I am trying to create a subset of a data frame I've created and am getting what appears to be a common error "...undefined columns selected...". Most solutions suggest a simple misplaced error but I believe my code is correct.
I've tested different combinations of variables in the subset and it's clear it's the last three variables creating the issues. Analysis has shown there are no NAs in the fields They're all fields within a larger list called SOURCE_DATA. I'm looking for any suggestion as to why I might be receiving this error. The link below is to a photo of the Data and Values descriptions in RStudio.
DATA_SUBSET <- SOURCE_DATA[,unique(c(IDVars, InterventionVar, OutcomeVars, ControlVars, ConditionalVars))]
Error in `[.data.frame`(SOURCE_DATA, , unique(c(IDVars, InterventionVar, :
undefined columns selected