I'm trying to plot a joyplot graph( density distributions across time) from the ggridges package. The file 'Dados empilhados' is a pooled data set.
library(ggridges)
library(ggplot2)
library(XLConnect)
data = loadWorkbook('Dados empilhados.xls')
data = readWorksheet(data, sheet = 'Sheet1', header = T)
ggplot(data[data$Time>0,], aes(x = betas.dyn, y = Time, group = Time)) +
geom_density_ridges(scale = 10, size = 0.25, rel_min_height = 0.03) +
theme_ridges() +
scale_x_continuous(limits=c(0.0, 1.3), expand = c(0.01, 0)) +
scale_y_reverse(breaks=c(2016, 2012, 2008, 2004, 2001), expand = c(0.01, 0))
but i'm getting the following error:
Error in -x : invalid argument to unary operator
Obs.: Dados empilhados:
Time Country betas betas.dyn
2001-Q1 Angola 10.02 12.23
2001-Q2 Angola 14.53 13.45
2001-Q3 Angola 13.32 11.74
. . . .
. . . .
. . . .