Skip to content

Ignore grouping when arrange()ing #1206

@ajdamico

Description

@ajdamico
set.seed( 2014 )

library(dplyr)
library(nycflights13)


x <- flights
x[ sample( seq( nrow( x ) ) , 300000 ) , 'origin' ] <- NA
x[ sample( seq( nrow( x ) ) , 300000 ) , 'dest' ] <- NA


# arrange( desc( num ) ) fails

x %>%
    group_by( dest , origin ) %>%
        summarize( 
            num = n() ,  
            something = n_distinct( arr_time ) ,
            another = round( 100 * mean( is.na( arr_time ) ) , 1 ) ,
            yet = round( 100 *mean( arr_time , na.rm = TRUE ) , 1 )
        ) %>%
            arrange( desc( num ) )

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions