Good day, I created two constructor methods for a generic function. One is for the default empty constructor and the other is a constructor when any one or more parameters is specified by the user. The method signatures are:
1. c("missing", "missing", "missing", "missing", "missing", "missing", "missing", "missing"), 2. c("characterOrMissing", "numericOrMissing", "numericOrMissing", "numericOrMissing", "numericOrMissing", "characterOrMissing", "BiocParallelParamOrMissing", "numericOrMissing") The class unions are defined as you might expect. setClassUnion("characterOrMissing", c("character", "missing")) setClassUnion("numericOrMissing", c("numeric", "missing")) setClassUnion("BiocParallelParamOrMissing", c("BiocParallelParam", "missing")) The first method works as expected: > system.time(CrossValParams()) user system elapsed 0.165 0.000 0.165 The second takes over ten minutes and constantly uses 100% CPU usage, according to top. > system.time(CrossValParams("Leave-k-Out", leave = 2)) user system elapsed 760.018 15.093 775.090 Strangely, if I rerun this code again, it works quickly the second time. > system.time(CrossValParams("Leave-k-Out", leave = 2)) user system elapsed 0.145 0.000 0.145 I haven't been able to come up with a minimal reproducile example of the issue. How can this be done consistently and efficiently? -------------------------------------- Dario Strbenac University of Sydney Camperdown NSW 2050 Australia _______________________________________________ Bioc-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel