-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path01-intro.Rmd
More file actions
99 lines (70 loc) · 3.61 KB
/
01-intro.Rmd
File metadata and controls
99 lines (70 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Package List and First Steps{#intro -}
## Getting R{-}
If you have never used or heard of `R` before,
I suggest you start by reading about [data science in `R`](http://r4ds.had.co.nz/) and [installing RStudio](https://www.rstudio.com/products/rstudio/download/#download).
Only once you have done that can we continue.
## The `rethomics` packages{-}
Rethomics works as a collection of interconnected packages.
Here is a list of all our packages so far (as well as their individual PDF documentation, description and status).
```{r kable, echo=FALSE}
packages <- c("behavr",
"ggetho",
"damr",
"scopr",
"sleepr",
"zeitgebr"
)
titles <- sapply(packages,
function(p){
if(!p %in% rownames(installed.packages()))
return("Unavailable")
packageDescription(p, fields="Title")
}
)
package_name <- sprintf("[%s](https://github.com/rethomics/%s)", packages, packages)
doc <- sprintf("[](https://github.com/rethomics/%s/raw/master/%s.pdf)", packages, packages)
travis_ci <- sprintf("[](https://travis-ci.org/rethomics/%s)", packages,packages,packages)
coverage <- sprintf("[](https://codecov.io/github/rethomics/%s?branch=master)", packages, packages, packages)
cran_img <- sprintf('http://www.r-pkg.org/badges/version/%s',packages)
cran_url <- sprintf('https://cran.r-project.org/package=%s',packages)
cran <- sprintf("[](%s)", cran_img,cran_url)
cran_log_img <- sprintf('https://cranlogs.r-pkg.org/badges/%s',packages)
cran_log_url <- sprintf('https://www.rdocumentation.org/packages/%s',packages)
cran_log <- sprintf("[](%s)", cran_log_img,cran_log_url)
# `scopr` [](https://travis-ci.org/rethomics/scopr)[](https://codecov.io/github/scopr/behavr?branch=master)
titles <- stringr::str_replace(titles, "\n", " ")
library(knitr)
knitr::kable(data.frame(
Package = package_name,
Doc = doc,
Description = titles,
Travis = travis_ci,
Coverage = coverage,
CRAN = cran
#CRAN.log = cran_log
),
row.names = FALSE)
```
## Installation{-}
### CRAN{-}
You may have noticed, in the table above, that some packages are on the CRAN (the official `R` package repository).
Therefore, we can use `R`'s default tools to install them.
For instance, `behavr`, can simply be installed with:
```{r, eval=FALSE}
install.packages("behavr")
```
### devtools{-}
For packages that are not on CRAN, or if you want the very latest snapshot of a package, you can use `devtools`.
First, install and load it:
```{r, eval=FALSE}
install.packages("devtools")
library(devtools)
```
You should see a warning message saying something like `"GitHub repo contains submodules, [...]"`, which is fine.
Beyond that, ensure you have *no error messages*. `devtool` is a package that simplifies installation of unofficial packages (for instance hosted on github) like `rethomics` ones.
To install `behavr`, you would run:
```{r, eval=FALSE}
install_github("rethomics/behavr")
```
In the same way, you could install other `rethomics` packages by changing `"behavr"` for another package name.
For instance, you could install `ggetho` with `install_github("rethomics/ggetho")`.