MyNixOS website logo
Description

Creating Tables of Excluded Observations.

Instead of counting observations before and after a subset() call, the ExclusionTable() function reports the number before and after each subset() call together with the number of observations that have been excluded. This is especially useful in observational studies for keeping track how many observations have been excluded for each in-/ or exclusion criteria. You just need to provide ExclusionTable() with a dataset and a list of logical filter statements.

R-CMD-check CRAN status

Description

This package provides an exclusion table in R with which you can keeping track of inclusion and exclusion criteria that you apply to your datasets. Using the exclusion_table() function you can obtain a table listing the number of excluded observation for each inclusion and exclusion criteria. Additionally, if you use the option keep_data == TRUE you can also obtain the dataset without the excluded observations.

Quick Example

This is a quick example to illustrate what ExclusionTable offers. We will use the penguins dataset included in the {palmerpenguins} package for the example. So make sure you install the package before running the example below.

# Load Penguine dataset
library(palmerpenguins)

# Apply some exclusions
exclusion_table(penguins, 
                exclusion_criteria = c("year == 2007", 
                                       "sex  == 'male'",
                                       "bill_length_mm <= 40 & 
                                       !is.na(bill_length_mm)"),
                labels_exclusion   = c("Measured in 2007",
                                       "Males",
                                       "Bill length <= 40mm"))

The code above produces the following table, which offers a nice overview of the number of observations that were removed from the dataset for each exclusion criteria.

================================================
Excluded the following observations:
================================================
Exclusions based on EXCLUSION criteria

            exclusion n_prior n_post n_excluded
1    Measured in 2007     344    234        110
2               Males     234    114        120
3 Bill length <= 40mm     114     66         48
4               TOTAL     344     66        278

================================================

Please take a look at the vigniett on my website for more information on how to use the {ExclusionTable} package.

Installation

You can download the latest release of this package from CRAN using install.packages(ExclusionTable) or the latest development version using {remotes}.

remotes::install_github("entjos/ExclusionTable")
library(ExclusionTable)

Bugs

If you find any bugs or have any suggestions please don't hesitate to file an issue on GitHub or contact me via my website, Twitter or email.

Metadata

Version

1.1.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