R (programming language): Difference between revisions

Content deleted Content added
Clarified the connection between the code block on the left and the diagnostic plots on the right.
Line 406:
=== Mandelbrot set ===
[[File:Mandelbrot Creation Animation.gif|thumb|200px|"Mandelbrot.gif" graphic created in R. (Note: Colors differ from actual output.)]]
This example of a [[Mandelbrot set]] example highlights the use of [[complex numbers]]. It models the first 20 [[iteration]]s of the [[equation]] <code>z = z<sup>2</sup> + c</code>, where <code>c</code> represents different [[Complex number|complex constants]].
 
InstallTo run this sample code, it is necessary to first install the package that provides the <code>write.gif()</code> function beforehand:
<syntaxhighlight lang="r">
install.packages("caTools")
</syntaxhighlight>
 
RThe Sourcesample code is as follows:
<syntaxhighlight lang="r">
library(caTools)