I have a very complex dataset where I am struggling to find with R, the joint occurrence through four main columns in their values' rows. To explain this better, I am providing the following example with the airquality dataset, where just for simplicity purposes, I will show two main examples:
library(readxl)
library(tidyverse)
libra
library(data.table)
install.packages('hablar')
library(hablar)
#1st example
airquality %>%
select(Wind, Temp) %>%
find_duplicates(Wind, Temp)
#2nd example
airquality %>%
select(Wind, Month) %>%
find_duplicates(Wind, Month)
And so on. Just to avoid writing separate chunks of code to iterate the same operation for further columns, could you please suggest another iterative mode for the same results (for loops, map() functions, apply() functions). Could you please show as follows some examples?
Just to clarify the output I am looking for seems more a less to a table such as the one provided below:
# A tibble: 31 x 2
Wind Temp
<dbl> <int>
1 6.9 74
2 11.5 68
3 14.9 81
4 7.4 76
5 8 82
6 11.5 79
7 14.9 77
8 10.3 76
9 6.3 77
10 14.9 77
# ... with 21 more rows
But I would like to iterate the same result for many columns of interest
P.s. I know that instead of using function 'find_duplicates from the package ('hablar') there are different. So you have any further suggestions, feel free to implement this in your solution. It will be very appreciated.
Thank you so much for paying attention