I am trying to plot 100 sheet of excel data that have different X and Y values. And, I am new to R, I just started using this a month ago. For now, I am trying to plot two sheets of data from the 100 sheets. I manage to use XLConnect to import the excel file onto R. And, string out the header from each sheets, so it doesn't mess up the format
And, I wrote this:
ggplot(data, aes(x,y)) +
+ geom_line(data$Sheet1, aes(x=X, y=Y), colour = "blue")
+ geom_line(data$Sheet100, aes(x=X, y=Y), colour = "red")
The R studio gives me this error message:
Error: ggplot2 doesn't know how to deal with data of class list
So in the end I tried data with header and without header. Eventually, both all have the same error problem. I don't know what to do. Could you please help me out?
Thanks
Update: the problem solved
p <- ggplot(data$Sheet1, aes(x=X,y=Y)) + geom_point(color='blue')
p
p <- p + geom_point(data= data$Sheet2,aes(x=X,y=Y),color='red')
p
p <- p + geom_point(data= data$Sheet3,aes(x=X,y=Y),color='pink')
p
and continue adding for layering the plot