This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
library(dplyr) library(readr) library(readxl) library(writexl) library(openxlsx) library(lubridate)
library(ggplot2) - gráficos library(zoo) library(data.table)
library(dplyr) - manipulação de dados library(naivebayes) - redes
neurais library(neuralnet) - redes neurais library(quantmod)
library(fpp) - dados de séries temporais - 1ª edição library(fpp2) -
dados de séries temporais - 2ª edição library(fpp3) - dados de séries
temporais - 3ª edição library(forecast) - previsões library(DMwR2)
library(stats)
library(plogr) library(psych) - estatística - correlações
library(forecast) library(fpp) library(fpp2)
library(tseries) library(patchwork) library(mFilter) library(xts)
library(zoo)
vendas2024 <- read_excel(“Vendas2024.xlsx”) salario_base2024 <- read_excel(“Salario_base2024.xlsx”)
pagamentos_realizados <- salario_base2024 %>% select(n_inscricao =‘Número de Inscrição’, nome = Nome, sobrenome = Sobrenome, setor = Setor, cargo = Cargo, contrato = Contrato, salario_base = Salario_base )
pagamento_realizados <- pagamentos_realizados %>% mutate(nome_completo = paste(nome, sobrenome), vendas_mes = 0, aliquota_ir = 0, irpf = 0, inss = 0, comisao_vendas = 0, salario_liquido = 0, inss_parcela_empregador = 0, fgts = 0) %>% select(-c(nome, sobrenome))
vendas_mes <- vendas2024 %>% group_by(ano, mes)%>% summarise(venda_mensal = sum(venda_diaria)) %>% arrange(ano, mes)
plot(vendas_mes$venda_mensal)
vendas_mes_ts <- ts (vendas_mes$venda_mensal, start = c(2018,1), frequency = 12) plot(vendas_mes_ts)
decomp_vendas_mes <- decompose(vendas_mes_ts, type = “additive”) plot(decomp_vendas_mes)
forecast(vendas_mes_ts, 6, 90) forecast(vendas_mes_ts, 6, 95
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
You can also embed plots, for example:
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.