Open SaiPavanKumarB opened 5 years ago
png(paste0("Line_Graph_Aggregated.png"), width=15, height=10, units="in", res = 144) p<-ggplot(data=temp,aes(x=Date_Time, y=value, colour=variable))+geom_line()+ theme(axis.text.x = element_text(angle = 60, vjust = 0.5, hjust = 0.5))+scale_x_datetime(breaks = temp$Date_Time)+ ggtitle(paste0("Forecast Vs Adjusted")) print(p) pic_file<-paste0("Line_Graph_Aggregated.png") insertImage(WorkBook,"Aggregated Data", pic_file, startRow = 14, startCol = 'A') saveWorkbook(WorkBook,file = paste0(BookName,".xlsx"), overwrite = TRUE)
Image is being generated & saved as .png file in the working directory. But it is not being inserted to the Workbook
(please attach an example xlsx file if possible)
1.
2.
3.
Version of openxlsx : 4.1 Version of R: 3.4
Expected Behavior
png(paste0("Line_Graph_Aggregated.png"), width=15, height=10, units="in", res = 144) p<-ggplot(data=temp,aes(x=Date_Time, y=value, colour=variable))+geom_line()+ theme(axis.text.x = element_text(angle = 60, vjust = 0.5, hjust = 0.5))+scale_x_datetime(breaks = temp$Date_Time)+ ggtitle(paste0("Forecast Vs Adjusted")) print(p) pic_file<-paste0("Line_Graph_Aggregated.png") insertImage(WorkBook,"Aggregated Data", pic_file, startRow = 14, startCol = 'A') saveWorkbook(WorkBook,file = paste0(BookName,".xlsx"), overwrite = TRUE)
Actual Behavior
Image is being generated & saved as .png file in the working directory. But it is not being inserted to the Workbook
Steps to Reproduce the Problem
(please attach an example xlsx file if possible)
1.
2.
3.
sessionInfo()