kasc2df: Conversion of Objects of Class kasc

Description Usage Arguments Value Author(s) See Also Examples

Description

An object of class kasc stores several maps in a data frame (one column per variable, and one row per pixel of the raster map). However, the features mapped are rarely rectangle-shaped, whereas the map are inevitably rectangles. Therefore, a lot of pixels of the maps do not contain data. The pixels of the map that do not contain data are NA in this data frame. kasc2df will "clean" the object of class kasc from these NAs, and will return a data frame containing only mapped values that can be used in subsequent analysis.
After these analyses, df2kasc may be used to convert the modified data frame to an object of class kasc for mapping (e.g. for maps of factorial axes, using dudi analyses, see help(dudi.pca)).

Usage

1
2
kasc2df(x, var = names(x))
df2kasc(df, index, x)

Arguments

x

an object of class kasc in kasc2df
an object of class kasc or mapattr in df2kasc

var

a character vector. The names of the variables in the kasc that are to be kept in the output

df

a data frame resulting from a computation of the component tab of the list previously returned by the function kasc2df (see section Value below). This computation may be any form of analysis (Principal component analysis, modelling techniques, etc.)

index

an integer vector giving the position of the rows of df in the returned kasc (such an index can be computed using kasc2df)

Value

kasc2df returns a list with the following components:

tab

a data frame without NAs, with a number of variables equals to length(var).

index

a vector of indices of the rows of the kasc kept for the analyses (that is, not NA).

df2kasc returns an object of class kasc.

Author(s)

Clement Calenge [email protected]

See Also

kasc for additional information on objects of class kasc.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data(puechabon)
kasc <- puechabon$kasc

# Display the kasc object
image(kasc)

# Preparation for Principal component analysis
x <- kasc2df(kasc)
x$tab <- x$tab[, (names(x$tab) != "Aspect")]

# Principal component analysis
ana <- dudi.pca(x$tab, scannf = FALSE)

s.corcircle(ana$co)
s.label(ana$li, clab = 0)


## Map of the scores of the rows
scores <- df2kasc(ana$li, x$index, kasc)
image(scores)

adehabitat documentation built on Jan. 28, 2018, 5:02 p.m.