Description Usage Arguments Details Value Author(s) See Also Examples
Coerces the Input Object of Class ASpaces to a Tracks Object
1 | as.Tracks(x, sp, varname)
|
x |
an object of class ASpace |
sp |
an object of class sp used in x |
varname |
name of the column in sp's data.frame which can be matched |
Function as.Track
accepts converts ASpace
objects
to an onject of class Tracks
. When converting a single ASpace
object, unlike the ASpaces
class, there is basically no sp given, so
it is essential to enter the sp argument.
Also, since the input of the time is fixed to the POSIXct
or
POSIXt
class in the Tracks
class, attention is needed that the
existing time format is changed to the type of the corresponding class.
An object of class Tracks
Seong-Yun Hong (syhong@khu.ac.kr)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
# creates sample info data
testinfo <- list()
# 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))
#constructs an object of class 'ASpace'
testASpace <- new("ASpace", info = list(id = 1), trip = testtrip)
testTracks <- as.tracksCollection(testASpace, varname = "adm_dr_cd")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.