create a loop that appends a random integer 1:10 to the end of an array in r
# Create an empty arraymy_array <- c()
# Set the desired number of random integers to appendnum_iterations <- 5
for (i in1:num_iterations) {
# Generate a random integer between 1 and 10 random_integer <- sample(1:10, 1)
# Append the random integer to the array my_array <- c(my_array, random_integer)
}
print(my_array)