Madhura Paralikar
Madhura Paralikar

Reputation: 1

How to merge data extracted from other excel sheets into one final excel sheet in r?

I need to make an final excel sheet which will contain inputs from other excel sheets. For the same I have extracted data based on some conditions and trying to merge them into one by using merge function but when I am doing so it's combining the extracted data alphabetically or in a weird way not one by one or in some order. I want the extracted data in order. P.S. Using R shiny to upload the files and extracting the data but not able to merge them.

Upvotes: 0

Views: 66

Answers (1)

CSS
CSS

Reputation: 71

To efficiently read the files, you can use the fread() function from library data.table.

library(data.table)
df1 = fread("file1.xlxs")
df2 = fread("file2.xlxs")

To preserve the row order while joining 2 data frames, you can use the join() function from library plyr.

library(plyr)
df = join(df1,df2)

Upvotes: 1

Related Questions