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