-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.Rmd
75 lines (55 loc) · 1.6 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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
<!-- badges: start -->
[![R-CMD-check](https://github.com/dmurdoch/tables/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/dmurdoch/tables/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# tables
The goal of tables is to compute and display complex tables of summary statistics.
Output may be in LaTeX, HTML, plain text, or an R
matrix for further processing.
## Installation
You can install the release version of `orientlib` using
``` r
install.packages("tables")
```
You can install the development version of tables from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("dmurdoch/tables")
```
## Example
This is a basic example which shows you how to solve a common problem:
```{r example}
library(tables)
set.seed(123)
# In an R Markdown document, you don't want each table
# to output the HTML document header, so turn
# off that option:
table_options(htmloptions(head=FALSE))
X <- rnorm(125, sd=100)
Group <- factor(sample(letters[1:5], 125, replace = TRUE))
tab <- tabular( Group ~
(N=1) +
Format(digits=2)*X*
((Mean=mean) +
Heading("Std Dev")*sd)
)
# To print in plain text:
tab
# To format in HTML:
toHTML(tab)
```
```{r}
# To generate LaTeX code:
strsplit(toLatex(tab)$text, "\n")
```