[R] Combine subsets by factor level

lglucia libgray3827 at gmail.com
Wed Jun 6 06:07:50 CEST 2012


I'm attempting to change a data set by compressing rows into columns.
Currently there are several rows that all have information about one
"patient," but at different cycles. I'm trying to make each patient only
have one row in the data set.

Does anyone know a good way to combine data sets by factor level? I've
separated the groups into different subsets by cycle, but not every patient
has data for every cycle (i.e. there are 1200 who have cycle 0, but only 200
of those have a cycle 1, and a different number have cycles higher than
that, etc). I then made the patient number the identifying label. If there
is a way to column-combine these subsets by the factor level of these
patient names, and leave any patients that are missing a cycle as NA?

If anyone has insight on how to do this, or a better way to complete what
I'm trying to do, I'd appreciate it!

--
View this message in context: http://r.789695.n4.nabble.com/Combine-subsets-by-factor-level-tp4632472.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list