```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

This challenge has been adapted from [Columbia University Psychology Department's Scientific Computing Workshops](https://cu-psych-computing.github.io/cu-psych-comp-tutorial/){target="_blank"} and some materials provided by Ana DiGiovanni and Anna Vannucci. 

For each of the following questions, the answer should be expressed as the output of a command or a series of commands.

# Data frames and data cleaning

## Read in data

1. Read in the data from the csv file `Study2_Subjects.csv` and save it in a variable named `study2`. Remember to load any necessary packages first. 

```{r}

```

2. View the first 5 rows of the dataframe and check the datatype for all the columns.

```{r}

```

3. How many columns do you have in the dataset? What are their names?

```{r}

```

4. How many observations/subjects do you have in the dataset?

```{r}

```

5. What is the mean age of participants in your dataset? 

```{r}

```

6. What is the median score for depression symptoms in the personality questionnaire?
HINT: Look at the readme file to see which column stores the depression symptoms score.

```{r}

```

7. Check for missing values

```{r}

```

8. We can actually fix this missing value, because we have this information in the README. Check the README and fix the missing value.
```{r}

```

9. The columns Q1, Q2 and Q3 are not descriptive enough. Just looking at the columns we don't know what they refer to. Check the README file to get more info, and rename the columns in a more informative way. Remember to store it in a new variable (e.g. `study2_cleaned`)
HINT: Use the `rename()` function

```{r}

```

10. Moving forward, we don't really care about the age and the sex. We are more interested in the questionnaire scores and the condition. Select only the variables you care about. 

HINT: use the function `select()` 
HINT 2: Be sure to keep the Subject ID in the dataframe, because we need that for future analyses.

```{r}

```

The use of `%>%` is especially important for stacking functions. So we could do step 9 and 10 together as one. Try this below.

```{r}

```

11. Now filter for those Subjects who are in condition B only. Don't save this into a variable, we only to look at the data for those in condition B.

```{r}

```

12. Save this cleaned dataframe as `Study2_cleaned.csv`

```{r}

```
