resources

Here are a number of helpful resources to dig deeper into text processing and analysis:

Tutorials

Cheat sheets

load packages

if (!require(pacman)) {
  install.packages("pacman")
}
pacman::p_load("tidyverse", "here", "tidytext", "ggwordcloud", "knitr", "reactable",
               install = TRUE)

load the data file

Modify the path as needed to where your week4_data.csv file is downloaded. Note, my path is a little different, but for you, it should be in the data/ directory in the same folder as this script.

Import the csv file and assign it to the variable data

data = read_csv(here("static", "labs", "data", "week4_data.csv"))

tidy the data

The key variables we’ll be working with today are as follows:

  • behavior_voting: voted in 2020; single dichotomous item, yes or no
  • advantages: open-ended question about the advantages of voting
  • disadvantages: open-ended question about the disadvantages of voting
  • barriers: open-ended question about the barriers of voting
  • solutions: open-ended question about the solutions of voting
data_tidy = data %>%
  # filter out test and incomplete responses
  filter(!DistributionChannel == "preview") %>%
  filter(Finished == 1 & consent == 1) %>%
  # select a subset of variables 
  select(ResponseId, behavior_voting, advantages, disadvantages, barriers, solutions) %>%
  # convert responses to numeric and recode response values
  mutate(behavior_voting = recode(behavior_voting,
                                  "1" = "yes",
                                  "2" = "no"))

Let’s check out what the tidied data look like

data_tidy

make a table

basic table using knitr::kable()

Let’s make a table to present the raw text for the advantages and disadvantages questions

data_tidy %>%
  select(advantages, disadvantages) %>%
  kable(format = "pandoc")
