library(RCPA3)POL 300: Lab 3
This page contains R code for Lab 3.
Instructions
To complete this lab:
- create a new R script on your computer
- save it under the name
POL 300 Lab 2.R - copy and paste the code from this page (in the gray boxes) into the script
- comment the code as instructed during the lab
Code
setwd(dirname(rstudioapi::getSourceEditorContext()$path))
getwd()sortC(id=country, by=infant.mortality, data=world, limit=5)
sortC(id=country, by=infant.mortality, data=world, limit=5, descending=F)
sortC(id=country, by=fh.democ.3cat, thenby=gdp.percap, data=world, limit=10)crosstabC(dv=abortlaws.3cat, iv=religiosity3, data=states)
crosstabC(dv=abortlaws.3cat, iv=religiosity3, data=states, chisq=T)
crosstabC(dv=frac.eth2, iv=election.violence.post, data=world, chisq=T)compmeansC(dv=coup.attempts, iv=dpi.system, data=world)```