speedy_classes {speedycode}R Documentation

Automate code for changing variable classes

Description

'speedy_classes' automates the code for changing variable classes for many variables at time. The default is for each variable to be saved back to the its original class so the new classes are the only required input. Variables that do not need to be changed may be kept or removed from the code.

Usage

speedy_classes(data, path = "")

Arguments

data

name of dataset

path

If saving code to a new R script file, specify the file path here. Leave blank if not saving code.

Details

'speedy_classes' automates the code for changing the classes of a large number of variables at once. The code may be copied and pasted from the console or saved out to a separate R script. The 'dplyr' package is not required to run the package, but the automated code uses 'dplyr' syntax so you will need to load it to run the code.

Value

Formatted code written with 'dplyr' syntax for changing the classes of all variables in a dataset. The automated code maintains the original class for each variable so the only required input is a different class for the variables that need it. You can run the entire code chuck created by 'speedy_classes' without changing anything in the generated code.

Author(s)

Jacob Harris

Examples

speedy_classes(data = iris)

## Not run: speedy_classes(data = iris, path = "~/INPUT-FILE-PATH")


[Package speedycode version 0.3.0 Index]