Skip to contents

英文原页:fao_data_dir()

说明

返回download_fao_data()和download_fishbase_data()保存数据、所有函数查找数据的目录:优先使用fao_settings(data_dir = ...)设置的文件夹,其次是环境变量FAOFISHINGREPORT_DATA_DIR,否则为R的用户数据文件夹(tools::R_user_dir("faofishingreport", "data"))。

English

Returns the directory where download_fao_data() and download_fishbase_data() save data and where all functions look for it: the folder set with fao_settings(data_dir = ...), else the environment variable FAOFISHINGREPORT_DATA_DIR, else the user data folder of R (tools::R_user_dir("faofishingreport", "data")).

用法

返回值

一个字符串,即该目录的路径。

English

A character string with the directory path.

详细说明

如果要在每个R会话中都使用同一个文件夹,例如由多台电脑或一个团队共享的云端文件夹,可以在用户主目录的.Renviron文件(file.path(Sys.getenv("HOME"), ".Renviron"))中加一行FAOFISHINGREPORT_DATA_DIR=<文件夹>,然后重启R。

English

To use the same folder in every R session, e.g. a cloud folder shared by several computers or a team, add a line FAOFISHINGREPORT_DATA_DIR=<folder> to the .Renviron file in your home folder (file.path(Sys.getenv("HOME"), ".Renviron")) and restart R.

示例

fao_data_dir()
fao_settings(data_dir = "D:/shared/fao_data")   # e.g. a folder shared by a team