Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DepthProfileData function ConversionFactor output column missing when no NaN in input column #137

@jbousquin

Description

@jbousquin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions