Abstract
My mother is learning how to comminucate via text message. Certain sayings often come along with this new skill, such as “anyone can learn to do this” or “wow, this is amazing!” My favorite is “I’m going digital.” This conversation thread got me thinking about generational differences around the use of technology. My search for baby boomers, technology, and bad data visualization led me to…..
Original source
What’s wrong with this?What I wanted to create using R
How I created the pie chart using R
Read the (manufactured) data, create variables, calculate new %s that will add up to 100%
a<- 100
b<- 2.43
require(readxl)
## Loading required package: readxl
## Warning: package 'readxl' was built under R version 3.1.3
SurveyData <- read_excel("~/EDAV/150326_EDAVBlogData.xlsx", sheet = "surveyresults")
#doing the calculations to re-weigh the responses in R this time around. This summary is also done in the "summary" tab in the workbook
sum(SurveyData$"Leaders"=="yes")
## [1] 40
((sum(SurveyData$"Leaders"=="yes")/a)/b)
## [1] 0.1646091
((sum(SurveyData$"Willing-to-learn"=="yes")/a)/b)
## [1] 0.2510288
((sum(SurveyData$"Tech-savvy"=="yes")/a)/b)
## [1] 0.09053498
((sum(SurveyData$"People-savvy"=="yes")/a)/b)
## [1] 0.3209877
((sum(SurveyData$"Creative"=="yes")/a)/b)
## [1] 0.1728395
Call plotrix library to try a 3d pie chart
library(plotrix)
## Warning: package 'plotrix' was built under R version 3.1.3
slices <- c(((sum(SurveyData$"Leaders"=="yes")/a)/b),((sum(SurveyData$"Willing-to-learn"=="yes")/a)/b),((sum(SurveyData$"Tech-savvy"=="yes")/a)/b),((sum(SurveyData$"Creative"=="yes")/a)/b), ((sum(SurveyData$"People-savvy"=="yes")/a)/b))
lbls <- c("17.4% Creative", "16.5% Leaders", " 32.2% People-savvy", "9.09% Tech-savvy", "25.2% Willing to learn")
Is a 3d chart pie chart better than the original?
pie3D(slices,labels=lbls, explode=0.2,main="How Baby Boomers Describe Themselves")
Remember it’s better to keep it simple. Let’s try a regular 2d chart…
pie(slices,labels=lbls,radius=0.7, main="How Baby Boomers Describe Themselves")
The 2d chart works! Let’s try to define new colors for the chart now.
colors = c("red", "green","blue","purple","orange")
Update pie chart with new colors
pie(slices,labels=lbls,radius=0.7, col=colors, main="How Baby Boomers Describe Themselves ")
Next steps: I’d like to investigate for V 2.0:
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 3.1.3
## Loading required package: RColorBrewer
## Warning: package 'RColorBrewer' was built under R version 3.1.3
Using the “Spectral” ColorBrewer theme from the above selection. Display.brewer.all() is great, but why does this render in such a compact way?