April 2, 2012
By

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

You probably already knew that you can draw mathematical equations in Google by typing the equation into the search box. For example, here's the Standard Normal density function:

I can't find a way to embed the graph directly, but if you click on it you'll find it's interactive: you can inspect points, zoom in/out etc. You can create a similar chart in R quite easily with the command:

plot(dnorm,xlim=c(-4,4))

(This works because there is a method for objects of type "function" -- like dnorm -- for the generic plot function.) It's not quite so eay to visualize of a function of two arguments in R, but Google has just announced a new capability for graphing bivariate equations as a 3-D surface. For example:

If you have a touchpad, the chart reacts to swiping gestures to allow you to rotate and inspect the surface. Play around with other bivariate equations in the search box to see what you can draw!