aoles / EBImage

:art: Image processing toolbox for R
70 stars 28 forks source link

Image subsetting fails when called from Rscript #31

Closed aoles closed 6 years ago

aoles commented 6 years ago

The following script fails when executed through Rscript. The reason for this is that methods package is not being loaded by Rscript.

library(EBImage)

x = readImage(system.file("images", "sample-color.png", package="EBImage"))
x[1:100, 1:100, ]
Error in slot(x, ".Data") : could not find function "slot"
Calls: [ -> [ -> eval.parent -> eval -> eval
Execution halted

To circumvent this load the methods package through a call to library(methods).