[This article was first published on Learning R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
hc_app< -read.table("n:/misc/healthcareapproval.txt", header = T, sep = "\t")
attach(hc_app) hc_fit.o1< -lowess(Oppose~as.Date(Dates),f=0.25)
hc_fit.f1< -lowess(Favor~as.Date(Dates),f=0.25)
hc_fit.o2< -lowess(Oppose~as.Date(Dates),f=0.75)
hc_fit.f2< -lowess(Favor~as.Date(Dates),f=0.75)
plot(as.Date(Dates),Oppose,
main=”Public opinion and health care reform”,
ylim=c(0,80),pch=16,
xlim=c(as.Date(“2009-01-01”),as.Date(“2009-11-01”)),
cex.axis=.85, col=”#E6ADD8″,
xlab=””,ylab=”Percentage approving or opposing”) points(as.Date(Dates),
Favor,pch=16,col=”#ADD8E6″)
lines(hc_fit.f1,col=”blue”,lwd=2)
lines(hc_fit.o1,col=”red”,lwd=2)
lines(hc_fit.f2,col=”blue”,lwd=2,lty=3)
lines(hc_fit.o2,col=”red”,lwd=2,lty=3)
abline(h=50,lwd=.5,lty=3,col=”#555555″)
To leave a comment for the author, please follow the link and comment on their blog: Learning R.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.