Displaying 2 results from an estimated 2 matches for "cod_out".
Did you mean:
cmd_out
2008 Jun 06
1
Agreggating data using external aggregation rules
...I have a big data frame DF (about 2,000,000 rows) with 7 columns being
variables and 1 being a measure (using reshape package nomeclature).
There are no "duplicates" in it.
Fot each of the variables I have some "rules" to apply, being COD_IN the
value of the variable in the DF, COD_OUT the one to be transformed to;
once obtained the "new codes" in the DF I have to aggregate the "new DF"
(for example summing the measure).
Usually the total transformation (merge+aggregate) really decreases the
number of lines in the data frame, but sometimes it can grows depend...
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.