[R] inadverted reordering of a df column when it is copied to another df

Thierry Onkelinx thierry.onkelinx at inbo.be
Fri Mar 17 16:16:34 CET 2017


Dear Karl,

This is hard to investigate without a reproducible example.

Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium

To call in the statistician after the experiment is done may be no
more than asking him to perform a post-mortem examination: he may be
able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does
not ensure that a reasonable answer can be extracted from a given body
of data. ~ John Tukey


2017-03-17 16:05 GMT+01:00 Karl Schilling <karl.schilling op uni-bonn.de>:
> Dear all:
>
> I have two data.frames A and B of the same number of rows (about 40,000). I
> realized that when I copy column x from data.frame A to B, the order of this
> column  gets changed. This seems to affect only values in rownumbers > ~
> 35/36,000. It also happens in any of the following three approaches:
>
> A$x <- B$x
>
> x <- B$x (here, x is still in the correct order)
> B$x <- x : now x is reordered
>
> B <- cbind(A, B$x)
>
> I am working with Windows7Pro/64bit, R 3.3.3, and RStudio 0.99.903.
>
> Any help would be appreciated.
>
> Best regards
>
> Karl Schilling
>
> ______________________________________________
> R-help op r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list