Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pdf("fig_02.pdf", width = 5, height = 5)
- par(bty = "n", las = 1, mar = c(3, 4, 4, 1) + 0.2)
- #---- El grande a la izquierda
- n <- 100 # número de tiras
- izq <- numeric()
- dch <- numeric()
- for (i in 1:n) {
- izq[i] <- runif(1)
- if (izq[i] < 0.5) {
- izq[i] <- 1 - izq[i]
- }
- dch[i] <- 1 - izq[i]
- }
- monton_izq <- sum(izq)
- monton_dch <- sum(dch)
- barplot(c(monton_izq, monton_dch), names.arg = c("izquierda", "derecha"), col = c("darkorange", "lightblue"), ylab = "tamaño del montón", main = "LARGO A LA IZQUIERDA")
- dev.off()
Advertisement
Add Comment
Please, Sign In to add comment