Skip to content

Instantly share code, notes, and snippets.

@MJacobs1985
Last active March 6, 2022 06:38
Show Gist options
  • Save MJacobs1985/3dcc58dc2b1c5c817fac78b8aa364ab6 to your computer and use it in GitHub Desktop.
Save MJacobs1985/3dcc58dc2b1c5c817fac78b8aa364ab6 to your computer and use it in GitHub Desktop.
### Recode all character to factor data ##
arc[sapply(arc, is.character)]<-lapply(arc[sapply(arc, is.character)],as.factor)
str(arc)
## Recode Generation (A/S)
levels(arc$`generation(a/s)`)[levels(arc$`generation(a/s)`)=="05SB"]<-NA
### LOOK AT RAW DATA
dim(arc)
str(arc)
skim(arc)
## tabulate the data ###
table(arc$region)
table(arc$region, arc$slaughteryear)
table(arc$slaughteryear)
heatmap(table(arc$weightclasshalv, arc$slaughterq))
heatmap(table(arc$slaughteryear,arc$regi))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment