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

adapt to tibble from REDCapR #61

Merged
merged 2 commits into from
Jul 13, 2023
Merged

Conversation

wibeasley
Copy link
Contributor

close #59

Copy link
Contributor Author

@wibeasley wibeasley left a comment

Choose a reason for hiding this comment

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

some comments to help @RaymondBalise & @gabrielodom evaluate this PR better.

R/drop_labels.R Show resolved Hide resolved
R/import_instruments.R Show resolved Hide resolved
R/make_instrument_auto.R Show resolved Hide resolved
tests/testthat/test-import_instruments.R Show resolved Hide resolved
c(1, 2, 3, 4, 5),
label = "Study ID",
class = c("labelled", "numeric")
),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure why the new version of REDCapR produces this change. But I haven't really studied what tidyREDCap does with the labelled class.

Copy link
Owner

Choose a reason for hiding this comment

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

labelled needs to be the last argument in the class list. So we need a unit test to make sure that all is still good. See the fix_class_bug() function in make_instrument_auto.R. It is a horrible kludge. We need to look at the labeling function that REDCapTidieR is using to see if things could be simpler.

@@ -65,7 +70,7 @@ target <- structure(
"character"
))
),
row.names = c(NA, -5L), class = "data.frame"
row.names = c(NA, -5L), class = c("tbl_df", "tbl", "data.frame")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

adapt to the tibble that REDCapR returns.

Copy link
Owner

Choose a reason for hiding this comment

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

Need to double check the unit test still behaves but it makes good sense.

Copy link
Owner

@RaymondBalise RaymondBalise left a comment

Choose a reason for hiding this comment

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

It would be good to go though this together. Talk to you soon.

@@ -65,7 +70,7 @@ target <- structure(
"character"
))
),
row.names = c(NA, -5L), class = "data.frame"
row.names = c(NA, -5L), class = c("tbl_df", "tbl", "data.frame")
Copy link
Owner

Choose a reason for hiding this comment

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

Need to double check the unit test still behaves but it makes good sense.

R/import_instruments.R Show resolved Hide resolved
R/make_instrument_auto.R Show resolved Hide resolved
@RaymondBalise RaymondBalise merged commit 18d28b4 into RaymondBalise:master Jul 13, 2023
@gabrielodom
Copy link
Collaborator

Looks good to me

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.

adapt for REDCapR 1.2.0
3 participants