全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
6551 5
2014-02-05
悬赏 100 个论坛币 已解决
shangzheng.xlsx
大小:(73.91 KB)

 马上下载


上面是数据文件。
代码:
复制代码
结果:
TT截图未命名.jpg


我尝试另存为2003excel文件,打开时,提示:
Error in make.names(col.names, unique = TRUE) :
  invalid multibyte string 1
In addition: Warning message:
In read.table("shangzheng.xls", header = T) :
  incomplete final line found by readTableHeader on 'shangzheng.xls'

最佳答案

kaifengedu 查看完整内容

建议使用xlsx包。输出为:
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2014-2-5 19:15:46
建议使用xlsx包。
复制代码
输出为:
复制代码
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-2-5 20:45:06
1. Save Excel files into text
Saving Excel files into CSV can be done directly from Excel or through some external tools that allows batch operations. Native R functions for text data import can so be used.
复制代码
2. Copy and paste from Excel to R
This is a fast solutions, but it has one main drawbacks: it requires to open Excel file, select data and copy. By the way, this is the best compromise when you're in a hurry.
复制代码
3. ODBC connection
复制代码
4. gdata package
复制代码
5. xlsReadWrite package
复制代码
6. XLConnect package
复制代码
7.xlsx package
复制代码
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-2-5 20:54:22
kaifengedu 发表于 2014-2-5 19:15
建议使用xlsx包。输出为:
非常感谢!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-2-5 21:17:50
耕耘使者 发表于 2014-2-5 20:54
非常感谢!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-2-5 23:25:58
dxystata 发表于 2014-2-5 20:45
1. Save Excel files into text
Saving Excel files into CSV can be done directly from Excel or throug ...
精彩!
多谢兄弟!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群