Re: [R] Rank sum in friedman test

2008-01-07 Thread Jim Lemon
[EMAIL PROTECTED] wrote: Dear all, I'm using friedman rank test in R. Need to know how to calculate rank sum in friedman test (R options to get rank sum in friedman test). Kindly help me. Hi jeevitesh, The sums of ranks in the Friedman test are simply the column sums of the

Re: [R] numerical data frame

2008-01-07 Thread Richard . Cotton
I've successfully import my synteny data to R by using scan command. Below show my results. My major problem with my data is how am i going to combine the column names with the data( splt) where i have tried on cbind but a warning message occur. I have realized that the splt data only

Re: [R] rainbow function

2008-01-07 Thread Richard . Cotton
I'm using rainbow function to generate 10 colors for the plot and it is difficult to tell the neighboring colors from each other. How can I make the colors more differently. Using 10 colours is always going to be difficult, but take a look at ColorBrewer

[R] glibc detected *** /usr/lib64/R/bin/exec/R: double free or corruption ???? tm package

2008-01-07 Thread Jan Wijffels
Hi, I have a collection of .txt documents in my working folder for which I want to do some text mining. If I run TextDocCol from the tm package, R crashes with some memory issues. Does anyone has any idea if this is related to R itself or to the tm package? Below you can find what is

[R] help.search and indexing

2008-01-07 Thread Dong-hyun Oh
Dear expeRt, I occasionally use help.search() function to find appropriate functions in R. Whenever committing help.search() after rerunning R, it takes so much time to find help (around 2 minutes). Is there any way to make it faster in help.search()? I think indexing help database is one of

Re: [R] rainbow function

2008-01-07 Thread Barry Rowlingson
Wang, Zhaoming (NIH/NCI) [C] wrote: Hello I'm using rainbow function to generate 10 colors for the plot and it is difficult to tell the neighboring colors from each other. How can I make the colors more differently. If all you want is for neighbouring colours to be distinguishable you

[R] plotting categoric vs. categoric

2008-01-07 Thread temiz
hello which graph can I use for categoric var. vs categoric var. ? regards -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. __ R-help@r-project.org mailing list

Re: [R] rainbow function

2008-01-07 Thread Achim Zeileis
On Mon, 7 Jan 2008, Barry Rowlingson wrote: rainbow() is great - for drawing rainbows - but the palettes from the RColorBrewer package are much better for statistical plots as someone else suggested. When I write code for plots I try and use RColorBrewer if it's there: ...additionally, there

Re: [R] how to use R for Beta Negative Binomial

2008-01-07 Thread Duncan Murdoch
Nasser Abbasi wrote: Duncan Murdoch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Why did you change the parameters? If you used the same ones as above, you get sghyper(a=-1, k=-1, N=5) $title [1] Generalized Hypergeometric $Mean [1] 0.2

Re: [R] FW: cgh package

2008-01-07 Thread Tom Price
Dear Celine, Please excuse the delay in responding over the holiday period. Here are my answer to your questions. If you are having further difficulties or these answers don't seem right do let me know. (1) Yes, I recommend splitting your data by chromosome. If you perform a genomewide analysis,

[R] error message in having subset

2008-01-07 Thread temiz
hello I want to have subset of my dataset that is equal to 0. But, I got this error message. hs2=hs[hs$hey60==0 ,] Error in hs[hs$hey60 == 0, ] : (subscript) logical subscript too long regards -- This message has been scanned for viruses and dangerous content by MailScanner, and is

[R] Orientation of labels on axes

2008-01-07 Thread mika03
http://www.nabble.com/file/p14664173/at-modality.png I created the above image with R and I have one problem left: Some of the labels of the axes do not show up, probably because there's not enough space. I use the following code to create the plot: modality - read.table(results.table,

Re: [R] Orientation of labels on axes

2008-01-07 Thread Albert Greinoecker
Hi Michael, a solution would be not to draw axes directly, but afterwards with the axis-command: plot(length, col=color, axes=F) axis(2,at=your_positions, labels=your_labels, cex.axis=0.6, las=1); # left axis axis(1,at=your_positions, labels=your_labels, cex.axis=0.6, las=1); # bottom axis

Re: [R] Is there a R function for seasonal adjustment

