Re: [R] Trouble passing list or non-list to function using ...

2006-05-26 Thread Gabor Grothendieck
Its not clear from your post which of the tests does not give you the desired output and what the desired output is in that case. Just guessing but maybe you meant to use testlist[[i]] instead of testlist[i] in the loop? On 5/26/06, Jason Barnhart <[EMAIL PROTECTED]> wrote: > Hello, > > Simply p

[R] Trouble passing list or non-list to function using ...

2006-05-26 Thread Jason Barnhart
Hello, Simply put, I'm trying to call a function "testme" with value "age=NA". I wish to use "dotlist<-list(...)" inside the function and have dotlist become: $age [1] NA I'm modifying existing code and need to minimize changing that code so it's easiest to conform how I call the existing f

[R] Building V2.3.0 on Tru64 V5.1B

2006-05-26 Thread Ravi, Narendra, INFOT
Hi, I am going to be attempting a build of R for the alphas (our main need is to collate and present graphically, performance metrics we gather on our applications). We have: CC=cc, CXX=cxx, Fortran V5.51 (f77, f95), GNU make 3.80, Perl 5.8.4 I am hesitant to rebuild GCC on this platform

Re: [R] Too many open files

2006-05-26 Thread Gabor Grothendieck
Try closeAllConnections() On 5/26/06, Omar Lakkis <[EMAIL PROTECTED]> wrote: > This may be more of an OS question ... > I have this call > > r = get.hist.quote(symbol, start= format(start, "%Y-%m-%d"), end= > format(end, "%Y-%m-%d")) > which does a url request > > in a loop and my program runs out

Re: [R] Too many open files

2006-05-26 Thread Seth Falcon
"Omar Lakkis" <[EMAIL PROTECTED]> writes: > This may be more of an OS question ... > I have this call > > r = get.hist.quote(symbol, start= format(start, "%Y-%m-%d"), end= > format(end, "%Y-%m-%d")) > which does a url request > > in a loop and my program runs out of file handlers after few hundred

[R] Too many open files

2006-05-26 Thread Omar Lakkis
This may be more of an OS question ... I have this call r = get.hist.quote(symbol, start= format(start, "%Y-%m-%d"), end= format(end, "%Y-%m-%d")) which does a url request in a loop and my program runs out of file handlers after few hundred rotations. The error message is: 'Too many open files'.

Re: [R] R.oo question