advantages disadvantages
you have some impact in making your voice heard Some states make the process of voting extremely technical. Often times many ballots get tossed out because people were just unaware of how to complete the form properly.
Making sure your voice is being heard. Time-consuming
You get to exercise your constitutional right. You get a say in who are the leaders of the country. Long lines, sometimes it’s inconvenient to vote.
That you get to do your civic duty and have your voice heard It can be a long and tedious process with lines, etc.
Exercising your right that the people before you fought for. I think one of the greatest advantages of voting is that it encourages you to educate yourself and to have an opinions about something. Voting could potentially cause polarization, as there will be a winner and a loser, and in theory, it pits people against one another.
Exercising your rights as a citizen There are no candidates that I wish to support
Your opinion is taken into account. In this election year, safety at the poll is a concern.
Letting the country be run in the way the people want it to. Sometimes allows for tyranny of majority groups
Is a surefire way of contributing to your community Must recognize that you supported someone even if they ended up doing damage to the country
Doing your civic duty Being swayed to vote for a particular candidate
having a say in the future of our country being criticized for voting for a specific candidate
Having a say in who runs the country It might be a difficult thing for people from certain areas or backgrounds to do
Voicing my view and influencing who takes office none
If the candidate I favor doesn’t get elected, I would not regret because I did my part by voting. Allowing the candidate I don’t favor to have a slight increase of advantage of winning.
Having a say in how the US will proceed as a country. It sometimes feels like individual voices do not affect change.
having a voice in how I want America to be politicians may ignore what you want once they get elected (assuming they don’t need to be reelected)
It always you to voice your opinion and be an agent of change. It takes some time to go through the process
being a part of our countries democracy and supporting my preferred candidate the candidate I voted for is not my favorite, but is the best option
being able to express your views on the candidates and their policies time-consuming and having little to no impact on the outcome
Having your voice heard, making a change Not every vote counts the same
Influencing the election Long lines and confusing registration process
Democratically electing government leaders As far as America goes, we are given 2 options and if you don’t like either you can’t do anything about it. Voting third party is unfortunately essentially a waste.
exerting your right and helping form our democracy there are none
Being able to vote allows me to have a say in what’s going on in our government. With how our voting system is set up (the electoral college), sometimes it seems like even when we vote, we don’t have a say. For example, last election Hilary Clinton won the popular vote, but Trump still on the election.
Individuals get to participate in democracy and select their representatives Uninformed people making decisions
Being able to engage with the future of the country; main way to contribute to what the government will look like. Important civic duty. No candidate for any party is ever perfect. Chances are, you need to compromise on some of your beliefs for each person you vote for.
To directly participate in our democracy and choose our leader The physical process and currently exposing yourself to potential infection
Partaking in a decision that will influence our country for the next four years If I am not fully informed of the stances of the politicians, I could make a decision that will negatively influence my nation or local community
getting rid of the evil Trump waiting in a long line
having a voice having to choose between candidates who don’t represent one’s personal values
voting for others who cannot do so legitimizing the imperial empire of the United States and participating in a government that is fundamentally against sexual and ethnic minorities
the sticker getting COVID
getting people that represent at least some of your values in positions of power to make change none - every person should have the ability to voice their own opinion and vote for the candidate they prefer
Having a voice in democracy. Certain groups of people are continuously disenfranchised.
It gives you the opportunity to push society in the direction you want it to go in. Even if you don’t exactly have a say in what goes on in your community, voting is a step in the right direction. Maybe people think their vote doesn’t matter, especially depending on the state you live in.
Democracy The Electoral College
An oppurtunity for concrete reflection of your own values and opinions on various political issues. The minor inconvenience of having to spend some time voting
You feel a sense of contribution or control in the way that the country or locality is run. Some votes in certain states count more than others
Local government! I feel like it can change the outcomes on a local level. It was confusing and took a lot of time to figure out the mail in ballot when I was voting in PA but am not a resident of PA.
Having a say in the leadership of this country; to make a change None in voting itself
Making your voice heard and playing a part in our democracy Possibly long wait times
’-civic duty ’-voter supression
Being able to voice your opinions on a national level. None to be honest.
having the ability to create change in the community i don’t see any
Participating in a democracy is a privilege and to vote is taking advantage of this privilege. The anxiety that uncertainty creates for voters.
Exercising my rights, doing something meaningful, taking a stance on my future. Paying for postage.
Expressing your opinion Inconvenient
I think one of the greatest advantages of voting is having a voice in the future of our country. I think one possible disadvantage of voting is that people are not perfectly informed.
Choosing who represents you None
Making your voice be heard /
Ability to influence Not having an impact on the larger scale
That your voice gets counted in the consideration of the highest position of leadership in the country. Not necessarily a disadvantage of voting, but because of the electoral college, individual votes for the president can possibly not count at all.
Having one’s voice heard, casting a ballot for the person you feel best represents you. Feeling like you are picking the lesser of two evils, not being sure whether one candidate is truly better than the other.
Expressing your opinion and identifying with other people who share your values Polarizing yourself from people who might be very similar to you
I felt very uncomfortable with the prospect that the election would not turn out the way I would like it to. The greatest advantage therefore was to exert all the influence I could, however minute. Not having a good outcome is the disadvantage of voting; it’s demoralizing. Aside from that, I can’t really think of anything other than the logistics: losing time and stressing over a vote.
It is an opportunity to express your opinion and dictate the potential future of public policy. There might be some disadvantages to voting if it takes a lot of time to do so or if polling places are hard to access
Allows you to take pride in standing up for your own beliefs
Helps a candidate that you support Time commitment
you feel as though you have a say in how you are governed in reality you do not have much of a say in how you are governed whether you vote or not
Expressing your voice. Both of the candidates aren’t really that good, voting for the wrong one.
Having a say in the government policies of my country It is hard to believe that one single vote (i.e. mine) matters
feeling satisfaction, having you voice be heard takes a long time sometimes, individual votes dont really make that much of a difference
In battleground states, an individual’s voting power can be huge, especially if voters show up in large numbers. I see discouragement of voting because the electoral college is an outdated and antiquated institution that breaks the backbone of democracy. It was created because of a reason that no longer exists: news didn’t spread fast enough for people to be informed enough about the choices for president. Now news spreads in seconds and the electoral college is an unfair and unequal way to elect a president. It too often happens that a president is elected that the people did not want.
civic duty n/a
Being able to change a part of government in your favor Being forced to make moral concessions
voicing your opinion, getting to exercise a right that people still to this day don’t have in some places, being civically engaged, exciting nothing
Being able to feel like you have power over a situation instead of sitting back and watching the country go in a direction you don’t like. I guess, in other words, to be able to have a voice. Are there disagvantages?
I live in a swing state, so my vote could very well be influential. Inefficiencies in counting; manipulation; people not understanding the process; inefficiencies in actually voting (wait time and etc); the electoral college; voter suppression
keeping bad people out of office it doesn’t help much when you belong to a marginalized community
The feeling that as it is a right of Americans, it is a cultural and social requirement being fulfilled The lines are long and the experience is bureaucratic and dull
Influence public policy, participate in democracy None
Voting is a way to get your voice heard in the government. By choosing who you want to fight for your beliefs, you are able to be a part of larger change. Voting also confirms and validates your own beliefs and political leanings. Sometimes the voting process can be quite tedious/inaccessible. Voting for different parties can spark rifts between you and close friends/family.
You can make a difference in policy Hassle
Being able to participate in the democratic process, elect candidates who you believe in, to be able to see your opinions reflected in policy Voter disenfranchisement in the US is rampant (may be difficult to obtain an ID, reach a polling location, etc), in this election voting was particularly difficult (especially in Pennsylvania, this year in the primaries tens of thousands of ballots never arrived, and in this election the process for obtaining a mail in ballot was unnecessarily difficult).
Collectively, it allows the individuals of a democracy to instigate change on a national level. On an individual basis, it can instill a genuine pride and satisfaction to people who fullfill their civic duty. The fact that the system can be abused and manipulated through processes like gerrymandering and the spread of misinformation.
Expressing your say in the government feeling like it didnt count because of the electoral college.
The greatest advantage of voting is feeling that you have a say in the political process. The greatest disadvantage of voting is feeling that your vote doesn’t matter since individual votes are inconsequential. If you do not live in a swing state this can feel particularly true.
You get to share your opinion and have a say in the democracy of the country. At times it feels as if your vote is irrelevant.
Expressing my right to vote. Possibly helping make an impact on future legislation. Choosing local officials. I think that in the US specifically, we tend to settle for candidates. Voting even when we are not satisfied by any candidate and do not support some of their policies. We are forced to pick between the lesser of two evils and I think this enables the parties to continue to disregard the needs of minorities who they know will still give them a vote.
Expressing your voice in our democracy. It could take a long time to do it, or you could be exposed to coronavirus.
getting the orange man out
also allow the country to see people are shifting ideologies n/a
Having a say in who is going to be the leader of this country, which was EXTREMELY important in this election, specifically I don’t see any disadvantages.
Expressing individual beliefs about what our union should look like through our democratic process. I don’t think that there are any!
exercising your civic duty and having a say over the direction of our government there are none!
Being able to influence issues that affect you and people you care about. I don’t think there are any disadvantages of voting.
The ability to vote because not everyone around the world has that. There are no disadvantages to voting other than it takes a little time out of someone’s day.
’- voicing your opinion
- being an active citizen
- makes you more politically informed ’- perhaps it can be stressful to make a decision when both candidates don’t represent your values
Putting people in government who you actually want Nothing
It truly allows individuals to collectively convene on an issue. I think on the local level it is incredibly effective. The biggest advantage comes from an educated body all voting, after hearing arguments from both sides, on their own view. The sense of voice it gives people is nice for someone. A single leader or group of officials can often be more efficient/quicker than voting, as some people vote without any thought on the topic. I think in this election, disadvantages have been people still hating one side or the other for casting their honest opinion. People cling to their vote like it is the only true way, when in reality matters are more complicated. Voting is the most democratic process we have, but people shame you for exercising your opinion.
Having a say in the government waiting in line to vote/effort put into the process
You exercise your freedom by adding your two cents to current events, even if it feels like the impact is small. It also makes you feel like you’re doing something to guide the country and local community in what you think is the right direction If you don’t like any of the candidates, it can leave a nasty feeling to have to vote for someone you don’t really like.
It’s one of the easiest ways to politically engage. There’s technically no economic utility in voting (it’s never economically worth it for individual people).
Making your voice count N/A
you have a voice in what happens to your country none
NA NA
Carrying out your right and duty as an American citizen. You are able to exercise your voice and affect the structure of national, state, and local government. In a partisan system, many people see their votes as meaningless in dominated states (ex. Oregon is mostly liberal, and many feel that no matter how they vote, it won’t affect that fact that Oregon is blue).
being able to choose a candidate who can push out policies voting for limited number of candidates who you may both disagree with
Especially in a swing state like Pennsylvania, you can really see how your vote matters and contributes to the political future of the United States. I don’t think there are disadvantages to voting.
Able to express and think freely Herd mentality. It is hard to get an opinion for yourself
Best way for individuals to express their opinions about where the country/town/etc should go only thing I can think of is that it is on a weekday, so you might lose work time or need child care to do it, so you might lose money
It’s a way for citizens to directly have a say in government affairs and all citizens are entitled to the right to vote once 18. Considering the vast number of people in a country it can be difficult for change to occur through voting.
In theory, the candidates are accountable for their actions; they must answer to the people at the polls. No candidate is guaranteed the position regardless of what they do. This should limit tyranny and oligarchy. I can think of multiple reasons:
-Vote counting still corruptible
-Uneducated voters
-Has encouraged a two party system that somewhat resembles an oligarchy

