Skip to content

Commit

Permalink
Repete os dados de PCH para o futuro.
Browse files Browse the repository at this point in the history
  • Loading branch information
tuberculo committed Jun 27, 2020
1 parent 8c41e78 commit 4d2130d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CalcFatorPCH.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ FatorPCH <- pivot_wider(FatorPCH, names_from = Subsistema, values_from = fator,
FatorPCH <- mutate(FatorPCH, across(where(is.double), round, 3))
write.table(FatorPCH, paste0("FatorPCH.tsv"), sep = "\t", dec = ",", row.names = FALSE)

Arquivo <- "C:/Users/malta/AppData/Local/Temp/~PLEXOS/0b9c23e3-de92-43ff-a02f-e17c98e4a6c4/Entradas/Vazoes/FatorPCH - Copia.tsv"
dados <- read_tsv(Arquivo, locale = locale(decimal_mark = ","))

novoFator <- bind_rows(dados, mutate(dados, YEAR = YEAR + (2018 - 1982) + 1))
#Remove os dias bissextos nos anos errados.
novoFator <- drop_na(mutate(novoFator, Data = ymd(paste0(YEAR, "/", MONTH, "/", DAY))))
novoFator <- select(novoFator, -Data)
write.table(novoFator, paste0("FatorPCH.tsv"), sep = "\t", dec = ",", row.names = FALSE, quote = FALSE)


FatorPCH <- mutate(group_by(FatorPCH, Subsistema), porMed = Vazao / mean(Vazao), FC = Vazao / max(Vazao))
Expand Down

0 comments on commit 4d2130d

Please sign in to comment.