如何将受密码保护的Excel文件读入R中? [英] How do you read a password protected excel file into r?

查看:311
本文介绍了如何将受密码保护的Excel文件读入R中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将受密码保护的Excel文件读入r?

How do you read a password protected excel file into r?

我尝试了excel.link,但不适用于R版本3.2.3(我的版本)

I have tried excel.link but its not available for R version 3.2.3 (My version)

我也尝试了RDCOMClient,但它也不适用于R版本3.2.3

I also tried RDCOMClient but it is also not available for R version 3.2.3

推荐答案

我只是从excel.link包中使用了xl.read.file.

https://rdrr.io/cran/excel.链接/man/xl.read.file.html

那很简单.

使用上一个答案中的相同测试文件( https://github. com/miraisolutions/xlconnect/files/794219/TestWorkbook.xlsx ).

Using the same test file from the previous answer (https://github.com/miraisolutions/xlconnect/files/794219/TestWorkbook.xlsx).

install.packages("excel.link")

library("excel.link")

dat <- xl.read.file("TestWorkbook.xlsx", password = "pass", write.res.password="pass")

dat

(与测试文件不同,我需要的文件只有一个密码,因此我不需要最后一个参数.)

(The file I needed only had one password, unlike the test file, so I didn't need the last argument for my use.)

这篇关于如何将受密码保护的Excel文件读入R中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