Writing R tables to HTML with CSS Pretties

#I did not change my variable, df, or file names to generic terms for fear of mislabeling them and leading someone down to The Path of Frustration.

require(foreign)

lil2<-read.spss(“CrosstabsR2.sav”, to.data.frame=TRUE)

#lil2=df
lil <- xtabs(~EducSum+Income, data=lil2)
View(lil)

library(knitr)
KableOutput <- kable(lil,format=”html”,output=TRUE)

htmlStyle1 <- scan(“/Users/spss/Desktop/Style1html”,what=”raw”)
htmlStyle1
write(htmlStyle1,”/Users/spss/Desktop/kableoutput.html”)

write(KableOutput,”/Users/spss/Desktop/kableoutput.html”, append=TRUE)

Comments are closed.