如何使两个字符串的顶部在图上对齐?
library(stringr)
arep <- rep('a', 17) %>%
str_c(collapse = "\n")
brep <- rep('b', 10) %>%
str_c(collapse = "\n")
plot.new()
text(x = .5, y = .5, labels = arep)
text(x = .4, y = .5, labels = brep)
答案 0 :(得分:0)
尽管这是一种解决方法,但至少这是可行的:
arep <- rep('a', 17) %>%
str_c(collapse = "\n")
brep <- c(rep('b', 10), rep("", 7)) %>%
str_c(collapse = "\n")
plot.new()
text(x = .5, y = .5, labels = arep)
text(x = .4, y = .5, labels = brep)