Skip to content

Newbie R question

17 messages · Tena Sakai, (Ted Harding), Dieter Menne +3 more

#
Tena Sakai wrote:
man R
/quiet

R --slave <<< "cat('foo\n')"
# foo

vQ
#
On 28-Apr-09 20:42:45, Tena Sakai wrote:
An unusual request! I had to browse 'man R' a bit before getting
a hint.

  R --silent --nosave < barebone.R

should do it!
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 28-Apr-09                                       Time: 22:11:23
------------------------------ XFMail ------------------------------
#
Tena Sakai <tsakai <at> gallo.ucsf.edu> writes:
And don't forget 

R --vanilla

which I like most because of the taste.

Dieter
#
Dieter Menne wrote:
once we talk about preferences, here's the version which i like most
because of (a) least typing, (b) the non-pompous little r:

    r <<< "cat('foo\n')"
    # foo

vQ
#
Wacek Kusnierczyk wrote:
... and (c) superior performance (in this particular case):
time (R --silent --no-save <<< "cat('foo\n')")
    # 0.296s

    time (R --quiet --no-save <<< "cat('foo\n')")
    # 0.280s

    time (R --slave <<< "cat('foo\n')")
    # 0.293s

    time (r <<< "cat('foo\n')")
    # 0.055s

vQ
#
Unless you're working on a Mac or Windows (if I'm not mistaken about  
case handling there), where it will just overwrite the standard R  
interpreter. :-(

Cheers,
Just another former non-Mac-user.

[ stefan.evert at uos.de | http://purl.org/stefan.evert ]
#
Tena Sakai wrote:
For the basic 'put text in an html page'

  library(hwriter)
  htmlFile = tempfile()
  hwrite("Hello World", htmlFile)
  browseURL(htmlFile)

for more advanced static pages

  example(hwrite)

Martin
#
Tena Sakai wrote:
sorry, it is me that needs to be clued in. I misread your email; the
example above has nothing to do with Rpad.

And for windows users, satisfying R and firefox (for instance) seems to
require

  htmlFile = file.path(tempdir(), "tmp.html")

and

  browseURL(paste("file://", htmlFile, sep=""))

Martin