```{r setup}
library(tidyverse)
```


## Exercise 01. Recap

1. [Load](#readr) the data in a table. Name of the table is up to you. Typically, I use names like `data`, `reports`, `results`, etc. Don't forget to specify columns' type.
2. Exclude `filename` column (it duplicates `Participant` and `Session` columns).
3. Compute a new variable `SameResponse` which is `TRUE` when `Response1` and `Response2` match each other (in the experiment, that means that an object was rotating in the same direction before and after the intervention).
4. For every combination of `Participant`, `Prime` and `Probe` compute proportion of same responses.
5. Plot the results with `Probe` variable on x-axis, proportion of same responses on y-axis, and use `Prime` to facet plots. Use box plots (or violin plots) to visualize the data. Try adding color, labels, etc. to make plots look nice.

```{r exercise 01}
```


## Exercise 02. Using factors

Copy-paste the code from exercise #1 and alter it so the labels are `"sphere"` (for `"heavy poles sphere"`), `"octo-band"` (for `"stripes-8"`), `"quad-band"` (`"stripes-4"`), `"dual-band"` (for `"stripes-2"`) and levels are be in that order.

```{r exercise 02}
```


## Exercise 03. Using forcats
For exercise #3, redo exercise #2 but using [fct_relevel()](https://forcats.tidyverse.org/reference/fct_relevel.html) and [fct_recode()](https://forcats.tidyverse.org/reference/fct_recode.html). You still need to use `factor()` function to convert `Prime` and `Probe` to factor but do not specify levels and labels. Use [fct_relevel()](https://forcats.tidyverse.org/reference/fct_relevel.html) and [fct_recode()](https://forcats.tidyverse.org/reference/fct_recode.html) inside `mutate()` verbs to reorder and relabel factor values (or, first relabel and then reorder, whatever is more intuitive for you).

```{r exercise 03}
```

## Exercise 04. Averages per facet
Compute for each condition (`Prime`×`Probe`) over all participants. Use preprocessing code from exercise #3 but, once you computed proportion per `Participant`×`Prime`×`Probe`, you need to group data over `Prime`×`Probe` to compute average performance across observers.

```{r exercise 04}
```

## Exercise 05. Averages per facet
Use table that you computed in exercise #4. Plot the results using [geom_point()](https://ggplot2.tidyverse.org/reference/geom_point.html) plus [geom_line()](https://ggplot2.tidyverse.org/reference/geom_path.html) to plot the mean response.

```{r exercise 05}
```

## Exercise 06. Averages in one plot
Tweak code from exercise 5 to plot all lines on the same plot and use color property to distinguish between different primes.

```{r exercise 06}
```

## Exercise 07. Confidence intervals.
Modify code from from exercise #6 to compute two additional variables/columns for lower and upper limits of the 89% confidence interval (think about what these limits are for 89% CI). Then, use [geom_errorbar()](https://ggplot2.tidyverse.org/reference/geom_linerange.html) to plot 89% CI (you will need to map the two variable you computed to `ymin` and `ymax` properties).

```{r exercise 07}
```

## Exericuse 08. Read and preprocess Likert-scale data
* Read the file likert-scale.csv specifying column types
* Convert _Condition_ column to factor where 1 is "game" and 2 is "experiment"
* Convert _Response_ column to factor using levels described in the main text. 

```{r exercise 08}

```

## Exercise 09. Compute proportion of responses per level

* group data per response level
* count number of responses per level
* compute proportion per response per level
* visualize the results

```{r exercise 09}

```

## Exercise 10. Compute proportion of responses per level and condition

* group data per response level and condition
* count number of responses per level and condition
* compute proportion per response per level separately for each condition 
* visualize the results using color to distinguish between groups

```{r exercise 10}

```

