[Rd] Error: NAs are not allowed in subscripted assignments: change from R.1.9

Vadim Ogranovich vograno at evafunds.com
Sun Apr 3 23:39:53 CEST 2005


Hi,

There seems to be a change in 2.0.1 in the workings of subscript
assignments with missing values.


# This is R.2.0.1

# assignment w/ missing index doesn't work when right-hand-side is a
matrix. It did work in 1.9.1
> x = matrix(1, 2, 2); x[c(1,NA),] = x
Error: NAs are not allowed in subscripted assignments
# it does work for a vector
> x = matrix(1, 2, 2); x[c(1,NA),] = 1

Is this change intentional? There seems to be nothing about it in the
release notes.

Thanks,
Vadim


> version
         _                       
platform x86_64-unknown-linux-gnu
arch     x86_64                  
os       linux-gnu               
system   x86_64, linux-gnu       
status                           
major    2                       
minor    0.1                     
year     2004                    
month    11                      
day      15                      
language R



More information about the R-devel mailing list