Closed
Description
Since I updated R to version 4.0 the scale_x_reverse () function has stopped working together with renderPlot () or renderPlotly( ), which I use in a shiny app that I develop ...
However when I test scale_x_reverse () out of the render it works fine. It is worth mentioning that in all other versions of R it was working normally in both Windowns (7, 8 and 10) and Linux (Ubunto, mint, Debian, Suse). Now I am use Windowns 10, R (4.0), RStudio (1.2.5042).
Can someone help me?
Brief description of the problem
# ` # Variables
peran_multi <<- 0
ysup_multi <- max(NMRData[1,])
yinf_multi <- min(NMRData[1,])
ysup_multi <- ysup_multi + ysup_multi*0.03
chkzoom_multi <<- 1
idb_multi <<- 0
# Data.frame
testy_multi <<- data.frame(Chemical_Shift=CS_values_real[1,],Spectrum=NMRData[1,])
ranges_multi <- reactiveValues(x = c((min(testy_multi$Chemical_Shift)), max(testy_multi$Chemical_Shift)), y = c(-100,ysup_multi))
# ranges_multi_plot <- reactiveValues(x = sort(c((min(testy_multi$Chemical_Shift)), max(testy_multi$Chemical_Shift)), decreasing = TRUE), y = c(yinf_multi,ysup_multi))
spectrums_multi <- reactiveValues(dat = data.frame(Chemical_Shift=CS_values_real[1,],Spectrum=NMRData[1,]))
# Plot
output$plot_multi <- plotly::renderPlotly({
ggplot2::ggplot(spectrums_multi$dat,ggplot2::aes(Chemical_Shift,Spectrum)) + ggplot2::geom_line(color='blue') + ggplot2::scale_x_reverse() +
ggplot2::coord_cartesian(xlim = ranges_multi$x, ylim = ranges_multi$y, expand = FALSE) +
ggplot2::theme(axis.text.x = ggplot2::element_text(size = 12, color = "#000000"),
axis.text.y = ggplot2::element_text(size = 12, color = "#000000"),
title = ggplot2::element_text(face = "bold", color = "#000000", size = 17),
axis.title = ggplot2::element_text(face = "bold", color = "#000000", size = 15)
) +
ggplot2::labs(x = "Chemical Shift", y = "Intensity")
})
`