[R] kmeans error (bug?)

2003-11-09 Thread Murad Nayal
Hello, I have been getting the following intermittent error from kmeans: >str(cavint.p.r) num [1:1967, 1:13] 0.691 0.123 0.388 0.268 0.485 ... - attr(*, "dimnames")=List of 2 ..$ : chr [1:1967] "6" "49" "87" "102" ... ..$ : chr [1:13] "HYD" "NEG" "POS" "OXY" ... > set.seed(34) > kmeans(cav

Re: [R] Subsetting a list of vectors

2003-11-09 Thread Gabor Grothendieck
Dirk and Ray have provided two very clever solutions which perform transformation and selection in one go by returning NA and NULL respectively for unwanted elements and then eliminating the NAs and NULLs. I thought it would be worthwhile to bring them together and make some further minor

Re: [R] Subsetting a list of vectors

2003-11-09 Thread Dirk Eddelbuettel
On Sun, Nov 09, 2003 at 09:29:26PM -0600, Dirk Eddelbuettel wrote: > On Sun, Nov 09, 2003 at 10:00:42PM -0500, Gabor Grothendieck wrote: > > There are languages that do allow this. For example, Python > > has list comprehensions which are things like this: > > > ># give me the squares of the

Re: [R] Subsetting a list of vectors

2003-11-09 Thread Dirk Eddelbuettel
On Sun, Nov 09, 2003 at 10:00:42PM -0500, Gabor Grothendieck wrote: > There are languages that do allow this. For example, Python > has list comprehensions which are things like this: > ># give me the squares of the even numbers from 1-10, in a list. >>>> [ x*x for x in range(1,11) if x

RE: [R] Subsetting a list of vectors

2003-11-09 Thread Gabor Grothendieck
This has already been answered but I think behind your question may have been the thought of whether its possible to do it all at once: transformation and selection. There are languages that do allow this. For example, Python has list comprehensions which are things like this: # give me

[R] Extending function symbols() to handle arbitrary shapes

2003-11-09 Thread Steve Dutky
Currently the function symbols() permits plotting of circles, squares, rectangles, stars, thermometers, and boxplots. Can anybody suggest an approach for extending/cloning this function to handle arbitrary shapes specified, perhaps, as bitmaps, or as postscript primitives? Thanks, Steve Dutky

[R] Re: configure" options and R CMD INSTALL

2003-11-09 Thread Rajiv Prasad
Hi Tomomi: (B (BI received the other e-mail where you sent rimage_0.5-3. It installed (Bwithout any problems using fftw-2.1.5. Thanks for the quick response. (B (BRajiv (B (B- Original Message - (BFrom: "Tomomi TAKASHINA" <[EMAIL PROTECTED]> (BTo: "Rajiv Prasad" <[EMAIL PROTECTE

[R] Re: configure" options and R CMD INSTALL

2003-11-09 Thread Tomomi TAKASHINA
Hi, Rajiv: (B (BAt Sun, 9 Nov 2003 16:10:23 -0800, "Rajiv Prasad" wrote: (B (B> I tried downgrading to fftw-2.1.5, but that was no help either. The error (B> message is still the same, at the same place during configuration. (B> (B> It seems to me that configure is checking for the existan

Re: [R] Subsetting a list of vectors

2003-11-09 Thread Spencer Graves
When I did it in S-Plus 6.1 and R 1.8.0, I didn't get NULL entries: I got NAs. There is a difference between NULLs and NAs. The NAs can be deleted using is.na, as follows: > list.of.vectors <- list(a=1, b=1:3) > x3 <- sapply(list.of.vectors, function(x)x[3]) > x3 a b NA 3 > x3 a b NA 3 >

[R] Subsetting a list of vectors

2003-11-09 Thread Hadley Wickham
Hi, I'm trying to subset a list which contains variable length vectors. What I want to do is extract (eg.) the 3rd item in each vector (with length >= 3). At the moment I'm using sapply(list.of.vectors, function(x) {x[3]}). The problem with this is that sapply returns a list of the same len

Re: [R] "configure" options and R CMD INSTALL

2003-11-09 Thread Rajiv Prasad
Hi Dirk (and Tomomi): Thanks for the quick reply. I tried using '--configure-args="--with-fftw-lib=/usr/local/fftw-3.0.1"', but it did not help. configure still fails at the same place: ... checking for fftwnd_one in -lfftw... no configure: error: Sorry, cant find fftw library. Please use --wit

SV: [R] How to create unique factor from two factors? + Boostrap Q

2003-11-09 Thread Thomas Holm
Well! Isn´t that what Copulas is all about. Fitting multifactor models into one model /T Thomas Holm Södra Hesperiagatan 32A9 00100 Helsingfors [EMAIL PROTECTED] -Ursprungligt meddelande- Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För Peter Dalgaard Skickat: den 9 november 2

Re: [R] How to create unique factor from two factors? + Boostrap Q

2003-11-09 Thread Peter Dalgaard
Prof Brian Ripley <[EMAIL PROTECTED]> writes: > Well, it is one of those things > > -- it works in R but not in S > -- it appears in the examples for help(":") but is not otherwise mentioned >on the help page (why?) > -- it does not give a numerical list of combinations, as asked for > -- it

Re: [R] Non-standard axis plotting

2003-11-09 Thread Paul Murrell
Hi Laura Quinn wrote: I am trying to plot positions on a grid where the x and y axis equate to longitudinal and latitudinal co-prdinates respectively. As these co-ordinates are southings and westings, i need the origin of my graph to contain the two highest values of each co0ordinate, with the val

Re: [R] "configure" options and R CMD INSTALL

2003-11-09 Thread Dirk Eddelbuettel
On Mon, Nov 10, 2003 at 10:02:00AM -0800, Rajiv Prasad wrote: > I separately compiled and installed fftw-3.0.1. The problem seems to be that > I need to provide "--with-fftw-lib" option to the configure script. How do I > do this? As options to R CMD INSTALL as per: [EMAIL PROTECTED]:~/chibud

[R] "configure" options and R CMD INSTALL

2003-11-09 Thread Rajiv Prasad
Hi folks: I am trying to install the package "rimage" in R 1.8.0 on an Alpha Linux box. "R CMD INSTALL rimage_0.5-1.tar.gz" fails with the following: ... ... checking for stdint.h... yes checking for unistd.h... yes checking fftw.h usability... yes checking fftw.h presence... yes checking for f

Re: [R] weird behaviour of eigen()

2003-11-09 Thread Thomas Lumley
On Sun, 9 Nov 2003, Karim Elsawy wrote: > I'm using R 1.7.1 under linux redhat > it seems that the eigen values produced by eigen() do not follow > a consistant order; I mean either ascending or discending This is strange, since the source code explicitly sorts them. Can you send an actual exampl

Re: [R] multiple cross-correlation function

2003-11-09 Thread Prof Brian Ripley
On Sun, 9 Nov 2003, mpie wrote: > Please forgive my ignorance, but is there such thing > as a "multiple cross-correlation function", i.e., a > cross-correlation function for more than two time > series. If there is, is it implemented in R? I > couldn't find it. ?acf -- Brian D. Ripley,

Re: [R] How to create unique factor from two factors? + Boostrap Q

2003-11-09 Thread Prof Brian Ripley
Well, it is one of those things -- it works in R but not in S -- it appears in the examples for help(":") but is not otherwise mentioned on the help page (why?) -- it does not give a numerical list of combinations, as asked for -- it does give unused levels, which in this application is disastr

Re: [R] How to create unique factor from two factors? + Boostrap Q

2003-11-09 Thread kjetil
On 9 Nov 2003 at 13:29, Prof Brian Ripley wrote: > Factor3 <- factor(unclass(Factor1) + nlevels(Factor1)*(unclass(Factor2)-1)) > Cannot this be done even easier by calculating the interaction? > a <- factor(rep(1:3,rep(3,3))) > b <- factor(rep(1:3,3)) > ab <- a:b > ab [1] 1:1 1:2 1:3 2:1 2:2 2:

[R] multiple cross-correlation function

2003-11-09 Thread mpie
Hi all, Please forgive my ignorance, but is there such thing as a "multiple cross-correlation function", i.e., a cross-correlation function for more than two time series. If there is, is it implemented in R? I couldn't find it. Thanks, Mark __ [EMAIL

[R] weird behaviour of eigen()

2003-11-09 Thread Karim Elsawy
I'm using R 1.7.1 under linux redhat it seems that the eigen values produced by eigen() do not follow a consistant order; I mean either ascending or discending e.g for one system: eigenV<-eigen(V) > print(eigenV$values) [1] -7.706828e+13 -4.702980e+13 -3.267579e+13 -1.701297e+

Re: [R] How to create unique factor from two factors? + Boostrap Q

2003-11-09 Thread Prof Brian Ripley
Factor3 <- factor(unclass(Factor1) + nlevels(Factor1)*(unclass(Factor2)-1)) will give you the unique combinations, not labelled as you do but then I don't think you need that. On Sun, 9 Nov 2003, Scott Norton wrote: > This might be easy but I'm very new to R and this question doesn't seem to >

[R] How to create unique factor from two factors? + Boostrap Q

2003-11-09 Thread Scott Norton
This might be easy but I'm very new to R and this question doesn't seem to have any nice keywords that bring up relevant search results when I search the CRAN search engine. Therefore, I'll plead (as I have in the recent past) Newbie status. I have a data frame with two factors (Factor 1 and 2