Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #161 Coercion date datatype #214

Merged
merged 29 commits into from
Feb 13, 2024
Merged

Closes #161 Coercion date datatype #214

merged 29 commits into from
Feb 13, 2024

Conversation

cpiraux
Copy link
Collaborator

@cpiraux cpiraux commented Jan 10, 2024

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.

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 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

  • Added xportr.character_metadata_types and xportr.numeric_metadata_types so that all R types, including dates, are handled by xportr_type. In case the R type is different from the metadata type, the variable is coerced

  • I am wondering it the utility function first_class is still needed?

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.
  • Code is formatted according to the tidyverse style guide. Use styler package and functions to style files accordingly.
  • Updated relevant unit tests or have written new unit tests. See our Wiki for conventions used in this package.
  • Creation/updated relevant roxygen headers and examples. See our Wiki 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!

@cpiraux cpiraux linked an issue Jan 10, 2024 that may be closed by this pull request
@cpiraux cpiraux marked this pull request as ready for review January 17, 2024 11:43
R/type.R Outdated Show resolved Hide resolved
@bms63
Copy link
Collaborator

bms63 commented Jan 17, 2024

Sorry - I ran out of time to look this over today - @atorus-research/xportr-development-team does anyone else have time to review this PR and help diagnose the R-CMD checks?

@vedhav
Copy link
Collaborator

vedhav commented Jan 17, 2024

I'll fix the R CMD checks for this one. Looks like there is also a merge conflict as we change some options, I'll resolve it as well.

NEWS.md Outdated Show resolved Hide resolved
Comment on lines 67 to 82
#' coerce R classes to character XPT types. Default: "character"
#' }
#' \item{
#' xportr.character_metadata_types - The default character vector used to explicitly
#' coerce R classes to character XPT types. Default: c("character", "char",
#' "text", "date", "posixct", "posixt", "datetime", "time", "partialdate",
#' "partialtime", "partialdatetime", "incompletedatetime", "durationdatetime",
#' "intervaldatetime")
#' }
#' \item{
#' xportr.numeric_metadata_types - The default character vector used to explicitly
#' coerce R classes to numeric XPT types. Default: c("integer", "numeric", "num", "float")
#' }
#' \item{
#' xportr.numeric_types - The default character vector used to explicitly
#' coerce R classes to numeric XPT types. Default: c("integer", "numeric",
#' "num", "float")
#' coerce R classes to numeric XPT types. Default: c("integer", "float", "posixct", "posixt", "time", "date")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the changes in the options docs 1/2

R/options.R Outdated
Comment on lines 44 to 52
#' \item{xportr.character_types}{defaults to `"character"`}:
#' The default character vector used to explicitly coerce R classes to character XPT types.
#' \item{xportr.character_metadata_types}{defaults to `c("character", "char", "text", "date", "posixct", "posixt",
#' "datetime", "time", "partialdate", "partialtime", "partialdatetime",
#' "incompletedatetime", "durationdatetime", "intervaldatetime")`}:
#' The default character vector used to explicitly coerce R classes to character XPT types.
#' \item{xportr.numeric_types}{defaults to `c("integer", "numeric", "num", "float")`}:
#' \item{xportr.numeric_metadata_types}{defaults to `c("integer", "numeric", "num", "float")`}:
#' The default character vector used to explicitly coerce R classes to numeric XPT types.
#' \item{xportr.numeric_types}{defaults to `c("integer", "float", "posixct", "posixt", "time", "date")`}:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the changes in the options docs 2/2

R/zzz.R Outdated Show resolved Hide resolved
@vedhav vedhav force-pushed the 161-coercion-date-datatype branch from ffac454 to 2d5fe41 Compare February 1, 2024 14:24
Copy link

codecov bot commented Feb 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (afcfcd1) 100.00% compared to head (37c520e) 100.00%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #214   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          664       665    +1     
=========================================
+ Hits           664       665    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@EeethB EeethB merged commit 3fe8e84 into main Feb 13, 2024
13 checks passed
@EeethB EeethB deleted the 161-coercion-date-datatype branch February 13, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: --DTC variable coercion to character
4 participants