The following indicates that assignment of numeric values to an @values part of an mxMatrix only works when the [] are there. When they are not there (which used to work fine) we get an error:
> DirectionofCausationBcausesA$ACE.B@values
[,1] [,2]
[1,] 0 0
[2,] 0 0
> DirectionofCausationBcausesA$ACE.B@values[]
[,1] [,2]
[1,] 0 0
[2,] 0 0
>
> DirectionofCausationBcausesA$ACE.B@values<-0
Error in checkSlotAssignment(object, name, value) :
assignment of an object of class "numeric" is not valid for slot "values" in an object of class "FullMatrix"; is(value, "matrix") is not TRUE
>
>
> DirectionofCausationBcausesA$ACE.B@values
[,1] [,2]
[1,] 0 0
[2,] 0 0
>
> DirectionofCausationBcausesA$ACE.B@values[]<-0
#1
Log in or register to post comments
#2
foo <- matrix(1:9, 3, 3)
is.matrix(foo) # TRUE
foo <- 0
is.matrix(foo) # FALSE, oops
foo <- matrix(1:9, 3, 3)
foo[] <- 0
is.matrix(foo) # TRUE
Log in or register to post comments