# Store the value 42 in the object my_number
my_number <- 42
# Print the value of my_number
my_number [1] 42
Functions, Packages, and Objects
September 17, 2026
<-<-, and the data or value you wish to assign to the object is on the right+ addition- subtraction* multiplication/ division^ exponentiation (also **)mean() function to calculate the average of a set of numbersc() to create a vector of numbersCreate a vector of numbers and take the mean…
mean() calculates the mean of a set of numbersmedian() calculates the median of a set of numberssd() calculates the standard deviation of a set of numberssum() calculates the sum of a set of numberslength() calculates the length of a vectormax() and min() calculate the maximum and minimum values of a vectorround() rounds a number to a specified number of decimal placessqrt() calculates the square root of a numberlog() calculates the natural logarithm of a numberexp() calculates the exponential of a numberabs() calculates the absolute value of a numberread_csv() is a functionggplot() is a functionreadr is a package that contains the read_csv() functionggplot2 is a package that contains the ggplot() functioninstall.packages() to install packageslibrary() to load packagesggplot2 for data visualizationreadr for reading datadplyr for data manipulationtidyr for data tidyinglibrary(ggplot2)library(tidyverse)