[R] is there a way of identifying batch mode running?

2012-05-02 Thread Paul.Rustomji
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

[R] returning value from source() in R .Net

2012-05-01 Thread Paul.Rustomji
Hello I would like to source an R script from within a C# .Net application equivalent to: source("my_r_code.r") I can get this to run but am not sure how to retrieve R objects defined with script my_r_code.r at runtime. For example, if "my_r_code.r" contains #-- contents of my_r_code.r---

[R] Problem using SNOW with data frame as a function argument

2011-09-17 Thread Paul.Rustomji
Hello I would like to use SNOW to parallelise some computations to be made on columns of a data frame, using different parameter values for each SNOW "worker". I gather(?) clusterMap() is the appropriate SNOW function to do something like this. I suspect the problem lies in the fact that I am

[R] Problem with factors in lm() when using Rscript but not GUI

2010-03-22 Thread Paul.Rustomji
Hello R-help I am having a curious problem. I am using a batch file to call an R script and am getting an error when performing a lm() fit using factorial data only when running in batch mode (see below). I do not get the error when executing the same code in GUI mode in R 2.10.1. Nor do I g

[R] Read PNG file and display with more than 256 colors RGDAL

2009-07-14 Thread Paul.Rustomji
Hello list I am trying to use a Googlemaps tile (png file, 640 X 640 px tile) as a background to a plot and have been using the rgdal library to read in the PNG file (modified from code in the RGoogleMaps package). This works OK. My problem is is that the SGDF2PCT function in rgdal seems to b

[R] Problem loading ReadImages package (and RGooglemaps)

2009-07-09 Thread Paul.Rustomji
Hello All I have just tried to install the ReadImages packge in R but am getting an error message stating: "This application has failedt to start because jpeg62.dll was not found. Re-installing the application may fix this problem" and at the R prompt this error message gets returned: > loca

[R] how to control significant digits(?) on axis labels

2009-04-23 Thread Paul.Rustomji
Dear R mailing list I would like some help on how to get R to display the same number of significant digits (?) for *all* tick marks on axis labels (yet be flexible enough to handle different data sets that vary by 10-1000X). Consider this simple example: #---# x <- seq

[R] problem with gls finding model terms without specifying data=named.object

2009-02-16 Thread Paul.Rustomji
Hello R-help I am having trouble getting gls to find the R objects that comprise a linear model when the data=named.object option(option!) is not specified. In the gls() help it states data is "an optional data frame containing the variables named in model, correlation, weights, and subset. By

[R] Rscript -e, Sweave and tempdir()

2008-10-15 Thread Paul.Rustomji
Hello R-Help I have a question about the "behind the scenes" behaviour of the Rscript -e command and particularly its interaction with Sweave and tempdir(). We are trying to deploy R as a web service to do water quality analyses and have been writing software to call Sweave via Rscript eg: cm

[R] problem running Sweave as a web service with anti-virus software

2008-09-28 Thread Paul.Rustomji
Hello R mailing list We are trying to use R and Sweave, running as a web service on a server to prepare statistical reports but are having problems with our anti-virus software apparently prohibiting execution due to what we think is Sweave trying to run an executable in one of the system's tempo

[R] problem using cat within Sweave code chunks when fig=TRUE

2008-08-24 Thread Paul.Rustomji
Hello R list I was intending to use a cat statement within Sweave code chunks that generate greaphs to generate a readme.txt file listing all the figures generated with a brief caption along the lines of: desired format of "readme.txt" _ figure1.eps caption for

[R] Is conditional evaluation of R code chunks possible in Sweave ?

2008-07-30 Thread Paul.Rustomji
Hi R mailing list Does anyone know of a good way to conditionally evaluate R code chunks when Sweaveing? What I'd kind of like to be able to do is set a number of variables in a list and if variable.a=TRUE then process code chunk labelled "methodA", if variable.b=TRUE then process code chunk labe

[R] Is there a better way to check if an element of a list exists than using match on names?

2008-07-29 Thread Paul.Rustomji
Hello R mailing list Is there a better way than this to see if an element exists *within* a list object : #generate "file.txt" using current routine cat("var1=33\nvar2=TRUE",file="file.txt") #load file to a list called "ipf" f <- function(.file){source(.file,local=TRUE);as.list(environment())}

[R] Is there a way to avoid loading dependendent packages?

2008-07-28 Thread Paul.Rustomji
Hello R help list I have been using the smoothScatter function within the "geneplotter" package to make some graphs using a Sweave Rnw script called via Rscript in a DOS/Windows batch file. The Rscript will ultimately be called by a web service with time-out constraints, hence things need to run

[R] How to set directory Rscript runs in/Sweave output directory

2008-07-27 Thread Paul.Rustomji
Hello I am using Sweave to generate some pdf reports using R on a Windows platform and would like to control the output directory that the generated .tex file goes to. Basically I use the following commands in a batch file: set outdir=c:/output/1234 Rscript -e Sweave('C:/pathpathpath/script.Rn

[R] Use plotmath expressions read from a text file in mtext/bquote

2008-06-25 Thread Paul.Rustomji
Hello R-help List I am writing some R scripts to create graphs of water quality trends that will be called by a web service running R. The axis titles will need to change as the input data (ie. water quality variable) changes according to a user's choice made via a web page. The way I am current

[R] Missing "spline_coef" DLL and Rob Hyndmans monotonic interpolator

2008-06-01 Thread Paul.Rustomji
Hello R help I have been trying to use Rob Hyndman's monotonically increasing spline function. But like another user or two seem have a problem with a missing DLL (namely "spline_coef"). None of the previous help postings seemed to have any solutions to this problem. As per a Ripley suggestion