Hi,
I am working on a large data-frame that has 4 columns and each column has variable rows. I am trying to find unique and identical pathways between the 4 columns (each column represent a particular day of treatment with a drug). Here below is a small example.
Pathways_1Day <- c("blood","kidney","testis","No","bone","liver","intestine","lungs","ABC","pancreas","Yes")
Pathways_2Day <- c("blood","kidney","testis","eyes","bone","cells","intestine","cervix","ABC","pancreas","None")
Pathways_3Day <- c("blood","kidney","vessels","lymph","t-cells","liver","intestine","lungs","ABC","epidermis","None")
df<-data.frame(Pathways_1Day,Pathways_2Day,Pathways_3Day)
I want to get a summary of the no of pathways that are common between different timepoints (1, 2 and 3 days).
Important: The no of pathways is not the same for each day.
I have tried this:
All_pathwayNames <- df%>%group_by_all%>%count
But the desired output is not what I am trying to get.
There can be different ways to address that. It will be great if I can get matching rows infront of each other across all columns.
Regards
What is the expected output for this data?