[Solved] Crosschecking Two Text Files with R


So is it a text file or excel file you are importing? Without more details, file structure, or a reproducible example, it will be hard to help.

You can try:

# Get the correct package
install.packages('readxl')

df1 <- readxl::read_excel('[directory name][file name].xlsx')
df2 <- readxl::read_excel('[directory name][file name].xlsx')

# Creates a new variable flag if miRNA from your first dataset is in the second dataset
df1$is_in_df2 <- ifelse(df1$miRNA %in% df2$miRNA, 'Yes', 'No')

1

solved Crosschecking Two Text Files with R