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,
  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.

fn.oracle.username

default is '_none_' This is your username for accessing oracle objects. For this function, it needs SELECT privileges on MFD_OBFMI.VMS_ALL.

fn.oracle.password

default is '_none_' This is your password for accessing oracle objects.

fn.oracle.dsn

default is '_none_' This is your dsn/ODBC identifier for accessing oracle objects.

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.

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 bothe 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 Feb. 12, 2024, 11:38 p.m.