get_approval_sample: Generate a random sample of a president's approval ratings

View source: R/SDS100_generate_simulated_samples.R

get_approval_sampleR Documentation

Generate a random sample of a president's approval ratings

Description

This function generates a sample of fictional data of people approve of the president.

Usage

get_approval_sample(n, degree_of_approval = FALSE)

Arguments

n

The sample size.

degree_of_approval

A Boolean that if set to TRUE will return a vector with the levels "strongly disapprove", "disapprove", "approve", "strongly approve". If this is set to false, then a vector that only has the levels "disapprove", "approve" will be returned.

Examples

 # Generate a sample from 10 individuals
 get_approval_sample(10)


emeyers/SDS100 documentation built on April 28, 2024, 5:07 p.m.