dot-locate: Find Individual's Location by Time

Description Usage Arguments Value Author(s) See Also Examples

Description

Find where an individual is located at a specific time during continuous trip

Usage

1
.locate(trip, id, at, na.rm, silent)

Arguments

trip

an object of data.frame containg person's continuous trip.

id

a vector of length 1, indicating person's ID

at

a numeric vector of length 1, specifying the time at which the location of an individual needs to be extracted

silent

logical. If TRUE, if any trip records have NAs in the time fields, a warning message will be provided.

Value

a single row data.frame containing correspond with 'at'

Author(s)

Seong-Yun Hong (syhong@khu.ac.kr)

See Also

slice

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#creates sample trip data
testtrip <- data.frame(tr_id = 1:10, tr_seq = rep(NA, 10), purpose = rep(NA, 10),
                      mode = rep(NA, 10), o_type = rep(NA, 10), 
                    o_time = c(200,300,400,500,600,700,800,900,1000,1100),
                    o_zone = c(1,2,3,4,5,6,5,4,3,2),
                    d_type = rep(NA, 10),
                    d_time = c(300,400,500,600,700,800,900,1000,1100,1200),
                    d_zone = c(2,3,4,5,6,5,4,3,2,1))
                    
#Find where at 800 via .locate
.locate(testtrip, 1, 600, na.rm = TRUE, silent = FALSE)

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