Get the name of the intervals column that the imputation methods come from
Source:R/impute.R
get_impute_column.Rdget_impute_column() applies the first two of the three readings of
impute described in get_impute_method() and says which column
get_impute_method() reads the methods from. It does not read the column,
so it does not check that the column is character.
Value
The name of the column of intervals that the methods come from
(character scalar): impute when it names a column of intervals, or
"impute" when impute is NA and intervals has a column named
"impute". NULL when impute is itself the method string, or is NA
and there is no "impute" column, so there is no column.
Examples
intervals <- data.frame(start = 0, end = 24, impute = "start_conc0", my_impute = "start_cmin")
get_impute_column(intervals, impute = "my_impute")
#> [1] "my_impute"
get_impute_column(intervals, impute = NA)
#> [1] "impute"
# A method string is not a column
get_impute_column(intervals, impute = "start_predose")
#> NULL
# NA without an "impute" column is not a column either
get_impute_column(intervals[, c("start", "end")], impute = NA)
#> NULL