R Markdown

Question 1 Answers:

1.A

  a <- (5 * 4) ^ (4 * 5) - 56
  print(a)
## [1] 1.048576e+26

1.B

  b <- 23 - 1 * (8 - 12)
  print(b)
## [1] 27

1.C

  result <- 56 / 8 * (3 + 4)
  print(result)
## [1] 49

1.D

  result <- 45 - 5 * 8 + (8 + 9)
  print(result)
## [1] 22

Question 2 Answers:

2.A

  a <- c(2,5,6,7)
  a
## [1] 2 5 6 7
  class(a)
## [1] "numeric"

2.B

  b <- as.integer(c(1,0,9,8))
  b
## [1] 1 0 9 8
  class(b)
## [1] "integer"

2.C

  library(ggplot2)

  Vector_Name <- c("First", "Second", "Third", "Fourth")
  C_Vector <- c(6, 5, 8, 3)
  
  # Create a data frame
  dataFrame <- data.frame(Vector_Name, C_Vector)
  
  # Create scatter plot
  ggplot(dataFrame, aes(x = Vector_Name, y = C_Vector)) + geom_point()