{"id":14068604,"url":"https://github.com/iqis/stash","last_synced_at":"2025-07-30T04:31:28.555Z","repository":{"id":117427107,"uuid":"199921348","full_name":"iqis/stash","owner":"iqis","description":"Naive on-disk caching in R","archived":false,"fork":false,"pushed_at":"2019-08-25T05:33:03.000Z","size":51,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-17T20:11:43.488Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iqis.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-07-31T20:04:22.000Z","updated_at":"2022-07-19T15:31:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"d22bf30a-9019-4bf5-a41d-6aa3df81072a","html_url":"https://github.com/iqis/stash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iqis/stash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iqis%2Fstash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iqis%2Fstash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iqis%2Fstash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iqis%2Fstash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iqis","download_url":"https://codeload.github.com/iqis/stash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iqis%2Fstash/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267809470,"owners_count":24147468,"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-07-30T02:00:09.044Z","response_time":70,"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":[],"created_at":"2024-08-13T07:06:18.204Z","updated_at":"2025-07-30T04:31:28.269Z","avatar_url":"https://github.com/iqis.png","language":"R","readme":"---\noutput: github_document\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)\n```\n# stash\n\n\u003c!-- badges: start --\u003e\n[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/iqis/stash?branch=master\u0026svg=true)](https://ci.appveyor.com/project/iqis/stash)\n[![Travis build status](https://travis-ci.org/iqis/stash.svg?branch=master)](https://travis-ci.org/iqis/stash)\n[![Codecov test coverage](https://codecov.io/gh/iqis/stash/branch/master/graph/badge.svg)](https://codecov.io/gh/iqis/stash?branch=master)\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)\n[![CRAN status](https://www.r-pkg.org/badges/version/stash)](https://cran.r-project.org/package=stash)\n\u003c!-- badges: end --\u003e\n\nCreates a cache in binary in the file system for any R object, returning a reference to the cache file. This is useful if have many R objects to deal with, an cannot fit them all at once in your memory. \n\n## Installation\n\n```{r eval = FALSE}\ndevtools::install_github(\"iqis/stash\")\n```\n\n\n## Example\n\n```{r include = TRUE}\nrequire(stash)\nrequire(magrittr)\n```\n\nMake a stash. \n```{r}\nmtc_stash \u003c- stash(mtcars)\nmtc_stash\n```\n\nThis means that mtcars is written into the above location. (It is also thus exposed that I use Windows.)\n\n\nAccess the stash's content with an empty `[]`.\n```{r}\nmtc_stash[] %\u003e% head()\n```\n\nIf you need to do any subsetting, you may chain `[]` or `$` right after.\n```{r}\nmtc_stash[][1:5, \"mpg\"]\nmean(mtc_stash[]$cyl)\n```\n\n\nThe object also provides access other useful information.\n```{r}\nmtc_stash$obj_class\nmtc_stash$obj_size\nmtc_stash$file_path\nmtc_stash$has_stash_file()\nmtc_stash$has_content()\n```\n\nCurrently, as the data set is stashed on to the disc, we don't have a copy in the memory. But we can load it.\n```{r}\nmtc_stash$has_content()\nmtc_stash$load_content()\nmtc_stash$has_content()\nmtc_stash[]\n```\n\nWe can also remove the in-memory content to release memory. But we still can read from the disk as in the beginning. \n```{r}\nmtc_stash$remove_content()\nmtc_stash$has_content()\n```\n\n```{r}\nmtc_stash[]\n```\n\nFinally we can also remove the stash on the disk. If we do this now, we will end with no data anywhere.\n```{r error = TRUE}\nmtc_stash$remove_stash()\nmtc_stash$has_stash_file()\nmtc_stash[]\n```\n\n\n\n\n","funding_links":[],"categories":["R"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiqis%2Fstash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiqis%2Fstash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiqis%2Fstash/lists"}