Description Usage Arguments Details Value Warning Note Author(s) See Also Examples
The provided creator functions build the basic data structures of Vegsoup* objects from local R objects. Shorthand functions are provided to collect data files from a folder or build an object from a simple community matrix only, with dummy variables created for missing data structures (taxonomic reference list, sites data and/or coordinates). To simulate a data set an interface to the coenoflex package is provided.
Vegsoup(...)
is the recommended user interface rather than the direct
new("Vegsoup", ....)
call.
1 2 3 4 5 6 7 8 9 | Vegsoup(x, y, z, coverscale, group, sp.points, sp.polygons,
proj4string = "+init=epsg:4326", stringsAsFactors = TRUE,
verbose = FALSE)
coenoflex(i = 30, j = 20, gradients = 2, seed = NULL, ...)
plainsoup(m, coverscale, layer = "0l", verbose = TRUE)
instantsoup(folder, sep = ";", dec = ",", coverscale)
|
x |
object of class |
y |
object of class |
z |
object of class |
m |
object that can be coereced to as matrix with plots as rows and species as columns. |
layer |
layer code to be assigned. |
folder |
Path to a folder with three csv files. One file named |
coverscale |
Abundance scale of the observations. Possible choices include all
definitions given by |
group |
A-priori grouping, if any and can be missing. |
proj4string |
Projection attributes for slots 'sp.points' and 'sp.polygons'.
If missing set to |
sp.points |
Object of class |
sp.polygons |
Object of class |
stringsAsFactors |
Convert character strings in |
sep |
See |
dec |
See |
i, j, gradients |
number of plots ( |
seed |
set random number generator to make results from methods reproducible. |
... |
Additional arguments passed to coenoflex. |
verbose |
Show status reports during function call. |
Vegsoup()
is the constructor function to create a prototype
object of class Vegsoup
. The first four arguments
(x, y, z, coverscale
) have to be specified. However, if argument
'x'
inherits from class "SpeciesTaxonomy", argument 'z'
can be
left missing.
The creator function does not allow to specify all slots of an
Vegsoup*
object, but rather tries to guess some of it's contents.
For example, if the sites data has variables exactly named longitude and
latitude those will be used to extract coordinates from. For coordinates
conforming to proj4string = "+init=epsg:4326"
those have to be
formatted as decimal degrees! See e.g. char2dms
to convert
between formats.
Function plainsoup
is a utility function that demands on a community
matrix, but nothing more. This function is suitable if there is no further
information on sample plots (sites or environmental data) and the taxonomic
concept used.
In order to build a Vegsoup
object dummy values have to be created.
Note, those will not be informative! To be exact, the function will create
a single site variable named "X1"
with all values set to zero.
colnames(m)
are used as abbreviations (see abbr
) as well
as full scientific latin names (see Taxonomy
).
All observations are put on a single layer encoded by argument layer
.
Because the cover (abundance) scale can not be guessed from argument m
a suitable cover scale as object Coverscale
needs to be
assigned.
Function instantsoup
is a shorthand when data files are guaranteed to
conform to some format that can be interpreted by the import functions
stackSpecies
, respectively stackSites
or are valid to simple
calls to class creator methods species
, sites
and taxonomy
all with signature 'character'
. Arguments
'coverscale'
and 'decostand'
can be specified afterwards
if needed, defaults of class Vegsoup
apply otherwise.
The same is true for argument 'proj4string'
. The defaults for
argument 'group'
is to create a dummy integer variable of ones.
Function coenflex
creates a random community with one or two
gradients and specified size (number of species and ploits). The
coenocline
function in package coenocliner offers a complete
interface. coenocline
objects can be coerced to class Vegsoup
with the as(obj, "Vegsoup")
coerce method.
An object of class Vegsoup
.
All missing values that might result when casting y
will be replaced
by NA
!
If sp.points and/or sp.polygons arguments are supplied, the objects must have a column named plot.
When suppling argument proj4string
ensure that
CRS(proj4string)
works.
If you gain errors using instantsoup
, try to create separate objects
for classes Species
, Sites
and Taxonomy
. You may
also want to call "SpeciesTaxonomy"
for the first and last objects
mentioned. Defaults for sep
and dec
passed to read.csv
are set according to read.csv2
!
Package coenoflex is currently missing from CRAN.
Roland Kaiser
Vegsoup-class
as.matrix
coverscale
decostand
vegdist
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 29 30 31 32 33 34 35 36 37 38 39 | # load example data
data(barmstein)
( x <- barmstein )
# this will open a browser window
## Not run: quicklook(x)
# for demonstration rebuild objects from its components
X <- species(x)
Y <- stackSites(cbind(sites(x), coordinates(x)), schema = "rownames")
Z <- taxonomy(x)
( x <- Vegsoup(X, Y, Z, "braun.blanquet") )
# Vegsoup object from community matrix only
# the dune data set
# see ?SpeciesTaxonomy for a more complete case
require(vegan)
data(dune)
x <- plainsoup(dune, "domin")
# plot ordinations of simulated data
x <- coenoflex(100, 50)
plotPCO(x, thresh = 0.2)
plot(metaMDS(as.logical(x)))
# if we omit 'as-logical' and the default 'as.matrix' applies
plot(decorana(x))
# promote to ordinal scale
coverscale(x) <- "ordinal"
table(species(coenoflex())$cov)
# order and coerce to a sparse matrix representation
vegdist(barmstein) <- "bray"
decostand(barmstein) <- "wisconsin"
as(seriation(barmstein, method = "packed"), "sparseMatrix")
# R-mode using mode argument, one of 'Q' or 'R'
as(as.logical(barmstein, mode = "R"), "sparseMatrix")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.