2008-01-07 Thread John Field
tom soyer tom.soyer at gmail.com writes: Hi, I just discovered decompose() and stl(), both are very nice! I am wondering if R also has a function that calculates the seasonal index, or make the seasonal adjustment directly using the results generated from either decompose() or stl(). It

Re: [R] error message in having subset

2008-01-07 Thread jim holtman
Can you either provide a subset of data or at least do 'str(hs)' so that we know what the structure of you data looks like. It could be a matrix, dataframe, list, Each makes difference in how it is handled. On Jan 7, 2008 8:47 AM, temiz [EMAIL PROTECTED] wrote: hello I want to have

Re: [R] help.search and indexing

2008-01-07 Thread Prof Brian Ripley
On Mon, 7 Jan 2008, Dong-hyun Oh wrote: Dear expeRt, I occasionally use help.search() function to find appropriate functions in R. Whenever committing help.search() after rerunning R, it takes so much time to find help (around 2 minutes). Is there any way to make it faster in

[R] output into an unformatted direct fortran file

2008-01-07 Thread Costas Douvis
Hello everybody Is there a way to output data into a file like the unformatted, direct fortran files? That's the kind that can be opened with: open(30, file='file', format='unformatted', access='direct', rec=1000, convert='big endian') Thank you in advance Kostas Douvis

Re: [R] Just Beginning

2008-01-07 Thread John Fox
Dear John, The first issue of R News had a very nice article by Brian Ripley on accessing databases from R; you'll find it at http://cran.r-project.org/doc/Rnews/Rnews_2001-1.pdf. There's also a section on databases in the R Data Import/Export manual, which comes with R. BTW, I don't generally

Re: [R] Orientation of labels on axes

2008-01-07 Thread Richard . Cotton
http://www.nabble.com/file/p14664173/at-modality.png I created the above image with R and I have one problem left: Some of the labels of the axes do not show up, probably because there's not enough space. Try par(las=1) then draw the plot plot(length, col=colour) Regards, Richie.

Re: [R] Just Beginning

2008-01-07 Thread Prof Brian Ripley
R can talk to MySQL via the RMySQL and RODBC packages: which is easier will depend on your infrastructure, including your OS. You haven't even told us your OS. But the 'R Data Import/Export Manual' and 'An Introduction to R', both of which ship with R, are the manuals to start with, as well as

Re: [R] output into an unformatted direct fortran file

2008-01-07 Thread Prof Brian Ripley
On Mon, 7 Jan 2008, Costas Douvis wrote: Hello everybody Is there a way to output data into a file like the unformatted, direct fortran files? That's the kind that can be opened with: open(30, file='file', format='unformatted', access='direct', rec=1000, convert='big endian') Fortran file

Re: [R] output into an unformatted direct fortran file

2008-01-07 Thread Richard . Cotton
Is there a way to output data into a file like the unformatted, direct fortran files? That's the kind that can be opened with: It sounds like you want to use cat(), e.g. cat(x = , 1:10, file=test.txt) See also write for outputting matices to file; and write.table and write.csv for data

[R] Update xlsReadWritePro v1.3.2

2008-01-07 Thread Hans-Peter
xlsReadWritePro natively reads and writes Excelfiles (v97 - 2003) on Windows. I have uploaded a small bugfix update thereof. Fixes: • error with dimnames in 1-dimensional arrays • misleading error (assertion) messages with wrong from/to arguments. Download package:

Re: [R] plotting categoric vs. categoric

2008-01-07 Thread David Winsemius
temiz [EMAIL PROTECTED] wrote in news:478225E1.5010706 @deprem.gov.tr: hello which graph can I use for categoric var. vs categoric var. ? plot() works if there is a method for the class of object. Here is an example with contingency table given to plot() that appeared on the list last

[R] R and Clusters

2008-01-07 Thread Lorenzo Isella
Dear All, I hope I am not asking a FAQ. I am dealing with a problem of graph theory [connected components in a non-directed graph] and I do not want to rediscover the wheel. I saw a large number of R packages dealing for instance with the k-means method or hierarchical clustering for spatially

Re: [R] moving or running average

2008-01-07 Thread Jared O'Connell
See ?rollmean in the zoo package. On Jan 7, 2008 3:31 PM, Abu Naser [EMAIL PROTECTED] wrote: Hi all R users, Can anyone please let me know how to do the moving average with R? With regards, Abu _ Free games, great

