### QUESTION 6
#
## Topic: usage of functions, rm.NA()

## Question: 
# I tried to execute rm.NA(1, 2, NA, 7, NA, 6) and I get just an error message 
# and not the arguements without the NAs. It says "unused arguements (2, NA, 7, NA, 6)"

# Answer

# the function should be used on a vector. You forgot to add the c() to produce the vector 
# the values 1, 2, etc are thus considered as different arguments of the function.
rm.NA <- function(x)
{
  return (x[!is.na(x)])
}
# you should use:
rm.NA(c(1, 2, NA, 7, NA, 6))
## [1] 1 2 7 6