Description Usage Arguments Value Note Author(s)
View source: R/category_maps.R
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
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. |
It will let you know if the code worked!
v.0.1. Note the appearance of the legend still needs some fiddling.
Kimberlee Baldry
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.