cached_file: cached_file

Description Usage Arguments Details Value See Also Examples

View source: R/cached_file.R

Description

Object representing a file in the cache (does not have to exist.)

Usage

 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)

Arguments

x

object

...

additional arguments

ext

ext or character of allowable extensions. (Default:) or string used in the cache

Details

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:

Value

a cached_file (subclass of fs::fs_path) object of the filename. The extension

See Also

Examples

 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()

decisionpatterns/cache documentation built on June 15, 2020, 9:35 p.m.