Skip to content

Commit

Permalink
change sourcever build
Browse files Browse the repository at this point in the history
  • Loading branch information
TsaiLintung committed Apr 17, 2024
1 parent 002094d commit d7229a6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
13 changes: 10 additions & 3 deletions development/build_source.R
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
Original file line number Diff line number Diff line change
@@ -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){
Expand Down
3 changes: 3 additions & 0 deletions development/source_head.R
Original file line number Diff line number Diff line change
@@ -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);
17 changes: 17 additions & 0 deletions fastdid.Rproj
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d7229a6

Please sign in to comment.