user3000205
user3000205

Reputation: 15

Drawing a Graph in R?

I'm trying to draw a graph of the function

 h(t)  =  200 - (1/2)9.8t^2 + 8t

but I keep receiving unexpected symbol errors when I do:

curve(200 - (1/2)*(9.8)t^2 + 8*t)

Any idea how to graph it correctly, and why I received the errors?

Upvotes: 0

Views: 95

Answers (1)

Thilo
Thilo

Reputation: 9157

There are two problems with your command:

  1. curve expects the variable to be named x, not t.
  2. The multiplication sign * is missing between (9.8) and x.

Try

curve(200 - (1/2)*(9.8)*x^2 + 8*x)

Giving

enter image description here

Upvotes: 2

Related Questions