Re: [R] How to change the value of a class slot

2005-06-08 Thread Uwe Ligges
Ross Boylan wrote: On Tue, 2005-06-07 at 08:36 +0200, Uwe Ligges wrote: Ross Boylan wrote: On Sat, Jun 04, 2005 at 07:08:56PM +0200, Martin Maechler wrote: Ross nextPath - function(pm){ #pm is a CompletePathMaker Ross[EMAIL PROTECTED] - [EMAIL PROTECTED](1) Ross [etc] If your

[R] matrix

2005-06-08 Thread Navarre Sabine
hi, is it possible to create a matrix with one row and according to add a row? in fact, at present, I'm doing an algorithm which fill a matrix. On the web site of CRAN, the package basic is impossible to be load! can you tell me where i can found it! Thanks Sabine

Re: [R] matrix

2005-06-08 Thread Achim Zeileis
On Wed, 8 Jun 2005 10:37:15 +0200 (CEST) Navarre Sabine wrote: hi, is it possible to create a matrix with one row and according to add a row? in fact, at present, I'm doing an algorithm which fill a matrix. I think you are looking for ?rbind and might also be interested in looking at An

Re: [R] matrix

2005-06-08 Thread Uwe Ligges
Achim Zeileis wrote: On Wed, 8 Jun 2005 10:37:15 +0200 (CEST) Navarre Sabine wrote: hi, is it possible to create a matrix with one row and according to add a row? in fact, at present, I'm doing an algorithm which fill a matrix. I think you are looking for ?rbind and might also be

Re: [R] matrix

2005-06-08 Thread Romain Francois
Le 08.06.2005 10:37, Navarre Sabine a écrit : hi, is it possible to create a matrix with one row and according to add a row? in fact, at present, I'm doing an algorithm which fill a matrix. ?rbind When you know the final size of your matrix, it is better to create a full matrix and then

[R] CRAN task view for genetics

2005-06-08 Thread Gorjanc Gregor
Hello to everyone! I have built CRAN task view for genetics. For now I have not submit it to CRAN yet and it can be accessible from: http://www.bfro.uni-lj.si/MR/ggorjan/software/R/Genetics.html http://www.bfro.uni-lj.si/MR/ggorjan/software/R/Genetics.ctv I have not submitted it to CRAN, since

Re: [R] Specifying medoids in PAM?

2005-06-08 Thread Martin Maechler
David == David Finlayson [EMAIL PROTECTED] on Tue, 7 Jun 2005 12:11:25 -0700 writes: David I am using the PAM algorithm in the CLUSTER library. David When I allow PAM to seed the medoids using the default __build__ David algorithm things work David well:

Re: [ESS] Re: [R] Strange characters in 2.1.0?

2005-06-08 Thread Martin Maechler
PaCo == Patrick Connolly [EMAIL PROTECTED] on Wed, 8 Jun 2005 11:31:44 +1200 writes: PaCo On Tue, 07-Jun-2005 at 04:10PM +0200, Martin Maechler wrote: PaCo | Dan == Dan Bolser [EMAIL PROTECTED] PaCo | .. PaCo | PaCo | Dan I have gone back to 2.0.0 :)

[R] Overlaying Barplots

2005-06-08 Thread Sven C. Koehler
Hello! I would like to overlay barplot(1:10) with a barplot(seq(1:5, each=2)), indicating that 50% of each bar belongs to category X. How do I do this in R? Best wishes, Sven C. Koehler __ R-help@stat.math.ethz.ch mailing list

[R] Fitting Theoretical Distributions to Daily Rainfall Data

2005-06-08 Thread Mohammad Ehsanul Karim
Dear List Members, I need a bit help about fitting some theoretical distributions (such as geometric, exponential, lognormal or weibull distribution) to the following *dry spell*, *wet spell*, *cycles (Wet-Dry or Dry-Wet)* from my meteorological (daily rainfall) data

[R] Fitting Theoretical Distributions to Daily Rainfall Data

