Re: [R] Delete NA from a dist object

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Thu, 05 Jun 2008 13:47:24 -0400

Try this:

d <- dist(USArrests)
ix <- which("Iowa" == labels(d))
d1 <- as.dist(as.matrix(d)[-ix, -ix])

On Thu, Jun 5, 2008 at 9:39 AM, Birgitle <birgit.lemcke_at_systbot.uzh.ch> wrote:
>
> I have a dist object containing 1 row that is only NA (not very intelligent
> to have bas dataset with one NA species....anyway).
> I would like to delete this row from this object.
>
> It may be not a difficult problem but I can not find a solution presently.
>
> So I would be very happy if somebody could give ma a hint
>
> Thanks
>
> B.
>
> -----
> The art of living is more like wrestling than dancing.
> (Marcus Aurelius)
> --
> View this message in context: http://www.nabble.com/Delete-NA-from-a-dist-object-tp17670016p17670016.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 05 Jun 2008 - 19:31:47 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 05 Jun 2008 - 20:32:34 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