[R] Re : Combining two datasets

2007-02-01 Thread justin bem
data3-sort(c(data1,data2)) See ?cbind, ? rbind ?append and ?merge for combining data Justin BEM Elève Ingénieur Statisticien Economiste BP 294 Yaoundé. Tél (00237)9597295. ___

[R] Sleep Function

2007-02-01 Thread Shubha Vishwanath Karanth
Hi R, I am fetching Bloomberg data from R. The problem I face is that I get a downloading error once pasted, but the same code run again will download the data. So, I assure you that it is not the problem with the R code. I will not be able to download the data due to some system

[R] Calling C code from R

2007-02-01 Thread Deb Midya
Hi! Thanks in advance. I am using R-2.4.0 on Windows XP. I am trying to create dll file. My C code: /* useC1.c */ void useC(int *i) { i[6] = 100; } I have tried to create useC1.dll. C:\R-2.4.0\binR CMD SHLIB useC1.c 'perl' is not recognized as an

[R] Extracting part of date variable

2007-02-01 Thread stat stat
Dear all, Suppose I have a date variable: c = 99/05/12 I want to extract the parts of this date like month number, year and day. I can do it in SPSS. Is it possible to do this in R as well? Rgd, - Here’s a

[R] Estimation of discrete unimodal density

2007-02-01 Thread wvanwie
Dear All, A method for the estimation is univariate unimodal densities (with unknown mode) is described in Statistical Inference under Order Restrictions by Barlow et al.. Would anyone know whether there is an R-implementation (preferably with reference) for the estimation of univariate

[R] R for bioinformatics

