-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e61984
commit 4f3724d
Showing
7 changed files
with
160 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
Package: speedycode | ||
Type: Package | ||
Title: Automate Code for Adding Labels, Renaming Variables, and | ||
Converting ASCII Files | ||
Version: 0.2.0 | ||
Author: Jacob Harris | ||
Maintainer: Jacob Harris <jh2689@cornell.edu> | ||
Description: Label, rename, and convert datasets and ASCII files more efficiently. 'speedycode' automates the code necessary for labeling variables with the 'labelled' package, renaming variables with 'dplyr' syntax, and converting ASCII files with the 'readroper' package. Most functions require only the name of the dataset and the code will be automatically written. Some convenience functions useful for converting ASCII files are also included. | ||
Version: 0.3.0 | ||
Date: 2022-03-30 | ||
Title: Automate Code for Adding Labels, Recoding and Renaming | ||
Variables, and Converting ASCII Files | ||
Authors@R: person("Jacob", "Harris", role = c("aut", "cre"), | ||
email = "jh2689@cornell.edu") | ||
Author: Jacob Harris [aut, cre] | ||
Suggests: labelled, readroper | ||
Description: Label, recode, rename, and convert datasets and ASCII files more efficiently. 'speedycode' automates the code necessary for labeling variables with the 'labelled' package, recoding and renaming variables with 'dplyr' syntax, and converting ASCII files with the 'readroper' package. Most functions require only the name of the dataset and the code will be automatically written. Some convenience functions useful for converting ASCII files are also included. | ||
License: GPL-3 | ||
Imports: dplyr, stringr, purrr | ||
Suggests: labelled, readroper | ||
Encoding: UTF-8 | ||
NeedsCompilation: no | ||
Packaged: 2021-11-02 18:55:46 UTC; Jacob | ||
Packaged: 2022-03-31 00:44:24 UTC; Jacob | ||
Maintainer: Jacob Harris <jh2689@cornell.edu> | ||
Repository: CRAN | ||
Date/Publication: 2021-11-02 19:10:02 UTC | ||
Date/Publication: 2022-03-31 06:40:05 UTC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
b0b532a3e357b14061639ca343877b7a *DESCRIPTION | ||
7a2e90953688a4fd39c4223957d73ed3 *DESCRIPTION | ||
0b1727142e519c8fd70ea6b0de9aecc1 *NAMESPACE | ||
0501b441a19f84c69f0a97b8a581c8f8 *R/speedycode.R | ||
f67f4006daaf28fbbb03197e947b7200 *R/speedycode.R | ||
c5d8c08d3a23dfcbf7d5311215ebaa70 *man/debug_ascii.Rd | ||
04a28fc42f6914e493062e4b1857dc43 *man/speedy_classes.Rd | ||
3bffd122ef0df120dc61268b920bf589 *man/speedy_labels.Rd | ||
afa3ce618aecd5dbc1ebb992b20291ee *man/speedy_rename.Rd | ||
29ea5ff8d05971b9de1d357f4ad41b05 *man/speedy_classes.Rd | ||
668096b2594b72ed7893f273b141b1b7 *man/speedy_labels.Rd | ||
118495538a70396cd49432074c1fada0 *man/speedy_mutate.Rd | ||
98e5501f1ba55afb34ab606a99a3064d *man/speedy_rename.Rd | ||
451e1078f88e5a3ffd5b32c2d7e99d59 *man/speedy_varnames.Rd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
\name{speedy_mutate} | ||
\alias{speedy_mutate} | ||
%- Also NEED an '\alias' for EACH other topic documented here. | ||
\title{ | ||
Automate code for recoding variables with the 'mutate' and 'case_when' functions | ||
} | ||
\description{ | ||
`speedy_mutate` automates the code for quickly recoding variables with a large number of unique levels with `dplyr` syntax. The user only needs to supply the variable to recode and whether or not those variables should be quoted or not. | ||
} | ||
\usage{ | ||
speedy_mutate(data, var, var_classes = "sn", path = "") | ||
} | ||
%- maybe also 'usage' for other objects documented here. | ||
\arguments{ | ||
\item{data}{ | ||
Name of dataset | ||
} | ||
|
||
\item{var}{ | ||
String of the name of the variable being recoded | ||
} | ||
|
||
\item{var_classes}{ | ||
Specifies whether or not the current variable and the new variable being created should have quotes around them. There are four possible inputs ("ss", "sn", "nn", "ns"). "ss" means the current and new variable with both have quotes. "sn" means the first will have quotes and the second will not and so forth. | ||
} | ||
|
||
\item{path}{ | ||
If saving code to a new R script file, specify the file path here. Leave blank if not saving code. | ||
} | ||
} | ||
\details{ | ||
`speedy_mutate` generates a formatted chunk of the code for creating a new variable using the `mutate` and `case_when` functions. The code may be copied and pasted from the console or saved out to a separate R script. This is useful when a new variable needs to be created with many different levels based on the values in another variable. | ||
} | ||
\value{ | ||
Formatted code written with 'dplyr' syntax for recoding variables with `mutate` and `case_when`. | ||
} | ||
|
||
%% ~Make other sections like Warning with \section{Warning }{....} ~ | ||
|
||
\examples{ | ||
\dontrun{A simple applications is to add geographical FIPS codes to U.S. states} | ||
|
||
states <- as.data.frame(state.abb) | ||
speedy_mutate(data = states, var = "state.abb") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters