We will be learning about R Markdown… NOTE: one hashtag # is for a NUMBER 1 HEADING or a TITLE
How to include text in the R Markdown… NOTE: two hashtags ## is for a NUMBER 2 HEADING to come under the number 1 heading… To include a LINK, place the work link in square brackets AND place the link in round brackets or greater than and less than signs (so the word link does not appear in the text). link or See https://stackoverflow.com/questions/35381742/reset-perspective-in-r-studio
NOTE: One star * is for ITALICS ALSO two stars ** for BOLD… 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.
KNIT is similar to RUN in R Studio… It allows you to see the work done… 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
TO GET A NEW CODE CHUNK TO INSERT NEW CODES, click the BIG GREEN C on the bar next to the KNIT BUTTON to get a drop down box, and click R for the new CODE CHUNK to appear… the new code chunk is grey with an {r} in it… Enter a code and press KNIT to see the results within the document…
ggplot(data = mpg) +
geom_point(mapping = aes(x = displ, y = hwy))
TO GIVE THE CODE CHUNK A NAME go to the curly bracket and include Chunk1… Click on the SETTING icon in the grey bar and adjust to suit… click on the OUTPUT arrow and choose if you want the CODE to show with the OUTPUT, depending on the end user or receiver… Also, show warning as FALSE for warnings not to show on the document
We use the exclamation sign (!) ![Fish Pic] (“C:)
![Picture of Rabbit] (https://www.pinterest.com/pin/701928291892422161/) {width=30%} THE IMAGE DID NOT SHOW UP IN THE DOCUMENT
R Markdown concluded
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.