-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
72 lines (55 loc) · 2.4 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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# starpolishr
This package allows for easy post polishing of latex [stargazer](https://cran.r-project.org/web/packages/stargazer/index.html)
output. See
[this vignette](https://github.com/ChandlerLutz/starpolishr/blob/master/vignettes/pdf/starpolishr-intro.pdf) for
a quick introduction. For examples, see the `Tables` section of my
papers [here](https://chandlerlutz.github.io/pdf/california-foreclosure-prevention-laws.pdf) and [here](https://chandlerlutz.github.io/pdf/local-labor-markets-canada-us.pdf). All of these tables were generated
exclusively within R using `stargazer` and `starpolishr`.
## Installation
You can install starpolishr from github with:
```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("ChandlerLutz/starpolishr")
```
## Quick Tips
* The first argument in all `starpolishr` functions is a
`stargazer` table, allowing for easy compatibility with
the
[magrittr](https://cran.r-project.org/web/packages/magrittr/index.html) `%>%`.
* All of the functions in the `starpolishr` package begin with
`star_` for easy `tab` completion in emacs or rstudio.
## Key Functions
Here is a list of key `starpolishr` functions in order of how often I
use them. See their help files for more details.
* `star_tex_notes` -- Adds custom notes using either the
latex [caption](https://www.ctan.org/pkg/caption) or the
latex [threeparttable](https://www.ctan.org/pkg/threeparttable).
* `star_tex_write` -- writes latex tables to a file and optionally
adds header files and common packages
* `star_lhs_names` and `star_rhs_names` -- updates variable names
using regular expressions. The advantage of these functions is that
they allow for variable names to span more than one line.
* `star_panel` -- panels multiple related `stargazer` tables into a
single latex table.
* `star_insert_row` -- insert a row after a given row in a `stargazer`
table
* `star_sidewaystable` -- converts a latex table to a latex
`sidewaystable`
* `star_add_column_numbers` -- if you pass a matrix to `stargazer`, it
won't add column numbers. This function will add column numbers to a
latex table.
## Authors
[Chandler Lutz](https://chandlerlutz.github.io/)
## License
GPL (>= 2)