请,我有这个数据框,我想导出它在Excel“.xls”文件格式。
df1 <- data.frame(sales_value = c(532489, 20000, 32111, 407536),
name = c("John", "Jane", "Jim", "Joan"))
我试过这个代码。
write.table(df1, file = "df1.xls", row.names = FALSE, sep = "\t")
但它包括销售价值中不需要的小数。
我试了下面的代码。
write.xlsx(df1, "df.xls")
But the output exported excel file was internally a .xlsx file format.
Please is there any other way of doing it?
1条答案
按热度按时间ldioqlga1#
可以考虑以下方法。此方法仅适用于Windows。