Skip to content

Commit ad70a5e

Browse files
committed
changed chunk options and installation of traits package from CRAN to github
1 parent 097b7a3 commit ad70a5e

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

traits/03-access-r-traits.Rmd

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ The rOpenSci traits package makes it easier to query the TERRA REF trait databas
88

99
Install the traits package
1010

11-
The traits package is on CRAN, and can therefore be installed using the following command:
11+
The traits package can be installed through github using the following command:
1212

1313
```{r install_traits, echo = TRUE, message = FALSE}
14-
install.packages('traits', repos = 'http://cran.rstudio.com/')
14+
15+
if(packageVersion("traits") == '0.2.0'){
16+
devtools::install_github('ropensci/traits')
17+
}
18+
1519
```
1620

1721
Load other packages that we will need to get started.
@@ -44,7 +48,7 @@ The R traits package is an API 'client'. It does two important things:
4448

4549
Lets start with the query of information about Sorghum from species table from above
4650

47-
```{r query-species, echo = TRUE}
51+
```{r query-species, results = 'hide', echo = TRUE}
4852
4953
sorghum_info <- betydb_query(table = 'species',
5054
genus = "Sorghum",
@@ -69,7 +73,7 @@ options(betydb_key = readLines('.betykey', warn = FALSE),
6973

7074
Now the same query can be reduced to:
7175

72-
```{r query-species-reduce, echo = TRUE}
76+
```{r query-species-reduce, message = FALSE, echo = TRUE}
7377
sorghum_info <- betydb_query(table = 'species',
7478
genus = "Sorghum",
7579
limit = 'none')
@@ -78,7 +82,7 @@ sorghum_info <- betydb_query(table = 'species',
7882
### Time series of height
7983

8084
Now let's query some trait data.
81-
```{r canopy_height, echo = TRUE, results = FALSE}
85+
```{r canopy_height, echo = TRUE, message = FALSE}
8286
sorghum_height <- betydb_query(table = 'search',
8387
trait = "canopy_height",
8488
sitename = "~Season 2",

0 commit comments

Comments
 (0)