# NOT RUN {
## Importation of asc files: numeric
## Path of the file to be imported
(file1 <- paste(system.file(package = "adehabitat"),
"ascfiles/elevation.asc", sep = "/"))
el <- import.asc(file1)
image(el)
el
## Importation of asc files: factor
(file2 <- paste(system.file(package = "adehabitat"),
"ascfiles/aspect.asc", sep = "/"))
(levelfile <- paste(system.file(package = "adehabitat"),
"ascfiles/aspect.txt", sep = "/"))
asp <- import.asc(file2, lev = levelfile, type = "factor")
image(asp)
asp
## map of white noise
wafwaf <- matrix(rnorm(10000), 100, 100)
wafwaf <- as.asc(wafwaf)
image(wafwaf)
## exportation of a map
export.asc(wafwaf, "foo.asc")
## remove the created file:
file.remove("foo.asc")
# }
Run the code above in your browser using DataLab