As found in the comments and the other answer, the correct way of doing this is to use ungroup()
.
The operation rowwise(df)
sets one of the classes of df
to be rowwise_df
. We can see the methods on this class by examining the code here, which gives the following ungroup
method:
#' @export
ungroup.rowwise_df <- function(x) {
class(x) <- c( "tbl_df", "data.frame")
x
}
So we see that ungroup
is not strictly removing a grouped structure, instead it just removes the rowwise_df
class added from the rowwise
function.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…