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

[R] R vglm new family writing: mix Poisson/multinomial

2008-01-07 Thread Benoit J
Hi dear R users, 1) I would like to know if there is a simple way to define a vglm family which would be a mix of poisson variables and bernoulli variables (0/1 response) for idea this would be invoked like this: vglm(...,family=mixpoissonmultinom(npoisson,n01response)) where the n's give the

Re: [R] Plot error

2008-01-07 Thread Richard . Cotton
> Thank you so much for replying and sorry for asking so many times.. > My data is just like the example in plot.svm (package e1071) of Iris > data of library MASS, difference is I have 7 classes 13 variables > and 3 observations.. I've tried the codes as in that example but > still I got this

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 onl

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 (http://www.personal.psu.edu/cab38/

[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 happening

[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 t

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 yo

[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 https://stat.ethz.ch/mailm

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, th

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" >> >

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 believe

[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", he

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=, labels=, cex.axis=0.6, las=1); # left axis axis(1,at=, labels=, cex.axis=0.6, las=1); # bottom axis cex.axis...relativefont size las...text orientation se

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

2008-01-07 Thread John Field
tom soyer 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 seems

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 help.se

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

2008-01-07 Thread Prof Brian Ripley
On Mon, 7 Jan 2008, Jan Wijffels wrote: > 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 pa

[R] Just Beginning

2008-01-07 Thread hoogeebear
Hi, Im new to "R", I am currently doing a proect for college, in which questions are answered and the results are sent to a mySql database. Essentially I want R to read from this database and generate graphs e.t.c. Dies anyone know of a good website where I can learn the different commands needed

[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 . There's also a section on databases in the R Data Import/Export manual, which comes with R. BTW, I don't generally t

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, Rich

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') Fortra

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 f

Re: [R] error message in having subset

2008-01-07 Thread John Kane
perhaps ?subset subset(hs, hs$hey60==0) --- temiz <[EMAIL PROTECTED]> wrote: > 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 > > > rega

[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: http://treetron.googlepages.com

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 dist

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 > > > > > > > > _ >

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 l

Re: [R] testing fixed effects in lmer

2008-01-07 Thread Ben Bolker
Achaz von Hardenberg 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 distanc

[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 plot(

[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. __ R-help@r-project.org

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 lin

[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/ ht

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 > Dat

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 Ad

[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. Is

[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] how to get residuals in factanal

2008-01-07 Thread Yijun Zhao
1. ?factanal says: == The factor analysis model is x = Lambda f + e ... but the major restriction is that the scores be uncorrelated and of unit variance, and that the errors be independent with variances Phi, the uniquenesses. ===

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 h

[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 distributi

[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 sta

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 Sen

[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 https://sta

[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.8750

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

2008-01-07 Thread Talbot Katz
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, max(v1) is 4, max(v2) is 6

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 make

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...

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 anti-deri

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

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 t

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] help on log-gamma regresion model with R

2008-01-07 Thread Dieter Menne
putro nugroho yahoo.com> writes: > > 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 suggest that you generate a small, self-co

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 PR

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

2008-01-07 Thread Talbot Katz
Hi Marc. Thank you for the swift response! I should have explained more about the partitions, I hoped it would be clear from the code. I am supplying an index vector to create the partitions. In my original example of v = c(1,4,2,6,7,5) with v1 = v[1:3], v2 = v[4], v3 = v[5:6], I would spec

[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] Efficient way to substract all entries in two vectors from eachother

2008-01-07 Thread Bert Gunter
Vectors of what? How is "closest" defined? See e.g. ?dist Bert Gunter Genentch Nonclinical Statistics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Johannes Graumann Sent: Monday, January 07, 2008 11:19 AM To: [EMAIL PROTECTED] Subject: [R] Efficient

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 constrain

[R] evaluating a vector of characters

2008-01-07 Thread Gregory Gentlemen
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 list out of paste("Data$x", 1:3, sep=""). How can I get list to evaluate paste("Data$x", 1:3, sep="") as an R object rather than a

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 poly

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

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" defi

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 l

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

2008-01-07 Thread Henrique Dallazuanna
Ops: b[which.min(abs(a-b))] On 07/01/2008, Henrique Dallazuanna <[EMAIL PROTECTED]> wrote: > 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[

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] Efficient way to substract all entries in two vectors from each other

2008-01-07 Thread Talbot Katz
Hi Joh. To echo Bert, more detail would be helpful. But here is a stab at something. Given two numeric vectors, a and b, for each entry of a this finds the index in b of the closest match. It's not efficient at all. > bestmati <- function( a, b ) { return( sapply( a, function( x ) { which.m

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)'

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 situati

[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 it

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): >> >> p

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,

[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 elem

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 polynom

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]] . . .alnin

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

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 includi

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

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-5430ho

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

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 i

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

2008-01-07 Thread Bert Gunter
?table Bert Gunter Genentech Nonclinical Statistics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gang Chen Sent: Monday, January 07, 2008 11:38 AM To: Duncan Murdoch Cc: R-Help Subject: Re: [R] Create a new dataframe from an existing dataframe Yes,

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] reducing the number of x-axis lables in a bwplot while plotting all boxes

2008-01-07 Thread Jeff D. Hamann
I apologize if this is somewhere in the archives, but I can't seem to find a solution to this question. I've been trying to plot a bwplot: print( bwplot( n.pareto ~ as.factor(gen) | mut.rate * n.pop, data=p6, horizontal=FALSE, box.ratio=0.75,

[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 h

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

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 http://www.R-project.org/posting-guid

  1   2   >