R/wrightify.R

Defines functions wrightify

Documented in wrightify

#' 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
}
michaeljbraus/wrightify documentation built on May 22, 2019, 9:51 p.m.