Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 179_fetch_dataset_lab…
Browse files Browse the repository at this point in the history
…el_from_metadata

# Conflicts:
#	DESCRIPTION
#	NEWS.md
  • Loading branch information
vedhav committed Dec 7, 2023
2 parents c36bb5f + 40a1dd4 commit 8437f07
Show file tree
Hide file tree
Showing 14 changed files with 123 additions and 119 deletions.
22 changes: 0 additions & 22 deletions .github/PULL_REQUEST_TEMPLATE/release.md

This file was deleted.

18 changes: 9 additions & 9 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
### Thank you for your Pull Request!
### Thank you for your Pull Request!

We have developed a Pull Request template to aid you and our reviewers. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the xportr codebase remains robust and consistent.
We have developed a Pull Request template to aid you and our reviewers. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the xportr codebase remains robust and consistent.

### The scope of `{xportr}`

`{xportr}`'s scope is to enable R users to write out submission compliant `xpt` files that can be delivered to a Health Authority or to downstream validation software programs. We see labels, lengths, types, ordering and formats from a dataset specification object (SDTM and ADaM) as being our primary focus. We also see messaging and warnings to users around applying information from the specification file as a primary focus. Please make sure your Pull Request meets this **scope of {xportr}**. If your Pull Request moves beyond this scope, please get in touch with the `{xportr}` team on [slack](https://pharmaverse.slack.com/archives/C030EB2M4GM) or create an issue to discuss.
`{xportr}`'s scope is to enable R users to write out submission compliant `xpt` files that can be delivered to a Health Authority or to downstream validation software programs. We see labels, lengths, types, ordering and formats from a dataset specification object (SDTM and ADaM) as being our primary focus. We also see messaging and warnings to users around applying information from the specification file as a primary focus. Please make sure your Pull Request meets this **scope of {xportr}**. If your Pull Request moves beyond this scope, please get in touch with the `{xportr}` team on [slack](https://pharmaverse.slack.com/archives/C030EB2M4GM) or create an issue to discuss.

Please check off each task box as an acknowledgment that you completed the task. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the `devel` branch until you have checked off each task.

### Changes Description

_(descriptions of changes)_
_(descriptions of changes)_

### Task List

