r error 4 (Error : C stack usage)

Can anyone help me to get rid of this error, please?

Gráfico de séries temporais

g1 <- ggplot(data, aes(day)) +

  • theme_bw() +
  • geom_line(aes(y = obs, colour = "Obs. max. temp."), lwd = 1.15, alpha = 0.8) +
  • xlab("Time") +
  • ylab("GHI in Cabinda (W h/m^2)") +
  • ggtitle("Global Horizontal Irradiation in Cabinda") +
  • theme(axis.text.x = element_text(angle = 80, hjust = 1),
  •     plot.title = element_text(hjust = 0.5)) +
  • scale_y_continuous(limits = c(105810, 180000)) +
  • scale_x_date(date_breaks = "5 months", labels = scales::date_format("%b %Y")) +
  • scale_colour_manual("", breaks = c("Obs. max. temp."), values = c("blue")) +
  • theme(legend.position = "none")

Exibir o gráfico

Error in RStudioGD() :
Shadow graphics device error: r error 4 (Error : C stack usage 7955288 is too close to the limit
In addition: There were 50 or more warnings (use warnings() to see the first 50)

Without a running example of your data it is hard to say where the error is coming from. Please provide a minimal working example, including data so we can reproduce the error.

One thing that comes to mind is your Y-scale with range over 30,000 this seems as something that might use a lot of memory as the error indicates.

This is an artifact of the operating system. Even though you may have 64GB, and even though R does a decent job of garbage collect to free up unneeded memory, the OS will only have let you have so much. The default for many systems is 2^23 (8,3886,08). On UNIX-derived systems, this can be increased. From the terminal use

man -ulimit

for details.

Windows, I don't know.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.