RE: [R] Need help on parsing dates

2004-02-25 Thread Gabor Grothendieck
I just came across another package for irregular dates, zoo, giving another alternative. It can be used together with dates, chron or POSIXct. For example, using chron: require(zoo) require(chron) z.zoo - zoo(z$Data, chron(z$Date, format=y-m-d)) --- Date: Mon, 23 Feb 2004 17:22:42 -0500

Re: [R] lapack routine dgesdd, error code 1

2004-02-25 Thread Prof Brian Ripley
You have to read the LAPACK code. It says * INFO(output) INTEGER * = 0: successful exit. * 0: if INFO = -i, the i-th argument had an illegal value. * 0: DBDSDC did not converge, updating process failed. and 1 0 so this was a convergence failure inside the

Re: [R] circular filter

2004-02-25 Thread Peter Wolf
filter.matrix.center implements Manhattan or L 1 distance. If you want to define neighbor points by Euklidean distances (L 2) use filter.matrix.center(p=2): filter.matrix.center.p - function(n=9,size=5,p=2){ x-matrix(1,n,n) center-(n+1)/2 (abs(row(x)-center)^p+abs(col(x)-center)^p)^(1/p)

Re: [R] Inheriting from factors + co.

2004-02-25 Thread Uwe Ligges
Torsten Steuernagel wrote: On 24 Feb 2004 at 21:38, Uwe Ligges wrote: setClass(myclass, representation(ANY, x = numeric, y =numeric)) new(myclass, 1:10)# works new(myclass, Test) # works new(myclass, factor(1:10))# fails Why do you think it fails? I was typing faster

[R] structure of mlm objects ?

2004-02-25 Thread ZABALZA-MEZGHANI Isabelle
Hello, I am using the function lm to fit several responses at the same time (100 responses). At the end of the fit, I get an object of class mlm. I would like to know if there is a way to access to each of the 100 underlying models separately (is it a list, ... ?). Which syntax should I use to

[R] RExcel and statistical tests

2004-02-25 Thread Benoît SECHET
Hi, I’d like to perform statistical tests on Excel with the RExcel package. Is it possible ? If yes, how to do that ? Thanks for your help Benoît SECHET mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] http://benoit.sechet.9online.fr http://benoit.sechet.9online.fr [[alternative

Re: [R] structure of mlm objects ?

2004-02-25 Thread Prof Brian Ripley
On Wed, 25 Feb 2004, ZABALZA-MEZGHANI Isabelle wrote: I am using the function lm to fit several responses at the same time (100 responses). At the end of the fit, I get an object of class mlm. Actually of class c(mlm, lm). I would like to know if there is a way to access to each of the 100

Re: [R] Inheriting from factors + co.

