vms_clean {dafishr} | R Documentation |
Fixing dates and column names
Description
This function cleans raw Vessel Monitoring System, VMS, data column files,
eliminate NULL values in coordinates, parse dates, and returns a data.frame
.
Usage
vms_clean(path_to_data)
Arguments
path_to_data |
it can be a path to the file downloaded or the data object itself.
If function is used with a path it adds a |
Details
It takes a raw data file downloaded using the vms_download()
function by
specifying directly its path or by referencing a data.frame already stored as an R object.
If path is used, column with the name of the raw file is conveniently added as future reference.
It also split date into three new columns year
, month
, day
, and retains the original date
column.
This function can be used with apply
functions over a list
of files or it can be paralleled using furrr
functions.
Value
A data.frame
Examples
# Using sample dataset, or a data.frame already stored as an object
# It is possible to use a path directly as argument
data("sample_dataset")
cleaned_vms <- vms_clean(sample_dataset)
head(cleaned_vms)