Re: [R] Fetching a range of columns

2008-09-15 Thread Jason Thibodeau
David, Using the ?count.fields revealed that I only have 2410 columns. That fixed the problem I had. I used, data_tmp[,842:2410] and that gave me the solution I was looking for. This, ironically, also solved the other problem I had. As for: > > You also say file.remove( fileout) , then you try

Re: [R] Looking for function tree.matrix

2008-09-15 Thread Mark Difford
Hi Meir, It's part of Prof. Ripley's package tree, but is not exported. library(tree) ls(asNamespace("tree")) RSiteSearch("tree.matrix") Regards, Mark. Meir Preiszler wrote: > > > Hi, > > Does anyone know where such a function can be found? > > Thanks > Meir > > > > **

Re: [R] Ward's Clustering Doubts

2008-09-15 Thread Mark Difford
Hi Rodrigo, [apropos of Ward's method] >> ... we saw something like "You must use it with Euclidean Distance..." Strictly speaking this is probably correct, as Ward's method does an analysis of variance type of decomposition and so doesn't really make much sense (I think) unless Euclidean dist

[R] Looking for function tree.matrix

2008-09-15 Thread Meir Preiszler
Hi, Does anyone know where such a function can be found? Thanks Meir Meir Preiszler - Research Engineer I t a m a r M e d i c a l Ltd. Caesarea, Israel: Tel: +(972) 4 617 7000 ext 232 Fax: +(972) 4 627 5598 Cell: +(972) 54 699 9630 Email: [EMAIL P

Re: [R] How to draw a plot like this?

2008-09-15 Thread Jinsong Zhao
Neil Shephard wrote: Jinsong Zhao wrote: Hi there, I hope to draw a plot like this: http://www.sg-chem.net/swizard/Ru-bqdi-spectra.gif is it possible to draw it using R? thanks for any suggestions. My intuition would say yes it is possible as R graphics are highly flexible. I'm afraid I

Re: [R] How to draw a plot like this?

2008-09-15 Thread Yihui Xie
I think the function split.screen() in 'graphics' package is enough for this task. For example, ## fig.loc = matrix(c(0, 1, 0, 1, 0.1, 0.6, 0.5, 0.9), 2, byrow = T) x = split.screen(fig.loc) par(mar = c(3, 3, 1, 1)) screen(1) plot(rnorm(100)) screen(2) plot(rnorm(20), type = "h") Yihui On Mo

Re: [R] How to draw a plot like this?

2008-09-15 Thread Jim Lemon
Jinsong Zhao wrote: Hi there, I hope to draw a plot like this: http://www.sg-chem.net/swizard/Ru-bqdi-spectra.gif is it possible to draw it using R? Hi Jinsong, Look at the subplot function in the TeachingDemos package. Jim __ R-help@r-project.

Re: [R] R rpm for Mandriva 2008.1 ?

2008-09-15 Thread Demmler J.
Solved! Something must have gone wrong when I set up the system. I reinstalled Mandriva, updated the packages and VOILA: R finally installed without any problems! Thanks Joanne [[alternative HTML version deleted]] __ R-help@r-project.org m

Re: [R] How to draw a plot like this?

2008-09-15 Thread Neil Shephard
Jinsong Zhao wrote: > > Hi there, > > I hope to draw a plot like this: > http://www.sg-chem.net/swizard/Ru-bqdi-spectra.gif > > is it possible to draw it using R? > > thanks for any suggestions. > My intuition would say yes it is possible as R graphics are highly flexible. I'm afraid I don

Re: [R] Help please! How to code a mixed-model with 2 within-subject factors using lme or lmer?

2008-09-15 Thread Mark Difford
Hi Roberto, The other thing you can do --- if you don't wish to step across to lmer(), where you will be able to exactly replicate the crossed-factor error structure --- is stay with aov(... + Error()), but fit the factor you are interested in last. Assume it is Sex. Then fit your model as aov.m

Re: [R] any package to do generalized linear mixed model?

2008-09-15 Thread Yihui Xie
lme4 On Mon, Sep 15, 2008 at 12:35 PM, Wensui Liu <[EMAIL PROTECTED]> wrote: > I checked GlmmML package. However, it can only do binomial and poisson > distribution. How about others such as gamma or neg binomial? > Thank you so much! > wensui > -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10

Re: [R] histogram

2008-09-15 Thread Jim Lemon
Felipe wrote: i calculated the density and wanna do something like this separate in 0-19-29-39-49-59-69-79-99 and put in these spaces 8 densities .. 0.something i have the frequency in % and divided already in 20 or 10 to get the density i tried and tried..made breaks vector to separate but cou

[R] help on sampling from the truncated normal/gamma distribution on the far end (probability is very low)

2008-09-15 Thread Daniel Davis
Hi, guys, I am trying to sample from a truncated normal/gamma distribution. But only the far end of the distribution (where the probability is very low) is left. e.g. mu = - 4; sigma = 0.1; The distribution is Normal(mu,sigma^2) truncated on [0,+Inf]; How can I get a sample? I tried to use inver

Re: [R] randomly sample within clustered data?

2008-09-15 Thread Brown, Tony Nicholas
Thierry, Thanks so much. Your solution works perfectly. Tony -Original Message- From: ONKELINX, Thierry [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2008 2:56 AM To: Brown, Tony Nicholas; r-help@r-project.org Subject: RE: [R] randomly sample within clustered data? Something li

Re: [R] Scaling X axis from -1 to 1

2008-09-15 Thread Jim Lemon
Gundala Viswanath wrote: Hi, I have a density plot in which the x axis ranged from 0 to 2000. How can I scale the data so that the x-axis is scaled in -1 to 1 form? Hi Gundala, If your data is named "mydata": mynewdata<-rescale(mydata,c(-1,1)) This will linearly transform "mydata" into t

Re: [R] randomly sample within clustered data?

2008-09-15 Thread ONKELINX, Thierry
Something like this? do.call("rbind", lapply( split(Dataf, Dataf$id), function(x){ x[sample(seq_len(nrow(x)), size=2), ] } ) ) HTH, Thierry

[R] randomly sample within clustered data?

2008-09-15 Thread Brown, Tony Nicholas
Dear useRs, What is an efficient way to randomly sample from clustered data such that I get equal representation from each cluster? For example, let's say I want to randomly sample two cases from each cluster created by the "id" variable in the following data frame: > id<-c(rep("100", 4),re