dplyr - group summary error in R -


my data

     quantity revenue   event 1    72.00  100.80 regular 2    72.00  111.60 regular 3    72.00  111.60   promo 4    72.00  111.60 regular 5    72.00  111.60 regular 6    72.00  111.60 regular 

class(test$event) returns "character"

when run

dplyr::summarize(dplyr::group_by(test, event), qty=sum(quantity)) 

i following error

error: invalid 'type' (character) of argument 

i did try

plyr::ddply(test, "event", summarise, quantity=sum(quantity)) 

and same error.

not sure went wrong. need fix this.


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -