#' Wrightify
#'
#' A simple Brownian motion function that makes designs reminiscent
#' of work by Frank Lloyd Wright.
#'
#' @param n number of points produced (60 works best).
#' @param type style of plot, default is \code{"s"}.
#' @param fun random deviates.
#' @export
#' @return matrix with two columns with random walk simulation
#'
#' @examples
#' wrightify(50)
#' wrightify(100)
wrightify <- function(n,type="s", fun=rnorm)
{
x<-cumsum(fun(n))
y<-cumsum(fun(n))
plot(x,y,type=type,yaxt='n',xaxt='n',ann=FALSE)
invisible(rbind(x=x, y=y)) # invisible suppresses printing if result not defined
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.