Re: [R] Graphing complex functions

2013-10-22 Thread Hans W Borchers
John Van Praag jvp247.com> writes: > > Does R have any facilities, or packages, for graphing complex functions? Package 'elliptic' has function view() for "Visualization of complex functions using colourmaps and contours" Hans Werner __ R-help@r

Re: [R] Graphing complex functions

2013-10-22 Thread Duncan Murdoch
On 22/10/2013 1:07 PM, John Van Praag wrote: Does R have any facilities, or packages, for graphing complex functions? I don't think base R does, but if you have a complex-valued function of a real variable, it wouldn't be hard to write one. For your example: library(rgl) xvals <- seq(0, 2*pi

[R] Graphing complex functions

2013-10-22 Thread John Van Praag
Does R have any facilities, or packages, for graphing complex functions? I find that 'curve' does not do the trick. Example: > f = function(x) cos(x) + 1i * sin(x) > curve(f, -pi, pi) Error in xy.coords(x, y, xlabel, ylabel, log) : (converted from warning) imaginary parts discarded in coercion