R/mountain.R

"mountain" <-
function (values, color, df=7) 
{
	x <- seq(0, 1, length=length(values))
	top <- smooth.spline(x, values, df=df)
	polygon(c(top$x, 1, 0), c(pmax(top$y, 0), 0, 0), col=color, border=NA)
}

Try the TaoTeProgramming package in your browser

Any scripts or data that you put into this service are public.

TaoTeProgramming documentation built on May 1, 2019, 6:47 p.m.