multi_sub {demcon}R Documentation

Multiple Column Subset

Description

Multiple Column Subset

Usage

multi_sub(dat, key.dat, vars = names(key.dat))

Arguments

dat

A data.table to be subsetted.

key.dat

A data.table containing multiple columns used to index and subset dat.

vars

Character string of columns in key.dat to be used for subsetting.

Value

A data.frame, data.table subsetted by key.dat.

Examples



cow_index<-demcon::cow_index()
names(cow_index)[1]<-"COWcode"
dat <- demcon::get_vdem()

dat <- demcon::multi_sub(dat, cow_index, vars = c("COWcode", "year"))


[Package demcon version 0.3.0 Index]