Skip to content

Commit

Permalink
2111 Ch4 restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanrongen committed Nov 21, 2024
1 parent 99b2d35 commit 5c89399
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 70 deletions.

Large diffs are not rendered by default.

27 changes: 25 additions & 2 deletions materials/02-basic-objects-and-data-types.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,32 @@ We’ve seen examples where we entered data directly into a function. Most of th

## Explained: Data types & structures

### Data types
Computers are picky when it comes to data and they like consistency. As such, it's good to be aware of the fact that data can be viewed or interpreted in different ways by the computer.

Programming languages are able to deal with different data types - and they need to. For example, it makes little sense to perform mathematical operations on text! To ensure that your data is viewed in the appropriate way, you need to be aware of some of the different **data types**.
For example, you might have research data the presence or absence of a tumour is scored. This would often be recorded as `0` when absent and `1` as present. Your computer views these values as numbers and would happily calculate the average of those values. Not ideal, because a tumour being, on average, `0.3` present makes no sense!

So, it makes sense to spend a bit of time looking at your data and making sure that the computer sees it in the correct way.

### Quantitative data

#### Discrete data
LO: discrete data

#### Continuous data
LO: continuous data

### Qualitative data

#### Categories
LO: categories (nominal data)

#### Ordinal data
LO: factors (ordinal data)


### Getting the computer to see the right way

In general, computers can view these different types of data in specific ways.

::: {.panel-tabset group="language"}
## R
Expand Down
17 changes: 0 additions & 17 deletions materials/04-plotting_files/execute-results/html.json

This file was deleted.

Binary file not shown.
42 changes: 0 additions & 42 deletions materials/05-data-types.qmd

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 6 additions & 7 deletions materials/_chapters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ book:
- materials/04-plotting.qmd
- part: "S3: Manipulating data"
chapters:
- materials/05-data-types.qmd
- materials/06-manipulating-columns.qmd
- materials/07-chaining-operations.qmd
- materials/08-manipulating-rows.qmd
- materials/09-grouped-operations.qmd
- materials/05-manipulating-columns.qmd
- materials/06-chaining-operations.qmd
- materials/07-manipulating-rows.qmd
- materials/08-grouped-operations.qmd
- part: "S4: Organise and combine"
chapters:
- materials/10-reshaping-data.qmd
- materials/11-combining-data.qmd
- materials/09-reshaping-data.qmd
- materials/10-combining-data.qmd

0 comments on commit 5c89399

Please sign in to comment.