View source: R/ReadData-function.R
Adds individual x and y coordinate columns (for both 'from' and 'to' locations; the latter is calculated as the origin of the next observation, since currently the origins and destinations are identical), day of the week, decimal time of day, duration, unique agent ID column, geodesic and haversine distances between origin and destination locations (since the current distance column only has 0 values due to origin and destination coordinates being the same), and speeds (in km/h) based on the calculated distances and durations. Removes all entries with duration = 0, since they seem to be duplicate entries. Optionally can be used to select only a specific date range.
1 2 |
inputPath |
character; the path to the folder where the json files are located |
minDate |
integer (optional); YYMMDD of minimum observation date to include; default is NA |
maxDate |
integer (optional); YYMMDD of maximum observation date to include; default (currently) is 160131, set to NA to exclude |
saveOutput |
boolean (optional); write out the data frame with the added columns; default is TRUE |
outputPath |
character (optional); the path to the folder where the updated json files should be saved if saveOutput is set to TRUE; default will create a subdirectory in the input directory called "BasicData" |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.