Displaying 20 results from an estimated 10000 matches similar to: "R command line arguments"
2007 Oct 25
4
ploting labels on barplot
Again me.
I want to plot the numbers on the bars of a barplot.
This can be done using hist function when setting the label argument true
(i.e.
data <- c(1,2,3,4)
hist(data, labels=T)
When I try this using barplot I get an error:
> barplot(summary(data), labels=T)
Error in axis(if (horiz) 2 else 1, at = at.l, labels = names.arg, lty =
axis.lty, :
formal
2007 Dec 01
3
compare strings
Sorry for the question, but I really cannot find the right search terms to
find an answer..
I have a data frame with strings in some of the columns.
I want to know all the rows where the strings in both columns are equal.
How do I do this?
Thanks,
Bernd
[[alternative HTML version deleted]]
2007 Oct 25
2
data frame usage
Hi,
I am new to R and couldn't find any information on how to handle my table
data that I just read in the way I want to use it..
I read in a table from a file:
x <- read.delim("filenam", header=TRUE)
one column (x$label) hold the class labels. Another holds some values
(x$val).
I want to calculate summary statistics for different classes.
How would I do this?
Thanks,
Bernd
2007 Oct 29
2
Qsub - unable to open connection to X11 display
Hi there,
I want to run an R script on a cluster with qsub. Obviously I don't want to
display any X window, but I want use png() or something else to write out
images.
Unfortunately I get the following error message:
> png(filename = " ALL.png", width = 480, height = 480, pointsize = 12, bg =
"white", res = NA)
Error in X11(paste("png::", filename,
2011 Mar 14
1
Rscript, hashbang, and arguments
Hi,
I have a bunch of R scripts which have the hash bang !/usr/bin/env Rscript
and I typically run these scripts by passing in some parameters like this:
./nameOfRScript arg1 arg2 ...
I know Rscript has the option to run in --vanilla. Where exactly do I
insert the --vanilla option? When I do something like this:
./nameOfRScript --vanilla arg1 arg2 ...
And I try to access the commandArgs,
2007 Aug 01
2
passing args to R CMD BATCH in win 2000
Hello and sorry to bother.
Please help.
I searched the archives but could not find out why --args is being ignored
on Windows 2000.
I try
R CMD BATCH --slave 11.R 11.Rout --args "12"
and 11.R has
x=commandArgs(trail=T)
print(x)
a=x[length(x)]
write.csv(a,file="13.out")
q("no")
the argument is not passed to the R process.
11.Rout only shows processing time and
2008 Mar 17
1
summary of summaries
Hi,
I have a few hundreds files with numerical information of different length
but with the same column structure. I use the following code to get summary
statistics
fplist <- list.files(pattern=".*analysis")
for (fp in fplist){
x2 <- read.delim(fp)
summary(x2)
}
Summary gives something like:
summary (x2)
V1 V2
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
2009 May 29
2
strsplit
I am trying split a string and use one part of it to label graphs. I am using strsplit for that. While I am able to split it, how do I access the separated parts.
> filName<-"chrI_2223"
>part<- strsplit(filName,"\\_")
> part
[[1]]
[1] "chrI" "2223"
> part[1]
[[1]]
[1] "chrI" "2223"
I looked up the help archive but did
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
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"
2007 Nov 26
1
looking for packages that visualize nucleotide sequence properties
Hi there,
I am looking for R-packages that can help me visualize properties on
nucleotide sequences. I want to display sequences in the 1-100K base range
as lines and plot features above and below those lines.
Any ideas would be welcome.
Thanks,
Bernd
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
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
2012 May 03
1
is there a way of identifying batch mode running?
Hello list
Is there a way of identifying from within R whether a script has been source(d) from Rgui.exe or via Rscript.exe in batch mode?
For the code I have I use the commandArgs() function to pick up command line args when running in batch mode via Rscript.exe
However I like to get the code working manually first using source("MyRCode.r")
I'd like to be able to put something at
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 =
2009 Sep 07
2
Writing R Scripts and passing command line arguments
Hi Guys
I am Abhishek, primarily a bioinformatician. I have recently started using
a lot of R thanks to some excellent packages available.
Lately I have felt the need to batch process few of the R scripts I have
been working with and strangely enough I am not able to find a good resource
on how to best do this. I did find few old threads on the archives but none
convinced me much. So here I am
2009 Feb 17
3
R scripts and parameters
A couple of weeks ago I asked how it is possible to run an R script (not a function) passing some parameters.
Someone suggested the function "commandArgs()".
I read the on-line help and found no clarifying example. Therefore I do not know how to use it appropriately.
I noticed this function returns the pathname of the R executable which is not what I need.
I meant to ask if it is
2017 Jul 12
1
submitting R scripts with command_line_arguments to PBS HPC clusters
Hi,
The problem is most likely, you need to call a R CMD BATCH with your arguments and the R-script inside of a shell script that you submit to your qsub.
Unfortunately we don't use qsub anymore so can't test it, but it should be as follows:
R-script eg. test.R:
> ##First read in the arguments listed at the command line
> args=(commandArgs(TRUE))
>
> ##args is now a list of
2012 Oct 29
6
export variable from bash to R
Dear R experts
This probably seems very easy to you guys, but I'm a beginner and would be
really glad if someone helped me with this:
I am trying to automate the execution of an R script (let's call it
"myscript.R") by passing a variable from a bash script to myscript.R.
I know I can use the command Rscript, but I don't know how to declare in
bash which variable will be