# Basic code chunk with options
code_chunk("x <- 1:10", echo = TRUE, message = FALSE)
# Python code chunk
code_chunk("import pandas as pd", lang = "python", eval = FALSE)
# Code chunk with multiple knitr options
code_chunk(
"plot(mtcars$mpg, mtcars$hp)",
echo = TRUE,
eval = TRUE,
fig.width = 7,
fig.height = 5,
warning = FALSE
)
Run the code above in your browser using DataLab