У меня есть следующий воспроизводимый график коэффициентов.
library(tidyverse)
tribble(~term, ~estimate, ~lower, ~upper, ~text,
"a", .25, .2, .3 , "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet orci vel dolor luctus auctor sed non lacus. Cras malesuada, tortor ac mattis rutrum, dui erat aliquam ipsum, id.",
"b", -.25, -.3, -.2, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet orci vel dolor luctus auctor sed non lacus. Cras malesuada, tortor ac mattis rutrum, dui erat aliquam ipsum, id.",
"intercept",0, -.1, .1, NA) %>%
ggplot(aes(y = term, x = estimate, label = text)) +
geom_point() +
ggrepel::geom_text_repel(size = 2, label.size = 0.1) +
geom_errorbarh(aes(xmin = lower, xmax = upper), height = 0) +
geom_vline(aes(xintercept = 0), linetype = "dashed") +
theme_classic()
Я хотел бы, чтобы метки были над точками и были ограничены меньшей шириной xlim aka. Есть ли способ обернуть текст или создать какое-то текстовое поле в ggplot2
или ggrepel
, чтобы сделать эту функциональность возможной?
\n
для разрыва строки. - person Martin Schmelzer   schedule 10.04.2018