Plotting Data

In order to make a scatterplot in order to perform generic x, y plotting, use the following: plot(x, y, …)

 

 

  • Then, press Run.

 

 

  • A plot will come up on the bottom right-hand corner on your screen.

 

 

  • Now let's make a histogram.
  • The function to make a histogram is the following: hist().
  • Using the dataset above, you can make a histogram of the Calories in the foods from lines 1-57.
  • Type the following into your script: x<-(data$Calories[1:57]) hist(x)

 

 

  • The plot should look like the following in plots on the bottom left hand side of your screen.

 

 

Now try making plots on your own!