Here is a variant of a problem I thought we were able to solve previously.
testdf <- data_frame(one = c(1,1,1), two = c(1,2,3), three = c(3,3,3))
How can I select the columns that
- have non-zero variance OR
- whose name is 'three'
I tried this without success
> testdf %>% select_if(funs(var(.) != 0 | grepl("three", names(.)))) > Error in selected[[i]] <- .p(.tbl[[tibble_vars[[i]]]], ...) : > replacement has length zero
What is the issue here?