我想在R中使用密码进行压缩压缩

时间:2016-10-18 15:47:50

标签: r zip gzip

我想用R中的默认密码编程来加密这个文件。我该怎么办?

zip("C:/Users/user/Downloads/myarchive.zip", 
    files="C:/Users/user/Downloads/example.txt", 
    flags = "-r9X")

谢谢!!!

1 个答案:

答案 0 :(得分:0)

PASSWORD <- "BillMurray"

zip("C:/Users/user/Downloads/myarchive.zip", 
    files="C:/Users/user/Downloads/example.txt", 
    flags = paste("--password", PASSWORD))