The system is still corruptible. In the American context, this was especially observable in the Jim Crow South, which selectively disenfranchised African American voters. In modern times, the Democrats tend to point to voter suppression while the Republicans tend to point to voter fraud. Bottom line: the system could be improved and made more transparent. Personally, I would make the vote counts completely digital and encrypted such that an automated computer program determines the results with bipartisan oversight. Additionally, I would remove mail-in absentee ballots with very very limited exceptions; e.g. you can vote for your state electronically across state-lines at a voting booth. There are various other things that I would do, e.g. data encryption with randomized encryption keys. This technology is available and is used in many other walks of life.

The news outlets don’t spread facts. It’s biased and absurd, on both sides. The average American cannot know the facts, nor do the established parties really want them to. At this point, I don’t know the facts. It seems that people are living in two very different realities because of the lack of this essential basis.

A vote for a third party is pretty much meaningless (in my opinion). Many people don’t agree with a political party on every issue. With the two party system, you are forced to vote for the better of two evils, which is simply based on some sort of coalition that will give a party the most votes rather than improve the country.

I really got on my soapbox for that one (sorry). You have a great opportunity to voice your opinion. It is better than not being able to vote, which would be a complete muting of one’s personal voice. Sometimes people don’t think that their vote really matters and counts when their opinion is not shared by the majority.
It is the most direct and easiest way in which we are average day citizens can impact policy and what our country looks like. It also incentivizes me to be more informed about issues in my community. Sometimes, if a ballot allows you to vote along party lines, it can cause people to be just as little as informed about issues that they previously were. Also, in terms of amendments and new ballot initiatives, I often find that people are completely ignorant to the meat of the issue at hand and can vote based off a few words that they see.
feeling like you did something? waiting in line
Your vote is your voice Better policies for yourself and others Civic duty None
You are completing a duty you have as a citizen Time commitment (that’s the biggest disadvantage I could think of, and it’s not even a big one)
It represents the ideals of the foundation in which America was built and allows everyone to take part in the country’s well-being. The social discourtesy that is expressed when presented with differing opinions regarding candidate choices is disadvantageous.
Participating in democracy having to make a hard moral choice
Voicing your opinion. Getting the right people elected. Nothing
If you don’t vote, you don’t get to complain about the outcome. Still can be kind of limited in the impact you can have on American politics. It is definitely a more complicated process than it needs to be.
your voice counts and matters! staying informed about things happening and making your voice heard if you live in a state that’s already very blue, etc. I see why some people don’t think their vote “matters” which isn’t good, but I think it’s still important to vote. I guess a possible disadvantage is that people don’t always make informed decisions.
it shows that democracy is working and a part of the process of democracy can be a long and timely process to ensure the most accurate results
voicing your opinion and making a difference there aren’t
You get to have a say in the democratic process. I can’t really see any, but potentially it’s disagreeing with someone else.
The possible positive impact on selecting better leaders for the country. The symbolic benefit of feeling more tied and involved in one’s country. Wasted time to vote, or the energy that goes into learning enough about candidates to cast a good vote. You could possibly make the wrong choice and help put bad leaders in power. Maybe being too politically engaged in general ends up being a bad thing for individuals and voting could help with that
Making your voice heard Two party system/limited choices
Getting a leader that’s fit to represent your country and make it look good. Lack of access for certain people. Perhaps voter fraud in this election.
Having every voice be heard People hopping on the bandwagon and only voting for what’s considered to be “in” as opposed to what they really stand for. Some people may vote for people just because of their name (i.e. the people who voted for Kanye West). I’m not sure how to exactly describe this disadvantage but I defiantly think it is one. I guess I could say people not really doing their research on the candidates is the disadvantage.
It’s our duty to vote in our democracy and by voting in this election I was able to elect someone who I think will unite our country and be better for human rights and help those less fortunate than me. You don’t get to have a voice in what happens in your life
Participating in the political process, having your voice heard and considered. N/a
Feeling like you made your voice heard, having some say in what happens in the government Voting often changes very little
It is a trusted process that can create change from a top down view. It also is important in uniting the nation depending on which candidates are selected A disadvantage is that voting maintains the current system which some might say is not currently working.
I think that voting is the best way to express the people’s opinions to the government on a widespread level. I don’t see any disadvantages to voting.
Creating change and having a voice/say in society in what you believe to be right. A possible disadvantage would be losing the election despite winning the popular vote.
Be a part of the democratic system, make your voice and opinions heard May seem to be belittled by either the electoral college or their lack of personal importance.
peaceful transition of power, using your voice NA
Feeling like you made a positive contribution. The only disadvantage was the time commitment which was worth it.
Voicing for our own community and identity. How voting can be used as a political toy.
It allows you to have some influence in the leadership of something important to me You sometimes have to choose the lesser of two evils and aren’t particularly passionate about their stances
Letting your voice be heard Other people who hold different views and publicize them way too much
Participating in democracy and making your voice heard The difficulties associated with voting and making sure your ballot is counted
you get to share your opinion nothing
Voice is heard Inconvenient
To me, voting allows you to exercise your ability to make a difference in your community. I don’t see a disadvantage. It’s easy, it’s important, and it actually makes a difference
The greatest advantage to voting is being able to elect officials that serve the interests of yourself and your community. A disadvantage of voting is many people solely vote based on party lines instead of fully understanding the policies of candidates, thus sometimes bringing unfit people to office.
You can show a small part of your opinion to the public through a vote. Hard to believe the vote will be counted fairly with previous and recent news.
Electing a candidate whose views align with your own Uniformed voters choosing unsuitable candidates
having a voice in government sometimes it is not easy to do
You can make your voice heard in a democracy. None
gives you the power to help choose your representatives who decide policies that will significantly impact your life. very few candidates who run for office are not corrupted by outside influences anymore so sometimes it feels like you are choosing between the lesser of two evils
Getting your opinions heard Not having your candidate win
Participating in democracy Having your opinion matter in the way the country is ran Complacency after putting in vote: feeling like since i voted, i have done my part, the job is done
People contribute to their representation in government. It encourages people to get involved more and become more informed about various policies and issues. Ideally, it should also encourage people to be more open-minded in order to make an informed decision. No apparent disadvantages, but I do think it’s important that people truly research thoroughly before they vote.
Having a voice and to make a difference in our country None that I can think of, I believe it is our civic duty to vote/
Being a part of something larger and having a say in the democracy in which we live. No
That you are able to have your voice heard, and contribute to the decision making of the new leaders of society. That many times your vote is not enough
We can make a difference in the outcome of the election and change the future of our country for the better it takes up a lot of time and can cause boredom
Its our right to vote! Advantage is taking a part of the U.S and expressing our opinions. No disadvantages
contributing to a cause you care about, exercising the right to vote none
Having your voice herd on a national level Not winning
Participating in a democratic republic, a monumental achievement of self-governance Not many–mail-in voting makes it pretty easy
a sense of belonging to the community, knowing that you were involved in something greater than yourself the distress of deciding who to vote for and the election results
Getting your opinion heard and being able to possibly make a change The lack of actual insight and news coverage different propositions on the ballot get or the lower position levels (like state and county level positions) since it causes people to just randomly pick one of the choices
Being able to have a say in what goes on in one’s community, my ease in doing it The difficulty in doing it for others of different backgrounds from me (i.e. not being able to fully understand the amendments because of a language barrier, not knowing how to register/how to vote), the antiquated nature of the electoral college, the months it takes of campaigning beforehand compared to other countries’ weeks
Democracy civil war
Voting gives citizens a choice to slightly determine or sway how their city/state/country is run. A lot of the time, it can feel like voting doesn’t really fix the issues some people value most.
getting your voice heard, participating as a citizen, it is your right, learning about the current and future political climate none
To express your opinion to your government None
You get to have an impact in your countries future Nothing
Have a say in democracy Lines
Having your voice and beliefs heard Contracting COVID at a polling location
You are able to let your voice be heard. As we saw in this election, when everyone bands together to vote, we have the ability to make historic changes. In the current state of the world, we need everyone to believe that their voice matters; our country is far overdue for change. Possible disadvantages to voting in a country like the United States is the lack of choice, or the pressure to conform to the two party system. There is a lot of pressure surrounding individuals who vote third party; they are often made to feel as though their votes are wasted. I think the voting system is also due for change.
Voting in local elections generates the greatest advantages in my eyes as these elections more directly influence the livelihood of a community. One of the disadvantages of voting is the way the act can dilute a sense of agency to challenge the state as one may believe that participating in the election can generate positive change for the disenfranchised (i.e. truly address houselessness, poverty, etc).
Letting your voice be heard, helping decide what course the government plots Voter intimidation/being seen a certain way because of party you vote for
Upholding democracy in giving every citizen equal opportunity to select elected officials N/A
The opportunity to be a part of or at the very least pose as part of the democraticdecision-making process of our society. Participating in a system that I fundamentally disagree with and believe should be abolished and completely reimagined

