gpt4 book ai didi

r - 如何在R中进行scp?

转载 作者:太空宇宙 更新时间:2023-11-04 05:17:21 24 4
gpt4 key购买 nike

我想知道是否 scp像:

scp localmachine/path_to_the_file username@server_ip:/path_to_remote_directory

可以使用 R 代码吗?换句话说,要在 R 的本地计算机中复制文件,可以使用 file.copy ,R 将文件从本地计算机复制到远程计算机的可能性有哪些?

最佳答案

有包裹ssh.utils它将 ssh 命令包装在 R 函数中。

所以你的例子将变成:

library(ssh.utils)
cp.remote(remote.src = "",
remote.dest = "username@server_ip",
path.src = "localmachine/path_to_the_file",
path.dest = "path_to_remote_directory")

编辑:我可以安装它,但无论如何它不是很灵活,因为它不接受选项...

使用系统命令,这只是:

system("scp localmachine/path_to_the_file username@server_ip:/path_to_remote_directory")

关于r - 如何在R中进行scp?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47331959/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com