-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
53 lines (35 loc) · 1.79 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
---
output:
md_document:
variant: markdown_github
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# snakecaser
The goal of snakecaser is to provide an RStudio add-in for converting a character string to snake case. I often want to do this when I create objects in R and want to name them with short descriptive phrases.
## Examples
"Here is some, rather simple, example text."
And here is what is looks like after the snakecaser add-in is used on it:
here_is_some_rather_simple_example_text
There is also a function, `to_snake_case()`, which can be called directly, independent of the RStudio add-in:
```{r example}
library(snakecaser)
to_snake_case("snakes are venomous, not poisonous!")
```
## Installation
This add-in can be installed with:
```{r eval=FALSE}
devtools::install_github("benmarwick/snakecaser")
```
## Related
[Tazinho/snakecase](https://github.com/Tazinho/snakecase): A very thorough and systematic package for converting strings to several different varieties of common cases.
[sfirke/janitor](https://github.com/sfirke/janitor): Contains numerous functions for examining and cleaning dirty data, including `clean_names()`, which is a thorough snake case converter.
[hrbrmstr/docxtractr](https://github.com/hrbrmstr/docxtractr/issues/7): For reading tables from Microsoft Word docx documents, has `mcga()` for making column names great by converting them to snake case. The direct inspiration for this add-in.
[decisionpatterns/lettercase](https://github.com/decisionpatterns/lettercase): Utilities for formatting strings with consistent capitalization, word
breaks and white space, including a snake case converter `lettercase::str_snake_case()`.