I have to compare two Excel spreadsheets as part of a project at work to determine whether a title has been added to or removed from the second Excel sheet (Book 2). Although the code I wrote is effective, it is also not very aesthetically pleasing and is challenging to understand for someone without any prior knowledge of R.

In order for my coworkers to comprehend and make changes to the differences, I want to compare two Excel files and output the differences in a simple manner. The result should ideally be a table that organizes the data so that it is simple to find and edit. I value all the assistance.

```structure(list(Title = c("D", "Mortal Kombat", "Godzilla",
"Wonder", "Suicide Squad", "Mulan"), Studio = c("X", "X",
"X", "X", "X", "Y"), Type = c("Special", "Special", "Special",
"Special", "Special", "Special")), class = c("tbl_df", "tbl",
"data.frame"), row.names = c(NA, -6L))

structure(list(Title = c("D", "Mortal Kombat", "Godzilla",
"Wonder", "Trolls"), Studio = c("X", "X", "X", "X", "X"
), Type = c("Special", "Special", "Special", "Special", "Special"
)), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA,
-5L))

library("compareDF")

compare_df(dat, dat2)```
Oct 14, 2022 in Others 1,548 views

## 1 answer to this question.

Solution:

```library(tidyverse)

book1_output <- anti_join(dat,dat2, by = "Title") %>% mutate(source = "Book1")
book2_output <- anti_join(dat2,dat, by = "Title") %>% mutate(source = "Book2")

final_output <- rbind(book1_output,book2_output)```
• 63,700 points

## Excel formula for searching two text in one cell and return values based on the result

You can include a second IF within ...READ MORE

## Word Mail Merge with Excel data has to be saved in different files with custom names

Try this: Public Sub Mail_Merge() On Error GoTo ErrH Dim ...READ MORE

## How to change two different date format into single date format in excel

With data in A2, in B2 enter: =IF(ISNUMBER(A2),A2,DATE(LEFT(A2,4),MID(A2,6,2),RIGHT(A2,2))) and apply your format ...READ MORE

## Excel, How to split cells by comma delimiter into new cells

The Excel manual method: choose Text to Column ...READ MORE

## Conversion of PDF file to Excel in R

I looked at the pdf, and it ...READ MORE

## Use R to create chart in Excel sheet

Here is a solution utilizing the XLConnect ...READ MORE

## Write from R into template in excel while preserving formatting

you have the XLConnect package. Read the documentation or the vignette of that ...READ MORE

Try something along the lines of: for (i ...READ MORE

## Apache POI - watermark in Excel - different appearance in Excel and LibreOffice

There is nothing that apache poi could ...READ MORE