Indexing (non)missing values using first() inside of summarise() no longer works. #1980
I used to be able to use the following code to get the first non-missing value within a group, but it no longer works. Now I get "Error: Unsupported vector type language."
ids <- c(1,1,2,2,3,3) data_column <- c(NA,1,2,3,3,NA) df <- data.frame(ids,data_column) df %>% group_by(ids) %>% summarise(data_column_first = first(data_column[!is.na(data_column)]))
What I wanted the code above to return is something like:
I don't know if this is a bug, a feature, a problem with the configuration of my environment, or if it's just a specific manifestation of some more general bug or feature, but it also occurs when trying to use last() in the same context instead of first().
Also, if you were to tell me a better alternative way to accomplish what I'm trying to do, I wouldn't complain! :D
The text was updated successfully, but these errors were encountered: