lsm2multifit | R Documentation |
this function was designed to shape the data as expected by multifit()
, merging the outputs from calc_lsm()
and some biological data to be used as reponse variables.
lsm2multifit(
lsm,
biodata = NULL,
level = NULL,
metrics = NULL,
class = NULL,
id.col = "site"
)
lsm |
a data frame from |
biodata |
a dataframe with response variables; see euglossini example data frame |
level |
The level to extract the metric; must be "landscape" or "class". |
metrics |
The metric to be extracted from |
class |
The class to extract the value if level is "class" |
id.col |
the column of the biodata that has the site id as the |
a data frame in wide format with a single value of a given metrics for each scale
Wilson Frantine-Silva
## Not run:
#For "landscape" level metrics
lsmdata <- calc_lsm(decouple(r,p,c(1000,2000,3000)), metric = "shdi")
d2multi <- lsm2multifit(lsm = lsmdata, biodata=euglossini,
level="landscape", metrics ="shdi")
head(d2multi)
scales <- colnames(d2multi)[grepl("X", colnames(d2multi))]
multifit(mod = "lm", multief = scales,
formula = Abundance ~ multief, data = d2multi,
criterion = "R2", plot_est = FALSE)
#For "class" level metrics
lsmdata <- calc_lsm(decouple(r,p,c(1000,2000,3000)), level = "class", metric = "pland")
biodata <- euglossini
d2multi <- lsm2multifit(lsm = lsmdata, biodata=euglossini, level="class", class=3, metrics ="shdi")
head(d2multi)
#' scales <- colnames(d2multi)[grepl("X", colnames(d2multi))]
multifit(mod = "lm", multief = colnames(d2multi)[grepl("X", colnames(d2multi))],
formula = Abundance ~ multief, data = d2multi,
criterion = "R2", plot_est = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.