fao_data_info() shows the release you use and how
to cite it.
All charts and maps follow a few settings, set once per R session
with fao_settings(). Run it without arguments to see the
current settings:
fao_settings()
#> lang en
#> theme bw
#> base_size 12
#> palette npg
#> map_palette deep-orange
#> map_center 0
#> map_projection longlat
#> map_land grey90
#> map_ocean NA
#> grid FALSE
#> dpi 600
#> pptx FALSE
#> data_dir C:/Users/<you>/AppData/Roaming/R/data/R/faofishingreport
#> online TRUE
#> sst ersst5
#> silent FALSE
#> show_data TRUE
#> plot_show FALSE
#> font SimSunfao_settings(...) takes the settings as
name = value, and one more argument,
reset:
| Argument | Meaning | Default |
|---|---|---|
... |
Settings to change, as name = value (table below) |
|
reset |
TRUE first restores all settings to their defaults |
FALSE |
The settings:
| Setting | Choices | Default |
|---|---|---|
lang |
Language of charts: "en", "zh",
"both"; the lang argument of a function takes
precedence |
"en" |
theme |
"bw", "classic", "minimal",
"light", "linedraw", "gray",
"dark", or a ggplot2 theme object; maps and pie charts keep
a minimal theme |
"bw" |
base_size |
Base font size of the theme | 12 |
font |
Font family of chart text (see Fonts) | chosen for the system |
palette |
Colours of categories (countries, species, groups): a ggsci palette
("npg", "lancet", โฆ), an RColorBrewer palette
("Set1", โฆ), a base R palette
(grDevices::palette.pals(), e.g.ย "Okabe-Ito";
grDevices::hcl.pals(), e.g.ย "viridis"), or a
vector of colours |
"npg" |
map_palette |
Colours of map values: a Material Design palette of ggsci
("deep-orange", "blue", "teal",
โฆ), an RColorBrewer palette ("YlOrRd",
"Blues", โฆ), a viridis option ("viridis",
"magma", "plasma", "inferno",
"cividis", "mako", "rocket",
"turbo"), a grDevices::hcl.pals() name, or a
vector of colours |
"deep-orange" |
map_center |
Central longitude of maps: 0 (longitudes -180 to 180,
Atlantic in the centre) or 180 (0 to 360, Pacific in the
centre); "-180-180" and "0-360" are also
accepted |
0 |
map_projection |
"longlat", "robinson",
"mollweide", "equal_earth",
"winkel_tripel", "mercator", or a PROJ string
or EPSG code (then map_center is not applied) |
"longlat" |
map_land |
Colour of countries without data on maps | "grey90" |
map_ocean |
Colour of the ocean on maps |
NA (no fill) |
grid |
Background grid lines (graticules on maps) | FALSE |
dpi |
Resolution of the PNG files | 600 |
pptx |
Also save editable PowerPoint files (uses the eoffice package) | FALSE |
data_dir |
Folder of downloaded FAO data (see ๐พ FAO data) |
NULL: the user data folder of R, see
fao_data_dir()
|
online |
Whether functions may connect to the internet to look for the newest
FishBase release; FALSE works offline with the downloaded
copy (see ๐ FishBase) |
TRUE |
sst |
Sea surface temperature data of fao_area_sst() and
mean_temperature_catch(): "ersst5" (built in),
a product downloaded with download_sst_data()
(e.g.ย "hadisst1"), or the path of your own NetCDF file or
folder (see ๐ก๏ธ Sea temperature) |
"ersst5" |
silent |
Whether the CMSY++ functions work without progress bars and
messages; their silent argument takes precedence (see ๐ CMSY++) |
FALSE |
show_data |
Whether a function shows a summary of its results in the console when it finishes (what was analysed, its main table, the files saved, the parts of the result); the result is returned invisibly | TRUE |
plot_show |
Whether charts are also drawn in the plot window (the Plots pane of
RStudio) as they are saved; the plot_show argument of a
function takes precedence |
FALSE |
fao_settings(reset = TRUE) restores the defaults. A
wrong name or value gives an error at once, with the choices available.
Each setting is stored as the R option
faofishingreport.<name>, so it can also be set with
options(), e.g.ย in an .Rprofile file.
fao_settings() returns the current settings invisibly, as a
list.
๐ Language
Every analysis has a lang argument;
fao_settings(lang = ...) changes the default for all of
them. "both" writes Chinese and English together,
e.g.ย โ็พไธๅจ (Million Tonnes)โ and โๆชๅจ Norwayโ.
fao_settings(lang = "zh")
fishing_area_country(FAO27$area_data, rank_range = 1:6)
fao_settings(lang = "both")
fishing_area_country(FAO27$area_data, rank_range = 1:6)Go back to English with fao_settings(lang = "en"). The
older argument ZH = TRUE still works and means
lang = "zh".
๐ผ๏ธ Themes
fao_settings(theme = "classic")
fishing_area_country(FAO27$area_data, rank_range = 1:6)
fao_settings(theme = "minimal", base_size = 14)
fishing_area_country(FAO27$area_data, rank_range = 1:6)Any ggplot2 theme can be used,
e.g.ย fao_settings(theme = ggplot2::theme_light(base_size = 13)).
๐จ Colour palettes
palette colours countries, species and groups:
fao_settings(theme = "bw", base_size = 12, palette = "lancet")
fishing_area_country(FAO27$area_data, rank_range = 1:6)
fao_settings(palette = "Okabe-Ito") # suitable for colour-blind readers
fishing_area_country(FAO27$area_data, rank_range = 1:6)
fao_settings(palette = c("#0B2E5B", "#16A6B6", "#F28E2B", "#E15759", "#59A14F", "#B07AA1"))
fishing_area_country(FAO27$area_data, rank_range = 1:6)
fao_settings(palette = "npg")Palettes of the ggsci package include "npg",
"aaas", "nejm", "lancet",
"jama", "jco", "d3"; of
RColorBrewer "Set1", "Set2",
"Dark2", "Paired"; of base R
grDevices::palette.pals() (e.g.ย the Okabe-Ito palette for
colour-blind readers, Okabe and Ito 2008) and
grDevices::hcl.pals() (Zeileis et al.ย 2020). More
categories than a palette has are interpolated.
๐บ๏ธ Map projections
The same map, the catch of each country in area 27, in each projection:
fao_settings(map_projection = "longlat") # plain longitude-latitude (default)
fishing_area_data("Atlantic, Northeast")
fao_settings(map_projection = "robinson")
fishing_area_data("Atlantic, Northeast")
fao_settings(map_projection = "equal_earth")
fishing_area_data("Atlantic, Northeast")
fao_settings(map_projection = "mollweide")
fishing_area_data("Atlantic, Northeast")
fao_settings(map_projection = "winkel_tripel")
fishing_area_data("Atlantic, Northeast")
fao_settings(map_projection = "mercator")
fishing_area_data("Atlantic, Northeast")The named projections and the PROJ projection each one uses (the maps are drawn with sf, which uses the PROJ library):
map_projection |
Projection | PROJ | Properties |
|---|---|---|---|
"longlat" |
Plain longitude-latitude (equidistant cylindrical, plate carrรฉe) |
EPSG:4326; +proj=eqc with
map_center = 180
|
Simple; areas far from the equator are enlarged |
"robinson" |
Robinson (Robinson 1974) | +proj=robin |
Compromise world map: neither equal-area nor conformal |
"equal_earth" |
Equal Earth (ล avriฤ et al.ย 2019) | +proj=eqearth |
Equal-area, with straight parallels |
"mollweide" |
Mollweide (Snyder 1987) | +proj=moll |
Equal-area, elliptical outline |
"winkel_tripel" |
Winkel tripel | +proj=wintri |
Compromise world map with low overall distortion |
"mercator" |
Mercator (Snyder 1987) | +proj=merc |
Conformal; areas grow strongly towards the poles, cut at 80ยฐ S and 84ยฐ N |
Any other projection can be given as a PROJ string or EPSG code, e.g.
fao_settings(map_projection = "+proj=natearth") or
"EPSG:3857".
๐ Pacific-centred maps
map_center = 180 shows longitudes 0 to 360, with the
Pacific in the centre. Areas and countries that the data split at the
dateline (e.g.ย the Pacific areas, Russia) are joined again:
fao_settings(map_projection = "robinson", map_center = 180)
fishing_area_data("Pacific, Northwest")Fishing area maps show the land without country borders, and the analysed country in red:
country_analysis("Norway")Countries are drawn from the Natural Earth map units (1:50m), matched to the FAO countries on their ISO 3 codes; the fishing areas from the FAO layer of the major fishing areas, simplified for world maps.
๐๏ธ Map colours
fao_settings(map_projection = "robinson", map_center = 0, map_palette = "viridis")
fishing_area_data("Atlantic, Northeast")
fao_settings(map_palette = "YlOrRd", map_land = "grey85", map_ocean = "#EAF4FB")
fishing_area_data("Atlantic, Northeast")The fill_scale argument of
fishing_area_data(), species_country() and
country_analysis() overrides map_palette for
one call.
๐ค Fonts
The font is chosen for the operating system so that Chinese text
displays: SimSun on Windows, Songti SC on macOS, Noto Serif CJK SC on
Linux, or the next installed Chinese font (and "sans" if
none is found). Change it with:
fao_font() # the current font
fao_settings(font = "Microsoft YaHei")fao_font() has one argument:
| Argument | Meaning | Default |
|---|---|---|
family |
Font family to use from now on, e.g.ย "Microsoft YaHei";
NULL only returns the current font |
NULL |
It returns the font family name.
fao_settings(font = ...), fao_font(...) and
options(faofishingreport.font = ...) do the same. The fonts
tried on each system:
| System | Fonts, in order |
|---|---|
| Windows | SimSun, NSimSun, Microsoft YaHei, SimHei, DengXian, KaiTi |
| macOS | Songti SC, STSong, PingFang SC, Heiti SC, Hiragino Sans GB, Arial Unicode MS |
| Linux | Noto Serif CJK SC, Noto Sans CJK SC, Source Han Serif SC, Source Han Sans SC, WenQuanYi Zen Hei, WenQuanYi Micro Hei, AR PL UMing CN |
The installed fonts are listed with the systemfonts package. PNG files are drawn with the ragg package, which finds any installed font by name; PowerPoint files use the same font name.
๐ Grid lines, resolution and PowerPoint
fao_settings(grid = TRUE)
fishing_area_country(FAO27$area_data, rank_range = 1:6)
fao_settings(grid = FALSE)PowerPoint files are written with the eoffice package, installed with faofishingreport; on macOS it also needs XQuartz.
fao_settings(dpi = 300) # smaller PNG files
fao_settings(pptx = TRUE) # also editable PowerPoint in figures/pptx/
fishing_area_species(FAO27$area_data, pptx = TRUE) # or for one call onlyโ๏ธ Arguments of each function
Besides the settings, the analysis functions have their own
arguments; lang, pptx and
fill_scale override the settings for one call. Each article
has a table of all of them:
| Functions | All arguments |
|---|---|
fishing_area_data(),
fishing_area_species(), fishing_area_country()
(line widths, point sizes, text sizes and colours) |
๐ Fishing area analysis |
species_country(), country_species(),
country_analysis()
|
๐ Species and countries |
check_fao_update(), download_fao_data(),
load_fao_data(), fao_data_info(),
fao_translate()
|
๐พ FAO data |
Summary analyses, e.g.ย stock_status(),
peak_trend()
|
๐ Composition, stock status and trends, ๐ Data quality, diversity and fleets |
fao_report() |
๐ Assessment report: Word, LaTeX and PDF |
๐ Translations
Chinese names of countries, species and areas come from FAO. The
Chinese names of ISSCAAP groups, major groups and income groups
(inst/extdata/group_names_zh.csv) and all chart labels
(inst/extdata/chart_labels.csv) are plain CSV files: edit
them in the package source and reinstall the package to change the
wording.
๐ References
FAO (2024). FAO Major Fishing Areas for Statistical Purposes. In: FAO
Fisheries and Aquaculture Division [online]. Licence: CC-BY 4.0. https://www.fao.org/fishery/geonetwork?uuid=ac02a460-da52-11dc-9d70-0017f293bd28
(the area boundaries of the fishing area maps, bundled as
inst/extdata/FAO_AREAS_CWP.shp)
Guo, K. eoffice: Export or Graph and Tables to โMicrosoftโ Office and Import Figures and Tables. R package. doi:10.32614/CRAN.package.eoffice
Harrower, M. and Brewer, C.A. (2003). ColorBrewer.org: an online tool for selecting colour schemes for maps. The Cartographic Journal 40(1): 27โ37. doi:10.1179/000870403235002042
Massicotte, P. and South, A. rnaturalearth: World Map Data from Natural Earth. R package. doi:10.32614/CRAN.package.rnaturalearth
Natural Earth. Admin 0 โ Details, map units, 1:50m. https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-details/
Okabe, M. and Ito, K. (2008). Color Universal Design (CUD): how to make figures and presentations that are friendly to colorblind people. https://jfly.uni-koeln.de/color/
Pebesma, E. (2018). Simple features for R: standardized support for spatial vector data. The R Journal 10(1): 439โ446. doi:10.32614/RJ-2018-009
Pedersen, T.L. and Shemanarev, M. ragg: Graphic Devices Based on AGG. R package. doi:10.32614/CRAN.package.ragg
PROJ contributors (2026). PROJ coordinate transformation software library. Open Source Geospatial Foundation. https://proj.org/. doi:10.5281/zenodo.5884394
Robinson, A.H. (1974). A new map projection: its development and characteristics. International Yearbook of Cartography 14: 145โ155.
ล avriฤ, B., Patterson, T. and Jenny, B. (2019). The Equal Earth map projection. International Journal of Geographical Information Science 33(3): 454โ465. doi:10.1080/13658816.2018.1504949
Snyder, J.P. (1987). Map Projections: A Working Manual. U.S. Geological Survey Professional Paper 1395. Washington, DC: U.S. Government Printing Office. doi:10.3133/pp1395
Wickham, H. (2016). ggplot2: Elegant Graphics for Data Analysis. New York: Springer. doi:10.1007/978-3-319-24277-4
Xiao, N. ggsci: Scientific Journal and Sci-Fi Themed Color Palettes for โggplot2โ. R package. doi:10.32614/CRAN.package.ggsci
Zeileis, A., Fisher, J.C., Hornik, K., Ihaka, R., McWhite, C.D., Murrell, P., Stauffer, R. and Wilke, C.O. (2020). colorspace: a toolbox for manipulating and assessing colors and palettes. Journal of Statistical Software 96(1): 1โ49. doi:10.18637/jss.v096.i01
