Dear R users, I have the following codes: zeta <- rep(1,8) n <- 7 for (i in 1:2){ beta <- zeta[1:n+(i-1)*(n+1)] print(beta) parm <- zeta[i*(n+1)] print(parm) } ################### The output is as follows: [1] 1 1 1 1 1 1 1 [1] 1 [1] NA NA NA NA NA NA NA [1] NA ####################### The outcome I want to get is: [1] 1 1 1 1 1 1 1 [1] 1 [1] 1 1 1 1 1 1 1 [1] 1
How could I get the desired outcome? best, kmh [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.