Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector.missing.values <- function(V) {
- if (!(NA %in% V)) {
- print("No missing value")
- } else {
- cat('Total number of missing values: ', sum(is.na(V)),'\n')
- return(which(V %in% NA))
- }
- }
- problem.1.test.vector.1 <- c(5, 7, 2, 4, NA, 6, 9, 10)
- problem.1.test.vector.2 <- c(36.5, 41.9, 53.8, NA, 37.4, 46.1, NA, NA, 54.9)
- problem.1.test.vector.3 <- c(103.4, 256.8, 189.5, 177.4, 218.3, 224.6)
- vector.missing.values(problem.1.test.vector.1)
- vector.missing.values(problem.1.test.vector.2)
- vector.missing.values(problem.1.test.vector.3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement