I have 12 raster files in a folder on which I want to use the levelplot of RasterVis.
kpacks <- c('tiff','rgdal','raster','sp','rasterVis')
new.packs <- kpacks[!(kpacks %in% installed.packages()[,"Package"])]
if(length(new.packs)) install.packages(new.packs)
lapply(kpacks, require, character.only=T)
remove(kpacks, new.packs)
options(max.print=5.5E5)
#World data
wlist <- list.files(pattern = "\\.tif$", include.dirs = TRUE)
s <- lapply(wlist, stack)
levelplot(s)
Error:
Error in UseMethod("levelplot") :
no applicable method for 'levelplot' applied to an object of class "list"
Note:
I can see the figure for individual geoTiff files:
levelplot(s[[1]]), for example
One of the files: https://www.dropbox.com/s/ank4uxjbjk3chaz/new_conus.tif?dl=0