Specify a minimum span of the selected region of interest and then keep trajectories that are wider than that span and go from one end to the other of the region.
The input viewr object; a tibble or data.frame with attribute
Span to use; must be numeric and between 0 and 1
Additional arguments passed to/from other pathviewr functions
Because trajectories may not have observations exactly at the
beginning or the end of the region of interest, it may be necessary to allow
trajectories to be slightly shorter than the range of the selected region of
span parameter of this function handles this. By
supplying a numeric proportion from 0 to 1, a user may allow trajectories to
span that proportion of the selected region. For example, setting
= 0.95 will keep all trajectories that span 95% of the length of the
selected region of interest. Setting
span = 1 (not recommended) will
strictly keep trajectories that start and end at the exact cut-offs of the
selected region of interest. For these reasons,
spans of 0.99 to 0.95
are generally recommended.
A viewr object (tibble or data.frame with attribute
pathviewr_steps that includes
"viewr") in which only
trajectories that span the region of interest are retained. Data are
labeled by direction (either "leftwards" or "rightwards") with respect to
their starting and ending
position_length values in the
Vikram B. Baliga
Other data cleaning functions:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
motive_data <- read_motive_csv(system.file("extdata", "pathviewr_motive_example_data.csv", package = 'pathviewr')) ## Clean the file. It is generally recommended to clean up to the ## "separate" step before running select_x_percent(). motive_separated <- motive_data %>% relabel_viewr_axes() %>% gather_tunnel_data() %>% trim_tunnel_outliers() %>% rotate_tunnel() %>% select_x_percent(desired_percent = 50) %>% separate_trajectories(max_frame_gap = "autodetect", frame_rate_proportion = 0.1) ## Now retain only the "full" trajectories that span ## across 0.95 of the range of position_length motive_full <- motive_separated %>% get_full_trajectories(span = 0.95)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.