readxl包括多个可以读取excel的函数,不需要与包“xlsx"中的read.xlsx()函数一样去调用java ("xlsx" 应用是需同时安装"xlsxjars","rJava")
例如readxl包的函数read_xlsx()读xlsx
sheet1=read_xlsx("Cici.xlsx",sheet = 1)
> sheet1
# A tibble: 1 x 3
A B C
<dbl> <dbl> <dbl>
1 1. 2. 3.
第二个sheet2
sheet2=read_xlsx("Cici.xlsx",sheet = 2)
> sheet2
# A tibble: 1 x 3
a b c
<dbl> <dbl> <dbl>
1 3. 2. 1.
readxl包的函数read_xls()读xls
sheet1=read_xls("data.xls",sheet = 1)
> sheet1
# A tibble: 1 x 3
A B C
<dbl> <dbl> <dbl>
1 1. 2. 3.
以及readxl包的read_excel()函数读xls和xlsx
read_excel("data.xls",sheet = 1)
# A tibble: 1 x 3
A B C
<dbl> <dbl> <dbl>
1 1. 2. 3.
read_excel("Cici.xlsx",sheet = 2)
# A tibble: 1 x 3
a b c
<dbl> <dbl> <dbl>
1 3. 2. 1.
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!