Exercise 1:Introduction to R

By Kristen Sosulski

Solve The Tasks In Order To Get Hands On The Concepts
What is the exercise about?

The exercise presents few tasks based on Introduction to R tutorial. Solve these 7 tasks based on the Introduction to R tutorial. This will not only brush up your concepts but also it will give you practical exposure to R. All the best!

Task 1 to 4:

  1. (123 – 45) / 4 + 4 * (72 / 2.34 – 3)
  2. absolute value of -88
  3. log10(72)
  4. e^1.45 – 2.612

Task 5:

a. Assign a variable year_born to 1984
b. Assign a variable year_current to 2014
c. Assign a variable age and compute it
d. Return True/False if person is eligible to vote in US (if age is greater than or equal to 18)

Task 6:

Given: formula for area of circle is pi*r^2
Given: Area = 100
a. Write statement to find r. (Hint: utilize “sqrt” and “pi” functions)

Task 7:

Given: went to lunch and pre-tax bill was $45.90
a. Compute subtotal: add NYC tax of 8.875%
b. Compute 15% tip on subtotal
c. Compute 20% tip on subtotal