1

How can I use the function summarise_all (from dplyr), but exclude several columns?

I saw some other topics on Stackoverflow, but they didn't gave an workable solution (How to apply summarise_each to all columns except one?).

The select() option is not really a solution, because I'm dealing with a lot of columns.

This is my code:

data_frame1 <- data_frame %>% 
  group_by(visitor_id) %>%
  summarise_all(funs(sum), - hit_time_gmt, - visit_start_pagename)

The error that I get:

Error in eval_bare(dot$expr, dot$env) : object 'hit_time_gmt' not found

And I don't get it, because when I check data_frame, I see that the columns hit_time_gmt and visit_start_pagename are existing.

R overflow
  • 1,196
  • 2
  • 14
  • 31

0 Answers0