SmartProject: SmartProject Class

Description Format Value Fields Methods Examples

Description

The SmartProject class implements the main class of smartR package.

Format

R6Class object.

Value

Object of R6Class with attributes and methods to fullfill a complete analisys with the SMART approach.

Fields

rawDataSurvey

Stores the raw survey data after being populated by loadSurveyLFD() method.

yearInSurvey

Stores the distinct years in the rawDataSurvey time-serie.

specieInSurvey

Stores the distinct species in the rawDataSurvey time-serie.

surveyBySpecie

Stores a list of SurveyBySpecie objects, one for each species in the time-series.

rawDataFishery

Stores the raw fishery data as is in the provided csv file. The attribute is populated by loadFisheryLFD() method.

yearInFishery

Stores the distinct years in the rawDataFishery time-serie.

specieInFishery

Stores the distinct species in the rawDataFishery time-serie.

fisheryBySpecie

Stores a list of FisheryBySpecie objects, one for each species in the time-series.

gooLstCoho

Stores a list of plots of species cohorts spatial distribution .

sampMap

Stores the environment object.

fleet

Stores the FishFleet object.

simProd

Stores the simulated pattern of production.

simEffo

Stores the simulated pattern of effort.

simBanFG

Stores a vector of fishable/banned fishing grounds.

simSpatialCost

Stores the simulated pattern of spatial costs.

simEffortCost

Stores the simulated pattern of effort costs.

simProdCost

Stores the simulated pattern of production costs.

simTotalCost

Stores the simulated pattern of total costs.

simRevenue

Stores the simulated pattern of revenue by species and fishing ground.

simTotalRevenue

Stores the simulated pattern of total revenues.

simCostRevenue

Stores the simulated pattern of costs and revenues.

simResPlot

Stores the plots with the simulation' results.

outGmat

Stores the evolution of gains during the simulation.

outOptimEffo

Stores the resulting pattern of effort.

outWeiProp

Stores the annual proportion of fish by cohort and fishing ground.

outWeiPropQ

Stores the seasonal proportion of fish by cohort and fishing ground.

Methods

setCostInput()

This method is used to setup the required data for costs computation

setInProduction()

This method is used to setup the required data for production costs computation

setDaysAtSea()

This method is used to compute the number of Days at Sea of each vessel

setEffortIndex()

This method is used to compute the value of the Effort Index

setProductionIndex()

This method is used to compute the value of the Production Index

getHarbFgDist()

This method is used to compute the weighted average distance of every fishing ground to each harbour

setFgWeigDist()

This method is used as helper function to get the weighted average distance between fishing ground and harbours

setRegHarbBox()

This method is used to compute the distance of each harbour to every fishing ground centroid

loadSurveyLFD(csv_path)

This method is used to load the raw survey LFD data from a csv file

loadFisheryLFD(csv_path)

This method is used to load the raw fishery LFD data from a csv file

setYearSurvey()

This method is used to store the distinct year in the survey time-series

setYearFishery()

TThis method is used to store the distinct year in the fishery time-series

loadMap(map_path)

This method is used to load the Environmental Grid and initialize the Environment object

createFleet()

This method is used to initialize the Fleet object

setSpecieSurvey()

This method is used to store the distinct species in the survey dataset

setSpecieFishery()

This method is used to store the distinct species in the fishery dataset

splitSpecieSurvey()

This method is used to split the survey dataset by species

splitSpecieFishery()

This method is used to split the fishery dataset by species

addSpecieSurvey(sing_spe)

This method is used to initialize a new surveyBySpecie object

addSpecieFishery(sing_spe)

This method is used to initialize a new fisheryBySpecie object

setSpreaFishery()

This method is used to prepare the fishery LFD data for MCMC analysis

setSpatFishery()

This method is used to setup the plot with the spatial distribution of the fishery dataset

setSpreaSurvey()

This method is used to prepare the survey LFD data for MCMC analysis

setSpatSurvey()

This method is used to setup the plot with the spatial distribution of the survey dataset

setDepthSurvey()

This method is used to assign the depth of each survey tow

setStratumSurvey()

This method is used to assign a depth stratum to each survey tow

setAbuAvgAll()

This method is used to compute the spiecies abundances at each survey stratum

setMeditsIndex()

This method is used to compute the MEDITS index

setStrataAbu()

This method is used to compute the weighted number of individuals of each size in every stratum

loadFleeEffoDbs(effort_path, met_nam, onBox = TRUE, perOnBox = 1)

This method is used to extract the vms data from one or more vmsbase DB

ggplotRawPoints(year)

