Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
509 views
in Technique[技术] by (71.8m points)

r - How to load xlsx file using fread function?

I wanted to use fread function to load all the datasets as I think it would better to use one type of import function so I just sticked to the fread.

Few of my files are in xlsx format and I was saving them to csv format and then using the fread function was trying to load the datasets.

But I noticed that when I converted the xlsx files into csv, an empty or incomplete row was being created in the newly created csv files.

Is there a way I can resolve this issue? Can I load xlsx file somehow using the fread function rather than converting it to csv file and then loading it using the fread function?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Here's how: Using command line tools directly in conjunction with csvkit like this

my.dt<-fread('in2csv my.xls')

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...