search for: numormyclass

Displaying 2 results from an estimated 2 matches for "numormyclass".

2019 Nov 11
2
Troubles using numeric in s4 class union
...not using integers. Steps to reproduce the problem: library(Matrix) # this class has *nothing* to do with Matrix setClass("MyClass", representation(myvalue = "numeric"), prototype(myvalue = NA_real_)) # this class also has nothing to do with Matrix setClassUnion("NumOrMyClass", c("numeric", "MyClass")) # this is to demonstrate creating and subsetting a specific Matrix m <- new("dgCMatrix", i = c(2L, 0L, 1L, 2L, 0L, 1L), p = c(0L, 1L, 2L, 4L, 4L, 6L), Dim = c(3L, 5L), Dimnames = list(NULL, NULL), x = c(2, 1, 2, 1, 2, 1), factors...
2019 Nov 27
0
Troubles using numeric in s4 class union
...roblem: > > library(Matrix) > > # this class has *nothing* to do with Matrix > setClass("MyClass", > representation(myvalue = "numeric"), > prototype(myvalue = NA_real_)) > # this class also has nothing to do with Matrix > setClassUnion("NumOrMyClass", c("numeric", "MyClass")) > > # this is to demonstrate creating and subsetting a specific Matrix > m <- new("dgCMatrix", i = c(2L, 0L, 1L, 2L, 0L, 1L), p = c(0L, 1L, 2L, 4L, > 4L, 6L), > Dim = c(3L, 5L), Dimnames = list(NULL, NULL), x = c(2...