View source: R/utility_functions.R
get_full_trajectories | R Documentation |
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.
get_full_trajectories(obj_name, span = 0.8, ...)
obj_name |
The input viewr object; a tibble or data.frame with attribute
|
span |
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
interest. The 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 span
= 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, span
s 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
direction
column.
Vikram B. Baliga
Other data cleaning functions:
gather_tunnel_data()
,
quick_separate_trajectories()
,
redefine_tunnel_center()
,
relabel_viewr_axes()
,
rename_viewr_characters()
,
rotate_tunnel()
,
select_x_percent()
,
separate_trajectories()
,
standardize_tunnel()
,
trim_tunnel_outliers()
,
visualize_frame_gap_choice()
Other functions that define or clean trajectories:
quick_separate_trajectories()
,
separate_trajectories()
,
visualize_frame_gap_choice()
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.