ggplot2 produces error when used in function or S4

后端 未结 4 1403
南笙
南笙 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:11

    Your version in the function is missing the following two lines at the very beginning compared to the original version:

    Data$Env <- factor(Data$Block)
    Data$Gen  <- factor(Data$Variety)
    

    Have you experimented with using debug() to step through functions to find the source of errors?

提交回复
热议问题