-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
69 lines (47 loc) · 1.53 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
---
title: "README"
author: "Sara Colom"
date: "`r Sys.Date()`"
output:
github_document:
df_print: kable
---
This repo contains the source function to generate one or two-way cross tab summary stats on the fly with `var_summarise()`
# Installation
Make sure you have `devtools`, `credentials` and `remotes` already installed and loaded. Also be sure to be active on the **UCSF VPN**.
- `install.packages("devtools")`
- `install.packages("credentials")`
- `install.packages("remotes"`
- `library(devtools)`
- `library(credentials)`
- `library(remotes)`
Steps are commented out below beneath its description.
```{r}
#set config
# usethis::use_git_config(user.name = "YourName", user.email = "your@mail.com")
#Go to github page to generate token
# usethis::create_github_token()
#paste your PAT into pop-up that follows...
# credentials::set_github_pat()
#now remotes::install_github() will work
# remotes::install_github("ucsf-bhhi/SummaryTable")
```
# Examples
This package was created to generate summary statics tables for one to two-cross tabs on the fly. You need to provide a data set with the variables you want to summarise.
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
Read in library
```{r}
library(SummaryTable)
library(dplyr)
```
## Example
### Data: iris
This is the output for `Sepal.Width` a continuous variable w/o stratification. Without any other sepcification, the function spits out the mean and SD.
```{r}
var_summarise(dat = iris, var = "Sepal.Width")
```