Closed celsomilne closed 1 year ago
When trying to create a SegmentedCells object from a table (i.e. output from a dplyr operation), an error is raised:
SegmentedCells
dplyr
> library(spicyR) > set.seed(51773) > x <- round(c(runif(200),runif(200)+1,runif(200)+2,runif(200)+3, > runif(200)+3,runif(200)+2,runif(200)+1,runif(200)),4) > y <- round(c(runif(200),runif(200)+1,runif(200)+2,runif(200)+3, > runif(200),runif(200)+1,runif(200)+2,runif(200)+3),4) > > cellType <- factor(paste('c',rep(rep(c(1:2),rep(200,2)),4),sep = '')) > imageID <- rep(c('s1', 's2'),c(800,800)) > > cells <- data.frame(x, y, cellType, imageID) > cells <- tibble::as_tibble(cells) > > cellExpr <- SegmentedCells(cells, cellTypeString = "cellType") Error in if (xi > xj) 1L else -1L : missing value where TRUE/FALSE needed In addition: Warning message: In Ops.factor(xi, xj) : ‘>’ not meaningful for factors
Should tibbles be coerced to a data.frame before when they are passed to SegmentedCells?
data.frame
hmmm... looks like it. I'll have a look and see if I can figure out if I can make it accept both, or I might just convert tibbles at the data cleaning step.
When trying to create a
SegmentedCells
object from a table (i.e. output from adplyr
operation), an error is raised:Should tibbles be coerced to a
data.frame
before when they are passed toSegmentedCells
?