2 dataframes in single dplyr pipeline

0 votes
Hi, Is it possible to use 2 dataframe/datasets in a pipelined statements? I need data from first dataframe and pass it to dataframe2 and fetch result.
Aug 7, 2019 in Data Analytics by kavya
1,209 views

1 answer to this question.

0 votes
You can use 2 different data frames in one pipeline but not together i,e

You can do this - >

dataframe1 %>% filter(dataframe1$var condition,dataframe2$var condition) %>% ................

But not this ->

dataframe1 %>% filter(var condition) %>% dataframe2 %>% filter(var condition) %>% ................

You can access secondary or multiple data frames within the pipeline of one data frame with its dataframe$variable_name.

Hope it helps.
answered Aug 21, 2019 by anonymous
• 33,030 points

Related Questions In Data Analytics

+1 vote
1 answer

How to convert a list of dataframes in to a single dataframe using R?

You can use the plyr function: data <- ...READ MORE

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

How to merge or join 2 dataframes in r?

Hi, When you merge two Dataframes, the result ...READ MORE

answered Oct 30, 2020 in Data Analytics by MD
• 95,440 points
507 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 6, 2019 in Data Analytics by anonymous
13,686 views
0 votes
1 answer

Rename a single column in dataframe using R

colnames(Samp)[2] <- "newname2" This sets the name of ...READ MORE

answered Apr 13, 2018 in Data Analytics by kappa3010
• 2,090 points
1,848 views
0 votes
3 answers

Code snippet to find number of null values in each column in a dataframe in R

colSums(is.na(data_frame_name)) will return you number of nulls ...READ MORE

answered Jul 5, 2019 in Data Analytics by sindhu
16,997 views
0 votes
1 answer

% of nulls for each column in the dataset - R

Use code as below -  lapply(air,function(x) { length(which(is ...READ MORE

answered Jul 4, 2019 in Data Analytics by anonymous
• 33,030 points
898 views
+1 vote
1 answer

How to add create a box plot with categorical columns?

One way is to convert to factor ...READ MORE

answered Jul 4, 2019 in Data Analytics by anonymous
• 33,030 points
1,756 views
0 votes
1 answer

Convert data.frame object into character vector/list

Hi, it is possible to store them ...READ MORE

answered Jul 9, 2019 in Data Analytics by anonymous
• 33,030 points
6,296 views
0 votes
1 answer

Can you use 2 dataframes in one ggplot?

Hi, Archana You can use only one data ...READ MORE

answered Aug 26, 2019 in Data Analytics by anonymous
• 33,030 points
505 views
0 votes
1 answer

List all dataframes in R session.

Try this. for(x in ls()){   if("data.frame" %in% ...READ MORE

answered Nov 4, 2019 in Data Analytics by anonymous
• 33,030 points
3,001 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