r - remove na

# Create a sample vector with NA values
vec <- c(1, 2, NA, 4, NA, 6)

# Remove NA values from the vector
vec_no_na <- vec[!is.na(vec)]