[R] adjust labels in plot:terminal_panel {party}

2007-10-24 Thread Alexander.Herr
Hi List, I am unsuccessfully trying to beautify barplot outputs from ctree. For example I would like to rotate x-axis lables and resize/change font/type. mtree <- ctree(ME ~ ., data = mammoexp) plot(mtree,terminal_panel=node_barplot(mtree,col="black",fill=NULL, beside=TRUE, ylines=NULL,

[R] Match and replace between two data.frames

2007-10-24 Thread Lauri Nikkinen
Hi folks, I have two dataframes like these: DF <- data.frame(ID=c("AA1234","AB3233","AC4353","AD2345","AE7453"), CK32344=c(1,3,2,4,1), CK32664=c(2,1,1,2,3), CK33422=c(2,2,1,3,2)) VAL <- data.frame(num=rep(6,3), type=c("CK32344", "CK32664", "CK33422"), number=c("32","452","234")) I want to replac

Re: [R] Executing a Function in a Loop With a ChangingValue foran Argument

2007-10-24 Thread Bill.Venables
I wondered if the real problem was bigger than your abstract version. OK. Here is one way to do it > myfunc <- function(x) { nam <- deparse(substitute(x)) val <- mean(x) cat("mean(", nam, ") =", val, "\n") invisible(val) } > ex <- quote(myfunc(x)) > subst <- function(Command,

Re: [R] convert factor dataframe into numeric matrix

2007-10-24 Thread Prof Brian Ripley
On Wed, 24 Oct 2007, sun wrote: > I took a look at these two ref cards and indeed they are helpful, but still > they are not complete enough to include this data.matrix() function in > particular. But note that it is linked from ?as.matrix. Although the 'See Also' sections of the help pages oft

Re: [R] scoping problem

2007-10-24 Thread Prof Brian Ripley
Local updating is what I would have recommended. But predict() will work correctly with NA values in the fit if the latter was done with na.action=na.exclude. I would find it clearer to use fitted() here, which also works for na.action=na.exclude. On Wed, 24 Oct 2007, Christos Hatzis wrote: >

Re: [R] Executing a Function in a Loop With a Changing Value foran Argument

2007-10-24 Thread Rick Bilonick
On Thu, 2007-10-25 at 15:34 +1000, [EMAIL PROTECTED] wrote: > There are many simple ways to do this, if I understand you correctly. > Here is an example > > > dat <- data.frame(matrix(rnorm(25), 5, 5)) > > names(dat) > [1] "X1" "X2" "X3" "X4" "X5" > > vars <- names(dat)[-1] > > vars > [1] "X2" "X3

Re: [R] GAM vs. MGCV packages

2007-10-24 Thread Prof Brian Ripley
The short answer is 'use mgcv unless you want compatibility with S or to use lo() terms'. You can read about the main differences by library(mgcv) ?gam Note that both packages are lower-case, and case does matter. On Wed, 24 Oct 2007, Firas Ahmed wrote: > Hi all, > > I am a new R- user and I

Re: [R] Executing a Function in a Loop With a Changing Value foran Argument

2007-10-24 Thread Bill.Venables
There are many simple ways to do this, if I understand you correctly. Here is an example > dat <- data.frame(matrix(rnorm(25), 5, 5)) > names(dat) [1] "X1" "X2" "X3" "X4" "X5" > vars <- names(dat)[-1] > vars [1] "X2" "X3" "X4" "X5" > myfunc <- function(x) print(mean(x)) > for(i in dat[, vars]) myf

[R] Executing a Function in a Loop With a Changing Value for an Argument

2007-10-24 Thread Rick Bilonick
I want to run a function in a loop and replace one of the arguments from a large list each time through the loop. If I was writing it out manually: myfunc(x=var1) myfunc(x=var2) etc. But I want to do this in a loop where x is replaced by a new name. Something like: for(i in vars) { myfunc(x=i)

Re: [R] Novice programing question

2007-10-24 Thread Ista Zahn
Thanks to everyone who responded to this question. I now understand much better, not only this particular issue, but also how to understand R documentation (it was not clear to me before happens when an argument is "NULL"). And yes, my original function was needlessly complicated! Thanks fo

Re: [R] Novice programing question

2007-10-24 Thread Bill.Venables
?var points out that "var is another interface to cov", i.e. it calculates (possibly part of) the "variance" matrix. In the simplest special case y = x and you get the entire variance matrix, or just the sample variance if x is a simple vector, as in your case. BTW you little function is a bit mo

Re: [R] rcmdr and mailing lists

2007-10-24 Thread John Fox
Dear Katherine, The plotMeans function in the Rcmdr package isn't intended to do what you want (in fact, I'd argue that in most cases it isn't desirable to plot means in a bar graph), but R graphics are very flexible and it wouldn't be hard to make the plot that you describe. I'd start with barplo

Re: [R] Novice programing question

2007-10-24 Thread jim holtman
'y' has a default value of NULL, so its value is NULL. Check ?cov to see what happens when it is NULL. On 10/24/07, Ista Zahn <[EMAIL PROTECTED]> wrote: > Hi all, > I apologize for the ignorance implicit in this question, but I'm > having a hard time figuring out how R functions work. For example

[R] Novice programing question

2007-10-24 Thread Ista Zahn
Hi all, I apologize for the ignorance implicit in this question, but I'm having a hard time figuring out how R functions work. For example, if I wanted to write a function to compute a variance, I would do something like >my.var <- function(x) (sum(((x-mean(x)))^2))/(length(((x-mean(x))) ^

Re: [R] scoping problem

2007-10-24 Thread Gabor Grothendieck
See: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/67474.html and also the other posts in that thread. On 10/24/07, Sandy Weisberg <[EMAIL PROTECTED]> wrote: > I would like to write a function that computes Tukey's 1 df for > nonadditivity. Here is a simplified version of the function I'd lik

Re: [R] X Axis labeling with class zoo

2007-10-24 Thread Gabor Grothendieck
Use the panel= argument as shown in the examples section of ?plot.zoo On 10/24/07, John Theal <[EMAIL PROTECTED]> wrote: > I'm using zoo to plot multiple data series, however, I am having > trouble adjusting the x-axis labeling on a multiple series plot. For > example, if I create a zoo > object

Re: [R] how to loop over a group of variables?

2007-10-24 Thread jim holtman
Actually I forgot you have a data frame. so use: for (i in 1:18){ .temp <- yourDataFrame[[paste('b', i, sep='')]] use .temp } On 10/24/07, DEEPANKAR BASU <[EMAIL PROTECTED]> wrote: > Hi All, > > I have a data frame with a group of variables named b1, b2, b3, ..., b18. > Thes

Re: [R] how to loop over a group of variables?

2007-10-24 Thread jim holtman
You can use 'get': for (i in 1:18){ .temp <- get(paste('b', i, sep='')) # get data to use . now use .temp in rest of calculations } On 10/24/07, DEEPANKAR BASU <[EMAIL PROTECTED]> wrote: > Hi All, > > I have a data frame with a group of variables named b1, b2, b3, ..., b18. > These

Re: [R] random walk w/ reflecting boundary: avoid control construct? [SEC=UNCLASSIFIED]

2007-10-24 Thread Crombie, Joe
Hi Johannes, I came up with the following (assuming that if step[i] is independent of step[i-1] then it is also independent of -step[i-1]): Cheers Joe > # your (unbounded) random walk > k <- cumsum(c(0,sample(c(-1,1), 1000, rep = T))) > > #shift it to positive, to allow following calculation

[R] how to loop over a group of variables?

2007-10-24 Thread DEEPANKAR BASU
Hi All, I have a data frame with a group of variables named b1, b2, b3, ..., b18. These variables take the value 1, 2 or NA. For each observation, I want to do some computation by looping over the values for the group of variables: b1 to b18. In STATA I would do: forval i=1/18 { --- use b`i'

[R] calculate residue by groups

2007-10-24 Thread Jiong Zhang, PhD
Hi Folks, I want to get the regression residue which each Race. But using: sample$resid <- by(sample,sample$Race),function(x)resid(lm( stroke ~ Sex + Age + Smoker + BMI, data = x))) Does not work. How do I calculate residue by grops? thanks. jiong The email message (and any attachments) is for

[R] Zicounts package

2007-10-24 Thread Nic Surawski
Dear R users, I have been using the zicounts package (verson 1.1.4) in R (version 2.4.1). I have been fitting zero inflated Poisson regressions to model the number of trips made by a household. Whilst I can get the best fit parameter set from zicounts, I can't get the package to return the

[R] "RESTFUL" R Web Service

2007-10-24 Thread Hisaji ONO
Hi. Is this available now? Regards. __ 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 commented, min

Re: [R] Plots in Meta-Analysis

2007-10-24 Thread Thomas Lumley
The forestplot() function in rmeta can plot fairly flexible forest plots. -thomas On Wed, 24 Oct 2007, Heather Watson wrote: > > Hello, > > I have been working with the meta and rmeta packages in R. Is it possible to > plot both the fixed and random effects so they appear on the same

Re: [R] adding total row/column to table-command

2007-10-24 Thread Peter Alspach
?addmargins Peter Alspach > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Georg Ehret > Sent: Thursday, 25 October 2007 9:19 a.m. > To: r-help > Subject: [R] adding total row/column to table-command > > Dear R, >I am often adding a total rows

[R] GAM vs. MGCV packages

2007-10-24 Thread Firas Ahmed
Hi all, I am a new R- user and I am going through the R-manuals, but I could not find an answer for my question. I am confused about when to use the GAM package and when to use the MGCV package?? My Model is a GAM model of continuous outcome and many non-linear continuous predictors (using th

[R] X Axis labeling with class zoo

2007-10-24 Thread John Theal
I'm using zoo to plot multiple data series, however, I am having trouble adjusting the x-axis labeling on a multiple series plot. For example, if I create a zoo object that consists of a date series and a numerical series and then plot it, I can adjust the x axis labeling using axis.Date(1,

Re: [R] adding total row/column to table-command

2007-10-24 Thread Benilton Carvalho
yes, addmargins() x = matrix(1:16, nc=4) addmargins(x) b On Oct 24, 2007, at 4:19 PM, Georg Ehret wrote: > Dear R, >I am often adding a total rows or column (sum over all rows or > columns) > when using table(data$1,data$2)... I do this now by adding the rows/ > columns > and rbind() or

Re: [R] scoping problem

2007-10-24 Thread Christos Hatzis
Another way to do this without messing with environments is to update the data and formula locally within the function and re-run the regression on the updated model/data: tukey.test <- function(m) { ud <- data.frame( m$model, pred2=m$fitted.values^2 ) uf <- update.formula(formula(m$terms)

[R] adding total row/column to table-command

2007-10-24 Thread Georg Ehret
Dear R, I am often adding a total rows or column (sum over all rows or columns) when using table(data$1,data$2)... I do this now by adding the rows/columns and rbind() or cbind()... But there must be a more efficient way Could someone please give me a hint? Thank you! With my best regards,

Re: [R] scoping problem

2007-10-24 Thread Duncan Murdoch
On 10/24/2007 3:43 PM, Sandy Weisberg wrote: > I would like to write a function that computes Tukey's 1 df for > nonadditivity. Here is a simplified version of the function I'd like to > write: (m is an object created by lm): > > tukey.test <- function(m) { > m1 <- update(m, ~.+I(predict(m)^

Re: [R] Partial aggregate on sorted data

2007-10-24 Thread Yves Moisan
>why not: >aggregate(myDataframe$TargetValue,list(SomeFactor = myDataframe$SomeFactor),function(x) mean(x[x>quantile(x,.66)])) Great stuff. Just what I was looking for ! Thanx a lot !! -- View this message in context: http://www.nabble.com/Partial-aggregate-on-sorted-data-tf4683988.html#a13

[R] scoping problem

2007-10-24 Thread Sandy Weisberg
I would like to write a function that computes Tukey's 1 df for nonadditivity. Here is a simplified version of the function I'd like to write: (m is an object created by lm): tukey.test <- function(m) { m1 <- update(m, ~.+I(predict(m)^2)) summary(m1)$coef } The t-test for the added vari

Re: [R] X11 graphics windows under CMD BATCH

2007-10-24 Thread David Scott
Not sure about answering your original question, but why not write the graphics output to a file, then fire up a viewer? David Scott On Wed, 24 Oct 2007, Luke Spadavecchia wrote: > Hi there, > > I am trying to plot some output from a FORTRAN (ifort) program using > R (2.5.1) under batch mode.

[R] Passing args and data to optim. WAS: Re: vectorized mle / optim

2007-10-24 Thread Charles C. Berry
On Wed, 24 Oct 2007, Arnaud Le Rouzic wrote: > Hi the list, > > I would need some advice on something that looks like a FAQ: the > possibility of providing vectors to optim() function. > Arnaud, If I have misunderstood your intent, let me say I am sorry. I think what you are struggling with is

[R] Adding a second y axis and specifying yaxs="i"

2007-10-24 Thread Cameron Guenther
Hello All, I have plotted a barplot and placed a line plot over top using par(new=TRUE). In the first plot I have specified that yaxs="i" and xaxs="i". However when I add a new axis to side 4 (right) and try to specify yaxs="i" it does nothing and the axis line begins above the x axis when I wa

Re: [R] Partial aggregate on sorted data

2007-10-24 Thread kees
Yves, why not: aggregate(myDataframe$TargetValue,list(SomeFactor = myDataframe$SomeFactor),function(x) mean(x[x>quantile(x,.66)])) Op Wed, 24 Oct 2007 15:30:10 +0200 schreef Yves Moisan <[EMAIL PROTECTED]>: > > Hi All, > > I'm looking for ways to compute aggregate statistics (with the aggre

Re: [R] random walk w/ reflecting boundary: avoid control construct?

2007-10-24 Thread Charles C. Berry
On Wed, 24 Oct 2007, Johannes H?sing wrote: Dear expeRts, recently I asked for a nice way to re-program a problem without using control constructs such as "for" or "sapply(1:length(x), ...". Is there a way to program a random walk with a reflecting boundary without resorting to such constructs?

Re: [R] Graphics - plotting two graphs

2007-10-24 Thread Tim Smith
Hi all, I think you are both right. Multiple scales are not a good idea. I think I'll go with the two graphs idea that John suggested. It is way better than trying to superimpose two scales. thanks a lot!! Tim Scionforbai <[EMAIL PROTECTED]> wrote: plot(x1,y1,"b",xlim=range(x1), ylim=c(0, 1

[R] vectorized mle / optim

2007-10-24 Thread Arnaud Le Rouzic
Hi the list, I would need some advice on something that looks like a FAQ: the possibility of providing vectors to optim() function. Here is a stupid and short example summarizing the problem: example 1 8< -- library(stats4) data

Re: [R] jEdit for R

2007-10-24 Thread Julian Burgos
Hi Rob, I used jEdit, but I'm not sure if there is a 'ctrl-R' option available. I eventually switched to Tinn-R, which is an editor customized for R (although I can be used for other languages) and does provide the connection to R you are looking for. Also (I think) loads faster and it is mo

Re: [R] Calling php web service fails

2007-10-24 Thread Duncan Temple Lang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rohan7 wrote: > hi, > > Thanks for replying. Actually today morning i saw the KEGG webservice by > Bioconductor and i call my php web service in similar fashion. It worked. > > - KEGG sample - > #KEGGserver <- SOAPServer("http://soap.genome.ad.jp

[R] Package Build fails: make ./help: no such file or directory

2007-10-24 Thread Dieter Menne
Dear List, After having installed R 2.6.0/Windows 2000, my trusted command script to build and install my package fails with an error message I do not understand. I have installed a fresh copy of Rtools, and made sure that these are the first on the path. For testing, I am using a package version

Re: [R] Graphics - plotting two graphs

2007-10-24 Thread Scionforbai
plot(x1,y1,"b",xlim=range(x1), ylim=c(0, 170),pch=16,cex=2,axes=FALSE,ann=FALSE) par(col="grey50", fg="grey50", col.axis="grey50") axis(1, at=seq(0, 16, 4)) axis(2, at=seq(0, 170, 10)) axis(4, at=seq(0, 170, 10)) par(new=TRUE) plot(x2,y2,"b",xlim=range(x2), ylim=c(0, 170),pch=21,cex=2,axes=FALSE,an

[R] vector graphics/ SVG plots via RSvgDevice

2007-10-24 Thread Sam McClatchie
System: 2.6.0 Linux kernel 2.6.15 Ubuntu dapper R version 2.5.1 ESS 5.2.11 on Emacs 21.4.1 Hello Brian Thanks for the tip. I upgraded to R 2.6.0., installed the package RSvgDevice, and modified my R-code to produce a vector graphics .svg file instead of postscript. The .svg file imported nicely i

Re: [R] Plots in Meta-Analysis

2007-10-24 Thread Bernd Weiss
Heather Watson schrieb: > Hello, > > I have been working with the meta and rmeta packages in R. Is it possible to > plot both the fixed and random effects so they appear on the same plot? > Basically, I would like the plot to show the effects of each study, the > summary effect for the fixed

Re: [R] jEdit for R

2007-10-24 Thread hadley wickham
You might be able to using the built in scripting capabilities of jEdit, but it will be critically dependent on your OS, which you didn't tell us. Hadley On 10/24/07, threshold <[EMAIL PROTECTED]> wrote: > > Hi, > I just installed jEdit but have no clue, whether I can run my code a'la > "ctrl-R"

Re: [R] Graphics - plotting two graphs

2007-10-24 Thread John Kane
It is not at all clear what you are trying to do. However does this do something like what you want? I just ignored the second y-axis as it is redundent. I have not been able to figure out what all the par calls were intended to do. x1 <- c(2, 4, 6, 8, 10, 12) x2 <- c(10, 20, 30, 40, 50, 60) y1

[R] rcmdr and mailing lists

2007-10-24 Thread Katherine Jones
I am trying to draw a bar chart with standard error bars for two groups. I was struggling in R so have now managed to get rcmdr up and running on my mac (although the help frequently crashes, everything else seems fine, if a bit sluggish; wouldn't use it for stats). This has allowed me to v

Re: [R] Fetching datapoints from a Time Series

2007-10-24 Thread Achim Zeileis
One comment first: Sending a request to the list *once* is sufficient! As for the question: A slight modification of Jim's solution... > > x <- read.table(tc <- textConnection(" DateValue > + 01/03/05 -0.008471364 > + 01/04/05 -0.008153802 > + 01/05/05 -0.000780031 > + 01

[R] random walk w/ reflecting boundary: avoid control construct?

2007-10-24 Thread Johannes Hüsing
Dear expeRts, recently I asked for a nice way to re-program a problem without using control constructs such as "for" or "sapply(1:length(x), ...". Is there a way to program a random walk with a reflecting boundary without resorting to such constructs? A working solution is ranwalk <- function(leng

Re: [R] plot within a loop

2007-10-24 Thread Matthew Keller
Hi Santanu, You can write it out to a PDF: a.new = 1.2 value.b = seq(from = 0, to = 1, by = 0.001) pdf('MyGraphs.pdf',width=11, height=8.5,pointsize=12, paper='special') par(mfrow = c(3,2)) for (i in 1:length(d)){ plot(value.b, dbeta(shape1 = value.b, shape2 = d[i], a.new), main = paste("B[",i,"]

Re: [R] convert factor dataframe into numeric matrix

2007-10-24 Thread sun
I took a look at these two ref cards and indeed they are helpful, but still they are not complete enough to include this data.matrix() function in particular. - Original Message - From: "John Kane" <[EMAIL PROTECTED]> To: "sun" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday,

[R] Plots in Meta-Analysis

2007-10-24 Thread Heather Watson
Hello, I have been working with the meta and rmeta packages in R. Is it possible to plot both the fixed and random effects so they appear on the same plot? Basically, I would like the plot to show the effects of each study, the summary effect for the fixed effects and the summary effect for

[R] Package forecast

2007-10-24 Thread Joao Santos
Hello All, I trying to use the function auto.arima() from package forecast but I have a problem. My steps after I used the function auto.arima(...) I create the time series like this: >bbrass = scan("C:/Program Files/R/data PTIN/my_file.dat") >regts.start = ISOdatetime(2006, 7, 1, hour=0,

Re: [R] Partial aggregate on sorted data

2007-10-24 Thread Moisan Yves
Hi Jim, Works indeed. Thanx a lot! It would be nice if those options were part of the aggregate function though just to have an easier way to play with the sorting and subset parameters. Thanx again! Yves P.S. there's a small typo :DEsCENDING :-) -Message d'origine- De : jim holtm

[R] jEdit for R

2007-10-24 Thread threshold
Hi, I just installed jEdit but have no clue, whether I can run my code a'la "ctrl-R" directly from jEdit script, or should source it from R command line, after saving it first in jEdit. thanks for any help, rob -- View this message in context: http://www.nabble.com/jEdit-for-R-tf4684065.html#a1

Re: [R] convert factor dataframe into numeric matrix

2007-10-24 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 24.10.2007 16:24:29: > > - Original Message - > From: "Prof Brian Ripley" <[EMAIL PROTECTED]> > To: "sun" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Wednesday, October 24, 2007 2:58 PM > Subject: Re: [R] convert factor dataframe into numeric ma

Re: [R] Looping

2007-10-24 Thread Duncan Murdoch
On 10/24/2007 10:30 AM, [EMAIL PROTECTED] wrote: > Is there a way to generate variables with names like var1, var2, var3? > Right now I've been resorting to using either a cat function to string it > together or to pre-generate a list and having it select from list[x] as it > loops. Your last reso

Re: [R] X11 graphics windows under CMD BATCH

2007-10-24 Thread Dirk Eddelbuettel
Luke, On 24 October 2007 at 15:16, Luke Spadavecchia wrote: | I am trying to plot some output from a FORTRAN (ifort) program using | R (2.5.1) under batch mode. In the FORTRAN code, I call R in batch Your questions is essentially FAQ 7.19. In non-interactive mode, R simply has no X11 de

[R] Different results in the unit root test. Why?

2007-10-24 Thread angchanyy
Situation: I had tired a 1000-data generated by random error(i.i.d.), then I sub it into different unit root tests. I got different results among the tests. The following are the test statistics I got: adf.test @ tseries ~ -10.2214 (lag = 9) ur.df @ urca ~ -21.8978 ur.sp @ urca ~ -27.68 pp.test @

Re: [R] convert factor dataframe into numeric matrix

2007-10-24 Thread John Kane
You might want to have a look at the two "R reference card" documents under "Contributed" on CRAN. --- sun <[EMAIL PROTECTED]> wrote: > > - Original Message - > From: "Prof Brian Ripley" <[EMAIL PROTECTED]> > To: "sun" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Wednesday, Oc

[R] plot within a loop

2007-10-24 Thread Santanu Pramanik
Hi , I'm having problem with the following plot. Basically I have to do 51(length of d, see below) plots. I want 6 plots (say) in a page and rests are in different pages. win.graph() starts a plot in new page. But I'm not being able to combine par(mfrow = c(3,2)) and win.graph() within a loop.

[R] Graphics - plotting two graphs

2007-10-24 Thread Tim Smith
Hi, I wanted to plot 2 lines on a single graph. Each graph has one axis that can be common. The code that I'm using is: --- par(mfrow=c(1, 1)) x1 <- c(2, 4, 6, 8, 10, 12) x2 <- c(10, 20, 30, 40, 50, 60) y1 <- c(10,12,15,22,34,21) y2 <- c(40,

[R] Looping

2007-10-24 Thread yiferic
Is there a way to generate variables with names like var1, var2, var3? Right now I've been resorting to using either a cat function to string it together or to pre-generate a list and having it select from list[x] as it loops. Help would be much appreciated. Thanks! __

Re: [R] convert factor dataframe into numeric matrix

2007-10-24 Thread sun
- Original Message - From: "Prof Brian Ripley" <[EMAIL PROTECTED]> To: "sun" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, October 24, 2007 2:58 PM Subject: Re: [R] convert factor dataframe into numeric matrix > On Wed, 24 Oct 2007, sun wrote: > >> Bear me if this is a na

Re: [R] Error in nls model.frame

2007-10-24 Thread Prof Brian Ripley
On Wed, 24 Oct 2007, Rafael Barros de Rezende wrote: > > Error in model.frame > > When I run the following nls model an error message appears and I dont > know how to solve that. Could you help me?? > > mat = c(1,2,3,4,5,6,7,8,9,12,16,24,36,48,60) > > for (i in 1:length(j30)) { > bliss

[R] PLS and CCA equivalent?

2007-10-24 Thread Yukihiro Ishii
Dear R users! Recently I read an itroductory book on chemometrics, in which the PLS(Partial least suqres) method is referred to as equivalent to the CCA(Canonical correlation analysis). Is it really the case? If so, is there anyone out there who could please show me literature that discusses the p

[R] X11 graphics windows under CMD BATCH

2007-10-24 Thread Luke Spadavecchia
Hi there, I am trying to plot some output from a FORTRAN (ifort) program using R (2.5.1) under batch mode. In the FORTRAN code, I call R in batch mode to execute a script called fig1.R using something like PROGRAM test USE IFPORT IMPLICIT NONE DO !Some functi

[R] understanding dt function and fitting distributions

2007-10-24 Thread Stéphane CRUVEILLER
Dear R-users, I 'm trying to fit several kind of ditribution over real sample data. Although I have been successful for many of them, I can figure out how to deal with Student t distribution. In dt function documentation, I can read: Density, distribution function, quantile function and random

Re: [R] Partial aggregate on sorted data

2007-10-24 Thread jim holtman
Is this something like you want: > set.seed(1) > test <- data.frame(value=runif(100), fact=sample(LETTERS[1:5], 100, TRUE)) > result <- tapply(test$value, test$fact, function(x, sort, subset){ + x <- x[order(x, decreasing=(sort == "DECENDING"))] + mean(head(x, length(x) * subset)) + }, sor

Re: [R] multicomp plotting

2007-10-24 Thread Nair, Murlidharan T
Thanks, multicomp was a typo in the code I put in the email. I am using multcomp. I did not understand the line attr(tmp, "type")<-"none" what is it doing? I looked up type under arguments, which mentions it as multiplicity adjustment to be applied. Does the statement say no adjustments to be app

Re: [R] Fetching datapoints from a Time Series

2007-10-24 Thread John Kane
Maybe ?window --- Megh Dal <[EMAIL PROTECTED]> wrote: > Hi all, > I have a time series like that : > DateValue > 01/03/05 -0.008471364 > 01/04/05 -0.008153802 > 01/05/05 -0.000780031 > 01/06/05 -0.000130064 > 01/07/05 -0.000650576 > 01/08/05 -0.000130166 > 01/10

[R] Partial aggregate on sorted data

2007-10-24 Thread Yves Moisan
Hi All, I'm looking for ways to compute aggregate statistics (with the aggregate function) but with an option for sorting and selecting a subset of the data frame. For example, I have would like to turn this : aggregate(myDataframe$TargetValue,list(SomeFactor = myDataframe$SomeFactor),mean) in

Re: [R] Rotated viewports in Grid

2007-10-24 Thread Gustaf Rydevik
On 10/24/07, Paul Murrell <[EMAIL PROTECTED]> wrote: > Hi > > > Gustaf Rydevik wrote: > > Hi all, > > > > I'm trying to generate a plot containing a scatterplot, with marginal > > densityplots for x and y. > > However, when I try to generate a vertical densityplot, I get the > > message "warning: c

Re: [R] Fetching datapoints from a Time Series

2007-10-24 Thread jim holtman
> x <- read.table(tc <- textConnection(" DateValue + 01/03/05 -0.008471364 + 01/04/05 -0.008153802 + 01/05/05 -0.000780031 + 01/06/05 -0.000130064 + 01/07/05 -0.000650576 + 01/08/05 -0.000130166 + 01/10/05 -0.004174282 + 01/11/05 0.01027384 + 01/12/05 -0.006099558 + 01/13/0

[R] Error in nls model.frame

2007-10-24 Thread Rafael Barros de Rezende
Error in model.frame When I run the following nls model an error message appears and I dont know how to solve that. Could you help me?? mat = c(1,2,3,4,5,6,7,8,9,12,16,24,36,48,60) for (i in 1:length(j30)) { bliss = nls(c(j[i,1:length(mat)]) ~ b0 + b1*((1-exp(-k1*mat))/(k1*mat

[R] Fetching datapoints from a Time Series

2007-10-24 Thread Megh Dal
Hi all, I have a time series like that : DateValue 01/03/05 -0.008471364 01/04/05 -0.008153802 01/05/05 -0.000780031 01/06/05 -0.000130064 01/07/05 -0.000650576 01/08/05 -0.000130166 01/10/05 -0.004174282 01/11/05 0.01027384 01/12/05 -0.006099558 01/13/05 -0.0

[R] Fetching datapoints from a Time Series

2007-10-24 Thread Arun Kumar Saha
Hi all, I have a time series like that : DateValue 01/03/05 -0.008471364 01/04/05 -0.008153802 01/05/05 -0.000780031 01/06/05 -0.000130064 01/07/05 -0.000650576 01/08/05 -0.000130166 01/10/05 -0.004174282 01/11/05 0.01027384 01/12/05 -0.006099558 01/13/05 -0.009811054 01/

[R] Fetching datapoints from a Time Series

2007-10-24 Thread Megh Dal
Hi all, I have a time series like that : DateValue 01/03/05 -0.008471364 01/04/05 -0.008153802 01/05/05 -0.000780031 01/06/05 -0.000130064 01/07/05 -0.000650576 01/08/05 -0.000130166 01/10/05 -0.004174282 01/11/05 0.01027384 01/12/05 -0.006099558 01/13/05 -0.0

[R] Fetching datapoints from a Time Series

2007-10-24 Thread Megh Dal
Hi all, I have a time series like that : DateValue 01/03/05 -0.008471364 01/04/05 -0.008153802 01/05/05 -0.000780031 01/06/05 -0.000130064 01/07/05 -0.000650576 01/08/05 -0.000130166 01/10/05 -0.004174282 01/11/05 0.01027384 01/12/05 -0.006099558 01/13/05 -0.0

[R] Fetching datapoints from a Time Series

2007-10-24 Thread Megh Dal
Hi all, I have a time series like that : DateValue 01/03/05 -0.008471364 01/04/05 -0.008153802 01/05/05 -0.000780031 01/06/05 -0.000130064 01/07/05 -0.000650576 01/08/05 -0.000130166 01/10/05 -0.004174282 01/11/05 0.01027384 01/12/05 -0.006099558 01/13/05 -0.0

[R] Odp: convert factor dataframe into numeric matrix

2007-10-24 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 24.10.2007 14:51:10: > Bear me if this is a naive question. > > I have a dataframe, all lists inside it are factors. When I use > as.matrix(df) to convert, I get a character matrix while my intention is to > get numeric matrix. I can make the convertion iterat

Re: [R] convert factor dataframe into numeric matrix

2007-10-24 Thread Prof Brian Ripley
On Wed, 24 Oct 2007, sun wrote: > Bear me if this is a naive question. > > I have a dataframe, all lists inside it are factors. When I use Do you mean 'all columns are factors'? A data frame is a list but usually does not contain lists. > as.matrix(df) to convert, I get a character matrix whil

Re: [R] convert factor dataframe into numeric matrix

2007-10-24 Thread Dimitris Rizopoulos
look at ?data.matrix(). 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/ http://www.s

Re: [R] is there a similar function to perform repeated statements asin SAS PROC MIXED?

2007-10-24 Thread Dimitris Rizopoulos
you can wave a look at the gls() function in package nlme, and specifically at the `weights' and `correlation' arguments; the same arguments are also available in the lme() function. I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public H

[R] convert factor dataframe into numeric matrix

2007-10-24 Thread sun
Bear me if this is a naive question. I have a dataframe, all lists inside it are factors. When I use as.matrix(df) to convert, I get a character matrix while my intention is to get numeric matrix. I can make the convertion iteratively by each list but I do think there is some more elegant way

[R] is there a similar function to perform repeated statements as in SAS PROC MIXED?

2007-10-24 Thread gallon li
PROC MIXED is used to fit mixed effects model for correlated data. Usually we can use either a REPEATED statment or a RANDOM statement. The random statement is corresponding to lme function in R -- specifying a random effect term. The repeated statement actually directly specifies the covariance

Re: [R] Rotated viewports in Grid

2007-10-24 Thread Paul Murrell
Hi Gustaf Rydevik wrote: > Hi all, > > I'm trying to generate a plot containing a scatterplot, with marginal > densityplots for x and y. > However, when I try to generate a vertical densityplot, I get the > message "warning: can't clip to rotated viewport", and nothing shows > up. I'm probably m

Re: [R] Compute R2 and Q2 in PLS with pls.pcr package

2007-10-24 Thread Bjørn-Helge Mevik
Ana Conesa wrote: > I am using the mvr function of the package pls.pcr to compute PLS > resgression You should consider switching to the package 'pls'. It supersedes 'pls.pcr', which is no longer maintained (the last version came in 2005). In pls, you would do the following to get R^2 and cros

Re: [R] Odp: help with image function

2007-10-24 Thread michael watson (IAH-C)
The Disney way: par(mar=c(2,8,2,2)) barplot(rep(1,10), axes=FALSE, names=rev(paste(breaks[1:10], breaks[2:11], sep="-")), horiz=TRUE, col=heat.colors(10), las=2) From: [EMAIL PROTECTED] on behalf of Petr PIKAL Sent: Wed 24/10/2007 11:33 AM To: Jonas Öster C

[R] Rotated viewports in Grid

2007-10-24 Thread Gustaf Rydevik
Hi all, I'm trying to generate a plot containing a scatterplot, with marginal densityplots for x and y. However, when I try to generate a vertical densityplot, I get the message "warning: can't clip to rotated viewport", and nothing shows up. I'm probably misunderstanding how viewports are meant t

[R] not having read the posting guide; was: Re: (no subject)

2007-10-24 Thread Uwe Ligges
[EMAIL PROTECTED] wrote: > Hello, > > This is my first query to the message board. But you forgot to read and follow the instructions in the posting guide. Please do so before posting! Thanks, Uwe Ligges > I have a question on how to do a long run multiplier in R. Our teacher has > given

Re: [R] analytical solution to Sum of binominal distributed random numbers?

2007-10-24 Thread Rainer M. Krug
Hi Jay & Matthias That's exactly what I was looking for. Thanks a lot Rainer G. Jay Kerns wrote: > Hi Rainer, > > The distr package can calculate the distribution for you: > > library(distr) > X <- Binom(size = 7, prob = 0.3) > Y <- Binom(size = 11, prob = 0.5) > Z <- X + Y > > d(Z)( 0:18 )

[R] Odp: help with image function

2007-10-24 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 24.10.2007 12:01:09: > Hallo! > Have succeded in creating an image plot using image() > Have failed to provide explanation to what the colors means in terms of > values/numbers (i.e. the height of the staples that the colors represent). > Wonder if anyone have any

Re: [R] How to avoid the NaN errors in dnbinom?

2007-10-24 Thread francogrex
Thanks Jim, I corrected the error by avoiding negative K values: k1=abs(mu1/((var1/mu1)-1)) k2=abs(mu2/((var2/mu2)-1)) I am not sure about the general code to determine the parameters though, sometimes it gives the expected values (determined in advance by rnbinom) and sometimes it's way off.

Re: [R] Data format problem

2007-10-24 Thread Joao Santos
Hello, First of all, thanks everyone that reply to my questions and I sorry to spend so many time to reply. I'm find a way to treat this problem using the zoo package: bbrass = scan("C:/Program Files/R/data PTIN/bbrass_client_2471_pool_72644_percent_in_use_500_NA.dat") regts.start = ISOdatetime(

Re: [R] Imputation method on binary data

2007-10-24 Thread sigalit mangut-leiba
Thank yot for your excellent detailed explanation! Sigalit. On 10/24/07, Ted Harding <[EMAIL PROTECTED]> wrote: > > On 24-Oct-07 08:51:30, sigalit mangut-leiba wrote: > > hello, > > I want to do a single Imputation method on binary data set. > > Is it possible to use imp.cat from CAT package? > >

Re: [R] date format conversion problem

2007-10-24 Thread Joao Santos
Hello Ben, First of all thanks for the reply,and sorry because I haven't replied early. In this time I find another form to create the "my time", like this: bbrass = scan("C:/Program Files/R/data PTIN/bbrass_client_2471_pool_72644_percent_in_use_500_NA.dat") regts.start = ISOdatetime(2006, 7, 1,

[R] help with image function

2007-10-24 Thread Jonas Öster
Hallo! Have succeded in creating an image plot using image() Have failed to provide explanation to what the colors means in terms of values/numbers (i.e. the height of the staples that the colors represent). Wonder if anyone have any help to offer in this matter? Have tried with convertColor() and

  1   2   >