Skip to content

Commit 9e0a21e

Browse files
kimberlyh66dlebauer
authored andcommitted
update trait vignette (#170)
1 parent fa16108 commit 9e0a21e

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

vignettes/01-get-trait-data-R.Rmd

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ Our example will show how to query for season 6 data <!-- what is a season? need
2121

2222
### Getting Started
2323

24-
First, we will need to install and load the traits package from github, and load it into our environment, along with the other packages we will use in this tutorial.
24+
First, we will need to install and load the traits package from CRAN, and load it into our environment, along with the other packages we will use in this tutorial.
2525

2626
```{r traits-vig-pack, message = FALSE, results = FALSE}
27-
# devtools::install_github('terraref/traits', force = TRUE) # run once
27+
# install.packages('traits') # run once
2828
library(traits)
2929
library(ggplot2)
3030
library(lubridate)
@@ -40,15 +40,16 @@ The function that is used to query BETYdb is called `betydb_query`. To reduce th
4040

4141
```{r traits-vig-bety-opt}
4242
options(betydb_url = "https://terraref.ncsa.illinois.edu/bety/",
43-
betydb_api_version = 'v1')
43+
betydb_api_version = 'beta',
44+
betydb_key = '9999999999999999999999999999999999999999')
4445
```
4546

4647

4748
### Querying available traits
4849

4950
The TERRA REF database contains trait data for many other seasons of observation, and available data may vary by season. Here, we get a visual summary of available traits and methods of measurement for a season.
5051

51-
First we construct a general query for the Season 4 data. This returns all season 4 data. The function `betydb_query` takes as arguments `key = "value"` pairs which represent columns in the database to query. In this example, we `sitename` column for season 4 data, and set the limit to "none" to return all records. By default, the function will search all tables in the database. To specify a particular table you can use the `table` argument.
52+
First we construct a general query for the Season 4 data. This returns all season 4 data. The function `betydb_query` takes as arguments `key = "value"` pairs which represent columns in the database to query. In this example, we set `sitename` column for season 4 data, and set the limit to "none" to return all records. By default, the function will search all tables in the database. To specify a particular table you can use the `table` argument.
5253

5354
```{r traits-vig-s4-summary-get-trait, message = FALSE}
5455
# get all of season 4 data
@@ -72,12 +73,12 @@ Now we can create a plot of all of the trait data collected during season 4, inc
7273

7374
```{r traits-vig-s4-summary-plot-data, fig.height = 15, fig.width = 7}
7475
ggplot(data = season_4) +
75-
geom_point(aes(x = raw_date, y = mean, color = method_name)) +
76+
geom_point(aes(x = raw_date, y = mean, color = method_name), shape = '.') +
7677
geom_line(aes(x = raw_date, y = mean, group = cultivar, color = method_name)) +
77-
facet_wrap(~trait, ncol = 1, scales = "free_y") +
78+
facet_wrap(~trait, ncol = 4, scales = "free_y") +
7879
xlab("Date") +
7980
ylab("Mean trait value") +
80-
ggtitle("Season 6 data summary") +
81+
ggtitle("Season 4 data summary") +
8182
guides(color = guide_legend(title="Method", ncol = 1, title.position = "top")) +
8283
theme_bw() +
8384
theme(legend.position = "bottom")

0 commit comments

Comments
 (0)