Re: [R] R and Clusters

2008-01-07 Thread Gabor Csardi
Lorenzo, why can't you actually generate the graph to find the connection components? With the 'igraph' package this is something like: g - graph.adjacency( DIST 0.5, mode=undirected ) g - simplify(g) no.clusters(g) assuming you have your distance matrix in 'DIST'. If N is too big then you

Re: [R] Orientation of labels on axes

2008-01-07 Thread John Kane
Have a look at ?staxlab library(plotrix)or http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-create-rotated-axis-labels_003f --- mika03 [EMAIL PROTECTED] wrote: http://www.nabble.com/file/p14664173/at-modality.png I created the above image with R and I have one problem left:

Re: [R] testing fixed effects in lmer

2008-01-07 Thread Ben Bolker
Achaz von Hardenberg fauna at pngp.it writes: Dear all, I am performing a binomial glmm analysis using the lmer function in the lme4 package (last release, just downloaded). I am using the Laplace method. However, I am not sure about what I should do to test for the significance

Re: [R] R and Clusters

2008-01-07 Thread Christian Hennig
Dear Lorenzo, if I understand your posting correctly, this is exactly what Single Linkage clustering does if you cut the dendrogram tree at your threshold distance. Therefore you can use hclust with method=single (which produces the full dendrogram; you have to generate the Euclidean

[R] is there something like or() ?

2008-01-07 Thread Sebastian Leuzinger
hi, this may be trivial, but we can't seem to find anything adequate, (although there is a work around with match() ). We are looking for something along the lines of plot(table1[table1$var2==or(a,b,c,d),var1]) would be handy, with the potential or() function leading to what

[R] moving or running average

2008-01-07 Thread Abu Naser
Hi all R users, Can anyone please let me know how to do the moving average with R? With regards, Abu _ Free games, great prizes - get gaming at Gamesbox. __

Re: [R] is there something like or() ?

2008-01-07 Thread Henrique Dallazuanna
Try this: plot(table1[table1$var2 %in% c(a,b,c,d),var1]) On 07/01/2008, Sebastian Leuzinger [EMAIL PROTECTED] wrote: hi, this may be trivial, but we can't seem to find anything adequate, (although there is a work around with match() ). We are looking for something along the lines of

[R] Polynomial fitting

2008-01-07 Thread Jonas Malmros
I wonder how one in R can fit a 3rd degree polynomial to some data? Say the data is: y - c(15.51, 12.44, 31.5, 21.5, 17.89, 27.09, 15.02, 13.43, 18.18, 11.32) x - seq(3.75, 6, 0.25) And resulting degrees of polynomial are: 5.8007 -91.6339 472.1726 -774.2584 THanks in advance! -- Jonas

Re: [R] is there something like or() ?

2008-01-07 Thread Dimitris Rizopoulos
look at ?%in%; 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: http://med.kuleuven.be/biostat/

Re: [R] Help on odfWeave package

2008-01-07 Thread sylvie ahoussou
Thanks you for your answers. I finally managed to have odfweave functionning well by downloading Rtools available at http://www.murdoch-sutherland.com/Rtools/ and selecting the option that allows you to update the variable PATH; I re-start my computer and miracle !! it works Sylvie

Re: [R] Polynomial fitting

2008-01-07 Thread Dimitris Rizopoulos
try this: y - c(15.51, 12.44, 31.5, 21.5, 17.89, 27.09, 15.02, 13.43, 18.18, 11.32) x - seq(3.75, 6, 0.25) coef(lm(y ~ x + I(x^2) + I(x^3))) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven

[R] genetic algorithms in solving classification problems

2008-01-07 Thread Damian Krstajic
Hello, I am planning to implement Genetic Algorithms in solving classification problems. As far as I can see there is only genalg package that I can use. I can see that there are gafit and rgenoud packages that can be used for regression and optimisation problems but not for classification.

[R] moving or running average

2008-01-07 Thread Abu Naser
Hi Jerad, Thanks for your quick response. I have installed the zoo using R CMD INSTALL zoo_1.4-1.tar.gz but the R could not recognize rollmean- wondering why? With regards, Abu _ [[replacing trailing spam]]

Re: [R] moving or running average

2008-01-07 Thread Jared O'Connell
I'm assuming the package installed correctly (I've only ever installed packages from within R) Have you loaded the zoo package before calling rollmean? ie. library(zoo) On Jan 7, 2008 4:31 PM, Abu Naser [EMAIL PROTECTED] wrote: Hi Jerad, Thanks for your quick response. I have

