Fractals in R

August 27, 2010

(This article was first published on R-Chart, and kindly contributed to R-bloggers)

Atte Tenkanen had a blog on fractals using R for a time. Much of his source code is still available online.  To produce his version of the Mandelbrot set:

Fractals (such as the Mandelbrot Set pictured above)  are objects that display self-similarity on all scales.  Fractal are mathematical concepts with practical applications. For example, fractal dimensions provide a solution to measuring a coastline – where you come up with different lengths depending upon the length of the ruler you use. (the Coastline Paradox).

There also pretty and fun to look at….

Back in the 80’s my little brother and I would type in fractal equations into a Radio Shack Color Computer.  We would spend half a day typing in a program and debugging it and the other half a day waiting for the image to render.  He later improved the process by using a Commodore Amiga and more than two fingers for typing.

You can also do this type of plot using ggplot2 – and most of the effort is related to turning off axes and legends.  The source is on github and can be run from there.


So now I can download source code from somewhere out on the interweb thingy and use open source software to render these images in a matter of seconds.  

Just like we used to do when we were kids….

To leave a comment for the author, please follow the link and comment on their blog: R-Chart. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)