Package: reproducible 2.1.1.9006

Eliot J B McIntire

reproducible: Enhance Reproducibility of R Code

A collection of high-level, machine- and OS-independent tools for making reproducible and reusable content in R. The two workhorse functions are Cache() and prepInputs(). Cache() allows for nested caching, is robust to environments and objects with environments (like functions), and has deals with some classes of file-backed R objects e.g., from terra and raster packages. Both functions have been developed to be foundational components of data retrieval and processing in continuous workflow situations. In both functions, efforts are made to make the first and subsequent calls of functions have the same result, but faster at subsequent times by way of checksums and digesting. Several features are still under development, including cloud storage of cached objects, allowing for sharing between users. Several advanced options are available, see ?reproducibleOptions().

Authors:Eliot J B McIntire [aut, cre], Alex M Chubaty [aut], Tati Micheletti [ctb], Ceres Barros [ctb], Ian Eddy [ctb], His Majesty the King in Right of Canada, as represented by the Minister of Natural Resources Canada [cph]

reproducible_2.1.1.9006.tar.gz
reproducible_2.1.1.9006.zip(r-4.5)reproducible_2.1.1.9006.zip(r-4.4)reproducible_2.1.1.9006.zip(r-4.3)
reproducible_2.1.1.9006.tgz(r-4.4-any)reproducible_2.1.1.9006.tgz(r-4.3-any)
reproducible_2.1.1.9006.tar.gz(r-4.5-noble)reproducible_2.1.1.9006.tar.gz(r-4.4-noble)
reproducible_2.1.1.9006.tgz(r-4.4-emscripten)reproducible_2.1.1.9006.tgz(r-4.3-emscripten)
reproducible.pdf |reproducible.html
reproducible/json (API)
NEWS

