Practical 1 worksheet
You can find the slides from the Week 1 practical session here, but you do not need them to complete this worksheet.
Open your project for this week in RStudio. Then, open a new Markdown file with HTML output and save it in the r_docs folder. (Give it a sensible name, like worksheet_01 or similar!)
For each of the tasks in Analysis, write your code to complete the task in a new code chunk.
Remember, you can add new code chunks by:
```{r}, press ↵ Enter, then ``` again.To prepare for the take-away paper, make sure you knit this document when you’ve finished the tasks.
Load the tidyverse package and read in the data in the setup code chunk.
Review the Codebook at the link below, which has all the information you need about this dataset.
You will need the output from all of the following tasks in order to complete the worksheet quiz. If you are having any trouble with this, or you aren’t sure how to understand what the output means, ask for help in your practical!
Bring up the standard help documentation for the function group_by() from the dplyr package.
Use ?function_name in the Console to bring up the help documentation in the Viewer.
If you are having difficulty working in RStudio, you can also search for the help documentation online. Keywords might include R, the function name, and the package that that function exists in.
Starting with the gensex data, do the following in a single pipeline.
gendergender_masc and gender_comfortHave a look at the example under “Basic Pipeline” in Tutorial 1!
Starting with the gensex data, do the following in a single pipeline.
gender_femgender variableHave a look at Task 10 in Tutorial 1!
Knit your worksheet once you’ve finished. You should see all of your code and output in the HTML document that it produces. This HTML will be saved in the same folder as the RMarkdown you knitted it from.
If you encounter a knitting error, ask for help in your practical!
Make sure you have the RMarkdown or knitted HTML on hand when you take the worksheet quiz - you will need your answers to the above tasks.
Good luck!