name <- c("Steve","Sophia","Oliver","Harry","Peter","Olivia","Marc")
determine the names of all users except the 2. and the 4.
name[c(-2, -4)]
or
name[c(1,3,5,6,7)]
Is name[-c(2,4)] also possible?
Yes it is:
> name[-c(2,4)] [1] "Steve" "Oliver" "Peter" "Olivia" "Marc"