GetRange: Get Range

Description Usage Arguments Examples

Description

simple function to extract columns from data frame

Usage

1
GetRange(var, range = 1:8, df)

Arguments

var

variable of interest (e.g., V)

range

range of variables with same stem name (e.g., V1, V2, ..., V8) , Default: 1:8

df

data to extract from

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data <- as.data.frame(matrix(1:80,ncol=8))
GetRange("V", c(1,4), data)
#    V1 V4
# 1   1 31
# 2   2 32
# 3   3 33
# 4   4 34
# 5   5 35
# 6   6 36
# 7   7 37
# 8   8 38
# 9   9 39
# 10 10 40

bfw documentation built on May 2, 2019, 6:51 a.m.