There is some weird formatting that breaks the columns in the table starting with the response that starts with “I can think of”. Let’s take a closer look and see what’s doing on there

data_tidy %>%
  select(ResponseId, advantages, disadvantages) %>%
  pivot_longer(cols = c(advantages, disadvantages)) %>%
  filter(grepl("^I can think of", value))

It looks like this person used the return key, coded here as \n. Let’s replace this with , to try to fix the issue

data_tidy %>%
  select(ResponseId, advantages, disadvantages) %>%
  pivot_longer(cols = c(advantages, disadvantages)) %>%
  mutate(value = gsub("\n", ", ", value)) %>%
  filter(grepl("^I can think of", value))
data_tidy %>%
  select(ResponseId, advantages, disadvantages) %>%
  pivot_longer(cols = c(advantages, disadvantages)) %>%
  mutate(value = gsub("\n", ", ", value)) %>%
  pivot_wider() %>%
  select(-ResponseId) %>%
  kable(format = "pandoc")
advantages disadvantages
you have some impact in making your voice heard Some states make the process of voting extremely technical. Often times many ballots get tossed out because people were just unaware of how to complete the form properly.
Making sure your voice is being heard. Time-consuming
You get to exercise your constitutional right. You get a say in who are the leaders of the country. Long lines, sometimes it’s inconvenient to vote.
That you get to do your civic duty and have your voice heard It can be a long and tedious process with lines, etc.
Exercising your right that the people before you fought for. I think one of the greatest advantages of voting is that it encourages you to educate yourself and to have an opinions about something. Voting could potentially cause polarization, as there will be a winner and a loser, and in theory, it pits people against one another.
Exercising your rights as a citizen There are no candidates that I wish to support
Your opinion is taken into account. In this election year, safety at the poll is a concern.
Letting the country be run in the way the people want it to. Sometimes allows for tyranny of majority groups
Is a surefire way of contributing to your community Must recognize that you supported someone even if they ended up doing damage to the country
Doing your civic duty Being swayed to vote for a particular candidate
having a say in the future of our country being criticized for voting for a specific candidate
Having a say in who runs the country It might be a difficult thing for people from certain areas or backgrounds to do
Voicing my view and influencing who takes office none
If the candidate I favor doesn’t get elected, I would not regret because I did my part by voting. Allowing the candidate I don’t favor to have a slight increase of advantage of winning.
Having a say in how the US will proceed as a country. It sometimes feels like individual voices do not affect change.
having a voice in how I want America to be politicians may ignore what you want once they get elected (assuming they don’t need to be reelected)
It always you to voice your opinion and be an agent of change. It takes some time to go through the process
being a part of our countries democracy and supporting my preferred candidate the candidate I voted for is not my favorite, but is the best option
being able to express your views on the candidates and their policies time-consuming and having little to no impact on the outcome
Having your voice heard, making a change Not every vote counts the same
Influencing the election Long lines and confusing registration process
Democratically electing government leaders As far as America goes, we are given 2 options and if you don’t like either you can’t do anything about it. Voting third party is unfortunately essentially a waste.
exerting your right and helping form our democracy there are none
Being able to vote allows me to have a say in what’s going on in our government. With how our voting system is set up (the electoral college), sometimes it seems like even when we vote, we don’t have a say. For example, last election Hilary Clinton won the popular vote, but Trump still on the election.
Individuals get to participate in democracy and select their representatives Uninformed people making decisions
Being able to engage with the future of the country; main way to contribute to what the government will look like. Important civic duty. No candidate for any party is ever perfect. Chances are, you need to compromise on some of your beliefs for each person you vote for.
To directly participate in our democracy and choose our leader The physical process and currently exposing yourself to potential infection
Partaking in a decision that will influence our country for the next four years If I am not fully informed of the stances of the politicians, I could make a decision that will negatively influence my nation or local community
getting rid of the evil Trump waiting in a long line
having a voice having to choose between candidates who don’t represent one’s personal values
voting for others who cannot do so legitimizing the imperial empire of the United States and participating in a government that is fundamentally against sexual and ethnic minorities
the sticker getting COVID
getting people that represent at least some of your values in positions of power to make change none - every person should have the ability to voice their own opinion and vote for the candidate they prefer
Having a voice in democracy. Certain groups of people are continuously disenfranchised.
It gives you the opportunity to push society in the direction you want it to go in. Even if you don’t exactly have a say in what goes on in your community, voting is a step in the right direction. Maybe people think their vote doesn’t matter, especially depending on the state you live in.
Democracy The Electoral College
An oppurtunity for concrete reflection of your own values and opinions on various political issues. The minor inconvenience of having to spend some time voting
You feel a sense of contribution or control in the way that the country or locality is run. Some votes in certain states count more than others
Local government! I feel like it can change the outcomes on a local level. It was confusing and took a lot of time to figure out the mail in ballot when I was voting in PA but am not a resident of PA.
Having a say in the leadership of this country; to make a change None in voting itself
Making your voice heard and playing a part in our democracy Possibly long wait times
’-civic duty, ’-voter supression
Being able to voice your opinions on a national level. None to be honest.
having the ability to create change in the community i don’t see any
Participating in a democracy is a privilege and to vote is taking advantage of this privilege. The anxiety that uncertainty creates for voters.
Exercising my rights, doing something meaningful, taking a stance on my future. Paying for postage.
Expressing your opinion Inconvenient
I think one of the greatest advantages of voting is having a voice in the future of our country. I think one possible disadvantage of voting is that people are not perfectly informed.
Choosing who represents you None
Making your voice be heard /
Ability to influence Not having an impact on the larger scale
That your voice gets counted in the consideration of the highest position of leadership in the country. Not necessarily a disadvantage of voting, but because of the electoral college, individual votes for the president can possibly not count at all.
Having one’s voice heard, casting a ballot for the person you feel best represents you. Feeling like you are picking the lesser of two evils, not being sure whether one candidate is truly better than the other.
Expressing your opinion and identifying with other people who share your values Polarizing yourself from people who might be very similar to you
I felt very uncomfortable with the prospect that the election would not turn out the way I would like it to. The greatest advantage therefore was to exert all the influence I could, however minute. Not having a good outcome is the disadvantage of voting; it’s demoralizing. Aside from that, I can’t really think of anything other than the logistics: losing time and stressing over a vote.
It is an opportunity to express your opinion and dictate the potential future of public policy. There might be some disadvantages to voting if it takes a lot of time to do so or if polling places are hard to access
Allows you to take pride in standing up for your own beliefs, Helps a candidate that you support Time commitment
you feel as though you have a say in how you are governed in reality you do not have much of a say in how you are governed whether you vote or not
Expressing your voice. Both of the candidates aren’t really that good, voting for the wrong one.
Having a say in the government policies of my country It is hard to believe that one single vote (i.e. mine) matters
feeling satisfaction, having you voice be heard takes a long time sometimes, individual votes dont really make that much of a difference
In battleground states, an individual’s voting power can be huge, especially if voters show up in large numbers. I see discouragement of voting because the electoral college is an outdated and antiquated institution that breaks the backbone of democracy. It was created because of a reason that no longer exists: news didn’t spread fast enough for people to be informed enough about the choices for president. Now news spreads in seconds and the electoral college is an unfair and unequal way to elect a president. It too often happens that a president is elected that the people did not want.
civic duty n/a
Being able to change a part of government in your favor Being forced to make moral concessions
voicing your opinion, getting to exercise a right that people still to this day don’t have in some places, being civically engaged, exciting nothing
Being able to feel like you have power over a situation instead of sitting back and watching the country go in a direction you don’t like. I guess, in other words, to be able to have a voice. Are there disagvantages?
I live in a swing state, so my vote could very well be influential. Inefficiencies in counting; manipulation; people not understanding the process; inefficiencies in actually voting (wait time and etc); the electoral college; voter suppression
keeping bad people out of office it doesn’t help much when you belong to a marginalized community
The feeling that as it is a right of Americans, it is a cultural and social requirement being fulfilled The lines are long and the experience is bureaucratic and dull
Influence public policy, participate in democracy None
Voting is a way to get your voice heard in the government. By choosing who you want to fight for your beliefs, you are able to be a part of larger change. Voting also confirms and validates your own beliefs and political leanings. Sometimes the voting process can be quite tedious/inaccessible. Voting for different parties can spark rifts between you and close friends/family.
You can make a difference in policy Hassle
Being able to participate in the democratic process, elect candidates who you believe in, to be able to see your opinions reflected in policy Voter disenfranchisement in the US is rampant (may be difficult to obtain an ID, reach a polling location, etc), in this election voting was particularly difficult (especially in Pennsylvania, this year in the primaries tens of thousands of ballots never arrived, and in this election the process for obtaining a mail in ballot was unnecessarily difficult).
Collectively, it allows the individuals of a democracy to instigate change on a national level. On an individual basis, it can instill a genuine pride and satisfaction to people who fullfill their civic duty. The fact that the system can be abused and manipulated through processes like gerrymandering and the spread of misinformation.
Expressing your say in the government feeling like it didnt count because of the electoral college.
The greatest advantage of voting is feeling that you have a say in the political process. The greatest disadvantage of voting is feeling that your vote doesn’t matter since individual votes are inconsequential. If you do not live in a swing state this can feel particularly true.
You get to share your opinion and have a say in the democracy of the country. At times it feels as if your vote is irrelevant.
Expressing my right to vote. Possibly helping make an impact on future legislation. Choosing local officials. I think that in the US specifically, we tend to settle for candidates. Voting even when we are not satisfied by any candidate and do not support some of their policies. We are forced to pick between the lesser of two evils and I think this enables the parties to continue to disregard the needs of minorities who they know will still give them a vote.
Expressing your voice in our democracy. It could take a long time to do it, or you could be exposed to coronavirus.
getting the orange man out, also allow the country to see people are shifting ideologies n/a
Having a say in who is going to be the leader of this country, which was EXTREMELY important in this election, specifically I don’t see any disadvantages.
Expressing individual beliefs about what our union should look like through our democratic process. I don’t think that there are any!
exercising your civic duty and having a say over the direction of our government there are none!
Being able to influence issues that affect you and people you care about. I don’t think there are any disadvantages of voting.
The ability to vote because not everyone around the world has that. There are no disadvantages to voting other than it takes a little time out of someone’s day.
’- voicing your opinion, - being an active citizen, - makes you more politically informed ’- perhaps it can be stressful to make a decision when both candidates don’t represent your values
Putting people in government who you actually want Nothing
It truly allows individuals to collectively convene on an issue. I think on the local level it is incredibly effective. The biggest advantage comes from an educated body all voting, after hearing arguments from both sides, on their own view. The sense of voice it gives people is nice for someone. A single leader or group of officials can often be more efficient/quicker than voting, as some people vote without any thought on the topic. I think in this election, disadvantages have been people still hating one side or the other for casting their honest opinion. People cling to their vote like it is the only true way, when in reality matters are more complicated. Voting is the most democratic process we have, but people shame you for exercising your opinion.
Having a say in the government waiting in line to vote/effort put into the process
You exercise your freedom by adding your two cents to current events, even if it feels like the impact is small. It also makes you feel like you’re doing something to guide the country and local community in what you think is the right direction If you don’t like any of the candidates, it can leave a nasty feeling to have to vote for someone you don’t really like.
It’s one of the easiest ways to politically engage. There’s technically no economic utility in voting (it’s never economically worth it for individual people).
Making your voice count N/A
you have a voice in what happens to your country none
NA NA
Carrying out your right and duty as an American citizen. You are able to exercise your voice and affect the structure of national, state, and local government. In a partisan system, many people see their votes as meaningless in dominated states (ex. Oregon is mostly liberal, and many feel that no matter how they vote, it won’t affect that fact that Oregon is blue).
being able to choose a candidate who can push out policies voting for limited number of candidates who you may both disagree with
Especially in a swing state like Pennsylvania, you can really see how your vote matters and contributes to the political future of the United States. I don’t think there are disadvantages to voting.
Able to express and think freely Herd mentality. It is hard to get an opinion for yourself
Best way for individuals to express their opinions about where the country/town/etc should go only thing I can think of is that it is on a weekday, so you might lose work time or need child care to do it, so you might lose money
It’s a way for citizens to directly have a say in government affairs and all citizens are entitled to the right to vote once 18. Considering the vast number of people in a country it can be difficult for change to occur through voting.
In theory, the candidates are accountable for their actions; they must answer to the people at the polls. No candidate is guaranteed the position regardless of what they do. This should limit tyranny and oligarchy. I can think of multiple reasons:, -Vote counting still corruptible, -Uneducated voters, -Has encouraged a two party system that somewhat resembles an oligarchy, , The system is still corruptible. In the American context, this was especially observable in the Jim Crow South, which selectively disenfranchised African American voters. In modern times, the Democrats tend to point to voter suppression while the Republicans tend to point to voter fraud. Bottom line: the system could be improved and made more transparent. Personally, I would make the vote counts completely digital and encrypted such that an automated computer program determines the results with bipartisan oversight. Additionally, I would remove mail-in absentee ballots with very very limited exceptions; e.g. you can vote for your state electronically across state-lines at a voting booth. There are various other things that I would do, e.g. data encryption with randomized encryption keys. This technology is available and is used in many other walks of life., , The news outlets don’t spread facts. It’s biased and absurd, on both sides. The average American cannot know the facts, nor do the established parties really want them to. At this point, I don’t know the facts. It seems that people are living in two very different realities because of the lack of this essential basis., , A vote for a third party is pretty much meaningless (in my opinion). Many people don’t agree with a political party on every issue. With the two party system, you are forced to vote for the better of two evils, which is simply based on some sort of coalition that will give a party the most votes rather than improve the country., , I really got on my soapbox for that one (sorry).
You have a great opportunity to voice your opinion. It is better than not being able to vote, which would be a complete muting of one’s personal voice. Sometimes people don’t think that their vote really matters and counts when their opinion is not shared by the majority.
It is the most direct and easiest way in which we are average day citizens can impact policy and what our country looks like. It also incentivizes me to be more informed about issues in my community. Sometimes, if a ballot allows you to vote along party lines, it can cause people to be just as little as informed about issues that they previously were. Also, in terms of amendments and new ballot initiatives, I often find that people are completely ignorant to the meat of the issue at hand and can vote based off a few words that they see.
feeling like you did something? waiting in line
Your vote is your voice , Better policies for yourself and others, Civic duty None
You are completing a duty you have as a citizen Time commitment (that’s the biggest disadvantage I could think of, and it’s not even a big one)
It represents the ideals of the foundation in which America was built and allows everyone to take part in the country’s well-being. The social discourtesy that is expressed when presented with differing opinions regarding candidate choices is disadvantageous.
Participating in democracy having to make a hard moral choice
Voicing your opinion. Getting the right people elected. Nothing
If you don’t vote, you don’t get to complain about the outcome. Still can be kind of limited in the impact you can have on American politics. It is definitely a more complicated process than it needs to be.
your voice counts and matters! staying informed about things happening and making your voice heard if you live in a state that’s already very blue, etc. I see why some people don’t think their vote “matters” which isn’t good, but I think it’s still important to vote. I guess a possible disadvantage is that people don’t always make informed decisions.
it shows that democracy is working and a part of the process of democracy can be a long and timely process to ensure the most accurate results
voicing your opinion and making a difference there aren’t
You get to have a say in the democratic process. I can’t really see any, but potentially it’s disagreeing with someone else.
The possible positive impact on selecting better leaders for the country. The symbolic benefit of feeling more tied and involved in one’s country. Wasted time to vote, or the energy that goes into learning enough about candidates to cast a good vote. You could possibly make the wrong choice and help put bad leaders in power. Maybe being too politically engaged in general ends up being a bad thing for individuals and voting could help with that
Making your voice heard Two party system/limited choices
Getting a leader that’s fit to represent your country and make it look good. Lack of access for certain people. Perhaps voter fraud in this election.
Having every voice be heard People hopping on the bandwagon and only voting for what’s considered to be “in” as opposed to what they really stand for. Some people may vote for people just because of their name (i.e. the people who voted for Kanye West). I’m not sure how to exactly describe this disadvantage but I defiantly think it is one. I guess I could say people not really doing their research on the candidates is the disadvantage.
It’s our duty to vote in our democracy and by voting in this election I was able to elect someone who I think will unite our country and be better for human rights and help those less fortunate than me. You don’t get to have a voice in what happens in your life
Participating in the political process, having your voice heard and considered. N/a
Feeling like you made your voice heard, having some say in what happens in the government Voting often changes very little
It is a trusted process that can create change from a top down view. It also is important in uniting the nation depending on which candidates are selected A disadvantage is that voting maintains the current system which some might say is not currently working.
I think that voting is the best way to express the people’s opinions to the government on a widespread level. I don’t see any disadvantages to voting.
Creating change and having a voice/say in society in what you believe to be right. A possible disadvantage would be losing the election despite winning the popular vote.
Be a part of the democratic system, make your voice and opinions heard May seem to be belittled by either the electoral college or their lack of personal importance.
peaceful transition of power, using your voice NA
Feeling like you made a positive contribution. The only disadvantage was the time commitment which was worth it.
Voicing for our own community and identity. How voting can be used as a political toy.
It allows you to have some influence in the leadership of something important to me You sometimes have to choose the lesser of two evils and aren’t particularly passionate about their stances
Letting your voice be heard Other people who hold different views and publicize them way too much
Participating in democracy and making your voice heard The difficulties associated with voting and making sure your ballot is counted
you get to share your opinion nothing
Voice is heard Inconvenient
To me, voting allows you to exercise your ability to make a difference in your community. I don’t see a disadvantage. It’s easy, it’s important, and it actually makes a difference
The greatest advantage to voting is being able to elect officials that serve the interests of yourself and your community. A disadvantage of voting is many people solely vote based on party lines instead of fully understanding the policies of candidates, thus sometimes bringing unfit people to office.
You can show a small part of your opinion to the public through a vote. Hard to believe the vote will be counted fairly with previous and recent news.
Electing a candidate whose views align with your own Uniformed voters choosing unsuitable candidates
having a voice in government sometimes it is not easy to do
You can make your voice heard in a democracy. None
gives you the power to help choose your representatives who decide policies that will significantly impact your life. very few candidates who run for office are not corrupted by outside influences anymore so sometimes it feels like you are choosing between the lesser of two evils
Getting your opinions heard Not having your candidate win
Participating in democracy, Having your opinion matter in the way the country is ran Complacency after putting in vote: feeling like since i voted, i have done my part, the job is done
People contribute to their representation in government. It encourages people to get involved more and become more informed about various policies and issues. Ideally, it should also encourage people to be more open-minded in order to make an informed decision. No apparent disadvantages, but I do think it’s important that people truly research thoroughly before they vote.
Having a voice and to make a difference in our country None that I can think of, I believe it is our civic duty to vote/
Being a part of something larger and having a say in the democracy in which we live. No
That you are able to have your voice heard, and contribute to the decision making of the new leaders of society. That many times your vote is not enough
We can make a difference in the outcome of the election and change the future of our country for the better it takes up a lot of time and can cause boredom
Its our right to vote! Advantage is taking a part of the U.S and expressing our opinions. No disadvantages
contributing to a cause you care about, exercising the right to vote none
Having your voice herd on a national level Not winning
Participating in a democratic republic, a monumental achievement of self-governance Not many–mail-in voting makes it pretty easy
a sense of belonging to the community, knowing that you were involved in something greater than yourself the distress of deciding who to vote for and the election results
Getting your opinion heard and being able to possibly make a change The lack of actual insight and news coverage different propositions on the ballot get or the lower position levels (like state and county level positions) since it causes people to just randomly pick one of the choices
Being able to have a say in what goes on in one’s community, my ease in doing it The difficulty in doing it for others of different backgrounds from me (i.e. not being able to fully understand the amendments because of a language barrier, not knowing how to register/how to vote), the antiquated nature of the electoral college, the months it takes of campaigning beforehand compared to other countries’ weeks
Democracy civil war
Voting gives citizens a choice to slightly determine or sway how their city/state/country is run. A lot of the time, it can feel like voting doesn’t really fix the issues some people value most.
getting your voice heard, participating as a citizen, it is your right, learning about the current and future political climate none
To express your opinion to your government None
You get to have an impact in your countries future Nothing
Have a say in democracy Lines
Having your voice and beliefs heard Contracting COVID at a polling location
You are able to let your voice be heard. As we saw in this election, when everyone bands together to vote, we have the ability to make historic changes. In the current state of the world, we need everyone to believe that their voice matters; our country is far overdue for change. Possible disadvantages to voting in a country like the United States is the lack of choice, or the pressure to conform to the two party system. There is a lot of pressure surrounding individuals who vote third party; they are often made to feel as though their votes are wasted. I think the voting system is also due for change.
Voting in local elections generates the greatest advantages in my eyes as these elections more directly influence the livelihood of a community. One of the disadvantages of voting is the way the act can dilute a sense of agency to challenge the state as one may believe that participating in the election can generate positive change for the disenfranchised (i.e. truly address houselessness, poverty, etc).
Letting your voice be heard, helping decide what course the government plots Voter intimidation/being seen a certain way because of party you vote for
Upholding democracy in giving every citizen equal opportunity to select elected officials N/A
The opportunity to be a part of or at the very least pose as part of the democraticdecision-making process of our society. Participating in a system that I fundamentally disagree with and believe should be abolished and completely reimagined

