as.data.frame.ASpaces: Convert ASPaces to Data Frame

Description Usage Arguments Details Value Author(s) Examples

View source: R/as.data.frame.Aspaces.R

Description

Coerces the Input Object of Class ASpaces to a Data Frame Object

Usage

1
as.data.frame.ASpaces(ASpaces, remove.notrip = TRUE)

Arguments

ASpaces

an object of class ASpaces

remove.notrip

logical. See details.

Details

This conversion function converts the ASpaces class composed of a relatively complex structure into a simple data.frame. The existing ASpaces class is divided into info and trips inside the data and is stored in a list form for each individual, so it is easy to distinguish between data but has a limitation that it is difficult to see at a glance.

This function converts to data.frame to make it easier to check. In this process, the conversion is performed in a way that the information of the corresponding info for each trip is connected equally.

Among the arguments, remove.notrip determines whether to keep the trip as it is or to delete it for an individual that does not exist. If set to TRUE, which is the default value, the relevant individuals are deleted, and if set to FALSE, the trip data of NA is attached to the information of personal info.

Value

An object of class data.frame

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)

#convert ASpaces into data.frame
df.slicedata <- as.data.frame.ASpaces(slicedata)

#compare with original data and result
slicedata@data[[1]]
df.slicedata[1:2, ]

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