mapNodeAverageLayerFiles: Generate maps from averaging stochastic DISPLACE spatial...

Description Usage Arguments Examples

View source: R/mapNodeAverageLayerFiles.R

Description

This function generates maps from an average layer as a second step after call to getAggNodesLayerFiles()

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
mapNodeAverageLayerFiles(general, a_type = "cumcatches", a_type2 = "",
  func = "ratio", field_pos = 4, a_pop = "",
  the_baseline = "svana_baseline",
  selected_scenarios_for_plot = general$namefolderoutput,
  selected_scenarios_for_table = general$namefolderoutput,
  selected_areas_for_table = c("22", "23", "24", "25", "IIIa", "IVa",
  "IVb", "IVc"), the_breaks_baseline = c(0.5, 1, round(exp(seq(0.5, 14,
  by = 1.2))), 1e+06), the_breaks = c(rev(-round(exp(seq(0, 7, by =
  1)))), 0, round(exp(seq(0, 7, by = 1)))), gis_shape = list(),
  a_width = 3400, a_height = 3500, xlims = c(-1, 17), ylims = c(53,
  60), xcell = 12, ycell = 17,
  legend_text1 = "Total Catches kg per ")

Arguments

fname

First name

lname

Last name

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
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
## Not run: 
general <- setGeneralOverallVariable (pathToRawInputs =file.path("C:", "Users", "fbas", 
                                                "Documents", "GitHub", paste0("DISPLACE_input_gis_", 
                                                 "DanishFleet")),
                                      pathToDisplaceInputs = file.path("C:", "Users", "fbas", 
                                                "Documents", "GitHub", paste0("DISPLACE_input_", "DanishFleet")),
                                      pathToOutputs =file.path("C:","DISPLACE_outputs"),
                                      caseStudy="DanishFleet",
                                      iGraph=41,
                                      iYear="2015",
                                      iCountry="DEN",
                                      nbPops=39,
                                      nbSzgroup=14,
                                      theScenarios= c("svana_baseline",
                                                      "svana_sub1mx20",
                                                      "svana_sub4mx20",
                                                      "svana_sub4mx5ns20bt",
                                                      "svana_sub4mx20ns5bt",
                                                      "svana_sub4mx5ns5bt" ),
                                      nbSimus=20,
                                      useSQLite=FALSE    
                                      )



  # caution: could take a  while...
  getAggNodeLayerFiles (general, a_type="cumcatches", a_tstep="34321")
  getAggNodeLayerFiles (general, a_type="cumsweptarea", a_tstep="34321")

  library(maptools)
  sh_coastlines               <- readShapePoly(file.path('C:','Users','fbas','Documents','GitHub','DISPLACE_input_myfish','graphsspe', 'shp', 'francois_EU'), 
                                                      proj4string=CRS("+proj=longlat +ellps=WGS84"))
  ices_areas                  <- readShapePoly(file.path('C:','Users','fbas','Documents','GitHub','DISPLACE_input_raw','ices_areas','ices_areas'), 
                                                     proj4string=CRS("+proj=longlat +ellps=WGS84"))

  NSsub1mx20                  <- readShapePoly(file.path('C:','Users','fbas','Documents','GitHub',
                                                    'DISPLACE_SVANAProject', 'Input for DISPLACE', 'NST2_sub1_mx20_wgs84'),
                                                     proj4string=CRS("+proj=longlat +ellps=WGS84"))
  BSsub1mx20                  <- readShapePoly(file.path('C:','Users','fbas','Documents','GitHub',
                                                    'DISPLACE_SVANAProject', 'Input for DISPLACE', 'BHT2_Sub1_Mx_20_wgs84'), 
                                                       proj4string=CRS("+proj=longlat +ellps=WGS84"))
  NSsub4mx20                  <- readShapePoly(file.path('C:','Users','fbas','Documents','GitHub',
                                                      'DISPLACE_SVANAProject', 'Input for DISPLACE', 'NST2_sub4_mx_20_wgs84'), 
                                                       proj4string=CRS("+proj=longlat +ellps=WGS84"))
  BSsub4mx20                  <- readShapePoly(file.path('C:','Users','fbas','Documents','GitHub',
                                                        'DISPLACE_SVANAProject', 'Input for DISPLACE', 'BHT2_Sub4_Mx_20LongTailedD_wgs84'), 
                                                          proj4string=CRS("+proj=longlat +ellps=WGS84"))
  NSsub4mx5                   <- readShapePoly(file.path('C:','Users','fbas','Documents','GitHub',
                                                         'DISPLACE_SVANAProject', 'Input for DISPLACE', 'NST2_sub4_mx05_wgs84'), 
                                                           proj4string=CRS("+proj=longlat +ellps=WGS84"))
  BSsub4mx5                   <- readShapePoly(file.path('C:','Users','fbas','Documents','GitHub',
                                                          'DISPLACE_SVANAProject', 'Input for DISPLACE', 'BHT2_Sub4_Mx_5LgtailedD_wgs84'), 
                                                             proj4string=CRS("+proj=longlat +ellps=WGS84"))



  mapNodeAverageLayerFiles (general, a_type="cumcatches", a_type2="",  field_pos=4,  the_baseline= "svana_baseline",
                           selected_scenarios_for_plot=general$namefolderoutput,
                           selected_scenarios_for_table=general$namefolderoutput,
                           selected_areas_for_table=c("22",    "23",    "24",    "25",    "IIIa",  "IVa",   "IVb",   "IVc"),
                           the_breaks_baseline= c(0.5, 1, round(exp(seq(0.5, 14, by=1.1))), 1000000),
                           the_breaks=c(rev(-round(exp(seq(0, 7, by=1)))),  0, round(exp(seq(0, 7, by=1)))),
                           gis_shape=list(svana_baseline=   list(sh_coastlines), # ices_areas),
                                          svana_sub1mx20=   list(NSsub1mx20, BSsub1mx20),
                                          svana_sub4mx20=   list(NSsub4mx20, BSsub4mx20),
                                          svana_sub4mx5ns20bt=   list(NSsub4mx5, BSsub4mx20),
                                          svana_sub4mx20ns5bt=   list(NSsub4mx20, BSsub4mx5),
                                          svana_sub4mx5ns5bt=    list(NSsub4mx5, BSsub4mx5)),
                                          a_width= 3400, a_height =3500, xlims =  c(-1, 17), ylims = c(53,60), xcell=12, ycell=17,
                                          legend_text1="Total Catches kg per "
                                          )


  mapNodeAverageLayerFiles (general, a_type="cumcatches", a_type2="cumsweptarea",  field_pos=4,  the_baseline= "svana_baseline",
                           selected_scenarios_for_plot=general$namefolderoutput,
                           selected_scenarios_for_table=general$namefolderoutput,
                           selected_areas_for_table=c("22",    "23",    "24",    "25",    "IIIa",  "IVa",   "IVb",   "IVc"),
                           the_breaks_baseline= c(0.5, 1, round(exp(seq(0.5, 14, by=1.1))), 1000000),
                          the_breaks=c(rev(-round(exp(seq(0, 7, by=1)))),  0, round(exp(seq(0, 7, by=1)))),
                           gis_shape=list(svana_baseline=   list(sh_coastlines), # ices_areas),
                                          svana_sub1mx20=   list(NSsub1mx20, BSsub1mx20),
                                          svana_sub4mx20=   list(NSsub4mx20, BSsub4mx20),
                                          svana_sub4mx5ns20bt=   list(NSsub4mx5, BSsub4mx20),
                                          svana_sub4mx20ns5bt=   list(NSsub4mx20, BSsub4mx5),
                                          svana_sub4mx5ns5bt=    list(NSsub4mx5, BSsub4mx5)),
                                          a_width= 3400, a_height =3500, xlims =  c(-1, 17), ylims = c(53,60), xcell=12, ycell=17,
                                          legend_text1="Total Catches kg per Swept Area km2 per "
                                          )


  mapNodeAverageLayerFiles (general, a_type="cumdiscards",  a_type2="cumcatches", func="rate", field_pos=4,  the_baseline= "svana_baseline",
                          selected_scenarios_for_plot=general$namefolderoutput,
                          selected_scenarios_for_table=general$namefolderoutput,
                          selected_areas_for_table=c("22",    "23",    "24",    "25",    "IIIa",  "IVa",   "IVb",   "IVc"),
                          the_breaks_baseline= c(round((exp(seq(0.00, 0.6, by=0.04))-1),3), 1.1),
                          the_breaks=c(rev(-round(exp(seq(0, 7, by=1)))),  0, round(exp(seq(0, 7, by=1)))),
                          gis_shape=list(svana_baseline=   list(sh_coastlines), # ices_areas),
                                         svana_sub1mx20=   list(NSsub1mx20, BSsub1mx20),
                                         svana_sub4mx20=   list(NSsub4mx20, BSsub4mx20),
                                         svana_sub4mx5ns20bt=   list(NSsub4mx5, BSsub4mx20),
                                         svana_sub4mx20ns5bt=   list(NSsub4mx20, BSsub4mx5),
                                         svana_sub4mx5ns5bt=    list(NSsub4mx5, BSsub4mx5)),
                                         a_width= 3400, a_height =3500, xlims =  c(-1, 17), ylims = c(53,60), xcell=12, ycell=17,
                                         legend_text1="Discarded proportion"
                                         )

## End(Not run)

frabas/displaceplot documentation built on May 3, 2019, 4:06 p.m.