# Install 'reproducible' in R:
install.packages('reproducible', repos = c('https://predictiveecology.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/predictiveecology/reproducible/issues

On CRAN:

reproducibilityreproducible-research

10.24 score 41 stars 15 packages 123 scripts 1.4k downloads 1 mentions 110 exports 10 dependencies

Last updated 2 months agofrom:631cc06f09 (on development). Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 19 2024
R-4.5-winOKNov 19 2024
R-4.5-linuxOKNov 19 2024
R-4.4-winOKNov 19 2024
R-4.4-macOKNov 19 2024
R-4.3-winOKNov 19 2024
R-4.3-macOKNov 19 2024

Exports:.addChangedAttr.addTagsToOutput.cacheMessage.cacheMessageObjectToRetrieve.checkCacheRepo.file.move.formalsNotInCurrentDots.grepSysCalls.isMemoised.orderDotsUnderscoreFirst.preDigestByClass.prefix.prepareOutput.requireNamespace.robustDigest.setSubAttrInList.sortDotsUnderscoreFirst.suffix.tagsByClass.unwrap.wrapasPathassessDataTypebasename2CacheCacheDBFileCacheDBTableNameCacheDigestCacheGeoCacheIsACacheCacheStorageDirCacheStoredFilecccheckAndMakeCloudFolderIDcheckPathChecksumsclearCachecompareNAconvertPathsconvertRasterPathsCopycopyFilecreateCachecropInputscropTodataType2downloadFileextractFromCachefastMaskFilenamesfixErrorsfixErrorsIngdalMaskgdalProjectgdalResamplegetRelativeinternetExistsisUpdatedkeepCachelinkOrCopylistNamedloadFileloadFromCachemakeMemoisablemakeRelativemaskInputsmaskTomaxFnmergeCachemessageCachemessageColouredmessageDFmessagePrepInputsmessagePreProcessmessageQuestionminFnmovedCachenlayers2normPathnormPathRelobjSizeobjSizeSessionpaddedFloatToCharpostProcesspostProcessTerrapostProcessToprepInputspreProcesspreProcessParamsprojectInputsprojectTorasterReadremapFilenamesreproducibleOptionsretryrmFromCachesearchFullsearchFullExset.randomseedshowCachestudyAreaNametempdir2tempfile2unmakeMemoisableupdateFilenameSlotsurlExistsvalues2writeFuturewriteOutputswriteTo

Dependencies:cpp11crayondata.tabledigestfilelockfpComparefslobstrprettyunitsrlang

Introduction to Cache

Rendered fromIntro-to-Cache.Rmdusingknitr::rmarkdownon Nov 19 2024.

Last update: 2024-05-15
Started: 2018-06-13

Readme and manuals

Help Manual

Help pageTopics
The 'reproducible' packagereproducible-package reproducible
Attach debug info to return for Cache.debugCache
Move a file to a new location - Defunct - use 'hardLinkOrCopy'.file.move
Evaluate whether a cacheId is memoised.isMemoised
Add a prefix or suffix to the basename part of a file path.prefix .suffix suffix
Copy the file-backing of a file-backed Raster* object.prepareFileBackedRaster
Remove attributes that are highly varying.removeCacheAtts
Provide standard messaging for missing package dependencies.requireNamespace
Set subattributes within a list by reference.setSubAttrInList
Deal with class for saving to and loading from Cache or Disk.unwrap .unwrap.default .unwrap.environment .unwrap.list .wrap .wrap.default .wrap.environment .wrap.list
Assess the appropriate raster layer data typeassessDataType assessDataType.default
A version of 'base::basename' that is 'NULL' resistantbasename2
Saves a wide variety function call outputs to disk and optionally RAM, for recovery laterCache
The exact digest function that 'Cache' usesCacheDigest
Cache-like function for spatial domainsCacheGeo
Check for presence of 'checkFolderID' (for 'Cache(useCloud)')checkAndMakeCloudFolderID
Check directory pathcheckPath checkPath,character,logical-method checkPath,character,missing-method checkPath,missing,ANY-method checkPath,NULL,ANY-method
An alternative to 'basename' and 'dirname' when there are sub-folderscheckRelative
Calculate checksumChecksums Checksums,character,logical-method Checksums,character,missing-method
Download from cloud, if necessarycloudDownload
'NA'-aware comparison of two vectorscompareNA
Change the absolute path of a fileconvertPaths convertRasterPaths
Recursive copying of nested environments, and other "hard to copy" objectsCopy Copy,ANY-method Copy,data.frame-method Copy,data.table-method Copy,list-method Copy,refClass-method
Copy a file using 'robocopy' on Windows and 'rsync' on Linux/macOScopyFile copySingleFile
Low-level functions to create and work with a cacheCacheDBFile CacheDBTableName CacheIsACache CacheStorageDir CacheStoredFile createCache extractFromCache loadFromCache rmFromCache
Determine filename, either automatically or manuallydetermineFilename
A wrapper around a set of downloading functionsdownloadFile
Download a remote filedownloadRemote
Extract files from archiveextractFromArchive
Faster operations on rasters (DEPRECATED because 'terra::mask' is fast)fastMask
Return the filename(s) from a Raster* objectFilenames Filenames,ANY-method Filenames,data.table-method Filenames,environment-method Filenames,list-method Filenames,Path-method
Fix common errors in GIS layers, using 'terra'fixErrorsIn
3-Step postProcess sequence for SpatRasters using 'gdalwarp'gdalMask gdalProject gdalResample
Relative pathsgetRelative makeRelative
Checks for existed of a url or the internet using <https://CRAN.R-project.org>internetExists urlExists
Has a cached object has been updated?isUpdated
Keep original geometries of 'sf' objectskeepOrigGeom
Hardlink, symlink, or copy a filelinkOrCopy
Create a list with names from object nameslistNamed
Load a file from the cacheloadFile
Merge two cache repositories togethermergeCache mergeCache,ANY-method
Use 'message' with a consistent use of 'verbose'.messageFunctionFn messageCache messageColoured messageDF messagePrepInputs messagePreProcess messageQuestion
Get min or maximum value of a (Spat)RasterdataType2 maxFn minFn nlayers2 values2
Deal with moved cache issuesmovedCache
Normalize file pathsnormPath normPath,character-method normPath,list-method normPath,logical-method normPath,missing-method normPath,NULL-method normPathRel
Wrapper around 'lobstr::obj_size'objSize objSizeSession
Convert numeric to character with paddingpaddedFloatToChar
Coerce a character string to a class "Path"asPath asPath.character asPath.null Path-class
Generic function to post process objectspostProcess postProcess.default postProcess.list
Transform a GIS dataset so it has the properties (extent, projection, mask) of anothercropTo maskTo postProcessTerra postProcessTo projectTo writeTo
Download and optionally post-process filesprepInputs
Download, Checksum, Extract filespreProcess preProcessParams
A helper to 'getOption("reproducible.rasterRead")'rasterRead
Remap file namesremapFilenames
'reproducible' optionsreproducibleOptions
A wrapper around 'try' that retries on failureretry
Save an object to CachesaveToCache
Search up the full scope for functionssearchFull searchFullEx
Set seed with a random value using Sys.time()set.randomseed
Examining and modifying the cachecc clearCache clearCache,ANY-method keepCache keepCache,ANY-method showCache showCache,ANY-method
Get a unique name for a given study areastudyAreaName studyAreaName,ANY-method studyAreaName,character-method
Make a temporary (sub-)directorytempdir2
Make a temporary file in a temporary (sub-)directorytempfile2
The known path for unrar or 7z.unrarPath unrarPath
Write to cache repository, using 'future::future'writeFuture