Error when include code in x argument for mapview
Seems like it is using a quoted version of the object name in a file path but that doesn't work when there is code in the argument
mapview::mapview(raster::raster(matrix(1:100)))
Error in normalizePath(path.expand(path), winslash, mustWork) : path[1]="lib/raster::raster(matrix(1:100))_0c1be5-1": The filename, directory name, or volume label syntax is incorrect In addition: There were 45 warnings (use warnings() to see them)
Yeah, that error message stems from the leaflet package if I am not mistaken. Did you try with leaflet?
This worked in leaflet, in that it didn't have an error:
leaflet::leaflet()|> leaflet::addRasterImage(raster::raster(matrix(1:100), crs = "EPSG:3857"))
Could be that the error comes from leaflet but I am not familiar enough to trigger it there. You could catch it in mapview and give a more informative error message. Or maybe you can create an issue in leaflet if you know how to trigger it?
I'll try to look into it, but I don't have much time at the moment. A work around for the time being is to assign to a variable and use that in mapview