Skip to content

Commit abd27c3

Browse files
committed
changed chunk parameters
1 parent 05155fb commit abd27c3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

traits/06-agronomic-metadata.Rmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Here are some key tables and fields that we will look at:
6363
| management_id | managements.id |
6464

6565

66-
```{r set-up, include = FALSE}
66+
```{r tutorial-06-set-up, include = FALSE}
6767
6868
library(dplyr)
6969
library(tidyr)
@@ -73,15 +73,15 @@ library(rgeos)
7373
library(leaflet)
7474
year <- lubridate::year
7575
76-
options(betydb_key = readLines('.betykey', warn = FALSE),
76+
options(betydb_key = readLines('traits/.betykey', warn = FALSE),
7777
betydb_url = "https://terraref.ncsa.illinois.edu/bety/",
7878
betydb_api_version = 'v1')
7979
8080
```
8181

8282

8383

84-
```{r}
84+
```{r 06_tibble, echo = TRUE, warning = FALSE}
8585
## query and join tables
8686
species <- betydb_query(table = "species") %>%
8787
select(specie_id = id, scientificname, genus)
@@ -124,7 +124,7 @@ Let's do the manual equivalent of a cross-table join. BETY actually does contain
124124

125125
The key idea here is that each treatment is associated with some (possibly many) managements, but the treatments table only reports the number of associated managements. To see the management IDs themselves, we need to query an individual treatment ID. So, we retrieve one table, then iterate over each row extracting the foreign keys for the other table. This requires an API call for every treatment, so beware that it is likely to be slow!
126126

127-
```{r}
127+
```{r 06_cross_join, echo = TRUE, results = 'hide'}
128128
treatments <- betydb_query(table = 'treatments') %>%
129129
select(treatment_id = id , name, definition, control)
130130

0 commit comments

Comments
 (0)