sample_trips samples a random set of trips from data.

sample_trips(data, nsamples = 100L, min.links = NULL)

Arguments

data

A data frame of trips and their road level travel information, formatted as trips, see trips or data(trips); View(trips).

nsamples

The number of trips to sample. Default is 100.

min.links

The minimum number of links in each of the sampled trips.

Value

Returns a vector of tripID's of the sampled trips. Those trips are to be removed from the data, it is up to the user to do so.

Examples

if (FALSE) {

data(trips)
# sampling a 100 random trips with minimum of 10 links each.
index = sample_trips(trips, min.links = 10)
trips[trips$tripID %in% index, ]    # sub-setting based on sampled trips
}