I have the following line in my code:
matching_row_index <- which(apply(df1, 1, identical, row_df))
Here, row_df is a dataframe with only one row. df1 is another dataframe with many rows and exact same columns as row_df. I wish to find the index of that row in df1, which matches with the single row of row_df. This value of the index is to be given to matching_row_index. However, on running the code and using print statements, print(matching_row_index) gives output integer(0). Also other functionality in the app which depends on mathing_row_index is not working as expected. print(row_df) gave correct output as expected, so apparently row_df is fine.
Can someone please correct this line of code or explain what is causing the bug?