{"action":"closed","issue":{"url":"https://api.github.com/repos/qinwf/jiebaR/issues/13","labels_url":"https://api.github.com/repos/qinwf/jiebaR/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/qinwf/jiebaR/issues/13/comments","events_url":"https://api.github.com/repos/qinwf/jiebaR/issues/13/events","html_url":"https://github.com/qinwf/jiebaR/issues/13","id":99116361,"number":13,"title":"distance函数的使用疑问","user":{"login":"zheguzai100","id":7357088,"avatar_url":"https://avatars.githubusercontent.com/u/7357088?v=3","gravatar_id":"","url":"https://api.github.com/users/zheguzai100","html_url":"https://github.com/zheguzai100","followers_url":"https://api.github.com/users/zheguzai100/followers","following_url":"https://api.github.com/users/zheguzai100/following{/other_user}","gists_url":"https://api.github.com/users/zheguzai100/gists{/gist_id}","starred_url":"https://api.github.com/users/zheguzai100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zheguzai100/subscriptions","organizations_url":"https://api.github.com/users/zheguzai100/orgs","repos_url":"https://api.github.com/users/zheguzai100/repos","events_url":"https://api.github.com/users/zheguzai100/events{/privacy}","received_events_url":"https://api.github.com/users/zheguzai100/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-05T04:46:48Z","updated_at":"2015-08-05T04:59:58Z","closed_at":"2015-08-05T04:59:58Z","body":"#### [distest.txt的内容]<h4>\r\n*abd1: 这是第一行吧算是\r\nmmmm2: 我把这个设置成第二行可以吗\r\nsho3: what r you talking about ?!\r\nsdjh4: may i have a word with u ?\r\nwhkshdf5: i wanna talk to u.*\r\n\r\n----------------------------------------------------------\r\n```r \r\ndata=read.table('I:/rwork/cnseg/distest.txt',header=FALSE,encoding='UTF-8',sep=':')\r\nError in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  : \r\n  line 2 did not have 3 elements\r\n\r\n想实现的效果\r\n1.通过read.table读取txt文件为data\r\n2.通过 ‘:’(冒号) 将数据拆分为两列，并通过row.names(data)=data[,1];data=data[,2]\r\n3.通过distance函数计算文本文件内 行与行之间的距离\r\n(经测试distance可以计算两个语句之间or两个文本文件之间的距离，\r\n 但是文本文件内的任意两句之间的距离不知该如何操作)\r\n```"}}