2004-02-25 Thread Torsten Steuernagel
On 25 Feb 2004 at 10:00, Uwe Ligges wrote: So you are going to handle/mix the S4 class like/with S3 classes? Hmm. Yes, and there is the problem. With S4 classes, it works. Now I would expect that is(factor(S3object, ANY) will be FALSE for factor and any other S3 class, but is(S3object, ANY)

[R] k nearest neighbours between two matrix

2004-02-25 Thread Angel
I have two dataframes A and B consisting of latitude longitude coordinates of points. For each point in A I want to find the k-nearest neighbours in B. Currently, I calculate the distance from each point in A to all the points in B (using rdist.earth() in fields package), sort the points of B by

Re: [R] Simulation help

2004-02-25 Thread Peter Dalgaard
Spencer Graves [EMAIL PROTECTED] writes: How about the following: set.seed(5) N - 8 # later 10 (nPois - rpois(N, 2)) [1] 1 3 4 1 0 3 2 3 z - rnorm(sum(nPois)) ? I read the original request as simulating the sum of a Poisson distributed number of Normals. So I'd suggest

[R] Pb with RODBC installation

2004-02-25 Thread pascal dessaux
Hello I'm starting to use R on a Windows XP Pro machine which is not connected to the internet; I want to use database connection so I downloaded the file RODBC_1.0-4.tar from CRAN; this file is not accepted by the Packages-Install Packages from local zip file menu function of R!!! I would

RE: [R] Pb with RODBC installation

2004-02-25 Thread RINNER Heinrich
You need the precompiled binaries of packages for that: http://cran.at.r-project.org/bin/windows/contrib/1.8/RODBC_1.0-4.zip -Heinrich. -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von pascal dessaux Gesendet: Mittwoch, 25. Februar 2004

Re: [R] r: plots

2004-02-25 Thread Petr Pikal
Hallo I use following function to produce graph of yright and yleft against x with additional options (like smoothing the lines, colour, line and point type choice and an options for some axes formating. Cheers Petr

[R] simtest for Dunnett

2004-02-25 Thread Laurent Houdusse
Hi all I use the function simtest for execute a Dunnett's test See: y-c(6.5,1.60E+01,1.05E+01,6.7,1.78E+01,6.6,4.7,7.5,1.63E+01,4.2,1.15E+01,2. 79E+01,9,1.07E+01,3.00E+01,9.5,1.42E+01,1.40E+01,9.4,6.1,3.00E+01,8.4,3.00E+

Re: [R] levelplot add line

2004-02-25 Thread Jeff Jorgensen
Deepayan, Thanks for the quick response. Just to make sure I understand, let me explain in a bit more detail what I am trying to do. I have created a levelplot (with contour lines and colored regions), and what I am trying to figure out now is how to add a series of horizontal lines across

Re: [R] levelplot add line

2004-02-25 Thread Deepayan Sarkar
On Wednesday 25 February 2004 08:13, Jeff Jorgensen wrote: Deepayan, Thanks for the quick response. Just to make sure I understand, let me explain in a bit more detail what I am trying to do. I have created a levelplot (with contour lines and colored regions), and what I am trying to

[R] writing polygons/segments to shapefiles (.shp) or other ArCGIS compatible file

2004-02-25 Thread Patrick Giraudoux
I am not sure a previous e-mail reached the list (no mail aknowledgement from R-boundle etc.). The question was how to write polygon or segment coordinates into a shapefile set or any other ArcGIS supported format. The library shapefiles seems to do something but the documentation is a bit

RE: [R] help for MLE

2004-02-25 Thread Edward Sun
Hi, when I write the likelihood function as fn-function(x) -50*log(2*pi)-100*log(sigma)-(1/2*(sum((x-mu)/sigma)^2)) then what should I do since it shows that Error in log(sigma) : Object sigma not found. Thanks edward From: Edward Sun Dear Sir/Madam, I am using R version 1.8.1. I am

RE: [R] help for MLE

2004-02-25 Thread Tom Blackwell
Edward - Either optim() or fitdistr() has an additional required argument which specifies the names (and incidentally starting values) for the parameters to be estimated. Did you supply that argument ? See help(optim), help(fitdistr). - tom blackwell - u michigan medical school -

Re: [R] help for MLE

2004-02-25 Thread Spencer Graves
Have you worked through the posting guide at the end of each r-help email? In particular, have you worked the examples in help('fitdistr') in library MASS and optim? hope this helps. spencer graves Edward Sun wrote: Hi, when I write the likelihood function as fn-function(x)

Re: [R] writing polygons/segments to shapefiles (.shp) or other ArCGIS compatible file

2004-02-25 Thread Stephane DRAY
I think It could not be done for the moment .. Perhaps, I am wrong ! In the package maptools, there is read.shape shape2poly, shape2line... These functions allow to read shapefiles files but not to write it. With the shapefiles package you can write shape object to files. I think that one

RE: [R] help for MLE

2004-02-25 Thread Liaw, Andy
Do: library(mle) ?mle and read the documentation and the example. That should get you on the right track. Andy From: Edward Sun Hi, when I write the likelihood function as fn-function(x) -50*log(2*pi)-100*log(sigma)-(1/2*(sum((x-mu)/sigma)^2)) then what should I do since it

Re: [R] writing polygons/segments to shapefiles (.shp) or other ArCGIS compatible file

2004-02-25 Thread Stephane DRAY
There is a little problem with the approach I described in my previous email. In ADE-4, coordinates are given in pixel and so Y are inverted. You must invert your Y coordinates to obtain the good representation in ArcView. An example: library(ade4) library(shapefiles) library(maptools) try1

[R] read.spss defaults

2004-02-25 Thread Robert W. Baer, Ph.D.
The read.spss parameter defaults are: use.value.labels=TRUE, to.data.frame=FALSE, Is there some reasoning other than historical for this choice? In most instances, it seems that the opposite default choice (use.value.labels=FALSE, to.data.frame=TRUE,) would better preserve any existing

[R] PWM Help

2004-02-25 Thread Jonathan Wang
I saw a Help e-mail related to MLE. Does R have a probability weighted method (PWM) estimator function? I can't seem to find anything on PWM, unless my eyes are playing trick on me. [[alternative HTML version deleted]] __ [EMAIL PROTECTED]

Re: [R] read.spss defaults

2004-02-25 Thread Thomas Lumley
On Wed, 25 Feb 2004, Robert W. Baer, Ph.D. wrote: The read.spss parameter defaults are: use.value.labels=TRUE, to.data.frame=FALSE, Is there some reasoning other than historical for this choice? In most instances, it seems that the opposite default choice (use.value.labels=FALSE,

Re: [R] PWM Help

2004-02-25 Thread Thomas Lumley
On Wed, 25 Feb 2004, Jonathan Wang wrote: I saw a Help e-mail related to MLE. Does R have a probability weighted method (PWM) estimator function? I can't seem to find anything on PWM, unless my eyes are playing trick on me. The survey package has a function for maximising

[R] Computing very large distance matrix

2004-02-25 Thread Arnav Sheth
Hello All, I have a 131072x132 matrix for which I need to compute a regular euclidean distance matrix, which I then need to transform and run agnes() on this transformed matrix. I am having trouble computing the distance matrix as it is fairly large and I am sure I have gone over the max.

Re: [R] Computing very large distance matrix

2004-02-25 Thread Tom Blackwell
Arnav - A suggestion I have made in the past is to run Chris Fraley and Adrian Raftery's mclust() procedure instead of Rousseuw's agnes(), if you are willing to use a different clustering method. The pdf instruction manual for the mclust package includes explicit suggestions for how to use

RE: [R] Computing very large distance matrix

2004-02-25 Thread Liaw, Andy
If that's 131072 points, not 132 points, the memory needed to store that is: 131072^2 * 8 / 1024^3 [1] 128 That's in gigabytes. When you have a Windows machine that has at least that much memory, you can try to do that. Before then, try something else. Andy From: Arnav Sheth Hello

Re: [R] Computing very large distance matrix

2004-02-25 Thread Prof Brian Ripley
On Wed, 25 Feb 2004, Arnav Sheth wrote: Hello All, I have a 131072x132 matrix for which I need to compute a regular euclidean distance matrix, which I then need to transform and run agnes() on this transformed matrix. I am having trouble computing the distance matrix as it is fairly

Re: [R] writing polygons/segments to shapefiles (.shp) or other ArCGIS compatible file

2004-02-25 Thread Patrick Giraudoux
Thanks a lot for the hints. I will try. Actually I was focusing (in a first stage) on simple segments (small mammal traplines...). I turned the problem out writing some lines to export the coordinates into a simple GRASS ascii file, imported it into GRASS as vector file and then used the export

Re: [R] levelplot add line

2004-02-25 Thread Jeff Jorgensen
Thanks for putting me on the right track. Sorry to be bothersome with another follow-up, but the code that calls the panel function (see below) doesn't seem to be working. What am I doing wrong? Thanks, Jeff levelplot(matrix,contour=T, cuts=15,at=seq(...), labels=T, region=T,

[R] LOOCV using R

2004-02-25 Thread David Verbel
Can someone help me with performing leave-out-one cross validation using R (model built is a Cox model)? Thanks. - David Verbel, MPH Senior Biostatistician Aureon Biosciences 28 Wells Avenue Yonkers, NY 10701 Phone: (914) 377-4021 Fax: (914)

RE: [R] LOOCV using R

2004-02-25 Thread Liaw, Andy
You can try and see if the errorest function in the `ipred' package can do the job. HTH, Andy From: David Verbel Can someone help me with performing leave-out-one cross validation using R (model built is a Cox model)? Thanks. - David

[R] books: Programming with Data: A Guide to the S Language vs. S Programming

2004-02-25 Thread Vadim Ogranovich
Hi, Could someone please compare Programming with Data: A Guide to the S Language by J. Chambers and S Programming by W. Venables and B. Ripley? Ideally, I need a guide for writing R OO-style packages that intensively interact with C/C++ libraries. The specific project I have in mind is to

Re: [R] LOOCV using R

2004-02-25 Thread Tom Blackwell
library(survival) library(boot) help(coxph) help(boot) - tom blackwell - u michigan medical school - ann arbor - On Wed, 25 Feb 2004, David Verbel wrote: Can someone help me with performing leave-out-one cross validation using R (model built is a Cox model)? Thanks.

RE: [R] books:

2004-02-25 Thread Gabor Grothendieck
Not precisely an answer to your question but here are some OO R links that I have collected over time. Not sure if all these links still work. a href=http://www.stat.wisc.edu/~st771-1/slides/wk2-4.pdf;Bates/a | a href=http://www.maths.lth.se/help/R/;Bengtsson/a | a

[R] distinct random number

2004-02-25 Thread li xian
How to express n distinct numbers between 0 and m? ( In R ) Thanks! - [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] distinct random number

2004-02-25 Thread Sundar Dorai-Raj
?sample sample(0:m, n) -sd li xian wrote: How to express n distinct numbers between 0 and m? ( In R ) Thanks! - [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list

Re: [R] Computing very large distance matrix

2004-02-25 Thread Arnav Sheth
Hello, Thank you all for your replies. I have just discovered that now, for some reason, R does not let me increase its memory limit beyond 4095 Mb. Also, I get a different error message when computing the matrix using daisy() as opposed to dist(): Error: Cannot allocate vector of size 135168

[R] se.contrast ???????????

2004-02-25 Thread Duncan Mackay
Hi all, Just to follow up Don Driscoll's earlier post, can anyone please explain why se.contrast fails here?? shp-factor(rep(c(reserve,strip),each=96)) site-factor(rep(c(1g,1p,1t,2g,2p,2t,3g,3p,3t,4g,4p ,4t),each=16)) pit-factor(rep(1:16,12))

Re: [R] Computing very large distance matrix

2004-02-25 Thread Roger D. Peng
The problem is not with R; the problem is with Windows, as well as the x86 architecture. You'll never really be able to access more than 3GB of physical memory (for a single process). Accessing more than 4GB requires a 64 bit processor. -roger Arnav Sheth wrote: Hello, Thank you all for

Re: [R] Computing very large distance matrix

2004-02-25 Thread Joel Pitt
Roger D. Peng wrote: The problem is not with R; the problem is with Windows, as well as the x86 architecture. You'll never really be able to access more than 3GB of physical memory (for a single process). Accessing more than 4GB requires a 64 bit processor. -roger Alternatively, if you move

RE: [R] Computing very large distance matrix

2004-02-25 Thread Liaw, Andy
From: Joel Pitt Roger D. Peng wrote: The problem is not with R; the problem is with Windows, as well as the x86 architecture. You'll never really be able to access more than 3GB of physical memory (for a single process). Accessing more than 4GB requires a 64 bit processor.

[R] return value in function

2004-02-25 Thread li xian
suppose I have a function example: getMatrix - function(a,b){ A1-diag(1,2,2) } If I want to get the both the A1 and dim(A1) from the function, Can I do return(A1,dim(A1)) inside the function ? And how can I access A1 and dim(A1) later on?

Re: [R] return value in function

2004-02-25 Thread Jason Turner
suppose I have a function example: getMatrix - function(a,b){ A1-diag(1,2,2) } If I want to get the both the A1 and dim(A1) from the function, Can I do return(A1,dim(A1)) inside the function ? And how can I access A1 and dim(A1) later on? The general approach for this is to use a

RE: [R] return value in function

2004-02-25 Thread Liaw, Andy
In general, one would use a list to wrap all objects to be returned into one object; e.g., getMatrix - function(a, b) { A1 - diag(1,2,2) return(list(matrix=A1, dim=dim(A1))) } You can then access them as: mat - getMatrix(1,1) mat$matrix mat$dim My question is, why do you need to return

[R] minimum value

2004-02-25 Thread li xian
suppose I have a vector called v, how can I get the index of the minimum element of vector v? Thanks! - [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list

RE: [R] minimum value

2004-02-25 Thread Andy Bunn
min(v) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of li xian Sent: Wednesday, February 25, 2004 8:46 PM To: [EMAIL PROTECTED] Subject: [R] minimum value suppose I have a vector called v, how can I get the index of the minimum element of vector v?

[R] Gnumeric - 1 Excel - ?

2004-02-25 Thread Marc Schwartz
Hi all, As happens from time to time, discussions on this list appear regarding the use of popular spreadsheets for statistical analysis. One such thread (post of mine) is here: http://maths.newcastle.edu.au/~rking/R/help/03a/6326.html While not advocating such use, these discussions have

RE: [R] minimum value

2004-02-25 Thread Jason Turner
I almost said the same. But he wanted the index. which.min(v) min(v) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of li xian Sent: Wednesday, February 25, 2004 8:46 PM To: [EMAIL PROTECTED] Subject: [R] minimum value suppose I have a vector

[R] Distance and Aggregate Data - Again...

2004-02-25 Thread Danny Heuman
I appreciate the help I've been given so far. The issue I face is that the data I'm working with has 53000 rows, so in calculating distance, finding all recids that fall within 2km and summing the population, etc. - a) takes too long and b) have no sense of progress. Below is a loop that reads