![]() I do not have access to the forecast package. ![]() Could someone please tell me what I am doing wrong? (note: the computer I am using for my work does not have an internet connection or a usb port - it only has R with some preloaded packages. However, none of these seem to be working correctly. #third attempt (plot actual, predicted and 5 future values - here, the actual and future values show up, but not the predicted) Legend("topleft", legend = c("original","fitted"), col = c("black","red"),lty = 1) How to plot multiple line charts in the same graph using two different methods depending upon your data.ggplotrstudiodatavisualisationCode : https://rpubs. Lines(fitted(fit), col = "red") # plot fitted values Plot(ts, main="as-is") # plot original sim #second attempt at plotting (no second line?) Here were my attempts at plotting the graphs: #first attempt at plotting (no second line?) Ts = ts(y.mon$property_damages_in_dollars, start = c(2014,1), frequency = 12) Y.mon$week = y.mon$`format(as.Date(date_decision_made), format = "%W-%y")` Y.mon<-aggregate(property_damages_in_dollars~format(as.Date(date_decision_made),įormat="%W-%y"),data=final_data, FUN=sum) Property_damages_in_dollars <- rnorm(731,100,10)įinal_data <- ame(date_decision_made, property_damages_in_dollars) I simulated some data in R and then tried to make plots that show actual vs predicted: #set seedĭate_decision_made = seq(as.Date(""), as.Date(""),by="day")ĭate_decision_made <- format(as.Date(date_decision_made), "%Y/%m/%d") In this tutorial, you will find step-by-step instructions to create line graphs, especially multiple line graphs, and to place legends right on top of the lines. Yet, when I ran the code, I can only see a line of one color. ![]() the actual values for a statistical model (arima, time series). ![]() I am trying to use the "lines' command in ggplot2 to show the predicted values vs. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |