R 路径参数中的 write_xlsx 函数
我在 R 中有一个脚本可以进行一些计算。最后,结果存储在像这样的数据框中。
n= 10
x= rnorm(n)
t = seq(1:n)
d = data.frame(t,x);d
我想将此脚本发送给许多人,其中一些人有 Mac,另一些人有 Windows,其中一些人有 Linux,运行脚本并将输出作为桌面上的 xlsx 格式文件。我知道如何使用函数 write_xlsx()
从 writexl
库到我自己的桌面。但是任何人如何才能运行该脚本并在其桌面上导出 xlsx 文件呢?
可能是这样的:
write_xlsx(d,path = "my question")
但我不知道怎么做。有什么帮助吗?
I have a script in R that does some calculations.At the end the results are stored in a data frame like this one.
n= 10
x= rnorm(n)
t = seq(1:n)
d = data.frame(t,x);d
I want to send this script to many people which some of have Mac others have windows and some of them linux, run the script and the output to be a xlsx format file in their desktop.I know how to do it with the function write_xlsx()
from writexl
library to my own desktop.But how anyone can run the script and the xlsx file to be exported in their desktop ?
Might be something like :
write_xlsx(d,path = "my question")
but I don't know how.Any help ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 writexl 包来实现它:
You can achieve it using writexl package: