Skip to content

Commit

Permalink
Closes #10 add function create_iso8601() (#21)
Browse files Browse the repository at this point in the history
* clean up dummy test

* add `dtc_formats` data set

* update .Rbuildignore

* add tibble support for automatic pretty printing of tibbles

* add `create_iso8601()` (closes #10)

* clean up `lintr::lint_package()` issues

* Automatic renv profile update.

* Automatic renv profile update.

* Fix typos in R/dtc_utils.R

Co-authored-by: edgar-manukyan <[email protected]>

* remove `dummy()` function

* remove `.onLoad()` function

This function was likely added as part of an automatic setup of the R package as a whole but I guess we should add the `.onLoad()` if really needed.

* Remove the `is_dtc_fmt()` function

Initially I thought of calling this function from within `assert_dtc_fmt()` but I think now that the current usage of `rlang::arg_match()` leads to more concise code, so this is preferred.

* Import `.data` from rlang globally

Import `.data` from rlang globally by using the R package level documentation (https://roxygen2.r-lib.org/articles/rd-other.html?q=_PACKAGE#packages).

* Update WORDLIST

* Update `assert_capture_matrix()` and `complete_capture_matrix()` docs

* Add `coalesce_capture_matrices()` doc

* Fix typo in `assert_dtc_fmt()` doc

* Add `regex_or()` doc

* Add `fmt_rg()` doc

* Add `fmt_c()` doc

* Add `parse_dttm_fmt()` doc

* Fix doc of `parse_dttm_fmt()`

* Add `dttm_fmt_to_regex()` doc

* Bump development version to 0.0.0.9001

* Style updates

Style updates on R/dtc_create_iso8601.R, R/dtc_parse_dttm.R, R/dtc_utils.R. Mostly indentation corrections, wrapping single line body if-conditions in braces, white space removal.

* Style update to tests/testthat/test-yy_to_yyyy.R

* Style update

Style updates on tests/testthat/test-iso8601.R and tests/testthat/test-reg_matches.R

* Blank lines removal

* Style update

* Update docs after style update

* Refactor code about parsing dttm formats

Made `dttm_fmt_to_regex()` interface more intitutive by accepting directly the argument `fmt` instead of `tbl_fmt_c` which was an intermediate R object returned by `parse_dttm_fmt()`. Also, introduced unit tests for `parse_dttm_fmt_()`.

* Make `parse_dttm_fmt()` handle the case of no matching format components

* Use `fmt_dttmc()` in unit tests

* Small clarification on unit test description

* Remove futile assertion from `assert_dtc_fmt()`

* Add staged_dependencies for admiraldev (#26)

* Add staged_dependencies for admiraldev

* Add new line

* Fix admiraldev links.

* Fix admiraldev articles links.

* Remove R 4.1 a it causing dependencies issues. We want to use purrr >= 1.0.0

* Test latest lintr

* Test lintr with install package locally

* Add install pacakge variable for lintr

* Skip multi version pkgdown workflow.

* R build ignore staged_dependencies.yaml

* Automatic renv profile update.

* Automatic renv profile update.

* Cleaned up lintr issues

* Export `fmt_cmp()` and add early draft of `create_iso8601()` article

* Update `create_iso8601()` article

* Link `create_iso8601()` doc to article "iso_8601"

* Add RM as author to DESCRIPTION

* Fix author role of RM

* Fix indentation at `fmt_cmp()` source

* Remove `.check_format` from examples and add an example with `fmt_cmp()`

* Add an example to `create_iso8601()` with involving alternative formats and unk values

* Add example to `create_iso8601()` about the interplay of `.format` and `.fmt_c`

* Update common.yml

* Update style

* Change "oak" to "sdtm.oak" in DESCRIPTION

* Change "oak" to "sdtm.oak" in README

---------

Co-authored-by: ramiromagno <[email protected]>
Co-authored-by: edgar-manukyan <[email protected]>
Co-authored-by: Adam Foryś <[email protected]>
  • Loading branch information
4 people authored Nov 29, 2023
1 parent 17e4452 commit 9d4944e
Show file tree
Hide file tree
Showing 69 changed files with 3,215 additions and 1,447 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
^pkgdown$
^LICENSE\.md$
^\.lintr$
^data-raw$
^staged_dependencies.yaml$
^vignettes/articles$
2 changes: 1 addition & 1 deletion .Rprofile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Sys.setenv("RENV_CONFIG_AUTO_SNAPSHOT" = FALSE)
if (!Sys.getenv("RENV_AUTOLOADER_ENABLED") %in% c("false", "FALSE")) {
.renv_profile <- paste(R.version$major, substr(R.version$minor, 1, 1), sep = ".")
if (!file.exists("./renv/profile")) {
if (.renv_profile %in% c("4.1", "4.2", "4.3")) {
if (.renv_profile %in% c("4.2", "4.3")) {
message("Set renv profile to `", .renv_profile, "`")
Sys.setenv("RENV_PROFILE" = .renv_profile)
} else {
Expand Down
95 changes: 0 additions & 95 deletions .devcontainer/4.1/devcontainer.json

This file was deleted.

8 changes: 3 additions & 5 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,15 @@ jobs:
# Whether to skip multiversion docs
# Note that if you have multiple versions of docs,
# your URL links are likely to break due to path changes
skip-multiversion-docs: false
latest-tag-alt-name: cran-release
multiversion-docs-landing-page: cran-release
branches-or-tags-to-list: >-
^cran-release$|^main$|^v([0-9]+\\.)?([0-9]+\\.)?([0-9]+)$
skip-multiversion-docs: true
linter:
name: Lint
uses: pharmaverse/admiralci/.github/workflows/lintr.yml@main
if: github.event_name == 'pull_request'
with:
r-version: "4.3"
latest-lintr: "true"
install-package: "true"
links:
name: Links
uses: pharmaverse/admiralci/.github/workflows/links.yml@main
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/r-renv-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
fail-fast: false
matrix:
config:
- {os: ubuntu-20.04, r: '4.1', repos: 'https://packagemanager.posit.co/cran/2022-03-10/'}
- {os: ubuntu-20.04, r: '4.2', repos: 'https://packagemanager.posit.co/cran/2023-03-15/'}
- {os: ubuntu-20.04, r: '4.3', repos: 'https://packagemanager.posit.co/cran/2023-04-20/'}

Expand Down
21 changes: 14 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
Package: sdtm.oak
Type: Package
Title: SDTM Data Transformation Engine
Version: 0.0.0.9000
Version: 0.0.0.9001
Authors@R: c(
person("Omar", "Garcia", email = "[email protected]", role = c("aut", "cre")),
person("Rammprasad", "Ganapathy", role = "aut"),
person("Ramiro", "Magno", email = "[email protected]",
role = "aut", comment = c(ORCID = "0000-0001-5226-3441")),
person("Pattern Institute", role = c("cph", "fnd")),
person("F. Hoffmann-La Roche AG", role = c("cph", "fnd")),
person("Pfizer Inc", role = c("cph", "fnd"))
)
Expand All @@ -13,21 +16,25 @@ Description: An EDC and Data Standard agnostic SDTM data transformation engine
based on standard mapping algorithms.
Language: en-US
License: Apache License (>= 2)
BugReports: https://github.com/pharmaverse/oak/issues
URL: https://pharmaverse.github.io/oak/, https://github.com/pharmaverse/oak
BugReports: https://github.com/pharmaverse/sdtm.oak/issues
URL: https://pharmaverse.github.io/sdtm.oak/, https://github.com/pharmaverse/sdtm.oak
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Depends: R (>= 4.1)
Depends: R (>= 4.2)
Imports:
rlang (>= 1.0.0)
admiraldev,
dplyr (>= 1.0.0),
purrr (>= 1.0.0),
rlang (>= 1.0.0),
stringr,
tibble
Suggests:
knitr,
rmarkdown,
spelling,
testthat (>= 3.1.7),
tibble
testthat (>= 3.1.7)
VignetteBuilder: knitr
Config/testthat/edition: 3
Config/testthat/parallel: true
5 changes: 4 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Generated by roxygen2: do not edit by hand

import(rlang)
export(create_iso8601)
export(fmt_cmp)
importFrom(rlang,.data)
importFrom(tibble,tibble)
6 changes: 4 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# sdtm.oak (development version)
# sdtm.oak 0.0.0.9001 (development version)

* Initial CRAN submission.
## New Features

* New function `create_iso8601()` for conversion of vectors of dates, times or date-times to ISO8601 format.
Loading

0 comments on commit 9d4944e

Please sign in to comment.