fancy table using reactable::reactable()

Let’s make a fancier, interactive table using the {reactable} package.

First, let’s add stripes to more easily distinguish responses.

data_tidy %>%
  select(ResponseId, advantages, disadvantages) %>%
  pivot_longer(cols = c(advantages, disadvantages)) %>%
  mutate(value = gsub("-", "", value),
         value = gsub("\n", ", ", value)) %>%
  pivot_wider() %>%
  select(-ResponseId) %>%
  reactable(striped = TRUE)

Next, let’s make the text filterable

data_tidy %>%
  select(ResponseId, advantages, disadvantages) %>%
  pivot_longer(cols = c(advantages, disadvantages)) %>%
  mutate(value = gsub("-", "", value),
         value = gsub("\n", ", ", value)) %>%
  pivot_wider() %>%
  select(-ResponseId) %>%
  reactable(striped = TRUE,
            filterable = TRUE)

generate word counts

Let’s get the number of times each word was used for advantages and disadvantages separately.

First, we need to convert the dataframe to the long format using pivot_longer(). Then, we’ll use the unnest_tokens() function to extract each individual word as a separate row

data_tidy %>%
  select(ResponseId, advantages, disadvantages) %>%
  pivot_longer(cols = c(advantages, disadvantages)) %>%
  unnest_tokens(word, value) %>%
  select(-ResponseId)

