Description Usage Arguments Details Value See Also Examples
Object representing a file in the cache (does not have to exist.)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## Default S3 method:
as_cached_ext(x, exts = NULL)
cached_file(x)
## S3 method for class 'cached_file'
print(x, ...)
as_cached_file(x, ext = backend_exts())
## Default S3 method:
as_cached_file(x, ext = backend_exts())
## S3 method for class 'character'
as_cached_file(x, ext = backends_exts())
## S3 method for class 'fs_path'
as_cached_file(x, ext = NULL)
## S3 method for class 'cached_name'
as_cached_file(x, ext = backends_exts())
## S3 method for class ''NULL''
as_cached_name(x)
## Default S3 method:
as_cached_name(x)
|
x |
object |
... |
additional arguments |
ext |
ext or character of allowable extensions. (Default:) or string used in the cache |
A cached_file
is a subclass of fs_path
object without the directory.
It is the filename without the path information.
When x
is a character object, as_cached_file
will:
convert it as-is if ending in a registered extension (may change)
coerce it to existing cached_object name if an existing file
exists in the cache
use the default extension prodivide by backend_exts()
or cached_name object, cached_file is looked for as:
an existing file in cache_path()
with one of the backend extensions
a cached_file
(subclass of fs::fs_path
) object of the filename. The extension
fs::path()
1 2 3 4 5 6 7 8 9 10 11 12 13 | cached_file('iris.rds') # e.g. "iris.rds"
as_cached_file('iris.rds') # Warn: Don't include extension
as_cached_file('iris', 'rds' )
as_cached_file(iris)
"iris.rds" %>% cached_file()
"iris" %>% as_cached_file()
"cache/iris.rds" %>% cached_path() %>% as_cached_file()
cached_name('iris') %>% as_cached_file()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.