Displaying 2 results from an estimated 2 matches for "yr1pb".
Did you mean:
yr1bp
2008 Jun 06
1
editing a data.frame
...d all the positions that have
the inappropriate tags. i tried sub() a couple of different ways, like
yr1bp$TreeTag[1501]<-sub("1.00", "1", yr1bp$TreeTag[1501])
and after turning yr1bp$TreeTag[1501] into <NA>,
yr1bp$TreeTag[1501]<-sub("", "1E-20", yr1pb$TreeTag[1501])
and
sub("", "1E-20", yr1bp$TreeTag[1501])
but it's not working. i guess it has something to do with the data.frame
characteristics i'm not aware of or don't understand. would i somehow
have to tear apart the columns, edit them, and then put it back...
2008 Jun 06
6
Subsetting to unique values
I want to take the first row of each unique ID value from a data frame.
For instance
> ddTable <-
data.frame(Id=c(1,1,2,2),name=c("Paul","Joe","Bob","Larry"))
I want a dataset that is
Id Name
1 Paul
2 Bob
> unique(ddTable)
Will give me all 4 rows, and
> unique(ddTable$Id)
Will give me c(1,2), but not accompanied by the name column.