[R] moving or running average

2008-01-07 Thread Abu Naser
Hi Jerad, Thanks for your quick response. I have installed the zoo using R CMD INSTALL zoo_1.4-1.tar.gz but the R could not recognize rollmean- wondering why? With regards, Abu _ Free games, great prizes - get gaming at

Re: [R] moving or running average

2008-01-07 Thread Uwe Ligges
Abu Naser wrote: Hi Jerad, Thanks for your quick response. I have installed the zoo using R CMD INSTALL zoo_1.4-1.tar.gz but the R could not recognize rollmean- wondering why? In R, don't forget to load zoo by library(zoo) Uwe Ligges With regards, Abu

[R] help on log-gamma regresion model with R

2008-01-07 Thread putro nugroho
Hii all, may I introduce myself. my name is Putro Nugroho i'am astudent of Gadjah Mada University, i'am doing on my final exam about Parametric Regression Model with gamma and log-gamma regression model. I have a problem about the syntax program on R because it doesn't work with gamma

[R] Great looking plot - but what does it mean?

2008-01-07 Thread mika03
http://www.nabble.com/file/p14668788/paragraphs.png Hi, R is is world full of wonders... I created the attached plot, and I think it's exactly what I need! Well, actually I think it is more that wht I need... I wanted R to show the mean values of the categories on the x-axis and maybe the

Re: [R] moving or running average

2008-01-07 Thread Bert Gunter
You may also wish to consider runmed(), which is a more robust running median, and is automatically available as part of the stats package. Bert Gunter Genentech Nonclinical Statistics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jared O'Connell

[R] moving or running average

2008-01-07 Thread Abu Naser
Aha... I forgot to load the library. Thanks everyone who responded my quaries. With regards, Abu _ Fancy some celeb spotting? __ R-help@r-project.org mailing list

[R] moving or running average

2008-01-07 Thread Abu Naser
Hi Jerad, Thanks for your quick response. I have installed the zoo using R CMD INSTALL zoo_1.4-1.tar.gz but the R could not recognize rollmean- wondering why? With regards, Abu _ Fancy some celeb spotting?

Re: [R] Polynomial fitting

2008-01-07 Thread Barry Rowlingson
Dimitris Rizopoulos wrote: try this: y - c(15.51, 12.44, 31.5, 21.5, 17.89, 27.09, 15.02, 13.43, 18.18, 11.32) x - seq(3.75, 6, 0.25) coef(lm(y ~ x + I(x^2) + I(x^3))) Or use the 'poly' function: coef(lm(x~poly(y,3))) (Intercept) poly(y, 3)1 poly(y, 3)2 poly(y, 3)3 4.875

Re: [R] R and Clusters

2008-01-07 Thread Lorenzo Isella
Thanks for both the replies. I am now giving a try to the suggestion by Gabor since it looks easier (for me) to implement. I am testing it, but so far it does what I have in mind. I am going now through the documentation of the igraph package. I can count the cluster number, but I also want to

Re: [R] Great looking plot - but what does it mean?

2008-01-07 Thread aaront
You might want to google box and whisker plot. mika03 wrote: http://www.nabble.com/file/p14668788/paragraphs.png Hi, R is is world full of wonders... I created the attached plot, and I think it's exactly what I need! Well, actually I think it is more that wht I need... I

Re: [R] Can R solve this optimization problem?

2008-01-07 Thread Ravi Varadhan
Hi Paul, Your problem statement does not make much sense to me. You say that an analytical solution can be found easily. I don't see how. This is a variational calculus type problem, where you maximize a functional. Your constraint dx/dt=u(t) means that there exists a solution (the

Re: [R] Great looking plot - but what does it mean?

2008-01-07 Thread Earl F. Glynn
mika03 [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] http://www.nabble.com/file/p14668788/paragraphs.png R is is world full of wonders... I created the attached plot, and I think it's exactly what I need! Well, actually I think it is more that wht I need... I wanted R to show

Re: [R] R and Clusters

