![](/img/trans.png)
[英]Read specific columns starting from certain rows from excel file using readxl package in R
[英]Import specific sheets and specific rows and specific columns from Excel file from readxl package in R
我有一个带有多个工作表的Excel文件(xls和xlsx格式)。 我已经在R中安装了readxl程序包。我尝试使用以下代码将特定的工作表,特定的行导入列,但出现错误
install.packages("readxl")
library("readxl")
sam1 <- read_excel("File1","Sheet1",rowIndex = 6:8,colIndex = 1:13)
read_excel(“ File1”,“ Sheet1”,rowIndex = 6:8,中的错误:未使用的参数(rowIndex = 6:8,colIndex = 1:13)
我们可以解决这个问题吗?
您可能会readxl
软件包与xlsx
软件包一起使用。 它们都具有带有不同自变量tho的read_xlsx()
函数。
您可以使用xlsx
软件包获得所需的结果。 您只需要安装软件包:
install.packages("xlsx")
library("xlsx")
sam1 <- read_excel("File1", "Sheet1", rowIndex = 6:8, colIndex = 1:13)
要么
sam1 <- xlsx::read_excel("File1", "Sheet1", rowIndex = 6:8, colIndex = 1:13)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.