Next, we’ll use the count() function to count the number of times each word was used and do this separately for each question using group_by()

data_tidy %>%
  select(ResponseId, advantages, disadvantages) %>%
  pivot_longer(cols = c(advantages, disadvantages)) %>%
  unnest_tokens(word, value) %>%
  group_by(name) %>%
  count(word, sort = TRUE)

This is a faster alternative to what we’ve been doing previously using summarize() and arrange()

data_tidy %>%
  select(ResponseId, advantages, disadvantages) %>%
  pivot_longer(cols = c(advantages, disadvantages)) %>%
  unnest_tokens(word, value) %>%
  group_by(name, word) %>%
  summarize(n = n()) %>%
  arrange(desc(n))

Because we don’t really care how many times words like “the” and “a” are used, we want to remove these from the dataframe. the {tidytext} package includes a handy dataframe of the most common “stop” words in English

stop_words

To remove the stop words, we’ll use the anti_join() function. Since we’ll be using this data throughout the next sections, let’s save this as a variable counts

(counts = data_tidy %>%
  select(ResponseId, advantages, disadvantages) %>%
  pivot_longer(cols = c(advantages, disadvantages)) %>%
  unnest_tokens(word, value) %>%
  group_by(name) %>%
  count(word, sort = TRUE) %>%
  anti_join(stop_words, by = "word"))

