# Base paste() NA handling behavior
paste(
'The', c('red', NA, 'orange'), 'fox jumped', NA, 'over the fence.',
collapse = ' '
)
# Removal of NA values
paste(
'The', c('red', NA, 'orange'), 'fox jumped', NA, 'over the fence.',
collapse = ' ',
na.rm = TRUE
)
Run the code above in your browser using DataLab