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

Lookupname eq varname #108

Merged
merged 3 commits into from Oct 21, 2019
Merged

Lookupname eq varname #108

merged 3 commits into from Oct 21, 2019

Conversation

PatrickRWright
Copy link
Collaborator

@PatrickRWright PatrickRWright commented Oct 18, 2019

It turns out that there is a problem when the name of a lookuptable (secuTrial) is equal to the name of the variable its being used in. If this is the case then the meta variables are not factorized properly.
It triggers this warning:
warning(paste("Unexpected: Not all levels converted for", name, "in form", form))

The fix is removing the nrow(lookup) == 0 condition. I spent quite some time investigating why I may have put it there in the first place, and as of now I think there is no need. Next to the tests in the package which all still pass without any changes I also made several local checks with private datasets (7 different secuTrial exports including lookuptable data structures). I loaded them before removing the condition and after removing the condition and checked the outputs with all.equal(). For all exports except the one that triggered the issue in the first place all.equal() returned TRUE.

In summary I think this condition can be safely removed because it serves no purpose and creates problems in specific scenarios.

@aghaynes
Copy link
Member

even though it's small, it would be good to have it documented in NEWS for the sake of completeness... just put it as a bug fix and reference this PR

@codecov-io
Copy link

Codecov Report

Merging #108 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #108   +/-   ##
=======================================
  Coverage   93.61%   93.61%           
=======================================
  Files          21       21           
  Lines        1049     1049           
=======================================
  Hits          982      982           
  Misses         67       67
Impacted Files Coverage Δ
R/factorize.R 86.76% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e993513...450134a. Read the comment docs.

@aghaynes aghaynes merged commit aae6c57 into SwissClinicalTrialOrganisation:master Oct 21, 2019
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.

None yet

3 participants