vubiostat / redcapAPI

R interface to REDCap (http://www.project-redcap.org/)
21 stars 27 forks source link

Missing Summary Refactor #339 #340

Closed spgarbet closed 8 months ago

spgarbet commented 8 months ago

I've attempted to refactor missingSummary to use exportRecordsTyped, and the preferred new interface. It fails the key test and I have not been able to figure out why.

spgarbet commented 8 months ago

@nutterb can you look at this branch and see if you can figure out why the summaries don't come out right?

nutterb commented 8 months ago

What I'm seeing is image

Which implies that we've changed something in the data, so my static reference no longer matches the output. Where X is the output of missingSummary, lines 5, 7, 9, 13, and 16 are different.

So I think at this point it's a matter of identifying the differences and updating either the data source of the DesiredOutput object to match.

> cbind(X$n_missing, DesiredOutput$n_missing)
      [,1] [,2]
 [1,]    6    6
 [2,]    0    0
 [3,]    0    0
 [4,]    0    0
 [5,]    0    1
 [6,]    0    0
 [7,]    0    1
 [8,]    0    0
 [9,]    0    1
[10,]    0    0
[11,]    1    1
[12,]    0    0
[13,]    0    1
[14,]    1    1
[15,]    0    0
[16,]    0    1
[17,]    0    0
[18,]    1    1
[19,]    0    0
[20,]    5    5
spgarbet commented 8 months ago

I suspect that a data class returned from exportRecordsTyped is failing a check in the branching logic summaries. I believe the DesiredOutput$n_missing .

spgarbet commented 8 months ago

I figured it out.