Sono completamente nuovo nel pacchetto R e tm, quindi scusate la mia stupida domanda ;-) Come posso mostrare il testo di un corpus di testo normale nel pacchetto R tm?Come mostrare il testo del corpus nel pacchetto R tm?
Ho caricato un corpus di 323 file di testo in un corpus:
src <- DirSource("Korpora/technologie")
corpus <- Corpus(src)
Ma quando chiamo il corpus con:
corpus[[1]]
ottengo sempre un po 'di output come questo, invece di il testo corpus stesso:
<<PlainTextDocument>>
Metadata: 7
Content: chars: 144
Content: chars: 141
Content: chars: 224
Content: chars: 75
Content: chars: 105
Come è possibile visualizzare il testo del corpus?
Grazie!
UPDATE campione riproducibile: ho provato con il built-in testo di esempio:
> 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
Come posso stampare il testo dei documenti?
UPDATE 2: informazioni di sessione:
> 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
Benvenuti in SO. Fornire un esempio riproducibile minimo: http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – lukeA