MyNixOS website logo
Description

Convert Categorical Representations of Logicals to Actual Logicals.

Survey systems and other third-party data sources commonly use non-standard representations of logical values when it comes to qualitative data - "Yes", "No" and "N/A", say. batman is a package designed to seamlessly convert these into logicals. It is highly localised, and contains equivalents to boolean values in languages including German, French, Spanish, Italian, Turkish, Chinese and Polish.

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)

Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD 13
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd13
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd13
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows