Q: Add new column based on coincidence of two columns I have these two starter data frames:
df1 <- data.frame("Location" = c('NE', 'SW', 'NW'), "Time" = c('0400', '1620', '2110'), "Assignment" = c('Painter', 'Astronaut', 'Bartender'), "Frequency" = c(84, 122, 139))
df1
    Location  Time  Assignment  Frequency
 1  NE        0400  Painter     84
 2  SW        1620  Astronaut   122
 3  NW        2110  Bartender   139

df2 <- data.frame("Location" = c('NE', 'SW', 'NW', 'NW', 'SE'), "Time" = c('0400', '1620', '2110', '2240', '1410'), "Assignment" = c('Scripter', 'Port Patrol', 'Lawyer', 'Supplier', 'Youtuber'), "Frequency" = c(82, 126, 144, 94, 102))
df2
    Location  Time  Assignment  Frequency
 1  NE        0400  Scripter    84
 2  SW        1620  Port Patrol 122
 3  NW        2110  Lawyer      139
 4  NW        2240  Supplier    94
 5  SE        1410  Youtuber    102

Suppose I didn't know which data frame was larger. But in this case, df2>df1 , so now I want to try and see which values of the columns 'Location' AND 'Time' coincide. For these equivalents, add a new column stating 'Coincide'. If not, this column should be NA.
For this, I tried:
df3$NewCol <- NA
df3$NewCol[df1$Location == df2$Location & df1$Time == df2$Time] <- 'Coincide'

or
if(df1$Location == df3$Location & df1$Time == df3$Time) {
df3$NewCol <- 'Coincide'
 }

(In this ones I created a new df3 which is a merge of df1 + df2)
But on both of these tries I get the error:
longer object length is not a multiple of shorter object length

Which I believe is a problem on both data frames having different lengths, but how could I overcome this ?
Thanks in advance

A: Answering the first question of adding a new column with 'Coincide'. 
We can do a full join with df1 and df2 which would give all the entries present in both the dataframes irrespective of their size. We can then check for NA values and assign 'Coincide' or NA value based on that. 
all_data <- merge(df1, df2, by = c('Location', 'Time'), all = TRUE)
all_data$new_col <- c('Coincide', NA)[(rowSums(is.na(all_data[-c(1:2)])) > 0) + 1]

all_data
#  Location Time Assignment.x Frequency.x Assignment.y Frequency.y  new_col
#1       NE 0400      Painter          84     Scripter          82 Coincide
#2       NW 2110    Bartender         139       Lawyer         144 Coincide
#3       NW 2240         <NA>          NA     Supplier          94     <NA>
#4       SE 1410         <NA>          NA     Youtuber         102     <NA>
#5       SW 1620    Astronaut         122  Port Patrol         126 Coincide

You can then select only the columns that you need for further analysis. 
