[R] Odd behaviour of R 2.00

Hiroto Miyoshi h_m_ at po.harenet.ne.jp
Sun Nov 14 06:18:03 CET 2004


Dear R users

I have a data frame containing character and numeric variables, whose
name is seishin.  When I tried to assign NA to "" in the data frame, R, 2.00
showed an error message, such as

> seishin[seishin==""]<-NA
Error: NAs are not allowed in subscripted assignments

This did not happen under R 1.9.0.

More oddly,
The following commands work just fine under R 2.0.0
> a<-1:10
> b<-letters[1:10]
> b[3]<-""
> c<-data.frame(cbind(a,b))
> c[c==""]<-NA

Why is this so?
And how can I assign NA to "" data.framewise in seishin data.frame?
Please help.

Sincerely
--------------------------------
Hiroto Miyoshi
h_m_ at po.harenet.ne.jp




More information about the R-help mailing list