{"id":20358087,"url":"https://github.com/irods/irods_client_library_rirods","last_synced_at":"2025-04-12T03:15:20.188Z","repository":{"id":62143299,"uuid":"547449411","full_name":"irods/irods_client_library_rirods","owner":"irods","description":"rirods R Package","archived":false,"fork":false,"pushed_at":"2024-07-02T10:23:48.000Z","size":6782,"stargazers_count":7,"open_issues_count":7,"forks_count":5,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-12T03:15:15.826Z","etag":null,"topics":["irods","irods-client","r","r-package","rstats","rstats-package"],"latest_commit_sha":null,"homepage":"https://rirods.irods4r.org","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/irods.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-07T17:51:04.000Z","updated_at":"2024-11-07T14:03:49.000Z","dependencies_parsed_at":"2024-11-14T23:27:01.529Z","dependency_job_id":"df607a5f-fa50-4b54-84ac-7577ead9c221","html_url":"https://github.com/irods/irods_client_library_rirods","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irods%2Firods_client_library_rirods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irods%2Firods_client_library_rirods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irods%2Firods_client_library_rirods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irods%2Firods_client_library_rirods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/irods","download_url":"https://codeload.github.com/irods/irods_client_library_rirods/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248510001,"owners_count":21116130,"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":["irods","irods-client","r","r-package","rstats","rstats-package"],"created_at":"2024-11-14T23:25:18.868Z","updated_at":"2025-04-12T03:15:20.169Z","avatar_url":"https://github.com/irods.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: \n  github_document:\n    md_extensions: [ \n      \"-autolink_bare_uris\" \n    ]\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\nknitr::opts_knit$set(\n  root.dir = tempdir()\n)\n```\n\n# rirods \u003ca href=\"https://dplyr.tidyverse.org\"\u003e\u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"138\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![Codecov test coverage](https://codecov.io/gh/irods/irods_client_library_rirods/branch/main/graph/badge.svg)](https://app.codecov.io/gh/irods/irods_client_library_rirods?branch=main)\n[![R-CMD-check](https://github.com/irods/irods_client_library_rirods/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/irods/irods_client_library_rirods/actions/workflows/R-CMD-check.yaml)\n\u003c!-- badges: end --\u003e\n\nThe rirods package is an R client for iRODS.\n\n## Installation\n\nYou can install the latest CRAN version of rirods like so:\n\n```r\ninstall.packages(\"rirods\")\n```\n\nOr, the development version from GitHub, like so:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"irods/irods_client_library_rirods\")\n```\n\n## Prerequisites\n\nThis package connects to the iRODS C++ HTTP API - https://github.com/irods/irods_client_http_api.\n\nLaunch a local demonstration iRODS service (including the HTTP API):\n\n```{r echo=FALSE}\nlibrary(rirods)\n```\n\n```{r setup, eval=FALSE}\n# load\nlibrary(rirods)\n# setup a mock iRODS server (https://github.com/irods/irods_demo)\nuse_irods_demo(\"alice\", \"passWORD\")\n```\n\n```{r rmirods, echo=FALSE}\nunlink(rirods:::path_to_irods_conf())\n```\n\nThis will result in the demonstration HTTP API running at `r URLencode(rirods:::.irods_host)`.\n\nThese Docker containers are designed to easily stand up a **DEMONSTRATION** of the iRODS server. It is intended for education and exploration. (See also `vignette(\"demo\")`.)\n\n**DO NOT USE IN PRODUCTION**\n\n## Example Usage\n\nTo connect to the HTTP API endpoint of your choice, load `rirods`, connect with `create_irods()`, and authenticate with your iRODS credentials:\n\n```{r project_mock, echo=FALSE, comment=\"\"}\nsubstitute(create_irods(x), list(x = rirods:::.irods_host))\n```\n\n```{r project, eval=is_irods_demo_running(), echo=FALSE}\neval(substitute(create_irods(x), list(x = rirods:::.irods_host)))\n```\n\n### Authentication\n\nIn this example Alice is a user of iRODS and she can authenticate herself with `iauth(\"alice\")`. This prompts a dialog where you can enter your password without hardcoding this information in your scripts.\n\n```{r, Alice, eval=FALSE}\n# login as alice with password \"passWORD\"\niauth(\"alice\") # or iauth(\"alice\", \"passWORD\")\n```\n\n```{r, secret, include=FALSE, eval=is_irods_demo_running()}\n# login as alice\niauth(\"alice\", \"passWORD\")\n```\n\n### Save R objects\n\nSuppose Alice would like to upload an R object from her current R session to an iRODS collection. For this, use the `isaveRDS()` command:\n\n```{r put, eval=is_irods_demo_running()}\n# some data\nfoo \u003c- data.frame(x = c(1, 8, 9), y = c(\"x\", \"y\", \"z\"))\n\n# check where we are in the iRODS namespace\nipwd()\n\n# store data in iRODS\nisaveRDS(foo, \"foo.rds\")\n```\n\n### Metadata\n\nTo truly appreciate the strength of iRODS, we can add some metadata that describes the data object \"foo\":\n\n```{r meta, eval=is_irods_demo_running()}\n# add some metadata\nimeta(\n  \"foo.rds\", \n  operations = \n    data.frame(operation = \"add\", attribute = \"foo\", value = \"bar\", units = \"baz\")\n)\n\n# check if file is stored with associated metadata\nils(metadata = TRUE)\n```\n\nFor more on using metadata, check out `vignette(\"metadata\")`.\n\n### Read R objects\n\nIf Alice wanted to copy the foo R object from an iRODS collection to her current R session, she would use `ireadRDS()`:\n\n```{r get, eval=is_irods_demo_running()}\n# retrieve in native R format\nireadRDS(\"foo.rds\")\n```\n\n### Other file formats\n\nPossibly Alice does not want a native R object to be stored on iRODS but a file type that can be accessed by other programs. For this, use the `iput()` command:\n\n```{r filetypes, eval=requireNamespace(\"readr\") \u0026 is_irods_demo_running()}\nlibrary(readr)\n\n# creates a csv file of foo\nwrite_csv(foo, \"foo.csv\")\n\n# send file\niput(\"foo.csv\", \"foo.csv\")\n\n# check whether it is stored\nils()\n```\n\n```{r rmfile, include=FALSE, eval=requireNamespace(\"readr\") \u0026 is_irods_demo_running()}\nunlink(\"foo.csv\")\n```\n\nLater on somebody else might want to download this file again and store it locally:\n\n```{r csv, eval=requireNamespace(\"readr\") \u0026 is_irods_demo_running()}\n# retrieve it again later\niget(\"foo.csv\", \"foo.csv\")\nread_csv(\"foo.csv\")\n```\n\n### Query\n\nBy adding metadata you and others can more easily discover data in future projects. Objects can be searched with General Queries and `iquery()`:\n\n```{r query, eval=is_irods_demo_running()}\n# look for objects in the home collection with a wildcard `%`\niquery(\"SELECT COLL_NAME, DATA_NAME WHERE COLL_NAME LIKE '/tempZone/home/%'\")\n```\n\n```{r query2, eval=is_irods_demo_running()}\n# or for data objects with a name that starts with \"foo\"\niquery(\"SELECT COLL_NAME, DATA_NAME WHERE DATA_NAME LIKE 'foo%'\")\n```\n\nFor more on querying, check out `vignette(\"metadata\")`.\n\n### Cleanup\n\nFinally, we can clean up Alice's home collection:\n\n```{r clean, eval=requireNamespace(\"readr\") \u0026 is_irods_demo_running()}\n# delete object\nirm(\"foo.rds\", force = TRUE)\nirm(\"foo.csv\", force = TRUE)\n\n# check if objects are removed\nils()\n```\n\n```{r down, eval=is_irods_demo_running()}\n# close the server\nstop_irods_demo()\n# optionally remove the Docker images\n# irods:::remove_docker_images()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firods%2Firods_client_library_rirods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firods%2Firods_client_library_rirods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firods%2Firods_client_library_rirods/lists"}