View source: R/makeUsedAvail.R
makeUsedAvail | R Documentation |
Make a used-available data frame from a presence-absence type data.
makeUsedAvail(x, ...)
## Default S3 method:
makeUsedAvail(x, y, ...)
## S3 method for class 'formula'
makeUsedAvail(formula, data = parent.frame(), ...)
x |
a matrix or data frame. |
y |
a vector with 0/1 entries, 1s are taken as used observations. |
formula |
two sided model formula of the form |
data |
data. |
... |
other arguments. |
The function returns a data frame, where used and available portions of
the input data are bound on top of each other, the first column
refers to y
, where used (1) and available (0) locations are
indicated different from the input values.
All locations in the input data are treated as available (0),
while only nonzero observations in y
are treated as used (1).
Peter Solymos
(x <- data.frame(species=rep(1:0,each=4), var1=1:8, var2=11:18))
makeUsedAvail(species ~ var1 + var2, x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.