# Create a file namefilen <- "table_aov" # or# filen <- paste("YOUR_DIR/table_aov")# Generate ANOVA outputfit=aov(yield ~ block + N * P + K, data = https://www.520longzhigu.com/shenghuo/npk) #'npk' dataset from base 'datasets'x=summary(fit)# Save ANOVA table as a CSV### Option 1: pass output as object# 輸出對象table2csv(x=x,file=filen, digits = 1, digitspvals = 3, add.rownames=TRUE)# 屏幕輸出導(dǎo)出到文件### Option 2: get output from consolesummary(fit)table2csv(file=filen, digits = 2, digitspvals = 4, add.rownames=TRUE)# Save ANOVA table as an Excel# Without formatting of the worksheetxtable2excel(file=filen, sheetName="aov_noformatting", digits = 1, digitspvals = 3, add.rownames=TRUE)# 更多參數(shù)# With formatting of the worksheettable2excel(x=x,file=filen, sheetName="aov_formated", append = TRUE, add.rownames=TRUE, fontName="Arial", fontSize = 14, fontColour = rgb(0.15,0.3,0.75), border=c("top", "bottom"), fgFill = rgb(0.9,0.9,0.9), halign = "center", valign = "center", textDecoration="italic")
原始數(shù)據(jù)的表格:
轉(zhuǎn)換格式之后的,在console中的數(shù)據(jù):
文件(csv和excel)中表格數(shù)據(jù):
導(dǎo)出為Word中的表,再也不用復(fù)制粘貼調(diào)格式了 table2officetable2ppt: 導(dǎo)出統(tǒng)計(jì)輸出到Microsoft Office PowerPoint/ LibreOffice Impress演示文稿中的表
table2doc: 將統(tǒng)計(jì)輸出導(dǎo)出到Microsoft Office Word/ LibreOffice Writer文檔中的表
table2office(x = NULL, file = "Rtable", type = c("PPT", "DOC"),append = FALSE, digits = 2, digitspvals = 2, trim.pval = TRUE,width = NULL, height = NULL, offx = 1, offy = 1,font = ifelse(Sys.info()["sysname"] == "Windows", "Arial","Helvetica")[[1]], pointsize = 12, add.rownames = FALSE)
# Create a file namefilen <- "table_aov"# filen <- paste("YOUR_DIR/table_aov")# Generate ANOVA outputfit=aov(yield ~ block + N * P + K, data = https://www.520longzhigu.com/shenghuo/npk) #'npk' dataset from base 'datasets'# Save ANOVA table as a PPT### Option 1: pass output as objectx=summary(fit)table2ppt(x=x,file=filen, digits = 1, digitspvals = 3, add.rownames =TRUE)### Option 2: get output from consolesummary(fit)table2ppt(x=x,file=filen, width=5, font="Times New Roman", pointsize=14, digits=4, digitspvals=1, append=TRUE, add.rownames =TRUE) # append table to previous slide# Save ANOVA table as a DOC filetable2doc(x=x,file=filen, digits = 1, digitspvals = 3, add.rownames =TRUE)summary(fit)table2doc(file=filen, width=3.5, font="Times New Roman", pointsize=14, digits=4, digitspvals=1, append=TRUE, add.rownames =TRUE) # append table at end of document
將表格數(shù)據(jù)導(dǎo)出到ppt和word中:
table2textable2html: 導(dǎo)出統(tǒng)計(jì)輸出到HTML表 。
table2tex(x = NULL, file = "Rtable", type = "TEX", digits = 2,digitspvals = 2, trim.pval = TRUE, summary = FALSE, standAlone = TRUE,add.rownames = FALSE, ...)
summary:是否匯總數(shù)據(jù)文件 。
standAlone:導(dǎo)出的Latex代碼應(yīng)該是獨(dú)立可編譯的,還是應(yīng)該粘貼到另一個(gè)文檔中 。
add.rownames:是否應(yīng)該將行名添加到表中(在第一列之前插入一列) 。
# Create a file namefilen <- tempfile(pattern = "table_aov") # or# filen <- paste("YOUR_DIR/table_aov")# Generate ANOVA outputfit=aov(yield ~ block + N * P + K, data = https://www.520longzhigu.com/shenghuo/npk) #'npk' dataset from base 'datasets'x=summary(fit)# Export to Latex in standAlone formattable2tex(x=x,file=filen,add.rownames = TRUE)# Export to Latex to paste in tex documentsummary(fit) # get output from the consoletable2tex(file=filen, standAlone = FALSE,add.rownames = TRUE)# Export to HTMLtable2html(x=x,file=filen) # orsummary(fit) # get output from the consoletable2html(file=filen,add.rownames = TRUE)
導(dǎo)出到html或tex中的表格數(shù)據(jù):
R統(tǒng)計(jì)和作圖
- Graphpad,經(jīng)典繪圖工具初學(xué)初探
- 維恩(Venn)圖繪制工具大全 (在線+R包)
- 在R中贊揚(yáng)下努力工作的你,獎(jiǎng)勵(lì)一份CheatShet
以上關(guān)于本文的內(nèi)容,僅作參考!溫馨提示:如遇健康、疾病相關(guān)的問題,請您及時(shí)就醫(yī)或請專業(yè)人士給予相關(guān)指導(dǎo)!
「愛刨根生活網(wǎng)」www.malaban59.cn小編還為您精選了以下內(nèi)容,希望對您有所幫助:- PDF轉(zhuǎn)換成Excel的方法 PDF如何轉(zhuǎn)換成EXCEL
- 南方立秋吃什么 立秋養(yǎng)生吃什么好
- 如何防蚊蟲叮咬 夏天防蚊蟲的方法
- 秋冬季如何養(yǎng)生 秋冬季健康養(yǎng)生方法
- 夏季如何養(yǎng)生 夏季養(yǎng)生飲食小常識(shí)
- 冬季御寒措施 冬季如何保暖御寒
- 天冷吃什么食物好 什么茶適合天冷喝
- 圖文 屬鼠都是怎么看待抑郁癥患者的
- 圖文 關(guān)燈后 屬鼠女生最喜歡跟男友聊什么
- 圖文 最讓屬鼠在生活中感覺到驕傲的時(shí)候
