{"id":14068627,"url":"https://github.com/PredictiveEcology/lazyR","last_synced_at":"2025-07-30T04:31:30.041Z","repository":{"id":77257880,"uuid":"42975641","full_name":"PredictiveEcology/lazyR","owner":"PredictiveEcology","description":"An R package for stashing objects in lazy load databases, analogous to lazy loaded packages","archived":false,"fork":false,"pushed_at":"2016-01-05T19:42:34.000Z","size":176,"stargazers_count":5,"open_issues_count":3,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T13:14:57.443Z","etag":null,"topics":[],"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/PredictiveEcology.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}},"created_at":"2015-09-23T03:16:46.000Z","updated_at":"2020-03-10T13:59:33.000Z","dependencies_parsed_at":"2023-02-23T17:15:28.750Z","dependency_job_id":null,"html_url":"https://github.com/PredictiveEcology/lazyR","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PredictiveEcology/lazyR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PredictiveEcology%2FlazyR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PredictiveEcology%2FlazyR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PredictiveEcology%2FlazyR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PredictiveEcology%2FlazyR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PredictiveEcology","download_url":"https://codeload.github.com/PredictiveEcology/lazyR/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PredictiveEcology%2FlazyR/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267809474,"owners_count":24147470,"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.797Z","updated_at":"2025-07-30T04:31:29.713Z","avatar_url":"https://github.com/PredictiveEcology.png","language":"R","readme":"# lazyR\n\nAn R package for stashing objects in lazy load databases, analogous to lazy loaded packages.\nThis uses the `archivist` package for the back end, using the `.rda` files or raster-based files. The lazy mechanism is at loading time only, creating a promise to evaluate the `loadFromLocalRepo()` function when it is needed.\n\n## Using manual lazy saving\n\nThe basic work flow is:\n\n1. decide on a folder for the database, and set it using `lazyDir()`\n\n2. save objects to a lazyR database using `lazySave(obj)`\n\n    - optionally give it tags while saving: `lazySave(obj, tags=c(\"maps\", \"USA\"))`\n\n3. list the contents of the lazyR database with `lazyLs()`\n4. re-load objects via name or tag using `lazyLoad2(tag=\"maps\")`\n5. remove objects via `lazyRm(\"objName\")` or `lazyRm(lazyLs(\"tagname\"))`\n\n## Using caching (automatic lazy saving)\n\nAn alternative workflow is to use the `%\u003c%` (`assignCache`) operator, which will automatically cache the object with its assigned object name. Caching, like with the archivist package, will first do a hash of the arguments in the function, compare with the hashed value of the objects in the database, and return the cached object, if the hash values are the same.\n\nExample:\n\n1. decide on a folder for the database, and set it using\n\n    lazyDir(tempdir(), create=TRUE)\n\n2. assign objects via `%\u003c%`. See help(cacheAssign)\n\n    a %\u003c% seq(1,10,1)\n\n## Common things to use:\n\n- `lazyLs()` will list all objects in the database\n- `lazyLs(tagType=\"all\")` will list the full `archivist` `data.frame` with columns: `md5Hash`, `tag`, `dateCreated`.\n- others to come\n\n## Connection with `archivist` package\n\nThe `lazyDir` argument in the `lazyR` package is exactly the same as a repository in archivist.\nThus, all archivist functions work with the `lazyR` package. Simply use lazyDir and RepoDir interchangeably.\n\nNotes:\n\n- Some tags are done automatically\n\n    - a full set of classes, a result of a call to `is(obj)`, prefixed by `class:` in the tags\n    - the original object name, prefixed with `objectName:`    \n    \n- Objects of class `Raster*` are special because of their \"sometimes on disk\" nature. \n    \n    - If there is a file backing the object, then this file will be copied to the lazyDir directory, with a subdirectory called \"raster\"\n    - The original file will be used as part of the lazy loading.\n    - If the original file is a temporary file, be sure to use `lazySave(..., copyRasterFile=TRUE)` to save it. This is also required to ensure portability of a `lazyR` database.\n\n","funding_links":[],"categories":["R"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPredictiveEcology%2FlazyR","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPredictiveEcology%2FlazyR","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPredictiveEcology%2FlazyR/lists"}