# Print elements of vector using for loop. sample <- c(1:6) for(elem in sample) { print(elem) }