Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有两张表 A 和 B 的 excel 文件。我只需要从表 B 上传和使用 Rstudio 中的数据。 我怎样才能做到这一点?
我将文件导入rstudio并写了这个: dat <- read_excel ("multi_anova.xlsx")
dat <- read_excel ("multi_anova.xlsx")
但是当我尝试使用数据时(dat$id),它给了我所有 excels 的文件 id,而不仅仅是 B 表。
(dat$id)
如何获取 B 表的 ID?
在函数中指定要从中读取数据的工作表名称read_excel-
read_excel
dat <- read_excel("multi_anova.xlsx", sheet = "B") dat$id
我们可以read.xlsx使用openxlsx
read.xlsx
openxlsx
library(openxlsx) dat <- read.xlsx("multi_anova.xlsx", sheet = "B") dat$id