An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090428/7810808e/attachment-0001.pl>
Newbie R question
17 messages · Tena Sakai, (Ted Harding), Dieter Menne +3 more
Tena Sakai wrote:
Hi,
I am a newbie with R. My environment is linux and
I have a file. I call it barebone.R, which has one
line:
cat ('Hello World!\n')
I execute this file as:
R --no-save < barebone.R
And it does what I expect. What I get is 20+/- lines
of text, one of which is 'Hello World!'.
How would I go about getting rid of all but the line I
am after, 'Hello World!'?
man R
/quiet
R --slave <<< "cat('foo\n')"
# foo
vQ
On 28-Apr-09 20:42:45, Tena Sakai wrote:
Hi,
I am a newbie with R. My environment is linux and
I have a file. I call it barebone.R, which has one
line:
cat ('Hello World!\n')
I execute this file as:
R --no-save < barebone.R
And it does what I expect. What I get is 20+/- lines
of text, one of which is 'Hello World!'.
How would I go about getting rid of all but the line I
am after, 'Hello World!'?
Regards,
Tena Sakai
tsakai at gallo.ucsf.edu
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 ------------------------------
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090428/10faadcd/attachment-0001.pl>
Tena Sakai <tsakai <at> gallo.ucsf.edu> writes:
I learned 3 new tricks. (Not bad for a newbie?) $ R --silent --no-save < barebone.R $ R --quiet --no-save < barebone.R $ R --slave < barebone.R
And don't forget R --vanilla which I like most because of the taste. Dieter
Dieter Menne wrote:
Tena Sakai <tsakai <at> gallo.ucsf.edu> writes:
I learned 3 new tricks. (Not bad for a newbie?)
$ R --silent --no-save < barebone.R
$ R --quiet --no-save < barebone.R
$ R --slave < barebone.R
And don't forget R --vanilla which I like most because of the taste.
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:
Dieter Menne wrote:
R --vanilla
which I like most because of the taste.
once we talk about preferences, here's the version which i like most because of (a) least typing, (b) the non-pompous little r:
... and (c) superior performance (in this particular case):
r <<< "cat('foo\n')"
# foo
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
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090429/290d4f12/attachment-0001.pl>
Tena Sakai wrote:
Hi, That's pretty impressive performance, but wait. Where does this little r come from? And how does it differ from its big brother?
the little r comes from littler [1]. it doesn't claim to be larger than it is. [1] http://dirk.eddelbuettel.com/code/littler.html
the little r comes from littler [1]. it doesn't claim to be larger than it is. [1] http://dirk.eddelbuettel.com/code/littler.html
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:
Hi,
Many thanks to Wacek Kusnierczyk and Ted Harding.
I learned 3 new tricks. (Not bad for a newbie?)
$ R --silent --no-save < barebone.R
$ R --quiet --no-save < barebone.R
$ R --slave < barebone.R
With slight differences, they all do what I wanted.
Moving right along my tiny agenda...
Given the same one-liner,
cat ('Hello World!\n')
would someone please show me how to turn this one liner
into a web page with Rpad?
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
Obviously, What I want to build is a web page, where it say "click <here>" and when it is clicked the screen blanks out and give a line: Hello World! I have looked at an example or two of Rpad, but it was overly complicated for simpleminded newbie. Regards, Tena Sakai tsakai at gallo.ucsf.edu -----Original Message----- From: Ted.Harding at manchester.ac.uk [mailto:Ted.Harding at manchester.ac.uk] Sent: Tue 4/28/2009 2:11 PM To: r-help at r-project.org Cc: Tena Sakai Subject: RE: [R] Newbie R question On 28-Apr-09 20:42:45, Tena Sakai wrote:
Hi,
I am a newbie with R. My environment is linux and
I have a file. I call it barebone.R, which has one
line:
cat ('Hello World!\n')
I execute this file as:
R --no-save < barebone.R
And it does what I expect. What I get is 20+/- lines
of text, one of which is 'Hello World!'.
How would I go about getting rid of all but the line I
am after, 'Hello World!'?
Regards,
Tena Sakai
tsakai at gallo.ucsf.edu
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 ------------------------------ [[alternative HTML version deleted]]
______________________________________________ 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.
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090429/f11fd792/attachment-0001.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090429/2630116a/attachment-0001.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090429/d0a88226/attachment-0001.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090429/4569b839/attachment-0001.pl>
Tena Sakai wrote:
Hi,
The example given:
library(hwriter)
htmlFile = tempfile()
hwrite("Hello World", htmlFile)
browseURL(htmlFile)
worked. Including the line:
example(hwrite)
which is very nice.
But I am a bit confused. Am I using elements
of Rpad package? Or is this strictly to do
with hwriter package?
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
Please clue me in. Regards, Tena Sakai tsakai at gallo.ucsf.edu -----Original Message----- From: Martin Morgan [mailto:mtmorgan at fhcrc.org] Sent: Wed 4/29/2009 10:32 AM To: Tena Sakai Cc: ted.harding at manchester.ac.uk; r-help at r-project.org Subject: Re: [R] Newbie R question PART2 Tena Sakai wrote:
Hi,
Many thanks to Wacek Kusnierczyk and Ted Harding.
I learned 3 new tricks. (Not bad for a newbie?)
$ R --silent --no-save < barebone.R
$ R --quiet --no-save < barebone.R
$ R --slave < barebone.R
With slight differences, they all do what I wanted.
Moving right along my tiny agenda...
Given the same one-liner,
cat ('Hello World!\n')
would someone please show me how to turn this one liner
into a web page with Rpad?
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
Obviously, What I want to build is a web page, where it say "click <here>" and when it is clicked the screen blanks out and give a line: Hello World! I have looked at an example or two of Rpad, but it was overly complicated for simpleminded newbie. Regards, Tena Sakai tsakai at gallo.ucsf.edu -----Original Message----- From: Ted.Harding at manchester.ac.uk [mailto:Ted.Harding at manchester.ac.uk] Sent: Tue 4/28/2009 2:11 PM To: r-help at r-project.org Cc: Tena Sakai Subject: RE: [R] Newbie R question On 28-Apr-09 20:42:45, Tena Sakai wrote:
Hi,
I am a newbie with R. My environment is linux and
I have a file. I call it barebone.R, which has one
line:
cat ('Hello World!\n')
I execute this file as:
R --no-save < barebone.R
And it does what I expect. What I get is 20+/- lines
of text, one of which is 'Hello World!'.
How would I go about getting rid of all but the line I
am after, 'Hello World!'?
Regards,
Tena Sakai
tsakai at gallo.ucsf.edu
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 ------------------------------
[[alternative HTML version deleted]]
______________________________________________ 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.
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090430/aa3bdd9b/attachment-0001.pl>