Skip to content

Edit checks for weight cols and id cols in hts_prep_variable #168

Description

@ashleyasmus

This check fails for my dataset:

# Check that there is a id and weight for every table
if (length(data) != length(id_cols)) {
stop("Each table in data must have a corresponding id in id_cols")
}
if (weighted) {
if (length(data) != length(wt_cols)) {
stop("Each table in data must have a corresponding weight in wt_cols")
}
}

The check should not look at the length of the id columns, but rather that each table in hts_data has an id in id_cols.
Something like:

missing_ids = lapply(hts_data, function(x) length(names(x)[names(x) %in% id_cols])==0)
any(unlist(missing_ids))

missing_wts = lapply(hts_data, function(x) length(names(x)[names(x) %in% wt_cols])==0)
any(unlist(missing_wts ))

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions