[R] how to export output

Rui Barradas ruipbarradas at sapo.pt
Thu Jun 14 15:40:49 CEST 2012


Hello,

Try

sink("sentiment.txt")
classify_polarity(...etc...)
sink()


If this doesn't do it see

?capture.output

Hope this helps,

Rui Barradas

Em 14-06-2012 09:13, raishilpa escreveu:
> hello,
> I am using following command
>
> classify_polarity(documents,algorithm="bayes",verbose=TRUE)
>   output is:
> [1] "DOCUMENT 1"
> [1] "WORD: excited CAT: positive POL: strongsubj SCORE: 8.44419229853175"
> [1] "WORD: happy CAT: positive POL: strongsubj SCORE: 8.44419229853175"
> [1] "WORD: optimistic CAT: positive POL: weaksubj SCORE: 7.7510451179718"
> [1] "POS: 25.670707456461 NEG: 0.445453222112551 RATIO: 57.6282899800754"
>
> [1] "DOCUMENT 2"
> [1] "WORD: annoyed CAT: negative POL: strongsubj SCORE: 9.0300168178449"
> [1] "WORD: irritated CAT: negative POL: strongsubj SCORE: 9.0300168178449"
> [1] "WORD: scared CAT: negative POL: strongsubj SCORE: 9.0300168178449"
> [1] "POS: 1.03127774142571 NEG: 27.5355036756473 RATIO: 0.0374526557993482"
>
>       POS                NEG                 POS/NEG              BEST_FIT
> [1,] "25.670707456461"  "0.445453222112551" "57.6282899800754"   "positive"
> [2,] "1.03127774142571" "27.5355036756473"  "0.0374526557993482" "negative"
>
> I want to export this output...what I am using is that
> write.csv(documents,file="sentiment.csv")
>
> but I am getting only following part
>       POS                NEG                 POS/NEG              BEST_FIT
> [1,] "25.670707456461"  "0.445453222112551" "57.6282899800754"   "positive"
> [2,] "1.03127774142571" "27.5355036756473"  "0.0374526557993482" "negative"
>
> I want to export whole output....Can anybody help me in this regard
>
> thanks in advance
>
> Shilpa Rai
>
> --
> View this message in context: http://r.789695.n4.nabble.com/how-to-export-output-tp4633341.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list