2007-02-01 Thread Benoit Ballester
Hi, I was wondering if someone could tell me more about this book, (if it's a good or bad one). I can't find it, as it seems that O'Reilly doesn't publish any more. Thanks, Ben -- Benoit Ballester __ R-help@stat.math.ethz.ch mailing list

Re: [R] Extracting part of date variable

2007-02-01 Thread Henrique Dallazuanna
format.Date(c, %d) format.Date(c, %m) format.Date(c, %y) format.Date(c, %Y) On 01/02/07, stat stat [EMAIL PROTECTED] wrote: Dear all, Suppose I have a date variable: c = 99/05/12 I want to extract the parts of this date like month number, year and day. I can do it in SPSS. Is it

[R] Wavlet filter using morlet mother wavelet

2007-02-01 Thread anil kumar rohilla
nbsp; Hi, List ,I am searching any package on R which can do wavelet filtering for mother wavelet morlet ,is anybody having any script for the same ?I am new to the RwAVELET ANALSSIS..THANKS IN ADVANCE ANIL KUMAR ANIL KUMAR(nbsp;METEOROLOGIST)LRF SECTIONnbsp;NATIONAL

Re: [R] Calling C code from R

2007-02-01 Thread Vladimir Eremeev
You need to install perl and MinGW, at least. If you have them installed, then you need to properly set PATH environment variable and, probably, restart your command line session. See chapter 5 of the manual Writing R extensions (installed in R_HOME/doc/manual) and these two links

[R] matrix of matrices

2007-02-01 Thread Federico Abascal
Dear all, it is likely a stupid question but I cannot solve it. I want to have a matrix of 100 elements. Each element must be a vector of 500 elements. If I do: imp-array(dim=100) imp[1]-vector(length=500) it does not work. Warning message: number of items to replace is not a multiple

[R] indexing

2007-02-01 Thread javier garcia-pintado
Hello, In a nutshell, I've got a data.frame like this: assignation - data.frame(value=c(6.5,7.5,8.5,12.0),class=c(1,3,5,2)) assignation value class 1 6.5 1 2 7.5 3 3 8.5 5 4 12.0 2 and a long vector of classes like this: x - c(1,1,2,7,6,5,4,3,2,2,2...) And would

Re: [R] Extracting part of date variable

2007-02-01 Thread Gabor Grothendieck
Read the help desk article in R News 4/1 about dates and note the table at the end of it, in particular. On 2/1/07, stat stat [EMAIL PROTECTED] wrote: Dear all, Suppose I have a date variable: c = 99/05/12 I want to extract the parts of this date like month number, year and day. I can

Re: [R] Calling C code from R

2007-02-01 Thread Peter Dalgaard
Deb Midya wrote: Hi! Thanks in advance. I am using R-2.4.0 on Windows XP. I am trying to create dll file. My C code: /* useC1.c */ void useC(int *i) { i[6] = 100; } I have tried to create useC1.dll. C:\R-2.4.0\binR CMD SHLIB useC1.c

Re: [R] Extracting part of date variable

2007-02-01 Thread Peter Dalgaard
stat stat wrote: Dear all, Suppose I have a date variable: c = 99/05/12 I want to extract the parts of this date like month number, year and day. I can do it in SPSS. Is it possible to do this in R as well? Rgd, Yes. One way is to use substr(), e.g.:

Re: [R] indexing

2007-02-01 Thread Dimitris Rizopoulos
one way is the following: assignation$value[match(x, assignation$class)] 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:

Re: [R] indexing

2007-02-01 Thread jim holtman
assignation$value[match(x,assignation$class)] [1] 6.5 6.5 12.0 NA NA 8.5 NA 7.5 12.0 12.0 12.0 On 2/1/07, javier garcia-pintado [EMAIL PROTECTED] wrote: Hello, In a nutshell, I've got a data.frame like this: assignation - data.frame(value=c(6.5,7.5,8.5,12.0),class=c(1,3,5,2))

[R] read.spss and encodings

2007-02-01 Thread Thomas Friedrichsmeier
Hi! I'm having trouble with importing spss files containing non-ascii characters (R 2.4.1, debian linux, i386). To reproduce: Download the following file: http://statmath.wu-wien.ac.at/data/spss/de/comphomeneu.sav require (foreign) Sys.setlocale (locale=C) read.spss(comphomeneu.sav)$ARBEIT[1]

[R] How can I calculate conditional mean in a large dataset including date data

2007-02-01 Thread Majid Iravani
Dear R users, I have a dataframe with two columns: first column is date data (e.g. 1/1/2000 with character format: daily data from 1/1/1970 till 31/12/2003) and second column is temperature value. Now I'd like to calculate mean for each month in a year (i.e. May 2001, June 1997) and mean for

Re: [R] read.spss and encodings

2007-02-01 Thread Peter Dalgaard
Thomas Friedrichsmeier wrote: Hi! I'm having trouble with importing spss files containing non-ascii characters (R 2.4.1, debian linux, i386). To reproduce: Download the following file: http://statmath.wu-wien.ac.at/data/spss/de/comphomeneu.sav require (foreign) Sys.setlocale (locale=C)

Re: [R] memory-efficient column aggregation of a sparse matrix

2007-02-01 Thread Douglas Bates
On 1/31/07, Jon Stearley [EMAIL PROTECTED] wrote: I need to sum the columns of a sparse matrix according to a factor - ie given a sparse matrix X and a factor fac of length ncol(X), sum the elements by column factors and return the sparse matrix Y of size nrow(X) by nlevels(f). The appended

Re: [R] matrix of matrices

2007-02-01 Thread Federico Abascal
For the case someone is interested in it, here it is the solution somebody suggested me: to use a list. imp - vector(list, 100) imp[[1]] - im[1:500,] names(imp[[1]]) = the list of labels of imp[1:500,] Thanks! Federico Federico Abascal wrote: Dear all, it is likely a stupid question but I

Re: [R] features of save and save.image (unexpected file sizes)

2007-02-01 Thread Vaidotas Zemlys
Hi, On 2/1/07, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Thu, 1 Feb 2007, Vaidotas Zemlys wrote: Hi, On 1/31/07, Professor Brian Ripley [EMAIL PROTECTED] wrote: Two comments: 1) ls() does not list all the objects: it has all.names argument. Yes, I tried it with all.names,

Re: [R] memory-efficient column aggregation of a sparse matrix

2007-02-01 Thread roger koenker
Doug is right, I think, that this would be easier with full indexing using the matrix.coo classe, if you want to use SparseM. But then the tapply seems to be the way to go. url:www.econ.uiuc.edu/~rogerRoger Koenker email[EMAIL PROTECTED]Department of Economics

[R] Index mapping on arrays

