ecodata.Rd
Load a dataset directly to an R object, save it as file, or both.
ecodata(subdiscipline, topic, dataset, path) # S4 method for missing,missing,missing,missing ecodata() # S4 method for character,missing,missing,missing ecodata(subdiscipline) # S4 method for character,character,missing,missing ecodata(subdiscipline, topic) # S4 method for character,character,character,missing ecodata(subdiscipline, topic, dataset) # S4 method for character,character,character,character ecodata(subdiscipline, topic, dataset, path)
subdiscipline | A string containing the name of an ecological discipline |
---|---|
topic | A string containing the name of an analytical topic |
dataset | A string containing the name of a dataset |
path | A string containing the path to save the data file |
An R object
This function is used to load one of the static or dynamic datasets provided by the package. It can be either loaded directly into R as an object, or it can be saved to a file by specifying the path parameter, or both.
# Try running the ecodata() without any arguments. You'll get some information # about valid options for the first parameter. data <- ecodata::ecodata()#> A list of subdisciplines. Choose one for the first parameter: #> #> "Quantitative Ecology" #> QE Description #> #> "Spatial Ecology" #> SE Description #>#> NULL# Repeat this process until we get data data <- ecodata::ecodata("Quantitative Ecology")#> A list of topics for Quantitative Ecology. Choose one for the second parameter: #> #> "Distributions" #> Data for various statistical distributions #> #> "Generalized Linear Models" #> #> #> "Occupancy" #> #># Instead of NULl this time, we get the information that was printed out. It may # or many not be useful to store in a variable for later reference without having # to run the function again. head(data)#> topic description #> 2 Distributions Data for various statistical distributions #> 3 Generalized Linear Models #> 4 Occupancy# Repeat this process until we get data data <- ecodata::ecodata("Quantitative Ecology", "Distributions")#> A list of topics for Quantitative Ecology and Distributions. Choose one for the third parameter: #> #> "Normal Random Sets" #> A data frame containing several sets of normally distributed random numbers #>#> dataset #> 2 Normal Random Sets #> description #> 2 A data frame containing several sets of normally distributed random numbers#> m0_sd1 m1_sd1 m1_sd2 m2_sd2 #> 1 -1.400043517 0.6632850 0.66750763 4.24123130 #> 2 0.255317055 0.7841598 1.24043707 2.79979531 #> 3 -2.437263611 1.6211323 -0.32346862 0.03094468 #> 4 -0.005571287 -0.2840265 -0.06124515 0.99487563 #> 5 0.621552721 -0.3000924 0.39716259 3.97429688 #> 6 1.148411606 0.6232305 -0.20460321 6.38296202# This particular data set is actually dynamically generated. This means that # running it again should produce different results. data <- ecodata::ecodata("Quantitative Ecology", "Distributions", "Normal Random Sets") head(data)#> m0_sd1 m1_sd1 m1_sd2 m2_sd2 #> 1 -0.7733135 2.90029082 0.2108509 -0.5081599 #> 2 3.4805397 0.19312233 -3.3071172 1.7408031 #> 3 -0.6174220 -0.39633665 -0.7425115 2.8749540 #> 4 0.5207824 0.02515786 0.8773875 0.4820917 #> 5 0.5925403 1.43501099 -2.6091138 3.5131325 #> 6 -0.9003468 0.24952342 3.2440206 0.7082751