#### *Example of plotting a dataset (Car dataset):
plot(cars)
plot(airquality)
print("Hello world")
#variable
a=5.5
b=10
c= a+b
c
[1] 15.5
this_is_a_variable=100
this_is_a_variable
[1] 100
this_0_var=10
- When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the *Preview* button or press *Ctrl+Shift+K* to preview the HTML file).
- The preview shows you a rendered HTML copy of the contents of the editor. Consequently, unlike *Knit*, *Preview* does not run any R code chunks. Instead, the output of the chunk when it was last run in the editor is displayed.
# Example plot with title
x <- 1:15
y <- x^2
plot(x, y, main="Quadratic Function Plot", xlab="X-axis", ylab="Y-axis")
# Function to print colored text
color_text <- function(text, color_code) {
cat(paste0("\033[", color_code, "m", text, "\033[0m\n"))
}
# Example usage
color_text("This is red text", "31")
This is red text
color_text("This is green text", "32")
This is green text
color_text("This is yellow text", "33")
This is yellow text
color_text <- function(text, color_code) {
cat(paste0("\033[", color_code, "m", text, "\033[0m\n"))
}
# Example title in red
title_text <- "1st Class_R Programming and Data Science"
color_text(title_text, "31")
1st Class_R Programming and Data Science