I'm trying to create a class in R called move
, and want one of the fields to be type move
as well. I know this is possible in Java, but I'm unsure how to do this in R (if it can be done).
I've tried searching for examples, but have been unable to find any. This is what my code looks like:
move = setRefClass("move", fields=list(pos="numeric", backtracker="move"))
This is the error I get when trying to run the above line:
Error in refClassInformation(Class, contains, fields, methods, where) : class “move” for field ‘backtracker’ is not defined
Is it possible to do something like this in R?
Thanks in advance!