[Rd] Error message for matrix(1)[[1,,]]

Stavros Macrakis macrakis at alum.mit.edu
Thu Mar 26 16:44:25 CET 2009


> matrix(1)[[1,]]
Error in matrix(1)[[1, ]] : invalid subscript type 'symbol'

This is of course an incorrect use of [[, but I think the error
message could be more helpful.
I will guess that it is interpreting the missing value indicator as a
symbol, since I get the same error message for

> matrix(1)[[ quote(a=), ]]

          -s

PS quote(a=) seems to be the easiest way to get the missing value
indicator as a value.  Is it by design that it returns the MVI? Or is
it a missing error check?



More information about the R-devel mailing list