library(baad.data)
library(tidyverse)
#> + ggplot2 2.2.1 Date: 2017-10-04
#> + tibble 1.3.4 R: 3.4.1
#> + tidyr 0.7.1 OS: Windows 10 x64
#> + readr 1.1.1 GUI: RTerm
#> + purrr 0.2.3 Locale: English_Australia.1252
#> + dplyr 0.7.2 TZ: America/New_York
#> + stringr 1.2.0
#> + forcats 0.2.0
#> -- Conflicts ----------------------------------------------------
#> * filter(), from dplyr, masks stats::filter()
#> * lag(), from dplyr, masks stats::lag()
baaddata <- baad_data()$data
baaddry <- baad_data()$dictionary
some_vars <- c(
"d.bh",
"family",
"latitude",
"longitude",
"m.so",
"species",
"vegetation"
)
some_vars_data <- baad_d[some_vars]
#> Error in eval(expr, envir, enclos): object 'baad_d' not found
some_vars_data
#> Error in eval(expr, envir, enclos): object 'some_vars_data' not found
some_vars_dictionary <- baaddry %>%
filter(variable %in% some_vars) %>%
select(variable, description) %>%
# shorten description to fit it in screen
mutate(description = stringr::str_trunc(description, 60))
some_vars_dictionary
#> variable description
#> 1 latitude latitude of location where sampled (-90 to 90 deg South t...
#> 2 longitude longitude of location where sampled (-180 to 180 West to ...
#> 3 vegetation vegetation type where sampled if grown in field (leave bl...
#> 4 species latin name of species (genus species)
#> 5 family family
#> 6 d.bh diameter of stem at breast height
#> 7 m.so mass of all above-ground structures (=m.lf + m.st)