Markdown Author: Jessie Bell, 2023

Libraries Used: tinytex

Introduction to R Part 1

1. Create

Create an R script that answers the questions asked in each lab.

2. Load

ABDLabs foder and find script “LearningToolsWeek1.R”.

3. Objects

Come up with an object name for each of the following:

A. Body temperature in celsius

bodytemp_C <- c(44, 55, 60)
print(bodytemp_C)
## [1] 44 55 60

B. Aspirin given per dose to patients

asperdose <- c(15, 17, 18.5)
print(asperdose)
## [1] 15.0 17.0 18.5

C. & D. You decide!

Just make sure that it is easy for you to remember, is only capitalized when you really want it to be, and does not have spaces.

4. Calculate

Use R to calculate the following:

A. \(15*17\)

15*17
## [1] 255

B. \(15^3\)

13^3
## [1] 2197

C. \(\log(10)\) natural log

log(14)
## [1] 2.639057

D. \(\log(100)\) base 10

log10(100)
## [1] 2

5. Extension Activity, make equations pretty

Add equations to your markdown using typeset based on LaTeX, like below: \(\sum_{n=1}^{10} n^2\) install tinytex library and use this guide.

This lab was completed using the following textbook: The Analysis of Biological Data by Whitlock and Schluter