2008-01-07 Thread Gabor Csardi
On Mon, Jan 07, 2008 at 05:25:44PM +0100, Lorenzo Isella wrote: Thanks for both the replies. I am now giving a try to the suggestion by Gabor since it looks easier (for me) to implement. I am testing it, but so far it does what I have in mind. I am going now through the documentation of the

Re: [R] Seeking a more efficient way to find partition maxima

2008-01-07 Thread Marc Schwartz
Talbot Katz wrote: Hi. Suppose I have a vector that I partition into disjoint, contiguous subvectors. For example, let v = c(1,4,2,6,7,5), partition it into three subvectors, v1 = v[1:3], v2 = v[4], v3 = v[5:6]. I want to find the maximum element of each subvector. In this example,

Re: [R] Can R solve this optimization problem?

2008-01-07 Thread Gabor Grothendieck
Just looking at this again what I meant was that unless you can linearize it you can't use linear programming. You still could use general nonlinear optimization subject to constraints. Define new variables z[i] = x[i] - x[i-1] Then x[i] = z[0] + ... + z[i] so maximize (we dropped the first and

Re: [R] rainbow function

2008-01-07 Thread Greg Snow
If your main goal is to find 10 colors that are easy to tell apart and look good in a graph, then look at the RColorBrewer package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL

[R] Efficient way to substract all entries in two vectors from each other

2008-01-07 Thread Johannes Graumann
Hi all, I'm to inexperienced to come up with the matrix solution elusively appearing on the horizon for the following problem and would appreciate if you could give me a nudge ... I have two vectors a, and b and need to find the closest match for each value of a in b. How to do that efficiently?

Re: [R] Can R solve this optimization problem?

2008-01-07 Thread Paul Smith
On Jan 7, 2008 4:32 PM, Ravi Varadhan [EMAIL PROTECTED] wrote: Your problem statement does not make much sense to me. You say that an analytical solution can be found easily. I don't see how. This is a variational calculus type problem, where you maximize a functional. Your constraint

Re: [R] Polynomial fitting

2008-01-07 Thread apjaworski
Jonas, In statistical sense polynomial is a linear regression fit. The function that handles linear fitting is called lm. Here is how you can reproduce your results: lm(y ~ x + I(x^2) + I(x^3)) Unless you are really after the polynomial coefficients it is probably better to use orthogonal

Re: [R] Efficient way to substract all entries in two vectors from eachother

2008-01-07 Thread Johannes Graumann
Vectors are numerics. I'd like to know for each a[i], which b[j] delivers the smallest abs(a[i]-b[j]). Thanks for your time. Joh Bert Gunter wrote: Vectors of what? How is closest defined? See e.g. ?dist Bert Gunter Genentch Nonclinical Statistics -Original Message- From:

Re: [R] Efficient way to substract all entries in two vectors from eachother

2008-01-07 Thread Henrique Dallazuanna
Try this: b[which.min(a-b)] On 07/01/2008, Johannes Graumann [EMAIL PROTECTED] wrote: Vectors are numerics. I'd like to know for each a[i], which b[j] delivers the smallest abs(a[i]-b[j]). Thanks for your time. Joh Bert Gunter wrote: Vectors of what? How is closest defined? See e.g.

Re: [R] evaluating a vector of characters

2008-01-07 Thread Henrique Dallazuanna
Try: sapply(paste(Data$x, 1:3, sep=), function(x)eval(parse(text=x))) On 07/01/2008, Gregory Gentlemen [EMAIL PROTECTED] wrote: Dear R users, I'd like to evaluate a vector of characters. For example, say I have a data frame called Data including the field names x1, x2, x3, and I'd like to a

Re: [R] Can R solve this optimization problem?

2008-01-07 Thread Gabor Grothendieck
I think what he meant is that x is a function of t so if dx/dt is regarded to be a function of t, which we shall call u(t), then u(t)'s absolute value at each value of t is less than or equal to 1 (as opposed to u(t) being known). On Jan 7, 2008 11:32 AM, Ravi Varadhan [EMAIL PROTECTED] wrote:

Re: [R] Can R solve this optimization problem?

2008-01-07 Thread Paul Smith
Yes, Gabor, that is the interpretation that I meant. Thanks for the clarification. Paul On Jan 7, 2008 5:59 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: I think what he meant is that x is a function of t so if dx/dt is regarded to be a function of t, which we shall call u(t), then u(t)'s

Re: [R] evaluating a vector of characters

