Left Join and Right Join using dplyr

0 votes

I have these two data-frames - "Employee-Designation" and "Employee-Salary"

Employee-Designation:

Name  Designation 
 John    CTO
 Sam     CEO
 Raj     SDE
 Amy     COO
 Anne    Analyst

Employee-Salary:

Name  Salary 
 John    12345
 Sam     23456
 Jason   43251
 Adam    32411
 Anne    22212


I would want to perform left join and right join on these two data-sets and join these two by the "Name" column.

Mar 27, 2018 in Data Analytics by kurt_cobain
• 9,350 points
1,097 views

1 answer to this question.

0 votes

The below is the code to perform left join

left_join(employee_designation,employee_salary,by="name")

Similarly, you can perform the right join as well:

right_join(employee_designation,employee_salary,by="name") 
answered Mar 27, 2018 by Bharani
• 4,660 points

Related Questions In Data Analytics

+1 vote
1 answer

Join using two mappers - invalid inputfile exception

Dear Learner, Hope you are doing well. Can you ...READ MORE

answered Dec 18, 2017 in Data Analytics by Sudhir
• 1,570 points
596 views
0 votes
1 answer

Join list of data.frames using map() call

You can use Reduce set.seed(24) r1 <- map(c(5, 10, 15), ...READ MORE

answered Apr 6, 2018 in Data Analytics by Sahiti
• 6,370 points
1,036 views
0 votes
1 answer

How to join a list of data frames using map()

You can use reduce set.seed(24) r1 <- map(c(5, 10, ...READ MORE

answered Apr 11, 2018 in Data Analytics by kappa3010
• 2,090 points
1,568 views
0 votes
2 answers

Transforming a key/value string into distinct rows in R

We would start off by loading the ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
1,169 views
0 votes
1 answer

Finding frequency of observations in R

You can use the "dplyr" package to ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
5,887 views
0 votes
1 answer

Plotting multiple graphs on the same page in R

If you want to plot 4 graphs ...READ MORE

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,660 points
1,422 views
+1 vote
2 answers

Custom Function to replace missing values in a vector with the mean of values

Try this. lapply(a,function(x){ifelse(is.na(x),mean(a,na.rm = TRUE ...READ MORE

answered Aug 14, 2019 in Data Analytics by anonymous
1,929 views
0 votes
1 answer

Using "dplyr" to summarise multiple columns

You can use the "sumamrise_all()" function for ...READ MORE

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,660 points
1,635 views
0 votes
1 answer

Using dplyr package to summarise multiple columns - R

'dplyr' package provides 'summarise_all()' function to apply ...READ MORE

answered Jun 6, 2018 in Data Analytics by Bharani
• 4,660 points
2,093 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP