Since this is a sequential problem and we don't need to assign the outcome, we can use a for loop:names(dflist) <- c("dfA", "dfB", "dfC") # Define names of df'sfor (i in seq(dflist)) { gg <- ggplot(dflist[[i]], aes(x = x, y = y, fill = x))+ geom_boxplot(position = "dodge") + ggtitle(names(dflist[i])) print(gg)} 这篇关于从列表中数据框的名称中将标题名称添加到ggplots列表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-25 09:47