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 in Data Analytics by kavya
16 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 20 by anonymous
• 28,040 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 13, 2018 in Data Analytics by darklord
• 6,170 points
170 views
0 votes
0 answers

How to merge or join 2 dataframes in r?

How to merge or join 2 dataframes ...READ MORE

Jul 15 in Data Analytics by Karthick
14 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 in Data Analytics by anonymous
3,159 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,020 points
344 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 in Data Analytics by sindhu
102 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 in Data Analytics by anonymous
• 28,040 points
31 views
0 votes
1 answer

How to add create a box plot with categorical columns?

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

answered Jul 4 in Data Analytics by anonymous
• 28,040 points
44 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 in Data Analytics by anonymous
• 28,040 points
34 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 in Data Analytics by anonymous
• 28,040 points
13 views