Hello,
I'm beginner in R Studio and I've a test about vectors and their ordenation next week, but I still have some doubts. I don't know if here is the right place to send my question.
Well, bellow I send the code:
vetor_dados <- c(78, 32, 2, 65, 27)
x <- vetor_dados
cont1 <- 0
cont2 <- 0
for(n in x){
cat(cont1, " ")
if((n %% 2) != 0){ # (a %% b)
cont1 <- cont1 + 1
}else{
cont2 <- cont2 + 1
}
}
Can anybody help me with this code and its result? I would like an explanation, not only an answer. In my test we can't use R Studio to run codes...
Thanks!