@@ -127,32 +127,42 @@ writeLines('9999999999999999999999999999999999999999',
127127 con = '~/.betykey_public')
128128```
129129``` {r traits}
130- terraref_test_url <- "https://terraref.ncsa.illinois.edu/bety-test/"
131-
132- betykey <- readLines('~/.betykey_public', warn = FALSE)
130+ terraref_test_url <-
131+ public_betykey <-
133132
134133```
135134
135+ ### Our first Query
136+
136137``` {r simulated-LAI}
137138sorghum_lai <- betydb_query(table = 'search',
138139 trait = "LAI",
139140 api_version = 'beta',
140141 limit = 5000,
141- betyurl = terraref_test_url ,
142- key = betykey )
142+ betyurl = "https://terraref.ncsa.illinois.edu/bety-test/" ,
143+ key = readLines('~/.betykey_public', warn = FALSE) )
143144
144- #traits <- betydb_query(table = "traits",
145- # api_version = 'beta',
146- # limit = 5000,
147- # betyurl = terraref_test_url,
148- # key = betykey)
145+ ```
149146
147+ Notice all of the arguments? We can change this by setting the default options
150148
151149
150+ ``` {r}
151+ options(betydb_key = readLines('~/.betykey_public', warn = FALSE),
152+ betydb_url = "https://terraref.ncsa.illinois.edu/bety-test/",
153+ betydb_api_version = 'beta')
152154```
153155
154- ``` {r}
156+ Now the same query can be reduced to:
155157
158+ ``` {r eval=FALSE}
159+ sorghum_lai <- betydb_query(table = 'search',
160+ trait = "LAI",
161+ limit = 5000)
162+ ```
163+
164+
165+ ``` {r}
156166ggplot(data = sorghum_lai) +
157167 geom_smooth(aes(x = lubridate::yday(lubridate::ymd_hms(raw_date)), y = mean, color = as.factor(lubridate::year(lubridate::ymd_hms(raw_date)))), span = 0.5) +
158168# scale_x_datetime(date_breaks = '6 months', date_labels = "%b %Y") +
0 commit comments