Determines legs of an individual journey, by excluding jumps in location for consecutive measurements. Sorts the data by timestamp first. Allows the user to specify a threshold time and/or distance (optionally with individual values per method used) below which the segments are considered as part of the same journey. Assigns a unique journey ID to each identified individual journey. Writes the output for each agent to a *.kml file with summary statistics for that (leg of the) journey (total duration, total distance, minimum speed, maximum speed, average speed, method used and origin & destination x and y coordinates).
1 2 3 4 5 6 7 8 | identifyJourneys(inputPath, inputName = "Cleaned_Agent",
agentID = "agentID", timeStamp = "ts", origin = c("from_locx",
"from_locy"), destination = c("to_locx", "to_locy"),
method = "method_desc", duration = "duration", distance = "distGeo",
methodThreshold = NA, durThreshold = 100, distThreshold = 100,
ignoreMethodChanges = FALSE, ignoreStops = FALSE,
outputPath = paste(inputPath, "JourneyData/", sep = ""),
outputName = "Journeys")
|
inputPath |
character; the path to the folder where the input *.csv files are located |
inputName |
character (optional); select only file names which contain the string specified; default is "Cleaned_Agent" |
agentID |
character; name of the column containing the agent IDs; default is "agentID" |
timeStamp |
character; name of column containing the numeric time stamp of the measurements for each agent (should contain date and time); default is "ts" |
origin |
character; name of column containing c(x, y) coordinates; default is c("to_locx","to_locy") |
destination |
character; name of column containing c(x, y) coordinates; default is c("from_locx","from_locy") |
method |
character; name of column containing method of transportation used; default is "method" |
duration |
character; name of column containing duration of (leg of) journey in seconds; default is "duration" |
distance |
character; name of column containing distance of (leg of) journey in meters; default is "distGeo" |
methodThreshold |
character vector (optional); vector of the names of the methods ("car", "notfoundinindex", "pedestrian", "unknown", "bicycle", "publicTransport") in the order their method-specific duration and/or distance thresholds will be supplied; default is NA |
durThreshold |
integer (optionally vector); threshold duration in seconds below which observations are considered to belong to the same journey; if methods are specified in methodThreshold, can supply method-specific duration thresholds as an integer vector; set to NA to select only based on distance threshold; if both are supplied, only one of the conditions needs to be met; default is 100 |
distThreshold |
integer (optionally vector); threshold distance in meters below which observations are considered to belong to the same journey; if methods are specified in methodThreshold, can supply method-specific distance thresholds as an integer vector; set to NA to select only based on duration threshold; if both are supplied, only one of the conditions needs to be met; default is 100 |
ignoreMethodChanges |
boolean (optional); ignore method changes when identifying potential legs of the same journey; must be FALSE if specifying methodThresholds; default is FALSE |
ignoreStops |
boolean (optional); disregard stationary moments when identifying potential legs of the same journey; default is TRUE |
outputPath |
character (optional); the path to the folder to write the output *.csv and *.kml files to, set to NA to not write output files; default is the inputPath |
outputName |
character (optional); if outputPath is not NA, will prefix the output filenames ("Agent-ID#.extension") with this; default is "Journeys", set to NA to just have the AgentIDs |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.