Home  >  Article  >  How to import excel data in R language

How to import excel data in R language

angryTom
angryTomOriginal
2020-02-13 14:46:1439602browse

How to import excel data in R language

R语言怎么导入excel数据

1、首先,导入R语言需要加载xlsx包,没有安装这个包的,请用下面的代码进行在线安装:

install.packages("xlsx")

2、安装好xlsx包后,接下来导入存放在“C:\Users\HWT\Desktop”路径下的“test.xlsx”文件,导入这个文件的代码如下:

library(xlsx)
read.xlsx2(file="C:\\Users\\HWT\\Desktop\\test.xlsx",sheetIndex=1)

How to import excel data in R language

How to import excel data in R language

更多R语言相关知识,请访问PHP中文网

The above is the detailed content of How to import excel data in R language. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn