PcAux-Package / PcAux

This is the repository for the PcAux project.
GNU General Public License v3.0
4 stars 5 forks source link

Small 'idVars' issue #21

Closed Lwaggens closed 6 years ago

Lwaggens commented 6 years ago

Found a small bug when you don't include any argument for idVars.

In the createPcAux step, after imputation and while trying to calculate linear components, it returns an error:

Error in as.data.frame.default(x[[i]], optional = TRUE) : 
  cannot coerce class ‘structure("uninitializedField", package = "methods")’ to a data.frame

This happens during this step during doPCA:

data.frame(map$idCols, pcaOut$x[, 1:map$nComps[pcType]])

Basically, its because if no ID variable the map$idCols will have nothing there. Really it's just an unintuitive error for not including an ID that happens later than it should. Likely there should be a quick check in prepData to identify a lack of ID and an error message accompanying it.

kylelang commented 6 years ago

I think this will be resolved once I finish modifying the initialize() function. As noted in Issue #18, my streamlining has caused some new issues, but they should be pretty easy to resolve.

kylelang commented 6 years ago

Actually, the problem was simply with the way we were checking for empty "idVars." The issue should be resolved now.