trace <- MigrationDetectR::example_trace
# Detect segments
segments <-
detect_segments(
locs = trace$location,
times = trace$timestamp,
param_min_days = 3,
param_prop_days = 0.06,
param_window_size_days = 7)
nrow(segments) # check the number of detected segments
migrations <-
identify_migrations(
segs = segments$segments,
locs = segments$locs,
min_res_length = 90,
occurrence_locs = trace$location,
occurrence_times = trace$timestamp
)
nrow(migrations) # check the number of identified migrations
head(migrations) # check the detected migrations
Run the code above in your browser using DataLab