Note, I am relatively knew to R and have learned a lot from questions and answers found here.
So, I am have a dataframe that has month and year currently as a character string in the form "yyyy-mm". The original data was by minutes and so I used the group_by function to take the average of the data. I noticed when using group_by I was received a PosIXlt error and thus made the column a character string.
That worked in order to do the group_by and I was able to get the averages by month. Now when I am trying to make a line graph using the Month_Yr column as my x-axis but am now not able to plot due to the characters. A sample of my df is:
Month_Yr GAP_Mean <chr> <dbl> 2006-12 1.9012951 2007-01 1.5460339 2007-02 1.4010835 2007-03 1.3186270
etc. I have several other columns and am trying to create all of them on one graph and found help via other posts and was able to graph when I just had months but the Month_Yr column is giving me trouble. When putting in the following code, I get the warning "geom_path: Each group consists of only one observation. Do you need to adjust the group aesthetic?".
Month_Yr%>% gather(key, Watts, GAP_Mean, GAP_Diff) %>% ggplot(aes(x=Month_yr,y=Watts,colour=key))+geom_line()
I am hoping someone can help. As said, I am relatively new to R. I had to write a report using this data and threw it in Excel but now am trying to get more accustomed to the visualisation packages of R. Please let me know if you I have been unclear or you need any further info.