MyNixOS website logo
Description

Panel Data Wrangling Tools.

Leading/lagging a panel, creating dummy variables, taking panel differences, looking for panel autocorrelations, and more. Implemented via a 'data.table' back end.

panelWranglR

Travis buildstatus Lifecycle:stable License: GPLv3 CRANstatus

panelWranglR is a simple package for wrangling panel data.

Installation

You can install the stable version of panelWranglR from CRAN with

install.packages("panelWranglR")

The latest version is also available from github using the devtools package

devtools::install_github("JSzitas/panelWranglR")

Introduction

The goal of panelWranglR is to provide simple functions that take care of common panel data wrangling needs, such as lagging a panel, differencing a panel (including selections of variables from a panel), finding correlations/autocorrelations in a panel, and so on. For a full list of all of the available functionality, please refer to the documentation.

Example

Let’s start by lagging a whole panel of data, using 5 lags.

# example data: 
    X <- matrix(rnorm(800000),8000,100)
    tim <- seq(1:4000)
    geo_AT <- rep(c("AT"), length = 4000)
    geo_NO <- rep(c("NO"), length = 4000)
    both_vec_1 <- cbind(tim,geo_NO)
    both_vec_2 <- cbind(tim,geo_AT)
    both <- rbind(both_vec_1,both_vec_2)
    X <- cbind(both,X)
    colnames(X) <- c("time", "geo", paste("V", 1:100, sep = "")) 

library(panelWranglR)

    panel_lag( data = X, 
               cross.section = "geo",
               time.variable = "time",
               lags = 5 )    
    

Or maybe we want to turn the cross section variable into several dummy variables:

panel_dummify( data = X,
               cross.section = "geo" )

We can do that for the time variable too (though it is not recommended with many time ‘levels’!)

Further functionality follows the same general syntax and usage (and documentation hopefully clears up any misunderstandings.)

Contributing

If you would like to contribute a pull request, please do contribute! All contributions will be considered for acceptance, provided they are justifiable and the code is reasonable, regardless of anything related to the person submitting the pull request. Please keep things civil - there is no need for negativity. Also, please do refrain from adding unnecessary dependencies (Ex: pipe) to the package (such pull requests as would add an unnecessary dependency will be denied/ suspended until the code can be made dependency free).

Metadata

Version

1.2.13

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