Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions R/join.R
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
verbose = FALSE) {
# NSE vars
sdimz <- cell_ID <- sdimx <- sdimy <- name <- NULL

core_units <- c("cell", "spot")
n_gobjects <- length(gobject_list)
gobj_idx <- seq_len(n_gobjects)

Expand Down Expand Up @@ -538,7 +538,18 @@
set_defaults = FALSE
)

cx[][["list_ID"]] <- gname
if (spat_unit %in% core_units) {
if (nrow(cx[]) == 0) {
stop(sprintf("Core spat_unit '%s' has 0 rows, object is invalid.", spat_unit))

Check notice

Code scanning / lintr

Lines should not be more than 80 characters. This line is 102 characters. Note

Lines should not be more than 80 characters. This line is 102 characters.
}
} else {
if (nrow(cx[]) == 0) {
next # polygon units
}
}

cx[][["list_ID"]] <- rep(gname, nrow(cx[]))
#cx[][["list_ID"]] <- gname

Check notice

Code scanning / lintr

Remove commented code. Note

Remove commented code.
cx[][["cell_ID"]] <- paste0(gname, "-", cx[][["cell_ID"]])
gobj <- setGiotto(gobj, cx,
initialize = FALSE, verbose = FALSE
Expand Down Expand Up @@ -697,7 +708,11 @@
return_giottoPolygon = TRUE
)
spat_information_vector <- gpoly[]
spat_information_centroids <- centroids(gpoly)
spat_information_centroids <- tryCatch(
centroids(gpoly),

Check warning

Code scanning / lintr

no visible global function definition for 'centroids' Warning

no visible global function definition for 'centroids'
error = function(e) NULL
)
# spat_information_centroids <- centroids(gpoly)

Check notice

Code scanning / lintr

Remove commented code. Note

Remove commented code.

savelist_vector[[gobj_i]] <- spat_information_vector
savelist_centroids[[gobj_i]] <- spat_information_centroids
Expand Down
Loading