Tôi hoàn toàn mới trong gói R và tm, vì vậy hãy giải thích câu hỏi ngu ngốc của tôi ;-) Làm cách nào để hiển thị văn bản của một văn bản thuần trong gói R tm?Cách hiển thị văn bản văn bản trong gói R tm?
Tôi đã tải một corpus với 323 tập tin văn bản đơn giản trong một corpus:
src <- DirSource("Korpora/technologie")
corpus <- Corpus(src)
Nhưng khi tôi gọi là corpus với:
corpus[[1]]
tôi luôn luôn nhận được một số kết quả như thế này thay vì bản thân văn bản chính:
<<PlainTextDocument>>
Metadata: 7
Content: chars: 144
Content: chars: 141
Content: chars: 224
Content: chars: 75
Content: chars: 105
Làm cách nào để hiển thị văn bản của kho văn bản?
Cảm ơn!
CẬP NHẬT mẫu tái sản xuất: Tôi đã thử nó với built-in văn bản mẫu:
> data("crude")
> crude
<<VCorpus>>
Metadata: corpus specific: 0, document level (indexed): 0
Content: documents: 20
> crude[1]
<<VCorpus>>
Metadata: corpus specific: 0, document level (indexed): 0
Content: documents: 1
> crude[[1]]
<<PlainTextDocument>>
Metadata: 15
Content: chars: 527
Làm thế nào tôi có thể in nội dung của văn bản?
UPDATE 2: phiên Info:
> sessionInfo()
R version 3.1.3 (2015-03-09)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] tm_0.6-1 NLP_0.1-7
loaded via a namespace (and not attached):
[1] parallel_3.1.3 slam_0.1-32 tools_3.1.3
Chào mừng bạn đến với SO. Vui lòng cung cấp ví dụ có thể tái sản xuất tối thiểu: http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – lukeA