When assigning class types to fields in Reference Classes, what is the specification for numeric that allows for NAs? For example, if I use the following code and try to assign a value of NA to the field extinctTime, I receive an error stating:
Error: invalid assignment for reference class field ‘extinctTime’, should be from class “numeric” or a subclass (was class “logical”)
I know there is likely a simple solution to permit the inclusion of NA extinction times for field extinctTime, but any advice would be great.
simClass <- setRefClass(
Class = 'simClass',
fields = list(
...
extinct = 'logical',
extinctTime = 'numeric'
...
)
)