Hi,
I am writing on some visualization functions for a large database that consists of multiple "cycles" of production described by numerous parameters. I wrote a code to plot all the parameters linked to a given cycle. I am using the package ggplot2 but it looks like instead of plotting all 34 parameters in that case, I only have 20 plots out of the needed 34 once I call the function. I don't know if the problem lies with my code or if 20 is the full capacity of windows displayed at once? I have heard of functions like dev.off() but don't know if they would help in dealing with this issue. Here is my code:
######## Function plotting all the parameters for one cycle using the indexes of the parameters and the cycle : plot_cycle_allparameters_interactive()
plot_cycle_allparameters_interactive <- function(datafile,Cycle_index){
Cycle_name = names(datafile)[Cycle_index]
Cycle_data = datafile[[Cycle_name]]
for(i in 2:length(Cycle_data)){
figure_interactive <- ggplot(Cycle_data, aes(x =Time,y = Cycle_data[,i], group= 1)) +
geom_line(color='blue') + scale_y_continuous(expand = c(0,0)) + labs(y = colnames(Cycle_data)[i])
print(ggplotly(figure_interactive))
dev.off()
}
}
Any recommendation would be appreciated. Thanks!