Understanding Polar Coordinates

In this section, we'll generate some numbers and plot them as Cartesian and polar coordinates.

Let's begin by implementing the following steps:

  1. Generate angles between 0-360, in intervals of 15:
t <- seq(0, 360, by=15).
  1. Define another variable - the radius r:
r <- 2.
  1. Use qplot to plot the vectors in Cartesian coordinates (Plot1). What do you see? Write your answer as a comment in the code:
qplot(r,t)

Your first plot should look like plot 1.

  1. Use qplot to plot the vectors in polar coordinates. What do you see? Write your answer:
qplot(r,t)+coord_polar(theta="y"). 

  1. Use scales to change the labeling and make it look like plot 3. Here, we define the range from 0-360, with breaks of 30:
qplot(r,t)+coord_polar(theta="y")+scale_y_continuous(breaks=seq(0,360,30)). 

Refer to the complete code at https://goo.gl/RheL2G.

Plot 1 is as follows:

Plot 2 is as follows:

The final plot is as follows:

Various label formats are available, and you can change label formats as well. The following label formats are available:

We will combine all of the preceding commands to make a single plot.