Re: [R] Delete NA from a dist object

2008-06-05 Thread Gabor Grothendieck
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 <[EMAIL PROTECTED]> wrote: > > I have a dist object containing 1 row that is only NA (not very intelligent > to have bas dataset with one NA speciesa

Re: [R] Delete NA from a dist object

2008-06-05 Thread Birgitle
Have still some problems match("name", names(object)) [1] NA which(names(object)=="Iname") integer(0) TestDist = object[-"name",] Fehler in -"name" : ungültiges Argument für unären Operator Error in -"name": invalid argument for unären (don`t know what this means) operator Thanks Birgit m

Re: [R] Delete NA from a dist object

2008-06-05 Thread mel
Birgitle a écrit : Many thanks. Is there a way to give me the number of the row, if I have the row name? B. a= object 'w' = name > match('w', names(a)) # or > which(names(a)=='w') # or but deletion should work with the number and/or with the name. _

Re: [R] Delete NA from a dist object

2008-06-05 Thread Birgitle
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

Re: [R] Delete NA from a dist object

2008-06-05 Thread Birgitle
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 speciesanyway). >> I would like to delete t

Re: [R] Delete NA from a dist object

2008-06-05 Thread mel
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 speciesanyway). I would like to delete this row from this object. newDistObject = distObject[-unwantedRow, ] hih __ R

[R] Delete NA from a dist object

2008-06-05 Thread Birgitle
I have a dist object containing 1 row that is only NA (not very intelligent to have bas dataset with one NA speciesanyway). 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