R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

Including Plots

You can also embed plots, for example:

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.

Headings

This is a primary heading

This is a secondary heading

This is a tertiary heading

Italics

This text will appear italicized! so will this text

Bold

This text will appear bold!

This is a secondary heading which is bold!

This is a secondary heading which is bold and italic!

Bulleted Lists

  • first item in list
  • second item in list
  • third item in list

You can also use numbers instead of bullets. For example:

  1. first item in list
  2. second item in list
  3. third item in list
  4. fourth item in list

Newlines

Newlines require a double space after the end of a line. If you just hit “enter” at the end of a line, two words appear next to each other, rather than in a new line.

However, if you put two spaces at the end of the line, the next word or sentence will appear in the newline. See examples below:

enter pressed at the end:

College of Business Business Analytics

double space at the end of the first sentence:

Pompea College of Business
Business Analytics

Inserting code chunks

Use the insert code chunk button to insert a code chunk where you write your R code.

The code chunk uses a special character known as acute, backtick, left quote, an open quote, or the back quote, which is (`). It’s on the same U.S. computer keyboard key as the tilde.

The following is typed by hand, not inserted using the button.

a= 10
b= 20
c = a*b
c
## [1] 200

Inline Computations

Occasionally, it’s useful to put some computations within a sentence. For example, you may be quoting a specific numerical results in the middle of a paragraph. Rather than try to copy and paste the result into the paragraph, it’s better to just do the computation right there in the text. Use backtick and r.

See the example below:

myrand = runif(1)

The random number generated is : 0.0918563