Hi everybody, How can I get text from RScript (e.g. syntax, reminder) into the result text. Sink() does not do that - I only read the results and therefore I have to 'guess' which syntax was used where - reminders I wrote are lost. Bw and thank you in advance, Roberto [[alternative HTML version deleted]]
Dear Roberto, The easiest way IMHO is to convert your script into an R markdown document. See https://rmarkdown.rstudio.com/ Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance thierry.onkelinx at inbo.be Havenlaan 88 bus 73, 1000 Brussel www.inbo.be /////////////////////////////////////////////////////////////////////////////////////////// To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey /////////////////////////////////////////////////////////////////////////////////////////// 2018-04-24 11:23 GMT+02:00 P. Roberto Bakker <robertobakker at gmail.com>:> Hi everybody, > > How can I get text from RScript (e.g. syntax, reminder) into the result > text. > Sink() does not do that - I only read the results and therefore I have to > 'guess' which syntax was used where - reminders I wrote are lost. > > Bw and thank you in advance, > > Roberto > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.
Look at the spin and stitch functions in the knitr package if you want to process an existing script into an output that mixes the code run with the output. Look at the txtStart and related functions in the TeachingDemos package if you want the code and output saved in a file from a session where you are typing in commands. If in general you want text, code, and output mixed, learn the knitr and/or rmarkdown packages for how to write a file that can be processed into a report. Also consider learning about RStudio notebook documents where you can have the output mixed into the "script" file. On Tue, Apr 24, 2018 at 3:23 AM, P. Roberto Bakker <robertobakker at gmail.com> wrote:> Hi everybody, > > How can I get text from RScript (e.g. syntax, reminder) into the result > text. > Sink() does not do that - I only read the results and therefore I have to > 'guess' which syntax was used where - reminders I wrote are lost. > > Bw and thank you in advance, > > Roberto > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.-- Gregory (Greg) L. Snow Ph.D. 538280 at gmail.com
Hi Thierry, Thank you for your information. Bw Roberto Op di 24 apr. 2018 12:01 schreef Thierry Onkelinx <thierry.onkelinx at inbo.be>:> Dear Roberto, > > The easiest way IMHO is to convert your script into an R markdown > document. See https://rmarkdown.rstudio.com/ > > Best regards, > > ir. Thierry Onkelinx > Statisticus / Statistician > > Vlaamse Overheid / Government of Flanders > INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE > AND FOREST > Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance > thierry.onkelinx at inbo.be > Havenlaan 88 bus 73, 1000 Brussel > www.inbo.be > > > /////////////////////////////////////////////////////////////////////////////////////////// > To call in the statistician after the experiment is done may be no > more than asking him to perform a post-mortem examination: he may be > able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher > The plural of anecdote is not data. ~ Roger Brinner > The combination of some data and an aching desire for an answer does > not ensure that a reasonable answer can be extracted from a given body > of data. ~ John Tukey > > /////////////////////////////////////////////////////////////////////////////////////////// > > > > > 2018-04-24 11:23 GMT+02:00 P. Roberto Bakker <robertobakker at gmail.com>: > > Hi everybody, > > > > How can I get text from RScript (e.g. syntax, reminder) into the result > > text. > > Sink() does not do that - I only read the results and therefore I have to > > 'guess' which syntax was used where - reminders I wrote are lost. > > > > Bw and thank you in advance, > > > > Roberto > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > > 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. >[[alternative HTML version deleted]]
Hi Greg, Thank you for all information. Bw Roberto Op di 24 apr. 2018 21:42 schreef Greg Snow <538280 at gmail.com>:> Look at the spin and stitch functions in the knitr package if you want > to process an existing script into an output that mixes the code run > with the output. > > Look at the txtStart and related functions in the TeachingDemos > package if you want the code and output saved in a file from a session > where you are typing in commands. > > If in general you want text, code, and output mixed, learn the knitr > and/or rmarkdown packages for how to write a file that can be > processed into a report. Also consider learning about RStudio > notebook documents where you can have the output mixed into the > "script" file. > > On Tue, Apr 24, 2018 at 3:23 AM, P. Roberto Bakker > <robertobakker at gmail.com> wrote: > > Hi everybody, > > > > How can I get text from RScript (e.g. syntax, reminder) into the result > > text. > > Sink() does not do that - I only read the results and therefore I have to > > 'guess' which syntax was used where - reminders I wrote are lost. > > > > Bw and thank you in advance, > > > > Roberto > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > > 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. > > > > -- > Gregory (Greg) L. Snow Ph.D. > 538280 at gmail.com >[[alternative HTML version deleted]]
Try putting this options(echo=TRUE) at the beginning of your script See ?source for a clue -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 ?On 4/24/18, 2:23 AM, "R-help on behalf of P. Roberto Bakker" <r-help-bounces at r-project.org on behalf of robertobakker at gmail.com> wrote: Hi everybody, How can I get text from RScript (e.g. syntax, reminder) into the result text. Sink() does not do that - I only read the results and therefore I have to 'guess' which syntax was used where - reminders I wrote are lost. Bw and thank you in advance, Roberto [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
Dear Don, Thank you for your information. Bw Roberto 2018-04-25 23:13 GMT+02:00 MacQueen, Don <macqueen1 at llnl.gov>:> Try putting this > options(echo=TRUE) > at the beginning of your script > > See ?source for a clue > > -Don > > -- > Don MacQueen > Lawrence Livermore National Laboratory > 7000 East Ave., L-627 > Livermore, CA 94550 > 925-423-1062 > Lab cell 925-724-7509 > > > ?On 4/24/18, 2:23 AM, "R-help on behalf of P. Roberto Bakker" < > r-help-bounces at r-project.org on behalf of robertobakker at gmail.com> wrote: > > Hi everybody, > > How can I get text from RScript (e.g. syntax, reminder) into the result > text. > Sink() does not do that - I only read the results and therefore I have > to > 'guess' which syntax was used where - reminders I wrote are lost. > > Bw and thank you in advance, > > Roberto > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. > > >[[alternative HTML version deleted]]