문제

Does anyone have any tips about how to share raster layers (or a part of it) in forums like this? I'd like to ask a question and give some reproducible data but I'm not sure what is the best way to do it.

Thanks a lot in advance!

도움이 되었습니까?

해결책

stackoverflow, gis.stackexchange, r-sig-geo and the examples in the manuals of sp and the raster package and other packages are full of examples how to do that. Here are some:

library(raster)
# example files
f1 <- system.file("external/test.grd", package="raster")
r <- raster(f1)
f2 <- system.file("external/rlogo.grd", package="raster")
b <- brick(f2)

# create your own 
x <- raster(nrow=18, ncol=36)
values(x) <- runif(ncell(x))
y <- raster(nrow=10, ncol=10, xmn=0, xmx=10, ymn=0, ymx=10, crs='+proj=utm +zone=2')
values(y) <- 1:ncell(y)

다른 팁

Answer given by Frede Aakmann Tøgersen.

For geographical data 'data(meuse.grid)' can be used as an example.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top