MyNixOS website logo
Description

Searchable Variable Explorer with Labelled Variables.

Creates a summary dataframe that can be used in 'RStudio' similar to the variable explorer in 'Stata', but which also includes the summary statistics. By default the result is shown in the 'RStudio' Viewer Pane as a searchable data table. This is useful particularly if you have a large dataset with a very large number of labelled variables with hard to remember names. Can also be used to generate a table of summary statistics.

varsExplore

Searchable variable explorer with labelled variables in RStudio's Viewer Pane

Install

From CRAN:

install.packages("varsExplore")

Development version:

devtools::install_github("vladtarko/varsExplore")

Basic usage

# import data
qog <- rio::import("http://www.qogdata.pol.gu.se/dataarchive/qog_std_cs_jan18.dta")

# create variable explorer in RStudio's View Pane
vars_explore(qog)

This will create a searchable variable explorer, and calculate summary statistics for each variable.

The table is searchable, and you can, furthermore, arrange it, say, based on which variable has least missing values. For instance, search for "GDP per capita" and see which variable provides most complete information.

If you click on the (+) next to a variable, you will get both the summary statistics, the unique values and, if present, the value labels. The option value.labels.width limits how many characters to include in the "Value labels" and "Values" columns. Default is 500.

If you set minimal = TRUE, only "Variable", "Description", "Obs.", and "Missing" will be shown (and none the summary stats will be calculated).

vars_explore(qog, minimal = TRUE)

If you set silent = FALSE the variable explorer will also return the dataframe of summary statistics.

qog_summary <- vars_explore(qog, silent = FALSE)

This can be used to make summary statistics tables, e.g. for a paper.

Acknowledgements

This was made possible by Reigo Hendrikson's datatable2: http://www.reigo.eu/2018/04/extending-dt-child-row-example/

As far as I know, Reigo hasn't made this available in a package. It is included in this package, with some minor modifications, and you can use it with varsExplore::datatable2().

Metadata

Version

0.3.0

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • 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