Re: [R] setting new working directories

2007-01-05 Thread Jim Lemon
Bill Shipley wrote: Hello, and Happy New Year. My default working directory is getting very cluttered. I know that I should be using a different working directory for each project (I work in Windows), but do not know how to go about creating different ones and moving back and forth between

[R] [R-pkgs] RMySQL 0.5-11 uploaded to CRAN

2007-01-05 Thread David James
Hello, I've uploaded version 0.5-11 of RMySQL into CRAN, and it should be available soon. From the NEWS file: Version 0.5-11 * Fixed a bug that would crash R with a failed mysql_real_connect(). * dbApply() is now working again (but still experimentally). * Re-formatted the C code. [0.5-9

[R] Error in load

2007-01-05 Thread Giovanni Parrinello
Dear All, can anyone explain this message Error in load(matched2.RData) : Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'builtin'? Have I the possibility to retrieve the data? TIA Giovanni -- dr. Giovanni Parrinello Department of Biotecnologies Medical Statistics Unit University of

Re: [R] color of opposite sign values in filled.contour

2007-01-05 Thread Jim Lemon
Claudia Tebaldi wrote: Dear R-helpers, I'm plotting geophysical data in the form of contours using filled.contour. The display would be much more effective if the areas with negative values could be color coded by -- say -- cold colors in the range of blue to green, and conversely the

Re: [R] Error in load

2007-01-05 Thread Prof Brian Ripley
You appear to have a corrupted character vector in your saved image. Either R was internally corrupted when the image was saved or the file has been corrupted. In neither case would the the data be intact. On Fri, 5 Jan 2007, Giovanni Parrinello wrote: Dear All, can anyone explain this

Re: [R] Fast Removing Duplicates from Every Column

2007-01-05 Thread Bert Jacobs
Hi, I'm looking for some lines of code that does the following: I have a dataframe with 160 Columns and a number of rows (max 30): Col1 Col2 Col3 ... Col 159 Col 160 Row 1 0 0 LD ... 0 VD Row 2 HD 0 00 MD Row 3 0 HD

[R] Problem with plot() and POSIXt dates

2007-01-05 Thread COMTE Guillaume
Hy all, I'm plotting graphs using plot() function, they are on X axes POSIX dates: POSIXt oldClass POSIXct POSIXlt I can't figure out why sometimes it prints the month and days and sometimes it prints the unix timestamp. It appens usually when the xlim is short like only some

[R] the Rscript is missing in my prévious mail .

2007-01-05 Thread COMTE Guillaume
Sorry i forgot to give the Rscript to execute with the datas in the archive attached : limite_x-structure(as.numeric(read.table(limite_x)), class=c(POSIXt,POSIXct)) limite_y-as.numeric(read.table(limite_y)) test-as.numeric(read.table(y_values))

Re: [R] ifelse on data frames

2007-01-05 Thread Petr Pikal
Hi you could use also another approach in case of data frames A - as.data.frame(A) A0 - -A*log(A) A0[is.na(A0)] - 0 which changes NaN's to zeroes HTH Petr On 5 Jan 2007 at 16:38, talepanda wrote: Date sent: Fri, 5 Jan 2007 16:38:05 +0900 From: talepanda [EMAIL

[R] Efficient multinom probs

2007-01-05 Thread Ingmar Visser
Dear R-helpers, I need to compute probabilties of multinomial observations, eg by doing the following: y=sample(1:3,15,1) prob=matrix(runif(45),15) prob=prob/rowSums(prob) diag(prob[,y]) However, my question is whether this is the most efficient way to do this. In the call prob[,y] a whole

Re: [R] Fast Removing Duplicates from Every Column

2007-01-05 Thread Petr Pikal
Hi I am not sure if I understand how do you want to select unique items. with sapply(DF, function(x) !duplicated(x)) you can get data frame with TRUE when an item in particular column is unique and FALSE in opposite. However then you need to choose which rows to keep or discard e.g.

Re: [R] Efficient multinom probs

2007-01-05 Thread Dimitris Rizopoulos
maybe prob[cbind(1:length(y), y)] I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web:

[R] gstat package. singular attibute

2007-01-05 Thread javier garcia-pintado
Hello, I'm using the gstat package within R for an automated procedure that uses ordinary kriging. I can see that there is a logical (singular) atrtibute of some adjusted model semivariograms: .- attr(*, singular)= logi TRUE I cannot find documentation about the exact meaning and the

Re: [R] Problem with plot() and POSIXt dates

2007-01-05 Thread Prof Brian Ripley
No attachment arrived: see the posting guide for handling attachments. But in any case the posting guide says If you are using an old version of R and think it does not work properly, upgrade to the latest version and try that, before posting. and your version of R is ancient. Note,

Re: [R] color of opposite sign values in filled.contour

2007-01-05 Thread Achim Zeileis
On Thu, 4 Jan 2007, Richard M. Heiberger wrote: Get the RColorBrewer package from CRAN Description: The packages provides palettes for drawing nice maps shaded according to a variable. The package vcd also offers the function diverge_hcl() that constructs diverging palettes (based on

[R] maximum likelihood estimation of 5 parameters

2007-01-05 Thread francogrex
Hi Guys, it would be great if you could help me with a MLE problem in R. I am trying to evaluate the maximum likelihood estimates of theta = (a1, b1, a2, b2, P) which defines a mixture of a Poisson distribution and two gamma prior distributions (where the Poisson means have a gamma

[R] Problem with plot() and POSIXt dates

2007-01-05 Thread COMTE Guillaume
So maybe i will finaly succeed asking the right way, Hy all, I'm plotting graphs using plot() function, they are on X axes POSIX dates: POSIXt oldClass POSIXct POSIXlt I can't figure out why sometimes it prints the month and days and sometimes it prints the unix timestamps. Here is an

Re: [R] maximum likelihood estimation of 5 parameters

2007-01-05 Thread Ingmar Visser
Franco, You can provide lower and upper bounds on the parameters if you use optim with method=L-BFGS-B. Hth, Ingmar From: francogrex [EMAIL PROTECTED] Date: Fri, 5 Jan 2007 04:54:50 -0800 (PST) To: r-help@stat.math.ethz.ch Subject: [R] maximum likelihood estimation of 5 parameters Hi

Re: [R] coefficients of each local polynomial from loess() or locfit()

2007-01-05 Thread Dieter Menne
Liu, Delong (NIH/CIT) [C] liud2 at mail.nih.gov writes: I want to extract estimated coeffiicents of each local polynomial at given x from loess(), locfit(), or KernSmooth(). Can some experts provide me with suggestions? Thanks. Try cars.lo - loess(dist ~ speed, cars) str(cars.lo) List

Re: [R] color of opposite sign values in filled.contour

2007-01-05 Thread Claudia Tebaldi
Dear all, especially those of you that kindly provided suggestions yesterday, I was not asking for cool palettes -- even if I now appreciate the pointers -- but I was asking for a way to make the 0 level of a filled contour plot correspond to the neutral color in the color scale when the range

Re: [R] coefficients of each local polynomial from loess() or locfit()

2007-01-05 Thread Dieter Menne
Liu, Delong (NIH/CIT) [C] liud2 at mail.nih.gov writes: I want to extract estimated coeffiicents of each local polynomial at given x from loess(), locfit(), or KernSmooth(). Can some experts provide me with suggestions? Thanks. Before you start on your own, also note Brian Ripleys recent

Re: [R] Problem with plot() and POSIXt dates

2007-01-05 Thread Gabor Grothendieck
We can force the X axis into the format of our choice by suppressing it in the plot and explicitly calling axis.POSIXct with our choice of format (see ?axis.POSIXct): x - seq(from = as.POSIXct(2005-10-14), to = as.POSIXct(2007-01-02), by = day y - as.numeric(x) plot(y ~ x, xaxt =

Re: [R] Problem with plot() and POSIXt dates

2007-01-05 Thread Gabor Grothendieck
Sorry, there was a missing parenthesis after the first statement. Here is the code again: x - seq(from = as.POSIXct(2005-10-14), to = as.POSIXct(2007-01-02), by = day) y - as.numeric(x) plot(y ~ x, xaxt = n) at - x[seq(1, length(x), length = 5)] axis.POSIXct(1, at, at, %y-%b-%d) On

Re: [R] color of opposite sign values in filled.contour

2007-01-05 Thread Duncan Murdoch
On 1/5/2007 9:08 AM, Claudia Tebaldi wrote: Dear all, especially those of you that kindly provided suggestions yesterday, I was not asking for cool palettes -- even if I now appreciate the pointers -- but I was asking for a way to make the 0 level of a filled contour plot correspond to the

[R] aov - glm - lmer

2007-01-05 Thread cressonim
I am sorry to ask a trivial question but I am not a statistician. When I need to compare more than two groups in a unbalanced design with SAS system I use PROC GLM (like the example in data5.csv from Cody R. Applied statistics and SAS programming language p.223). R glm gives different results.

Re: [R] aov - glm - lmer

2007-01-05 Thread Martin Henry H. Stevens
In R, -- lm fits ordinary least squares linear models; this is likely to be what you want if you were using PROC GLM. -- glm fits generalized linear models (e.g. logit, Poisson, Gaussian, etc.). -- lmer and lme fit mixed models, similar to PROC MIXED Cheers, Hank On Jan 5, 2007, at 10:05 AM,

Re: [R] maximum likelihood estimation of 5 parameters

2007-01-05 Thread francogrex
Franco, You can provide lower and upper bounds on the parameters if you use optim with method=L-BFGS-B. Hth, Ingmar Thanks, but when I use L-BFGS-B it tells me that there is an error in optim(start, f, method = method, hessian = TRUE, ...) : L-BFGS-B needs finite values of 'fn' -- View this

Re: [R] maximum likelihood estimation of 5 parameters

2007-01-05 Thread Prof Brian Ripley
On Fri, 5 Jan 2007, francogrex wrote: [quoting Ingmar Vissar without attribution, contrary to the posting guide.] Franco, You can provide lower and upper bounds on the parameters if you use optim with method=L-BFGS-B. Hth, Ingmar Thanks, but when I use L-BFGS-B it tells me that there is

Re: [R] maximum likelihood estimation of 5 parameters

2007-01-05 Thread Ravi Varadhan
Franco, Is it possible that you have failed to provide the negative of loglikelihood to optim, since optim, by default, minimizes a function? If you want to do this withput redefining the log-likelihood, you should set fnscale= -1 (as hinted by Prof. Ripley). This would turn the problem into a

Re: [R] ifelse on data frames

2007-01-05 Thread MrJ Man
On Friday 05 January 2007 12:34, Petr Pikal wrote: Hi you could use also another approach in case of data frames A - as.data.frame(A) A0 - -A*log(A) A0[is.na(A0)] - 0 I think you meant A0[which(is.na(A0))] - 0 which changes NaN's to zeroes HTH Petr Regards

[R] eval(parse(text vs. get when accessing a function

2007-01-05 Thread Ramon Diaz-Uriarte
Dear All, I've read Thomas Lumley's fortune If the answer is parse() you should usually rethink the question.. But I am not sure it that also applies (and why) to other situations (Lumley's comment http://tolstoy.newcastle.edu.au/R/help/05/02/12204.html was in reply to accessing a list).

Re: [R] ifelse on data frames

2007-01-05 Thread rolf
``MrJ Man'' wrote: On Friday 05 January 2007 12:34, Petr Pikal wrote: Hi you could use also another approach in case of data frames A - as.data.frame(A) A0 - -A*log(A) A0[is.na(A0)] - 0 I think you meant A0[which(is.na(A0))] - 0 He most certainly DOES NOT mean this!

Re: [R] eval(parse(text vs. get when accessing a function

2007-01-05 Thread Peter Dalgaard
Ramon Diaz-Uriarte wrote: Dear All, I've read Thomas Lumley's fortune If the answer is parse() you should usually rethink the question.. But I am not sure it that also applies (and why) to other situations (Lumley's comment http://tolstoy.newcastle.edu.au/R/help/05/02/12204.html was in

Re: [R] eval(parse(text vs. get when accessing a function

2007-01-05 Thread Bert Gunter
?? Or to add to what Peter Dalgaard said... (perhaps for the case of many more functions) Why eval(parse())? What's wrong with if then? g - function(fpost,x){if(fpost==1)f.1 else f.2 }(x) or switch() if you have more than 2 possible arguments? I think your remarks reinforce the wisdom of

Re: [R] eval(parse(text vs. get when accessing a function

2007-01-05 Thread Ramon Diaz-Uriarte
On Friday 05 January 2007 19:21, Peter Dalgaard wrote: Ramon Diaz-Uriarte wrote: Dear All, I've read Thomas Lumley's fortune If the answer is parse() you should usually rethink the question.. But I am not sure it that also applies (and why) to other situations (Lumley's comment

Re: [R] eval(parse(text vs. get when accessing a function

2007-01-05 Thread Ramon Diaz-Uriarte
On Friday 05 January 2007 19:35, Bert Gunter wrote: ?? Or to add to what Peter Dalgaard said... (perhaps for the case of many more functions) Why eval(parse())? What's wrong with if then? g - function(fpost,x){if(fpost==1)f.1 else f.2 }(x) or switch() if you have more than 2 possible

Re: [R] eval(parse(text vs. get when accessing a function

2007-01-05 Thread jim holtman
The other reason for considering which of the different approaches to use would be performance: f.1 - function(x) x+1 f.2 - function(x) x+2 system.time({ + for (i in 1:10){ + eval(parse(text=paste('f.', i%%2+1, sep='')))(i) + } + }) [1] 6.96 0.00 8.32 NA NA

Re: [R] problem with logLik and offsets

2007-01-05 Thread Prof Brian Ripley
The problem is with residuals in model3. Fixed in 2.4.1 patched and later. On Wed, 3 Jan 2007, Jarrod Hadfield wrote: Hi, I'm trying to compare models, one of which has all parameters fixed using offsets. The log-likelihoods seem reasonble in all cases except the model in which there are

Re: [R] split-plot multiple comparisons

2007-01-05 Thread Richard M. Heiberger
Thank you for your example. I am now using it an example in the MMC Mean--mean Multiple Comparisons plot in the HH package on CRAN. The source for HH_1.17 is on CRAN in Austria as of this morning. The Windows and MacOS binaries will be on CRAN in a few days and will then propagate to the

Re: [R] memory limits in R loading a dataset and using the package tree

2007-01-05 Thread Weiwei Shi
IMHO, R is not good at really large-scale data mining, esp. when the algorithm is complicated. The alternatives are 1. sampling your data; sometimes you really do not need that large number of records and the accuracy might already be good enough when you load less. 2. find an alternative

[R] Error in save function

2007-01-05 Thread fernando espindola
Hi r-user, I am trying to save same objects in workspace, but the next error message is show in line command, save(area,cent,larg,mran,eddy,dia,vort,slan,file=stat.Rdata) Erro en save.default(area, cent, larg, mran, eddy, dia, vort, slan, file = stat.Rdata) : 5 arguments passed to

Re: [R] maximum likelihood estimation of 5 parameters

2007-01-05 Thread Ken Beath
Using the inverse logistic transform to replace p by exp(xp)/(1+exp(xp)) allows unconstrained fitting of xp. There may still be problems where xp tends to + or - infinity depending on starting values. francogrex [EMAIL PROTECTED] 01/05/07 11:54 PM Hi Guys, it would be great if you could help

Re: [R] Error in save function

2007-01-05 Thread Prof Brian Ripley
There is no 'save.default' function in R. You were asked in the posting guide to report the results of sessionInfo(). (It looks like an old version of R.oo might be the culprit, and you might need to update.packages().) On Fri, 5 Jan 2007, fernando espindola wrote: Hi r-user, I am trying

Re: [R] eval(parse(text vs. get when accessing a function

2007-01-05 Thread Greg Snow
Ramon, I prefer to use the list method for this type of thing, here are a couple of reasons why (maybe you are more organized than me and would never do some of the stupid things that I have, so these don't apply to you, but you can see that the general suggestion applys to some of the rest of

Re: [R] eval(parse(text vs. get when accessing a function

2007-01-05 Thread Peter Dalgaard
Greg Snow wrote: Personally I have never regretted trying not to underestimate my own future stupidity. Fortune! __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] memory limits in R loading a dataset and using the packagetree

2007-01-05 Thread Sicotte, Hugues Ph.D.
I agree about sampling, but.. You can go a little further with your hardware. The defaults in R is to play nice and limit your allocation to half the available RAM. Make sure you have a lot of disk swap space (at least 1G with 2G of RAM) and you can set your memory limit to 2G for R. See

Re: [R] maximum likelihood estimation of 5 parameters

2007-01-05 Thread francogrex
No I have not forgotten to use a negative fnscale to optimize, so as you suggest I will post some parts of the code I am running to show you the errors: n [1] 3 1 4 54 6 58 20 14 3 14 4 65 1 7 9 10 2 4 66 [20] 5 9 7 12 7 55 105 2 5 10 55 5 28

Re: [R] eval(parse(text vs. get when accessing a function

2007-01-05 Thread Patrick Burns
Peter Dalgaard wrote: Greg Snow wrote: Personally I have never regretted trying not to underestimate my own future stupidity. Fortune! Seconded. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] Calling confint.glm from within another function

2007-01-05 Thread Inman, Brant A. M.D.
On July 12, 2004 Spencer Graves wrote an email describing essentially the same issue that I would like help on: calling the confint function from within another homemade function. Because he provided many good examples of the problem, I will not reproduce them here but will instead refer readers

Re: [R] eval(parse(text vs. get when accessing a function

2007-01-05 Thread Thomas Lumley
On Fri, 5 Jan 2007, Ramon Diaz-Uriarte wrote: I see, this is direct way of dealing with the problem. However, you first need to build the f list, and you might not know about that ahead of time. For instance, if I build a function so that the only thing that you need to do to use my function

Re: [R] Calling confint.glm from within another function

2007-01-05 Thread Marc Schwartz
On Fri, 2007-01-05 at 17:01 -0600, Inman, Brant A. M.D. wrote: On July 12, 2004 Spencer Graves wrote an email describing essentially the same issue that I would like help on: calling the confint function from within another homemade function. Because he provided many good examples of the

Re: [R] maximum likelihood estimation of 5 parameters

2007-01-05 Thread Charles C. Berry
Franco, It is up to the user of mle() to define a function that is numerically well behaved - even near the boundaries - and/or to provide suitable boundary constraints. Using gamma() in situations in which the argument could be 500 (say) will cause problems. It appears that the maximum of

[R] Bootstrapping Confidence Intervals for Medians

2007-01-05 Thread gilbertg
I apologize for this post. I am new to R (two days) and I have tried and tried to calculated confidence intervals for medians. Can someone help me? Here is my data: institution1 0.21 0.16 0.32 0.69 1.15 0.9 0.87 0.87 0.73 The first four observations compose group 1 and observations 5 through 9

[R] help with gls

2007-01-05 Thread Zhenqiang Lu
Hello R-users, I am using gls function in R to fit a model with certain correlation structure. The medol as: fit.a-gls(y~1,data=test.data,correlation=corAR1(form=~1|aa),method=ML) mu-summary(fit.a)$coefficient With the toy data I made to test, the estimate of mu is exactly equal to the