Skip to contents

英文原页:compare_releases()

说明

本函数逐条记录(国家、物种条目、渔区和年份)比较FAO全球捕捞产量(Global Capture Production)数据的两个版本,并列出两个版本之间修订过的历史数据:产量有变化的记录、在旧版本已涵盖的年份中新增的记录,以及被删除的记录。它按年份和国家汇总这些修订,并显示每年总产量的变化。

English

This function compares two releases of the FAO Global Capture Production data record by record (country, species item, fishing area and year) and lists the historical data that were revised between them: records whose catch changed, records added for years the older release already covered, and records removed. It summarises the revisions by year and by country and shows how the total catch of each year changed.

用法

compare_releases(
  old = NULL,
  new = NULL,
  area_name = NULL,
  country_name = NULL,
  tolerance = 0.5,
  top_n = 10,
  plot = TRUE,
  table = TRUE,
  lang = NULL,
  pptx = getOption("faofishingreport.pptx", FALSE),
  plot_show = fao_setting("plot_show"),
  label = NULL,
  data_dir = fao_data_dir()
)

参数

old, new
要比较的版本,例如”2025.1.0”和”2026.1.0”,或用”bundled”表示本包自带的数据。new默认为本机上可用的最新版本,old默认为它之前的一个版本。
English The releases to compare, e.g. “2025.1.0” and “2026.1.0”, or “bundled” for the data bundled with the package. Default is the newest release available on this computer for new, and the one before it for old.
area_name, country_name
可选,要比较的FAO渔区和国家。默认为NULL,即全部。
English Optional FAO fishing areas and countries to compare. Default is NULL, all.
tolerance
变化量不超过这一吨数时忽略不计。默认为0.5(舍入误差)。
English Changes of at most this many tonnes are ignored. Default is 0.5 (rounding).
top_n
国家图中显示的修订量最大的国家数。默认为10。
English The number of countries with the largest revisions in the country chart. Default is 10.
plot
逻辑值。为TRUE(默认)时,图表保存在figures/png/summary/。
English A logical value. If TRUE (default), charts are saved in figures/png/summary/.
table
逻辑值。为TRUE(默认)时,表格保存在tables/。
English A logical value. If TRUE (default), tables are saved in tables/.
lang
图表文字和名称的语言:“en”(英文)、“zh”(中文)或”both”(中英双语)。默认为NULL,即使用fao_settings()设置的语言(未更改时为”en”)。
English The language of the chart text and names: “en” (English), “zh” (Chinese) or “both” (Chinese and English). Default is NULL, which uses the language set with fao_settings() (“en” unless changed).
pptx
逻辑值。为TRUE时,图表还另存为可编辑的PowerPoint文件,保存在figures/pptx/summary/。默认为FALSE,可以用fao_settings(pptx = TRUE)为所有函数统一更改。
English A logical value. If TRUE, charts are also saved as editable PowerPoint files in figures/pptx/summary/. Default is FALSE, which can be changed for all functions with fao_settings(pptx = TRUE).
plot_show
逻辑值。为TRUE时,每张图在保存的同时也画在绘图窗口中(例如RStudio的Plots窗格),便于立即查看。默认为FALSE,可以用fao_settings(plot_show = TRUE)为所有函数统一更改。无论是否显示,图表都会保存为文件(plot = TRUE)。
English A logical value. If TRUE, each chart is also drawn in the plot window (e.g. the Plots pane of RStudio) as it is saved, to look at it at once. Default is FALSE, which can be changed for all functions with fao_settings(plot_show = TRUE). The charts are saved as files (plot = TRUE) either way.
label
输出文件名中使用的名称。默认由area_name和country_name中给出的渔区和国家组成(两者都未给出时为”fao”)。
English The name used in the output file names. Default is the fishing area (or the country) of the data.
data_dir
下载的数据版本的保存目录。默认为fao_data_dir()。
English The directory where downloaded releases are stored. Default is fao_data_dir().

返回值

以不可见方式返回一个列表,包括by_year(两个版本中每年的产量及每年的修订)、by_country(按国家统计的修订,不含重新归类的记录)、records(每条修订、新增、删除或重新归类的记录)和releases(比较的两个版本)。

English

Invisibly, a list with by_year (catch in both releases and the revisions of each year), by_country (revisions by country, without reclassified records), records (every revised, added, removed or reclassified record) and releases (the two releases compared).

详细说明

各国提交更正或更完整的数据后,FAO会修订往年的数据(Garibaldi,2012)。Zeller和Pauly(2018)把只在近年数据中采用报告方面的改进、而不修订往年数据的做法称为“现时偏差”(presentist bias),这种做法会使时间序列显示出实际上并未发生的增长。比较不同版本可以看出哪些年份和国家的数据被修订过,以及修订追溯到多早。尚无已发表的研究以这种方式逐条记录比较FishStat的相继版本;这一比较是本包提供的工具,上述两篇论文提供了背景。

版本之间按本包使用的名称进行比较(下载版本时通过FAO代码匹配名称)。如果一条记录从一个物种条目下删除,又以相同的国家、渔区、年份和产量出现在另一个物种条目下(例如FAO重命名或拆分了某个物种条目),则标记为”reclassified”(重新归类),不计为产量的修订。请先用download_fao_data(version = ...)下载较早的版本;check_fao_update()可以列出这些版本。

English

FAO revises earlier years when countries send corrected or more complete data (Garibaldi 2012). Zeller and Pauly (2018) call “presentist bias” the practice of applying improvements in reporting to recent years only, without revising the earlier years, which makes the time series show an increase that did not happen. Comparing releases shows which years and countries were revised and how far back the revisions reach. No published study has compared successive FishStat releases record by record in this way; the comparison is a tool of this package, and the two papers above give the background.

Releases are compared on the names used by the package (matched through FAO codes when a release is downloaded). A record removed under one species item and added under another with the same country, area, year and catch (e.g. when FAO renames or splits a species item) is marked “reclassified” and is not counted as a revision of the catch. Download older releases first with download_fao_data(version = ...); check_fao_update() lists them.

参考文献

Garibaldi, L. (2012). The FAO global capture production database: a six-decade effort to catch the trend. Marine Policy 36: 760-768. doi:10.1016/j.marpol.2011.10.024

Zeller, D. and Pauly, D. (2018). The ‘presentist bias’ in time-series data: implications for fisheries science and policy. Marine Policy 90: 14-19. doi:10.1016/j.marpol.2018.01.015

示例

download_fao_data(version = "2025.1.0")
compare_releases("2025.1.0", "2026.1.0", lang = "zh")
compare_releases("2025.1.0", "2026.1.0", country_name = "China")