From d7229a6ad6eed289fc915db34feca442c6dd724b Mon Sep 17 00:00:00 2001 From: TsaiLintung <101155567+TsaiLintung@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:38:03 +0800 Subject: [PATCH] change sourcever build --- development/build_source.R | 13 ++++++++++--- .../{fastdid_sourcever.R => fastdid_0_9_2.R} | 5 +++-- development/source_head.R | 3 +++ fastdid.Rproj | 17 +++++++++++++++++ 4 files changed, 33 insertions(+), 5 deletions(-) rename development/{fastdid_sourcever.R => fastdid_0_9_2.R} (99%) create mode 100644 development/source_head.R create mode 100644 fastdid.Rproj diff --git a/development/build_source.R b/development/build_source.R index cde2d46..7d3bbc3 100644 --- a/development/build_source.R +++ b/development/build_source.R @@ -1,16 +1,23 @@ rm(list = ls()) gc() -setwd("~/GitHub/EventStudyCode") +library(stringr) +library(here) -source_files <- list.files("R", include.dirs = FALSE, full.names = TRUE) +source_files <- list.files(here("R"), include.dirs = FALSE, full.names = TRUE) ver <- "0.9.2" vername <- "unbalanced" +dep <- c("data.table", "stringr", "BMisc", "collapse", "dreamerr", "parglm") -sink("interactive/fastdid_sourcever.R") +sink(here("development/source_head.R")) cat(paste0("#", as.character(Sys.Date()), "\n")) cat(paste0("message('loading fastdid source ver. ver: ", ver, " (", vername ,"), date: " , as.character(Sys.Date()), "')\n")) +cat(paste0("require(", dep, ");") |> str_flatten()) +sink() + +sink(paste0("development/fastdid_", str_replace_all(ver, "\\.", "_"), ".R")) +cat(readLines(here("development/source_head.R")), sep ="\n") for(file in source_files){ current_file = readLines(file) cat(current_file, sep ="\n") diff --git a/development/fastdid_sourcever.R b/development/fastdid_0_9_2.R similarity index 99% rename from development/fastdid_sourcever.R rename to development/fastdid_0_9_2.R index 78b3969..a809b86 100644 --- a/development/fastdid_sourcever.R +++ b/development/fastdid_0_9_2.R @@ -1,5 +1,6 @@ -#2023-12-21 -message('loading fastdid source ver. ver: 0.9.2 (unbalanced), date: 2023-12-21') +#2024-04-17 +message('loading fastdid source ver. ver: 0.9.2 (unbalanced), date: 2024-04-17') +require(data.table);require(stringr);require(BMisc);require(collapse);require(dreamerr);require(parglm); aggregate_gt <- function(gt_result, cohort_sizes, id_weights, id_cohorts, result_type, balanced_event_time){ diff --git a/development/source_head.R b/development/source_head.R new file mode 100644 index 0000000..ea6800f --- /dev/null +++ b/development/source_head.R @@ -0,0 +1,3 @@ +#2024-04-17 +message('loading fastdid source ver. ver: 0.9.2 (unbalanced), date: 2024-04-17') +require(data.table);require(stringr);require(BMisc);require(collapse);require(dreamerr);require(parglm); \ No newline at end of file diff --git a/fastdid.Rproj b/fastdid.Rproj new file mode 100644 index 0000000..21a4da0 --- /dev/null +++ b/fastdid.Rproj @@ -0,0 +1,17 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX + +BuildType: Package +PackageUseDevtools: Yes +PackageInstallArgs: --no-multiarch --with-keep.source