![]() So here's Yihui Xie's website showing the different chunk options that are available. You can learn more about these at Yihui Xie's website for the Netter package. By the way, we can also control the size of the figure using code chunk options. And you can see it now shown here in the plot viewer window at the bottom right. If we click on that, since the pressure data sets built in, it just goes ahead and runs this plot. If we want to actually see what this plot is going to look like before we embedded in our document, we can actually select the code here in the R markdown document and there's a little icon at the rate that says run current chunk. By running this R code chunk, a scatter plot is created and then inserted in the document where the code was specified. ![]() In this line of code makes a scatter plot of pressure along the y vertical axis against temperature shown on the horizontal axis. So the R chunk shown here, there's only one line of code between the back ticks that start and end with three back ticks and the R symbol. So, if we go to the help window and type in pressure, it'll bring up some information that says that this is data on the relation between the temperature and degrees Celsius and vapor pressure of Mercury in millimeters of Mercury. And you can get more detailed information on this built in data set by looking it up in the help window. There's 19 rows for 19 different data points of temperature and pressure. If you click on the little table icon on the right, next to data1, this opens a data set and a viewer at the top left. This is now a copy of the built in pressure data set. Click on your Environment tab at the top right to see that the object data1 was created. Go to the console window which is on the bottom left and type in the following: data1 <- pressure. Let's take a quick look at this built in data set. This is a data set that's built into the base R software. The last section of this current document contains a chunk of R code that makes a plot of the pressure data set. ![]() ![]() Scroll to the bottom of your current R markdown document. First, we're going to take a look at some figures. Next, we're going to insert other objects and elements within your document such as figures, tables, and equations. So far, you've explored the Yammer header and you've tried out several R markdown syntax to change the formatting of text in your document. Open RStudio and then open the RStudio project for this module. So let's continue working with the same R markdown document. ![]()
0 Comments
Leave a Reply. |