Skip to content
Prev 334052 / 398513 Next

Merging two data frames, but keeping NAs

Adding the argument all.x=TRUE to merge() will retain the NA values,
but the only reliable way I've found to preserve order with NA values
in a merge is to add an index column to x, merge the data, sort on the
index column, then delete it.

Sarah
On Thu, Dec 5, 2013 at 9:56 AM, Rainer M Krug <Rainer at krugs.de> wrote: