Introduction to R: Plotting
One of the best reasons to use R is its ability to make graphics. There are some packages that you can install that can make really beautiful graphics, like ‘ggplot2.’ (Note that because R is open-source, anyone can contribute code for carrying out new operations. Bundles of code created for a particular purpose are called packages. Many packages are natively installed when R is installed, but many, like ‘ggplot2’, must be custom installed using the function ‘install.package’.)
Here we will focus on using the basic ‘plot’ command. Run ‘?plot’ to get more information about the arguments of this function. The only things that you need for doing a basic plot are a series of x coordinates and a series of y coordinates.
x = seq(0, 1, 0.01) y = 5*sqrt(x) # compute y plot(x, y)