ggplot2 produces error when used in function or S4

后端 未结 4 1469
南笙
南笙 2021-01-17 08:35

I\'ve tough time with ggplot2 when used in function or S4. Here is my code without function:

rm(list=ls(all=TRUE))
library(nlme)
data(Oats)
Data <- Oats

         


        
4条回答
  •  孤城傲影
    2021-01-17 09:08

    p <- p + geom_text(aes(label = row.names(G)), size = 3, vjust = 1.25, colour = "black")
    

    You're providing it with a layer, but no data to plot. Either move label= into your original call to ggplot or provide geom_text() with a data= argument

提交回复
热议问题