k4v3
k4v3

Reputation: 55

How to plot curve properly in R?

I just started to learn R for my statistics class and I need to plot the curve with following parametrization:

I tried this, but not sure whether it's correct:

x <- seq(0,2*pi)
t <- choose(sin(2*x), cos(3*x) )
plot(t)

Because I get different curve on WolframAlpha

Upvotes: 1

Views: 60

Answers (1)

tacoman
tacoman

Reputation: 947

You can simply use curve() to plot mathematical expression in R.

curve(choose(sin(2*x), cos(3*x)), from=0, to=2*pi)

Upvotes: 1

Related Questions