You can install the development version from GitHub with:
# install.packages("devtools")
#devtools::install_github("githubIEP/worldriskpollr")
Once installed you can load the library using:
The World Risk Poll is the first ever global study of worry and risk across the world. The poll was conducted by Gallup as part of its World Poll, and is based on interviews with over 150,000 people, including those living in places where little or no official data exists, yet where reported risks are often high.
The World Risk Polls covers the biggest risks faced globally including new findings on subjects such as risks faced by women, safety of food, experience of serious injury and violence and harassment in the workplace, climate change, and online safety.
The poll will enable businesses, regulators, governments and academics to work with communities to develop policies and actions that save lives and make people feel safer. This landmark piece of research will be undertaken at least four times over eight years and the weight of knowledge accumulated will contribute in a more significant way than any past research, to making the world a safer place.
The poll reveals new insights – for example demonstrating that demographic factors are generally a better predictor of risk perception than experience; and new findings that tell us how across the world, different groups of people experience risk in very different ways.
The poll highlights discrepancies between people’s perception of risk and the actual likelihood of them experiencing those dangers. For the first time, we learn how safe people feel; how they perceive risk and what risks they experience everyday.
You can access more details and findings related to the World Risk poll here.
Lloyd’s Register teamed up with the Institute for Economics and Peace (IEP) to explore the complex relationship between peace and people’s perceptions of risk and their safety and security. You can see our latest findings in the annual release of the Global Peace Index In June. Further information about IEP can be found here).
IEP created this package to provide you with easy, programmatic access to the World Risk Poll. We are responsible for maintaining it. We encourage you to reach out to us directly if you have any questions about the package or our broader work measuring trends in peace and security.
The World Risk Poll surveyed people in 150 countries in total, including countries with very low levels of peace where little or no official data exists, yet where reported risks are often high.
The worldriskpollr
package is designed to give you quick
and easy access to all data collected through the World Risk Poll.
worldriskpollr
provides you with an interactive package to
interact and access aggregated survey data.
Using the following functions, it will download and process the World Risk Poll data into your package cache memory, then extract questions of interest.
wrp_search
To search for a question if interest, worldriskpollr
provides wrp_search
for users to enter a search term. If
the search term is a match, wrp_search
will return a data
frame with the following columns.
wrp_question_uid
: The unique identifier for the
question, needed to use the function wrp_get
.
question
: The question in full.
responses
: The responses given in the poll.
head(wrp_search("violence"))
#> # A tibble: 6 × 3
#> wrp_question_uid question respo…¹
#> <chr> <chr> <chr>
#> 1 VH1 Ever Experienced Physical Violence/Harassment at Wor… Yes
#> 2 VH1 Ever Experienced Physical Violence/Harassment at Wor… No
#> 3 VH1 Ever Experienced Physical Violence/Harassment at Wor… (Respo…
#> 4 VH1 Ever Experienced Physical Violence/Harassment at Wor… (DK)
#> 5 VH1 Ever Experienced Physical Violence/Harassment at Wor… (Refus…
#> 6 VH1B How Many Times You Experienced Physical Violence/Har… Once o…
#> # … with abbreviated variable name ¹responses
wrp_get
The wrp_get
function provides users with a way of access
aggregated data. Users can select which geographic region they would
like to see the data at:
country
: data is aggregated to the national
level;
region
: data is aggregated to the national
level;
income
: data is aggregated based on World Bank
Income classification of the country.
The results will be disaggregated by the following groups:
national
, respondent’s nation;
age group
, respondent’s age group;
gender
, respondent’s gender;
education
, respondent’s highest level of
education;
incomeFeelings
, respondent’s feelings about their
household income;
income5
, respondent’s per capita income
quintile;
urbanicity
, respondent’s residence: urban or
rural;
householdSize
, total number of people in the
respondent’s household;
childrenInHousehold
, total number of children under
15 in the respondent’s household.
Users need to provide the desired aggregation level to
wrp_get
as a string. It is also necessary to provide a
question code string, such as those provided returned in
wrp_search
. The use of wrp_get
looks like:
head(wrp_get(geography = "country", wrp_question_uid = "Q1"))
#> # A tibble: 6 × 6
#> geography disaggregation year question respo…¹ perce…²
#> <chr> <chr> <dbl> <chr> <chr> <dbl>
#> 1 United States Country Name 2019 Feel More, Less or About a… More s… 9.01
#> 2 United States Country Name 2019 Feel More, Less or About a… Less s… 13.4
#> 3 United States Country Name 2019 Feel More, Less or About a… About … 27.7
#> 4 United States Country Name 2019 Feel More, Less or About a… (DK) 0.0616
#> 5 United States Country Name 2019 Feel More, Less or About a… (Refus… 0.0575
#> 6 United States Country Name 2021 Feel More, Less or About a… More s… 8.03
#> # … with abbreviated variable names ¹response, ²percentage
This returns a 6 column dataframe in tidy format with the following columns:
geography
: Lists the geography selected.
disaggregation
: The disaggregation used in the data
results.
group
: the type of disaggregation
year
: year of results
question
: the question in full
response
: the response
percentage
: the percentage of respondents for each
disaggregation that provided the relevant response.
So a standard use case stringing wrp_search
and
wrp_get
together could look like:
# Search for a topic
<- wrp_search("violence")
tmp # Pick the question of interest
<- tmp[tmp$question ==
tmp "Ever Experienced Physical Violence/Harassment at Work (all countries)", ]
# Get the question code
<- unique(tmp$wrp_question_uid)
tmp # get the data
head(wrp_get(geography = "country", wrp_question_uid = tmp))
#> # A tibble: 6 × 6
#> geography disaggregation year question respo…¹ perce…²
#> <chr> <chr> <dbl> <chr> <chr> <dbl>
#> 1 United States Country Name 2021 Ever Experienced Physical … Yes 11.8
#> 2 United States Country Name 2021 Ever Experienced Physical … No 88.2
#> 3 Egypt Country Name 2021 Ever Experienced Physical … Yes 2.12
#> 4 Egypt Country Name 2021 Ever Experienced Physical … No 63.8
#> 5 Egypt Country Name 2021 Ever Experienced Physical … (Respo… 33.9
#> 6 Egypt Country Name 2021 Ever Experienced Physical … (Refus… 0.247
#> # … with abbreviated variable names ¹response, ²percentage