-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed merge conflicts after pull from main
Merge commit '61343b054d2a190eb1e20de6bcb1265c10d2ac34' #Conflicts: # .Rbuildignore # DESCRIPTION
- Loading branch information
Showing
12 changed files
with
300 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
^\.Rproj\.user$ | ||
^LICENSE\.md$ | ||
^data-raw$ | ||
^\.github$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
on: | ||
push: | ||
branches: [main, master] | ||
pull_request: | ||
branches: [main, master] | ||
|
||
name: R-CMD-check | ||
|
||
jobs: | ||
R-CMD-check: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
R_KEEP_PKG_SOURCE: yes | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::rcmdcheck | ||
needs: check | ||
|
||
- uses: r-lib/actions/check-r-package@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
name: Commands | ||
|
||
jobs: | ||
document: | ||
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }} | ||
name: document | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/pr-fetch@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::roxygen2 | ||
needs: pr-document | ||
|
||
- name: Document | ||
run: roxygen2::roxygenise() | ||
shell: Rscript {0} | ||
|
||
- name: commit | ||
run: | | ||
git config --local user.name "$GITHUB_ACTOR" | ||
git config --local user.email "[email protected]" | ||
git add man/\* NAMESPACE | ||
git commit -m 'Document' | ||
- uses: r-lib/actions/pr-push@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
style: | ||
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }} | ||
name: style | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/pr-fetch@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
|
||
- name: Install dependencies | ||
run: install.packages("styler") | ||
shell: Rscript {0} | ||
|
||
- name: Style | ||
run: styler::style_pkg() | ||
shell: Rscript {0} | ||
|
||
- name: commit | ||
run: | | ||
git config --local user.name "$GITHUB_ACTOR" | ||
git config --local user.email "[email protected]" | ||
git add \*.R | ||
git commit -m 'Style' | ||
- uses: r-lib/actions/pr-push@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
on: | ||
push: | ||
branches: [main, master] | ||
pull_request: | ||
branches: [main, master] | ||
|
||
name: test-coverage | ||
|
||
jobs: | ||
test-coverage: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::covr | ||
needs: coverage | ||
|
||
- name: Test coverage | ||
run: | | ||
covr::codecov( | ||
quiet = FALSE, | ||
clean = FALSE, | ||
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") | ||
) | ||
shell: Rscript {0} | ||
|
||
- name: Show testthat output | ||
if: always() | ||
run: | | ||
## -------------------------------------------------------------------- | ||
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true | ||
shell: bash | ||
|
||
- name: Upload test results | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-test-failures | ||
path: ${{ runner.temp }}/package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
.Rhistory | ||
.RData | ||
.Ruserdata | ||
inst/doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +0,0 @@ | ||
|
||
# 0: Master Script for Creating Diabetes Population -------------------------- | ||
|
||
# Load dependencies: | ||
library(haven) | ||
library(data.table) | ||
library(lubridate) | ||
library(here) | ||
library(fs) | ||
|
||
# 1: Run Import Script to Convert Raw Files from SAS Format -------- | ||
|
||
# Set path to root of raw files folder, e.g.: | ||
foreign_folder = 'E:/ProjektDB/ALMAU/Rawdata/707517/' | ||
|
||
# Set names of files to be imported. Can be split across multiple virtual machines for saving time. | ||
# Executing everything on one machine works fine too. | ||
|
||
# To run in 3 simultaneous chuncks on 3 virtual machines, run each of the following sections of 3 lines on a different machine: | ||
sas_files_1 <- "^bef|^lpr_diag|^uaf_diag|^lpr_adm|^uaf_adm|.*sksube201[4-8]" | ||
sas_file_list <- list.files(path = foreign_folder, pattern = sas_files_1, recursive = T) | ||
source(here("R/import.R")) | ||
|
||
# | ||
sas_files_2 <- "^sysi|^sssy200[6-9]|^sssy20[1-9]" | ||
sas_file_list <- list.files(path = foreign_folder, pattern = sas_files_2, recursive = T) | ||
source(here("R/import.R")) | ||
|
||
# | ||
sas_files_3 <- "^lab|^lmdb" | ||
|
||
sas_files_3 <- "^udda|^akm|^faik" | ||
sas_file_list <- list.files(path = foreign_folder, pattern = sas_files_3, recursive = T) | ||
source(here("R/import.R")) | ||
|
||
# Set path to root of secondary raw files folder, e.g.: | ||
foreign_folder = 'E:/ProjektDB/ALMAU/Rawdata/707517/Eksterne data/2021-06-09 fra SDS/' | ||
sas_files_3 <- "^lab_forsker" | ||
sas_file_list <- list.files(path = foreign_folder, pattern = sas_files_3, recursive = T) | ||
source(here("R/import.R")) | ||
|
||
|
||
# Note exclusion of either of sssy and sysi in 2005, where they potentially overlap. | ||
# Note also that we import medication prescriptions from all years, even though we only filter and use those from 1997 onwards. | ||
|
||
|
||
# 2: Run Filter Script to Create Source Data --------------------------------- | ||
|
||
source(here("R/filter.R")) | ||
|
||
|
||
|
||
# 3: Run Population Script to Generate Diabetes Population ------------------- | ||
source(here("R/population.R")) | ||
|
||
|
||
# 4: Draw a Live Sample of the Diabetes Population at a Point in Time-------------------- | ||
source(here("R/draw_dm_sample.R")) | ||
|
||
# Import the entire diabetes population through time: | ||
dm_population <- readRDS(here('data/output/dm_population.rds')) | ||
# Select which year to draw the population: | ||
|
||
dm_2019 <- draw_dm_sample(sample_year = 2019) | ||
saveRDS(dm_2019, here("data/output/dm_population_2019.rds")) | ||
|
||
rm(dm_population, dm_2018) | ||
|
||
# And draw the corresponding diagrams: | ||
source(here("R/flowcharts.R")) | ||
load(here("data", "source", "flowchart_counts.Rdata")) | ||
draw_inclusion() | ||
draw_type(sample_year = 2019) | ||
|
||
|
||
# 5: Compress Imported Raw Data to Save Space ----------------------------- | ||
|
||
compress = TRUE | ||
# Can be set to FALSE if wanting to uncompress the raw data at a later point | ||
|
||
source(here("R/compress.R")) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#' @keywords internal | ||
"_PACKAGE" | ||
|
||
## usethis namespace: start | ||
#' @importFrom lifecycle deprecated | ||
## usethis namespace: end | ||
NULL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.html | ||
*.R |
Oops, something went wrong.