# NOT RUN {
# Make a folder on googledrive -- share it with yourself and anybody else -- either use
# googledrive package or do this manually on drive.google.com
# Grab the share link -- pass it here to cloudFolderID
# first time -- looks in cloudFolderID for checksums -- none there, so it makes it
# then it runs the function, caching locally, and uploading to cloud -- copy exists in
# 2 places
library(googledrive)
newDir <- drive_mkdir("testFolder")
a1 <- cloudCache(rnorm, 1, cloudFolderID = newDir$id)
# second time -- sees that it is in both places, takes local
a2 <- cloudCache(rnorm, 1, cloudFolderID = newDir$id)
# clear local -- get from cloud copy, make a local copy in cacheRepo
clearCache(ask = FALSE)
a3 <- cloudCache(rnorm, 1, cloudFolderID = newDir$id)
# now both local and cloud exist
a4 <- cloudCache(rnorm, 1, cloudFolderID = newDir$id)
# Clean up -- see cloudSyncCache
# }
Run the code above in your browser using DataLab