I tried to add a column in the results table called "besoin_fr," but it's giving me an error saying "Warning: Error in <-: attribute 'names' [34] must be of the same length as vector [33]."
} else {
colnames(new_results) <- c(
"Date",
paste("Temp\U00E9rature salle propre (Tlocal [\U00B0 C])"),
paste("Humidit\U00E9 Relative salle propre (HRlocal [%])"),
paste("Temp\U00E9rature de soufflage (T_souf [\U00B0 C])"),
# "Temperature exterieure (T_ext [\U00B0C])",
paste("Temp\U00E9rature reseau d'eau chaude (T_eau_ch [\U00B0 C])"),
paste("Temp\U00E9rature reseau d'eau froide (T_eau_fr [\U00B0 C])"),
paste("Besoin de chaleur ou de froid (Besoin [kWh])"),
paste("Conso thermique chaud (conso_ch (kWh))"),
paste("Conso thermique chaud par heure (conso_ch (kWh))"),
paste("Conso gaz chaudi\U00E8re par heure (kWh)"),
paste("Conso thermique froid (conso_fr (kWh))"),
paste("Conso thermique froid par heure (conso_fr [kWh])"),
paste("Conso \U00E9lec froid par heure [kWh]"),
paste("Zones"),
paste("Temp\U00E9rature de m\U00E9lange (T_mel [\U00B0 C])"),
paste("Humidit\U00E9 relative du m\U00E9lange (HR_mel [%])"),
paste("Quantit\U00E9 d'eau condens\U00E9", "e par heure (cond_eau [dm3])", sep = ""),
paste("Quantit\U00E9 d'eau evapor\U00E9", "e par heure (conso_eau [dm3])", sep = ""),
paste("Quantit\U00E9 d'eau evapor\U00E9", "e par heure zone1 (conso_eau_z1 [dm3])", sep = ""),
paste("Conso \U00E9lec ventilateur par heure (conso_ventilateur [kWh])"),
paste("D\U00E9bit d'air neuf (m_a_n [m3/h])"),
paste("D\U00E9bit d'air repris (m_a_r [m3/h])"),
paste("Consigne (Tmin [\U00B0 C])"),
paste("Consigne (Tmax [\U00B0 C])"),
paste("Consigne (HRmin [%])"),
paste("Consigne (HRmax [%])"),
paste("Consignes Apports (ConsApports [kWh])"),
paste("r m\U00E9lange (r_mel [g eau/kg air sec])"),
paste("Quantit\U00E9 cumul\U00E9", "e d'eau evapor\U00E9", "e (conso_eau [dm3])", sep = ""),
paste("Quantit\U00E9 cumul\U00E9", "e d'eau condens\U00E9", "e (cond_eau [dm3])", sep = ""),
paste("Quantit\U00E9 cumul\U00E9", "e d'eau evapor\U00E9", "e zone 1 (conso_eau_z1 [dm3])", sep = ""),
paste("Conso \U00E9lec cumul\U00E9", "e ventilateur (conso_ventilateur [kWh])", sep = ""),
paste("Conso cumul\U00E9", "e humidificateur (conso_humid [kWh])", sep = ""),
paste("Besoin de froid zone8 (Besoin_fr [kWh])")
)
}
Data_consigne0 <- Table_bilan0()$bilan_consigne0
Data_consigne0$`Nombre d'heures` <- format(Data_consigne0$`Nombre d'heures`, digits = 9, decimal.mark = ".", big.mark = " ")
Data_cons0 <- Table_bilan0()$bilan_conso0
Data_cons0$Valeur <- format(Data_cons0$Valeur, digits = 9, decimal.mark = ".", big.mark = " ")
Data_zone0 <- Table_bilan0()$bilan_zone0
Data_zone1 <- Table_bilan0()$bilan_zone1
Data_zone0$`Nombre d'heures` <- format(Data_zone0$`Nombre d'heures`, digits = 9, decimal.mark = ".", big.mark = " ")
Data_zone1$`Nombre d'heures` <- format(Data_zone1$`Nombre d'heures`, digits = 9, decimal.mark = ".", big.mark = " ")
Data_MDE <- data.frame(MDE = c(paste("R\U00E9", "cup\U00E9rateur de chaleur", sep = ""), "Free cooling"))
Data_MDE$etat <- c(input$Mode_recup_ener0, input$Free_Cooling0)
wb <- XLConnect::loadWorkbook(filename = file, create = TRUE)
XLConnect::createSheet(wb, name = "Resultats")
cs <- XLConnect::createCellStyle(wb, name = "myDateStyle")
XLConnect::setDataFormat(cs, format = "dd/mm/yyyy HH:MM")
XLConnect::setCellStyle(wb, sheet = "Resultats", row = 1, col = 1, cellstyle = cs)
XLConnect::createSheet(wb, name = "Resultats")
XLConnect::writeWorksheet(wb, data = new_results, sheet = "Resultats")
setColumnWidth(wb, sheet = "Resultats", column = 1, width = 5000)
setColumnWidth(wb, sheet = "Resultats", column = 2, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 3, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 4, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 5, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 6, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 7, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 8, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 9, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 10, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 11, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 12, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 13, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 14, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 15, width = 2500)
setColumnWidth(wb, sheet = "Resultats", column = 16, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 17, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 18, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 19, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 20, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 21, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 22, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 23, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 24, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 25, width = 2800)
setColumnWidth(wb, sheet = "Resultats", column = 26, width = 2800)
setColumnWidth(wb, sheet = "Resultats", column = 27, width = 2800)
setColumnWidth(wb, sheet = "Resultats", column = 28, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 29, width = 3000)
setColumnWidth(wb, sheet = "Resultats", column = 30, width = 3000)
XLConnect::createSheet(wb, name = "Donnees Meteo")
**`strong text`**