I am trying to use the as.raster function of the raster package, but there is already a function with the same name in the grDevices package. So, I use the :: operator to differentiate between the two, but it doesn't appear to work. Can someone explain where I'm going wrong? Minimal working example below:
library("raster")
a <- matrix(1:15, ncol=3)
raster::as.raster(a)
Output:
Error in rgb(tx, tx, tx, maxColorValue = max) :
color intensity 6, not in [0,1]
This error message is for the grDevices version of the function.