generate a word cloud

Now that we have word counts, let’s make a word cloud using the {ggwordcloud} package.

To make it easier to interpret, let’s filter out any word that only appears once.

We’ll use the color aesthetic to separate the advantages and disadvantages words.

counts %>%
  filter(n > 1) %>%
  ggplot(aes(label = word, size = n, color = name)) +
  geom_text_wordcloud_area(rm_outside = TRUE)

This time, let’s separate the advantages and disadvantages words into two separate panels with facet_grid()

counts %>%
  filter(n > 1) %>%
  ggplot(aes(label = word, size = n, color = name)) +
  geom_text_wordcloud_area(rm_outside = TRUE) +
  facet_grid(~name)

To make the most common words pop a little more, let’s change the max size

counts %>%
  filter(n > 1) %>%
  ggplot(aes(label = word, size = n, color = name)) +
  geom_text_wordcloud_area(rm_outside = TRUE) +
  scale_size_area(max_size = 6) +
  facet_grid(~name)

plot word counts

Next, let’s plot the word counts for each question as a bar graph

counts %>%
  ggplot(aes(x = word, y = n, fill = name)) +
  geom_bar(stat = "identity")

Let’s reduce this down to 15 most common words per group

advantages_15 = counts %>%
  filter(name == "advantages") %>%
  slice(1:15)

