getBitacoraData: Get data from bitacora class

Description Usage Arguments Value Note Author(s) Examples

View source: R/imarpe-main.R

Description

This function read the information from the Programme of Fishery Logbooks (in spanish: Programa de Bitacoras de Pesca - PBP) and create a data base which includes a data frame and a list with the main features of the data frame. The included data frame object has observations corresponding to rows and variables to columns.

Usage

1
2
3
4
5
6
7
8
9
getBitacoraData(file, colTrip = "CODIGO_VIAJE", colPort = "PUERTO_SALIDA",
  colDateStart = "DIA_SALIDA", colDateOut = "DIA_ARRIBO",
  colSearchTime = "DURACION_BUSQUEDA",
  colStorageCapacity = "CAPACIDAD_BODEGA_REGISTRADA",
  colLat = "LATITUD_INICIAL", colLon = "LONGITUD_INICIAL",
  colHaul = "NUMERO_CALA", colHaulTotal = "TOTAL_CALAS",
  colCatchHaul = "CAPTURA_CALA", capAnch = "CAPTURA_ANCHOVETA",
  capSar = "CAPTURA_SARDINA", capJur = "CAPTURA_JUREL",
  capCab = "CAPTURA_CABALLA", capBon = "CAPTURA_BONITO")

Arguments

file

The name of the file. If it does not contain an absolute path, the file name is relative to the current working directory, getwd.

colTrip

Name of travel code column. By default is "CODIGO_VIAJE".

colPort

Name of the port column. By default is "PUERTO_SALIDA".

colDateStart

Name of data column with the start date of the travel. By default is "DIA_SALIDA".

colDateOut

Name of data column with the end date of the travel. By default is "DIA_ARRIBO".

colSearchTime

Name of the data column with the search time. By default is "DURACION_BUSQUEDA".

colStorageCapacity

Name of the data column with the storage capacity. By default is "CAPACIDAD_BODEGA_REGISTRADA".

colLat

Name of the data column with the latitude. By default is "LATITUD_INICIAL".

colLon

Name of the data column with the longitude. By default is "LONGITUD_INICIAL".

colHaul

Name of the data column with the fishing haul number. By default is "NUMERO_CALA".

colHaulTotal

Name of the data column with the total number of fishing hauls by travel. By default is "TOTAL_CALAS".

colCatchHaul

Name of the data column with the catch by fishing haul. By default is "CAPTURA_CALA".

capAnch

Name of the data column with the anchovy catches. By default is "CAPTURA_ANCHOVETA".

capSar

Name of the data column with the sardine catches. By default is "CAPTURA_SARDINA".

capJur

Name of the data column with the jack mackerel catches. By default is "CAPTURA_JUREL".

capCab

Name of the data column with the chub mackerel catches. By default is "CAPTURA_CABALLA".

capBon

Name of the data column with the bonito catches. By default is "CAPTURA_BONITO".

Value

data A data frame containing a representation of the data in the file.
info A list containing the main features of the data.

Note

If type is not explicitly defined, the function will be equivalent to use read.csv.

Author(s)

Criscely Lujan-Paredes, criscelylujan@gmail.com.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Read a example of data base
bitacoraData = system.file("extdata", "bitacoraData.csv", package = "imarpe")

# Create a object of bitacora class
bitacoraObject = getBitacoraData(file = bitacoraData)

# Check the class of bitacoraObject
class(bitacoraObject)

# To get the data of bitacora class
dataBase = bitacoraObject$data

# To get the main features of the data
info = bitacoraObject$info

imarpe/imarpe documentation built on Aug. 8, 2020, 8:40 p.m.