2008-01-07 Thread Greg Snow
This is a fortune(106) situation (with a little fortune(77) in there as well). I am unsure what exactly the original poster is wanting to do, but accessing the columns of a data frame (or list) by character strings can be done using [[ ]] rather than $ and should be able to work for this

[R] Create a new dataframe from an existing dataframe

2008-01-07 Thread Gang Chen
I have a dataframe DF with 4 columns (variables) A, B, C, and D, and want to create a new dataframe DF2 by keeping B and C in DF but counting the frequency of D while collapsing A. I tried by(DF$D, list(DF$B, DF$C), FUN=summary) but this is not exactly what I want. What is a good way to do

Re: [R] glm for nominal X ordinal

2008-01-07 Thread Gang Chen
Thanks a lot! This is exactly what I wanted. Gang On Jan 5, 2008, at 2:20 PM, David Winsemius wrote: Gang Chen [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Suppose I have a two-way table of nominal category (party affiliation) X ordinal category (political ideology): party

Re: [R] Seeking a more efficient way to find partition maxima

2008-01-07 Thread Marc Schwartz
Talbot, Try this: PartMax - function(x, breaks) { breaks - c(breaks, length(x) + 1) sapply(seq(length(breaks) - 1), function(i) max(x[breaks[i]:(breaks[i + 1] - 1)], na.rm = TRUE)) } PartMax(c(1,4,2,6,7,5),c(1,4,5)) [1] 4 6 7 PartMax(6:1,c(1,4,5))

[R] Naming list objects

2008-01-07 Thread Wade Wall
Hi all, I am trying to name list objects, but am having trouble doing so. At the moment I have list alninc that has 3 objects and I can refer to them as alninc[[1]] . . .alninc[[3]]. I would like to refer to them as alninc$F, alninc$V and alninc$G. How do I do this? This appears to be an

Re: [R] Polynomial fitting

2008-01-07 Thread Prof Brian Ripley
On Mon, 7 Jan 2008, [EMAIL PROTECTED] wrote: Jonas, In statistical sense polynomial is a linear regression fit. The function that handles linear fitting is called lm. Here is how you can reproduce your results: lm(y ~ x + I(x^2) + I(x^3)) Unless you are really after the polynomial

Re: [R] Naming list objects

2008-01-07 Thread Gabor Csardi
names(alninc) - c(F,V,G) See ?names Gabor On Mon, Jan 07, 2008 at 01:35:59PM -0500, Wade Wall wrote: Hi all, I am trying to name list objects, but am having trouble doing so. At the moment I have list alninc that has 3 objects and I can refer to them as alninc[[1]] . . .alninc[[3]]. I

Re: [R] Seeking a more efficient way to find partition maxima

2008-01-07 Thread Gabor Grothendieck
Try testing the performance of transforming your series to one in which the values of each partition are larger than all prior partitions and the untransforming back: # test data myseq - c(1, 4, 2, 6, 7, 5) part - c(1, 4, 5) M - max(myseq) # transform myseq2 - myseq + M * cumsum(replace(0 *

Re: [R] Naming list objects

2008-01-07 Thread Daniel Nordlund
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wade Wall Sent: Monday, January 07, 2008 10:36 AM To: [EMAIL PROTECTED] Subject: [R] Naming list objects Hi all, I am trying to name list objects, but am having trouble doing so. At the moment I

Re: [R] evaluating a vector of characters

2008-01-07 Thread Marc Schwartz
Henrique Dallazuanna wrote: Try: sapply(paste(Data$x, 1:3, sep=), function(x)eval(parse(text=x))) On 07/01/2008, Gregory Gentlemen [EMAIL PROTECTED] wrote: Dear R users, I'd like to evaluate a vector of characters. For example, say I have a data frame called Data including the field

Re: [R] Create a new dataframe from an existing dataframe

2008-01-07 Thread Duncan Murdoch
On 1/7/2008 1:28 PM, Gang Chen wrote: I have a dataframe DF with 4 columns (variables) A, B, C, and D, and want to create a new dataframe DF2 by keeping B and C in DF but counting the frequency of D while collapsing A. I tried by(DF$D, list(DF$B, DF$C), FUN=summary) but this is not

Re: [R] Seeking a more efficient way to find partition maxima

2008-01-07 Thread Talbot Katz
Thanks Gabor! This is the sort of thing I was trying to devise, but I ran up against my extensively documented brain power limitations ;-) Per your remarks, it remains to be seen how it performs compared to a good implementation with one of the apply functions. -- TMK -- 212-460-5430

