本文介绍了读取PSV(管道分隔)文件或字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚收到一个数据文件,其扩展名为"* .psv".经过一些研究,我不知道如何打开它.

I have just received a data file, whose extension is "*.psv". After doing a bit of research, I don't know how to open it R.

推荐答案

感谢hrbrmstr,我找到了答案.我们可以使用read.csv来读取* .psv文件.

Thanks to hrbrmstr, I found the answer. We could use read.csv to read *.psv file.

read.csv("myfile.psv", sep = "|", header = FALSE, stringsAsFactors = FALSE)

psv文件可能有很多不同的表示形式,但是当涉及到数据挖掘时,我认为它可能更多地与管道分离"文件有关.文件中的数据用"|"分隔

There might be many different representations of psv file, but when it comes to data mining, I think it might be more about "pipe separated" file. The data in the file is separated by "|"

这篇关于读取PSV(管道分隔)文件或字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 15:37