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
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
21676a6
Add metadata type
cpiraux Dec 22, 2023
ce0b5e4
Add test for date coercion to character
cpiraux Jan 10, 2024
1f50d9b
Update test-length for datetime variables
cpiraux Jan 12, 2024
9625a77
Remove format from type
cpiraux Jan 12, 2024
1841c4e
Udpate function description to remove reference to DT, DTM and TM
cpiraux Jan 17, 2024
7ec86fb
Added Changes Description
cpiraux Jan 17, 2024
c2c24bf
Updated function description
cpiraux Jan 17, 2024
c7e86e1
Merge branch 'main' into 161-coercion-date-datatype
cpiraux Jan 17, 2024
b96350c
fixed small bug
cpiraux Jan 17, 2024
b24ae25
Removed blank lines
cpiraux Jan 17, 2024
fbf7839
Removed blank line
cpiraux Jan 17, 2024
2877651
Merge branch 'main' into 161-coercion-date-datatype
vedhav Jan 17, 2024
e93b119
chore: update docs with new options
vedhav Jan 17, 2024
04f8fca
Update description in type.R
cpiraux Jan 22, 2024
701fb5e
Update option character_metadata_types
cpiraux Jan 22, 2024
53bffb9
Merge branch '161-coercion-date-datatype' of github.com:atorus-resear…
cpiraux Jan 22, 2024
be591a0
update description in NEWS.md
cpiraux Jan 22, 2024
3c3b291
Merge branch 'main' into 161-coercion-date-datatype
cpiraux Jan 22, 2024
d38bc17
Merge branch 'main' into 161-coercion-date-datatype
cpiraux Jan 30, 2024
2d5fe41
fix: pass the domain name explicitly
vedhav Feb 1, 2024
7c1ccde
Add numeric to R numeric type
cpiraux Feb 5, 2024
0979306
Merge branch 'main' into 161-coercion-date-datatype
cpiraux Feb 5, 2024
388223c
Split too long line
cpiraux Feb 5, 2024
f3b1c8d
Merge branch '161-coercion-date-datatype' of github.com:atorus-resear…
cpiraux Feb 5, 2024
7bf0e4d
Merge branch 'main' into 161-coercion-date-datatype
cpiraux Feb 5, 2024
3ead6ae
Merge branch 'main' into 161-coercion-date-datatype
bms63 Feb 11, 2024
892f530
Merge branch 'main' into 161-coercion-date-datatype
bms63 Feb 11, 2024
66a07ee
Merge branch 'main' into 161-coercion-date-datatype
bms63 Feb 11, 2024
37c520e
Merge branch 'main' into 161-coercion-date-datatype
bms63 Feb 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

* Added a check for character variable lengths up to 200 bytes in `xpt_validate()`(#91, #189).

* 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 (#161).
cpiraux marked this conversation as resolved.
Show resolved Hide resolved

## Deprecation and Breaking Changes

* The `label` argument from the `xportr_write()` function is deprecated in favor of the `metadata` argument. (#179)
Expand Down
6 changes: 1 addition & 5 deletions R/type.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@
#' 'xportr.character_types' option is used to explicitly collapse the class of a
#' column to character using `as.character`. Similarly, 'xportr.numeric_types'
#' will collapse a column to a numeric type. If no type is passed for a
#' variable and it isn't identifed as a timing variable, it is assumed to be numeric and coerced with `as.numeric`.
#' variable, it is assumed to be numeric and coerced with `as.numeric`.
cpiraux marked this conversation as resolved.
Show resolved Hide resolved
#'
#' Certain care should be taken when using timing variables. R serializes dates
#' based on a reference date of 01/01/1970 where XPT uses 01/01/1960. This can
#' result in dates being 10 years off when outputting from R to XPT if you're
#' using a date class. For this reason, `xportr` will try to determine what
#' should happen with variables that appear to be used to denote time.
#'
#' For variables that end in DT, DTM, or, TM, if they are not explicitly noted
#' in 'xportr.numeric_types' or 'xportr.character_types', they are coerced to
#' numeric results.
#'
#' @inheritParams xportr_length
#'
#' @section Messaging: `type_log()` is the primary messaging tool for
Expand Down
6 changes: 1 addition & 5 deletions man/xportr_type.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.