Skip to content

Commit 6e730eb

Browse files
committed
revise metadata handling
1 parent 0e54666 commit 6e730eb

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

data-raw/NowcastedTables.R

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ source("data-raw/BEAData.R")
44
source("R/UtilityFunctions.R")
55

66
ls <- list("url" = "USEEIO",
7-
"date_accessed" = "",
7+
"date_accessed" = format(Sys.Date(), "%Y-%m-%d"),
88
"date_last_modified" = "")
99

1010
dir <- file.path(rappdirs::user_data_dir(), "USEEIO-input")
1111
dir.create(dir, showWarnings = FALSE)
1212

1313
for(yr in c(2018:2023)) {
1414
name <- "U_out"
15-
df <- read.csv(file.path(dir, paste0(name, "_", yr, ".csv")))
15+
file <- file.path(dir, paste0(name, "_", yr, ".csv"))
16+
ls['date_last_modified'] <- as.character(as.Date(file.mtime(file)))
17+
df <- read.csv(file)
1618
rownames(df) <- df[, 1]
1719
df <- df[, -1]
1820
names(df) <- gsub("^X", "", names(df))
@@ -21,7 +23,9 @@ for(yr in c(2018:2023)) {
2123
schema_year = 2017)
2224

2325
name <- "U_imports_out"
24-
df <- read.csv(file.path(dir, paste0(name, "_", yr, ".csv")))
26+
file <- file.path(dir, paste0(name, "_", yr, ".csv"))
27+
ls['date_last_modified'] <- as.character(as.Date(file.mtime(file)))
28+
df <- read.csv(file)
2529
rownames(df) <- df[, 1]
2630
df <- df[, -1]
2731
names(df) <- gsub("^X", "", names(df))
@@ -30,7 +34,9 @@ for(yr in c(2018:2023)) {
3034
schema_year = 2017)
3135

3236
name <- "V_out"
33-
df <- read.csv(file.path(dir, paste0(name, "_", yr, ".csv")))
37+
file <- file.path(dir, paste0(name, "_", yr, ".csv"))
38+
ls['date_last_modified'] <- as.character(as.Date(file.mtime(file)))
39+
df <- read.csv(file)
3440
rownames(df) <- df[, 1]
3541
df <- df[, -1]
3642
names(df) <- gsub("^X", "", names(df))

0 commit comments

Comments
 (0)