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.
Birgitle a ?crit :> 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.newDistObject = distObject[-unwantedRow, ] hih
Many thanks. Is there a way to give me the number of the row, if I have the row name? B. mel-10 wrote:> > Birgitle a ?crit : > >> 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. > > newDistObject = distObject[-unwantedRow, ] > > hih > > ______________________________________________ > 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. > >----- 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-tp17670016p17670598.html Sent from the R help mailing list archive at Nabble.com.
Additonally I got this error message TestDist = Dist.HalbDisGow88[-147,] Fehler in Dist.HalbDisGow88[-147, ] : falsche Anzahl von Dimensionen (Error in Dist.HalbDisGow88[-147, ] : wrong number of dimensions Birgit mel-10 wrote:> > Birgitle a ?crit : > >> 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. > > newDistObject = distObject[-unwantedRow, ] > > hih > > ______________________________________________ > 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. > >----- 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-tp17670016p17670720.html Sent from the R help mailing list archive at Nabble.com.
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. >