That great! It's working! Thank you so much!
It is a pure magic which makes my head spin.
aggregate(.~ id, lapply(df, as.character), FUN =
function(x)paste(sort(x), collapse = ''), na.action = na.pass)
1. help says:
Note that ‘paste()’ coerces ‘NA_character_’, the character missing
value, to ‘"NA
Thank you for your efforts.
Although it is still not working, it feels like getting closer and
closer.
id cycle1 cycle2 cycle3
1 1cmfcmfcmf
2 2mfcmfcmfc
3 3 acfNA acfNA NAcfm
I really appreciate transformation from subsets ("c","m","f") to "cmf".
That was critica
Just change the FUN function:
aggregate(.~ id, lapply(df, as.character), FUN = function(x)paste(sort(x),
collapse = ''), na.action = na.pass)
On Fri, Jan 21, 2011 at 6:27 PM, Den wrote:
>
> Thank you for your efforts.
> Although it is still not working, it feels like getting closer and
> closer
Dear Henrique
Thank you again for helping me
Unfortunately, your code seems not to be working
> aggregate(.~ id, lapply(df, as.character), FUN = paste, collapse = "")
id cycle1 cycle2 cycle3
1 1cmfcmfcmf
2 2mfcmfcmfc
3 3 cf cf cf
(letter 'a' missing in df[
correction:
aggregate(.~ id, lapply(df, as.character), FUN = paste, collapse = "",
na.action = na.pass)
On Fri, Jan 21, 2011 at 5:56 PM, Henrique Dallazuanna wrote:
> Try this:
>
> aggregate(.~ id, lapply(replace(df, is.na(df), ''), as.character), FUN =
> paste, collapse = "", na.action = na.pass
Try this:
aggregate(.~ id, lapply(replace(df, is.na(df), ''), as.character), FUN =
paste, collapse = "", na.action = na.pass)
On Fri, Jan 21, 2011 at 5:45 PM, Den wrote:
> Dear Henrique
> Thank you again for helping me
> Unfortunately, your code seems not to be working
>
> > aggregate(.~ id, la
Try this:
aggregate(.~ id, lapply(test, as.character), FUN = paste, collapse = "")
On Fri, Jan 21, 2011 at 10:25 AM, Den wrote:
> Dear [R] people
> Could you please help with following data transformation.
> Any suggestions, hints, references and even guessing on performing any
> of the followi
for the first task ...
Moritz
__
Moritz Grenke
http://www.360mix.de
-Ursprüngliche Nachricht-
Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im
Auftrag von Den
Gesendet: Freitag, 21. Januar 2011 13:26
An: R-help
Betreff: [R] complex transfor
that a reasonable answer can be extracted from a given body of data.
~ John Tukey
> -Oorspronkelijk bericht-
> Van: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] Namens Den
> Verzonden: vrijdag 21 januari 2011 13:26
> Aan: R-help
> Onderwerp: [R]
Dear [R] people
Could you please help with following data transformation.
Any suggestions, hints, references and even guessing on performing any
of the following steps are highly appreciated. Those transformations are
crucial for my work.
(n_, _n, j_, k_ signify numbers)
SOURCE DATA:
id
10 matches
Mail list logo