[R] Polynomial Goal Programming

2008-06-10 Thread Shubha Vishwanath Karanth
Hello R, Is there a package to perform Polynomial goal programming in R? BR, Shubha Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com This e-mail may contain confidential a

Re: [R] How to join data.frames and vectors of different length, in an inteligent way?

2008-06-10 Thread Hvidberg, Martin
Thanks Chuck With your help I managed to write the code as I wanted it. The result looks like this: dafSamp <- data.frame(cbind(c(1972,1984,1969,1976,1999,1996,1976,1984,1976),c(117,7 3,92,113,80,78,98,106,99))) dafSamp$Ay <- ave(dafSamp$X2, dafSamp$X1, FUN=mean) dafSamp$AA <- dafSamp$X2 * (mean(

[R] computing and showing mean

2008-06-10 Thread Paul Adams
Hello to everyone, I am trying to compute a mean and show it to the screen and then save to later be used as a boxplot.I have used the following code: dat<-read.table(file="C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt",header=T,row.names=1) file.show(file="C:\\Documents and S

Re: [R] documentation of wts object returned by nnet() function

2008-06-10 Thread Prof Brian Ripley
See the summary() method. It labels the weights for you. On Tue, 10 Jun 2008, wmg wrote: In MASS there is a nnet() function which returns, among other things, a wts[] vector giving the weights in the neural network. However, in neither the book nor in the online documentation for the routine

Re: [R] the title is too long for a graph

2008-06-10 Thread Prof Brian Ripley
On Tue, 10 Jun 2008, Barry Rowlingson wrote: Hua Li wrote: Hi All, I have a problem of putting long titles on a graph: for example, x= seq(1:100) y=seq(1:100) plot(x,y,main="p=0.05:A-B=3,C-D=10,D-E=100,A-F=2,AFR-E=3,ACE-D=1,ADEF-M=0,AED-E=10,DE-F=3,AB-J=4,AC-J=10,ED-F=1,ED-B=4,AF-B=10,CD-S=1

Re: [R] Bayesian Analysis using the BUGS Language

2008-06-10 Thread Tobias Verbeke
DrakeGis wrote: WinBugs doesn't run in LINUX. Neither OpenBugs. There is a long thread ending on http://tolstoy.newcastle.edu.au/R/e2/devel/07/08/4121.html which documents how many people helped me get OpenBUGS running under Linux (embedded in an R package, of course). HTH, Tobias Drake

[R] Problem when combining dotplot() and textplot() using grid

2008-06-10 Thread Bernhard
Hi everyone. I want to solve the following problem. I have a data.frame and I create a dotplot using lattice. Then I want to use the grid-package to create a combined graphic which contains the dotplot as well as a textplot() (using package gplots) of the data.frame next to the dotplot. Example

[R] MCA in R

2008-06-10 Thread K. Elo
Hi! Is there any possibilities to do multiple classification analysis (MCA) in R? (MCA examines the relationships between several categorical independent variables and a single dependent variable, and determines the effects of each predictor before and after adjus­tment for its inter-correlat

[R] difference between nlm and nlminb

2008-06-10 Thread ae2356
Hi, I was wondering if someone could give a brief, big picture overview of the difference between the two optimization functions nlm and nlminb. I'm not familiar with PORT routines, so I was hoping someone could give an explanation. Thanks, Angelo __

[R] model simplification using Crawley as a guide

2008-06-10 Thread ChCh
Hello, I have consciously avoided using step() for model simplification in favour of manually updating the model by removing non-significant terms one at a time. I'm using The R Book by M.J. Crawley as a guide. It comes as no surprise that my analysis does proceed as smoothly as does Crawley's a

[R] ARMA random effects?

2008-06-10 Thread Spencer Graves
Hi, All: Is there a way to get random effects for ARMA parameters? Consider the following example from the 'corARMA' help page: fm1Ovar.lme <- lme(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), data = Ovary, random = pdDiag(~sin(2*pi*Time))) fm5Ovar.lme <- update(fm

Re: [R] Cluster analysis using numeric and factor variables

2008-06-10 Thread Moshe Olshansky
If you can define a distance between two vectors (where each one has some numerical and some categorical coordinates) then you can proceed with any clustering algorithm. One possibility to get such a distance is to use RandomForest which can produce a proximity matrix which can be turned into d

Re: [R] Cluster analysis using numeric and factor variables [SEC=UNCLASSIFIED]

2008-06-10 Thread Jin.Li
Try hclust with daisy in cluster package. Cheers, Jin Jin Li, PhD Spatial Modeller/ Computational Statistician Marine & Coastal Environment Geoscience Australia Ph: 61 (02) 6249 9899 Fax: 61 (02) 6249 9956 email: [EMAIL PROTECTED] ---

[R] Cluster analysis using numeric and factor variables

2008-06-10 Thread Nagu
Hi, Are there any algorithms that handle numeric and factor variables together in a cluster analysis? Thank you, Nagu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-projec

Re: [R] trouble installing Rmpi on 64-bit Ubuntu 8.04 with openmpi

2008-06-10 Thread Mark Kimpel
Thanks to all for the advice. Took me a bit to get back to this, but the following worked just fine for me with my 64-bit Ubuntu 8.04 OS: R CMD INSTALL Rmpi_0.5-5.tar.gz --configure-args=--with-mpi=/usr/lib64/openmpi On Thu, Jun 5, 2008 at 3:23 AM, Paul Hewson <[EMAIL PROTECTED]> wrote: > Or (mor

Re: [R] Bug/Error in formatC? (Was: Why doesn 't formatC( x, digits=2, format= " g")...)

2008-06-10 Thread Peter Dunn
Martin I know you and Brian have been discussing this issue, and Brian would officially declare it a 'buglet' if he used that word, but for completeness (I should have done this anyway; my oversight): > What are the exact platform details? > sessionInfo() R version 2.7.0 (2008-04-22) i486-pc-l

[R] Sweave, ggplot2 and two-page figures

2008-06-10 Thread Aric Gregson
I am using Sweave to generate a document in which ggplot2 figures are embedded. I am using the following code in a particular plot within a subfloat environment: <>= print(qplot(bosday2, Arday2, data= arbostimearonlyNArm, colour=factor(bos2), shape=factor(bos2), size=factor(cumARscore), position="

Re: [R] newbie nls question

2008-06-10 Thread Michael Manning
Hi On 11/06/2008 at 10:56 a.m., "Ranney, Steven" <[EMAIL PROTECTED]> wrote: > I'm tyring to fit a relatively simple nls model to some data, but keep coming > up against the same error (code follows): > > Oto=nls(Otolith ~ Linf*(1-exp(-k(AGE-to))), > data = ages, > start = list(Linf=100

Re: [R] newbie nls question

2008-06-10 Thread Simon Blomberg
On Tue, 2008-06-10 at 16:56 -0600, Ranney, Steven wrote: > I'm tyring to fit a relatively simple nls model to some data, but keep coming > up against the same error (code follows): > > Oto=nls(Otolith ~ Linf*(1-exp(-k(AGE-to))), > data = ages, > start = list(Linf=1000, k=0.1, to=0.1),

[R] newbie nls question

2008-06-10 Thread Ranney, Steven
I'm tyring to fit a relatively simple nls model to some data, but keep coming up against the same error (code follows): Oto=nls(Otolith ~ Linf*(1-exp(-k(AGE-to))), data = ages, start = list(Linf=1000, k=0.1, to=0.1), trace = TRUE) The error message I keep getting is "Error in eva

[R] Sweave, ggplot2 and two-page figures

2008-06-10 Thread Aric Gregson
I am using Sweave to generate a document in which ggplot2 figures are embedded. I am using the following code in a particular plot within a subfloat environment: <>= print(qplot(bosday2, Arday2, data= arbostimearonlyNArm, colour=factor(bos2), shape=factor(bos2), size=factor(cumARscore), position="

Re: [R] plotMeans() is there a ylim argument? Please Help.

2008-06-10 Thread Gabor Grothendieck
Try plotmeans in the gplots package. On Tue, Jun 10, 2008 at 5:14 PM, stephen sefick <[EMAIL PROTECTED]> wrote: > I can not seem to get a ylim argument into plotMeans() is there anyway to do > this. > thanks in advance > > Stephen > > -- > Let's not spend our time and resources thinking about thin

Re: [R] Frame from long to wide format

2008-06-10 Thread hadley wickham
The reshape package will definitely do what you want. Cast will automatically fill in an missing spots with NAs, and you'll just need something like the following for your aggregation function: last <- function(x) x[length(x)] You can find out more about reshape at http://had.co.nz/reshape Hadl

Re: [R] Frame from long to wide format

2008-06-10 Thread Greg Snow
The reshape function and even more powerful reshape package will probably do what you want. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Be

[R] plotMeans() is there a ylim argument? Please Help.

2008-06-10 Thread stephen sefick
I can not seem to get a ylim argument into plotMeans() is there anyway to do this. thanks in advance Stephen -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and

Re: [R] Bayesian Analysis using the BUGS Language

2008-06-10 Thread DrakeGis
WinBugs doesn't run in LINUX. Neither OpenBugs. > > DrakeGis wrote: >> Hi all, >> I observed that the 'link' between R and BUGS (winBugs/linBugs) has >> totally disappeared. I'm wondering what package can be use to run >> bayesian models specified using the BUGS language in R (specifically >> und

[R] Frame from long to wide format

2008-06-10 Thread Tom Backer Johnsen
I have this frame in the long format which I want to convert to wide format. There are three columns in the frame, the id for the rows in the wide format, the name of the column where the final value (the third column) is to be placed. The complicating factor is that the long format is not co

Re: [R] convert characters into integers in a matrix

2008-06-10 Thread Manisha Brahmachary
Thanks, This works fine. -Original Message- From: Erik Iverson [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2008 4:19 PM To: Manisha Brahmachary Cc: r-help@r-project.org Subject: Re: [R] convert characters into integers in a matrix Manisha - Will this work instead? if 'a' is your

Re: [R] Really simple question

2008-06-10 Thread Søren Højsgaard
?setdiff Fra: [EMAIL PROTECTED] på vegne af [EMAIL PROTECTED] Sendt: ti 10-06-2008 22:32 Til: r-help@r-project.org Emne: [R] Really simple question Hi, I don't have too much programming experience - sorry in advance if this question is very basic, and thanks f

[R] Really simple question

2008-06-10 Thread naw3
Hi, I don't have too much programming experience - sorry in advance if this question is very basic, and thanks for the help. I have a vector of numbers and another vector of a subset of those numbers. How can I create a third vector with all the numbers in the original list that aren't in the giv

Re: [R] samr result

2008-06-10 Thread Richardson, Patrick
Could you post your code so we can see what you are trying to do? Thanks, Patrick From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Eleni Christodoulou [EMAIL PROTECTED] Sent: Tuesday, June 10, 2008 11:20 AM To: r-help@r-project.org Subject: [R] sam

Re: [R] convert characters into integers in a matrix

2008-06-10 Thread Henrique Dallazuanna
Try this: x <- matrix(c("A", "P", "M", "A", "P", "M"), 2) x[] <- as.numeric(as.character(factor(x, labels = c(0,1,1 x On 6/10/08, Manisha Brahmachary <[EMAIL PROTECTED]> wrote: > > Hello, > > > > I will appreciate any suggestion for this simple problem. I have a matrix > of > characters "A"

Re: [R] fitting periodic 'sine wave' model

2008-06-10 Thread Søren Højsgaard
If you make the x-values more dense, e.g. with x<-seq(0,20,0.1) then your example works. Plotting your data might give a hint to why your example fails Btw: It is generally not a good idea to use F for a parameter because F usually means FALSE. Regards Søren ___

Re: [R] convert characters into integers in a matrix

2008-06-10 Thread Erik Iverson
Manisha - Will this work instead? if 'a' is your matrix, try ifelse(a == "A", 0, 1) Best, Erik Iverson Manisha Brahmachary wrote: Hello, I will appreciate any suggestion for this simple problem. I have a matrix of characters "A", "P", "M". I want to convert those characters to inte

[R] convert characters into integers in a matrix

2008-06-10 Thread Manisha Brahmachary
Hello, I will appreciate any suggestion for this simple problem. I have a matrix of characters "A", "P", "M". I want to convert those characters to integers 0,1, 1 respectively. I am using the following R statements: exprs.new<-gsub("P",1,exprs) exprs.new1 <- gsub("A",0,exprs.new) e

Re: [R] Comparing two groups of proportions

2008-06-10 Thread Rolf Turner
On 10/06/2008, at 6:08 PM, Ivan Adzhubey wrote: Hi Rolf, On Monday 09 June 2008 11:16:57 pm Rolf Turner wrote: Your approach tacitly assumes --- as did the poster's question --- that the probability of passing an item by one method is *independent* of whether it is passed by the other metho

Re: [R] Bayesina Analysis using the BUGS Language

2008-06-10 Thread Uwe Ligges
DrakeGis wrote: Hi all, I observed that the 'link' between R and BUGS (winBugs/linBugs) has totally disappeared. I'm wondering what package can be use to run bayesian models specified using the BUGS language in R (specifically under Linux). Is there any other option besides JAGS ? Thanks T

[R] Bayesina Analysis using the BUGS Language

2008-06-10 Thread DrakeGis
Hi all, I observed that the 'link' between R and BUGS (winBugs/linBugs) has totally disappeared. I'm wondering what package can be use to run bayesian models specified using the BUGS language in R (specifically under Linux). Is there any other option besides JAGS ? Thanks

[R] Bayesian Analysis using the BUGS Language

2008-06-10 Thread DrakeGis
Hi all, I observed that the 'link' between R and BUGS (winBugs/linBugs) has totally disappeared. I'm wondering what package can be use to run bayesian models specified using the BUGS language in R (specifically under Linux). Is there any other option besides JAGS ? Thanks

Re: [R] substitute() reading data instead of name

2008-06-10 Thread Carl Witthoft
Just wanted to say thanks to all suggestions. My code works fine now *_0 Carl __ 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-guide.html and provide com

[R] Two-sided Tobit with random intercepts

2008-06-10 Thread Anthony A. Pezzola
Could someone please indicate if there is a package capable of computing a hierarchical two-sided tobit model. Thanks in advance. --- Anthony A. Pezzola [EMAIL PROTECTED] (02) 354-7823 Profesor de Ciencia Política Instituto de Ciencia Política Universi

Re: [R] par(mfrow=c(4,2)) vs. lattice

2008-06-10 Thread Gabor Grothendieck
mfrow is for classic graphics and when the graphs are unrelated. lattice is for grid graphics and typically when the panels are related such as being the same plot but conditioned on different factor levels. These are typical uses only as one can write arbitary panels with lattice and produce rel

Re: [R] par(mfrow=c(4,2)) vs. lattice

2008-06-10 Thread Bert Gunter
FWIW: I use lattice exclusively. One difference from the mfrow approach is that lattice automatically provides (if desired) the same scaling on all plots, necessary to make visual comparisons. It also provides an easy way to appropriately label and and arrange the plots, as well as to provide stan

Re: [R] the title is too long for a graph

2008-06-10 Thread Gabor Grothendieck
Instead of placing this information in the title we could consider placing it in a legend. s <- "a=1,b=2,c=3" plot(1:10) legend("topleft", legend = strsplit(s, ",")[[1]], ncol = 1, cex = 0.5, bty = "n") On Tue, Jun 10, 2008 at 12:07 PM, Hua Li <[EMAIL PROTECTED]> wrote: > Hi All, > > I have a pr

Re: [R] Crosscorr.plot

2008-06-10 Thread Doran, Harold
Dieter crosscorr.plot is in the coda package, which I should have noted. The function wasn't producing a chart. It was only returning NULL. But, when I updated packages, it is now. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Dieter Menne > Sent

Re: [R] Crosscorr.plot

2008-06-10 Thread Dieter Menne
Doran, Harold air.org> writes: > > Just out of curiosity, why might this be occuring: > > > class(x6) > [1] "mcmc" > > crosscorr.plot(x6) > NULL > > # Replicable code > > example(lmer) > x6 <- mcmcsamp(fm1, n=1000) > crosscorr.plot(x6) > I cannot reproduce this with the Current Sourceforge

[R] par(mfrow=c(4,2)) vs. lattice

2008-06-10 Thread stephen sefick
I have had good sucess with the par(mfrow=c(#,#)) for formating graphs and they look good to me. I have seen a lot of use of the lattice package and thought I would go fishing on the list for y'all's comments. Is there a time when lattice would be easier more appropriate for certain graphics over

Re: [R] the title is too long for a graph

2008-06-10 Thread Greg Snow
Here is one approach: > tmp <- > "p=0.05:A-B=3,C-D=10,D-E=100,A-F=2,AFR-E=3,ACE-D=1,ADEF-M=0,AED-E=10,DE-F=3,AB-J=4,AC-J=10,ED-F=1,ED-B=4,AF-B=10,CD-S=10,AM-C=4" > tmp2 <- gsub(',',', ',tmp) > tmp3 <- strwrap(tmp2, 30) > par(mar=c(5,4,10,1)+.1) > plot(1:10, main=paste(tmp3, collapse="\n")) Hope

Re: [R] Plotting multiple continuous lines with symbols

2008-06-10 Thread Greg Snow
In your plot and lines function call you specify type="b" which says to use "b"oth lines and points with gaps in the lines around the points. If you change that to type="o" then it will "o"verplot the points and lines (no gaps). The different types are documented in ?plot.default. Hope this he

Re: [R] Plotting multiple continuous lines with symbols

2008-06-10 Thread Jorge Ivan Velez
Dear Tariq, A good starting point would be ?matplot. Also, you can try this: set.seed(123) X=cbind(1:10,matrix(rnorm(10*5),ncol=5)) matplot(X[,1],X[,2:5],type='o',lty=1,col=1,pch=1:5,xlab="Variable X",ylab="Outcome") and the add your any text you want around. HTH, Jorge On Tue, Jun 10, 200

Re: [R] the title is too long for a graph

2008-06-10 Thread Barry Rowlingson
Hua Li wrote: Hi All, I have a problem of putting long titles on a graph: for example, x= seq(1:100) y=seq(1:100) plot(x,y,main="p=0.05:A-B=3,C-D=10,D-E=100,A-F=2,AFR-E=3,ACE-D=1,ADEF-M=0,AED-E=10,DE-F=3,AB-J=4,AC-J=10,ED-F=1,ED-B=4,AF-B=10,CD-S=10,AM-C=4") R seems not able to print the whole

Re: [R] Fast method to compute average values of duplicated IDs

2008-06-10 Thread Jorge Ivan Velez
Dear Daren, Try this: tapply(t[,"value"],t[,"id"],mean) HTH, Jorge On Tue, Jun 10, 2008 at 11:37 AM, Daren Tan <[EMAIL PROTECTED]> wrote: > > Hi, > > How do I collapse (average in the simplest case) the values of those > duplicated ids (i.e., 2, 5, 6, 9) to give a table of unique ids ? > >

Re: [R] Plotting multiple continuous lines with symbols

2008-06-10 Thread stephen sefick
does lty not work? please read the posting guide. On Tue, Jun 10, 2008 at 12:13 PM, Tariq Perwez <[EMAIL PROTECTED]> wrote: > Hi, > I am trying to plot multiple lines on one plot such that all lines are of > the same color (black) and continuous. I need to distinguish these multiple > plots from

Re: [R] Concat Multiple Plots into one PNG figure

2008-06-10 Thread Greg Snow
Look at ?print.trellis in the lattice package (specifically the split and more argumnets). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Beh

Re: [R] Fast method to compute average values of duplicated IDs

2008-06-10 Thread Greg Snow
?tapply ?aggregate -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Daren Tan > Sent: Tuesday, June 10, 2008 9:37 AM > To: r-help@r-pr

Re: [R] the title is too long for a graph

2008-06-10 Thread stephen sefick
#try this cex.main=1.1 This is a par parameter ?par plot(x,y,main="p=0.05:A-B=3,C-D=10,D-E=100,A-F=2,AFR-E=3,ACE-D=1,ADEF-M=0,AED-E=10,DE-F=3,AB-J=4,AC-J=10,ED-F=1,ED-B=4,AF-B=10,CD-S=10,AM-C=4", cex.main=1.1) On Tue, Jun 10, 2008 at 12:07 PM, Hua Li <[EMAIL PROTECTED]> wrote: > Hi All, > > I

Re: [R] the title is too long for a graph

2008-06-10 Thread Jorge Ivan Velez
Dear Hua, Try using "\n" in the title or the "cex.main" argument. See ?par for details. # First attempt x= seq(1:100) y=seq(1:100) plot(x,y,main="p=0.05:A-B=3,C-D=10,D-E=100,A-F=2,AFR-E=3,ACE-D=1,ADEF-M=0,\n AED-E=10,DE-F=3,AB-J=4,AC-J=10,\n ED-F=1,ED-B=4,AF-B=10,CD-S=10,AM-C=4") # Second attemp

[R] Plotting multiple continuous lines with symbols

2008-06-10 Thread Tariq Perwez
Hi, I am trying to plot multiple lines on one plot such that all lines are of the same color (black) and continuous. I need to distinguish these multiple plots from each other by using different symbols (I am using pch=). However, all my lines are broken on both sides of the symbols. This unfortuna

[R] the title is too long for a graph

2008-06-10 Thread Hua Li
Hi All, I have a problem of putting long titles on a graph: for example, x= seq(1:100) y=seq(1:100) plot(x,y,main="p=0.05:A-B=3,C-D=10,D-E=100,A-F=2,AFR-E=3,ACE-D=1,ADEF-M=0,AED-E=10,DE-F=3,AB-J=4,AC-J=10,ED-F=1,ED-B=4,AF-B=10,CD-S=10,AM-C=4") R seems not able to print the whole title. The titl

Re: [R] using spec.pgram

2008-06-10 Thread stephen sefick
I from a first thought I would say that you are apply this wrong! The fourier transform convolves a function (cos(x)+isin(x) (this may not be the exact formula but I don't have my books near)) to the data and then integrates over -1/2 to 1/2 takes the modulus and plots this- the periodogram. The

Re: [R] Slow function

2008-06-10 Thread Marc
Hi Jim, This is genotype data of 170 samples. I selected subsets of SNP optimized for different types of germplasm. So it is a matrix with 170 rows and 1536, 384 or 96 columns of binary data (0, 1). I have 14 of such matrices in a list. x <- list() for (i in 1:14) { set.seed(i) x[[i]] <- ma

Re: [R] Question on lda and predict

2008-06-10 Thread Peter Flom
I wrote > Hello > > Using R 2.7.0 on Windows. > > I am running a linear discriminant analysis as follows > > > discrim1 <- lda(normvar~ mafmahal+ mrfmahal+ mffmahal+ bafmahal+ brfmahal+ > cofmahal+ bmfmahal+ cfmahal+ fractmahal+ antmahal+ absmifmahal+ > absifmahal, subset = train)

[R] Concat Multiple Plots into one PNG figure

2008-06-10 Thread Gundala Viswanath
Dear experts, I tried to put the two plots into one final PNG figure with the following script. However instead of giving 2 plots in one figure, it only gives the the last plot in one figure. What's wrong with my script below? __BEGIN__ in_fname <- paste("mydata.txt.",sep="") out_fname <- past

[R] Fast method to compute average values of duplicated IDs

2008-06-10 Thread Daren Tan
Hi, How do I collapse (average in the simplest case) the values of those duplicated ids (i.e., 2, 5, 6, 9) to give a table of unique ids ? t <- cbind(id=c(1:10, 2,5,6,9), value=rnorm(14)) _ [[alternative HTML ver

Re: [R] Question on lda and predict

2008-06-10 Thread Peter Flom
I wrote (in part) > > I am running a linear discriminant analysis as follows > > > discrim1 <- lda(normvar~ mafmahal+ mrfmahal+ mffmahal+ bafmahal+ brfmahal+ > cofmahal+ bmfmahal+ cfmahal+ fractmahal+ antmahal+ absmifmahal+ > absifmahal, subset = train) > prediction <- predict(discr

Re: [R] Parse XML

2008-06-10 Thread Martin Morgan
Hi Pratt -- ppatel3026 <[EMAIL PROTECTED]> writes: > Could someone provide a link or examples of parsing XML document in R? Few > specific questions below: Always helpful to know what software you're using; here's mine > library(XML) > sessionInfo() R version 2.8.0 Under development (unstable)

[R] samr result

2008-06-10 Thread Eleni Christodoulou
Hello list! I have a proble trying to perform a SAM analysis using the function samr from the samr package. I have put the option *center.arrays=TRUE *in order to scale all the experiments to median=0. I would like to retrieved the scaled data but it seems that samr does not return it...Does anyon

[R] GAM and poly.transform Issue

2008-06-10 Thread Bert Jacobs
Hi, I have the following problem while running a "gam" regression: test.gam = gam(fmla,data=Final.Df) where fmla is a regression formula that looks like: "Var1 ~ poly(c(1:160), degree = 5) + VarC1 + VarC2 + . VarC12 Within SPlus I used the following phrase to find the coefficients

Re: [R] Question on lda and predict

2008-06-10 Thread Erik Iverson
Peter Flom wrote: Hello Using R 2.7.0 on Windows. I am running a linear discriminant analysis as follows discrim1 <- lda(normvar~ mafmahal+ mrfmahal+ mffmahal+ bafmahal+ brfmahal+ cofmahal+ bmfmahal+ cfmahal+ fractmahal+ antmahal+ absmifmahal+ absifmahal, subset = train) predic

Re: [R] A curious bug in read.xls

2008-06-10 Thread Peter Dalgaard
Alberto Monteiro wrote: > I found a curious bug in read.xls. I don't know if it's reproducible. > > It's like this: suppose I do a read.xls in a spreadsheet. A column > begins with a number. Then, any strings below it will be rendered as NA. > If the column begins with a string, then it will be ren

[R] Question on lda and predict

2008-06-10 Thread Peter Flom
Hello Using R 2.7.0 on Windows. I am running a linear discriminant analysis as follows discrim1 <- lda(normvar~ mafmahal+ mrfmahal+ mffmahal+ bafmahal+ brfmahal+ cofmahal+ bmfmahal+ cfmahal+ fractmahal+ antmahal+ absmifmahal+ absifmahal, subset = train) prediction <- predict(discri

[R] SPSS, length variable names

2008-06-10 Thread mk90-40
Hello, I have to read in a SPSS-file. I use spss.get() from the Hmisc-package (version 3.4-3) and win-R(2.7.0) My Problem now is, that the length of all variable names is cutted to 8 characters. Can I avoid this? Thank you! -- Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten _

Re: [R] A curious bug in read.xls

2008-06-10 Thread Abhijit Dasgupta
I believe read.xls has a colClasses argument. If you import using read.xls(filename, colClasses='character') everything will be imported as a string, and you can re-convert after importing Alberto Monteiro wrote: I found a curious bug in read.xls. I don't know if it's reproducible. It's like

Re: [R] fitting periodic 'sine wave' model

2008-06-10 Thread Charilaos Skiadas
In addition to Gabor's suggestion, note the following warning from ?nls Warning Do not use nls on artificial "zero-residual" data. The nls function uses a relative-offset convergence criterion that compares the numerical imprecision at the current parameter estimates to the residual sum-of-

[R] Parse XML

2008-06-10 Thread ppatel3026
Could someone provide a link or examples of parsing XML document in R? Few specific questions below: For instance I can retrieve specific nodes using this: node <- xpathApply(xml, "//" %+% xtag, xmlValue) 1) I want to be able to retrieve parent node for this node, how can I do this? getParentN

Re: [R] Plot timer in a for loop

2008-06-10 Thread Ken Spriggs
So this works... Thanks. My mistake was leaving out seq_len() for (i in seq_len(nrow(Volumes))){ plot(as.numeric(deltas[i,])) Sys.sleep(0.5); } Ken Spriggs wrote: > > I appreciate the response but if this is what you have in mind I didn't > get anything different. > Any ideas why? > > f

Re: [R] Plot timer in a for loop

2008-06-10 Thread Ken Spriggs
The goal is to look at an evolution of a process over 400 steps. I don't really need to page back and forth so much as I'd like to just watch it like a flip book. jholtman wrote: > > Write it out to a PDF file and you can view at your leasure. On WIndows > you > have the option of paging b

Re: [R] Comparing two groups of proportions

2008-06-10 Thread Greg Snow
Actually, if you have the information on the individual units, then the production line information is redundant and you can just use Mcnemar's test comparing QA1 to QA2. Though as Rolf mentioned, this will not give the same information as if you have true state and can compare false positives

Re: [R] Plot timer in a for loop

2008-06-10 Thread Ken Spriggs
I appreciate the response but if this is what you have in mind I didn't get anything different. Any ideas why? for (i in nrow(Volumes)){ plot(as.numeric(deltas[i,])) Sys.sleep(0.5); } Thanks Jan T. Kim wrote: > > On Mon, Jun 09, 2008 at 02:02:01PM -0700, Ken Spriggs wrote: >> >> Hello, >>

Re: [R] Bug/Error in formatC? ....

2008-06-10 Thread Martin Maechler
> "MM" == Martin Maechler <[EMAIL PROTECTED]> > on Tue, 10 Jun 2008 15:05:05 +0200 writes: > "PD" == Peter Dunn <[EMAIL PROTECTED]> > on Tue, 10 Jun 2008 09:25:07 +1000 writes: PD> Hi all After posting what follows, Duncan Murdoch PD> suggested perhaps a bug in for

[R] A curious bug in read.xls

2008-06-10 Thread Alberto Monteiro
I found a curious bug in read.xls. I don't know if it's reproducible. It's like this: suppose I do a read.xls in a spreadsheet. A column begins with a number. Then, any strings below it will be rendered as NA. If the column begins with a string, then it will be rendered correctly. Alberto Monteir

[R] documentation of wts object returned by nnet() function

2008-06-10 Thread wmg
In MASS there is a nnet() function which returns, among other things, a wts[] vector giving the weights in the neural network. However, in neither the book nor in the online documentation for the routine can I find documentation of which element of wts[] goes with which link in the network---in

Re: [R] Hello

2008-06-10 Thread Greg Snow
Look at the "image" function and the "levelplot" function in the lattice package. -Original Message- From: "sumit gupta" <[EMAIL PROTECTED]> To: "r-help@r-project.org" Sent: 6/10/08 6:55 AM Subject: [R] Hello Hello, I am facing a problem in drawing heat map using R. I have a 70X3 mat

Re: [R] fitting periodic 'sine wave' model

2008-06-10 Thread Gabor Grothendieck
Try RSiteSearch("fit a sine") On Tue, Jun 10, 2008 at 10:25 AM, Jon Loehrke <[EMAIL PROTECTED]> wrote: > I have been attempting to estimate the periodic contribution of an effect to > some data but have not been able to fit a sine wave within R. > It would be nice to start by being able to fit a

[R] Odp: Hello

2008-06-10 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 10.06.2008 14:49:55: > Hello, > > I am facing a problem in drawing heat map using R. > > I have a 70X3 matrix and I want to draw a heat map with 1 coloumn on X axis > another on Y axis and want to show the value of 3rd coloumn using heat > colours. > Could you p

[R] fitting periodic 'sine wave' model

2008-06-10 Thread Jon Loehrke
I have been attempting to estimate the periodic contribution of an effect to some data but have not been able to fit a sine wave within R. It would be nice to start by being able to fit a sine wave with an amplitude and frequency. x<-seq(0,20,by=0.5) y<-2*sin(2*pi*.5*x) #amplitude =2, frequen

Re: [R] How to join data.frames and vectors of different length, in an inteligent way?

2008-06-10 Thread Chuck Cleland
You could put the group averages back into dafSamp using ave(): dafSamp <- data.frame(cbind(c(1972,1984,1969,1976,1999,1996,1976,1984,1976), c(117,73,92,113,80,78,98,106,99))) dafSamp$Ay <- ave(dafSamp$X2, dafSamp$X1, FUN=mean) dafSamp$vecAA <- dafSamp$X2 * (dafSamp$Ay / mean

Re: [R] Problem with by(... , median)

2008-06-10 Thread Michal Figurski
Well, Yes, that works just fine! Thank you! -- Michal J. Figurski HUP, Pathology & Laboratory Medicine Xenobiotics Toxicokinetics Research Laboratory 3400 Spruce St. 7 Maloney Philadelphia, PA 19104 Henrique Dallazuanna wrote: Try using aggregate: aggregate(tb[-1], list(tb$Subject), FUN=medi

[R] How to join data.frames and vectors of different length, in an inteligent way?

2008-06-10 Thread Hvidberg, Martin
I have a data set something like this: "", "Value" 1972 , 117 1984 , 73 1969 , 92 1976 , 113 1999 , 80 1996 , 78 1976 , 98 1984 , 106 1976 , 99 it could be created with: > dafSamp <- > data.frame(cbind(c(1972,1984,1969,1976,1999,1996,1976,1984,1976),c(117,73,92,113,80,78,98,1

[R] rollingRegression() Problem / Error in nrow(x)

2008-06-10 Thread nmarti
I am tring to use the rollingRegression function from PerformanceAnalytics. When I apply the function to R stock data (Boston), the function works fine. But when I try to apply it to data that I imported from excel, using xlsReadWrite, I recieve an error message: > Error in nrow(x): subscript o

Re: [R] Histogram of gaps

2008-06-10 Thread Chuck Cleland
On 6/10/2008 9:23 AM, Creighton, Sean wrote: Hi I consider myself not a complete beginner in R, however an elegant solution to this problem stumps me. I have a fairly long time series of 6 or so points, I need to gather the data to create a histogram of the length of continuous zero periods

[R] Associative Rules Search

2008-06-10 Thread Endre Domiczi
Hello, I would be very thankful to hear how often you search for associative rules in your daily work and what would you consider the most important in your tasks: - Data loading speed - Data processing speed - Advanced algorithms for rules post-processing Thanks a lot for your time! Best regar

Re: [R] Systemfit (was RE: How to force two regression coefficients to be equal but opposite in sign?)

2008-06-10 Thread Woolner, Keith
Thank you Arne. Though I didn't detail all of my attempts, I did in fact try a larger restriction matrix that accounted for the levels of the factors. However, I think my error in those attempts was in adding N columns to the matrix for an N-level factor (rather than N-1 columns), because I tho

Re: [R] Problem with by(... , median)

2008-06-10 Thread Henrique Dallazuanna
Try using aggregate: aggregate(tb[-1], list(tb$Subject), FUN=median, na.rm = T) On Tue, Jun 10, 2008 at 10:18 AM, Michal Figurski < [EMAIL PROTECTED]> wrote: > Hello everyone, > > I am new to R, I have been using SAS for a while. Not surprisingly, I find > R much better in graphics, which is pub

[R] Histogram of gaps

2008-06-10 Thread Creighton, Sean
Hi I consider myself not a complete beginner in R, however an elegant solution to this problem stumps me. I have a fairly long time series of 6 or so points, I need to gather the data to create a histogram of the length of continuous zero periods in a data set. So image the data looks like t

[R] Problem with by(... , median)

2008-06-10 Thread Michal Figurski
Hello everyone, I am new to R, I have been using SAS for a while. Not surprisingly, I find R much better in graphics, which is publication ready right away. Recently, I have been trying to calculate some basic statistics using R. I have a dataset of multiple rows per subject. For example: S

Re: [R] Bug/Error in formatC? (Was: Why doesn 't formatC( x, digits=2, format= " g")...)

2008-06-10 Thread Martin Maechler
> "PD" == Peter Dunn <[EMAIL PROTECTED]> > on Tue, 10 Jun 2008 09:25:07 +1000 writes: PD> Hi all After posting what follows, Duncan Murdoch PD> suggested perhaps a bug in formatC, or an error on PD> documentation. Any comments? It could be called a bug in your platform's

[R] Hello

2008-06-10 Thread sumit gupta
Hello, I am facing a problem in drawing heat map using R. I have a 70X3 matrix and I want to draw a heat map with 1 coloumn on X axis another on Y axis and want to show the value of 3rd coloumn using heat colours. Could you please help me with this . Thank you . Regards, Sumit [[alterna

Re: [R] using spec.pgram

2008-06-10 Thread Matthieu Stigler
Hello I don't know exactly what you want to do but: -why do you use in your example h$counts and not h? Furthermore helpl file says it should be a time series, why then rather not your time series? -usually na.action will make the "default" action, which you can see by getOptions("na.action"

Re: [R] piper diagram

2008-06-10 Thread Jim Lemon
Dylan Beaudette wrote: Hi, Is anyone on the list familiar with an R implementation of Piper Diagrams? Example: http://faculty.uml.edu/nelson_eby/89.315/IMAGES/Figure%209-78.jpg I am thinking that two calls to triax.plot (plotrix) along with some kind of affine-transformed standard plot would

  1   2   >