[R] about the subscript assignment porblem
kh zu
zk_h1 at yahoo.ca
Tue Nov 30 18:50:02 CET 2004
Hi, Dear,
I have a problem for the new version 2.0 of R
When I put this code in it give me the error:
uis$ivhx3[uis$ivhx>0] <- 1*(uis$ivhx==3)
Error: NAs are not allowed in subscripted assignments
but this would happen in version 1.91
there are missing data in the data set and it is
represented as NA
the data set can be find on line
at the ucla web
actually this is a example from its web site
the c code is at
https://svn.r-project.org/R/trunk/src/main/subassign.c
:
if(length(y) > 1)
for(i = 0; i < n; i++)
if(INTEGER(indx)[i] == NA_INTEGER)
error("NAs are not allowed in subscripted
assignments");
So maybe we need get rid of this conditional code.
Best Wishes
Ku
More information about the R-help
mailing list