{"id":15800885,"url":"https://github.com/seananderson/ramlegacy","last_synced_at":"2026-04-22T21:32:22.301Z","repository":{"id":26209976,"uuid":"29656312","full_name":"seananderson/ramlegacy","owner":"seananderson","description":"R package to download, import, convert, and cache the RAM Legacy Stock Assessment Database","archived":false,"fork":false,"pushed_at":"2020-05-07T17:23:12.000Z","size":19,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T21:18:40.723Z","etag":null,"topics":["database","fisheries","r","r-package"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seananderson.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-22T04:35:21.000Z","updated_at":"2020-05-07T17:23:15.000Z","dependencies_parsed_at":"2022-07-25T00:16:13.898Z","dependency_job_id":null,"html_url":"https://github.com/seananderson/ramlegacy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/seananderson/ramlegacy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seananderson%2Framlegacy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seananderson%2Framlegacy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seananderson%2Framlegacy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seananderson%2Framlegacy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seananderson","download_url":"https://codeload.github.com/seananderson/ramlegacy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seananderson%2Framlegacy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263480868,"owners_count":23473164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","fisheries","r","r-package"],"created_at":"2024-10-05T01:08:25.889Z","updated_at":"2026-04-22T21:32:22.241Z","avatar_url":"https://github.com/seananderson.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput:\n  md_document:\n    variant: markdown_github\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\"\n)\n```\n\n# Import the RAM Legacy Stock Assessment Database into R\n\n[![Travis-CI Build Status](https://travis-ci.org/seananderson/ramlegacy.svg?branch=master)](https://travis-ci.org/seananderson/ramlegacy)\n\n**Please use Carl Boettiger and Gupta Kshitiz's ramlegacy package https://github.com/ropensci/ramlegacy instead.**\n\nThis package does one thing: it downloads a Microsoft Access copy of the [RAM Legacy Stock Assessment Database](http://ramlegacy.org) and converts it to a local sqlite3 database. This makes it easy to [work with dplyr/dbplyr](https://cran.r-project.org/web/packages/dbplyr/vignettes/dbplyr.html), for example. The `make_ramlegacy()` function also leaves a copy of `.csv` files for each table in the database in the R working directory if you'd prefer to work with those.\n\n**Note that you must have the utility `mdb-tables` installed** and in your path from `mdbtools`. This utility provides tools for extracting Access databases. You can find installation instructions at \u003chttp://mdbtools.sourceforge.net\u003e. If you're on OS X and using homebrew, you can install it with `brew install mdbtools`.\n\n### Example use\n\n```{r knitr-options, cache=FALSE, echo=FALSE}\nlibrary(\"knitr\")\nopts_chunk$set(cache=TRUE)\n```\n\nInstall the package:\n\n```{r, eval=FALSE}\n# install.packages(\"devtools\")\ndevtools::install_github(\"seananderson/ramlegacy\")\n```\n\nCache and convert the database:\n\n```{r}\nlibrary(\"ramlegacy\")\nmake_ramlegacy()\n```\n\nWork with the data:\n\n```{r}\nlibrary(\"dplyr\")\nram \u003c- src_sqlite(\"ramlegacy.sqlite3\")\nram # see the available tables\n```\n\nAccess the `area` table:\n\n```{r}\ntbl(ram, \"area\")\n```\n\nJoin the time series `ts` and `stock` tables on the `stockid` column:\n\n```{r}\nts \u003c- tbl(ram, \"timeseries\")\nstock \u003c- tbl(ram, \"stock\")\nselect(stock, stockid, scientificname, commonname, region) %\u003e%\n  inner_join(ts)\n```\n\nNote that because you are working with dplyr and a database, you will need to use `dplyr::collect()` once you want to load the data into a local data frame. For example:\n\n```{r}\ntbl(ram, \"area\") %\u003e% \n  collect()\n```\n\nFor safety, you may want to use `dplyr::collect(n = Inf)` to return all rows of data, not just the minimum default number. In this case it won't make a difference.\n\n```{r}\ntbl(ram, \"area\") %\u003e% \n  collect(n = Inf)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseananderson%2Framlegacy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseananderson%2Framlegacy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseananderson%2Framlegacy/lists"}