Re: [R] Change values in a dateframe-Speed TEST

2013-07-25 Thread arun
#   0.132   0.000   0.133 identical(res1,as.data.frame(dtNew)) #[1] TRUE A.K. ----- Original Message - From: Arnaud Michel To: Berend Hasselman Cc: R help Sent: Thursday, July 25, 2013 3:59 AM Subject: Re: [R] Change values in a dateframe-Speed TEST Le 25/07/2013 08:50, Berend Hasselm

Re: [R] Change values in a dateframe-Speed TEST

2013-07-25 Thread Arnaud Michel
Le 25/07/2013 08:50, Berend Hasselman a écrit : On 25-07-2013, at 08:35, Arnaud Michel wrote: But I just noticed that the two solutions are not comparable : the change concern only Nom and Prenom (solution Berend) and not also Sexe or Date.de.naissance orother variables (solution Arun) that c

Re: [R] Change values in a dateframe-Speed TEST

2013-07-24 Thread Berend Hasselman
On 25-07-2013, at 08:35, Arnaud Michel wrote: > But I just noticed that the two solutions are not comparable : > the change concern only Nom and Prenom (solution Berend) and not also Sexe or > Date.de.naissance orother variables (solution Arun) that can changed. But my > question was badly put

Re: [R] Change values in a dateframe-Speed TEST

2013-07-24 Thread Arnaud Michel
But I just noticed that the two solutions are not comparable : the change concern only Nom and Prenom (solution Berend) and not also Sexe or Date.de.naissance orother variables (solution Arun) that can changed. But my question was badly put. Michel Le 25/07/2013 08:06, Arnaud Michel a écrit :

Re: [R] Change values in a dateframe-Speed TEST

2013-07-24 Thread Arnaud Michel
Hi For a dataframe with name PaysContrat1 and with nrow(PaysContrat1) [1] 52366 the test of system.time is : system.time(droplevels(do.call(rbind,lapply(split(PaysContrat1,PaysContrat1$Matricule), FUN=function(x) {x[,c("Nom","Prénom")] <- x[nrow(x),c("Nom","Prénom"),drop=TRUE];x} user