r - function tm::tm_map encounter an error -
i have vcorpus
"oanc" , want change words lower case, use following function
oanc1 <- tm_map(oanc, content_transformer(tolower))
but got warning:
warning message: in mclapply(content(x), fun, ...) : scheduled cores 2 encountered errors in user code, values of jobs affected
the vcorpus
"oanc" of size 586mb while "oanc1" 4mb. in addition, contents, except first text, broken, , when run
writelines(as.character(oanc1[[2]]))
i got
error in fun(content(x), ...) : invalid input 'o<8c><be>bĭĪ<e2>=<f3><81>̡@>9<c2>au<b7>l<99><c5>u <c4>%<a0>[,<9c><93><b8><90>w<b7><97><f7>58<e3><d7>><91><bf>"~wd<cf>2<c3><84>1gq<dd><ed>ـ\<e2><fb><f3><d3>x]<fe>5t!<9f><89>ٍdh<e3><d6>zu<bc><e8><b6>_rs<f0><f7><81><eb>e<f0><bd>Ԗ2o<b4>g<a7><b9><d2><fc><8a><f2><89>3<a8>ؗ<d6><c0>.w,<l<b7>}<f8>j<8f><f1><f1>����{p<94><a3>x<9e><89><da>e'<8c><ca>}y<d1><ca>v<f7>v<c3>>s^`<9e><86><f1><b1>e<b8>)<cd>ꅹ<e5><ab><<80><eb><8e>z<d0>}<a3>c<86>(%r<86><f4><e3>i*<da>i v{<94>'<f6>i<f6><a7>{dh<d0>jg۾wo<dd>?<<f7>i<c5>c<84>g<dc>3<bb>-e<e9>l<b1><b6>xg<f5>f<81><97><b1><e5><de>ln<b1><d6><f5><f6><90> DŽ<b2>/j<fc><d9>{£<83><f1><c5>;n7<bb>ɰeg<a9><b0><87>!<b5>5]9<b9><e6><fe>_q<aa>u<a8><c0><cf>,<d9><dc>wܒ<ba>ɑ<f1>q<c9>:r<e4><b4><ea>w<be>pcb' in 'utf8towcs'
does 1 can me? operating system ubuntu 14.04lts, , r version 3.2.0
first, make sure text encoded in utf-8 (if can open file in text editor should able modify encoding when save it). if doesn't fix problem, try adding argument "mc.cores = 1" tm_map function.
Comments
Post a Comment