R Save a excel workbook with password protection

后端 未结 3 1114
春和景丽
春和景丽 2021-01-14 05:12

I\'m a bit impressed because I couldn\'t find an answer so far.

I have a small R script that is loading data from one source and writing a few dozens Excel files fro

3条回答
  •  礼貌的吻别
    2021-01-14 05:55

    If you have access to a file archiver and can't install rJava, a possible workaround that also works with other output formats is to save the files as usual and then archive them with password protection.

    E.g. using 7-zip:

    setwd("c:/Program Files/7-Zip/")
    pwd <- "123"
    shell(paste0("7z a d:/Data/myfile.zip d:/Data/myfile.xlsx -p", pwd))
    

提交回复
热议问题