I am trying to mosaic several rasters into single big raster in R. Using script that posted in https://stackoverflow.com/questions/15287807/how-can-i-create-raster-mosaic-using-list-of-rasters But, I have received a warning message and error message.
rasters1 <- list.files("F:\\MOD15A2_LAI_1km\\MOD15A2_LAI_2009",
pattern = "mod15a2.a2009001.*.005.*.img$",
full.names = TRUE, recursive = TRUE)
mos1 <-mosaic(rasters1, fun=mean)
It was reporting error as below
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘extent’ for signature ‘"character"’
Then I tried another version.
rasters1.mosaicargs <- rasters1
rasters1.mosaicargs$fun <- mean
But here some warning message as below
Warning message:
In rasters1.mosaicargs$fun <- mean : Coercing LHS to a list
I have ignored the message then continued
mos2 <- do.call(mosaic, rasters1.mosaicargs)
but here same error mentioned in as an above
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘mosaic’ for signature ‘"character", "character"’