2006-05-26 Thread Henrik Bengtsson
On 5/26/06, Omar Lakkis <[EMAIL PROTECTED]> wrote: > This is a simple R.oo question but I, thankfully, hope that someone > would explain it to me so I would better understand this work frame. > I create this class: > > setConstructorS3("MyExample", function(param=0) { > print(paste("called with p

Re: [R] R newbie attempting to plot data

2006-05-26 Thread Chuck Cleland
Rex Eastbourne wrote: > Hi, > > I just started using R and am having trouble with the below error: > > I type: > >> df <- read.csv("/home/rex/Desktop/mytable.csv") > > which gives me what I want: > > ... > 639 2006-05-26 16:46:54 4 16 > 640 2006-05-26 17:05:36 5 17 > 641 2006-05-26

[R] R newbie attempting to plot data

2006-05-26 Thread Rex Eastbourne
Hi, I just started using R and am having trouble with the below error: I type: > df <- read.csv("/home/rex/Desktop/mytable.csv") which gives me what I want: ... 639 2006-05-26 16:46:54 4 16 640 2006-05-26 17:05:36 5 17 641 2006-05-26 17:30:48 6 17 But now I try: > plot(df[4

[R] R.oo question

2006-05-26 Thread Omar Lakkis
This is a simple R.oo question but I, thankfully, hope that someone would explain it to me so I would better understand this work frame. I create this class: setConstructorS3("MyExample", function(param=0) { print(paste("called with param=", param)) extend(Object(), "MyExample", .param = p

Re: [R] missed ylim from plot.default

2006-05-26 Thread Greg Snow
Try the following function to see if it does what you want. The basic syntax for your example would be: > tmp <- squishplot( xlim=c(-0.5,7), ylim=c(-0.5,2.8), asp=1 ) > plot(1:5, rep(1,5), xlim=c(-0.5,7), ylim=c(-0.5,2.8)) > par(tmp) # reset plotting region for future plots The function definiti

Re: [R] PC rotation question

2006-05-26 Thread Sasha Pustota
I wrote: > On p. 48 of "Statistics Complements" to the 3rd MASS edition, > http://www.stats.ox.ac.uk/pub/MASS3/VR3stat.pdf > I read that the orthogonal rotations of Z Lambda^-1 remain > uncorrelated, where Z is the PC and Lambda is the diag matrix of > singular values. However, the example below th

Re: [R] how to get a series of results by "loop"

2006-05-26 Thread Gabor Grothendieck
Try this: set.seed(1) r <- .1 n <- 5 test <- data.frame(sp = paste("sp", 1:n, sep = ""), x= rnorm(n), y = rnorm(n)) r <- 1 # radius f <- function(i) cbind(orig = test[i,1], subset(test, (x - x[i])^2 + (y - y[i])^2 < r^2)) do.call("rbind", lapply(1:n, f)) On 5/26/06, zhang jian <[EMAIL PROTECTED]

Re: [R] find position to last number in a vector

2006-05-26 Thread apjaworski
I am sure there are several ways of doing this but how about something like this: y <- c(NA,NA,10,NA,2,NA,NA,1,NA,NA) x <- c(10,20,30,40,50,60,70,80,85,100) tail(x[!is.na(y)], 1) or rev(x[!is.na(y)])[1] Rudimentary checks indicate that the second expression is much faster than the first. Also

Re: [R] Maximum likelihood estimate of bivariatevonmises-weibulldistribution

2006-05-26 Thread Chaouch, Aziz
Thanks Ravi! That's probably more than what I need. I suppose I'll have to get back to you for some more explanations but for now I'm trying to apply the log-likelihood (likelihood) that you defined to the fitdistr function or use the log-likelihood with optim(). Thanks again, that's really helpfu

[R] pdf output incompatible with latest ghostscript

2006-05-26 Thread ivo welch
I just upgraded to the latest ghostscript, AFPL 8.54. When I run the R output through gs, I get AFPL Ghostscript 8.54: Set UseCUEColor for UseDeviceIndependentColor to work properly. followed by a segfault. the resulting ghostscript file is incomplete (no %%EOF). probably a ghostscript bug, bu

Re: [R] find position to last number in a vector

2006-05-26 Thread Liaw, Andy
Is this what you want? > x [1] NA NA 10 NA 2 NA NA 1 NA NA > y [1] 10 20 30 40 50 60 70 80 85 100 > y[max(which(!is.na(x)))] [1] 80 Andy From: Anders Bjørgesæter > > Hello > > Is there a function to extract the position (i.e. row number or more > desirable the value from another

[R] curve peeling

2006-05-26 Thread Greg Tarpinian
R2.3.0, WinXP. I am trying to fit the model Y(t) = C1*exp(-exp(a)*t) + C2*exp(-exp(b)*t) - (C1+C2)*exp(-exp(c)*t) to some pharmacokinetic data. The data derives from a single oral dose of a drug. Does anyone know how to use peeling and/or other methods to obtain good starting estimates of

[R] find position to last number in a vector

2006-05-26 Thread Anders Bjørgesæter
Hello Is there a function to extract the position (i.e. row number or more desirable the value from another column with the same rownumber ) of last number in a vector? This is done in a loop with 1000s of columns. e.g. vector/column.n: na,na,10,na,2,na,na,1,na,na fixed column:10,20,30,40,50,6

Re: [R] how to pick a value from AR equation

2006-05-26 Thread Marco Geraci
Ciao, you didn't provide lots of details so I'll try to answer your questions with examples you can find typing ?PP.test and ?ar. In general, when you run a command in R you get an output. You just need to understand what kind of object you get. For the PP.test > x <- rnorm(1000) > pp <- PP.test(x

Re: [R] how to get a series of results by "loop"

2006-05-26 Thread zhang jian
I donot know how to do it remainly. Perhaps my question is not clear. For example, test=data.frame(sp=paste(c("sp"),1:100,sep=""),x=rnorm(100),y=rnorm(100)) # I want to get the data in the circle of radius = 1 in every point, and I want to add a sign (e.g. sp1,sp2) in order that I can disting

Re: [R] I cannot load the package "Rcmdr"

2006-05-26 Thread Prof Brian Ripley
On Fri, 26 May 2006, John Fox wrote: > Dear Zhang Jian, > > Is it possible that you're using a version of the Rcmdr package that's > incompatible with your version of R? That ought to have generated an error much earlier, but of course the dependencies in an old version of Rcmdr might not have b

Re: [R] how to pick a value from AR equation

2006-05-26 Thread Lorenzo Bencivelli
ok, i'll try to be more precise. both functions i need (ar() and PP.test()) are in the package stats. what i would like to do: omega<-array(0, dim=c(N+1,7)) omega[1,]<-("series","mean","std","max","min","ar(1)coeff","stdar(1)") for (i in (2:N+1)){ omega[i,1]<-i-1 omega[i,2]<-mean(y

Re: [R] how to pick a value from AR equation

2006-05-26 Thread Rogerio Porto
Lorenzo, in order to help you more, you should consider sending to the list some relevant code with the functions and packages you are using. Rogerio. - Original Message - From: "Lorenzo Bencivelli" <[EMAIL PROTECTED]> To: Sent: Friday, May 26, 2006 1:21 PM Subject: [R] how to pick a va

Re: [R] Returned mail: Data format error

2006-05-26 Thread hci
Hello, Your mail to [EMAIL PROTECTED] was caught by the SpamAssassin filter running on the bcs.org.uk mail system. To confirm that your mail is genuine, please click this link, or paste it into your browser: https://bcsnet.bcs.org.uk/approve.php?c=66e3c8769c1611445312f4 You will not have to do t

[R] combinatorial programming problem

2006-05-26 Thread Kjetil Brinchmann Halvorsen
Hola! I am programming a class (S3) "symarray" for storing the results of functions symmetric in its k arguments. Intended use is for association indices for more than two variables, for instance coresistivity against antibiotics. There is one programming problem I haven't solved, making an inver

Re: [R] I cannot load the package "Rcmdr"

2006-05-26 Thread John Fox
Dear Zhang Jian, Is it possible that you're using a version of the Rcmdr package that's incompatible with your version of R? (I won't have access to email this weekend, so will be unable to reply until Monday to your response.) I hope this helps, John On Fri, 26 May 2006 09:52:31 -0400 "zhang

[R] how to pick a value from AR equation

2006-05-26 Thread Lorenzo Bencivelli
i need to compute several (hundreds) of regression AR and PP.test for untary roots. is there an easy way to pick the values of interest from the output of these operations? i would like to fill a matrix (in a for cycle) with all the values of coefficients, standard deviations, PP statistics and

Re: [R] Maximum likelihood estimate of bivariatevonmises-weibulldistribution

2006-05-26 Thread Ravi Varadhan
Hi Aziz, I am attaching a file that contains the functions that I wrote to compute the MLE for a binary vonMises mixture, using the EM algorithm. It also contains a simulation example. Let me know if you have any trouble. Hope this is helpful, Ravi.

Re: [R] upgrade or recompile

2006-05-26 Thread Uwe Ligges
Mike Wolfgang wrote: > Dear list, > > My current R 2.2.0 in my linux desktop was installed by compiling sources, > now I want to upgrade it to 2.3.0, is it possible to upgrade it without > re-compiling sources? Thanks, No, except if installing a binary distribution. BTW: You might want to try an

Re: [R] Maximum likelihood estimate of bivariate vonmises-weibulldistribution

2006-05-26 Thread Chaouch, Aziz
Hi, I'm still strugling with this copula model but this seems to be the way to go. I'm now trying to model the marginal distributions and and for wind direction I use a mixture of 2 von mises. I'd like to estimate all the parameters (m1,m1,kappa1,kappa2,p) by maximizing the likelihood but I don't

[R] multiple comparisons of time series data

2006-05-26 Thread Kyle Hall
I am interested in a statistical comparison of multiple (5) time series' generated from modeling software (Hydrologic Simulation Program Fortran). The model output simulates daily bacteria concentration in a stream. The multiple time series' are a result of varying our representation of the stre

[R] upgrade or recompile

2006-05-26 Thread Mike Wolfgang
Dear list, My current R 2.2.0 in my linux desktop was installed by compiling sources, now I want to upgrade it to 2.3.0, is it possible to upgrade it without re-compiling sources? Thanks, mike [[alternative HTML version deleted]] __ R-help@sta

Re: [R] how to multiply a constant to a matrix?

2006-05-26 Thread Tony Plate
I still can't see why this is a problem. If a 1x1 matrix should be treated as a scalar, then it can just be wrapped in drop(), and the arithmetic will be computed correctly by R. Are there any cases where this cannot be done? More specifically, are there any matrix algebra expressions where,

Re: [R] Is there a way to draw 3d plot?

2006-05-26 Thread Greg Snow
There is also the rotate.persp function in the TeachingDemos package. It creates a set of slider bars that you can move with the mouse to change the different options to persp including the angles. It is not quite as convenient as clicking in the plot and dragging like rgl allows, but it does have

Re: [R] Function as.Date leading to error implying that strptime requires 3 arguments

2006-05-26 Thread Rob Balshaw
Thank you to Prof Ripley, Gabor Grothendieck, Dirk Eddelbuettel and others who emailed with suggestions and comments. Dr Ripley's suggestion that I reinstall appears to have fixed the problem, though I confess I have upgraded only to 2.3.0 rather than the beta 2.3.1. I use Windows XP Pro, Service

[R] MART(tm) vs. gbm

2006-05-26 Thread manuel.martin
Hello, I have been using two different implementations of the stochastic gradient boosting (Friedman 2002) : MART(tm) with R and the gbm package. Both are fairly comparable except that the MART with R systematically strongly (depending on the dataset though) outperforms the gbm tool in terms of

[R] I cannot load the package "Rcmdr"

2006-05-26 Thread zhang jian
I can load the package in other R file, but I can not do it in the file. How to solve the question? > local({pkg <- select.list(sort(.packages(all.available = TRUE))) + if(nchar(pkg)) library(pkg, character.only=TRUE)}) Loading required package: tcltk Loading required package: car Error in parse(f

[R] MART(tm) vs. gbm

2006-05-26 Thread manuel martin
Hello, I tried two different implementations of the stochastic gradient boosting (Friedman 2002) : the MART(tm) with R tool (http://www-stat.stanford.edu/~jhf/R-MART.html) and the gbm R package. To me, both seemed fairly comparable, except maybe regarding the different loss criterion proposed a

Re: [R] changing font size in plot(effect())

2006-05-26 Thread John Fox
Dear Peter, OK -- I see that this works as advertized. Thanks, John On Fri, 26 May 2006 07:12:52 -0600 P Ehlers <[EMAIL PROTECTED]> wrote: > No, I don't think so, John. I think what I proposed is > Deepayan's newer way of setting parameters. I used to do it the > other way, too (S-PLUS may sti

Re: [R] query: sample size calculation

2006-05-26 Thread P Ehlers
[EMAIL PROTECTED] wrote: > Dear all, > > I am doing something wrong. > > I am trying to apply a formula for sample size calculation as in the book > "Design and Analysis of Clinical Trials", from Chow et all. > > There a suggested sample size strategy uses the formula > > 0.30/0.45=F(0.80,2n,

Re: [R] Try to debbug R script

2006-05-26 Thread Cuvelier Etienne
LAURENS, Guillaume a écrit : > Hi, > > I have a bug and I don't find it. Can u help me please. > > In attachement : > - My script file : CPU_study.txt > - My data sample file : a.txt > > When I use it, the error message is : >> source("H:/R/_workspace/CPU_study_1.R") > Erreur dans "[<-"(`*tmp*`

Re: [R] changing font size in plot(effect())

2006-05-26 Thread P Ehlers
No, I don't think so, John. I think what I proposed is Deepayan's newer way of setting parameters. I used to do it the other way, too (S-PLUS may still need it), but I find this new way very handy, since it avoids the get/save/alter/set process. Try this: trellis.device() trellis.par.set(list(axi

Re: [R] Try to debbug R script

2006-05-26 Thread Duncan Murdoch
On 5/26/2006 8:45 AM, LAURENS, Guillaume wrote: > Hi, > > I have a bug and I don't find it. Can u help me please. > > In attachement : > - My script file : CPU_study.txt > - My data sample file : a.txt > > When I use it, the error message is : >> source("H:/R/_workspace/CPU_study_1.R") > Erreur

[R] query: sample size calculation

2006-05-26 Thread ManuelPerera-Chang
Dear all, I am doing something wrong. I am trying to apply a formula for sample size calculation as in the book "Design and Analysis of Clinical Trials", from Chow et all. There a suggested sample size strategy uses the formula 0.30/0.45=F(0.80,2n,2n)/F(0.025,2n,2n) which gives n=96, as in t

[R] Try to debbug R script

2006-05-26 Thread LAURENS, Guillaume
Hi, I have a bug and I don't find it. Can u help me please. In attachement : - My script file : CPU_study.txt - My data sample file : a.txt When I use it, the error message is : > source("H:/R/_workspace/CPU_study_1.R") Erreur dans "[<-"(`*tmp*`, i, k, value = numeric(0)) : rien à remplac

Re: [R] Computing a reliability index of a statistic with missing data

2006-05-26 Thread Chaouch, Aziz
Thanks Spencer, that is interesting but I must say I'm a bit lost with the terminology. I'll try to catch up but I'm not sure I need a complicated model (MC sounds complicated to me but it may not be...). I plan to use this reliability index just as an indication and I need to compute it in batch

[R] lme, best model without convergence

2006-05-26 Thread Thomas Wutzler
Dear R-help list readers, I am fitting mixed models with the lme function of the nlme package. If I get convergence depends on how the method (ML/REM) and which (and how much) parameters will depend randomly on the cluster-variable. How get the bist fit without convergence? I set the paramet

[R] Thanks for help

2006-05-26 Thread Thomas Wutzler
Hello David and Spencer, thank you for your replies! The systemfit-package was exactly what I was looking for. The only little drawback is, that the nonlinear systemfit does not support predifined weights yet (in oder to ensure homegenity of variances when predictios are hetescedastic) Thanks a

Re: [R] Is there a way to draw 3d plot?

2006-05-26 Thread Duncan Murdoch
On 5/26/2006 3:39 AM, Antonio, Fabio Di Narzo wrote: > 2006/5/26, Michael <[EMAIL PROTECTED]>: >> On 5/26/06, Uwe Ligges <[EMAIL PROTECTED]> wrote: >>> Michael wrote: >>> Hi all, I have a 2D matrix, which has 100 rows, and 100 columns, I have a 2D matrix, with 100 rows and

[R] Simulate Strauss process in 3D

2006-05-26 Thread Adrian Baddeley
Apple Ho writes: > I am searching some information about simulating Strauss process in 3D If you need this immediately, I suggest you follow Brian Ripley's advice. This probably involves downloading a source tar file of the R package and finding the Fortran code in library/spatial/src/. The Fort

Re: [R] Vector elements and ratios

2006-05-26 Thread David Hugh-Jones
> outer(c(20,40,20,60), c(5,4,2), "/") [,1] [,2] [,3] [1,]45 10 [2,]8 10 20 [3,]45 10 [4,] 12 15 30 cheers D On 26/05/06, Andrej Kastrin <[EMAIL PROTECTED]> wrote: > Dear useRs, > > I have two different length vectors: one column (1...m) and one row > vecto

Re: [R] Vector elements and ratios

2006-05-26 Thread jim holtman
?outer > v1 <- c(20,40,20,60) > v2 <- c(5,4,2) > outer(v1,v2,'/') [,1] [,2] [,3] [1,]45 10 [2,]8 10 20 [3,]45 10 [4,] 12 15 30 > On 5/26/06, Andrej Kastrin <[EMAIL PROTECTED]> wrote: > > Dear useRs, > > I have two different length vectors: one column (1...m

Re: [R] Vector elements and ratios

2006-05-26 Thread Chuck Cleland
Andrej Kastrin wrote: > Dear useRs, > > I have two different length vectors: one column (1...m) and one row > vector (1...n): > > 20 > 40 > 20 > 60 > > 5 4 2 > > Now I have to calculate ratios between column vector elements and each > row vector elements: > > 4 5 10 > 8 10 20 > 4 5 20 > 15 1

[R] Vector elements and ratios

2006-05-26 Thread Andrej Kastrin
Dear useRs, I have two different length vectors: one column (1...m) and one row vector (1...n): 20 40 20 60 5 4 2 Now I have to calculate ratios between column vector elements and each row vector elements: 4 5 10 8 10 20 4 5 20 15 12 30 Thank's in advance for any suggestions, Andrej _

Re: [R] factors and ops

2006-05-26 Thread Gabor Grothendieck
Try an ordered factor: subset(HR, ordered(Patient) > 214) or HR$Patient <- ordered(HR$Patient) subset(HR, Patient > 214) You might also check that it orders them in the way you want. ordered(HR$Patient) in the first case or just HR$Patient in the second case will display the data followed

Re: [R] changing font size in plot(effect())

2006-05-26 Thread John Fox
Dear Peter, Won't that wipe out the other components of axis.text, etc.? Regards, John On Thu, 25 May 2006 06:22:22 -0600 P Ehlers <[EMAIL PROTECTED]> wrote: > > John Fox wrote: > > > Dear Emilie, > > > > This is, I guess, the effect() function in the effects package. If > so, > > note that

Re: [R] Indexing vector with repeated values

2006-05-26 Thread Uwe Ligges
Andris Jankevics wrote: > Hi all, > I have a vector which contains many repeated values. > > >>Z <- c(1,2,3,4,5,1,2,3,4,5,1,2,3,5,5,2,3,4,5) > > > I need to know how many times each number in this vecetor is repeated. > I can use a command like this: > > >>table (cut(Z,seq(1,5,1))) Why not

Re: [R] Is there a way to draw 3d plot?

2006-05-26 Thread Antonio, Fabio Di Narzo
2006/5/26, Michael <[EMAIL PROTECTED]>: > > On 5/26/06, Uwe Ligges <[EMAIL PROTECTED]> wrote: > > > > Michael wrote: > > > > > Hi all, > > > > > > I have a 2D matrix, which has 100 rows, and 100 columns, > > > > > > I have a 2D matrix, with 100 rows and 100 columns, > > > > > > I want to display it

[R] Labels in cluster plots

2006-05-26 Thread Sasha Pustota
I'm trying to follow an example from ?clara, which plots two clusters: > x <- rbind(cbind(rnorm(10,0,8), rnorm(10,0,8)), cbind(rnorm(20,50,8), rnorm(20,50,8))) > clarax <- clara(x, 2) > clusplot(clarax) Suppose I'd like to label these 30 observations on the plot according t

[R] Indexing vector with repeated values

2006-05-26 Thread Andris Jankevics
Hi all, I have a vector which contains many repeated values. >Z <- c(1,2,3,4,5,1,2,3,4,5,1,2,3,5,5,2,3,4,5) I need to know how many times each number in this vecetor is repeated. I can use a command like this: > table (cut(Z,seq(1,5,1))) (1,2] (2,3] (3,4] (4,5] 4 4 3 5 But ho

Re: [R] missed ylim from plot.default

2006-05-26 Thread Antonio, Fabio Di Narzo
2006/5/26, Peter Ehlers <[EMAIL PROTECTED]>: > > > Antonio, Fabio Di Narzo wrote: > > > Hi all. > > On my R-2.3.0, calling: > > > > > >>plot(1:5, rep(1,5), xlim=c(-0.5,7), ylim=c(-0.5,2.8), asp=1) > > > > > > gives to me a plot (tried pdf and X11) whose y axis goes from about -2 > to > > about 4.5

Re: [R] Is there a way to draw 3d plot?

2006-05-26 Thread Michael
On 5/26/06, Uwe Ligges <[EMAIL PROTECTED]> wrote: > > Michael wrote: > > > Hi all, > > > > I have a 2D matrix, which has 100 rows, and 100 columns, > > > > I have a 2D matrix, with 100 rows and 100 columns, > > > > I want to display it using 3D plot, much like plot3d and mesh/surf > functions > > i

Re: [R] Is there a way to draw 3d plot?

2006-05-26 Thread Uwe Ligges
Michael wrote: > Hi all, > > I have a 2D matrix, which has 100 rows, and 100 columns, > > I have a 2D matrix, with 100 rows and 100 columns, > > I want to display it using 3D plot, much like plot3d and mesh/surf functions > in matlab. > > Specifically, in matlab, I just need to do the followin

[R] Distribution Fitting

2006-05-26 Thread Lorenzo Isella
Hi, I know this is a bit off-topic, but I am quite puzzled. I am going through several papers about aerosol physics and in this field you often have determine the parameters of a distribution to match your experimental data (one typically uses a Gaussian mixture). However, in many cases people plot