When trying to write tests for DepthProfileData function in ResultFlagsDependent I was getting the error:
Error in `[.data.frame`(check.data, , col.order) : undefined columns selected
This happens on line 530 because the column order list includes columns that don't exist in check.data. This may also relate to issue #131.
In my case the missing column was derived from 'ActivityDepthHeightMeasure.MeasureUnitCode' which had units and no NaN. If the column is in fields (I was using the default) the if statement on line 404 appears to catch and continue when there are more than 0 NaN in the column. Based on the comment on the line above I think the inverse was intended (i.e., continue if more than 0 are NOT NaN):
if (sum(!is.na(check.data$ActivityDepthHeightMeasure.MeasureUnitCode)) > 0) {
Wanted to make sure I understood the intended logic correctly before submitting a PR.