- [ ] The spirit of xportr is met in your Pull Request
- [ ] Place Closes #<insert_issue_number> into the beginning of your Pull Request Title (Use Edit button in top-right if you need to update)
- [ ] Summary of changes filled out in the above Changes Description. Can be removed or left blank if changes are minor/self-explanatory.
- [ ] Check that your Pull Request is targeting the `devel` branch, Pull Requests to `main` should use the [Release Pull Request Template](https://github.com/atorus-research/xportr/tree/94_pr_template/.github/PULL_REQUEST_TEMPLATE)
- [ ] Code is formatted according to the [tidyverse style guide](https://style.tidyverse.org/). Use `styler` package and functions to style files accordingly.
- [ ] Summary of changes filled out in the above Changes Description. Can be removed or left blank if changes are minor/self-explanatory.
- [ ] Code is formatted according to the [tidyverse style guide](https://style.tidyverse.org/). Use `styler` package and functions to style files accordingly.
- [ ] Updated relevant unit tests or have written new unit tests. See our [Wiki](https://github.com/atorus-research/xportr/wiki/Style-Guide-for-Unit-Tests) for conventions used in this package.
- [ ] Creation/updated relevant roxygen headers and examples. See our [Wiki](https://github.com/atorus-research/xportr/wiki/Style-Guide-for-Roxygen-Headers) for conventions used in this package.
- [ ] Run `devtools::document()` so all `.Rd` files in the `man` folder and the `NAMESPACE` file in the project root are updated appropriately
- [ ] Run `pkgdown::build_site()` and check that all affected examples are displayed correctly and that all new/updated functions occur on the "Reference" page.
- [ ] Update NEWS.md if the changes pertain to a user-facing function (i.e. it has an @export tag) or documentation aimed at users (rather than developers)
- [ ] Make sure that the pacakge version in the NEWS.md and DESCRIPTION file is same. Don't worry about updating the version because it will be auto-updated using the `vbump.yaml` CI.
- [ ] Address any updates needed for vignettes and/or templates
- [ ] Link the issue Development Panel so that it closes after successful merging.
- [ ] Fix merge conflicts
- [ ] Pat yourself on the back for a job well done! Much love to your accomplishment!
- [ ] Fix merge conflicts
- [ ] Pat yourself on the back for a job well done! Much love to your accomplishment!
6 changes: 4 additions & 2 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: Check URLs 🔗

on:
push:
branches: [main]
branches:
- main
pull_request:
branches: [main, devel]
branches:
- main

jobs:
links:
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/check-standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ name: R-CMD-check 📦

on:
push:
branches: [main, devel]
branches:
- main
pull_request:
branches: [main, devel]
branches:
- main

jobs:
R-CMD-check:
Expand All @@ -18,11 +20,11 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- { os: macOS-latest, r: "release" }
- { os: windows-latest, r: "release" }
- { os: ubuntu-latest, r: "devel", http-user-agent: "release" }
- { os: ubuntu-latest, r: "release" }
- { os: ubuntu-latest, r: "oldrel-1" }

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ name: Check Lint 🧹

on:
push:
branches: [main]
branches:
- main
pull_request:
branches: [main, devel]
branches:
- main

jobs:
lint:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- master

jobs:
pkgdown:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ on:
push:
branches:
- main
- devel
pull_request:
branches:
- main
- devel

concurrency:
group: spelling-${{ github.event.pull_request.number || github.ref }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: Check Style 🎨

on:
push:
branches: [main]
branches:
- main
pull_request:
branches: [main, devel]
branches:
- main

concurrency:
group: style-${{ github.event.pull_request.number || github.ref }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

jobs:
test-coverage:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/vbump.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Version Bump ⬆️

on:
push:
branches:
- main

jobs:
vbump:
name: Version Bump 🤜🤛
if: github.event_name == 'push'
uses: insightsengineering/r.pkg.template/.github/workflows/version-bump.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
114 changes: 45 additions & 69 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,85 +1,61 @@
Package: xportr
Title: Utilities to Output CDISC SDTM/ADaM XPT Files
Version: 0.3.1.9000
Authors@R:
c(
person(given = "Eli",
family = "Miller",
role = c("aut", "cre"),
email = "Eli.Miller@AtorusResearch.com",
Version: 0.3.1.9001
Authors@R: c(
person("Eli", "Miller", , "Eli.Miller@AtorusResearch.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-2127-9456")),
person(given = "Vignesh ",
family = "Thanikachalam",
role = c("aut")),
person(given = "Ben",
family = "Straub",
role = ("aut")),
person(given = "Ross",
family = "Didenko",
role = ("aut")),
person(given = "Zelos",
family = "Zhu",
role = ("aut")),
person(given = "Ethan",
family = "Brockmann",
role = ("aut")),
person(given = "Vedha",
family = "Viyash",
role = ("aut")),
person(given = "Andre",
family = "Verissimo",
role = ("aut")),
person(given = "Sophie",
family = "Shapcott",
role = ("aut")),
person(given = "Celine",
family = "Piraux",
role = ("aut")),
person(given = "Adrian",
family = "Chan",
role = ("aut")),
person(given = "Sadchla",
family = "Mascary",
role = ("aut")),
person(given = "Atorus/GSK JPT",
role = "cph"))
Description: Tools to build CDISC compliant data sets and check for CDISC compliance.
person("Vignesh ", "Thanikachalam", role = "aut"),
person("Ben", "Straub", role = "aut"),
person("Ross", "Didenko", role = "aut"),
person("Zelos", "Zhu", role = "aut"),
person("Ethan", "Brockmann", role = "aut"),
person("Vedha", "Viyash", role = "aut"),
person("Andre", "Verissimo", role = "aut"),
person("Sophie", "Shapcott", role = "aut"),
person("Celine", "Piraux", role = "aut"),
person("Adrian", "Chan", role = "aut"),
person("Sadchla", "Mascary", role = "aut"),
person("Atorus/GSK JPT", role = "cph")
)
Description: Tools to build CDISC compliant data sets and check for CDISC
compliance.
License: MIT + file LICENSE
URL: https://github.com/atorus-research/xportr
BugReports: https://github.com/atorus-research/xportr/issues
Depends:
R (>= 3.5)
Imports:
cli,
dplyr (>= 1.0.2),
purrr (>= 0.3.4),
stringr (>= 1.4.0),
magrittr,
glue (>= 1.4.2),
haven (>= 2.5.0),
janitor,
lifecycle,
magrittr,
purrr (>= 0.3.4),
readr,
rlang (>= 0.4.10),
cli,
stringr (>= 1.4.0),
tidyselect,
readr,
janitor,
tm,
haven (>= 2.5.0),
lifecycle
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
tm
Suggests:
testthat (>= 3.0.0),
withr,
knitr,
rmarkdown,
readxl,
DT,
labelled,
admiral,
devtools,
DT,
knitr,
labelled,
lintr,
metacore,
readxl,
rmarkdown,
spelling,
testthat (>= 3.0.0),
usethis,
lintr,
metacore
withr
VignetteBuilder:
knitr
Config/testthat/edition: 3
VignetteBuilder: knitr
Depends:
R (>= 3.5)
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
12 changes: 11 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# xportr 0.3.1.9000
# xportr 0.3.1.9001

## New Features and Bug Fixes
* `xportr_write()` now accepts `metadata` argument which can be used to set the dataset label to stay consistent with the other `xportr_*` functions. It is noteworthy that the dataset label set using the `xportr_df_label()` function will be retained during the `xportr_write()`.
Expand All @@ -7,10 +7,20 @@
## Deprecation and Breaking Changes
* The `label` argument from the `xportr_write()` function is deprecated in favor of the `metadata` argument.

## Documentation

# xportr 0.3.1

## New Features and Bug Fixes

* Make `xportr_type()` drop factor levels when coercing variables

## Documentation

* Set up Development version of Website (#187)

## Deprecation and Breaking Changes

# xportr 0.3.0

## New Features and Bug Fixes
Expand Down
3 changes: 3 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ search:
news:
cran_dates: true

development:
mode: auto

navbar:
structure:
right: [slack, github]
Expand Down
20 changes: 20 additions & 0 deletions tests/testthat/test-type.R
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,23 @@ test_that("xportr_type: Gets warning when metadata has multiple rows with same v
# Checks that message doesn't appear when xportr.domain_name is valid
multiple_vars_in_spec_helper2(xportr_type)
})

test_that("xportr_type: Drops factor levels", {
metadata <- data.frame(
dataset = "test",
variable = c("Subj", "Param", "Val", "NotUsed"),
type = c("numeric", "character", "numeric", "character"),
format = NA
)

.df <- data.frame(
Subj = as.character(123, 456, 789),
Different = c("a", "b", "c"),
Val = factor(c("1", "2", "3")),
Param = c("param1", "param2", "param3")
)

df2 <- xportr_type(.df, metadata, "test")

expect_null(attributes(df2$Val))
})

0 comments on commit 8437f07

Please sign in to comment.