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

Array import magic #365

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Array import magic #365

wants to merge 7 commits into from

Conversation

nealrichardson
Copy link
Contributor

@nealrichardson nealrichardson commented Mar 1, 2019

Array/MR variables coming in from SPSS or other lossy file formats generally need some work to reconstruct the "right" metadata because they have to shove both parent and subvariable metadata into the "varlabels" of the subvariables. This often follows a pattern of having varlabels with a prefix containing the parent question wording (description) and a suffix that is the actual response label. (We also do this when we "unbind" an array.)

These functions allow us to detect this metadata pattern and attempt to repair it.

To do:

  • Detect the common string prefix in subvariables
  • Put that prefix in the parent's description and remove it from the subvars (needs test)
  • Confirm that our round trip of unbind/bind behaves as expected
  • Add argument to makeArray() so that this detection happens when the array is created
  • Add function to comb all arrays in the dataset?
  • Document

Ultimately we may want this done server side, but this will help us now and will inform any backend implementation.

@codecov
Copy link

codecov bot commented Mar 1, 2019

Codecov Report

Merging #365 into master will decrease coverage by 0.15%.
The diff coverage is 51.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #365      +/-   ##
==========================================
- Coverage   90.37%   90.22%   -0.16%     
==========================================
  Files         115      116       +1     
  Lines        7325     7354      +29     
==========================================
+ Hits         6620     6635      +15     
- Misses        705      719      +14
Impacted Files Coverage Δ
R/add-variable.R 84.61% <28.57%> (-5.53%) ⬇️
R/clean-array.R 59.09% <59.09%> (ø)

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 6feab4a...c640f4d. Read the comment docs.

@codecov
Copy link

codecov bot commented Mar 1, 2019

Codecov Report

Merging #365 into master will decrease coverage by 0.15%.
The diff coverage is 51.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #365      +/-   ##
==========================================
- Coverage   90.37%   90.22%   -0.16%     
==========================================
  Files         115      116       +1     
  Lines        7325     7354      +29     
==========================================
+ Hits         6620     6635      +15     
- Misses        705      719      +14
Impacted Files Coverage Δ
R/add-variable.R 84.61% <28.57%> (-5.53%) ⬇️
R/clean-array.R 59.09% <59.09%> (ø)

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 6feab4a...f876457. Read the comment docs.

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.

1 participant