简体   繁体   English

使用 openxlsx 将 Excel 数据导入 R:文件中的错误(con,“r”):无效的“描述”参数

[英]Import Excel data into R using openxlsx: Error in file(con, "r") : invalid 'description' argument

I am trying to import the data in my Excel file into R using Openxlsx library:我正在尝试使用 Openxlsx 库将 Excel 文件中的数据导入 R :

library(openxlsx)
data <- read.xlsx("datafile.xlsx", sheet = "Sheet1")

However, I get the following error:但是,我收到以下错误:

Error in file(con, "r") : invalid 'description' argument
In addition: Warning message:
In unzip(xlsxFile, exdir = xmlDir) : error 1 in extracting from zip file

This error is thrown because your Excel file is open.抛出此错误是因为您的 Excel 文件已打开。 Save and close the Excel file and try again, it will work.保存并关闭 Excel 文件并重试,它会工作。

Error is also returned when file is password-protected文件受密码保护时也会返回错误

I'm currently having this issue, but I have confirmed (multiple times) that the files of interest are closed.我目前遇到此问题,但我已(多次)确认感兴趣的文件已关闭。 I have also restarted my computer.我也重新启动了我的电脑。 Any ideas about what could be causing this besides an open file?除了打开的文件之外,关于什么可能导致此问题的任何想法?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 R Openxlsx 包(版本 4.2.2)-文件错误(描述 = xlsxFile):“描述”参数无效 - R Openxlsx package (version 4.2.2) - Error in file(description = xlsxFile) : invalid 'description' argument R闪亮:文件错误(文件,“ rt”):无效的“描述”参数 - R shiny: Error in file(file, “rt”) : invalid 'description' argument 在R中使用“ xlsx”和“ openxlsx”包导出Excel文件时发生冲突 - Clash when exporting excel file using “xlsx” and “openxlsx” packages in R 在R中使用openxlsx包读取多个Excel工作表时出错 - Error Reading Multiple Excel Sheets Using openxlsx package in R 使用 openxlsx 导出 R 数据框时出错(“zipr 中的错误”) - Error when exporting R data frame using openxlsx ("Error in zipr") R openxlsx Excel导出:XML错误 - R openxlsx Excel Export: XML Error 在R中安装网格:“错误:无效的Description文件” - Installing lattice in R: “Error : Invalid DESCRIPTION file” R:使用openxlsx将数据导出为“文本” - R: Export data as “text” using openxlsx 我在使用包 openxlsx 从 R 将图像粘贴到 Excel 中时遇到错误 - I am facing error in pasting an image in Excel from R using package openxlsx 使用 openxlsx 在 R 中使用 write.xlsx 创建的 Excel 文件的密码保护 - Password protecting an Excel file created using write.xlsx in R with openxlsx
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM