Description Usage Arguments Value Author(s) See Also Examples
The key function of the MADtraits package. When run with defaults,
it will download and build a database of species' traits from all
the manuscript sources in the package. *Please* make
use the the cache
feature, as it will massively speed and
ease your use of the package.
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 | MADtraits(cache, datasets, delay = 5)
## S3 method for class 'MADtraits'
print(x, ...)
## S3 method for class 'MADtraits'
summary(object, ...)
## S3 method for class 'MADtraits'
x[spp, traits]
species(x, ...)
traits(x, ...)
## S3 method for class 'MADtraits'
as.data.frame(
x,
row.names,
optional,
num.func = mean,
cat.func = function(x) names(which.max(table(x))),
data = 10,
...
)
|
cache |
Specify an existing directory/folder where datasets can be downloaded to and stored. If a dataset is already present in this directory, it will not be downloaded from the server but instead loaded locally. We *STRONGLY* advise you to specify a cache location. |
datasets |
Character vector of datasets to be searched for trait data. If not specified (the default) all trait datasets will be downloaded and returned. |
delay |
How many seconds to wait between downloading and
processing each dataset (default: 5). This delay may seem
large, but if you specify a |
x |
|
... |
ignored |
object |
|
spp |
|
traits |
|
row.names |
Ignored |
optional |
Ignored |
num.func |
To summarise data at the species level (which is
done by default), a function is needed to summarise the
continuous data at the species level. This argument specifies
this function; while the default is |
cat.func |
To summarise data at the species level (which is done by default), a function is needed to summarise the continuous data at the species level. This argument specifies this function; while the default is to just return the modal value, other options could be used. |
data |
Which variables to summarise into a data.frame. If
numeric, the top |
MADtraits.data object.
Will Pearse
clean.MADtraits convert.MADtraits.units lookup.MADtraits.species
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
# Download all MADtraits data, and cache (save) it on your hard-drive for use later
data <- MADtraits(cache="Documents/MADtraits/cache")
# Perform basic checks and cleaning on that data
clean.data <- clean.MADtraits(data)
# Subset data down to the traits you want (notice the comma position)
subset.data <- clean.data[,c("specific_leaf_area","height")]
# Subset data down to the species you want (notice the comma position)
subset.data <- clean.data[c("quercus_robur","quercus_ilex"),]
# Subset multiple things at once
clean.data[c("quercus_robur","quercus_ilex"),"specific_leaf_area"]
# Convert that into a data.frame for use in an analysis
neat.data <- as.data.frame(clean.data)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.