Aan de slagGa gratis aan de slag

Do you know your data?

The previous exercise dealt about socio-economic indicators and access to education of different individuals. The edu_equal_1 dataset that you've built is already available in the workspace. Now that you have it in R, it's pretty easy to get some basic insights.

For example, you can ask yourself how many observations (e.g., how many people) have an age higher than 40 and are literate? When you call

str(edu_equal_1)

You'll see that age is an integer, and literate is a factor, with the levels "yes" and "no". The following expression thus answers the question:

nrow(subset(edu_equal_1, age > 40 & literate == "yes"))

Up to you to answer a similar question now:

How many observations/individuals of Bulgarian ethnicity have an income above 1000?

Deze oefening maakt deel uit van de cursus

Intermediate Importing Data in R

Cursus bekijken

Praktische interactieve oefening

Zet theorie om in actie met een van onze interactieve oefeningen.

Begin met trainen