0

I have created a grouped data frame using dplyr:

average_steps.i2 <- activity2 %>% 
   group_by(Group, interval) %>%
   summarise(Average.Steps = mean(steps))

when I attempt to plot it, using ggplot

ggplot(average_steps.i2 , aes(x=date,y=Average.Steps)) + 
      geom_line() +
      facet_wrap(~Group , nrow=2)

I get the following error:

Don't know how to automatically pick scale for object of type function. Defaulting to continuous
Error in data.frame(x = function ()  : 
  arguments imply differing number of rows: 0, 576

What does this mean? (I can program around by creating separate data sets and using par() to stack them, but would like to know the ggplot way to do this)

Sandy Muspratt
  • 31,719
  • 12
  • 116
  • 122
Bill Raynor
  • 413
  • 1
  • 4
  • 10

0 Answers0