Displaying 2 results from an estimated 2 matches for "tolgadata".
2008 Jun 06
3
col.names ?
Dear R Users,
A bit of an elementary question, but somehow, I haven't been able to
figure it out. I'd like to changes the column names of a data frame, so I
am looking for something like col.names (as in row.names). Could someone
please show me how to change the column names of a data frame ?
Thanks,
Tolga
Generally, this communication is for informational purposes only
and it is
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.