df2latex(psych::Thurstone,rowlabels=FALSE,apa=FALSE,short.names=FALSE,
caption="Thurstone Correlation matrix")
df2latex(psych::Thurstone,heading="Thurstone Correlation matrix in APA style")
df2latex(psych::describe(psych::sat.act)[2:10],short.names=FALSE)
cor2latex(psych::Thurstone)
cor2latex(psych::sat.act,short.names=FALSE)
fa2latex(psych::fa(psych::Thurstone,3),heading="Factor analysis from R in quasi APA style")
#to write to rtf file
#replace the temporary file name with something more useful
fn <- tempfile(pattern="example",fileext=".rtf") #create a temporary file
#better is to create a local file
# e.g. fn <- "rtf_example.rtf"
cor2rtf(sat.act, file=fn) #write to the file
dd <- psych::describe(sat.act)
temp <- df2rtf(dd, file=fn, append=TRUE, width=12) #write and keep open
temp1 <- cor2rtf(sat.act,old=temp,caption=date(), append=TRUE) #use date as caption
cor2rtf(sat.act, old=temp1, stars=TRUE) #close the file
#now open this with your word processor and reformat with left justify
#now write a factor analysis output to an output file
# e.g. fn <- "rtf_example.rtf"
f5 <- psych::fa(bfi,5)
temp <- fa2rtf(f5, width=12, file=fn, append=TRUE) #a normal fa output
fl <- psych::fa.lookup(f5, dictionary=bfi.dictionary)
fa2rtf(fl, old = temp)
##now open this with your word processor
#To convert these latex tables to HTML
#f3.lat <- fa2latex(psych::fa(psych::Thurstone,3),
# heading="Factor analysis from R in quasi APA style")
#library(tth)
#f3.ht <- tth(f3.lat)
#print(as.data.frame(f3.ht),row.names=FALSE)
###
#If using Sweave to create a LateX table as a separate file then set silent=TRUE
#e.g.,
#LaTex preamble
#....
#<>=
#f3 <- fa(Thurstone,3)
#fa2latex(f3,silent=TRUE,file='testoutput.tex')
#@
#
#\input{testoutput.tex}
Run the code above in your browser using DataLab