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
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 #
etc bullet point we use - (jesus, we need a space before and after)
you can make some nice quotes by using >
hello wolrd!!!!!!!!!!
you can link sites to things you want people to see
you can add formulas in a nice form by using the two dollars signs \[ x+3y=6 \]
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 ( t or f is the opposite it will show the result but not the code)
## [1] "hey brother"
we can use both at the same time.
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
it allows me in inches to change the size of graphs
Figure caption underneath the figure
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
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
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
default tango payment kate monochrome espresso zenburn haddock
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