{"id":32383295,"url":"https://github.com/gustavobio/rb","last_synced_at":"2025-10-25T01:54:35.918Z","repository":{"id":82170656,"uuid":"95913418","full_name":"gustavobio/RB","owner":"gustavobio","description":"Search specimens and download images from the JBRJ (RB) herbarium.","archived":false,"fork":false,"pushed_at":"2017-07-06T17:59:01.000Z","size":39,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-15T13:21:02.833Z","etag":null,"topics":["herbaria","herbarium","jbrj","rb"],"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/gustavobio.png","metadata":{"files":{"readme":"README.md","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,"governance":null}},"created_at":"2017-06-30T18:20:19.000Z","updated_at":"2024-03-15T13:21:02.834Z","dependencies_parsed_at":null,"dependency_job_id":"6a16a60c-da84-4101-abd8-5ce3b6182c93","html_url":"https://github.com/gustavobio/RB","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gustavobio/RB","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gustavobio%2FRB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gustavobio%2FRB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gustavobio%2FRB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gustavobio%2FRB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gustavobio","download_url":"https://codeload.github.com/gustavobio/RB/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gustavobio%2FRB/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280893608,"owners_count":26409279,"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","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["herbaria","herbarium","jbrj","rb"],"created_at":"2025-10-25T01:53:47.754Z","updated_at":"2025-10-25T01:54:35.913Z","avatar_url":"https://github.com/gustavobio.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"## RB: R package to search for records and download images from the RB (Jardim Botânico do Rio de Janeiro) herbarium\n\n### Installation:\n\nRB is not on CRAN, so please install it from github:\n\n```r\n# Install devtools\ninstall.packages(\"devtools\")\n\n# Install finch (YOU MUST INSTALL THE VERSION FROM GITHUB IF USING R ON WINDOWS!)\ndevtools::install_github(\"gustavobio/finch\")\n\n# Install RB:\ndevtools::install_github(\"gustavobio/RB\")\n```\n\n### Usage:\n\nRB tools have three main usage scenarios:\n\n  1. Searching for records in the RB database.\n  2. Navigating images.\n  3. Downloading images.\n  \n#### 1. Searching for records\n\nThe main function here is `search_rb`. When you call it for the first time \nthe package will try to download the DWCA dataset provided by the Jardim Botânico\ndo Rio de Janeiro. This dataset is a little over 100M, so it may take a while. Memory usage \nis also high and will likely impact performance in computers with lower specs:\n\n```r\n\u003e library(RB)\n\u003e download_rb_data(encoding = \"UTF-8\")\ntrying URL 'http://ipt.jbrj.gov.br/jbrj/archive.do?r=jbrj_rb\u0026v=84.109'\ndownloaded 103.9 MB\n\nRead 691354 rows and 45 (of 45) columns from 0.352 GB file in 00:00:13\nRead 625625 rows and 7 (of 7) columns from 0.153 GB file in 00:00:07\n153 GB file in 00:00:07\n\u003e miconias \u003c- search_rb(\"Miconia albicans\")\n```\n\nThis call to `search_rb` returns a data frame with 477 rows and 45 columns, including scientific name, family,\ncollector, collector notes, dates, determiner, county, state, and so on:\n\n```r\n\u003e str(miconias)\n'data.frame':\t477 obs. of  45 variables:\n $ id                      : chr  \"urn:catalog:JBRJ:RB:741399\" \"urn:catalog:JBRJ:RB:1045255\" \"urn:catalog:JBRJ:RB:1045306\" \"urn:catalog:JBRJ:RB:1045294\" ...\n $ type                    : chr  \"Collection\" \"Collection\" \"Collection\" \"Collection\" ...\n $ modified                : chr  \"2014-07-08 00:45:06.721283\" \"2015-11-30 17:52:29.673752\" \"2015-11-30 17:52:57.868959\" \"2015-11-30 19:04:47.934176\" ...\n $ rightsHolder            : chr  \"\" \"RB\" \"RB\" \"RB\" ...\n $ institutionCode         : chr  \"RB\" \"RB\" \"RB\" \"RB\" ...\n $ collectionCode          : chr  \"\" \"RB\" \"RB\" \"RB\" ...\n $ basisOfRecord           : chr  \"PreservedSpecimen\" \"PreservedSpecimen\" \"PreservedSpecimen\" \"PreservedSpecimen\" ...\n $ occurrenceID            : chr  \"urn:catalog:JBRJ:RB:741399\" \"urn:catalog:JBRJ:RB:1045255\" \"urn:catalog:JBRJ:RB:1045306\" \"urn:catalog:JBRJ:RB:1045294\" ...\n $ catalogNumber           : chr  \"RB00741399\" \"RB01045255\" \"RB01045306\" \"RB01045294\" ...\n $ recordNumber            : chr  \"431\" \"488\" \"551\" \"538\" ...\n $ recordedBy              : chr  \"N.L. Britton; H.H. Rusby\" \"P. Rosa; T.S.Pereira; A. Pintor \u0026 JF.A. Baumgratz\" \"P. Rosa; T.S.Pereira; A. Pintor \u0026 JF.A. Baumgratz\" \"P. Rosa; T.S.Pereira; A. Pintor \u0026 JF.A. Baumgratz\" ...\n...\n```\n\nThe first argument in `search_rb` is a scientific name. Please see the helpfile (`?search_rb`) for a list of all possible arguments. You can combine them to refine your search:\n\n```r\n# By scientific name and year\n\u003e miconias_2015 \u003c- search_rb(\"Miconia albicans\", year = 2015)\n\u003e dim(miconias_2015)\n[1] 13 45\n```\n\n```r\n# By genus and county\n\u003e miconias_itirapina \u003c- search_rb(genus = \"Miconia\", county = \"Itirapina\")\n\u003e dim(miconias_itirapina)\n[1] 24 45\n```\n\n```r\n# By scientific name and collector\n\u003e myrcias_van \u003c- search_rb(\"Myrcia guianensis\", collector = \"Staggemeier\")\n\u003e dim(myrcias_van)\n[1]  3 45\n```\n\n#### 2. Navigating images\n\nYou can also open images in the default browser using `open_rb_images` and passing the results from `search_rb`:\n\n```r\n\u003e open_rb_images(myrcias_van)\n```\n\u003cimg width=\"400\" alt=\"screen shot 2017-06-30 at 17 24 22\" src=\"https://user-images.githubusercontent.com/30267/27752751-06fd4da4-5db9-11e7-897b-1b3cc933cf4d.png\"\u003e\n\n\nThis will open all images in your browser in new tabs. The maximum number of images is given by the argument `max`, which defaults to 5.\n\n```r\n\u003e open_rb_images(myrcias_van, max = 15)\n```\n\nYou can also tweak image resolution using the argument `width` (the default width in pixels is 600):\n\n```r\n\u003e open_rb_images(myrcias_van, width = 3000)\n```\n\nIf you are just browsing images (for instance, to check plant characteristics) you can do the search directly in `open_rb_images`:\n\n```r\n\u003e open_rb_images(scientific_name = \"Miconia albicans\")\n``` \n\nThis will open the first 5 images in the database. If you want random 5, use the argument `random`:\n\n```r\n\u003e open_rb_images(scientific_name = \"Miconia albicans\", random = TRUE, width = 3000) # files here will be large\n```\n\n#### 3. Downloading images\n\nImages can also be downloaded and stored locally, in folders in your current path. See `getwd()` if you don't know where this is. You can change this with `setwd()`.\n\n```r\n\u003e getwd()\n[1] \"/Users/gustavo\"\n```\n\nThe function `download_rb_images` is the workhorse here. For instance, you can download images from a previous search:\n\n```r\n\u003e download_rb_images(myrcias_van)\n3 images found. Continue? (y/n): y\n  |===================================================================| 100%\n\u003e \n``` \n\nThis call downloads images in the default resolution (in this case, width = 3000) to a local dir:\n\n\u003cimg width=\"400\" alt=\"screen shot 2017-06-30 at 17 11 16\" src=\"https://user-images.githubusercontent.com/30267/27752423-4b3a4d20-5db7-11e7-97f1-1b542016de55.png\"\u003e\n\nPlease beware that if your search yields several results, downloading all images can impact RB servers. Use discretion here. You could, for instance,\ndownload all images for a given family:\n\n```r\n\u003e download_rb_images(family = \"Melastomataceae\")\n26890 images found. Continue? (y/n): y\n\nDownloading 26890 images to /Users/gustavo/RB_images__30_Jun_17_22_37/:\n  |                                                                   |   0%\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgustavobio%2Frb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgustavobio%2Frb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgustavobio%2Frb/lists"}