2007-02-01 Thread Demi Anderson
Dear R-community, I have some trouble with index mappings for arrays. If, for example, I have the array R A - array(1:9, c(3,3,2)) and two index mappings both of same size R x - c(2, 3) R y - c(1, 2) Now I want to access the elements (A[1, x[i], y[i]])_i of A, i.e. A[1, x[1], y[1]] = A[1, 2,

Re: [R] Wiki for Graphics tips for MacOS X

2007-02-01 Thread Ben Bolker
Gabor Grothendieck ggrothendieck at gmail.com writes: To get the best results you need to transfer it using vector graphics rather than bitmapped graphics: http://www.stc-saz.org/resources/0203_graphics.pdf There are a number of variations described here (see entire thread). Its for

Re: [R] any implementations for adaptive modeling of time series?

2007-02-01 Thread AA
Hi Peter, generally speaking, wavelets are known to be good at extracting signal from noisy data and are adaptive but I am not familiar with any R implementation of wavelets. A simple way of looking at changes would be to use CUSUM (strucchange package). I hope this helps. Ansel. On 1/30/07,

Re: [R] Estimation of discrete unimodal density

2007-02-01 Thread rolf
Wessel van Wieringen wrote: A method for the estimation is univariate unimodal densities (with unknown mode) is described in Statistical Inference under Order Restrictions by Barlow et al.. Would anyone know whether there is an R-implementation (preferably with reference) for the estimation

Re: [R] Index mapping on arrays

2007-02-01 Thread Dimitris Rizopoulos
probably you want something like the following: A[cbind(rep(1, length(x)), x, 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:

Re: [R] prop.test() references

2007-02-01 Thread Marc Schwartz
On Thu, 2007-02-01 at 07:22 +0100, Jean lobry wrote: Dear R-help, I'm using prop.test() to compute a confidence interval for a proportion under R version 2.4.1, as in: prop.test(x = 340, n = 400)$conf [1] 0.8103309 0.8827749 I have two questions: 1) from the source code my

Re: [R] Wiki for Graphics tips for MacOS X

2007-02-01 Thread Gabor Grothendieck
On 2/1/07, Ben Bolker [EMAIL PROTECTED] wrote: Gabor Grothendieck ggrothendieck at gmail.com writes: To get the best results you need to transfer it using vector graphics rather than bitmapped graphics: http://www.stc-saz.org/resources/0203_graphics.pdf There are a number of

Re: [R] what is the purpose of an error message in uniroot?

2007-02-01 Thread Chris Andrews
Matt, Some time back I didn't like the uniroot restriction either so I wrote a short function manyroots that breaks an interval into many shorter intervals and looks for a single root in each of them. This function is NOT guaranteed to find all roots in an interval even if you specify many

Re: [R] How can I calculate conditional mean in a large dataset including date data

2007-02-01 Thread Vladimir Eremeev
dfr-data.frame(day=c(1/1/1970,5/1/1970,5/12/2003,31/12/2003),temperature=c(1,-1,2,0.5)) dfr day temperature 1 1/1/1970 1.0 2 5/1/1970-1.0 3 5/12/2003 2.0 4 31/12/2003 0.5

Re: [R] read.spss and encodings

2007-02-01 Thread Thomas Friedrichsmeier
On Thursday 01 February 2007 14:18, Peter Dalgaard wrote: so you should convert it: iconv(Im B\xfcro, from=latin1, to=UTF-8) [1] Im Büro iconv(Im B\374ro,from=latin1, to=UTF-8) [1] Im Büro I see. Thanks! Any chances of adding something like this to read.spss()? read.spss -

[R] Fwd: Re: read.spss and encodings

2007-02-01 Thread John Kane
--- John Kane [EMAIL PROTECTED] wrote: Date: Thu, 1 Feb 2007 09:07:11 -0500 (EST) From: John Kane [EMAIL PROTECTED] Subject: Re: [R] read.spss and encodings To: Thomas Friedrichsmeier [EMAIL PROTECTED] Hi Thomas, I am using R 2.4.1 on WindowsXP and I don't seem to be having any

Re: [R] How can I calculate conditional mean in a large dataset including date data

2007-02-01 Thread bogdan romocea
days - seq(as.Date(1970/1/1), as.Date(2003/12/31), days) temp - rnorm(length(days), mean=10, sd=8) tapply(temp, format(days,%Y-%m), mean) tapply(temp, format(days,%b), mean) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Majid Iravani Sent:

Re: [R] Extracting part of date variable

2007-02-01 Thread John Kane
Thank you Peter. It was not my question but I was just about to start the morning's work by searching Help and RSiteSearch() for this exact question. --- Peter Dalgaard [EMAIL PROTECTED] wrote: stat stat wrote: Dear all, Suppose I have a date variable: c = 99/05/12

Re: [R] Index mapping on arrays

2007-02-01 Thread Robin Hankin
Hello Demi The trick for array indexing on an array A, where length(dim(A))==n, is to use an n-column matrix M to extract the elements by rows of M. If I understand correctly, the following should help: A - array(1:18,c(3,3,2)) x - 2:3 y - 1:2 A[cbind(x,y,1)] [1] 2 6 You may find

[R] xtable and column headings

2007-02-01 Thread Ian Kennedy
When I generate a LaTeX table using xtable I have been setting column names to strings with LaTeX code in order to get features like subscripts in the column headings. I recently had to reinstall xtable and discovered that all my LaTeX column headings were printing out in LaTeX code rather than

Re: [R] How can I calculate conditional mean in a large dataset including date data

2007-02-01 Thread Gabor Grothendieck
You could also use aggregate with the zoo package. Using the same input data that Vladimir used, create a zoo variable and aggregate it: library(zoo) z - zoo(dfr[,2], as.Date(dfr[,1], %d/%m/%Y)) aggregate(z, as.yearmon, mean) Jan 1970 Dec 2003 0.00 1.25 zoo is described in the

Re: [R] line plot

2007-02-01 Thread Rense Nieuwenhuis
Hi, or otherwise you may try: plot(c(1,5), c(1,10),type=l) kindest regard, Rense On Feb 1, 2007, at 8:14 , Petr Pikal wrote: Hi see ?segments segments(1,10,5,10) HTH Petr On 1 Feb 2007 at 14:21, XinMeng wrote: From: XinMeng [EMAIL PROTECTED] To:

[R] Need help writing a faster code

2007-02-01 Thread Ravi Varadhan
Hi, I apologize for this repeat posting, which I first posted yesterday. I would appreciate any hints on solving this problem: I have two matrices A (m x 2) and B (n x 2), where m and n are large integers (on the order of 10^4). I am looking for an efficient way to create another matrix,

Re: [R] mca-graphics: all elements overlapping in the help-example for multiple correspondence analysis

2007-02-01 Thread Michael Reinecke
Thank you very much, that works fine! I now realize that I should have looked up not only the help pages for plot and mca but also for plot.mca, which I did not think possible (unfortunately I am a too sporadic user to know where to get the appropriate information). Best regards, Michael

Re: [R] Loading functions in R

2007-02-01 Thread Matthew Keller
Hi Jeff, The way I do this is to place all the options that I want, along with functions I've written that I always want available, into the Rprofile.site file. R always loads this file upon startup. That file is located in the etc/ folder. E.g., on my computer, it is at: C:\Program

Re: [R] Need help writing a faster code

2007-02-01 Thread Dimitris Rizopoulos
the following seems to be a first improvement: m - 2000 n - 5000 A - matrix(rnorm(2*m), ncol=2) B - matrix(rnorm(2*n), ncol=2) W1 - W2 - matrix(0, m, n) ## ## g1 - function(x, y){ theta - atan((y[2] - x[2]) / (y[1] - x[1])) theta +

Re: [R] Need help writing a faster code

2007-02-01 Thread Robin Hankin
Hi A - matrix(runif(10),ncol=2) B - matrix(runif(10),ncol=2) g - function(i4){theta - atan2( (i4[4]-i4[2]),(i4[3]-i4[1])) + return(theta + 2*pi*(theta0))} apply(A,1,function(x){apply(B,1,function(y){g(c(x,y))})}) [,1] [,2] [,3][,4] [,5] [1,] 1.1709326

Re: [R] read.spss and encodings

2007-02-01 Thread Thomas Lumley
On Thu, 1 Feb 2007, Thomas Friedrichsmeier wrote: Hi! I'm having trouble with importing spss files containing non-ascii characters Peter has explained what is going on. It would be ideal for read.spss() to do the translation to the current locale. This would require knowing what encoding

Re: [R] xtable and column headings

2007-02-01 Thread Richard M. Heiberger
I would use latex() in the Hmsic package. Here is a short example tmp - matrix(1:12,4) library(Hmisc) tmp.latex - latex(tmp, colheads=c(abc$_1$,def$^{12}_4$,$g\\times h$)) ## note the escaped \ in the above colheads vector print.default(tmp.latex) Copy the contents of the file referenced in

[R] [lattice] levelplot for 2D density plots

2007-02-01 Thread Sebastian Weber
Hello all, I'm trying to use the levelplot lattice function and can not adapt it to my tastes concering colors: dens - data.frame(x=c(), y=c(), z=c(), run=c()) for(l in levels(degCorrel$run)) { ind - degCorrel$run == l dk - kde2d(log10(degCorrel$correlFunc[ind]), log10(degCorrel

[R] indexing without looping

2007-02-01 Thread javier garcia-pintado
Hello, I've got a data.frame like this: assignation - data.frame(value=c(6.5,7.5,8.5,12.0),class=c(1,3,5,2)) assignation value class 1 6.5 1 2 7.5 3 3 8.5 5 4 12.0 2 and a long vector of classes like this: x - c(1,1,2,7,6,5,4,3,2,2,2...) And

Re: [R] Need help writing a faster code

2007-02-01 Thread Ravi Varadhan
Thank you, Dimitris and Robin. Dimitris - your solution(s) works very well. Although my g function is a lot more complicated than that in the simple example that I gave, I think that I can use your idea of taking the whole matrix inside the function and working directly with it. Robin - using

[R] when i configure the R 2.4.1,i meet the problem

2007-02-01 Thread xiaopeng hu
i get the message : configure: WARNING: you cannot build info or html versions of the R manuals how to deal with it ? [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] indexing without looping

2007-02-01 Thread David Barron
One way would be to use merge, like this: merge(assignation,data.frame(class=x),all.y=TRUE) There might well be better ways... On 01/02/07, javier garcia-pintado [EMAIL PROTECTED] wrote: Hello, I've got a data.frame like this: assignation -

Re: [R] indexing without looping

2007-02-01 Thread Ido M. Tamir
Hi, xt - assignation$value[match(x,assignation$class)] HTH ido __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented,

Re: [R] indexing

2007-02-01 Thread Tony Plate
a - data.frame(value=c(6.5,7.5,8.5,12.0),class=c(1,3,5,2)) x - c(1,1,2,7,6,5,4,3,2,2,2) match(x, a$class) [1] 1 1 4 NA NA 3 NA 2 4 4 4 a[match(x, a$class), value] [1] 6.5 6.5 12.0 NA NA 8.5 NA 7.5 12.0 12.0 12.0 -- Tony Plate javier garcia-pintado wrote: Hello,

Re: [R] Need help writing a faster code

2007-02-01 Thread Ravi Varadhan
Dear Dimitris, I implemented your solution on my actual problem. I was able to generate my large transition matrix in 56 seconds, compared to the previous time of around 27 minutes. Wow!!! I thank you very much for the help. R and the R-user group are truly amazing! Best regards, Ravi.

Re: [R] when i configure the R 2.4.1,i meet the problem

2007-02-01 Thread Roland Rau
On 2/1/07, xiaopeng hu [EMAIL PROTECTED] wrote: i get the message : configure: WARNING: you cannot build info or html versions of the R manuals how to deal with it ? did you read the manual 'R Installation and Administration'? see section 2.2 there. it is mentioned there that you need

[R] would you please navigate me?

2007-02-01 Thread a.eslami
Hello My name is Aida Eslami. I am a M.S.c student of statistics at Shahid Beheshti University , Tehran, Iran. The subject of my thesis is Analysis of Masked Data. I have some problems in

[R] Losing factor levels when moving variables from one context to another

2007-02-01 Thread Michael Rennie
Hi, there I'm currently trying to figure out how to keep my factor levels for a variable when moving it from one data frame or matrix to another. Example below: vec1-(rep(10,5)) vec2-(rep(30,5)) vec3-(rep(80,5)) vecs-c(vec1, vec2, vec3) resp-rnorm(2,15) dat-as.data.frame(cbind(resp, vecs))

Re: [R] Losing factor levels when moving variables from one context to another

2007-02-01 Thread Chuck Cleland
Michael Rennie wrote: Hi, there I'm currently trying to figure out how to keep my factor levels for a variable when moving it from one data frame or matrix to another. Example below: vec1-(rep(10,5)) vec2-(rep(30,5)) vec3-(rep(80,5)) vecs-c(vec1, vec2, vec3) resp-rnorm(2,15)

Re: [R] Losing factor levels when moving variables from one context to another

2007-02-01 Thread Marc Schwartz
On Thu, 2007-02-01 at 12:13 -0500, Michael Rennie wrote: Hi, there I'm currently trying to figure out how to keep my factor levels for a variable when moving it from one data frame or matrix to another. Example below: vec1-(rep(10,5)) vec2-(rep(30,5)) vec3-(rep(80,5)) vecs-c(vec1,

Re: [R] would you please navigate me?

2007-02-01 Thread Ben Bolker
a.eslami a.eslami at Mail.sbu.ac.ir writes: Hello My name is Aida Eslami. I am a M.S.c student of statistics at Shahid Beheshti University , Tehran, Iran. The subject of my thesis is Analysis of Masked Data. I have some problems in writing of my program (optimization). Would you

[R] Help with efficient double sum of max (X_i, Y_i) (X Y vectors)

2007-02-01 Thread Jeffrey Racine
Greetings. For R gurus this may be a no brainer, but I could not find pointers to efficient computation of this beast in past help files. Background - I wish to implement a Cramer-von Mises type test statistic which involves double sums of max(X_i,Y_j) where X and Y are vectors of differing

Re: [R] Help with efficient double sum of max (X_i, Y_i) (X Y vectors)

2007-02-01 Thread Ravi Varadhan
Jeff, Here is something which is a little faster: sum1 - sum(outer(x, x, FUN=pmax)) sum3 - sum(outer(x, y, FUN=pmax)) Best, Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health

Re: [R] Help with efficient double sum of max (X_i, Y_i) (X Y vectors)

2007-02-01 Thread Benilton Carvalho
Well, a reproducible example would be nice =) not tested: x = rnorm(10) y = rnorm(20) mymax - function(t1, t2) apply(cbind(t1, t2), 1, max) sum(outer(x, y, mymax)) is this sth like what you need? b On Feb 1, 2007, at 1:18 PM, Jeffrey Racine wrote: Greetings. For R gurus this may be a no

Re: [R] R for bioinformatics

2007-02-01 Thread Seth Falcon
Benoit Ballester [EMAIL PROTECTED] writes: Hi, I was wondering if someone could tell me more about this book, (if it's a good or bad one). I can't find it, as it seems that O'Reilly doesn't publish any more. I've never seen a copy so I can't comment about its quality (has anyone seen a

[R] Upcoming Course**** R/Splus Fundamentals and Programming Techniques**** In Washington DC, San Francisco and Princeton

2007-02-01 Thread elvis
XLSolutions Corporation (www.xlsolutions-corp.com) is proud to announce our R/S-plus Fundamentals and Programming Techniques : www.xlsolutions-corp.com/Rfund.htm *** Washington DC / March 1-2, 2007 *** San Francisco / March 15-16, 2007 *** Princeton / Week of Feb 26 (dates coming soon) Should

Re: [R] indexing without looping

2007-02-01 Thread Greg Johnson
javier garcia-pintado jgarcia at ija.csic.es writes: Hello, I've got a data.frame like this: assignation - data.frame(value=c(6.5,7.5,8.5,12.0),class=c(1,3,5,2)) assignation value class 1 6.5 1 2 7.5 3 3 8.5 5 4 12.0 2 and a long

Re: [R] R for bioinformatics

2007-02-01 Thread Marc Schwartz
On Thu, 2007-02-01 at 10:45 -0800, Seth Falcon wrote: Benoit Ballester [EMAIL PROTECTED] writes: Hi, I was wondering if someone could tell me more about this book, (if it's a good or bad one). I can't find it, as it seems that O'Reilly doesn't publish any more. I've never seen a

Re: [R] Help with efficient double sum of max (X_i, Y_i) (X Y vectors)

2007-02-01 Thread Achim Zeileis
Jeff, you can do sum1: \sum_i\sum_j max(X_i,X_j) sum2: \sum_i\sum_j max(Y_i,Y_j) sum(x * (2 * rank(x) - 1)) sum3: \sum_i\sum_j max(X_i,Y_j) sum(outer(x, y, pmax)) Probably, the latter can be speeded up even more... Z __ R-help@stat.math.ethz.ch

[R] plot.function with xlim, bug?

2007-02-01 Thread Prasenjit Kapat
Consider the following lines of code: plot(function(x) sin(cos(x)*exp(-x/2)), from=-8,to=7,xlim=c(-5,5)) Uses integral points (integers from -5 to 5) to draw the plot, instead of the usual default of n= 101 equally spaced points (from ?plot.function). plot(function(x)

[R] Lining up x-y datasets based on values of x

2007-02-01 Thread Christos Hatzis
Hi, I was wondering if there is a direct approach for lining up 2-column matrices according to the values of the first column. An example and a brute-force approach is given below: x - cbind(1:10, runif(10)) y - cbind(5:14, runif(10)) z - cbind((-4):5, runif(10)) xx - seq(

Re: [R] Lining up x-y datasets based on values of x

2007-02-01 Thread Marc Schwartz
On Thu, 2007-02-01 at 15:05 -0500, Christos Hatzis wrote: Hi, I was wondering if there is a direct approach for lining up 2-column matrices according to the values of the first column. An example and a brute-force approach is given below: x - cbind(1:10, runif(10)) y - cbind(5:14,

Re: [R] R for bioinformatics

2007-02-01 Thread Peter Dalgaard
Marc Schwartz wrote: On Thu, 2007-02-01 at 10:45 -0800, Seth Falcon wrote: Benoit Ballester [EMAIL PROTECTED] writes: Hi, I was wondering if someone could tell me more about this book, (if it's a good or bad one). I can't find it, as it seems that O'Reilly doesn't publish any

[R] Can this loop be delooped?

2007-02-01 Thread Talbot Katz
Hi. I have the following code in a loop. It splits a vector into subvectors of equal size. But if the size of the original vector is not an exact multiple of the desired subvector size, then the first few subvectors have one more element than the last few. I know that the cut function could

Re: [R] Problems installing R-2.4.1 on Solaris 11 x-86 from source: error in gmake after successful configure

2007-02-01 Thread Prof Brian Ripley
What is 'Solaris 11'? According to www.sun.com, the latest Solaris version is 10, and my sysadmins have not heard of Solaris 11. You seem to be missing the Solaris compilation tools, ar in this case. In Solaris = 10 they are in /usr/ccs/bin, not in the path by default. On Wed, 31 Jan 2007,

Re: [R] Lining up x-y datasets based on values of x

2007-02-01 Thread Christos Hatzis
Thanks Marc and Phil. My dataset actually consists of 50+ individual files, so I will have to do this one column at a time in a loop... I might look into SQL and outer joints as an alternative to avoid looping. Thanks again. -Christos -Original Message- From: Marc Schwartz

Re: [R] R for bioinformatics

2007-02-01 Thread Marc Schwartz
On Thu, 2007-02-01 at 21:32 +0100, Peter Dalgaard wrote: Marc Schwartz wrote: On Thu, 2007-02-01 at 10:45 -0800, Seth Falcon wrote: Benoit Ballester [EMAIL PROTECTED] writes: Hi, I was wondering if someone could tell me more about this book, (if it's a good or bad one).

[R] time series analysis

2007-02-01 Thread lamack lamack
Does anyone know a good introductory book or tutorial about time series analysis? (time series for a beginner). Thank you so much. John Lamak _ Descubra como mandar Torpedos SMS do seu Messenger para o celular dos seus amigos.

Re: [R] time series analysis

2007-02-01 Thread Ben Fairbank
John -- Well, as a start, have a look at Modern Applied Statistics with S, by Venables and Ripley, both of which names you will recognize if you read this list often. There is a 30-page chapter on time series (with suggestions for other readings), obviously geared to S and R, that is a good

Re: [R] Lining up x-y datasets based on values of x

2007-02-01 Thread Marc Schwartz
On Thu, 2007-02-01 at 15:45 -0500, Christos Hatzis wrote: Thanks Marc and Phil. My dataset actually consists of 50+ individual files, so I will have to do this one column at a time in a loop... I might look into SQL and outer joints as an alternative to avoid looping. Thanks again.

[R] Autocorrelated Binomial

2007-02-01 Thread Rick Bilonick
I need to generate autocorrelated binary data. I've found references to the IEKS package but none of the web pages currently exist. Does anyone know where I can find this package or suggest another package? Rick B. __ R-help@stat.math.ethz.ch mailing

Re: [R] Lining up x-y datasets based on values of x

2007-02-01 Thread Marc Schwartz
Christos, Haccording to the Value section in ?merge: A data frame. The rows are by default lexicographically sorted on the common columns, but for sort=FALSE are in an unspecified order. Looking at the code, while there is a lot of time spent on matching things, the key sort() code

Re: [R] Lining up x-y datasets based on values of x

2007-02-01 Thread Christos Hatzis
[Sorry I meant to reply to the list] Thanks, Marc. That's what I have done. However, there seems to be a penalty from using merge repeatedly as it appears to internally re-sort the datasets. In my case the datasets are long (~35K rows) and already sorted so this step adds considerable and

[R] Affymetrix data analysis

2007-02-01 Thread Tristan Coram
Hi, I am trying to read in my Affymetrix CEL files (48 files, total ~600 MB) but I keep getting memory errors. Can somebody please help me with this. Or is therea remote server I can send my data to for computation? Any help is much appreciated. Thanks Dr. Tristan Coram

Re: [R] Can this loop be delooped?

2007-02-01 Thread jim holtman
This might do what you want: # test data x - 1:43 nb - 5 # number of subsets # create vector of lengths of subsets ns - rep(length(x) %/% nb, nb) # see if we have to adjust counts of initial subsets if ((.offset - length(x) %% nb) != 0) ns[1:.offset] = ns[1:.offset] + 1 # create the

Re: [R] Wavlet filter using morlet mother wavelet

2007-02-01 Thread rdporto1
Anil Kumar, it seems there isn't packages for continuous wavelet transforms in R. Anyway, take a look at the packages waveslim, wavethresh, wavelets or rwt. Maybe one of them can be useful to you. Rogerio. -- Cabeçalho original --- De: [EMAIL PROTECTED] Para:

[R] RSiteSearch() etc. - speed improvement

2007-02-01 Thread Jonathan Baron
My R search page at http://finzi.psych.upenn.edu/ which is also what you get with RSiteSearch() has been slowing down the last few months (years?). I thought this was because the archives were just getting too big. But I discovered a simple fix. The technical term for the problem is garbage. By

Re: [R] Lining up x-y datasets based on values of x

2007-02-01 Thread Prof Brian Ripley
On Thu, 1 Feb 2007, Marc Schwartz wrote: Christos, Haccording to the Value section in ?merge: A data frame. The rows are by default lexicographically sorted on the common columns, but for sort=FALSE are in an unspecified order. There is also a sort in the .Internal code. But I am

Re: [R] memory-efficient column aggregation of a sparse matrix

2007-02-01 Thread Jon Stearley
On Feb 1, 2007, at 6:22 AM, Douglas Bates wrote: It turns out that in the sparse matrix code used by the Matrix package the triplet representation allows for duplicate index positions with the convention that the resulting value at a position is the sum of the values of any triplets with

Re: [R] Lining up x-y datasets based on values of x

2007-02-01 Thread Gabor Grothendieck
The zoo package has a multiway merge with optional zero fill. Here are two ways: library(zoo) merge(x = zoo(x[,2], x[,1]), y = zoo(y[,2], y[,1]), z = zoo(z[,2], z[,1]), fill = 0) # or library(zoo) X - list(x = x, y = y, z = z) merge0 - function(..., fill = 0) merge(..., fill =

Re: [R] Affymetrix data analysis

2007-02-01 Thread Benilton Carvalho
The bioconductor mailing list is probably a better place to ask this type of question. [EMAIL PROTECTED] But we also need to know what arrays are you working with, what the errors are, what your sessionInfo() is Let us know, ok? b On Feb 1, 2007, at 5:46 PM, Tristan Coram wrote: Hi,

Re: [R] Affymetrix data analysis

2007-02-01 Thread Sicotte, Hugues Ph.D.
Tristan, I have a soft spot for problems analyzing microarrays with R.. for the memory issue, there have been previous posts to this list.. But here is the answer I gave a few weeks ago. If you need more memory, you have to move to linux or recompile R for windows yourself.. .. But you'll still

Re: [R] Wiki for Graphics tips for MacOS X

2007-02-01 Thread Gabor Grothendieck
I don't have a Linux system to try it with but omitting both dev.control statements it worked for me between two Windows XP sessions on the same machine using this version of R: R.version.string # Windows XP [1] R version 2.4.1 Patched (2006-12-30 r40331) It also successfully worked with:

Re: [R] Lining up x-y datasets based on values of x

2007-02-01 Thread Marc Schwartz
On Thu, 2007-02-01 at 23:34 +, Prof Brian Ripley wrote: On Thu, 1 Feb 2007, Marc Schwartz wrote: Christos, Haccording to the Value section in ?merge: A data frame. The rows are by default lexicographically sorted on the common columns, but for sort=FALSE are in an

Re: [R] Lining up x-y datasets based on values of x

2007-02-01 Thread Christos Hatzis
Marc, I don't think the issue is duplicates in the matching columns. The data were generated by an instrument (NMR spectrometer), processed by the instrument's software through an FFT transform and other transformations and finally reported as a sequence of chemical shift (x) vs intensity (y)

Re: [R] Problems installing R-2.4.1 on Solaris 11 x-86 from source: error in gmake after successful configure

2007-02-01 Thread 廖宮毅
On Thu, 2007-02-01 at 20:39 +, Prof Brian Ripley wrote: What is 'Solaris 11'? According to www.sun.com, the latest Solaris version is 10, and my sysadmins have not heard of Solaris 11. That is the solaris express community release, or the pre-release of the upcoming OpenSolaris

Re: [R] Lining up x-y datasets based on values of x

2007-02-01 Thread Christos Hatzis
Thanks Gabor. This is along the lines of what I was looking for. In fact the merge function for zoo objects (ordered) turns out to be almost an order of magnitude faster than the generic merge function for my problem: system.time( + zz - merge( spec.1 = zoo(nmr.spectra.serum[[1]]$V2,

Re: [R] Lining up x-y datasets based on values of x

2007-02-01 Thread Marc Schwartz
On Thu, 2007-02-01 at 22:46 -0500, Christos Hatzis wrote: Marc, I don't think the issue is duplicates in the matching columns. The data were generated by an instrument (NMR spectrometer), processed by the instrument's software through an FFT transform and other transformations and finally

Re: [R] Lining up x-y datasets based on values of x

2007-02-01 Thread Christos Hatzis
Marc, The data structure is a list of data frames generated from read.table: class(nmr.spectra.serum) [1] list class(nmr.spectra.serum[[1]]) [1] data.frame dim(nmr.spectra.serum[[1]]) [1] 32768 2 Converting the data.frames to matrices does not have much of an effect on timing.

[R] Regression trees with an ordinal response variable

2007-02-01 Thread Stacey Buckelew
Hi, I am working on a regression tree in Rpart that uses a continuous response variable that is ordered. I read a previous response by Pfr. Ripley to a inquiry regarding the ability of rpart to handle ordinal responses in 2003. At that time rpart was unable to implement an algorithm to handle

  1   2   >