作者psinqoo (零度空间)
看板R_Language
标题[问题] t() 转秩後问题
时间Mon Feb 2 09:21:16 2015
- 问题: 当你想要问问题时,请使用这个类别
[问题类型]:
程式谘询(我想用R 做某件事情,但是我不知道要怎麽用R 写出来)
[软体熟悉度]:
请把以下不需要的部份删除
使用者(已经有用R 做过不少作品)
[问题叙述]:
请简略描述你所要做的事情,或是这个程式的目的
我想问
一般我到资料都是 长这样的.csv
txt1 ALICE... 2015/01/02
txt2 asking... 2015/01/04
txt3 people.. 2015/01/13
. . .
. . .
. . .
但是资料很大 一转秩後 EXCEL 就打不开
txt1 txt2 txt3 . . . .
ALICE.. askainq.... people....XX
2015/01/02 2015/01/04 2015/01/13
做完 text mining 後
主要我拉出关键字後,到文章後
ex转秩後,去比对原文章後,日期那栏无法带出
ex转秩後 EXCEL 打得开 日期带得出
但是如果ex 资料量太大时 转秩後 打不开
日期那栏就 GG了~~
library(xlsx)
ex<-read.xlsx(file.choose(),2)
ex<-t(ex)
health<-grep("health", f8)
write.csv(ex[health],file="health.csv")
[程式范例]:
f1<-read.csv(file.choose(),sep=",")
f1<-t(f1)
f2 <- Corpus(VectorSource(f1))
#one<- tm_map(one, PlainTextDocument)
f3<- tm_map(f2, removePunctuation)
f4 <- tm_map(f3, removeNumbers)
f5 <- tm_map(f4, tolower)
f6 <- tm_map(f5, removePunctuation)
f7 <- tm_map(f6, removeWords, stopwords("english"))
f8<-tm_map(f7, stemDocument)
library(xlsx)
ex<-read.xlsx(file.choose(),2)
health<-grep("health", f8)
write.csv(ex[health],file="health.csv")
[关键字]:
t()
选择性,也许未来有用
--
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 122.116.187.182
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/R_Language/M.1422840082.A.EA7.html
1F:推 Carollax: excel限制的column数印象只有不到两万 02/02 10:08
2F:→ psinqoo: 是的很糟糕,过两万我就GG了,有克服方式可以交流吗? 02/02 10:09
3F:→ psinqoo: 奉上一餐交流 ^^ 02/02 10:10
4F:→ Carollax: 请问有什麽需求非得用excel打开吗? 02/02 10:11
因为我用 grep f8 去对应位址 txtX
然後在ex 要去对应位址取出 日期
其实ex与f1是相同的 只是ex多了日期这项
health<-grep("health", f8)
write.csv(ex[health],file="health.csv")
※ 编辑: psinqoo (122.116.187.182), 02/02/2015 12:19:34