/
t_backup_inputs.R
48 lines (38 loc) · 991 Bytes
/
t_backup_inputs.R
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
t_backup_inputs <- list(
tar_target(
backup_nindss,
{
file_path <- paste0(archive_dir, "/nindss.fst")
if(file.exists(file_path))
return(file_path)
fst::write_fst(nindss, path = file_path, compress = 100)
return(file_path)
},
cue = tar_cue_skip(is_retro),
format = "file"
),
tar_target(
backup_local_cases,
{
file_path <- paste0(archive_dir, "/local_cases.csv")
if(file.exists(file_path))
return(file_path)
file.copy(tar_read(raw_local_cases), file_path, overwrite = TRUE)
return(file_path)
},
cue = tar_cue_skip(is_retro),
format = "file"
),
tar_target(
backup_ensemble,
{
file_path <- paste0(archive_dir, "/ensemble.parquet")
if(file.exists(file_path))
return(file_path)
file.copy(tar_read(raw_ensemble), file_path, overwrite = TRUE)
return(file_path)
},
cue = tar_cue_skip(is_retro),
format = "file"
)
)