2005-06-08 Thread Ken Knoblauch
Have a look at the fit.dist function in Jim Lindsey's gnlm package at http://popgen0146uns50.unimaas.nl/~jlindsey/rcode.html fit.dist {gnlm} R Documentation Fit Probability Distributions to Frequency Data Description fit.dist fits the distributions in Chapter 4 of Lindsey (1995, 2003 2nd edn):

[R] bug in predict.lme?

2005-06-08 Thread Arne.Muller
Dear All, I've come across a problem in predict.lme. Assigning a model formula to a variable and then using this variable in lme (instead of typing the formula into the formula part of lme) works as expect. However, when performing a predict on the fitted model I gan an error messag -

Re: [R] How to change the value of a class slot

2005-06-08 Thread Thomas Petzoldt
Ross Boylan wrote: I defined an S4 class with a slot i. Then I wrote a regular function that attempted to increment i. [... details deleted ...] What do I need to do to update slot values? Here are some possibly relevant code fragments setClass(CompletePathMaker,

[R] Robustness of Segmented Regression Contributed by Muggeo

2005-06-08 Thread Park, Kyong H Mr. RDECOM
Hello, R users, I applied segmented regression method contributed by Muggeo and got different slope estimates depending on the initial break points. The results are listed below and I'd like to know what is a reasonable approach handling this kinds of problem. I think applying various initial

Re: [R] Overlaying Barplots

2005-06-08 Thread Martyn Plummer
On Wed, 2005-06-08 at 12:07 +0200, Sven C. Koehler wrote: Hello! I would like to overlay barplot(1:10) with a barplot(seq(1:5, each=2)), indicating that 50% of each bar belongs to category X. How do I do this in R? If you pass a matrix to barplot, it will stack values from the same column

Re: [R] Robustness of Segmented Regression Contributed by Muggeo

2005-06-08 Thread roger koenker
You might try rqss() in the quantreg package. It gives piecewise linear fits for a nonparametric form of median regression using total variation of the derivative of the fitted function as a penalty term. A tuning parameter (lambda) controls the number of distinct segments. More details

Re: [R] Robustness of Segmented Regression Contributed by Muggeo

2005-06-08 Thread Achim Zeileis
On Wed, 8 Jun 2005 08:25:16 -0400 Park, Kyong H Mr. RDECOM wrote: Hello, R users, I applied segmented regression method contributed by Muggeo and got different slope estimates depending on the initial break points. The results are listed below and I'd like to know what is a reasonable

[R] Random seed problem in MCMC coupling of chains

2005-06-08 Thread Gorjanc Gregor
Hello! I am performing coupling of chains in MCMC and I need the same value of seed for two chains. I will show demo of what I want: R code, which might show my example is: niter - 3 nchain - 2 tmpSeed - 123 for (i in 1:niter) { # iterations for (j in 1:nchain) { # chains set.seed(tmpSeed)

[R] Converting code from MATLAB to R

2005-06-08 Thread Martin Englund
Hi, I'm having trouble converting code from MATLAB to R; I want to find the equivalence to MATLAB's function 'fsolve'. I've tried 'nlm', on the squared argument, in R but i did not get the same results. Thankful if helped. Best regards, Martin Englund

[R] RODBC question: problem importing series with blank cells

2005-06-08 Thread Lapointe, Pierre
Hello, I have an excel file that I load through RODBC. Some of my columns are blank. They are equity time series and the stocks did not exist at the earlier dates. My problem is that the whole column becomes NA even though there are numbers at later dates. Here's my excel file

Re: [R] Random seed problem in MCMC coupling of chains

2005-06-08 Thread Dimitris Rizopoulos
do you want something like this: niter - 3 nchain - 2 rs - sample(500, niter, TRUE) for (i in 1:niter) { # iterations for (j in 1:nchain) { # chains set.seed(rs[i]) a - runif(1) cat(iter:, i, chain:, j, runif:, a, \n) } } I hope it helps. Best, Dimitris Dimitris Rizopoulos

Re: [R] Random seed problem in MCMC coupling of chains

2005-06-08 Thread Duncan Murdoch
On 6/8/2005 9:27 AM, Gorjanc Gregor wrote: Hello! I am performing coupling of chains in MCMC and I need the same value of seed for two chains. I will show demo of what I want: R code, which might show my example is: niter - 3 nchain - 2 tmpSeed - 123 for (i in 1:niter) { # iterations for (j

[R] Converting code from MATLAB to R

2005-06-08 Thread Martin Englund
Hi, I'm having trouble converting code from MATLAB to R; I want to find the equivalence to MATLAB's function 'fsolve'. I've tried 'nlm', on the squared argument, in R but i did not get the same results. Thankful if helped. Best regards, Martin Englund

Re: [R] how to run a script at the beginning of an interacive session ?

2005-06-08 Thread Marc Schwartz
On Tue, 2005-06-07 at 21:33 -0700, Mike R wrote: On 6/7/05, Marc Schwartz [EMAIL PROTECTED] wrote: On 6/7/05, Gabor Grothendieck [EMAIL PROTECTED] wrote: On 6/7/05, Liaw, Andy [EMAIL PROTECTED] wrote: snips Thanks Andy, Gabor and Marc. contents of .Rprofile .First -

Re: [R] RODBC question: problem importing series with blank cells

2005-06-08 Thread Prof Brian Ripley
On Wed, 8 Jun 2005, Lapointe, Pierre wrote: Hello, I have an excel file that I load through RODBC. Some of my columns are blank. They are equity time series and the stocks did not exist at the earlier dates. My problem is that the whole column becomes NA even though there are numbers at

Re: [R] Converting code from MATLAB to R

2005-06-08 Thread Robin Hankin
Hi Martin optim() should do the trick [and this isn't in R-and-octave2.txt; I'll update when I get a minute] HTH rksh On Jun 8, 2005, at 02:27 pm, Martin Englund wrote: Hi, I'm having trouble converting code from MATLAB to R; I want to find the equivalence to MATLAB's function

Re: [R] Bounding or constraining parameters in non-linear regressions

2005-06-08 Thread Douglas Bates
On 6/7/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Dear R-Users, Being an engineer and not a statistician, my desired course of action may either be impossible or very simple. I am attempting to fit a non-linear model to some measured data. One term in the model contains a

[R] variable png-size in multiple figure environment

2005-06-08 Thread Claude Théato Kobe
If I put only one plot in a png, I can drag the generated png on the edges and it changes its size by this. But when I put several plots on the same sheet using mfrow, the size can no longer be changed when viewing the file, and the resolution is bad. What do I need to do to keep the

[R] get level combinations from by list

2005-06-08 Thread bogdan romocea
Dear useRs, Given this code I end up with a list of class by: a - sample(1:5,200,replace=TRUE) b - sample(c(v1,v2,v3),200,replace=TRUE) c - sample(c(11,22,33),200,replace=TRUE) data - runif(200) grouped - by(data,list(a,b,c),function(x) {c(min=min(x),max=max(x),

RE: [R] Random seed problem in MCMC coupling of chains

2005-06-08 Thread Gorjanc Gregor
Thanks to Duncan, Dimitris as well as James for answers. I'll provide here also example from James, which seems to be the easiest of them all and was not posted to the list: niter - 3 nchain - 2 for (i in 1:niter) { # iterations for (j in 1:nchain) { # chains set.seed(i) a - runif(1)

Re: [R] Random seed problem in MCMC coupling of chains

2005-06-08 Thread Paul Gilbert
The tools in setRNG are intended for this kind of problem and I do use them regularly in much more complicated situations. They help save all the information, in addition to the seed, that you need for reproducible simulations. Try niter - 3 nchain - 2 for (i in 1:niter) { # iterations

Re: [R] get level combinations from by list

2005-06-08 Thread Chuck Cleland
Here is a different approach to achieving what I think you want using summarize() in the Hmisc package: library(Hmisc) mydata - data.frame(a = sample(1:5,200,replace=TRUE), b = sample(c(v1,v2,v3),200,replace=TRUE), c =

Re: [R] Random seed problem in MCMC coupling of chains

2005-06-08 Thread Paul Gilbert
Beware that your easy trick will give you the same result every time you run it. You need a better scheme if you actually intend to get a new experiment each time you run it. Paul Gorjanc Gregor wrote: Thanks to Duncan, Dimitris as well as James for answers. I'll provide here also example

[R] Solve f(x) = 0

2005-06-08 Thread Fredrik Thuring
Hi! I´m need a function that solves the equation f(x) = 0 (i.e. the root of the function) when f is a nonlinear function. Is there any? I´ve tried nlm and optim on the square of the function but the solution is very unstable. Thanks before hand. / Fredrik Thuring

Re: [R] variable png-size in multiple figure environment

2005-06-08 Thread Marc Schwartz
On Wed, 2005-06-08 at 16:46 +0200, Claude Thato Kobe wrote: If I put only one plot in a png, I can drag the generated png on the edges and it changes its size by this. But when I put several plots on the same sheet using mfrow, the size can no longer be changed when viewing the file, and

Re: [R] get level combinations from by list

2005-06-08 Thread Dimitris Rizopoulos
I think these are not stored by by() and they are produced inside print.by(). One way to get them could be: dn - dimnames(grouped) dn - expand.grid(dn) dn - dn[!sapply(grouped[1:nrow(dn)], is.null), ] dn rownames(dfr) - apply(dn, 1, paste, collapse = -) dfr I hope it helps. Best, Dimitris

Re: [R] Solve f(x) = 0

2005-06-08 Thread Achim Zeileis
On Wed, 8 Jun 2005 17:08:35 +0200 Fredrik Thuring wrote: Hi! I´m need a function that solves the equation f(x) = 0 (i.e. the root of the function) when f is a nonlinear function. Is there any? I´ve tried nlm and optim on the square of the function but the solution is very unstable. Look

Re: [R] Solve f(x) = 0

2005-06-08 Thread Martyn Plummer
On Wed, 2005-06-08 at 17:08 +0200, Fredrik Thuring wrote: Hi! Im need a function that solves the equation f(x) = 0 (i.e. the root of the function) when f is a nonlinear function. Is there any? Ive tried nlm and optim on the square of the function but the solution is very unstable. Your

Re: [R] Solve f(x) = 0

2005-06-08 Thread Spencer Graves
Have you plotted f(x)? Plot(s) might help reveal why the solution is very unstable. If f is a function of a univariate x, this is trivial. If f is a function of a bivariate x, use something like contour or persp. If higher dimensions, I might use something like fit -

Re: [R] Random seed problem in MCMC coupling of chains

2005-06-08 Thread Gabor Grothendieck
That could be addressed like this (where changing the offset changes the experiment). offset - 123 niter - 3 nchain - 2 for (i in 1:niter) { # iterations for (j in 1:nchain) { # chains set.seed(i+offset) a - runif(1) cat(iter:, i, chain:, j, runif:, a, \n) } } On 6/8/05, Paul Gilbert

Re: [R] Specifying medoids in PAM?

2005-06-08 Thread Martin Maechler
David == David Finlayson [EMAIL PROTECTED] on Wed, 8 Jun 2005 09:24:54 -0700 writes: David Sorry, I wasn't trying to submit a bug report just yet. the posting guide asks you to provide reproducible examples, in any case, not just for bug reports ... {and strictly speaking, you still

RE: [R] Random seed problem in MCMC coupling of chains

2005-06-08 Thread Gorjanc Gregor
Thanks to Paul and Gabor for additional tips/examples. Actually, I find Pauls suggestion with setRNG also nice and is exactly what I wanted. Paul, if I understand this correctly, your suggestion with setRNG does not alter RNG flow, it just takes care that chains really have equal seeds. I

Re: [R] how to run a script at the beginning of an interacive session ?

2005-06-08 Thread Mike R
On 6/8/05, Marc Schwartz [EMAIL PROTECTED] wrote: snips Thanks Marc, Cool ideas, thanks! Building on them, here is a twist. With this line in .Rprofile: .First - function() {if(Sys.getenv(R_PROJECT)!=) source(Sys.getenv(R_PROJECT))} R can be run with this bash command line: ## export

Re: [R] Random seed problem in MCMC coupling of chains

2005-06-08 Thread Gabor Grothendieck
Here is a small variation. We define a list to hold the last seed for each chain. Each time we enter the simulation for a chain we use that seed and each time we exit we update it. The loop becomes simpler since the setup is all done prior to looping and everything else is done in the inner

Re: [R] Random seed problem in MCMC coupling of chains

2005-06-08 Thread Jan T. Kim
On Wed, Jun 08, 2005 at 12:55:07PM -0400, Gabor Grothendieck wrote: That could be addressed like this (where changing the offset changes the experiment). offset - 123 niter - 3 nchain - 2 for (i in 1:niter) { # iterations for (j in 1:nchain) { # chains set.seed(i+offset) a -

[R] install package snow

2005-06-08 Thread Steve Adams
Hi, I have difficulty in installing package snow from CRAN. Somehow, this package is not shown up in the available package list when I tried to use the GUI interface. So I have to go to CRAN to download the source file: snow_0.2-1.tar.gz. Then I tried to install it using the following command:

[R] Course***R/S-plus Programming at 4 locations - July 2005

2005-06-08 Thread sue
XLSolutions Corporation (www.xlsolutions-corp.com) is proud to announce 2-day R/S-plus Fundamentals and Programming Techniques at 4 locations nationwide. www.xlsolutions-corp.com/courselist.htm Seattle, WA - July 11th-12th, 2005 San Francisco

Re: [R] install package snow

2005-06-08 Thread Roger D. Peng
I think for 'snow' you need to download the source and build it yourself. I assume you are on Windows (you didn't say!). 'snow' depends on external programs so it would seem unwise to have a binary package on CRAN. -roger Steve Adams wrote: Hi, I have difficulty in installing package

Re: [R] install package snow

2005-06-08 Thread Prof Brian Ripley
Please do read the FAQ Q7.8. Once you have followed that, it should install from the sources (it does for me). However, to make it work you need other things which are non-trivial to get working on Windows: see http://www.stat.uiowa.edu/~luke/R/cluster/cluster.html for the

Re: [R] install package snow

2005-06-08 Thread Romain Francois
Le 08.06.2005 20:51, Steve Adams a écrit : Hi, I have difficulty in installing package snow from CRAN. Somehow, this package is not shown up in the available package list when I tried to use the GUI interface. So I have to go to CRAN to download the source file: snow_0.2-1.tar.gz. Then I tried

FW: [R] Random seed problem in MCMC coupling of chains

2005-06-08 Thread Gorjanc Gregor
And a last post from Paul Gilbert. Thanks to all! This disscusion was really beneficial for me! -Original Message- From: Paul Gilbert [mailto:[EMAIL PROTECTED] Sent: sre 2005-06-08 21:01 To: Gorjanc Gregor Subject: Re: [R] Random seed problem in MCMC coupling of chains Gorjanc Gregor

Re: [R] Random seed problem in MCMC coupling of chains

2005-06-08 Thread Kjetil Brinchmann Halvorsen
Gorjanc Gregor wrote: Thanks to Paul and Gabor for additional tips/examples. Actually, I find Pauls suggestion with setRNG also nice and is exactly what I wanted. Paul, if I understand this correctly, your suggestion with setRNG does not alter RNG flow, it just takes care that chains really

Re: FW: [R] Random seed problem in MCMC coupling of chains

2005-06-08 Thread Gabor Grothendieck
On 6/8/05, Gorjanc Gregor [EMAIL PROTECTED] wrote: And a last post from Paul Gilbert. -Original Message- From: Paul Gilbert [mailto:[EMAIL PROTECTED] In your example it is important that you generate the same number of random numbers in each pass through the chain. If that is not

Re: [R] how to run a script at the beginning of an interacive session ?

2005-06-08 Thread Marc Schwartz
On Wed, 2005-06-08 at 11:32 -0700, Mike R wrote: On 6/8/05, Marc Schwartz [EMAIL PROTECTED] wrote: snips Thanks Marc, Cool ideas, thanks! Building on them, here is a twist. With this line in .Rprofile: .First - function() {if(Sys.getenv(R_PROJECT)!=)

[R] [R-pkgs] New CRAN package dyn

2005-06-08 Thread Gabor Grothendieck
dyn is an R package that facilitates the use of regression using time series data with lags and diffs (known as dynamic regression). It is a lightweight package that has no facilities of its own but leverages off the various time series and regression functions in R to make it easier to use them

Re: [R] Specifying medoids in PAM?

2005-06-08 Thread Martin Maechler
MM == Martin Maechler [EMAIL PROTECTED] on Wed, 8 Jun 2005 18:57:55 +0200 writes: David == David Finlayson [EMAIL PROTECTED] on Wed, 8 Jun 2005 09:24:54 -0700 writes: David Sorry, I wasn't trying to submit a bug report just yet. MM the posting guide asks you to provide

[R] Feedback requested on a solution to specifying R-scripts on the command line

2005-06-08 Thread Mike R
Hi All, I'm new to R and would like to get started on the right foot, so to say. So I am requesting feedback on a paradigm for organizing R projects. In esence, I am trying to organize my R projects in the same way I organize my numerical simulations. But it feels like I am imposing In

[R] How to plot more than 3 sets in Venn Diagrams?

2005-06-08 Thread Tan Hui Hui Jenny
I'm trying to plot Venn diagrams with more than 3 sets (5 actually) in order to describe graphically the genetic variation between populations. I tried the limma library but realised it can only plot 3 sets. Is there any solution? Of course I could plot the chart manually but it'll take too

[R] Weibull survival modeling with covariate

2005-06-08 Thread sms13+
I was wondering if someone familiar with survival analysis can help me with the following. I would like to fit a Weibull curve, that may be dependent on a covariate, my dataframe labdata that has the fields cov, time, and censor. Do I do the following? wieb-survreg(Surv(labdata$time,

Re: [ESS] Re: [R] Strange characters in 2.1.0?

2005-06-08 Thread Patrick Connolly
On Wed, 08-Jun-2005 at 11:20AM +0200, Martin Maechler wrote: | PaCo == Patrick Connolly [EMAIL PROTECTED] | on Wed, 8 Jun 2005 11:31:44 +1200 writes: | | PaCo On Tue, 07-Jun-2005 at 04:10PM +0200, Martin Maechler wrote: | PaCo | Dan == Dan Bolser [EMAIL PROTECTED] | | PaCo |

[R] Forecasting with macroeconomic structural equations models?

2005-06-08 Thread Ronaldo Carpio
Hello, Is there a package or sample code that shows how to do ex ante forecasts with a macroeconomic structural equations model? I looked at the sem package, which lets you estimate e.g. Klein's model, but I'm not sure how to make simulations using the full set of equations, including the

Re: [R] Weibull survival modeling with covariate

2005-06-08 Thread Watalu, Y. (aka Wataru)
Hi, I'm also wondering which expression the survreg() uses for Weibull regression. Referring to help(survreg) and help(survreg.distributions), I guess survreg() fits the following model. survreg() uses a different parametrization, say F(x, Wshape, Wscale) = 1-exp(-Wscale*(x^Wshape))), and

Re: [R] How to plot more than 3 sets in Venn Diagrams?

2005-06-08 Thread Gabor Grothendieck
If the data you posted is prototypical of your datasets then note that: - it has two disconnected components of 1 and 4 sets - there are only 8 unique rows out of 32 - 5 of these 8 are the regions that contain only the non-intersecting portion of each of the 5 sets unique(mydata) AA CH EA

RE: [R] May I ask you a question about matrix population models?

2005-06-08 Thread Mulholland, Tom
Have you found the file Using Rmetasim? In windows you can access this file by using the help and selecting browse directory. There appears to be a reasonable amount of information here. It looks to me as if you need to work your way through these files until you understand what is going on.