When compiling a03_VectorisingRcompadre.Rmd I get an error when using filter (but not if I replace with subset)
Error in storage.mode(x) <- "double" :
no method for coercing this S4 class to a vector
Calls: <Anonymous> ... withCallingHandlers -> withVisible -> eval -> eval -> filter
Why doesn't filter work for this?
The relevant chunk of code:
# add column 'check_NA_A', indicating whether matA contains missing values (T/F)
CompFlag <- cdb_flag(CompUnnest, checks = "check_NA_A")
# remove rows where matA contains missing values
CompSub <- subset(CompFlag, check_NA_A == FALSE)
# apply lambda() to every remaining matA
CompSub$lambda <- sapply(matA(CompSub), popdemo::eigs, what = "lambda")
When compiling
a03_VectorisingRcompadre.Rmd
I get an error when usingfilter
(but not if I replace withsubset
)Why doesn't filter work for this?
The relevant chunk of code: