cara menyaring vektor berdasarkan lokasi di r
vec <- c(11,22,33,44,55,66,77,88)
indexs <- c(1,8,5)
vec[indexs] # will return: [1] 11 88 55
Grumpy Goose
vec <- c(11,22,33,44,55,66,77,88)
indexs <- c(1,8,5)
vec[indexs] # will return: [1] 11 88 55