简体   繁体   English

将数据从R导出到Excel

[英]Export data from R into Excel

I'm trying to export some results obtained from R into Excel unsuccesfully. 我试图将从R获得的一些结果导出到Excel失败。 I have tried the following codes: 我尝试了以下代码:

write.table(ALBERTA1, "D:/ALBERTA1.txt", sep="\t")
write.csv(ALBERTA1,":\ALBERTA1.csv")
your_filename_in_R = read.csv("ALBERTA1.csv")
your_filename_in_R = read.csv("ALBERTA1.csv")
write.csv(df, file = "ALBERTA1.csv")
your_filename_in_R = read.csv("ALBERTA1.csv")
write.csv(ALBERTA1, "ALBERTA1.csv")
write.table(ALBERTA1, 'clipboard', sep='\t')
write.table(ALBERTA1,"ALBERTA1.txt")
write.table(as.matrix(ALBERTA2),"ALBERTA2.txt")
write.table(as.matrix(vecm.pred$fcst$Alberta_Females[,1]),"vecm.pred$fcst$Alberta_Females[,1].txt")
write.table(as.matrix(foo),"foo.txt")
write.xlsx(ALBERTA2, "/ALBERTA2.xlsx")
write.table(ALBERTA1, "D:/ALBERTA1.txt", sep="\t").

But my data from excel file is still messed up togheter and consequently i can't operate any computations. 但是我的excel文件中的数据仍然混乱不堪,因此我无法进行任何计算。 the two data are inside the same colums. 这两个数据位于同一列中。 the Please can you suggest me some other functions? 请您能建议我一些其他功能吗? 在此处输入图片说明

What I did to manage the CSV data in Excel: 我在Excel中管理CSV数据所做的工作:

  1. In excel find "Data" in the top Menu 在excel中,在顶部菜单中找到“数据”
  2. Choose the "Text to Columns ..." in the middle area of the menu. 在菜单的中间区域选择“文本到列...”。
  3. follow the instruction and then you get the data in columns 按照说明进行操作,然后按列获取数据

https://superuser.com/questions/364555/how-to-break-a-spreadsheet-containing-csv-into-multiple-columns https://superuser.com/questions/364555/how-to-break-a-spreadsheet- contains-csv-into-multiple-columns

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM