titleText='High School and Beyond Data Set'
sourceText='Source: National Opinion Research Center (1980)'
xaxisText= 'locus'
yaxisText= 'Count'
baseIntHist= baseIntHist + labs(title=titleText,
x = xaxisText,
y = yaxisText,
caption = sourceText)
baseIntHist
lab5_LOCUS=lab5[complete.cases(lab5$LOCUS),]
baseInt2= ggplot(lab5_LOCUS,aes(x = LOCUS))
baseIntHist= baseInt2 + geom_histogram()
baseIntHist
lab5_LOCUS=lab5[complete.cases(lab5$LOCUS),]
baseInt2= ggplot(lab5_LOCUS,aes(x = LOCUS))
baseIntHist= baseInt2 + geom_histogram()
baseIntHist
titleText='High School and Beyond Data Set'
sourceText='Source: National Opinion Research Center (1980)'
xaxisText= 'locus'
yaxisText= 'Count'
baseIntHist= baseIntHist + labs(title=titleText,
x = xaxisText,
y = yaxisText,
caption = sourceText)
baseIntHist
baseIntHist2= baseIntHist + theme(plot.caption = element_text(hjust = 0),
plot.title = element_text(hjust = 0.5))
baseIntHist2
baseIntHist2 + geom_histogram(bins=7,
colour='magenta',
fill='purple')
Part 5:
library(ggplot2)
frTable=as.data.frame(table(lab5$RACE))
names(frTable)=c('Type','Count')
baseNom= ggplot(data = frTable,
aes(x=Type, y=Count))
titleText='High School and Beyond Data Set'
sourceText='Source: National Opinion Research Center (1980)'
xaxisText= 'Race or ethnicity'
yaxisText= 'Count'
baseNom = baseNom + labs(title=titleText,
x = xaxisText,
y = yaxisText,
caption = sourceText)
baseNom
baseNom2= baseNom + geom_point()
baseNom2
Part 6 (For final project):
library("rio")
setwd("~/Desktop/session5")
bike <- import("~/Desktop/session5/jump bike data.xlsx")
bike
table(bike$Distance,exclude = 'nothing')
I have completed the document, yet in attempt to knit:
processing file: session5_LAB.Rmd Error in parse_block(g[-1], g[1], params.src) : duplicate label 'freqTab_abs' Calls: ... process_file -> split_file -> lapply -> FUN -> parse_block
Execution halted
pops up. May you help trouble shoot?
Session 5 LAB: Intro to Visualization
by Adrienne Hampton
Part 1:
Part 2: Make two barplots for one nominal variable (2 bar plots, both should have a title and a source)
The second plot should include more customized changes of your choice.
Part 3:
baseOrdBox
Part 4:
Part 5:
Part 6 (For final project):