Re: [R] Simple Problem: Plotting mathematical functions

2012-04-13 Thread R. A. Bilonick
On 04/12/2012 09:11 PM, David Winsemius wrote: On Apr 12, 2012, at 3:49 PM, Aye wrote: Okay, i got this far: f <- function(x) 0.25*x^2 + 6.47*x -32.6 g <- function(x) 0.99*x^2 -6*x -195 h <- function(x) 0.77*x^2 +14*x -495 j <- function(x) 0.001*x^2 + 65*x -785 k <- function(x) 0.9*x^2 -2*x -6

Re: [R] Simple Problem: Plotting mathematical functions

2012-04-12 Thread David Winsemius
On Apr 12, 2012, at 3:49 PM, Aye wrote: Okay, i got this far: f <- function(x) 0.25*x^2 + 6.47*x -32.6 g <- function(x) 0.99*x^2 -6*x -195 h <- function(x) 0.77*x^2 +14*x -495 j <- function(x) 0.001*x^2 + 65*x -785 k <- function(x) 0.9*x^2 -2*x -63

Re: [R] Simple Problem: Plotting mathematical functions

2012-04-12 Thread Aye
Okay, i got this far: f <- function(x) 0.25*x^2 + 6.47*x -32.6 g <- function(x) 0.99*x^2 -6*x -195 h <- function(x) 0.77*x^2 +14*x -495 j <- function(x) 0.001*x^2 + 65*x -785 k <- function(x) 0.9*x^2 -2*x -636 plot(x, f(x), xlab="Elemente in der R

Re: [R] Simple Problem: Plotting mathematical functions

2012-04-12 Thread Matthieu Dubois
Hi, you can use the curve() function for this. It is dedicated to plotting functions. Here is an example # turn your functions into r functions f <- function(x) 0.25 * x^2 + 6.47 * x -32.6 g <- function(x) 0.99*x^2 -6*x -195 j <- function(x) 0.77*x^2 + 14*x -495 k <- functi

Re: [R] Simple Problem: Plotting mathematical functions

2012-04-12 Thread R. Michael Weylandt
It seems that your first problem is syntax: 2x will thrown an error, while 2*x won't. Google around for a good intro tutorial (there's the main one you can access by typing help.start() and it's quite good) and these sorts of things will be explained. You might also want to use the curve func

Re: [R] Simple Problem: Plotting mathematical functions

2012-04-12 Thread Yellow
Hi, At the moment I am studying R at school. But I found this site very useful to explain the plot functions to me: http://www.harding.edu/fmccown/r/ Maybe that can help you too? -- View this message in context: http://r.789695.n4.nabble.com/Simple-Problem-Plotting-mathematical-functions