Description Usage Arguments Value Author(s) See Also Examples
getascattr
copies the attributes of an object of class asc
to another matrix of the same size.
getkascattr
performs the same operation for objects of class
kasc
.
1 2 | getascattr(xfrom, xto, type = c("numeric", "factor"), lev = NULL)
getkascattr(xkfrom, xkto)
|
xfrom |
an object of class |
xto |
a matrix with the same number of rows and columns
as |
type |
a character string giving the type of the map
( |
lev |
if |
xkfrom |
an object of class |
xkto |
a data frame with the same number of rows and columns
as |
getascattr
returns a raster matrix of class asc
,
getkascattr
returns a data frame of class kasc
Clement Calenge clement.calenge@oncfs.gouv.fr
kasc
for additionnal information on objects of
class kasc
, asc
for additionnal information on
objects of class asc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | data(puechabon)
## my.map is a map of elevation
my.map <- getkasc(puechabon$kasc, "Elevation")
sl <- getkasc(puechabon$kasc, "Slope")
attributes(sl) <- NULL
sl <- matrix(sl, ncol = ncol(my.map))
## sl is a matrix with the same size as my.map
toto <- getascattr(my.map, sl)
image(toto)
## Same rationale with aspect
asp <- getkasc(puechabon$kasc, "Aspect")
le <- levels(asp)
attributes(asp) <- NULL
asp <- matrix(asp, ncol = ncol(my.map))
## asp is now a matrix with the same size as my.map
tutu <- getascattr(my.map, asp, typ = "factor", lev = le)
cl <- colasc(tutu, NorthEast = "blue", SouthEast = "red",
SouthWest = "orange", NorthWest = "green")
image(tutu, clfac = cl)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.