subset: Subsets the Input object of Class ASpaces

Description Usage Arguments Details Value Author(s) Examples

View source: R/subset.R

Description

Extract ASpace objects with characteristics that meet given conditions from ASpaces

Usage

1
subset(x, condition, vars, all = TRUE, showProgress = TRUE)

Arguments

x

an object of class ASpaces

condition

a list that indicate characteristics.

vars

an optional character vector. See details.

all

logical. See details.

showProgress

logical. If TRUE, a progress bar appears on the R console while iterating.

Details

subset function is a function that refines a given ASpaces class object.

ASpace classes contain the characteristics of the activity space subject in the info slot, and subset function extracts only ASpaces that meet the given conditions based on the characteristics of#' this info slot and returns them to ASpaces.

'condition' is entered in the form of a list, and the ASpace of the corresponding condition is extracted by entering each desired condition in the list (i.e., list(var1 = x, var2 = y))

'vars' are used to refine the information in the resulting ASpace's info slot. When a specific character vector is input to 'vars', the info slot of ASpace resulting from the function has only the input variables. If 'vars' is not input, the result is same with the original info slot.

'all' determines whether to extract only the results that satisfy all of them when various conditions are given in the 'condition', or to extract the results that apply at least one. The default value is set to extract only when all conditions are satisfied as true.

Value

An object of class ASpaces

Author(s)

Changlock Choi (hihi7100@khu.ac.kr), Seong-Yun Hong (syhong@khu.ac.kr)

Examples

1
2
3
4
5
6
7
8
9
# load data
data(slicedata)

# subsetting ASpaces
subsetasp1 <- subset(slicedata, condition = list(sex = 1))
subsetasp2 <- subset(slicedata, condition = list(sex = 1, hhsize = 4))
subsetasp3 <- subset(slicedata, condition = list(sex = 1, hhsize = 4), 
                     all = FALSE)
                     

syunhong/slice documentation built on Feb. 7, 2021, 4:55 p.m.