Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pdf("fig_10.pdf", width = 5, height = 5)
- par(bty = "n", las = 1, mar = c(5, 5, 1, 1) + 0.2)
- # función suma armónicos
- sum_arm <- function(n) {
- a <- numeric(n)
- for (i in 1:n) {
- for (j in 1:i) {
- a[j] <- a[j] + 1/i
- }
- }
- a/n
- }
- # datos
- AAn <- c("Leu", "Ala", "Ser", "Gly", "Val", "Glu", "Thr", "Lys", "Ile", "Arg", "Asp", "Pro", "Asn", "Gln", "Phe", "Tyr", "Met", "His", "Cys", "Trp")
- AAp <- c(9.1, 7.5, 7.4, 7.1, 6.5, 6.3, 6, 5.8, 5.5, 5.2, 5.2, 5.1, 4.6, 4.1, 3.9, 3.3, 2.8, 2.2, 1.8, 1.3)
- n <- 20
- # gráfico
- plot(AAp, pch = 19, bty = "n", xaxt = "n", xlab = "Acids in decreasing order of abundance", ylab = "Percentage", ylim = c(0, 20))
- lines(AAp)
- axis(1, at = 1:20, labels = AAn, las = 2, cex.axis = 0.8)
- points(sum(AAp) * sum_arm(n), pch = 0)
- legend("topright", bty = "n", cex = 0.8, c("observed", "von Neumann's formula"), lwd = c(1, NA), pch = c(19, 0))
- dev.off()
Advertisement
Add Comment
Please, Sign In to add comment