On 19.06.2008, at 07:24, Paul Adams wrote:
> Hello everyone,
> I am wanting to replace an element in a matrix with NA. I have used
> the following code
> dat<-read.table(file="C:\\Documents and Settings\
> file.show(file="C:\\Documents and Settings\\....txt")
> Whenever I use this code I get the original value when I type show
> (X).I run the script and type
> show(X) and the original value is still there.What am I doing wrong?
Well, actually nothing.
R works line by line. You set X<-dat[1,51] with let's say '4711'. Fine X is now '4711'. Then you change the cell dat[1,51]<-NA. Fine. If you type show(dat) you'll see that the cell 1,51 is now NA. But X is still the same, because X is NOT bound to the content of the cell dat[1,51].
Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Archive generated by hypermail 2.2.0, at Thu 19 Jun 2008 - 07:31:06 GMT.
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.
list of date sections of archive