[R] test for end of file on connection

2004-05-11 Thread Vadim Ogranovich
Hi, I am looking for a function to test for end-of-file on a connection. Apparently this question was already asked a couple of years ago and then P. Dalgaard suggested to look at help(connections), help(readLines). Unfortunately, I couldn't find such a function on those pages, maybe I am

[R] R versus SAS: lm performance

2004-05-11 Thread Arne.Muller
Hello, A collegue of mine has compared the runtime of a linear model + anova in SAS and S+. He got the same results, but SAS took a bit more than a minute whereas S+ took 17 minutes. I've tried it in R (1.9.0) and it took 15 min. Neither machine run out of memory, and I assume that all

Re: [R] problem with loadURL -- claims newer version used- fixed

2004-05-11 Thread Prof Brian Ripley
On Mon, 10 May 2004, William Revelle wrote: big5r.txt is delimited by CR not LF, and as R writes it as a binary file, that's not the file that got saved. Thanks. That was the problem. I was transferring the files from my Mac to my web server (also a Mac) using Interarchy. It was putting

Re: [R] R versus SAS: lm performance

2004-05-11 Thread Prof Brian Ripley
The way to time things in R is system.time(). Without knowing much more about your problem we can only guess where R is spending the time. But you can find out by profiling -- see `Writing R Extensions'. If you want multiple fits with the same design matrix (do you?) you could look at the

Re: [R] How to draw holes generated by gpclib using plot function

2004-05-11 Thread Ross Ihaka
Hisaji ONO wrote: Hi. I've tried to create a polygon with one hole by gpclib using following example script. holepoly - read.polyfile(system.file(poly-ex/hole-poly.txt, package =gpclib), nohole = FALSE) area.poly(holepoly) plot(holepoly,poly.args=list(col=red,border=blue)) And I

[R] Meta-Analysis using lme

2004-05-11 Thread Heike Heidemeier
Dear list-members, I am trying to use R to conduct a meta-analysis, i.e. I'd like to use a multi-level model to integrate the findings of a number of primary research studies. I set up a simple two level-model (only summary statistics are provided by each study) as follows: sapp.lme - lme(D ~

[R] - making a Windows library from Unix source code

2004-05-11 Thread Livingstone, Paul
Hi All, I'm using R1.8.1 on Windows XP. I'm having trouble producing an R library from source code. A colleague has written the source code, in Unix. I've copied the source code across to Windows (with the help files, data files, description and index) and am trying to compile it into a

Re: [R] - making a Windows library from Unix source code

2004-05-11 Thread Prof Brian Ripley
On Tue, 11 May 2004, Livingstone, Paul wrote: I'm using R1.8.1 on Windows XP. I'm having trouble producing an R library from source code. A colleague has written the source code, in Unix. I've copied the source code across to Windows (with the help files, data files, description and

[R] How to import file from excle?

2004-05-11 Thread may nongmay
Hi R-help I have some question. First I have data in Excle ,then I would like to fit distribution from this data, how to import this data from excle? What's command? Thaks for first answer Second I learn R program from The Basics of S and S-plus book because it's basic, and then when I use

[R] How to import file from excle?

2004-05-11 Thread may nongmay
Hi R-help I have some question. First I have data in Excle ,then I would like to fit distribution from this data, how to import this data from excle? What's command? Thaks for first answer Second I learn R program from The Basics of S and S-plus book because it's basic, and then when I use

Re: [R] How to import file from excle?

2004-05-11 Thread Chuck Cleland
may nongmay wrote: ... I learn R program from The Basics of S and S-plus book because it's basic, and then when I use command is attact(geyser) [follow from book] but I can't . Because it's command only S (i think some command can't use in R???) In R, you need library(MASS) as a first step.

Re: [R] How to import file from excle?

2004-05-11 Thread Uwe Ligges
may nongmay wrote: Hi R-help I have some question. First I have data in Excle ,then I would like to fit distribution from this data, how to import this data from excle? What's command? There is an R Import/Export manual. Please read it. Thaks for first answer Second I learn R program from

Re: [R] Probleme with Kmeans...

2004-05-11 Thread TEMPL Matthias
Hello, When clustering with kmeans, your data should have more than one variable. Matthias -Ursprüngliche Nachricht- Von: clothilde kussener [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 11. Mai 2004 12:01 An: [EMAIL PROTECTED] Betreff: [R] Probleme with Kmeans... Hello, I would like

Re: [R] Probleme with Kmeans...

2004-05-11 Thread Uwe Ligges
clothilde kussener wrote: Hello, I would like to have any help with the function Kmeans of R.. I use this to do a classification of my data...I have chosen 12 classes but, I have always an error message: Error: empty cluster: try a better set of initial centers So, I don't understand the

[R] stability measures for heirarchical clustering

2004-05-11 Thread Jacqueline Hall
Dear R users, I'm interested in measuring the stability of a heirarchical clustering, of the overall clustering and finding sub clusters (from cutting the heirarchical clustering at different levels) which demonstrate stability. I saw some postings on the R help from a while back about

RE: [R] R versus SAS: lm performance

2004-05-11 Thread Arne.Muller
Hello, thanks for your reply. I've now done the profiling, and I interpret that the most time is spend in the fortran routine(s): Each sample represents 0.02 seconds. Total run time: 920.21999453 seconds. Total seconds: time spent in function and callees. Self seconds: time spent in

Re: [R] Colouring hclust() trees

2004-05-11 Thread Martin Keller-Ressel
How about this: hc is your hclust object,colv the color vector ordered like the original data and height the height of the color bar as fraction of dendrogram height. colorplot.hclust - function(hc,colv,height=.05) { plot(hc,lab=FALSE,hang=0) stopifnot(length(hc$order) == length(colv))

[R] bilinear and non linear

2004-05-11 Thread mendola
Dear all, there are R packages able to simulate or estimate bilinear model for time series? I know it is an open problem, but do exist something for very simplified bilinear models? Alternatively, what kinfd of non linear time series models are performed in R? If R is not able, could someone

[R] SDP QCQP

2004-05-11 Thread Ramzi TEMANNI
Hi, Are there package in R that can solve semidefinite programming problem and Quadratically Constrained Quadratic Programming ? Thanks in advance, Ramzi TEMANNI Ramzi DEA Student LimBio http://www.limbio-paris13.org UFR de Santé, Médecine et Biologie Humaine (SMBH) Léonard de Vinci 74, rue

Re: [R] R versus SAS: lm performance

2004-05-11 Thread Douglas Bates
[EMAIL PROTECTED] writes: Hello, A collegue of mine has compared the runtime of a linear model + anova in SAS and S+. He got the same results, but SAS took a bit more than a minute whereas S+ took 17 minutes. I've tried it in R (1.9.0) and it took 15 min. Neither machine run out of

RE: [R] R versus SAS: lm performance

2004-05-11 Thread Prof Brian Ripley
BTW, I forgot to mention that using multiple lhs's (but not all 12,000 at once) in a call to lm will help a lot: you may well be able to do 1000 fits in the same time as one, and that may be sufficient speed-up for you. Can you tell us how big the model matrix X is, and how much singularity

RE: [R] R versus SAS: lm performance

2004-05-11 Thread Liaw, Andy
I tried the following on an Opteron 248, R-1.9.0 w/Goto's BLAS: y - matrix(rnorm(14000*1344), 1344) x - matrix(runif(1344*503),1344) system.time(fit - lm(y~x)) [1] 106.00 55.60 265.32 0.00 0.00 The resulting fit object is over 600MB. (The coefficient compoent is a 504 x 14000 matrix.)

[R] calling data frames

2004-05-11 Thread Rogério Rosa da Silva
Dear List, I've around 1000 *.txt files, I've generate with other software. I've now done the following code (below). My question is how can I automate this (with do.call () ?), so it could be done for all the *.txt files. Thanks in advance, Rogério names- list.files() file -

Re: [R] stability measures for heirarchical clustering

2004-05-11 Thread Christian Hennig
Dear Jacqueline, may be the corrected rand index implemented in cluster.stats, package fpc, and the literature on its help page may be of interest to you. As far as I know, the corrected rand is the index cited most often for comparing different clusterings on the same points. This can be used

Re: [R] R versus SAS: lm performance

2004-05-11 Thread roger koenker
I would be curious to know how sparse the model.matrix for this problem is... Unless it is quite dense, or as Brian implies quite singular, I might suggest computing a Cholesky factorization in SparseM. url:www.econ.uiuc.edu/~rogerRoger Koenker email [EMAIL PROTECTED]

Re: [R] R versus SAS: lm performance

2004-05-11 Thread Peter Dalgaard
Liaw, Andy [EMAIL PROTECTED] writes: I tried the following on an Opteron 248, R-1.9.0 w/Goto's BLAS: y - matrix(rnorm(14000*1344), 1344) x - matrix(runif(1344*503),1344) system.time(fit - lm(y~x)) [1] 106.00 55.60 265.32 0.00 0.00 The resulting fit object is over 600MB. (The

Re: [R] How to draw holes generated by gpclib using plot function

2004-05-11 Thread Roger D. Peng
Sorry, but this limitation in plotting is something that I probably should have mentioned in the help page. At the time when I wrote this plotting wasn't really a priority so I never thought much of it. The GPC C library has a function has a function to return a collection of tristrips but

Re: [R] R versus SAS: lm performance

2004-05-11 Thread Prof Brian Ripley
On 11 May 2004, Peter Dalgaard wrote: Liaw, Andy [EMAIL PROTECTED] writes: I tried the following on an Opteron 248, R-1.9.0 w/Goto's BLAS: y - matrix(rnorm(14000*1344), 1344) x - matrix(runif(1344*503),1344) system.time(fit - lm(y~x)) [1] 106.00 55.60 265.32 0.00 0.00

RE: [R] calling data frames

2004-05-11 Thread Liaw, Andy
Not sure how automated you want, but the following might work (obviously untested): Guilda.list - list(Guilda1 = c(27,48), Guilda2 = c(5,17,19,20,21,24:26,40,41,77), Guilda3 = c(22,28,69), Guilda4 = c(29:37,78),

Re: [R] R versus SAS: lm performance

2004-05-11 Thread Peter Dalgaard
Prof Brian Ripley [EMAIL PROTECTED] writes: Hmm. Shouldn't be all that much faster, but it will produce the Type I SS as you go along, whereas R probably wants to fit the 15 different models. Nope, R can read off the Type I SSQs from the QR decomposition so only one fit is done.

Re: [R] Meta-Analysis using lme

2004-05-11 Thread Thomas Lumley
On Tue, 11 May 2004, Heike Heidemeier wrote: Dear list-members, I am trying to use R to conduct a meta-analysis, i.e. I'd like to use a multi-level model to integrate the findings of a number of primary research studies. I set up a simple two level-model (only summary statistics are

[R] Hypertext links in help files.

2004-05-11 Thread Rolf Turner
I've recently (finally!) installed R 1.9.0 on my laptop. Having done so I've encountered a mild problem with hypertext links from help files in add-on packages to ``native'' R functions. For example if I load the ``spatstat'' package, and ask for help on mpl(), I can see in the browser (I'm

Re: [R] Explaining Survival difference between Stata and R

2004-05-11 Thread Thomas Lumley
On Mon, 10 May 2004, Paul Johnson wrote: Dear Everybody: I'm doing my usual how does that work in R thing with some Stata projects. I find a gross gap between the Stata and R in Cox PH models, and I hope you can give me some pointers about what goes wrong. I'm getting signals from

RE: [R] bilinear and non linear

2004-05-11 Thread Pfaff, Bernhard
Dear all, there are R packages able to simulate or estimate bilinear model for time series? I know it is an open problem, but do exist something for very simplified bilinear models? Hello Dario, well, it should be possible to estimate a bilinear model by employing nls() or optim().

[R] Problem with 'expression'

2004-05-11 Thread Perez Martin, Agustin
DeaR useRs: Excuses by my English. I have a problem with 'expression' function. For example: a-expression(exp(-x^2)) b-expression(exp(x^2)) And I want to calculate: a*b And R returns: Error in a * b : non-numeric argument to binary operator I don't know what

AW: [R] Probleme with Kmeans...

2004-05-11 Thread TEMPL Matthias
Sorry, to solve your question I had tried: data(faithful) kmeans(faithful[c(1:20),1],10) Error: empty cluster: try a better set of initial centers But when I run this a second time it will be ok. It seems, that kmeans has problems to initialize good starting points, because of the random

[R] xtable with a table ?

2004-05-11 Thread Ian Wilson
Any more elegant solutions to this? a - sample(c(a,d,c),100,replace=T) b - sample(c(d,e,f,100,replace=T) t - table(a,b) xtable(t) Error in xtable(t) : no applicable method for xtable The problem is that while t is a table (and hence also a matrix) is.matrix(t) [1] TRUE data.frame(t)

[R] R/S-plus Course***In Raleigh/Durham-RTP, NC***R/Splus Fundamentals and Programming Techniques, May 27-28, 2004

2004-05-11 Thread elvis
XLSolutions Corporation (www.xlsolutions-corp.com) is proud to announce May 2004 2-day R/S-plus Fundamentals and Programming Techniques. Raleigh/Durham-RTP, NC May, 27-28 Interested in our R/Splus Advanced Programming course? Please email us! Reserve your

Re: [R] xtable with a table ?

2004-05-11 Thread Peter Dalgaard
Ian Wilson [EMAIL PROTECTED] writes: Any more elegant solutions to this? a - sample(c(a,d,c),100,replace=T) b - sample(c(d,e,f,100,replace=T) t - table(a,b) xtable(t) Error in xtable(t) : no applicable method for xtable Others might get a different error: xtable(t) Error: couldn't

Re: [R] Problem with 'expression'

2004-05-11 Thread Tamas Papp
On Tue, May 11, 2004 at 04:31:21PM +0200, Perez Martin, Agustin wrote: For example: a-expression(exp(-x^2)) b-expression(exp(x^2)) And I want to calculate: a*b Use t-2 expression(a, list(x=t))*expression(b, list(x=t)) I am not sure what you are using these for, but

Re: [R] Hypertext links in help files.

2004-05-11 Thread Prof Brian Ripley
Reinstallation should solve this, and did for me. Are you sure you have picked up the reinstalled version and not one in some other library tree? library(help=spatstat) will tell you when it was built. On Tue, 11 May 2004, Rolf Turner wrote: I've recently (finally!) installed R 1.9.0 on my

Re: [R] test for end of file on connection

2004-05-11 Thread Tony Plate
With the text of your message copied to the clipboard: con - file(clipboard, r) readLines(con, 1) [1] I am looking for a function to test for end-of-file on a connection. readLines(con, 1) [1] Apparently this question was already asked a couple of years ago and readLines(con, 1) [1] then P.

Re: [R] Problem with 'expression'

2004-05-11 Thread Tamas Papp
On Tue, May 11, 2004 at 05:13:24PM +0200, Tamas Papp wrote: a-expression(exp(-x^2)) b-expression(exp(x^2)) And I want to calculate: a*b Use t-2 expression(a, list(x=t))*expression(b, list(x=t)) Of course, I meant eval instead of expression. Sorry. Tamas --

[R] installing mgcv (Knoppix/Debian unstable)

2004-05-11 Thread Ben Bolker
Just in case anyone cares or is hitting the same problem: to install current mgcv (1.0-5) on 1.9.0 on Knoppix/Debian unstable I had to: # cd /usr/lib # ln -s /usr/lib/atlas/libblas.so.3 libblas-3.so # ln -s /usr/lib/atlas/liblapack.so.3 liblapack-3.so Otherwise compilation couldn't find

Re: [R] xtable with a table ?

2004-05-11 Thread Gabor Grothendieck
t. - table(a,b) xtable(format(t.)) From: Ian Wilson [EMAIL PROTECTED] : : Any more elegant solutions to this? : : a - sample(c(a,d,c),100,replace=T) : b - sample(c(d,e,f,100,replace=T) : t - table(a,b) : xtable(t) : Error in xtable(t) : no applicable method for xtable : : The problem

[R] ROracle package error

2004-05-11 Thread Joan Snodgrass
I am running R 1.8.1 on a Solaris 8 64-bit machine and using Oracle 9.2.0.4. I noticed that the readme for ROracle lists a problem and suggests the following to work around it: R CMD INSTALL --configure-args='--enable-extralibs' ROracle_0.5-4.tar.gz I ran the following to install since we have

Re: [R] installing mgcv (Knoppix/Debian unstable)

2004-05-11 Thread Dirk Eddelbuettel
Hi Ben, On Tue, May 11, 2004 at 11:57:40AM -0400, Ben Bolker wrote: Just in case anyone cares or is hitting the same problem: Any reason you choose to not install install the evailable package? [EMAIL PROTECTED]:~ apt-cache policy r-cran-mgcv r-cran-mgcv: Installed: 0.9.6-3 Candidate:

Re: [R] installing mgcv (Knoppix/Debian unstable)

2004-05-11 Thread Ben Bolker
Didn't know it was there (and it didn't occur to me to look ...). I have installed a few other of the Debianized packages, but I'm fairly new to Debian and don't know offhand how to get a list of which packages exist in Debian form and what their names are (or how to say install all R

Re: [R] SDP QCQP

2004-05-11 Thread Martin Maechler
Ramzi == Ramzi TEMANNI [EMAIL PROTECTED] on Tue, 11 May 2004 13:45:09 +0200 writes: Ramzi Hi, Are there package in R that can solve Ramzi semidefinite programming problem and Quadratically Ramzi Constrained Quadratic Programming ? You have probably seen the 'quadprog' package

Re: [R] installing mgcv (Knoppix/Debian unstable)

2004-05-11 Thread Dirk Eddelbuettel
On Tue, May 11, 2004 at 12:28:57PM -0400, Ben Bolker wrote: Didn't know it was there (and it didn't occur to me to look ...). I have installed a few other of the Debianized packages, but I'm fairly new to Debian and don't know offhand how to get a list of which packages exist in Debian

Re: [R] SDP QCQP

2004-05-11 Thread Douglas Bates
Martin Maechler [EMAIL PROTECTED] writes: Ramzi == Ramzi TEMANNI [EMAIL PROTECTED] on Tue, 11 May 2004 13:45:09 +0200 writes: Ramzi Hi, Are there package in R that can solve Ramzi semidefinite programming problem and Quadratically Ramzi Constrained Quadratic Programming ?

RE: [R] R versus SAS: lm performance

2004-05-11 Thread Arne.Muller
Thanks All, for your help. There seems to be a lot I can try to speed up the fits. However, I'd like to go for a much simpler model which I think is justified by the experiment itself, e.g; I may think about removing the nestinh (Ba:Ti:Do)/Ar. The model matrix has 1344 rows and 2970 columns,

[R] lags and differences

2004-05-11 Thread fciclone
Dear all, could someone please clarify me if this works, so as to implement lags and differences for example in y and in a independent x1 of a regression? model-lm((diff(y), -i)~x1+lag(x1,-1), data=anydata) Thanks, a lot, Alexandre. -- Início da mensagem original ---

Re: [R] lags and differences

2004-05-11 Thread Prof Brian Ripley
Lags apply to time series, and are ignored by lm. You need to do something like dat - ts.intersect(y1=diff(y), x1, x11 = lag(x1,-1), dframe=TRUE) lm(y1 ~ x1 + x11, data=dat) On Tue, 11 May 2004, fciclone wrote: Dear all, could someone please clarify me if this works, so as to

Re: [R] How to draw holes generated by gpclib using plot function

2004-05-11 Thread Roger Bivand
On Tue, 11 May 2004, Ross Ihaka wrote: Hisaji ONO wrote: Hi. I've tried to create a polygon with one hole by gpclib using following example script. holepoly - read.polyfile(system.file(poly-ex/hole-poly.txt, package =gpclib), nohole = FALSE) area.poly(holepoly)

[R] Fitting data from a spectrophotometer.

2004-05-11 Thread TAPO (Thomas Agersten Poulsen)
Dear R-list, It is not uncommon for laboratory equipment (e.g. spectrophotometers) to have a linear response in a certain interval and then go into saturation. I wonder if there is an R-function that models this; for instance by estimating the breakpoint and fitting a line below the

[R] Question about predict.multinom()

2004-05-11 Thread Giovanni Petris
Hello, This is the fitted model: fit Call: multinom(formula = resp ~ pred$cls + pred$smoke) Coefficients: (Intercept) pred$cls2 pred$cls3 pred$cls4 pred$cls5 pred$smoke2 pred$smoke3 Proteinuria-1.140520 0.1616644 0.05554898 -0.01584927 0.02574805 -0.4057245

Re: [R] Fitting data from a spectrophotometer.

2004-05-11 Thread Sundar Dorai-Raj
TAPO (Thomas Agersten Poulsen) wrote: Dear R-list, It is not uncommon for laboratory equipment (e.g. spectrophotometers) to have a linear response in a certain interval and then go into saturation. I wonder if there is an R-function that models this; for instance by estimating the

[R] How to use c routines in the exiting package?

2004-05-11 Thread Rui
Hi all, I want to know some details about the c routine “lasso” in the functions of “gl1ce()” . However, I have following troubles. First, I can not find the routine in the local directories of this function (or package). Second, if I found the routine, could I call it just like this way, say,

[R] recover should send messages to stderr, not stdout

2004-05-11 Thread Vadim Ogranovich
Hi, recover() sends all its messages, which I consider to be error messages, to stdout. I think they more properly belong to stderr. This is an important difference for those of us who use R in batch mode to generate ASCII files. Thanks, Vadim [[alternative HTML version deleted]]

Re: [R] R 1.9.0 on AIX, 64-bit

2004-05-11 Thread Tim Hoar
Here is a followup to Andy's post -- I have a working 64-bit R on AIX ... My institution is running AIX 5.1. Several things are needed to build R 1.9.0 and use dynamic loading of .so objects. *) setenv OBJECT_MODE 64 or the equivalent. *) There is a quirk (bug?) in the AIX compilers in

[R] Sem error - subscript out of bounds

2004-05-11 Thread Leonard assis
What´s happening with this following code: require(sem) Celpe.Mod.RAM - matrix(c( # path parametroInicio Produção- T1, gamma.11, NA, Produção- T2, gamma.12, NA,

Re: AW: [R] Probleme with Kmeans...

2004-05-11 Thread Unung Istopo Hartanto
Ups... I understand now about your comment before that Kmeans has problems to process one variable. Thank you very much. Unung On Tue, 2004-05-11 at 21:40, TEMPL Matthias wrote: Sorry, to solve your question I had tried: data(faithful) kmeans(faithful[c(1:20),1],10) Error: empty cluster:

RE: [R] Sem error - subscript out of bounds

2004-05-11 Thread John Fox
Dear Leonard, There are no error variances defined for the endogenous variables in the model. Have you read the document that describes how sem() works (at http://socserv.socsci.mcmaster.ca/jfox/Books/Companion/appendix-sems.pdf)? If not, that might help you specify the model. It should also help

[R] Problems with package foreign

2004-05-11 Thread kjetil
In using read.spss I get: Error in read.spss(Chu_cambios2.sav, to.data.frame = TRUE) : Error reading system-file header. In addition: Warning message: Chu_cambios2.sav: File layout code has unexpected value 50331648. Value should be 2, in big-endian or little-endian format. This

Re: [R] lags and differences

2004-05-11 Thread Gabor Grothendieck
In this particular case, i.e. regressing diff(y) against x and x lagged one could write this: lm(diff(y)~., data=as.data.frame(embed(x,2))) which works since the length of diff(y) happens to equal the number of rows in embed(x,2). fciclone fciclone at bol.com.br writes: : : Dear all,