category_maps: Create multiple SOOS Mapd from a file with extra category...

Description Usage Arguments Value Note Author(s)

View source: R/category_maps.R

Description

This script contains a function to create all SOOS WG maps from a file. The function: - acesses the file - applies data from rows of the file to 1. plot a WG map using plot_WG_map() and 2. save the file as a .png file using save_map() - outputs a message for each sucessfull map and when teh run is complete

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
category_maps(
  SOOS_WG_data = NULL,
  outdir,
  category_data,
  country_names_data,
  plot_type = "category_only",
  category_colours = SOOScol,
  category_values = NULL,
  plot_legend = T,
  category_names = NULL,
  category_legend = NULL,
  institution_names_data = NULL,
  ...
)

Arguments

SOOS_WG_data

A data frame. The data frame must contain the columns named "Acronym" (for the WG) and "Countries.Represented". See "example_WG_data" for an example. Needed for plot_type "WG" and "geocode". MUST have the same ordered rows as "category_data" !!

outdir

The directory where you would like .png files saved

category_data

This data frame must contain 3 columns labeled "Acronym" (for the WG or plotname), "Countries" (A list of SOOS named countries separated by a ";") and "Categories" (a list of assigned categories for each SOOS country). See example file for details. Note the categories should be ordered from low-high and can be numbers or a caracter vector corresponding to names in the "Categories" column. The highest ranking category will be decide the country fill. Can also be SOOS_WG_data

country_names_data

A data frame. The data frame must contain 2 columns labeled "Country" (what SOOS records the country as) and "ISO3_name". See "example_country_data" for an example.

plot_type

Is the baseplot a WG plot (plot_type = "WG"), a geocode plot (plot_type = "geocode"), or are there no markers (plot_type = "category_only")?

category_colours

The category colours, in order from lowest to highests category.

category_values

A vector containing ordered (low-high) category values if they are not numbered (Leave blank if numbered, starting from 1)

plot_legend

Plot a legend for categories?

category_names

The names you want to appear on the plot legend.

category_legend

The legend title.

institution_names_data

A data frame. The data frame must contain 4 columns labeled "Name" (what SOOS records the Affiliations as), "Type", "Latitude" and "Longitude". SSee example_institution_data for an example.

Value

It will let you know if the code worked!

Note

v.0.1. Note the appearance of the legend still needs some fiddling.

Author(s)

Kimberlee Baldry


KimBaldry/mapSOOSWG documentation built on March 13, 2021, 6:57 p.m.