Hi to all.
I am trying (hard) to have the summarized output from my code ,shown per row and as a grand total only.
I have learned that would be cbind code into a matrix (values only).
Is there anyone who could helpme with that?
I would need to see my sales ,forecast and Holtwinters values on rowbases in a matrix.
my reprex:
# load needed packages
library(readr)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(readxl)
library(forecast)
#> Registered S3 method overwritten by 'quantmod':
#> method from
#> as.zoo.data.frame zoo
library (ggplot2)
library(holtwinters)
#> Error in library(holtwinters): there is no package called 'holtwinters'
sales <- read_excel("C:/Users/jenny/Desktop/R Studio/MonthlySales1.xls")
#> New names:
#> * `` -> ...7
#> * `` -> ...8
salesLogHW <- HoltWinters(salesLog)
#> Error in as.ts(x): object 'salesLog' not found
HoltWinters(x= salesLog)
#> Error in as.ts(x): object 'salesLog' not found
HoltWinters(nextYearSales)
#> Error in as.ts(x): object 'nextYearSales' not found
autoplot(forecast(fit))
#> Error in forecast(fit): object 'fit' not found
fit <- Arima(sales$sales)
nextYearSales
#> Error in eval(expr, envir, enclos): object 'nextYearSales' not found
sales
#> # A tibble: 95 x 8
#> Month sales `ETS Forecast` `Hw -alpha` `Hw-beta` `Hw-gamma` ...7 ...8
#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 january 43 NA NA NA NA NA NA
#> 2 february 48 NA NA NA NA NA NA
#> 3 march 47 NA NA NA NA NA NA
#> 4 april 48 NA NA NA NA NA NA
#> 5 may 48 NA NA NA NA NA NA
#> 6 june 49 NA NA NA NA NA NA
#> 7 july 38 NA NA NA NA NA NA
#> 8 august 25 NA NA NA NA NA NA
#> 9 september 48 NA NA NA NA NA NA
#> 10 october 48 NA NA NA NA NA NA
#> # ... with 85 more rows
Created on 2020-05-18 by the reprex package (v0.3.0)