网站首页 / 育儿 / 正文

r语言读取excel数据(r语言对excel数据的分析)

时间:2022-04-13 06:40:03 浏览:7097次 作者:用户投稿 【我要投诉/侵权/举报 删除信息】

R语言中有很多读取Excel文件的Package,如RODBC、xlsx、gdata、xlsReadWrite等,但都有很多缺点(依赖Java,依赖操作系统,列数限制、效率等等),而下面要介绍的两个包可以完美地解决这些问题。

知识点 openxlsx: simplifies the the process of writing and styling Excel xlsx files from R and removes the dependency on Java.readxl: Read Excel Files. Works on Windows, Mac and Linux without external dependencies.包安装 install.packages("openxlsx")install.packages("readxl")Read Excel file # readxl 自带的excel文件xls_file <- readxl::readxl_example("datasets.xls")xlsx_file <- readxl::readxl_example("datasets.xlsx")readxl::read_xls(xls_file)readxl::read_xlsx(xlsx_file)openxlsx::read.xlsx(xlsx_file)Write Excel file xlsx_file <- readxl::readxl_example("datasets.xlsx")df <- openxlsx::read.xlsx(xlsx_file)openxlsx::write.xlsx(df, file = "datasets.xlsx")Edit Excel file

openxlsx 具有以下功能:

操作 WorkSheet操作 Cell & Style插入图片函数设置行高、列宽格式化等等Reference https://ycphs.github.io/openxlsx/index.htmlhttps://readxl.tidyverse.org/
版权声明:
本文内容由互联网用户自发贡献,该文观点仅代表作者本人,因此内容不代表本站观点、本站不对文章中的任何观点负责,内容版权归原作者所有、内容只用于提供信息阅读,无任何商业用途。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站(文章、内容、图片、音频、视频)有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至353049283@qq.com举报,一经查实,本站将立刻删除、维护您的正当权益。