[R] To make a graph for 4 functions

Rui Barradas ruipbarradas at sapo.pt
Fri Apr 27 22:36:37 CEST 2012


quantum wrote
> How can I use the curve when I have a vector? How should the R code look
> like?

You can't. From the manual:

"expr 	The name of a function, or a call or an expression written as a
function of x which will evaluate to an object of the same length as x."

Your function does not return an object of the same length as x. It triples
it's length.
You are complicating what is simple and was already answered.

Your latest function, t, has that problem.
A second problem is that it returns a vector when to make some sense it
should return a matrix.

A third problem is the name 't', it is the name of R's matrix transpose

Tip: Plot each curve one at a time like said before.

Rui Barradas

View this message in context: http://r.789695.n4.nabble.com/To-make-a-graph-for-4-functions-tp4592941p4593708.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list