Hello Everyone: I want to have an empty array and then create a for loop to add values to it. Ignore the simple function that's inside "temp_val" my function is more complicated. I just put that here for clarity
This is what I have:
values = numeric()
for (n1 in 1:50) {
n2 = n1+1
temp_val = (n1+n2)
append(values,temp_val)
}
I was hoping that as the for loop iterates 50 times that it would append 50 values from "temp_val" to my empty array "values" however, "values" never gets appended with any of the iterations from "temp val"
Please advise