MyNixOS website logo
Description

Test, Identify, Select and Mutate Categorical or Continuous Values.

Methods and utilities for testing, identifying, selecting and mutating objects as categorical or continous types. These functions work on both atomic vectors as well as recursive objects: data.frames, data.tables, tibbles, lists, etc..

catcont

Test For and Identify Categorical or Continuous Values

CRAN_Status_Badge License

This collection of methods and utilities allows for a working with vectors at a higher level abstraction, i.e. by whether they are categorical (nominal) or continous. The functions allow for testing, identifying, selecting, mutating,etc. and work with both atomic vectors and recursive objects (table and list-like) objects in a tidyverse compliant way.

Installation

You can install from CRAN with:

install.packages("catcont")

You can install catcont from github with:

# install.packages("devtools")
devtools::install_github("decisionpatterns/catcont")

Example

Tests

is_cat(letters)          # TRUE
is_cat(factor(letters))  # TRUE
is_cat(TRUE)             # TRUE
is_cat(FALSE)            # TRUE
is_cat(1:10)             # FALSE
is_cat(rnorm(10))        # FALSE
is_cat( Sys.Date() )     # FALSE
is_cat( complex(1,2) )   # FALSE
 
is_cont(letters)         # FALSE
is_cont(factor(letters)) # FALSE
is_cont(TRUE)            # FALSE
is_cont(FALSE)           # FALSE
is_cont(1:10)            # TRUE
is_cont(rnorm(10))       # TRUE
is_cont( Sys.Date() )    # TRUE
is_cont( complex(1,2) )  # TRUE
 

 

Identification

# Atomic 
cat_cont(1:10)
cat_cont(letters)
 
# Recursive 
cat_cont(iris)
 
which_cat(iris)
which_cat( iris, names=TRUE )
  
which_cont(iris)
which_cont( iris, names=TRUE )

Selection

iris %>% select_cat()
iris %>% select_cont()

Mutation

iris %>% mutate_if_cat(...)
iris %>% mutate_if_cont(...)
Metadata

Version

0.5.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    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-freebsd
  • 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-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows