`summarise()` has grouped output by 'Nationality'. You can override using the
`.groups` argument.
p_title <-"Preferred Foot by Nationality"p_caption <-"FIFA dataset"p <-ggplot(data =subset(pip1, !is.na(Preferred.Foot) &!is.na(Nationality)), aes(x=Nationality, y=pct, fill = Preferred.Foot))p +geom_col(position ="dodge2") +labs(x=NULL, y="Percent", fill ="Preferred Foot",title = p_title, caption = p_caption, subtitle ="As a faceted horizontal bar chart") +guides(fill ="none") +coord_flip() +facet_grid(~ Nationality) +geom_text(aes(label = pct), position =position_dodge2(width =1))
Manipulated Chart
# Example: Delete observations where the value in the 'age' column is greater than 30subset_data <- FIFA[FIFA$Overall <=50, ]pip2 <- subset_data %>%group_by(Nationality, Preferred.Foot) %>%summarize(N =n()) %>%mutate(freq = N/sum(N),pct =round((freq*100),0)) %>%filter(Nationality %in%c("Spain", "Brazil", "France", "Italy", "Argentina"))
`summarise()` has grouped output by 'Nationality'. You can override using the
`.groups` argument.
p2 <-ggplot(data =subset(pip2, !is.na(Preferred.Foot) &!is.na(Nationality)), aes(x=Nationality, y=pct, fill = Preferred.Foot))p2 +geom_col(position ="dodge2") +labs(x=NULL, y="Percent", fill ="Preferred Foot",title = p_title, caption = p_caption, subtitle ="As a faceted horizontal bar chart") +guides(fill ="none") +coord_flip() +facet_grid(~ Nationality) +geom_text(aes(label = pct), position =position_dodge2(width =1))
For my manipulated chart, I made a subset that only included players whose overall score was less than 50.
Some factors that lead to bias, error, and deception are confirmation bias, cherry-picking data, misleading visuals, and manipulation. People intentionally use these methods to make their data appear a certain way. This is generally in order to serve their own personal interest or the interest of their company. Manipulating data visualization can help businesses to turn a bigger profit. Intentional deception in the business world normally stems from greed. I want to teach myself how to recognize deception in data visualization so I never accidentally use it. The first paper listed the four main principles of usability as, “1) incorrect type of graphic; 2) incorrect range or scale; 3) incorrect use of the semantic variables; or 4) incorrect labeling of the displayed information” (Camba et al., 2022). This list is a helpful tool to know what to look for when trying to spot deception.
As Christians, we are called to live with integrity and honesty. Dishonesty, which comes from intentional bias, error, or deception, is a sin and taints our walk with God. We must strive to portray the truth as accurately as possible through data visualization. When we use deception, especially in our workplace, we’re telling others that it’s okay to lie and manipulate truth. Colossians 3:9-10 says, “Do not lie to each other, since you have taken off your old self with its practices and have put on the new self, which is being renewed in knowledge in the image of its Creator.” Because we are a new creation, we should try to remove the sinful habits of our old selves. Ephesians 4:25 says, “Therefore each of you must put off falsehood and speak truthfully to your neighbor, for we are all members of one body.” We are supposed to be an example of Jesus to others. We cannot represent Jesus well if we choose to lie and deceive others.