1.2 - Use R as a Fancy Calculator

  1. Write R code to compute the square root of 5 times 5.
sqrt(5*5)
  1. Write R code to get help on the function floor.
?floor
help(floor)
  1. Write R code to compute the square of \(\pi\) and round it to 4 digits after the decimal point.
round(pi^2, digits = 4)
  1. Write R code to compute the logarithm of 1 billion with base 1000.
log(1e9, 1e3)
  1. Write R code to verify \(sin^2(x) + cos^2(x) = 1\), for \(x = 724\).
sin(724)^2+cos(724)^2