VMS_from_MARFIS: VMS_from_MARFIS

View source: R/VMS_from_MARFIS.R

VMS_from_MARFISR Documentation

VMS_from_MARFIS

Description

This function takes a dataframe (with coordinate fields in decimal degrees), and extracts asssociated VMS data

Usage

VMS_from_MARFIS(
  df = NULL,
  cxn = NULL,
  fn.oracle.username = "_none_",
  fn.oracle.password = "_none_",
  fn.oracle.dsn = "_none_",
  usepkg = "rodbc",
  data.dir = NULL,
  VR_field = "VR_NUMBER",
  LIC_field = "LICENCE_ID",
  GC_field = "GEAR_CODE",
  LANDED_field = "LANDED_DATE",
  look_ahead_days = 7,
  lat.field = NULL,
  lon.field = NULL,
  make_segments = TRUE,
  make_segments_spatial = FALSE
)

Arguments

df

a dataframe to be analyzed.

cxn

A valid Oracle connection object. This parameter allows you to pass an existing connection, reducing the need to establish a new connection within the function. If provided, it takes precedence over the connection- related parameters.

fn.oracle.username

Default is '_none_'. This is your username for accessing Oracle objects. If you have a value for oracle.username stored in your environment (e.g., from an rprofile file), this can be left out and that value will be used. If a value for this is provided, it will take priority over your existing value. Deprecated; use cxn instead.

fn.oracle.password

Default is '_none_'. This is your password for accessing Oracle objects. If you have a value for oracle.password stored in your environment (e.g., from an rprofile file), this can be left out and that value will be used. If a value for this is provided, it will take priority over your existing value. Deprecated; use cxn instead.

fn.oracle.dsn

Default is '_none_'. This is your DSN/ODBC identifier for accessing Oracle objects. If you have a value for oracle.dsn stored in your environment (e.g., from an rprofile file), this can be left out and that value will be used. If a value for this is provided, it will take priority over your existing value. Deprecated; use cxn instead.

usepkg

default is 'rodbc'. This indicates whether the connection to Oracle should use 'rodbc' or 'roracle' to connect. rodbc is slightly easier to setup, but roracle will extract data ~ 5x faster. Deprecated; use cxn instead.

data.dir

the default is NULL. If you are hoping to load existing data, this folder should contain a data folder containing your rdata files. For this function, only MARFLEETS_LIC will be used, and only to add gear and licenced species onto each record.

VR_field

the default is "VR_NUMBER"

LIC_field

the default is "LICENCE_ID"

GC_field

the default is "GEAR_CODE"

LANDED_field

the default is "LANDED_DATE"

look_ahead_days

the default is 7

lat.field

the default is NULL. This is the name of the field holding latitude values (in decimal degrees)

lon.field

the default is NULL. This is the name of the field holding longitude values (in decimal degrees)

make_segments

the default is TRUE. This indicates whether or not the results should include an sp object of all of the VMS data as lines (in addition to a data frame)

make_segments_spatial

the default is FALSE. This indicates whether or not a shapefile should be created of all of the VMS data as lines (in addition to a data frame). make_segments must be TRUE for shapefiles to be generated.

Value

a list containing a data.frame called "marf_VMS" of the joined marfis/VMS data, and, if make_segments is TRUE, an sp object called "marf_VMS_segments". Additionally, if make_segments and make_segments_shp are both TRUE, a shapefile will be created in the working directory.

Author(s)

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


Maritimes/Mar.utils documentation built on April 5, 2025, 1:47 p.m.