Displaying 20 results from an estimated 4000 matches similar to: "commandArgs() prints warnings to STDOUT - correction"
2002 Jun 25
1
commandArgs: feature request
Dear R-core Team,
As Thomas Lumley pointed out in one of his e-mails one can use commandArgs()
to get a copy of the command line arguments supplied when R session was
invoked and then use grep to extract parameters of interest.
His solution works very well if the custom options are passed by names, e.g.
--my-option=value, but what if one wants to pass parameters by their
positions. Then it's
2010 Jan 10
0
commandArgs return value
Hello,
I plan to use a script with R CMD BATCH on different platforms Linux,
Windows and Mac OSX. I use the commandArgs(trailing = FALSE) function
to retrieve the name of the script and the arguments (example below
with output.) The online docs for "Introduction to R" (sections B.1
Invoking R from the command line and B.4 Scripting with R) and
help("commandArgs")
2007 Apr 01
2
commandArgs usage and --args invokation
Dear R experts:
I am a bit stymied by how the argument picking-off works in R batch file usage.
$ cat commandArgs.R
cat(" Command Line Arguments were ", commandArgs(), "\n");
$ /usr/bin/R CMD BATCH commandArgs.R --args 1 2 3
$ /usr/bin/R --args 1 CMD BATCH commandArgs.R
... I am now getting into interactive mode ?! I guess it really is skipping the
rest of the command line
2003 May 05
1
commandArgs()
Apologies for asking about this, but I don't quite understand how
this works after looking through the FAQ and the Help archives.
Let's say I want to pass "1000" as an argument to R. I did the
following:
>R CMD BATCH --1000 infile outfile
When I do print( commandArgs() ), I see
[1] ".../R.bin" "--restore"
[3] "--save"
2001 Nov 26
3
Doing things with POSIXt
Dear R-Users,
I have a data file with timestamps and I wanted to use POSIXct time data
type to represent the respective column. I played around with the type and
found a couple of issues:
* there seems to be no direct way of reading datetimes into a variable.
Let's say this is my file
"1992-02-27 23:03:20 PST"
"1992-02-27 22:29:56 PST"
"1992-01-14 01:03:30 PST"
2018 Sep 17
0
Rscript -e does not accept newlines under Linux?
On 16/09/2018 4:53 AM, Voeten, C.C. wrote:
> Hello,
>
> I have found what I believe to be a bug in the Linux version of the Rscript binary.
> Under Windows (official 64-bit 3.5.1 R distribution running on an up-to-date Win10), I can do the following (e.g. under powershell):
>
> PS H:\Users\Cesko> Rscript -e 'ls()
>>> ls()'
> character(0)
> character(0)
2005 Sep 23
1
R's parsing of command line arguments using commandArgs()
Hi all,
I am setting up some R program files for use by our DB programmers to
enable them to utilize some R functions which will be called from within
TCL code. R has been installed on an RHEL server and R will process the
results of SQL queries against an Oracle database.
In some cases, they will generate a data file to be read in and
processed by R, in others they will simply make the
2001 Sep 17
3
computational capacity of Linux network
Hi, This is not an R question per ce, but I feel like this is a right
community to ask it.
As a part of our work we run a lot of non-interactive computational jobs. To
increase the throughput we would like to distribute the load over the entire
network and we are looking at Linux network as a platform. Ideally we would
like to be able to submit a job to the network, rather than to a computer,
and
2001 Oct 27
2
"unloading" data
Dear R-Users,
I am reading the "An Introduction to R" manual and have come across data()
function for loading data.
I assume that R requires explicit loading of data objects to save memory.
Then I'd expect there should be a function that can unload the objects once
they are not needed anymore, what is this function? It would be helpful if
?data contained a reference to that
2002 Jun 28
1
browser/debug and for loop
Dear R-Users,
It seems like once one invokes browser() inside a loop and steps through the
body using 'n' any subsequent loop will be "intercepted" by debug()
function. Here is exactly what I mean
# fresh R session
# run a loop that has browser() inside the body
> for (i in seq(5)) { browser(); print(i) }
for (i in seq(5)) { browser(); print(i) }
Called from: NULL
2002 Dec 19
1
disabling NA token as na.string in read.table
Dear R-Users,
I have a csv file that has NA tokens and these tokens are perfectly good
values that need not to be converted to NA by read.table(). I tried to
prevent the conversion by specifying the na.strings arg., but this seems to
only add to the list of NA strings, not substitute.
> system("cat foo")
system("cat foo")
1 foo
2 NA
> read.table("foo",
2001 Jul 20
3
estimation of drift of continuous random walk
Dear R-Users,
I have the following problem to solve and I wonder if there are means in R
that can help me.
At irregular time intervals I observe a random walk process, Y, with
time-varying drift. I assume that the drift, D, is a (linear) function of
some parameter X. The goal is to estimate D(X).
I could regress Y_{t+dt} - Y_{t} ~ X, but it's probably not appropriate
since Var(Y_{t+dt} -
2003 Mar 11
2
system(..., intern=TRUE) splits long lines (PR#2623)
system(..., intern=TRUE) splits long lines after 118th character and
discards the 119th character
> a <- paste(rep("a", 124), collapse="")
> system(paste("echo", a), intern=TRUE)
system(paste("echo", a), intern=TRUE)
[1]
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
2002 Dec 05
1
writing to gzfile: segmentation fault (PR#2347)
Full_Name: Vadim Ogranovich
Version: Version 1.6.0 (2002-10-01)
OS: Red Hat 7.1
Submission from: (NULL) (209.99.241.1)
The following sequence of commands crashes my R session. The first weirdness
happens after the second command that appears not to change the "foo.gz" file,
no error generated.
> con <- gzfile("foo.gz", open="w"); cat("goo\n",
2001 Dec 11
0
Re: (PR#1210) an error message from scan() surprised vograno@arbitrade.com.
Original incorrect subject line was
Subject: [Rd] multi.line=FALSE does not work in scan() (PR#1210)
It *does* work quite correctly: this was an erroneous file nd
you got an error, just one you didn't understand.
Please don't use grossly misleading subject lines: they are all that
appear in the BUGS file.
On Tue, 11 Dec 2001 vograno@arbitrade.com wrote:
> The following applies to
2012 May 24
0
Is it possible to use quorum for CTDB to prevent split-brain and removing lockfile in the cluster file system
Hello list,
We know that CTDB uses lockfile in the cluster file system to prevent
split-brain.
It is a really good design when all nodes in the cluster can mount the
cluster file system (e.g. GPFS/GFS/GlusterFS) and CTDB can work happily in
this assumption.
However, when split-brain happens, the disconnected private network
violates this assumption usually.
For example, we have four nodes (A, B,
2008 Jan 05
1
Rscript argument processing minor bug with -g
I think there's a minor bug in the argument-processing carried out by Rscript.
The effect is that if one passes "-g" as a flag to the script, it is erroneously
exposed to the main executable's argument processing and therefore generates a
message about not being able to comply with the request for a particular GUI.
Uppercase G is fine as are the other 25 letters in upper or
2011 Apr 09
1
How do I make this faster?
I was on vacation the last week and wrote some code to run a 500-day
correlation between the Nasdaq tracking stock (QQQ) and 191 currency pairs
for 500 days. The initial run took 9 hours(!) and I'd like to make it
faster. So, I'm including my code below, in hopes that somebody will be able
to figure out how to make it faster, either through parallelisation, or by
making changes. I've
2009 Aug 28
1
How to convert a string passed as an argument to a vector?
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
Error in args[1] + 10 : non-numeric argument to binary operator
Execution halted
Regards,
Peng
2012 Mar 28
2
getopt does not work as expected!
I have the following script (also attached):
#!/usr/bin/Rscript
spec=matrix(c(
'verbose', 'v', 1, "integer",
'help' , 'h', 0, "logical"
),ncol=4, byrow=TRUE)
spec.dim=dim(spec)
spec.opt.long=spec[,1]
spec.opt.short=spec[,2]
spec.opt.l <- spec.dim[1]
infile <- "test.dat"
args=commandArgs(TRUE); l=length(args)
self =