"Hiroto Miyoshi" <h_m_ at po.harenet.ne.jp> writes:
Dear Professor Dalgaard
It is the NA pattern on the left hand side that matters. Does it help
to use
seishin[!is.na(seishin) & seishin==""]<-NA
?
Yes! the above line worked perfectly.
But why? To me, !is.na(seishin) & seishin=="" seems redundant.
If you could explain this, it would be greatly appreciated.
Thank you.
It's due to this change (do check the NEWS file when things change
unexpectedly...):
o Subassignments involving NAs and with a replacement value of
length > 1 are now disallowed. (They were handled
inconsistently in R < 2.0.0, see PR#7210.) For data frames
they are disallowed altogether, even for logical matrix indices
(the only case which used to work).
Now, I'm getting slightly confused here, since there appears to be
exceptions: