t1 <- c('064359208644', '108595042227', '115705579765', '139254098290', '163646243244')
t2 <- c('064359208644', '139254098290', '163646243244')
missing_elem <- as.character(setdiff(t1, t2))
missing_elem
if(length(missing_elem) != 0){
ss <- cat("Missing ids:", missing_elem)
}else{
ss <- "There are no missing ids"
}
ss
When I print the output of ss here it shows NULL but if t1 and t2 are the same and length(missing_elem) is 0 then ss is properly set to "There are no missing ids" and shows accordingly. Any idea why this might happen?