Jyo Nookula
Jyo Nookula

Reputation: 111

R-Date and time analysis

I am working on a reservation/booking data analysis to identify most popular hours and least popular hours (staffing can be increased during peak hours and lowered during lull). I tried a ggplot of date and time, hoping to see a peak and lull. I got this error:

ggplot(aes(x=dates, y=time),data=try)+geom_line error

Dont know how to add geom_line to this plot

Upvotes: 1

Views: 772

Answers (1)

akrun
akrun

Reputation: 887118

We need the () to make it work

  ggplot(aes(x=dates, y=time), data=try)+geom_line
  #Error: Don't know how to add geom_line to a plot
  ggplot(aes(x=dates, y=time), data=try)+geom_line()

data

  try <- data.frame(dates=1:5, time= sample(20, 5, replace=TRUE))

Upvotes: 1

Related Questions