Skip to content

Commit

Permalink
Merge pull request #251 from pharmaverse/618_templates_action@devel
Browse files Browse the repository at this point in the history
618 templates action@devel
  • Loading branch information
dgrassellyb authored Sep 18, 2023
2 parents 9e5494b + e7ec347 commit 12dee2b
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 6 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/templates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Check Templates

on:
workflow_dispatch:
pull_request:
branches:
- main
- devel

jobs:
templates:
name: Check Templates
uses: pharmaverse/admiralci/.github/workflows/check-templates.yml@main
secrets: inherit
with:
r-version: "4.1"
push-templates-data: true
exclude-templates-data: "adrs_basic"
9 changes: 7 additions & 2 deletions inst/templates/ad_adrs.R
Original file line number Diff line number Diff line change
Expand Up @@ -398,5 +398,10 @@ adrs <- adrs %>%

# Save output ----

dir <- tempdir() # Change to whichever directory you want to save the dataset in
saveRDS(adrs, file = file.path(dir, "adrs.rds"), compress = "bzip2")
dir <- file.path(getwd(), "tmp")
print(dir)
if (!file.exists(dir)) {
# Create the folder
dir.create(dir)
}
save(adrs, file = file.path(dir, "adrs.rda"), compress = "bzip2")
9 changes: 7 additions & 2 deletions inst/templates/ad_adrs_basic.R
Original file line number Diff line number Diff line change
Expand Up @@ -372,5 +372,10 @@ adrs <- adrs %>%

# ---- Save output ----

dir <- tempdir() # Change to whichever directory you want to save the dataset in
saveRDS(adrs, file = file.path(dir, "adrs.rds"), compress = "bzip2")
dir <- file.path(getwd(), "tmp")
print(dir)
if (!file.exists(dir)) {
# Create the folder
dir.create(dir)
}
save(adrs, file = file.path(dir, "adrs_basic.rda"), compress = "bzip2")
10 changes: 10 additions & 0 deletions inst/templates/ad_adtr.R
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,13 @@ adtr <- adtr %>%
dataset_add = select(adsl, !!!negate_vars(adsl_vars)),
by_vars = exprs(STUDYID, USUBJID)
)

# Save output ----

dir <- file.path(getwd(), "tmp")
print(dir)
if (!file.exists(dir)) {
# Create the folder
dir.create(dir)
}
save(adtr, file = file.path(dir, "adtr.rda"), compress = "bzip2")
9 changes: 7 additions & 2 deletions inst/templates/ad_adtte.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,10 @@ adtte <- adtte %>%

# Save output ----

dir <- tempdir() # Change to whichever directory you want to save the dataset in
saveRDS(adtte, file = file.path(dir, "adtte.rds"), compress = "bzip2")
dir <- file.path(getwd(), "tmp")
print(dir)
if (!file.exists(dir)) {
# Create the folder
dir.create(dir)
}
save(adtte, file = file.path(dir, "adtte.rda"), compress = "bzip2")

0 comments on commit 12dee2b

Please sign in to comment.