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 26, 2018 in Data Analytics by kurt_cobain
• 9,320 points
296 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 26, 2018 by Bharani
• 4,580 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,610 points
88 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 5, 2018 in Data Analytics by Sahiti
• 6,320 points
296 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
173 views
0 votes
2 answers

How to use group by for multiple columns in dplyr, using string vector input in R?

data = data.frame(   zzz11def = sample(LETTERS[1:3], 100, replace=TRUE),   zbc123qws1 ...READ MORE

answered Aug 5, 2019 in Data Analytics by anonymous
8,382 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,580 points
259 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,580 points
2,538 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,580 points
234 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
338 views
0 votes
1 answer

Using "dplyr" to summarise multiple columns

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

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,580 points
909 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,580 points
1,126 views