Skip to content
/ batman Public

❗ This is a read-only mirror of the CRAN R package repository. batman — Convert Categorical Representations of Logicals to Actual Logicals. Homepage: https://github.com/ironholds/batman Report bugs for this package: https://github.com/ironholds/batman/issues

License

Notifications You must be signed in to change notification settings

cran/batman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NA N-A N/A Batman

batman is a package for taking representations of logical values commonly found in qualitative and categorical data, and mapping them to actual logical values.

In survey data and similar it's not uncommon to see logical values represented as things like:

  1. "Yes"
  2. "No"
  3. "N/A"

This is nice and all, but when you throw it into R...

> as.logical(c("Yes","No","N/A"))
[1] NA NA NA

batman maps common representations to actual logicals. It contains one core function, to_logical, designed to do just that:

> library(batman)
> to_logical(c("Yes","No", "N/A"))
[1]  TRUE FALSE    NA

The goal is to have it not only provide this functionality, but provide this functionality in an internationalised way - with support for as many languages as possible. If you're interested in contributing localised equivalents to TRUE or FALSE values, please open a GitHub isuse with your translations! You'll be credited in the DESCRIPTION file. See the contribution guidelines.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Installation

To get the release version:

> install.packages("batman")

To get the development version:

> library(devtools)
> install_github("ironholds/batman")

Dependencies

Other than base R, the only dependency is Rcpp, which we use for added speed when parsing strings (and it's worthwhile - the code can handle 700k strings in 137 milliseconds)

About

❗ This is a read-only mirror of the CRAN R package repository. batman — Convert Categorical Representations of Logicals to Actual Logicals. Homepage: https://github.com/ironholds/batman Report bugs for this package: https://github.com/ironholds/batman/issues

Resources

License

Stars

Watchers

Forks

Packages

No packages published