library(cmu202) library(ggplot2) knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.align = "center", warning = FALSE, message = FALSE, echo = TRUE, eval=FALSE, fig.width = 7, height = 6 )
When you have a dataframe (an entry under the "data" tab of "environment"), you may view it in an excel-like format by running the following code:
View(data_name)
Note that this command is never to be run in an .Rmd
or .R
file, only in the terminal.
The head()
function allows one to see the first 6 rows of data. It is called with:
# Load the data for the example library(cmu202) data("airlines") head(airlines)
The tail()
function allows one to see the last six rows of data. It is called with:
# Load the data for the example library(cmu202) data("airlines") tail(airlines)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.