Skip to content

Commit 3b7020d

Browse files
committed
removed references to public key and made minor spacing edits
1 parent 413fff1 commit 3b7020d

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

traits/03-access-r-traits.Rmd

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,34 @@ theme_set(theme_bw())
2828
library(dplyr)
2929
```
3030

31-
Create a file that contains your API key. If you have signed up for access to the TERRA REF database, your API key will have been sent to you in an email. The public key will provide access to all metadata; you will need a personal key _and_ permissions to access the trait data. If you receive empty (NULL) datasets, it is likely that you do not have permissions.
31+
Create a file that contains your API key. If you have signed up for access to the TERRA REF database, your API key will have been sent to you in an email. You will need this personal key _and_ permissions to access the trait data. If you receive empty (NULL) datasets, it is likely that you do not have permissions.
3232

3333
```{r writing-key, echo = TRUE}
3434
# This should be done once with the key sent to you in your email
35-
# writeLines('abcdefg_rest_of_key_sent_in_email',
35+
36+
# Example:
37+
#writeLines('abcdefg_rest_of_key_sent_in_email',
3638
# con = '.betykey')
3739
38-
# Example with the public key:
39-
writeLines('9999999999999999999999999999999999999999',
40-
con = '.betykey_public')
4140
```
4241

42+
4343
#### R - using the traits package
4444

4545
The R traits package is an API 'client'. It does two important things:
4646
1. It makes it easier to specify the query parameters without having to construct a URL
4747
2. It returns the results as a data frame, which is easier to use within R
4848

49-
Lets start with the query of information about Sorghum from species table from above
49+
Lets start with the query of information about Sorghum from the species table
5050

5151
```{r query-species, results = 'hide', echo = TRUE}
5252
5353
sorghum_info <- betydb_query(table = 'species',
54-
genus = "Sorghum",
55-
api_version = 'v1',
56-
limit = 'none',
57-
betyurl = "https://terraref.ncsa.illinois.edu/bety/",
58-
key = readLines('.betykey', warn = FALSE))
54+
genus = "Sorghum",
55+
api_version = 'v1',
56+
limit = 'none',
57+
betyurl = "https://terraref.ncsa.illinois.edu/bety/",
58+
key = readLines('.betykey', warn = FALSE))
5959
6060
```
6161

@@ -64,7 +64,6 @@ sorghum_info <- betydb_query(table = 'species',
6464
Notice all of the arguments that the `betydb_query` function requires? We can change this by setting the default connection options thus:
6565

6666

67-
6867
```{r 03-set-up, echo = TRUE}
6968
options(betydb_key = readLines('.betykey', warn = FALSE),
7069
betydb_url = "https://terraref.ncsa.illinois.edu/bety/",

0 commit comments

Comments
 (0)