trackROV | R Documentation |
Create a track object from a data.frame. Preferably, coordinates should be in a projected coordinate system (e.g. UTM).
create_track(coords, crs = NA, crs_from = NA)
write_track(x, filename, digits = 2, ...)
write_track_sf(x, filename, as_line = FALSE, ...)
get_coords(x, data.table = FALSE)
## S3 method for class 'track'
plot(x, select = NA, engine = "plotly", scale_axis = FALSE, ...)
copy_track(x)
coords |
A data.frame with the ROV data. See |
crs |
A object with coordinate reference system. Check |
crs_from |
If supplied, coordinates are converted from |
x |
'track' object |
filename |
Output file name. |
digits |
Number of digits to round data |
... |
further arguments passed to |
as_line |
logical. If TRUE, save features as lines, else save as points |
data.table |
logical. TRUE returns a data.table. FALSE returns a data.frame. |
select |
character, indicating which Dive to plot. Default to plot first dive. |
engine |
character, either "plotly" or "rdl". |
scale_axis |
logical, scale axis to avoid rounding error in the scene |
Use create_track
to create a 'track' object and apply filters.
Following functions can also be used:
write_track
- Save coordinates in text file.
write_track_st
- Save coordinates in shape file.
get_coords
- Get coordinates from a 'track' object.
copy_track
- Make a copy of the object.
plot
- 3D plot of the track using plotly
.
plot_tracks
- Save tracks of each dive as a html file.
set_dives
- Associate dives based on start and end timestamps.
Always use copy_track
to make a copy of the track object (e.g. track2 = copy(track1)
),
or else filters will be applied to both objects.
Possible filters include:
filter_depth
- Filter points based on depth
trim_track
- Remove points that are far away in the start or end of a track.
remove_outliers
- Remove points that are far away from adjacent points.
remove_stopped
- Detect cloud of points and remove them from the track.
distance_filter
- Distance threshold filter.
distance_filter_mean
- Distance threshold filter followed by mean.
rolling_mean
- Rolling mean filter.
simplify_filter
- Remove points using Douglas-Peuker Algorithm.
interpolate_points
- Interpolate points along track.
fill_time_gaps
- Create a point every second.
# Example with dummy track
data("simcoords")
track_dummy = create_track(simcoords) %>%
remove_outliers(n = 15, d = 4, select = "Dive1") %>%
rolling_mean(n = 15) %>%
remove_stopped(n = 61, p = 0.0004, d = 6, t=35)
plot(track_dummy)
track_dummy2 = track_dummy %>% copy_track() %>% # use \code{copy_track} or else filters will also affect track_dummy
distance_filter(d = 4)
plot(track_dummy2)
plot(track_dummy2, select = "Dive2")
write_track(track_dummy2, "track_clean.csv", digits = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.