In this line, when all columns of the input matrix are the same, only one column should be returned. However the [ operator will turn single columns into vectors by default, causing an error in the downstream rename, as it can't deal with vectors:
Browse[1]> sigmut_mat_df[, !is_dupe] %>%
rename(!!dupe_group_names) %>%
replace(is.na(.), 0)
## Error in UseMethod("rename") :
## no applicable method for 'rename' applied to an object of class "c('double', 'numeric')"
Proposed solution
Setting drop = FALSE in the [ call will disable this behavior.
In this line, when all columns of the input matrix are the same, only one column should be returned. However the
[
operator will turn single columns into vectors by default, causing an error in the downstream rename, as it can't deal with vectors:Proposed solution
Setting
drop = FALSE
in the[
call will disable this behavior.