-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
67 lines (35 loc) · 2.44 KB
/
README.Rmd
File metadata and controls
67 lines (35 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
# Performing basic operations in R
<!-- badges: start -->
<!-- badges: end -->
In this exercise/assignment, we will learn how to perform basic operations using R while at the same time familiarising ourselves with using RStudio and with using a project-orientated R workflow.
For this exercise, we will use **body mass index** or **BMI** as our topic of interest and will use R in performing BMI calculations.
## Problem 1: Calculating BMI for a single persion given weight and height
Given a person with a weight of **80 kilograms** and a height of **1.6 metres**, calculate BMI using R.
### Knowledge and skill items to think about and find out:
* [ ] What is the formula for calculating BMI? What are the typical/standard units used for weight and height for this calculation?
* [ ] What are the arithmetic/mathematical operations expressed in the BMI formula? What symbols or syntax are used in R to perform the operations in the BMI formula?
* [ ] How to issue the command/instructions to R to perform the operations to calculate BMI?
* [ ] How to record/store the output of the command/instructions issued to R to perform the operations to calculate BMI?
* [ ] How to record/store/save the command/instructions issued to R to perform the operations to calculate BMI?
## Problem 2: Testing relationships between two values
Say we have ***Person A*** with a weight of **80 kilograms** and a height of **1.6 metres** and ***Person B*** with a weight of **120 kilograms** and a height of **210 centimetres**.
In R, try to answer the following questions:
1. Is Person A heavier in weight compared to Person B?
2. Is Person A taller in height compared to Person B?
3. Whose BMI is greater, Person A or Person B?
## Problem 3: Testing combined or compound relationships
In R, answer the following questions using logical operators:
1. Is the weight of Person A **AND** the weight of Person B both equal to 80 kilograms?
2. Is the weight of Person A **OR** the weight of Person B less than 100 kilograms?
3. Is the weight of Person A greater than the weight of Person B **AND** the height of Person A greater than the height of Person B?
4. Is the weight of Person A greater than the weight of Person B **OR** the height of Person A greater than the height of Person B?