Skip to content
Back to formatted view

Raw Message

Message-ID: <20050517091813.0520b712.detlef.steuer@hsu-hamburg.de>
Date: 2005-05-17T07:18:13Z
From: Detlef Steuer
Subject: NA erase your data trick
In-Reply-To: <4289901C.60608@statistik.uni-dortmund.de>

On Tue, 17 May 2005 08:33:00 +0200
Uwe Ligges <ligges at statistik.uni-dortmund.de> wrote:

> Anders Schwartz Corr wrote:
> > Oops,
> > 
> > I just erased all my data using this gizmo that I thought would replace -9
> > with NA.
> > 
> > A) Can I get my tcn5 back?
> 
> As you got it the first time. There is nothing like "undo".

If you??re lucky it still lives inside an old, not overwritten when leaving the depressing R session .RData.

Detlef

> 
> 
> > B) How do I do it right next time, I learned my lesson, I'll never do it
> > again, I promise!
> 
> By vectorization:
> 
>     tcn5[tcn5 == -9] <- NA
> 
> Uwe Ligges
> 
> 
> 
> > Anders Corr
> > 
> > 
> >>for(i in 1:dim(tcn5)[2]){         ##for the number of columns
> > 
> > +     for(n in 1:dim(tcn5)[1]){     ##for the number of rows
> > +         tcn5[is.na(tcn5[n,i]) | tcn5[n,i] == -9] <- NA
> > +
> > +         }
> > + }
> > 
> > 
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html