[R] adehabitat raster import

helen.mills at yale.edu helen.mills at yale.edu
Sat Apr 10 04:05:52 CEST 2010


Hello all,
I'm new to adehabitat and am having trouble getting my ascii files into the r.
I have 45 environmental data layers that are all stored in a folder as ascii
files. Is there an easy way to pull in all 45 of my data layers into a kasc
dataframe. I'm not new to r or multivariate modeling, but the documentation
seems confusing.

I've experimented with bringing a few of them in 1 by 1 using the following, but
get stuck after that:
(file1 <- paste(system.file(package = "adehabitat"),
"ascfiles/annheat.asc", sep = "/"))
annheat<-import.asc(file1)
image(annheat)
annheat
(file2 <- paste(system.file(package = "adehabitat"),
"ascfiles/aquifer.asc", sep = "/"))
aquifer<-import.asc(file2)
image(aquifer)
aquifer
(file3 <- paste(system.file(package = "adehabitat"),
"ascfiles/aspect.asc", sep = "/"))
aspect<-import.asc(file3)

(aspect <- getkasc(kasc, "aspect"))
(aquifer <- getkasc(kasc, "aquifer"))
(annheat <- getkasc(kasc, "annheat"))



More information about the R-help mailing list