Re: [Bioc-devel] Delayed Assignment to S4 Slots

2021-10-15 Thread Hervé Pagès
The constructor should probably be doing something like this but you get the idea: ResubstituteParams <- function(nFeatures_call) { if (missing(nFeatures_call)) new("ResubstituteParams", nFeatures=seq(10, 100, 10)) else new("ResubstituteParams", nFeatures_call=substi

Re: [Bioc-devel] Delayed Assignment to S4 Slots

2021-10-15 Thread Hervé Pagès
Hi Dario, It would be good if you could provide a little bit more context about ResubstituteParams objects and how they are typically used in practice. As you found out, delayedAssign() won't work. How about trying something like this? setClassUnion("numeric_OR_NULL", c("numeric", "NULL")

[Bioc-devel] Delayed Assignment to S4 Slots

2021-10-13 Thread Dario Strbenac via Bioc-devel
Good day, I have an S4 class with some slots in my Bioconductor package. One of the slots stores the range of top variables to try during feature selection (the variables might be ranked by some score, like a t-test). The empty constructor looks like setMethod("ResubstituteParams", "missing",