Please use reply-all to keep the mailing list in the loop, and use plain text
rather than HTML to make sure the your message gets through uncorrupted.
?merge
?lapply
# untested
# align rows by date
df1a <- merge( df1, df2, by="date", all.x=TRUE )
# like-named columns have .x or .y appended
df1
Why would you want to use a for loop? Is this homework?
--
Sent from my phone. Please excuse my brevity.
On May 6, 2016 4:15:09 PM PDT, Saba Sehrish via R-help
wrote:
>
>
>Hi
>
>I have two dataframes(df1, df2) with equal number of columns (1566) but
>lesser rows in df2 (2772 in df1 and 40 in
Hi
I have two dataframes(df1, df2) with equal number of columns (1566) but lesser
rows in df2 (2772 in df1 and 40 in df2). Row names are
identical in both dataframes (date). I want to replace NAs of df1 with the
values of df2 for all those rows having identical row names (date) but
without
3 matches
Mail list logo