subset_by_time: subset_by_time

View source: R/subset_by_time.R

subset_by_timeR Documentation

subset_by_time

Description

This function take a databframe (e.g. from VMS_get_recs), and can return a subset of the original records, ensuring that each is at least some amount of time from the previous. Specifically, by providing a min_minutes, it will return only those records that are at least that amount of time apart.

Usage

subset_by_time(
  df = NULL,
  min_minutes = 15,
  time_field = "POSITION_UTC_DATE",
  group_field = "VR_NUMBER"
)

Arguments

df

the dataframe that should be subset

min_minutes

the default is 15. This is the minimum # of minutes that must separate successive records in df, for each group of data. By default, groups are identified by unique VR_NUMBERS.

time_field

the default is "POSITION_UTC_DATE". This is the name of the field that contains the time associated with the records. POSIXct fields are known to work.

group_field

the default is "VR_NUMBER". This is a field that identifies the group of positions that should be subset.

Value

a data.frame

Author(s)

Mike McMahon, Mike.McMahon@dfo-mpo.gc.ca

See Also

Other general_use: DDMMSS_to_DD(), DDMMx_to_DD(), aggregator(), clip_by_poly(), combine_lists(), df_qc_spatial(), df_sf_to_gpkg(), df_to_sf(), drop_cols(), prepare_shape_fields(), updateCheck()


Maritimes/Mar.utils documentation built on Feb. 12, 2024, 11:38 p.m.