This method is used to plot the raw vms points

ggplotFgWeigDists()

This method is used to plot the weighted average distance between harbours and fishing grounds

setAvailData()

This method is used to gather the required data for the spatial clustering

predictProduction(specie)

This method is used to compute the estimated production

simProdAll(selRow = numeric(0))

This method is used to compute the simulated production

genSimEffo(method = "flat", selRow = numeric(0), areaBan = numeric(0))

This method is used to create a simulated pattern of effort

getSimSpatialCost()

This method is used to compute the simulated spatial costs

getSimEffortCost()

This method is used to compute the simulated effort costs

getSimProdCost()

This method is used to compute the simulated production costs

getSimTotalCost()

This method is used to collect all the simulated costs

getSimRevenue(selRow = numeric(0), timeScale = "Year")

This method is used to compute the simulated revenues

getLWstat()

This method is used to compute the length/weight statistics for each fishing ground

simulateFishery(thr0 = 100, effoBan = numeric(0), timeStep = "Year")

This method is used to simulate one year of fishing

setSimResults()

This method is used to store the results of a simulation run

ggplotFishingPoints(year)

This method is used to plot the fishing points

setCellPoin()

This method is used assign a cell to each vms point

setTrackHarb()

This method is used to assign the harbour to each fishing trip

setFishGround(numCut)

This method is used to setup the fishing ground configuration

addFg2Fishery()

This method is used to add the fishing ground information to each fishery data point

addFg2Survey()

This method is used to add the fishing ground information to each survey data point

setWeekEffoMatrCell()

This method is used to combine the raw effort points in weekly aggregated effort by cell

setWeekEffoMatrGround()

This method is used to combine the raw effort points in weekly aggregated effort by fishing ground

ggplotGridEffort(year)

This method is used to plot the gridded fishing effort

getNnlsModel(specie, minobs, thr_r2)

This method is used to compute the coefficients of the NNLS model

cohoDisPlot(whoSpe, whoCoh, whiYea, interp)

This method is used to store the spatial distribution of the species by cohort

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Initialize SmartProject
yourSmartRstudy <- SmartProject$new()

# Initialize fleet object
yourSmartRstudy$createFleet()


######################
## Environment Data ##
######################

# Locate the example environment asset' file
envAssetPath <- system.file("extdata/mapAsset.RDS", package = "smartR")

# Load environment asset' data
yourSmartRstudy$importEnv(readRDS(envAssetPath))

# Setup case study' map
yourSmartRstudy$sampMap$getGooMap()
yourSmartRstudy$sampMap$setGooGrid()
yourSmartRstudy$sampMap$setGooBbox()
yourSmartRstudy$sampMap$setGgDepth()
yourSmartRstudy$sampMap$setGgBioDF()
# View case study' grid
print(yourSmartRstudy$sampMap$gooGrid)


################
## Fleet Data ##
################

# Locate the example fleet asset' file
effAssetPath <- system.file("extdata/effAsset.RDS", package = "smartR")

# Load fleet asset' data
yourSmartRstudy$fleet$rawEffort <- readRDS(effAssetPath)

# Setup fishing vessel ids
yourSmartRstudy$fleet$setEffortIds()

# View speed distribution to setup fishing point filter
yourSmartRstudy$fleet$plotSpeedDepth(
which_year = "2012",
speed_range = c(2, 8),
depth_range = c(-20, -600)
)

# Setup fishing points' filter
yourSmartRstudy$fleet$setFishPoinPara(
speed_range = c(2, 8),
depth_range = c(-20, -600)
)

# Compute fishing points
yourSmartRstudy$fleet$setFishPoin()

# Assign cell id to each fishing point
yourSmartRstudy$setCellPoin()

# Add week and month number to each point
yourSmartRstudy$fleet$setWeekMonthNum()


#####################
## Fishing Grounds ##
#####################

# Setup available data to identify fishing areas
yourSmartRstudy$setAvailData()

# Setup cluster analysis input
yourSmartRstudy$sampMap$setClusInpu()

# Run cluster analysis with the SKATER method
yourSmartRstudy$sampMap$calcFishGrou(numCuts = 3, minsize = 10,
 modeska = "S", skater_method = "manhattan", nei_queen = FALSE)

# Setup cluster plot with 3 clusters
yourSmartRstudy$sampMap$setCutResult(ind_clu = 3)

# Map of the clusters' configuration
print(yourSmartRstudy$sampMap$ggCutFGmap)

smartR documentation built on July 2, 2020, 2:25 a.m.

Related to SmartProject in smartR...