Re: [R] Efficient way to substract all entries in two vectors from each other

2008-01-07 Thread Ido M. Tamir
Johannes Graumann wrote: Hi all, I'm to inexperienced to come up with the matrix solution elusively appearing on the horizon for the following problem and would appreciate if you could give me a nudge ... I have two vectors a, and b and need to find the closest match for each value of a

Re: [R] Create a new dataframe from an existing dataframe

2008-01-07 Thread Gang Chen
Yes, I misstated it when I said that I would keep B and C. I want to collapse column A, but count the frequency of D as a new column in the new dataframe DF2 while collapsing A. The rows of columns B, C, and D of course would be reduced because of A collapsing. For example, if dataframe DF

Re: [R] Create a new dataframe from an existing dataframe

2008-01-07 Thread Gang Chen
Sorry the new column in DF2 should be called FreqD instead of FreqA. How can I get DF2 with aggregate? Gang On Jan 7, 2008, at 2:38 PM, Gang Chen wrote: Yes, I misstated it when I said that I would keep B and C. I want to collapse column A, but count the frequency of D as a new column in

[R] side by side plots

2008-01-07 Thread hpbenton
Hello everyone, I have an overlay plot it's nice but you can't see all the data. I would like to know if there is a way to get a plot that gives a side by side plot so that each plot would be next to each other. The two plots have the same data are of different species. At the moment this is the

Re: [R] I need arguments pro-S-PLUS and against SAS...

2008-01-07 Thread Jeffrey J. Hallman
SAS programming is easy if everything you want to do fits easily into the row-at-a-time DATA step paradigm. If it doesn't, you have to write macros, which are an abomination. DATA step statements and macros are entirely different programming languages, with one doing evaluations at compile time,

Re: [R] side by side plots

2008-01-07 Thread Sundar Dorai-Raj
[EMAIL PROTECTED] said the following on 1/7/2008 2:59 PM: Hello everyone, I have an overlay plot it's nice but you can't see all the data. I would like to know if there is a way to get a plot that gives a side by side plot so that each plot would be next to each other. The two plots have

Re: [R] side by side plots

2008-01-07 Thread Dylan Beaudette
On Monday 07 January 2008, [EMAIL PROTECTED] wrote: Hello everyone, I have an overlay plot it's nice but you can't see all the data. I would like to know if there is a way to get a plot that gives a side by side plot so that each plot would be next to each other. The two plots have the same

Re: [R] side by side plots

2008-01-07 Thread Domenico Vistocco
[EMAIL PROTECTED] wrote: Hello everyone, I have an overlay plot it's nice but you can't see all the data. I would like to know if there is a way to get a plot that gives a side by side plot so that each plot would be next to each other. The two plots have the same data are of different

Re: [R] Efficient way to substract all entries in two vectors from each other

2008-01-07 Thread Johannes Graumann
Ido M. Tamir wrote: matchpt Thanks for this hint. It is exactly what I'm looking for. Cheers, Joh __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] two graphs

2008-01-07 Thread Georg Ehret
Dear R community, I am plotting a histogram and would wish to display another variable of the same dataset in a very narrow heatmap just below the x-axis. Never mind the specifics of my task: How can I draw a second graph/image just below a first graph/image? Thank you! Georg. ***

Re: [R] two graphs

2008-01-07 Thread Benilton Carvalho
?layout check: example(layout) to see its features. b On Jan 7, 2008, at 5:06 PM, Georg Ehret wrote: Dear R community, I am plotting a histogram and would wish to display another variable of the same dataset in a very narrow heatmap just below the x-axis. Never mind the specifics of

Re: [R] two graphs

