@@ -4,15 +4,17 @@ source("data-raw/BEAData.R")
44source(" R/UtilityFunctions.R" )
55
66ls <- list (" url" = " USEEIO" ,
7- " date_accessed" = " " ,
7+ " date_accessed" = format(Sys.Date(), " %Y-%m-%d " ) ,
88 " date_last_modified" = " " )
99
1010dir <- file.path(rappdirs :: user_data_dir(), " USEEIO-input" )
1111dir.create(dir , showWarnings = FALSE )
1212
1313for (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