1
I want to keep data labels organised in a way that does not overlap with each other.
The idea is to keep them above geom_point
or below.. depending on the position of the line.
How can I proceed ?
Follow the simplified command and a figure as an example of the problem.
dt <- data.frame(periodo = c("JUN", "JUL","AGO","SET","OUT","NOV","DEZ"),
diam = c(2.76,2.75,2.55,2.81,2.1,2.2,2.34,2.89,2.96,2.77,2.88,2.99,2.10,2.11))
dt$Variedade <- rep(c("A", "B"), each = nrow(dt)/2)
dt$periodo <- factor(dt$periodo, levels = c("JUN", "JUL","AGO","SET","OUT","NOV","DEZ"))
ggplot(dt, aes(x = periodo, y = diam, group = Variedade)) +
geom_point() +
geom_line() +
geom_label(aes(label = diam)) +
scale_y_continuous(breaks = c(2,4), limits = c(1,5))
When running the above command with the argument
ggrepel::geom_label_repel(fill = "white")
is returning me to the following error:Error in repel_boxes2(data_points = as.matrix(x$data[, c("x", "y")]), : pacote 'Rcpp_precious_remove' não oferece a função 'Rcpp'.
– patrick cesar