This repository has been archived by the owner on May 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
README.Rmd
96 lines (72 loc) · 2.26 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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
eval = FALSE
)
options(help_type = "text")
```
# tl
[![Travis build status](https://travis-ci.org/ropenscilabs/tl.svg?branch=master)](https://travis-ci.org/ropenscilabs/tl)
[![Codecov test coverage](https://codecov.io/gh/ropenscilabs/tl/branch/master/graph/badge.svg)](https://codecov.io/gh/ropenscilabs/tl?branch=master)
The goal of tl is to provide an R equivalent to the tldr command line tool, a community-contributed set of quick reference guides for R functions.
> "Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away" - Antoine de Saint-Exupéry
Briefly forgotten how a function works?
Don't want to scroll through a long help file to find the example usage?
You need tl;dr!
## Installation
You can install the current version of tl from [github](https://github.com) with:
```{r install}
devtools::install_github("ropenscilabs/tl")
```
## Examples
Here are some basic examples of how to use tl:
Use the `dr` function to find a help page
```{r dr_example1}
tl::dr(lm)
```
> ```r
> fits a linear model
>
> - fits a linear model of y dependent on x1 and x2
> m1 <- lm(y ~ x1 + x2)
>
> - fits on data in data frame df
> m1 <- lm(y ~ x1 + x2, data = df)
>
> - fits model of y on categorical variable xc
> m1 <- lm(y ~ as.factor(xc), data = df)
>
> - print model
> summary(m1)
> ```
```{r dr_example2}
tl::dr(tidyr::gather)
```
> ```r
> tidyr::gather
>
> converts data from wide to long
>
> - collapse columns x1 to x5 into 5 rows
> gather(data, key = "key", value = "value", x1:x5)
>
> - collapse all columns
> gather(data, key = "key", value = "value")
> ```
Page you are looking for does not exist?
Use the `create_page` function to make one! Please follow the instructions to keep it brief.
```{r create_page_example}
tl::create_page(base::system.file)
```
Want to submit your new page to the `tl` package?
Use the `submit_page` function to get instructions on how to add your help page to `tl`.
```{r submit_page_example}
tl::submit_page(base::system.file)
```