As Dason mentioned in the comment, your problem is with assignment. Let's create a simple example:
c1 = setRefClass("c1", fields = list( data = "numeric"))
c1$methods(m1 = function(a) a)
Now a quick test:
x = c1$new(data=10)
x$m1(1)
However,
R> c1$methods(m2 <- function(a) a)
Error in c1$methods(m2 <- function(a) a) :
Arguments to methods() must be named, or one named list
gives the error you see. The reason for this is that the <-
operator is slightly different from the =
operator. This in general doesn't matter (but it does here).