I get the following error.
$ Rscript plot.R
x=1:10
y=1:10
windows()
Error: could not find function windows
Execution halted
On Sun, Sep 6, 2009 at 11:59 AM, RIOS,ALFREDO ARTUROar...@ufl.edu wrote:
maybe
windows()
On Sun Sep 06 12:53:14 EDT 2009, Peng Yu pengyu...@gmail.com wrote:
Hi
Hi,
In 'example(barplot)' running in R, I see 'Hit Return to see next
plot:', then R waits for my input. I am wondering how to wait for a
user response in Rscript.
Regards,
Peng
__
R-help@r-project.org mailing list
Hi,
I thought that 'coefficients' is a named list, but I can not refer to
its element by something like r$coefficients$y. I used str() to check
r. It says the following. Can somebody let me know what it means?
..- attr(*, names)= chr [1:2] (Intercept) y
$ Rscript lm.R
x=1:10
y=1:10
Hi,
I am wondering how to pop up the graphics window from Rscript. I run
the following code, but I don't see the graphics window, even
transiently.
Regards,
Peng
$ Rscript plot.R
x=1:10
y=1:10
plot(x,y)
__
R-help@r-project.org mailing list
Hi,
According to the example below this email, attr(x,names) is the same
as names(x). I am wondering how many attributes there are of a given
variable. How to find out what they are? Can I always use
some_attribute(x) instead of attr(x, some_attribute)?
Regards,
Peng
x=c(1,2,3)
On Sun, Sep 6, 2009 at 12:45 PM, David Winsemiusdwinsem...@comcast.net wrote:
On Sep 6, 2009, at 1:35 PM, Duncan Murdoch wrote:
On 06/09/2009 1:04 PM, Peng Yu wrote:
Hi,
I thought that 'coefficients' is a named list, but I can not refer to
its element by something like r$coefficients$y. I
On Sun Sep 06 12:52:31 EDT 2009, Peng Yu pengyu...@gmail.com wrote:
Hi,
In 'example(barplot)' running in R, I see 'Hit Return to see next
plot:', then R waits for my input. I am wondering how to wait for a
user response in Rscript.
Regards,
Peng
Hi,
In python, there is a package that helps generating command line
options. I am wondering if there is such a package in R that helps
generating the command options for a R script?
http://docs.python.org/library/optparse.html
Regards,
Peng
__
Hi,
tempdir() always gives me the same result. Should it give a different
result each time I call it?
tempdir()
[1] /tmp/RtmppB72wH
tempdir()
[1] /tmp/RtmppB72wH
Regards,
Peng
__
R-help@r-project.org mailing list
Hi,
I run the following script. I don't understand why the second
'length(args)' does not show anything but the first one shows '0'. Is
it because the command 'q()' affects anything in the if-statement.
However, if I change the second 'length(args)' to
'print(length(args))', the script will
Hi,
commandArgs gives me the arguments. I am wondering what command can
give the whole command line.
Regards,
Peng
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
On Sun, Sep 6, 2009 at 10:50 PM, Steve
Lianogloumailinglist.honey...@gmail.com wrote:
Hi,
On Sun, Sep 6, 2009 at 11:25 PM, Peng Yupengyu...@gmail.com wrote:
Hi,
commandArgs gives me the arguments. I am wondering what command can
give the whole command line.
What does the whole command
) and see if the history file is easier to
find. Should be in your working directory.
Rscript is a program, not a record of the prior session.
--
David.
On Sep 4, 2009, at 11:03 PM, Peng Yu wrote:
Hi,
I run the following command and try to save the commands that have
been run in the script
Hi,
I am wonder if there is a function similar 'apply' but it could accept
multiple arguments?
For example, I have the following matrix.
x=matrix(1:6,nr=2)
y=matrix(1:6,nr=2)
I want to find a function that can be used to compute the linear
regression for each pair of rows in the two matrices?
that a savehistory.R file would exist.
So what OS? What did you do before this failed effort? And what are you
really trying to do?
Then perhaps someone familiar with your OS can answer.
--
David
.
On Sep 5, 2009, at 10:52 AM, Peng Yu wrote:
Hi,
I got the following error. Does it mean
Hi,
I am not familiar enough with statistics yet. Please excuse me if my
question is wrong.
In the simplest form of linear regression, the data points are two
list of scalars x_1, ..., x_n and y_1, ..., y_n. I am wondering if
there is a linear regression for two lists of vectors X_1, ..., X_n
:6,nr=2)
y=matrix(1:6,nr=2)
mapply(function(u,v){u + v},x,y)
[1] 2 4 6 8 10 12
On Sat, Sep 5, 2009 at 10:59 AM, Henrique Dallazuannawww...@gmail.com wrote:
Yes, see mapply.
On Sat, Sep 5, 2009 at 12:18 PM, Peng Yu pengyu...@gmail.com wrote:
Hi,
I am wonder if there is a function
Hi,
I don't see what the difference between read.delim and read.delim2
after reading the help. Can somebody let me know what it is?
Regards,
Peng
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the
Hi,
Suppose I have the following two matrices.
x=matrix(1:4,nr=2)
y=matrix(5:8,nr=2)
I want to join the two matrices to get the following two new matrices.
I did a search but I don't find any relevant webpage. Can somebody let
me know how to do it?
[,1] [,2]
[1,]13
[2,]24
Hi,
Suppose I have a logical vector x, I want to compute the 'and' and
'or' of all its element (the result should be a single value TRUE or
FALSE). I have read the R-intro.pdf logical vector section, but I
don't find the answer. Can somebody let me know how to do it?
x= rep(TRUE, 3)
Regards,
Hi,
I run the following command and try to save the commands that have
been run in the script. But it seems that no history is recorded. Is
it because that the history is not recorded in Rscript?
Regards,
Peng
$ Rscript savehistory.R
f=tempfile()
f
[1] /tmp/Rtmp7WBjGG/file327b23c6
history()
Hi,
Suppose that I have the following script.
$ cat commandArgs.R
args=commandArgs(trailingOnly=TRUE)
args[1]
I can supply command line options
$ Rscript commandArgs.R a
args=commandArgs(trailingOnly=TRUE)
args[1]
[1] a
I am wondering how to supply the command line arguments when I source
Hi,
$ cat commandArgs.R
args=commandArgs(trailingOnly=TRUE)
args[1]+10
I have the above code. But the following command line gives me an error. I
am wondering what is the correct way to convert a string to a vector?
$ Rscript commandArgs.R 1:3
args=commandArgs(trailingOnly=TRUE)
args[1]+10
Hi,
I did a search but I was able to find how to generate a random matrix.
Can somebody let me know how to do it?
Regards,
Peng
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
Hi,
I see the following package that can help me call perl from R. But the
webpage is about 3 years old. I am wondering what the latest package
that can help calling perl from R.
http://www.omegahat.org/RSPerl/
Regards,
Peng
__
R-help@r-project.org
Hi,
http://cran.r-project.org/doc/Rnews/Rnews_2003-3.pdf
There is information on how to debug R. But since it is fairly old, I
am wondering what the currently best way for debugging R script.
Regards,
Peng
__
R-help@r-project.org mailing list
Hi,
match(4, c(1,2,3))
[1] NA
The above code run smoothly. It would not stop when 4 does not mach in
c(1,2,3). I am wondering if there is a way to stop the code and pop up
an error message immediately. This capability to stop will make
debugging easier.
Regards,
Peng
Hi,
It is easy to understand the types vector and frame.
But I am wondering why the type factor is designed in R. What is the
advantage of factor compare with other data types in R? Can somebody
give an example in which case the type factor is much better than
other data types?
Regards,
Peng
Hi,
I know that I can use the following script to get the command line
options for an R script. But the output shows two many irrelevant
arguments. For example, I only want to pass a, b and c to the
script. The first 5 elements in the variable 'args' are not what I
want. I am wondering what is
Hi,
In C++, I can use the following construct to choice either of the two
blocks the comment but not both. Depending on whether the number after
#if is zero or not, the commented block can be chose. I'm wondering
if such thing is possible in R?
#if 0
commented with 0
#else
commented with 1
Hi,
It says in R-intro.pdf, For portable R code (including that to be
used in R packages) only A–Za–z0–9 should be used. I'm an wondering
why '_' and '.' can be used in portable R code.
It very common that some variable name should be composed of two or
more English words. Can somebody let me
Hi,
When I use Rscript to run an R script, I want Rscript show the line
numbers along with the commands executed. I am wondering if there is a
way to do so.
Regards,
Peng
__
R-help@r-project.org mailing list
Hi,
I run the following program. I thought that 'b' was a matrix. But it
is actually not, right? Can somebody elaborate more on the type
difference between 'b' and 'c' to help me understand it better?
Why 'c' is what it is now? Why 'c' is not the transpose of what it is now?
Regards,
Peng
$
Hi,
When I use Rscript, I want that it load an additional Rprofile file
besides the default ones. I don't find such an option. Can somebody
let me know if there is such an option?
Regards,
Peng
__
R-help@r-project.org mailing list
, ...){
cat( readLines( files ), sep = \n )
}
options( pager = dump.pager )
Romain
On 08/06/2009 08:59 PM, Peng Yu wrote:
Hi,
In R command line, when I type help(something), it will always show
the help in the different mode such that I don't see command lines
anymore but just
Hi,
I frequently need to open multiple help pages in R, which requires the
start of multiple R sessions. I am wondering if there is a way to
invoke the help page from the command line just like 'man'.
Regards,
Peng
__
R-help@r-project.org mailing list
Hi,
There are quiet a few different 'apply' functions, such as lapply,
sapply and many more. I'm very familiar with the 'Apply' function in
Mathematica. Can somebody point me a summary of all the 'apply'
functions in R. Also, I'm curious that what 'l' and 's' (and other
prefixes) stand for in
Hi,
I am wondering if some experienced users would help put the
ready-to-run code of the examples in the manuals. It would help new
users learn R faster by putting all the examples in an ready-to-run R
script file. Can somebody help do so sometime and post the code along
with the pdf manuals?
...@gmail.com wrote:
Is it really necessary? You can just copy the commands in the manual
and paste them to R.
Ronggui
2009/8/11 Peng Yu pengyu...@gmail.com:
Hi,
I am wondering if some experienced users would help put the
ready-to-run code of the examples in the manuals. It would help new
Hi,
I know '.' is not a separator in R as in C++. I am wondering where it
discusses the detailed usage of '.' in R. Can somebody point me a
webpage, a manual or a book that discuss this?
Regards,
Peng
__
R-help@r-project.org mailing list
Hi,
The book Programming with Data: A Guide to the S Language was
published over 10 years ago. I know that to understand object oriented
programming. I should read the associated section in this book. But I
am wondering if other chapters, in particular Chapter 3. Quick
Reference, are still
Hi,
Rscript does not print the commands in the script. I am wondering what
command can print both the commands as well as the output on the
screen.
Regards,
Peng
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE
On Fri, Aug 7, 2009 at 5:04 AM, Jakson Alves de
Aquinojaksonaqu...@gmail.com wrote:
Peng Yu wrote:
I'm wondering if R provide a vi mode in the command line just like
other shells such as bash do. Can somebody let me know?
I maintain a Vim plugin that makes the interaction with R easier
On Fri, Aug 7, 2009 at 5:04 AM, Jakson Alves de
Aquinojaksonaqu...@gmail.com wrote:
Peng Yu wrote:
I'm wondering if R provide a vi mode in the command line just like
other shells such as bash do. Can somebody let me know?
I maintain a Vim plugin that makes the interaction with R easier
Hi,
If I run the below command, it will generate a file 'file.Rout' to
save the output. But I want the output be shown in the screen
directly. I'm wondering if there is a direct way to do so.
R CMD BATCH file.R
Regards,
Peng
__
R-help@r-project.org
, 2009 at 9:45 AM, Erik Iversoneiver...@nmdp.org wrote:
You did not specify your OS, but you might try at the shell prompt:
Rscript file.R
See ?Rscript
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Peng Yu
Sent: Thursday
Hi,
I'm wondering if R provide a vi mode in the command line just like
other shells such as bash do. Can somebody let me know?
Regards,
Peng
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting
Hi,
In R command line, when I type help(something), it will always show
the help in the different mode such that I don't see command lines
anymore but just the help document. If I quit from the help mode, I
will only see the command lines by not the help document.
I would like the help document
-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Peng Yu
Sent: Thursday, August 06, 2009 9:35 AM
To: r-h...@stat.math.ethz.ch
Subject: [R] How to execute a R script but outputting the result to the
screen?
Hi,
If I run the below command, it will generate a file
, ...){
cat( readLines( files ), sep = \n )}
options( pager = dump.pager )
Romain
On 08/06/2009 08:59 PM, Peng Yu wrote:
Hi,
In R command line, when I type help(something), it will always show
the help in the different mode such that I don't see command lines
anymore but just the help
Hi,
I am looking for a reference page that gives me a complete list of R
string manipulation operations. At this moment, I am looking for
something like basename and dirname. The following webpage doesn't
give me any information. Can somebody point me a better resource?
301 - 351 of 351 matches
Mail list logo