Displaying 2 results from an estimated 2 matches for "yr1bp".
Did you mean:
rbp
2008 Jun 06
1
editing a data.frame
...n. as the last
value shows, some of the tags have decimals followed by 2 decimal
places. i just want whole numbers, i.e. not 1.00E-20, but 1E-20. i have
a rough understanding of regexp and grepped 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...
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.