6.2

1

math <- function(a,b,c){
  x <- a-b*c
  return(x)
}

math(1,2,3)
## [1] -5
math(100,200,300)
## [1] -59900
math(-4,-7,10)
## [1] 66

2

covid <- read.csv("Provisional_COVID-19_Death_Counts_by_Sex__Age__and_State.csv", fileEncoding = "UTF-8")

covid_plot <- function(state, sex, ages){
  covid2 <- covid[(covid$State == state) & (covid$Sex == sex) & (covid$Age.group == ages), ]
  barplot(covid2$Pneumonia..Influenza..or.COVID.19.Deaths,
          names.arg= covid2$Sex,
          main=paste("Sex Comparison", state, ages), 
          ylab= "COVID 19, Influenza, & Pnemonia Deaths")
   return=(NULL)
  }

3

f <- function(x){
  y <- x^2
  return(y)
}

mode(f)
## [1] "function"
length(f)
## [1] 1