disadvantages_15 = counts %>%
  filter(name == "disadvantages") %>%
  slice(1:15)

bind_rows(advantages_15, disadvantages_15) %>%
  ggplot(aes(x = word, y = n, fill = name)) +
  geom_bar(stat = "identity") +
  theme(legend.position = "top")

To make this easier to read, let’s flip the x and y coordinates and use position_dodge() to separate the questions

bind_rows(advantages_15, disadvantages_15) %>%
  ggplot(aes(x = word, y = n, fill = name)) +
  geom_bar(stat = "identity", position = "dodge") +
  coord_flip() +
  theme(legend.position = "top")

Since the questions have different words, let’s instead use facet_wrap and scales = "free to create each question as a separate panel

bind_rows(advantages_15, disadvantages_15) %>%
  ggplot(aes(x = word, y = n, fill = name)) +
  geom_bar(stat = "identity", position = "dodge") +
  coord_flip() +
  facet_wrap(~name, scales = "free") + 
  theme(legend.position = "none")

Let’s reorder the words by n

bind_rows(advantages_15, disadvantages_15) %>%
  ggplot(aes(x = reorder(word, n), y = n, fill = name)) +
  geom_bar(stat = "identity", position = "dodge") +
  coord_flip() +
  facet_wrap(~name, scales = "free") + 
  theme(legend.position = "none")

sentiment

Next looks at the positive and negative sentiment expressed in the text. To do this, we’ll use the get_sentiments dataframe from the {tidytext} package and join the dataframes using inner_join() so that only rows with words that have a positive or negative sentiment remains

data_tidy %>%
  select(ResponseId, advantages, disadvantages) %>%
  pivot_longer(cols = c(advantages, disadvantages)) %>%
  unnest_tokens(word, value) %>%
  inner_join(get_sentiments(lexicon = c("bing", "afinn", "loughran", "nrc"))) %>%
  select(-ResponseId)

Next, we’ll get counts, but this time for the number of positive and negative words for each question separately

data_tidy %>%
  select(ResponseId, advantages, disadvantages) %>%
  pivot_longer(cols = c(advantages, disadvantages)) %>%
  unnest_tokens(word, value) %>%
  inner_join(get_sentiments(lexicon = c("bing", "afinn", "loughran", "nrc"))) %>%
  group_by(name, sentiment) %>%
  count(sort = TRUE)

Let’s plot this as a bar graph

data_tidy %>%
  select(ResponseId, advantages, disadvantages) %>%
  pivot_longer(cols = c(advantages, disadvantages)) %>%
  unnest_tokens(word, value) %>%
  inner_join(get_sentiments(lexicon = c("bing", "afinn", "loughran", "nrc"))) %>%
  group_by(name, sentiment) %>%
  count(sort = TRUE) %>%
  ggplot(aes(x = name, y = n, fill = sentiment)) +
  geom_bar(stat = "identity", position = "dodge") +
  theme(legend.position = "top")

Finally, let’s see if this differs by people who did and didn’t vote

data_tidy %>%
  select(ResponseId, advantages, disadvantages, behavior_voting) %>%
  pivot_longer(cols = c(advantages, disadvantages)) %>%
  unnest_tokens(word, value) %>%
  inner_join(get_sentiments(lexicon = c("bing", "afinn", "loughran", "nrc"))) %>%
  group_by(name, sentiment, behavior_voting) %>%
  count(sort = TRUE) %>%
  ggplot(aes(x = behavior_voting, y = n, fill = sentiment)) +
  geom_bar(stat = "identity", position = "dodge") +
  facet_grid(~name) +
  theme(legend.position = "top")

data_tidy %>%
  group_by(behavior_voting) %>%
  summarize(n = n())

Since way more people voted than didn’t vote (hooray!!), let’s use percentages instead of count variables

total_words = data_tidy %>%
  select(ResponseId, advantages, disadvantages, behavior_voting) %>%
  pivot_longer(cols = c(advantages, disadvantages)) %>%
  unnest_tokens(word, value) %>%
  group_by(behavior_voting, name) %>%
  count(sort = TRUE) %>%
  rename("total_n" = n)

data_tidy %>%
  select(ResponseId, advantages, disadvantages, behavior_voting) %>%
  pivot_longer(cols = c(advantages, disadvantages)) %>%
  unnest_tokens(word, value) %>%
  inner_join(get_sentiments(lexicon = c("bing", "afinn", "loughran", "nrc"))) %>%
  group_by(name, sentiment, behavior_voting) %>%
  count(sort = TRUE) %>%
  left_join(., total_words) %>%
  mutate(percent = (n / total_n) * 100) %>%
  ggplot(aes(x = behavior_voting, y = percent, fill = sentiment)) +
  geom_bar(stat = "identity", position = "dodge") +
  facet_grid(~name) +
  theme(legend.position = "top")

assignment

Create a table using reactable() to present the responses to the barriers and solutions questions. Check out the reactable documentation and make it fancy

Generate word counts for the barriers and solutions questions and save these as counts

Create a dataframe called top10 that contains the 10 most commonly used words for both the barriers and solutions questions

Modify the following code to plot the word counts as a bar graph with each question as a separate panel

bind_rows(advantages_15, disadvantages_15) %>%
  ggplot(aes(x = reorder(word, n), y = n, fill = name)) +
  geom_bar(stat = "identity", position = "dodge") +
  coord_flip() +
  facet_wrap(~name, scales = "free") + 
  theme(legend.position = "none")

Modify the following code to explore whether people who voted use more negative language when describing barriers and more positive language when describing solutions

total_words = data_tidy %>%
  select(ResponseId, advantages, disadvantages, behavior_voting) %>%
  pivot_longer(cols = c(advantages, disadvantages)) %>%
  unnest_tokens(word, value) %>%
  group_by(behavior_voting, name) %>%
  count(sort = TRUE) %>%
  rename("total_n" = n)

data_tidy %>%
  select(ResponseId, advantages, disadvantages, behavior_voting) %>%
  pivot_longer(cols = c(advantages, disadvantages)) %>%
  unnest_tokens(word, value) %>%
  inner_join(get_sentiments(lexicon = c("bing", "afinn", "loughran", "nrc"))) %>%
  group_by(name, sentiment, behavior_voting) %>%
  count(sort = TRUE) %>%
  left_join(., total_words) %>%
  mutate(percent = (n / total_n) * 100) %>%
  ggplot(aes(x = behavior_voting, y = percent, fill = sentiment)) +
  geom_bar(stat = "identity", position = "dodge") +
  facet_grid(~name) +
  theme(legend.position = "top")