RStudio crashed when ggplot2 plot is shown

My code is as below, it crashes my RStudio in 2 of 4 trials. Not sure what is going on.

require(tidyquant) 
aapl_prices  <- tq_get("AAPL", get = "stock.prices", from = " 1990-01-01")


aapl_daily_returns <- aapl_prices %>%
  tq_transmute(select   = adjusted, 
               mutate_fun = periodReturn, 
               period     = "daily", 
               type       = "arithmetic")



aapl_monthly_returns <- aapl_prices %>%
    tq_transmute(select   = adjusted, 
               mutate_fun = periodReturn, 
               period     = "monthly", 
               type       = "arithmetic")


aapl_weekly_returns <- aapl_prices %>%
  tq_transmute(select   = adjusted, 
               mutate_fun = periodReturn, 
               period     = "weekly", 
               type       = "arithmetic")




ggplot(aes( x = daily.returns), data = aapl_daily_returns) +
  geom_histogram(fill = "blue")


ggplot(aes( x = weekly.returns), data = aapl_weekly_returns) +
  geom_histogram(fill = "blue")


ggplot(aes( x = monthly.returns), data = aapl_monthly_returns) +
  geom_histogram(fill = "blue")

I couldn't repro the issue on 1.2.1114 on OS Mojave. What's your platform?

I am using a Fedora 27 machine. After I have updated all my packages, it is gone. I guess it is related to Rcpp package.

2 Likes

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