similar to: filename

Displaying 20 results from an estimated 8000 matches similar to: "filename"

2005 Jun 02
1
DEM calculation
Hello R-World, i am trying to calculate data for a DEM (Digital Elavation Model) which i also want to plot in R. i have the coordinates for the lower left corner which look something like this: x<-42,2 y<-50,5 besides i have the cellsize of the grid, which is: z<-1,1 what i do is to calculate the corrdinates of the cells to the right and top, what i can do by specifying the number of
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
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
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
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
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 =
2005 May 12
2
tempsum
hi, i'd like to calculate a temperatursum, adding the value of each element. let's say the data looks like this: x<-c(1,2,3,4,5) what i want to do, is ploting not the sum in the end but all the subresults, too, so my vector holds: x[i] [1] 1,3,6,10,15 here is what i tried, which seems to be right to me, bu doesn't work out: x<-c(1,2,3,4,5) i<-1 j<-1
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,
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
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
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"
2012 Jan 04
2
using var from bash in R script
Dear R users, This probably a really noob question, but I'm stuck. I'd like to pass some variables from bash to R as strings. I can successfully pass variables using commandArgs(), the problem is that I end up with an array. So, for example: > Args <- commandArgs(TRUE) > Args [1] "one" "two" "three" Now, it just so happens that "one",
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
2011 Dec 05
2
bit error robustness
Hello everyone, I'm evaluating the Celt in terms of robustness against bit errors. So what I have done is encoding a wav file using the \tools\celtenc.exe and then manipulated the wav file according a desired bit error rate or burst error length. But the Celt decoder stops decoding with the first bit I manipulated even if this bit is not in the header. So is there a way to do the test
2006 Mar 15
2
difftime arguments
Hi I just started using RGui.exe under widnows. I have a text file containing date arranged in columns and rows, each column has the same format, each row with different formats. 3 of the columns are something like this 1/12/2006 3:59:45 PM I need to calculate the different in seconds between 2 selected periods using their row’s index My solution: Read the file in a data frame and
2012 May 22
2
Best way to locate R executable from within R?
Hi, I'd like to spawn of a new R process from within R using system(), e.g. system("R -f myScript.R"). However, just specifying "R" as in that example is not guaranteed to work, because "R" may not be on the OS's search path. What is the best way, from within a running R, to infer the command (basename or full path) for launching R in way that it works on
2007 Jan 24
1
writing R shell scripts?
Hi All, Another newbie question. I want to write an R script that takes argument from command line and runs and produces output to stdin. For example if there is file foo.R with following in it. args = commandArgs() print(args) then, when I run it like $ R foo.R hello it should print 'hello' on the terminal. I searched the mainling list and found a very old post that said said that
2007 Jun 19
2
Preconditions for a variance analysis
Hello everbody, i'm currently using the anova()-test for a small data.frame of 40 rows and 2 columns. It works well, but is there any preconditions for a valid variance analysis, that i should consider? Thank you for your answer, Daniel
2009 Aug 20
1
Command line option to an R script running through Rscript
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 the correct way to pass command line options to an R script.