Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 #142 issue_142_updated to account for DT, DTM, TM variables #145
Closes #142 issue_142_updated to account for DT, DTM, TM variables #145
Changes from 1 commit
c0f84b0
12fd07b
2f0e783
713f3d3
0fa5e68
e45cb28
3583b24
a772092
008386c
027fcff
b9ea9e7
8808bc1
839bffe
00dcfe7
7d2c4e2
0efc1b0
412c75d
ddc813b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The data are still converted to numeric R class. The attribute should numeric but the R class should stay date/dttm/time. The numeric date variables should not go through ".df[[i]] <<- as.numeric(.df[[i]])"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cpiraux can you give an example dataframe where this happens and what the expected result should be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that it is actually not coerced but the message is still present. I used df and metadata in test-type for the review:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fixed now @cpiraux
@elimillera can you take a look too? I've implemented your suggestion in today's meeting. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't use a metacore object but a dataframe for the metadata
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jump in the conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the testthat for this function and I see a new issue where in line 205 of test-type.R, the original df and xpt file have different timezones.
── Failure (test-type.R:208:3): xportr_type: date variables are not converted to numeric ──
df$RFICDTM (
actual
) not equal to df_xpt$RFICDTM (expected
).actual
: 1490824800expected
: 1490832000I checked the documentation and it comes from this parameter in the write_xpt function of haven:
Is this something to be concerned about? @cpiraux @elimillera @kaz462
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this! Timezone should be ignored. As the default value in haven for
adjust_tz = TRUE
, I think it is okay. I open dfdates.xpt in SAS and dates are okay. Is it possible to ignore the timezone when you compare the dates in testthat?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cpiraux test updated to expect that the as_character() of each datetime are equal so that timezone is ignored.