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

2008-07-27 Thread Prof Brian Ripley
On Mon, 28 Jul 2008, [EMAIL PROTECTED] wrote: 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/12

[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

Re: [R] Are there any packages that can process images other than pixelmap (i.e. pnm)?

2008-07-27 Thread Henrik Bengtsson
See EBImage on Bioconductor.org. /Henrik On Sun, Jul 27, 2008 at 10:21 PM, Arthur Roberts <[EMAIL PROTECTED]> wrote: > Hi, all, > > I am having trouble getting R to take pnm images via mogrify > > i.e. > > mogrify -resize 320x217 -format pnm *.png > > However R via pixmap says that it can't read t

[R] Are there any packages that can process images other than pixelmap (i.e. pnm)?

2008-07-27 Thread Arthur Roberts
Hi, all, I am having trouble getting R to take pnm images via mogrify i.e. mogrify -resize 320x217 -format pnm *.png However R via pixmap says that it can't read the file. If you have any ideas like a package that can read jpeg files, etc., I would appreciate it. Best wishes, Art Robert

[R] Help with a loop

2008-07-27 Thread Sofia Martinez
HI: I need ideas on how to make this code shorter (maybe with a second loop?). The code as it is works, but in this case I only have 14 samples, but it will become insane with more, so I need a way to make it more automatic. The problem is that the output from ts1, ts2, and so on is a vector with m

Re: [R] read.table question

2008-07-27 Thread Rolf Turner
On 28/07/2008, at 3:26 PM, Edna Bell wrote: Dear R list: I have a data set that I would like to bring it. The fourth column shows as numeric, but I want it to be a factor. Is there a way to do this from the read.table statement, or should I just wait and use the factor function please? Loo

[R] read.table question

2008-07-27 Thread Edna Bell
Dear R list: I have a data set that I would like to bring it. The fourth column shows as numeric, but I want it to be a factor. Is there a way to do this from the read.table statement, or should I just wait and use the factor function please? thanks, Edna Bell _

Re: [R] Converting english words to numeric equivalents

2008-07-27 Thread Rolf Turner
On 28/07/2008, at 12:32 PM, oscar Linares wrote: Hello, I am trying to convert english words to numeric equivalents, e.g., abc to 123. Is there a function or library or package for doing this in R? If not, can it be done easily in R? Your question is very ill-posed. What ``english word'

[R] Rolling regression - o/p selected coefficients

2008-07-27 Thread rcoder
Hi everyone, Using the rolling regression function - rollingRegression(formula, data, width, ...) - is there a way to output only selected coefficients to a results matrix. For e.g. if I only wanted the slope coefficients to be recorded, how would I go about doing this? Thanks, Michael -- View

[R] Converting english words to numeric equivalents

2008-07-27 Thread oscar Linares
Hello, I am trying to convert english words to numeric equivalents, e.g., abc to 123. Is there a function or library or package for doing this in R? If not, can it be done easily in R? Thanks, Oscar [[alternative HTML version deleted]] ___

[R] product of successive rows

2008-07-27 Thread rcoder
Hi everyone, I want to perform an operation on a matrx that outputs the product of successive pairs of rows. For example: calculating the product between rows 1 & 2; 3 & 4; 5 & 6...etc. Does anyone know of any readily available functions that can do this? Thanks, rcoder -- View this message

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-27 Thread Tim Hesterberg
I'll address the question of whether you can use the bootstrap to improve estimates, and whether you can use the bootstrap to "virtually increase the size of the sample". Short answer - no, with some exceptions (bumping / Random Forests). Longer answer: Suppose you have data (x1, ..., xn) and a s

[R] Mixed model question.

2008-07-27 Thread Rolf Turner
I continue to struggle with mixed models. The square zero version of the problem that I am trying to deal with is as follows: A number (240) of students are measured (tested; for reading comprehension) on 6 separate occasions. Initially (square zero) I want to treat the test time as a facto

Re: [R] Interpolating a line and then summing there values for a diurnal oxygen curve (zoo object)

2008-07-27 Thread Gabor Grothendieck
Try this using your z and library(zoo): # extract section of interest w <- window(z, start=chron("6/8/6", "4:16:0"), end=chron("6/8/6", "20:31:0")) # zap all interior points with NA's and then fill back in using linear interpolation lin <- na.approx(replace(w, time(w) > start(w) & time(w) < end(w

[R] Interpolating a line and then summing there values for a diurnal oxygen curve (zoo object)

2008-07-27 Thread stephen sefick
#I would like to interpolate a straight line between 06/08/06 04:16:00 - 06/08/06 20:31:00 with values and then sum them. This is an estimate of ecosystem #respiration and I will be using this in a larger context(48 days of these diurnal curves), but for right now I am just trying to figure out h

[R] equivalent R functions for Numerical Recipes fitxy and fitexy ?

2008-07-27 Thread Marc Fischer
Dear Folks, We need to fit the model y~x assuming there are random errors in both x and y. Numerical Recipes (Press et al.) have two useful functions, fitxy and fitexy, which handle cases of unspecified and specified errors respectively. Are there equivalent functions in base R or a ins

Re: [R] Link functions in SEM

2008-07-27 Thread Stas Kolenikov
sem is package for pretty traditional covariance matrix analysis. To deal with other members of exponential family than normal, you can also look at GLLAMM package (http://www.gllamm.org) that works from Stata. Or Mplus. Or you might have some luck building up a mixed model for your purpose, see ?n

Re: [R] Maximization under constraits

2008-07-27 Thread Ritwik Sinha
Hi Daniela, Will the "optim" function with the method "L-BFGS-B" work for you? Look for the "lower" argument in the function. Ritwik On Fri, Jul 25, 2008 at 9:07 AM, Daniela Garavaglia <[EMAIL PROTECTED]> wrote: > > I'm looking for a R function which can maximise this logliklihood function, > un

Re: [R] graphing regression coefficients and standard errors

2008-07-27 Thread Ritwik Sinha
Hi Murali, The plot function works on an "lm" object. The example from the help page of lm. Ritwik ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) group <- gl(2,10,20, labels=c("Ctl","Trt")) weight <- c(ctl, trt) anova(lm.D9

[R] help with durbin.watson

2008-07-27 Thread tom soyer
Hi, I have two time series, y and x. Diff(y) and Diff(x) both show no autocorrelation. But durbin.watson(lm(Diff(y)~lag(Diff(x),k=-4)) gives a DW value of zero. How come the residule is autocorrelated while Diff(y) and Diff(x) are not? Does anyone know if in my case a DW of zero indicates serial c

Re: [R] Object-oriented programming in R for Java programmers?

2008-07-27 Thread Stephen Tucker
This page is also a brief introduction to the S3 classes: http://www.ibm.com/developerworks/linux/library/l-r3.html (see section on 'Object-oriented R') and for S4, in addition to "How S4 methods work": http://developer.r-project.org/methodDefinition.html - Original Message From: Jo

[R] Fitting a Bivariate Poisson log-normal distribution

2008-07-27 Thread Famoye, Felix
I wrote an R program to fit a bivariate Poisson log-normal model. The model is first proposed by Aitchison and Ho (1989) in Biometrika, Volume 76 pages 643-653. The model involves using a double integration. The following is the program and the data that I used. My major problem was that R was runn

Re: [R] Object-oriented programming in R for Java programmers?

2008-07-27 Thread Stephen Tucker
I've never used it myself but I recall reading about this R.oo package a while ago - might be worth considering? http://www1.maths.lth.se/help/R/R.oo/ - Original Message From: Werner Wernersen <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Sunday, July 27, 2008 4:55:26 AM Subject: [R

Re: [R] Object-oriented programming in R for Java programmers?

2008-07-27 Thread Jeroen Ooms
Werner Wernersen wrote: > > I have done oo programming in C++ and Java before but the first few > tutorial on R oo were a bit confusing for me. > My personal experience is that the type of OO programming that makes for example Java code nice and easy to structure is not possible in R. The bigg

Re: [R] 64-bit R on Mac OS X 10.5.4

2008-07-27 Thread joseph
Hi Matt Your method is the easiest way for me to install the 64-bit R. I followed the directions on your web site and then did the following: R --arch=x86_64 source("http://bioconductor.org/biocLite.R";) biocLite(type = "source",lib = "/Library/Frameworks/R.framework/Versions/2.8/Resources/RL

Re: [R] A easy way to write formula

2008-07-27 Thread hadley wickham
On Sun, Jul 27, 2008 at 4:19 AM, Mark Difford <[EMAIL PROTECTED]> wrote: > > Hi Jinsong and Thierry, > >>> (x1 + x2 + x3) ^2 will give you the main effects and the interactions. > > Although it wasn't specifically requested it is perhaps important to note > that (...)^2 doesn't expand to give _all_

Re: [R] melting a list: basic question

2008-07-27 Thread hadley wickham
> Is it possible to install your development version of reshape? I could not > find it alongside of ggplot2 on github. Not yet, but I'm working on it. > If not, I've added "..." in the > method for the current version and it seems to work for me. Yes, that's the exact change I made. Thanks! Ha

Re: [R] Object-oriented programming in R for Java programmers?

2008-07-27 Thread Johannes Huesing
Werner Wernersen <[EMAIL PROTECTED]> [Sun, Jul 27, 2008 at 01:55:26PM CEST]: [...] > Is there any brief tutorial on oo programming in R > especially for people who have done oo in Java or C++ > before? That would be really helpful. "How S4 methods work" highlights the differences between R's funct

[R] Colors in Sweave

2008-07-27 Thread Stephen Tucker
Hi list, I was using Sweave and was wondering if anyone has had any luck changing the font colors of the code chunks. For instance, in my .Rnw preample I tried including: === \usepackage[usenames]{colors} \definecolor{darkred}{rgb}{0.545,0,0} \definecolor{midnightblue}{rgb}{0.098,0.098,0.439} \

[R] Link functions in SEM

2008-07-27 Thread Jeroen Ooms
Is it possible to fit a structural equation model with link functions in R? I am trying to build a logistic-regression-like model in sem, because incorporating the dichotomous variables linearly seems inappropriate. Mplus can do something similar by specifying a 'link' parameter, but I would like

[R] equivalent R functions for Numerical Recipes fitxy and fitexy ?

2008-07-27 Thread Marc Fischer
Dear Folks, We need to fit the model y~x assuming there are random errors in both x and y. Numerical Recipes (Press et al.) have two useful functions, fitxy and fitexy, which handle cases of unspecified and specified errors respectively. Are there equivalent functions in base R or a ins

Re: [R] [R-sig-Geo] Spatial Sample

2008-07-27 Thread Roger Bivand
On Sun, 27 Jul 2008, Paul Hiemstra wrote: Hi, One option is: ?spsample - which implements most of Ripley (1981, reprinted 2004, ch.3), and for even more choice, see functions in the spatstat package for point patterns, and the spsurvey package. Roger cheers, Paul Raphael Saldanha sch

[R] competing risk model with time dependent covariates under R or Splus

2008-07-27 Thread BXC (Bendix Carstensen)
This message was also sent to the MEDSTATS mailing list, so here is the reply I posted to that: Philippe, The machinery to use is to split follow-up time so finely that you can safely assume that rates are constant in each interval, and then just stuff it all into a Poisson model. This allows

Re: [R] response surface analysis

2008-07-27 Thread Jinsong Zhao
Tom La Bone wrote: There appears to be a very promising response surface package being discussed at useR-2008, but I have been unable to find the package on CRAN or contact the authors. www.statistik.uni-dortmund.de/useR-2008/abstracts/Sztendur+Diamond.pdf Tom Thanks for pointing me to this.

[R] Object-oriented programming in R for Java programmers?

2008-07-27 Thread Werner Wernersen
Hi, I was wondering if anybody might have a reference for me: My R code is growing and getting more and more confusing. Thus, I figure it's time to switch to object-oriented again. I have done oo programming in C++ and Java before but the first few tutorial on R oo were a bit confusing for me. I

Re: [R] re sponse surface analysis

2008-07-27 Thread Tom La Bone
There appears to be a very promising response surface package being discussed at useR-2008, but I have been unable to find the package on CRAN or contact the authors. www.statistik.uni-dortmund.de/useR-2008/abstracts/Sztendur+Diamond.pdf Tom Jinsong Zhao wrote: > > Hi, > > Is there a pack

Re: [R] GLS "no terms component" error

2008-07-27 Thread mm745
Thank you, Bill. I think I misread some text in my statistics handbook. This has helped to clear it up. Sorry for taking up your time and thank you for replying. M. Grace Quoting [EMAIL PROTECTED]: > The help file for dwtest says > > formula: a symbolic description for the model to be tested (or

Re: [R] Weighted variance function?

2008-07-27 Thread Arun Kumar Saha
oh now I got, R is taking unbiased estimator, anyways thanks On Sun, Jul 27, 2008 at 2:54 PM, Arun Kumar Saha <[EMAIL PROTECTED]>wrote: > I feel there is something wrong in definition in weighted variance. > > Say for a fair dice the variance of outcome should be : 2.92 ( > http://en.wikipedia.or

Re: [R] Weighted variance function?

2008-07-27 Thread Arun Kumar Saha
I feel there is something wrong in definition in weighted variance. Say for a fair dice the variance of outcome should be : 2.92 ( http://en.wikipedia.org/wiki/Variance) However if I use cov.wt() or weighted.var() by Gavin, I get : cov.wt(as.data.frame(1:6), rep(0.6, 6)) $cov 1:6 1:6 3.5 $c

Re: [R] A easy way to write formula

2008-07-27 Thread Mark Difford
Hi Jinsong and Thierry, >> (x1 + x2 + x3) ^2 will give you the main effects and the interactions. Although it wasn't specifically requested it is perhaps important to note that (...)^2 doesn't expand to give _all_ interaction terms, only interactions to the second order, so the interaction term

Re: [R] Retain plot?

2008-07-27 Thread ONKELINX, Thierry
Kevin, Open a new plot window before plotting the second plot. plot(rnorm(10), runif(10)) X11() plot(rnorm(10), runif(10)) HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Instit

Re: [R] A easy way to write formula

2008-07-27 Thread ONKELINX, Thierry
(x1 + x2 + x3) ^2 will give you the main effects and the interactions. So this will shorten your equation to ft <- lm(y ~ (x1 + x2 + x3) ^2 + I(x1 * x1)+ I(x2 * x2) + I(x3 * x3), mydata) HTH, Thierry ir. Thierry Onke

Re: [R] Lattice wireframe: How to avoid drawing lines around polygons when using shade=TRUE

2008-07-27 Thread Oliver M. Haynold
On Sun, 27 Jul 2008 05:00:48 +, Oliver M. Haynold wrote: > I am using wireframe from the lattice package, with the shade option set > to TRUE. When I output to PDF or Postscript, a line gets drawn around > each polygon of my surface which causes ugly Moiré effects and doesn't > make sense in my

Re: [R] Transfer Function Modeling

2008-07-27 Thread Ashish Kumar
Hi, I would like to know how to build the transfer function modeling for bivariate time series data. I tried searching for relevant threads, but could not find much help with it. Thanks Ashish [[alternative HTML version deleted]] __ R-

Re: [R] Weighted variance function?

2008-07-27 Thread Arun Kumar Saha
ur prog gives following result: weighted.var(c(1,-1), c(0.5,0.5)) [1] 2 is it ok? On Thu, Jul 24, 2008 at 7:57 PM, Gavin Simpson <[EMAIL PROTECTED]>wrote: > On Thu, 2008-07-24 at 02:25 +0530, Arun Kumar Saha wrote: > > There is a R function to calculate weighted mean : weighted.mean() under > >

Re: [R] Color of box frame in Legend (Was: Matrix barplot)

2008-07-27 Thread Andreas Tille
On Sun, 27 Jul 2008, S Ellison wrote: Looking at the legend() source the filled box line colour is hardcoded : if (mfill) { if (plot) { fill <- rep(fill, length.out = n.leg) rect2(left = xt, top = yt + ybox/2, dx = xbox, dy = ybox, col = fill, densi

[R] A easy way to write formula

2008-07-27 Thread Jinsong Zhao
Hi I have a data frame, including x1, x2, x3, and y. I use lm() to fit second-order linear model, like the following: ft <- lm(y ~ x1 + x2 + x3 + I(x1 * x1) + I(x1 * x2) + I(x1 * x3) + I(x2 * x2) + I(x2 * x3) + I(x3 * x3), mydata) if the independent variable number is large, the formula will be

[R] Retain plot?

2008-07-27 Thread rkevinburton
Every time I issue a plot command it removes the current plot and replaces it with the plot that I just issued. I would like to keep both plots. I looked in the documentation and found plot.new but was unable to get it to work. I think I want that functionality. Any suggestions? Thank you. Kev

Re: [R] S4 : setGeneric for classical methods

2008-07-27 Thread cgenolin
Martin Maechler <[EMAIL PROTECTED]> a écrit : "CG" == Christophe Genolini <[EMAIL PROTECTED]> on Sat, 26 Jul 2008 12:12:12 +0200 writes: CG> Martin Maechler <[EMAIL PROTECTED]> a écrit : >>> "CG" == Christophe Genolini <[EMAIL PROTECTED]> >>> on Tue, 22

Re: [R] Complex to polar?

2008-07-27 Thread Prof Brian Ripley
Please read ?complex. On Sun, 27 Jul 2008, [EMAIL PROTECTED] wrote: I am using fft(x) to compute the fft of a real-valued sequence. This returns (as expected an array of complex numbers. Is ther an R function to transform these complex numbers into two arrays for the magnitude and phase? Basi

[R] Complex to polar?

2008-07-27 Thread rkevinburton
I am using fft(x) to compute the fft of a real-valued sequence. This returns (as expected an array of complex numbers. Is ther an R function to transform these complex numbers into two arrays for the magnitude and phase? Basically polar notation? Thank you. Kevin _