2008-01-07 Thread Weidong Gu
Try use args. 'position' and 'more' h1-hist() h2-hist() print(h1,position=c(0,0,1,1),more=T) print(h2,position=c(,,,) Weidong Gu, University of Alabama, Birmingham -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Georg Ehret Sent: Monday, January 07,

Re: [R] Great looking plot - but what does it mean?

2008-01-07 Thread Julian Burgos
Hi Mika03, It would be useful to know what function you used to create your plot. Assuming you used boxplot, do this: ?boxplot ?boxplot.stats Julian mika03 wrote: http://www.nabble.com/file/p14668788/paragraphs.png Hi, R is is world full of wonders... I created the attached plot,

Re: [R] I need arguments pro-S-PLUS and against SAS...

2008-01-07 Thread John Sorkin
I fear I risk being viewed as something of a curmudgeon, but the truth must be stated. S-Plus, R, SAS, etc. are all similar in that they are all tools to an end and not an end in themselves. Any one of the three can do most statistical analyses one might want to do. I could point out the

Re: [R] I need arguments pro-S-PLUS and against SAS...

2008-01-07 Thread Frank E Harrell Jr
John Sorkin wrote: I fear I risk being viewed as something of a curmudgeon, but the truth must be stated. S-Plus, R, SAS, etc. are all similar in that they are all tools to an end and not an end in themselves. Any one of the three can do most statistical analyses one might want to do. I

Re: [R] two graphs

2008-01-07 Thread John Kane
?par and have a look at mfrow par() controls a vast amount of plotting options for regular graphics Example aa - rnorm(100, 25, 4) bb - aa/2 par(mfrow=c(2,1)) hist(aa) plot(bb) --- Georg Ehret [EMAIL PROTECTED] wrote: Dear R community, I am plotting a histogram and would wish to

Re: [R] side by side plots

2008-01-07 Thread John Kane
?par and have a look at mfcol or mfrow. Example exp-cbind(abs(round(rnorm(10),2)*10), seq(100, 200, by=10)) ref-cbind(abs(round(rnorm(10),2)*10), seq(100, 200, by=10)) op - par(mfrow=c(1,2)) plot(ref, col=red) plot(exp, col=blue) par(op) --- [EMAIL PROTECTED] wrote: Hello everyone, I have

[R] How should I improve the following R code?

2008-01-07 Thread Seung Jun
I'm looking for a way to improve code that's proven to be inefficient. Suppose that a data source generates the following table every minute: Index Count 0 234 1 120 7 11 30 1 I save the tables in the following CSV format: time,index,count

Re: [R] Naming list objects

2008-01-07 Thread John Kane
names(alninc) - c(F, V, G) --- Wade Wall [EMAIL PROTECTED] wrote: Hi all, I am trying to name list objects, but am having trouble doing so. At the moment I have list alninc that has 3 objects and I can refer to them as alninc[[1]] . . .alninc[[3]]. I would like to refer to them as

Re: [R] Seeking a more efficient way to find partition maxima

2008-01-07 Thread jim holtman
Does this do what you want? x - c(1,4,2,6,7,5) x.i - c(1,4,5) partiMax - function(vec, index){ + # create a vector to identify the subvectors + x.b - diff(c(index, length(vec) + 1)) + # split up the vector + x.s - split(vec, rep(seq_along(index), times=x.b)) +

Re: [R] I need arguments pro-S-PLUS and against SAS...

2008-01-07 Thread John Sorkin
Frank, I believe you are proving my point. The difference is not so much the language as the end users. I use SAS, R, and SPlus on a regular basis. For some analyses, SAS is easiest to use, for some R (or SPlus). I can be just as dangerous using SAS and I can be with R if I don't think about

[R] A question on chisq.test

2008-01-07 Thread Rong Jian
Dear all, I would like to do a goodness-of-fit test on my data to see if they follow a mixture of 2 poisson distributions. I have small numbers for observed values. Most of them 5. The chisq.test gives warning message: Chi-squared approximation may be incorrect in: chisq.test(x , p = prob).

[R] Error with rbind and zoo

2008-01-07 Thread Kondamani, Arjun (GMI - NY Corporate Bonds)
Hi all: I have a directory of files as in - bunchafiles - list.files(path=/data/2.3/2006, pattern=returns, full.names=T,recursive=T) Each file is a bunch of returns for a particular date (unique). There are like 252 files or so. With a custom function myread (below), I define a

Re: [R] How should I improve the following R code?

2008-01-07 Thread jim holtman
One thing to do is to use Rprof() on your script so that you can determine where time is being spent. My guess it that most of the time is in the wtd.quantile function. If your Counts don't get too big, another way is to use 'quantile' directly: Index - c(0,1,7,30) Count - c(234,120,11,1)

  1   2   >