Posts by Sophia Araújo • 11 points
2 posts
-
-1
votes2
answers42
viewsQ: Loop is not walking, does not leave the first position
f3 <- function(n) { dados <- rnorm(n, mean = 0, sd = 1) matrizB <- matrix(0,2, n) for (i in 1:length(dados)) { s <- 1 if (i <= 0.2) { matrizB[1,] <- 1 matrizB[2,] <- 0.2 } if (i…
-
-2
votes1
answer35
viewsQ: Repeat loop does not leave first position
The exercise is: Using the function repeat, gere 1000 samples of normal distribution, each of equal sample size n and mean and standard deviation parameters equal to µ and σ, respectively. Choose…