-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadme.Rmd
99 lines (64 loc) · 2.97 KB
/
readme.Rmd
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
---
output: github_document
editor_options:
chunk_output_type: console
---
# SileR
This is the GitHub repository hosting the R package SileR. The package will not
evolve much in the future because it aims at documenting how we obtained the
results for the paper entitled "Differences in age-specific mortality
between wild-caught and captive-born Asian elephants" by Mirkka Lahdenperä,
Khyne U Mar, Alexandre Courtiol and Virpi Lummaa ([Nature Communications 2018](https://rdcu.be/39Sp)).
The only planned updates are those that will be necessary to maintain
compatibility with other packages, so that our code won't break.
The main goal of the R package SileR is to fit survival models derived from a
model introduced by Siler ("A competiting-risk model
for animal mortality", Ecology, 1979). The main differences are that the
effect of covariate(s) are being investigated and that the survival models
have to be fitted on right and left censored longitudinal data.
This package has not been conceived for general use. It serves to document the
steps of our analysis.
## How to explore the sources of the package?
To see our source code, you can either browse the files above within GitHub or
download the *.tar.gz file containing all sources bundled with some data to
try out our functions in R.
This file is available here: https://github.com/courtiol/drat/blob/gh-pages/src/contrib/SileR_0.9.0.tar.gz
## Installation
Since the package contains C++ code that needs to be compiled, there are two
possibilities for installation. The easiest one is to install the binary version
of our package. We have created one for Windows and one for MacOS but that may
fail depending on your exact infrastructure. The alternative is to compile the
sources of the package on your own computer but that may require you to install
some development tools.
### General installation requirements
Whichever option you choose, to install successfully the R package you will need:
* an up-to-date installation of R (https://cran.r-project.org);
* the R package ```drat``` installed. You can install it by typing:
```{r, eval = FALSE}
install.packages("drat")
```
### Installation from binaries
Simply type the following:
```{r, eval = FALSE}
drat::addRepo("courtiol")
install.packages("SileR")
```
### Installation from sources
This option requires the tools allowing to compile R packages on your computer:
* if you are using Linux, you should already have them;
* if you are using MacOS, you need to install Xcode (available from https://developer.apple.com/xcode/) if you have not done it;
* if you are using Windows, you need to install Rtools (available from https://cran.r-project.org/bin/windows/Rtools/) if you have not done it.
Then, simply type the following:
```{r, eval = FALSE}
drat::addRepo("courtiol")
install.packages("SileR", type = "source")
```
## Usage
1. load the package:
```{r, eval = FALSE}
library("SileR")
```
2. access the main documentation by typing:
```{r, eval = FALSE}
help("SileR")
```