Question: The following correspond with the programming language R. Please answer the following HW questions. 1) Write in words what each line of code means. There
The following correspond with the programming language R. Please answer the following HW questions.
1) Write in words what each line of code means. There are five lines. Some lines have been annotated for you: ```{r} vector.1 <- 1:10
vector.1
vector.2 <- rep(NaN, times = length(vector.1))
for(i in 1:length(vector.1)) { vector.2[i] <- vector.1[i] + 1 }
vector.2 ```
-------------------------------
2) In the above question, you used the letter 'i' to denote each variable in vector.1 and vector.2. If you replaced 'i' with 'j', would anything change about your output? Please explain your answer.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
