image.asc: Displays a Color Image of a Matrix of Class 'asc'

Description Usage Arguments Note Author(s) See Also Examples

Description

These functions display a raster matrix of class asc.

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'asc'
image(x, col = gray((240:1)/256), clfac = NULL, ...)
## S3 method for class 'asc'
contour(x, ...)
## S3 method for class 'asc'
persp(x, ...)
## S3 method for class 'asc'
plot(x, ...)

Arguments

x

a matrix of class asc

col

for maps of type "numeric", the colors to be used (see help(par))

clfac

for maps of type "factor", a character vector giving the names of colors for each level of the factor (see help(colasc))

...

additional arguments to be passed to the generic function image, persp, contour, and filled.contour (but see below)

Note

The function plot.asc uses the function filled.contour. The output produced by filled.contour is actually a combination of two plots; one is the filled contour and one is the legend. Two separate coordinate systems are set up for these two plots, but they are only used internally - once the function has returned these coordinate systems are lost. If you want to annotate the main contour plot, for example to add points, you can specify graphics commands in the plot.axes argument of the function filled.contour (this argument is to be passed to the function plot.asc). An example is given below.

Author(s)

Clement Calenge clement.calenge@oncfs.gouv.fr

See Also

image, contour, persp, filled.contour, asc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
data(puechabon)

# Case of a continuous variable: the elevation
my.map <- getkasc(puechabon$kasc, "Elevation")
image(my.map, main = "Elevation in Puechabon")
contour(my.map, add = TRUE)

# use of the function plot.asc: adding points on the map
plot(my.map, plot.axes = {points(puechabon$locs[,c("X","Y")])},
     main = "Elevation")

# Case of a factor: the aspect
asp <- getkasc(puechabon$kasc, "Aspect")
cl <- colasc(asp, NorthEast = "blue", SouthEast = "red", 
             SouthWest = "orange", NorthWest = "green")

## graphical display
image(asp, clfac = cl, main = "Aspect", xlab = "Lambert X",
      ylab = "Lambert Y") 
legend(706500, 3162000, legend = levels(asp), fill = cl,
       cex = 0.7)


opar<-par(mar = c(0,0,3,0), bg = "slategray")
persp(my.map, scale = FALSE, box = FALSE, border = NA, shade = 0.75, 
      col = "darkolivegreen3", expand = 2, theta = -60, phi = 30, 
      main = "The topography of Puechabon")
par(opar)

ClementCalenge/adehabitat documentation built on May 6, 2019, 12:02 p.m.