In this unit:

- Read in different types of data files.
- Understand how to examine whole dataset.
- Understand how to examine specific variables.
- Convert variable types.
- Manage missing values.

R and RStudio Data Activities

Using the Crime Survey for England and Wales, 2013-2014: Unrestricted Access Teaching Dataset (see Unit 1), perform the following activity: - Create a subset of individuals who belong to the ‘75+’ age group and who were a ‘victim of crime’ that occurred in the previous 12 months.

To create a subset requires first knowing the names of the data elements using 'names(csew1314teachingopen)'- Output in section 1.
Looking at the values using 'table(csew1314teachingopen$agegrp7)' shows the bands, but not the values - section 2.
The values can be found using 'attr(csew1314teachingopen$agegrp7, "labels")' - section 3. This shows that the subset value should equal 7.
This is then paired with values of 1 for csew1314teachingopen$bcsvicitm, indicating they identify as being a victim of crime - section 4.
The end result is a new table named 'crime_75victim', which has 67 rows - section 5.
Results shown in image on the left.