in rmarkdown the html we need to add a hastag to write code while if we wana write a comment we just type so look code chunk is the like to the html knows we are using R code chuck:

Toothdata <- ToothGrowth

head(Toothdata)
##    len supp dose
## 1  4.2   VC  0.5
## 2 11.5   VC  0.5
## 3  7.3   VC  0.5
## 4  5.8   VC  0.5
## 5  6.4   VC  0.5
## 6 10.0   VC  0.5

thats cool, but why dont we just it as the opposite like in normal r? but its cool that we can get the results of our code directly and its foldable like a window so no need for a console

fit <- lm(len~dose, data = Toothdata)

b<-fit$coefficients
plot(len~dose, data=Toothdata)
abline(lm(len~dose, data=Toothdata))
Figure1: cool i made this

Figure1: cool i made this

The slope of the regression linear model the coffiecent is 9.7635714

Now a new idea: is give sections(text size it seems like) in the final doc it can be done by adding #

First section header

second header

third

etc bullet point we use - (jesus, we need a space before and after)

  • one
  • two
  • three
    • one
    • two
    • three

you can make some nice quotes by using >

hello wolrd!!!!!!!!!!

you can link sites to things you want people to see

RMarkdown

Formulas

you can add formulas in a nice form by using the two dollars signs \[ x+3y=6 \]

Code Chunks options

Eval

Eval ( T or F basically true or false): it checks if it needs to evaluates a code chunk ( you can turn off section of a code) so

print("hey brother")

it should be 3 but since thee eval is false its gowning to ignore the outcome of this code

print("hey brother")
## [1] "hey brother"

Echo

Echo ( t or f is the opposite it will show the result but not the code)

## [1] "hey brother"

so echo fasle will not allow us to see the code if true then we will see the code and its result

we can use both at the same time.

Cache

if enabled the code will not run the second time it will give you the same result, but be careful if you chnage stuff since its no longer variable its fixed…its important in genomics

fig.width or fig.height

it allows me in inches to change the size of graphs

fig. cap

Figure caption underneath the figure

Table of contents

in the name lol: we do this by changing the YAML CODE which is found in the top of the html console here this is a copy:

title: “am learning html”

author: “me”

date: “2025-06-10”

output:

html_document:

toc: True 

toc_float: True 

Tabs

we can add tabs in out report we need to tell each section if it needs to be a tab by placing : {.tabset} after the line so every level ONE header will be a new tab

aesthetics

Theme

you can change the color, highlights, color of hyperlink basically cute and u do this by change thing in the YAML ( the first code chunk in the beginning ) you can use :

Cerulean journal flatfly readable spacelab united cosmo lumen paper sandstone simplex yeti null

Hightlights

default tango payment kate monochrome espresso zenburn haddock

Code folding

you can hide and show the code since if its long it may be annoying to scroll through

we can use in YAML under html_documnet

code_folding: hide