Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ropensci/hoardr
Manage cached files
https://github.com/ropensci/hoardr
caching r r-package rstats
Last synced: 3 months ago
JSON representation
Manage cached files
- Host: GitHub
- URL: https://github.com/ropensci/hoardr
- Owner: ropensci
- License: other
- Created: 2017-01-12T18:27:17.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-01-23T10:20:37.000Z (10 months ago)
- Last Synced: 2024-06-11T12:43:16.079Z (5 months ago)
- Topics: caching, r, r-package, rstats
- Language: R
- Homepage:
- Size: 131 KB
- Stars: 22
- Watchers: 6
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- jimsghstars - ropensci/hoardr - Manage cached files (R)
README
---
output: github_document
editor_options:
chunk_output_type: console
---```{r echo=FALSE}
knitr::opts_chunk$set(
warning = FALSE,
message = FALSE,
collapse = TRUE,
comment = "#>"
)
```
# hoardr[![status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![cran checks](https://badges.cranchecks.info/worst/hoardr.svg)](https://badges.cranchecks.info/worst/hoardr.svg)
[![R-check](https://github.com/ropensci/hoardr/workflows/R-check/badge.svg)](https://github.com/ropensci/hoardr/actions?query=workflow%3AR-check)
[![codecov.io](https://codecov.io/github/ropensci/hoardr/coverage.svg?branch=master)](https://app.codecov.io/github/ropensci/hoardr?branch=master)
[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/hoardr)](https://cran.r-project.org/package=hoardr)
[![cran version](https://www.r-pkg.org/badges/version/hoardr)](https://cran.r-project.org/package=hoardr)`hoard` - manage cached files
Exposes a single `R6` object so that when the package is imported in another
package for managing cached files, you don't need to pollute the NAMESPACE
with a bunch of functions. (you can always just `hoardr::fxn`, but
with a single object there are other benefits as well [maintaining state, e.g.]).## install
stable
```{r eval=FALSE}
install.packages("hoardr")
```dev version
```{r eval=FALSE}
remotes::install_github("ropensci/hoardr")
``````{r}
library(hoardr)
```## usage
initialize client
```{r}
(x <- hoardr::hoard())
```set cache path
```{r}
x$cache_path_set("foobar", type = 'tempdir')
```make the directory if doesn't exist
```{r}
x$mkdir()
```put a file in the cache
```{r}
cat("hello world", file = file.path(x$cache_path_get(), "foo.txt"))
```list the files
```{r}
x$list()
```details
```{r}
x$details()
```delete by file name
```{r}
x$delete("foo.txt")
x$list()
```## Meta
* Please [report any issues or bugs](https://github.com/ropensci/hoardr/issues).
* License: MIT
* Get citation information for `hoardr` in R doing `citation(package = 'hoardr')`
* Please note that this project is released with a [Contributor Code of Conduct][coc]. By participating in this project you agree to abide by its terms.[![rofooter](https://ropensci.org/public_images/github_footer.png)](https://ropensci.org)
[coc]: https://github.com/ropensci/hoardr/blob/master/CODE_OF_CONDUCT.md