Title: | Download and Read RAM Legacy Stock Assessment Database |
---|---|
Description: | Contains functions to download, cache and read in 'Excel' version of the RAM Legacy Stock Assessment Data Base, an online compilation of stock assessment results for commercially exploited marine populations from around the world. The database is named after Dr. Ransom A. Myers whose original stock-recruitment database, is no longer being updated. More information about the database can be found at <https://ramlegacy.org/>. Ricard, D., Minto, C., Jensen, O.P. and Baum, J.K. (2012) <doi:10.1111/j.1467-2979.2011.00435.x>. |
Authors: | Carl Boettiger [aut, cph] , Kshitiz Gupta [aut, cre, cph], Sam Albers [rev] , Jamie Afflerbach [rev] , RAM Legacy Stock Assessment Database [dtc] |
Maintainer: | Kshitiz Gupta <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2.0 |
Built: | 2024-12-14 03:35:06 UTC |
Source: | https://github.com/ropensci/ramlegacy |
Downloads a specified version of RAM Legacy Stock Assessment
Excel Database and as an RDS object to a local directory specified by
ram_dir
. The function will check if the version requested
already exists on the user's computer and if it does then it prompts the user
to download it again unless 'overwrite = TRUE' in which case the function will
download the version without displaying the prompt. The function also supports
downloading all the older versions (1.0, 2.0, 2.5, 3.0, 4.3) from
[a github repo](www.github.com/kshtzgupta1/ramlegacy-assets)
download_ramlegacy(version = NULL, ram_path = NULL, ram_url = "https://doi.org/10.5281/zenodo.2542918", overwrite = FALSE, quiet = FALSE)
download_ramlegacy(version = NULL, ram_path = NULL, ram_url = "https://doi.org/10.5281/zenodo.2542918", overwrite = FALSE, quiet = FALSE)
version |
A character vector of length 1 specifying the version number of the database that should be downloaded. As of writing this package, the available versions are "1.0","2.0", "2.5", "3.0", "4.3", "4.40", "4.41", and "4.44". If the version argument is not specified then it defaults to latest version (currently latest version is "4.44"). |
ram_path |
A string specifying the path of the local directory where
database will be downloaded. By default this path is set to the location
provided by rappdirs package and can be viewed by calling
|
ram_url |
A string. By default it is set to the Zenodo url of the database.
Please do not pass in any other url to |
overwrite |
This argument is only relevant if you are trying to re-download a version that is already present locally in the rappdirs directory. If overwrite = TRUE then user will not encounter the interactive prompt that confirms whether to overwrite the version present locally. |
quiet |
If TRUE, suppress status messages |
Other ramlegacy functions: load_ramlegacy
,
ram_dir
# download version 4.44 download_ramlegacy(version = "4.44") # download version 1.0 download_ramlegacy(version = "1.0") # If version not specified then default # to latest version (currently 4.44) download_ramlegacy()
# download version 4.44 download_ramlegacy(version = "4.44") # download version 1.0 download_ramlegacy(version = "1.0") # If version not specified then default # to latest version (currently 4.44) download_ramlegacy()
Returns a list of specific dataframes or a list of all the dataframes present in the requested version of the database.
load_ramlegacy(version = NULL, tables = NULL, ram_path = NULL)
load_ramlegacy(version = NULL, tables = NULL, ram_path = NULL)
version |
A character vector of length 1 specifying the version number of the database. As of writing this package, the available versions are "1.0", "2.0", "2.5", "3.0", "4.3", "4.40", "4.41" and "4.44". If version argument is not specified then it defaults to newest version (v4.44). |
tables |
A character vector specifying the names of particular dataframes to load from a specified version. If not specified then a list containing all the dataframes within the requested version is returned. For a description of the different tables present in the database please see below. |
ram_path |
path to the local directory where the specified version of
the RAM Legacy Stock Excel Assessment Database was downloaded. By default
this path is set to within the rappdirs directory and can be viewed using
calling the function |
metadata: Table with summarized metadata (only available in newer versions starting from v4.40)
stock: This stores the stock database table
assessment: This stores the assessment database table
taxonomy: This stores the taxonomy database table
management: This stores the management database table
assessor: This stores the assessor database table
assessmetod: This stores the assessmetod database table
area: This stores the area database table
biometrics: This stores the biometrics database table
tsmetrics: This stores the tsmetrics database table
timeseries: The time series data is a matrix object with the following headers/columns: (1) assessid (2) stockid (3) stocklong (4) tsid (5) tsyear (6) tsvalue
bioparams: The parameter data is a matrix object with the following headers/columns: (1) assessid (2) stockid (3) stocklong (4) bioid (5) biovalue (6) bioyear (7) bionotes
timeseries_values_views: This stores the timeseries values with timeseries type along the columns and stocks along the rows
timeseries_units_views: This stores the timeseries values with timeseries type along the columns and stocks along the rows
timeseries_ids_views: This stores the timeseries IDs with timeseries type along the columns and stocks along the rows
timeseries_assessments_views: This stores the timeseries assessments with timeseries type along the columns and stocks along the rows
timeseries_notes_views: This stores the timeseries notes with timeseries type along the columns and stocks along the rows
timeseries_sources_views: This stores the timeseries sources with timeseries type along the columns and stocks along the rows
timeseries_years_views: This stores the timeseries years with timeseries type along the columns and stocks along the rows
bioparams_values_views: This stores the reference point values, with reference point type along the columns and stocks along the rows
bioparams_units_views: This stores the reference point units, with reference point type along the columns and stocks along the rows
bioparams_ids_views: This stores the reference point IDs, with reference point type along the columns and stocks along the rows
bioparams_assessments_views: This stores the reference point assessments, with reference point type along the columns and stocks along the rows
bioparams_sources_views: This stores the reference point sources, with reference point type along the columns and stocks along the rows
bioparams_notes_views: This stores the reference point notes, with reference point type along the columns and stocks along the rows
tb.data: Total Biomass
ssb.data: Spawning Stock Biomass
tn.data: Total Abundance
r.data: Recruits
tc.data: Total Catch
tl.data: Total Landings
recc.data: Recreational Catch
f.data: Fishing Mortality
er.data: Exploitation Rate
divtb.data: TB/TBmsy
divssb.data: SSB/SSBmsy
ivf.data: F/Fmsy
diver.data: ER/ERmsy
divbpref.data: B/Bmsypref
divupref.data: U/Umsypref
tbbest.data: TBbest
tcbest.data: TCbest
erbest.data: ERbest
divtb.mgt.data: TB/TBmgt
divssb.mgt.data: SSB/SSBmgt
divf.mgt.data: F/Fmgt
diver.mgt.data: ER/ERmgt
divbpref.mgt.data: B/Bmgtpref
divupref.mgt.data: U/Umgtpref
cpair.data: Cpair
tac.data: TAC
cadv.data: Cadvised
survb.data: survB
cpue.data: CPUE
effort.data: EFFORT
Other ramlegacy functions: download_ramlegacy
,
ram_dir
# first download version 4.44 of the database download_ramlegacy(version = "4.44") # get a list containing area and bioparams tables # from version 4.44 database load_ramlegacy(version = "4.44", tables = c("area", "bioparams"))
# first download version 4.44 of the database download_ramlegacy(version = "4.44") # get a list containing area and bioparams tables # from version 4.44 database load_ramlegacy(version = "4.44", tables = c("area", "bioparams"))
Provides the download location for download_ramlegacy
in an OS independent manner. This is also the location from where
load_ramlegacy
loads the database from.
ram_dir(vers = NULL)
ram_dir(vers = NULL)
vers |
character, version number of the database. As of writing this
package, the available versions are "1.0", "2.0", "2.5", "3.0", "4.3","4.40",
"4.41", and "4.44". If version is not specified the |
Other ramlegacy functions: download_ramlegacy
,
load_ramlegacy
# return the path to the rappdirs directory where # all version subdirectories are stored ram_dir() # Returns the path of the subdirectory where v4.3 # of the database is downloaded to and read from. ram_dir(vers = "4.3")
# return the path to the rappdirs directory where # all version subdirectories are stored ram_dir() # Returns the path of the subdirectory where v4.3 # of the database is downloaded to and read from. ram_dir(vers = "4.3")