다음 코드가 있습니다.
library(tidyverse)
all_annot_df <- as.tibble(iris) %>%
mutate(Obs = paste0("Obs_", row_number())) %>%
select(Obs, Species, Sepal.Length)
signif_thres <- 7.5
all_annot_df["Significant"] <- ifelse((all_annot_df$Sepal.Length > signif_thres),"Signif","NotSignif")
p <- all_annot_df %>%
ggplot(aes(reorder(Obs,Sepal.Length), Sepal.Length, colour=Species)) +
geom_point() +
theme_bw() +
xlab("Observation") +
theme(axis.text.x=element_blank(),
axis.ticks.x=element_blank()) +
geom_hline(aes(yintercept=signif_thres, colour='red'))
p
위의 그림과 같이 ggrepel을 사용하여 레이블을 표시하고 싶습니다 . 어떻게하니?
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다