1. Introduction

library(learnr)
knitr::opts_chunk$set(echo = FALSE)

1.1 Installation of R, RStudio and R Packages

  1. Which of the following code using to install packages into R will cause an error?

  2. install.packages("r02pro")

  3. install.packages(r02pro)

  4. Write R code to load the package r02pro


  1. Write R code to calculate 2 + 3.

1.2 Use R as a Fancy Calculator

  1. Write R code to compute the square root of 5 times 5.

  1. Write R code to get help on the function floor.

  1. Write R code to compute the square of $\pi$ and round it to 4 digits after the decimal point.

  1. Write R code to compute the logarithm of 1 billion with base 1000.

  1. Write R code to verify $sin^2(x) + cos^2(x) = 1$, for $x = 724$.



Try the r02pro package in your browser

Any scripts or data that you put into this service are public.

r02pro documentation built on May 31, 2023, 8:09 p.m.