R 関数を作る

R 関数を作ってみる (1) 正規分布 塗りつぶし

graph.norm <- function(x1,x2,m,s,oneway=FALSE,rev=FALSE) { sig <- sqrt(s) xmin <- m-4*sig xmax <- m+4*sig dx <- (xmax-xmin)/1000 x <- seq(xmin,xmax,by=dx) y <- dnorm(x,mean=m,sd=sig) xl <- c(xmin,xmax) yl <- c(0,max(y)*1.05) title = paste(…