[R] Generating mp3s from lattice-made pdfs with animation package

2010-07-22 Thread sethandmelva
I have generated a multi-page pdf with lattice. Now I want to make an mpeg3 file animation from it. I have been experimenting with the 'animation' package. The saveM ovie function will create an mp3 file, but it is not clear if it will take a pdf as the 'expr' that generates animations. S

Re: [R] Multilevel survival model

2010-07-22 Thread Kingsford Jones
On Thu, Jul 22, 2010 at 8:23 AM, Christopher David Desjardins wrote: > * Please cc me if you reply as I am a digest subscriber * > > Hi, > I am wondering how I can run a multilevel survival model in R? Below is > some of my data. > >> head(bi0.test) >  childid famid lifedxm     sex      age delta

Re: [R] Heterogeneous variance in two-way mixed ANOVA

2010-07-22 Thread Kingsford Jones
Can't give more specific advice without more information (see the posting guide), but I suspect you want to use nlme::lme, specifying a weights argument to adjust for the heterogeneity. Kingsford On Wed, Jul 21, 2010 at 11:10 PM, Kline, Keith A wrote: > I have heterogeneous variance in a two-way

Re: [R] xtable

2010-07-22 Thread Kingsford Jones
not an xtable solution, but R2HTML::HTML has an impressive list of methods, including HTML.infl: lm.SR <- lm(sr ~ pop15 + pop75 + dpi + ddpi, data = LifeCycleSavings) influencia <- influence.measures(lm.SR) library(R2HTML) methods(HTML) HTML(influencia, 'influencia.html') and open the html file i

Re: [R] Changing some values within a variable

2010-07-22 Thread Toni Pitcher
All sorted Thanks very much for your help Peter and Jannis. Toni Peter Alspach wrote: Tena koe Toni Assume your data is in a data.frame called toniData (naming a data.frame data is not a good idea as data is a function in R - see ?data), and that Group is of class character (try str(

Re: [R] Permutation test

2010-07-22 Thread Wu Gong
hi, Library DAAG has onet.permutation function for one-sample permutation test and twot.permutation function for two-sample permutation test. Anyway, p-value is a result of a test, what's your test? - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/Permutation

Re: [R] choosing a random sample by precentage

2010-07-22 Thread Joshua Wiley
Hi Ethan, I should clarify that you do not *need* to make size an integer, so you technically do not need trunc(), but if you use trunc() or round(), you get to be in control of what you get. To answer your second question, look at this little function, it even lets you choose different percentag

Re: [R] Filtering in R

2010-07-22 Thread David Winsemius
On Jul 22, 2010, at 9:06 PM, stephen sefick wrote: Agian, Plead read the bottom of this email. Also, it looks like you should read An Introduction to R. It certainly does appear this poster needs to do both. On Thu, Jul 22, 2010 at 7:52 PM, jd6688 wrote: The dataframe is id sala

Re: [R] Filtering in R

2010-07-22 Thread Jorge Ivan Velez
?subset HTH, Jorge On Thu, Jul 22, 2010 at 8:52 PM, jd6688 <> wrote: > > The dataframe is > > id      salary > 100    500 > 101    600 > 102    700 > 103    800 > > how can i generate a subsets if salary>600? > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/Filtering-i

Re: [R] Filtering in R

2010-07-22 Thread stephen sefick
Agian, Plead read the bottom of this email. Also, it looks like you should read An Introduction to R. On Thu, Jul 22, 2010 at 7:52 PM, jd6688 wrote: > > The dataframe is > > id      salary > 100    500 > 101    600 > 102    700 > 103    800 > > how can i generate a subsets if salary>600? > > >

[R] Filtering in R

2010-07-22 Thread jd6688
The dataframe is id salary 100500 101600 102700 103800 how can i generate a subsets if salary>600? -- View this message in context: http://r.789695.n4.nabble.com/Filtering-in-R-tp2299603p2299603.html Sent from the R help mailing list arc

Re: [R] na.rm=TRUE

2010-07-22 Thread stephen sefick
make this reproducible! On Thu, Jul 22, 2010 at 7:40 PM, jd6688 wrote: > > POS=sum(x[-1][x[-1]>0],na.rm=TRUE) > is this the correct syntax? > -- > View this message in context: > http://r.789695.n4.nabble.com/na-rm-TRUE-tp2299596p2299596.html > Sent from the R help mailing list archive at Nabble

Re: [R] GLM Starting Values

2010-07-22 Thread Gabor Grothendieck
On Thu, Jul 22, 2010 at 4:56 PM, Tyler Williamson wrote: > Hello, > > Suppose one is interested in fitting a GLM with a log link to binomial data.   > How does R choose starting values for the estimation procedure?  Assuming I > don't supply them. > Assuming weights are not specified it uses thi

[R] na.rm=TRUE

2010-07-22 Thread jd6688
POS=sum(x[-1][x[-1]>0],na.rm=TRUE) is this the correct syntax? -- View this message in context: http://r.789695.n4.nabble.com/na-rm-TRUE-tp2299596p2299596.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing li

Re: [R] MISSING VALUE IN R

2010-07-22 Thread stephen sefick
sum() has a na.rm argument sum(x, na.rm=TRUE) On Thu, Jul 22, 2010 at 7:19 PM, jd6688 wrote: > > I have a DF > > ID   VALUE > 100  120 > 101  100 > 102  100 > 103 > 104 > 105 > > > when i calculate the sum of the values, it returned NA. should I populate > the blank value as 0? > > Thanks, >

[R] MISSING VALUE IN R

2010-07-22 Thread jd6688
I have a DF ID VALUE 100 120 101 100 102 100 103 104 105 when i calculate the sum of the values, it returned NA. should I populate the blank value as 0? Thanks, -- View this message in context: http://r.789695.n4.nabble.com/MISSING-VALUE-IN-R-tp2299586p2299586.html Sent from

Re: [R] Vintage Attrition Curves

2010-07-22 Thread Gabor Grothendieck
On Thu, Jul 22, 2010 at 7:45 PM, Kevin T. Ryan wrote: > Hi There - > > New to the list, so hopefully I don't mess this up too much ... I am > hoping maybe some of you can help me.  I have a problem I'm trying to > solve regarding customer accounts, attrition and forecasting. > Basically, here is w

Re: [R] , how to express bar(zeta) in main title in boxplot

2010-07-22 Thread Marcus Liu
It works well for the title command.  Thanks. t --- On Thu, 7/22/10, David Winsemius wrote: From: David Winsemius Subject: Re: [R] , how to express bar(zeta) in main title in boxplot To: "Peter Ehlers" Cc: "Marcus Liu" , r-help@r-project.org Date: Thursday, July 22, 2010, 1:40 PM On Jul 22,

Re: [R] Changing some values within a variable

2010-07-22 Thread Peter Alspach
Tena koe Toni Assume your data is in a data.frame called toniData (naming a data.frame data is not a good idea as data is a function in R - see ?data), and that Group is of class character (try str(toniData)) then: toniData[toniData$Group %in% 'A','Group'] <- 'C' will work. But from your mess

Re: [R] Changing some values within a variable

2010-07-22 Thread Jannis
Toni Pitcher schrieb: This works to some extent, all As have been changes to Cs, but the Bs have also been changed, in this case to "2", instead of remaining as their original values. How do I get the Bs to stay the same? You should consult some introductory tutorial dealing with Rs way of t

[R] Vintage Attrition Curves

2010-07-22 Thread Kevin T. Ryan
Hi There - New to the list, so hopefully I don't mess this up too much ... I am hoping maybe some of you can help me. I have a problem I'm trying to solve regarding customer accounts, attrition and forecasting. Basically, here is what I want to do (not sure of the best way): 1. Track accounts by

Re: [R] pagebreak in xtable and columns'width

2010-07-22 Thread Jannis
n.via...@libero.it schrieb: I would like to Know if somewhere in xtable I can put the command \pagebreak . There is an add.to.row argument in print.xtable, where you could add this command. You have to specify a line where to add this though. How about appending each printed xtable object

Re: [R] choosing a random sample by precentage

2010-07-22 Thread Joshua Wiley
On Thu, Jul 22, 2010 at 4:11 PM, jd6688 wrote: > > Hi Joshua: > > how to do a permutation test on the following sample with the sample size in > 2 : Take a look at some of the results from RSiteSearch("permutation test") the "coin" package also comes to mind Josh > > id        weight    

[R] Permutation test

2010-07-22 Thread jd6688
I have a sample in size of 2 rows, for instanse: idweightp value 100 125 101160 102 150 , how can I calculate the p value after the permutation and how the permutation test cab be done? Thanks, -- View this message in context: http://r.789695.n4.nabble.com/Permut

Re: [R] choosing a random sample by precentage

2010-07-22 Thread jd6688
Hi Joshua: how to do a permutation test on the following sample with the sample size in 2 : idweight P VALUE 100 100 101 200 102 200 103 150 ... Thanks -- View this message in context: http://r.789695.n4.nabble.com/choosing-a-random-sample-by-pr

Re: [R] choosing a random sample by precentage

2010-07-22 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Xebar Saram > Sent: Thursday, July 22, 2010 3:50 PM > To: r-help@r-project.org > Subject: [R] choosing a random sample by precentage > > hi all > > i have found the follwoing wa

Re: [R] choosing a random sample by precentage

2010-07-22 Thread Joshua Wiley
Hi Ethan, Sure with a bit of extra work: x <- matrix(1:109, ncol = 1) x[sample(nrow(x), trunc(nrow(x)*.1)), ] you could also use round() in place of trunc(), you just need something to get it to an integer. If you didn't like having to type the name several times you could make a simple functio

Re: [R] p-VALUE calculation

2010-07-22 Thread Bill.Venables
Is this the kind of thing you mean? > wData <- within(wData, { + z <- (weigth - mean(weigth))/sd(weigth) + "p-value" <- 2*pnorm(-abs(z)) ## 2-sided + rm(z) }) > wData employee_id weigth p-value 1 100150 0.3763641 2 101200 0.9081403 3 102300 0.1547139 4

Re: [R] p-VALUE calculation

2010-07-22 Thread Hadley Wickham
What is your null hypothesis? What is your alternate hypothesis? What is the test statistic? Why do you want a p-value? Hadley On Thu, Jul 22, 2010 at 5:40 PM, jd6688 wrote: > > Here is my dataframe with 1000 rows: > > employee_id         weigth       p-value > > 100                     150 > 1

Re: [R] function return

2010-07-22 Thread Daniel Hocking
Thank you so much! I think I had tried those two pieces separately and obviously had no success. I also typed panel3pt1.fn in the console without the () following it. On Jul 22, 2010, at 5:57 PM, David Winsemius wrote: On Jul 22, 2010, at 5:34 PM, David Winsemius wrote: On Jul 22, 2

[R] choosing a random sample by precentage

2010-07-22 Thread Xebar Saram
hi all i have found the follwoing way to choose a random sample by sample size (200): ten_per_T2000 <- F_T2000_All[sample(nrow(F_T2000_All), 200), ] but i wondered if there is a way to choose a sample size by precentage (10% etc..) thx ethan __ R-

Re: [R] prediction from a logistic mixed effects model

2010-07-22 Thread Ben Bolker
kdionisio gmail.com> writes: > > > Hi, > Is there any similar command to "predict" which can be used with a logistic > random effects model? Poke around on http://glmm.wikidot.com , let me know how you do. Ben Bolker __ R-help@r-project.org ma

[R] p-VALUE calculation

2010-07-22 Thread jd6688
Here is my dataframe with 1000 rows: employee_id weigth p-value 100 150 101 200 102 300 103 180 . My question: how can I calculate the p-value in R for each employee? the distributio

Re: [R] , how to express bar(zeta) in main title in boxplot

2010-07-22 Thread Peter Dalgaard
Peter Ehlers wrote: > On 2010-07-22 15:21, David Winsemius wrote: >> On Jul 22, 2010, at 5:01 PM, Peter Ehlers wrote: >> >>> On 2010-07-22 14:40, David Winsemius wrote: On Jul 22, 2010, at 4:24 PM, Peter Ehlers wrote: > On 2010-07-22 11:44, Marcus Liu wrote: >> Hi everyone, I am p

Re: [R] Question about a perceived irregularity in R syntax

2010-07-22 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Peter Dalgaard > Sent: Thursday, July 22, 2010 3:13 PM > To: Pat Schmitz > Cc: r-help@r-project.org > Subject: Re: [R] Question about a perceived irregularity in R syntax > > Pat

[R] Question regarding panel data diagnostic

2010-07-22 Thread amatoallah ouchen
Good day R-listers, I'm currently working on a panel data analysis (N=17, T=5), in order to check for the spurious regression problem, i have to  test for stationarity but i've read somewhere  that i needn't to test for it as  my T<10 , what do you think? if yes  is there any other test  i have to

Re: [R] Mathematical expression

2010-07-22 Thread Peter Dalgaard
Uwe Ligges wrote: > > On 22.07.2010 21:47, Filoche wrote: >> Hi everyone. >> >> I'm trying to display the r^2 of a linear regression on a plot using >> text(...). I first build the string to display. However, I can't find why >> this is not working (it display literally r^2 instead of r superscri

Re: [R] Question about a perceived irregularity in R syntax

2010-07-22 Thread Peter Dalgaard
Pat Schmitz wrote: > Both vector query's can select the values from the data.frame as written, > however in the first form assigning a value to said selected numbers fails. > Can you explain the reason this fails? > > dat <- data.frame(index = 1:10, Value = c(1:4, NA, 6, NA, 8:10)) > > dat$Value

Re: [R] , how to express bar(zeta) in main title in boxplot

2010-07-22 Thread Peter Ehlers
On 2010-07-22 15:21, David Winsemius wrote: On Jul 22, 2010, at 5:01 PM, Peter Ehlers wrote: On 2010-07-22 14:40, David Winsemius wrote: On Jul 22, 2010, at 4:24 PM, Peter Ehlers wrote: On 2010-07-22 11:44, Marcus Liu wrote: Hi everyone, I am plotting a boxplot with main title as main =

Re: [R] legend in R plot

2010-07-22 Thread Carl Witthoft
It occurs to me that Hannah may simply be plotting to a plot window that is overall too small. Try setting the plot window to full-screen (or close to that), and then running your plot & legend. Once the picture on the screen is the way you like it, save or copy (clipboard) to your format of

[R] Question about a perceived irregularity in R syntax

2010-07-22 Thread Pat Schmitz
Both vector query's can select the values from the data.frame as written, however in the first form assigning a value to said selected numbers fails. Can you explain the reason this fails? dat <- data.frame(index = 1:10, Value = c(1:4, NA, 6, NA, 8:10)) dat$Value[dat$Value == "NA"] <- 1 #Why doe

Re: [R] String processing - is there a better way

2010-07-22 Thread Hervé Pagès
Hi Brian, On 07/21/2010 10:02 AM, Davis, Brian wrote: [...] Part 2) My next step in the string processing is to take the characters in the output of CleanRead and subtract 33 from the ascii value of the character to obtain an integer. Again I have a solution that works, involving splitting the

Re: [R] function return

2010-07-22 Thread David Winsemius
On Jul 22, 2010, at 5:34 PM, David Winsemius wrote: On Jul 22, 2010, at 5:27 PM, Daniel Hocking wrote: I am sorry if this question is vague or uninformed. I am just learning R and struggling. I am using the book Hierarchical Modeling and Inference in Ecology and they provide examples of R

Re: [R] Hydrology plots in R

2010-07-22 Thread Jonathan Christensen
Sam, I recommend taking a look at the ggplot2 package. This page from the author's website contains an example of what I think you are trying to achieve: http://had.co.nz/ggplot2/geom_segment.html Obviously, this would require doing the whole plot in ggplot2, but that's not at all unpleasant. Th

[R] Changing some values within a variable

2010-07-22 Thread Toni Pitcher
Hi I'm new to R and would like some help with a couple of problems. I suspect the solutions are quite simple. I have a data.frame (data) with 40 variables and 5238 observations created from ~150 text files using read.table. I would like to change some of the entries within two different col

Re: [R] function return

2010-07-22 Thread David Winsemius
On Jul 22, 2010, at 5:27 PM, Daniel Hocking wrote: I am sorry if this question is vague or uninformed. I am just learning R and struggling. I am using the book Hierarchical Modeling and Inference in Ecology and they provide examples of R code. I have the following code from the book but when

[R] function return

2010-07-22 Thread Daniel Hocking
I am sorry if this question is vague or uninformed. I am just learning R and struggling. I am using the book Hierarchical Modeling and Inference in Ecology and they provide examples of R code. I have the following code from the book but when I run it I don't get any output. I cannot get

Re: [R] , how to express bar(zeta) in main title in boxplot

2010-07-22 Thread David Winsemius
On Jul 22, 2010, at 5:01 PM, Peter Ehlers wrote: On 2010-07-22 14:40, David Winsemius wrote: On Jul 22, 2010, at 4:24 PM, Peter Ehlers wrote: On 2010-07-22 11:44, Marcus Liu wrote: Hi everyone, I am plotting a boxplot with main title as main = bquote(paste(.(ts.ind[s]), ": ", bar(zeta), "

Re: [R] using "sample()" for a vector of length 1

2010-07-22 Thread Ted Harding
And, surely, regardless of R version: resamp <- function(x,...){if(length(x)==1) x else sample(x,...)} resamp((1:10),10) # [1] 8 2 10 6 5 4 3 7 9 1 resamp((1:10),1) # [1] 7 resamp((1:10),1) # [1] 4 resamp((1:10),1) # [1] 10 resamp(10,1) # [1] 10 resamp(10,1) # [

Re: [R] Sweave special characters problem

2010-07-22 Thread Bunny, lautloscrew.com
Thx everybody, finally I got it to go. I switched all three files (mysource.R, sweavetemplate.Rnw,invokeSweave.R) to UTF-8 encoding, switched the options() like suggested below and it just worked. On 22.07.2010, at 16:11, David Winsemius wrote: > > On Jul 22, 2010, at 9:39 AM, Bunny, lautlos

Re: [R] , how to express bar(zeta) in main title in boxplot

2010-07-22 Thread Peter Ehlers
On 2010-07-22 14:40, David Winsemius wrote: On Jul 22, 2010, at 4:24 PM, Peter Ehlers wrote: On 2010-07-22 11:44, Marcus Liu wrote: Hi everyone, I am plotting a boxplot with main title as main = bquote(paste(.(ts.ind[s]), ": ", bar(zeta), " Boxplot from 2001 to 2009", sep = "")) but it doesn'

[R] GLM Starting Values

2010-07-22 Thread Tyler Williamson
Hello, Suppose one is interested in fitting a GLM with a log link to binomial data. How does R choose starting values for the estimation procedure? Assuming I don't supply them. Thanks, Tyler __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Mathematical expression

2010-07-22 Thread Filoche
Hi. This is working fine. Thank you for your help. Best regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Mathematical-expression-tp2299253p2299364.html Sent from the R help mailing list archive at Nabble.com. __ R-help

Re: [R] using "sample()" for a vector of length 1

2010-07-22 Thread Jonathan
I see.. Thanks! On Thu, Jul 22, 2010 at 4:39 PM, Hadley Wickham wrote: > Did you look at the examples in sample? > > # sample()'s surprise -- example > x <- 1:10 >    sample(x[x >  8]) # length 2 >    sample(x[x >  9]) # oops -- length 10! >    sample(x[x > 10]) # length 0 > > ## For R >= 2.11.0

Re: [R] using "sample()" for a vector of length 1

2010-07-22 Thread Hadley Wickham
Did you look at the examples in sample? # sample()'s surprise -- example x <- 1:10 sample(x[x > 8]) # length 2 sample(x[x > 9]) # oops -- length 10! sample(x[x > 10]) # length 0 ## For R >= 2.11.0 only resample <- function(x, ...) x[sample.int(length(x), ...)] resample(x[x > 8]) #

Re: [R] , how to express bar(zeta) in main title in boxplot

2010-07-22 Thread David Winsemius
On Jul 22, 2010, at 4:24 PM, Peter Ehlers wrote: On 2010-07-22 11:44, Marcus Liu wrote: Hi everyone, I am plotting a boxplot with main title as main = bquote(paste(.(ts.ind[s]), ": ", bar(zeta), " Boxplot from 2001 to 2009", sep = "")) but it doesn't work. The program said they cannot fin

Re: [R] Mathematical expression

2010-07-22 Thread Uwe Ligges
On 22.07.2010 21:47, Filoche wrote: Hi everyone. I'm trying to display the r^2 of a linear regression on a plot using text(...). I first build the string to display. However, I can't find why this is not working (it display literally r^2 instead of r superscript 2). r2string = expression(pa

Re: [R] using "sample()" for a vector of length 1

2010-07-22 Thread Henrique Dallazuanna
Try this: x <- 10 sample(x, 1, prob = c(rep(0, x - 1), 1)) On Thu, Jul 22, 2010 at 5:31 PM, Jon BR wrote: > Hi All, >I'm trying to use the "sample" function within a loop where the > vector being sampled from (the first argument in the function) will > vary in length and composition. When

[R] using "sample()" for a vector of length 1

2010-07-22 Thread Jon BR
Hi All, I'm trying to use the "sample" function within a loop where the vector being sampled from (the first argument in the function) will vary in length and composition. When the vector is down in size to containing only one element, I run into the "undesired behaviour" acknowledged in the ?

[R] Mathematical expression

2010-07-22 Thread Filoche
Hi everyone. I'm trying to display the r^2 of a linear regression on a plot using text(...). I first build the string to display. However, I can't find why this is not working (it display literally r^2 instead of r superscript 2). r2string = expression(paste(r^2)," = ", r2); Any help would be

Re: [R] , how to express bar(zeta) in main title in boxplot

2010-07-22 Thread Peter Ehlers
On 2010-07-22 11:44, Marcus Liu wrote: Hi everyone, I am plotting a boxplot with main title as main = bquote(paste(.(ts.ind[s]), ": ", bar(zeta), " Boxplot from 2001 to 2009", sep = "")) but it doesn't work. The program said they cannot find the function "bar". Does anyone know how to do it c

Re: [R] Sweave special characters problem

2010-07-22 Thread Bunny, lautloscrew.com
Dear all, i think I am a step further with the issue. I am pretty sure now, that it is not a Sweave problem. It's indeed an encoding problem with my Mac. If i source the file without any sweave source("myRcode.R") I already get an error message, despite the fact that the code is correct. If

Re: [R] Hurst Exponent Estimation

2010-07-22 Thread Hans W Borchers
Spencer Graves structuremonitoring.com> writes: > > Have you tried something like the following: > > library(sos) > H <- ???Hurst > summary(H) > H > >This identified 50 links in 15 packages, and displayed the > results in a table in a web browser with links to the best match in the

[R] gam() and contrast

2010-07-22 Thread Xia Li
Dear All, I met problems when doing contrast and now really need some help in the model below: Fit=gam(y~treat+SEQUENCE+PERIOD+SEX+s(x),data=dat, random=list(SUBJID=~1),correlation=corAR1(form=~1|SUBJID)) And error message keeps coming out when I want to compare the differences between treatments

Re: [R] Bar Plot Bars "Bleed" off Plotting Area

2010-07-22 Thread David Winsemius
On Jul 22, 2010, at 2:13 PM, Gregory Gilbert wrote: R Community, I have a stupid little barplot I am trying to construct (Windows XP, R.11.1, 32-bit). Whenever I run it my bars run below the horizontal axis. Can anyone (1) reproduce this and (2) offer a solution? I'm not sure I should b

Re: [R] How to fix slope and estimate intercept

2010-07-22 Thread Jun Shen
Hi, Bill, Thanks. This is what I am looking for. Jun On Thu, Jul 22, 2010 at 1:54 PM, William Dunlap wrote: >> -Original Message- >> From: r-help-boun...@r-project.org >> [mailto:r-help-boun...@r-project.org] On Behalf Of Jun Shen >> Sent: Thursday, July 22, 2010 10:30 AM >> To: R-help

[R] , how to express bar(zeta) in main title in boxplot

2010-07-22 Thread Marcus Liu
Hi everyone, I am plotting a boxplot with main title as main = bquote(paste(.(ts.ind[s]), ": ", bar(zeta), " Boxplot from 2001 to 2009", sep = "")) but it doesn't work.  The program said they cannot find the function "bar".  Does anyone know how to do it correctly?  Thanks. tin

Re: [R] post hoc test for lme using glht ?

2010-07-22 Thread SNAFU1
Thanks, that seems to have cleared it up. (I did cut and paste from the console - I didn't think most of what I tried was very going to be very helpful and didn't want to drown people in spurious info. Sorry for the mistakes) -- View this message in context: http://r.789695.n4.nabble.com/post

Re: [R] How do I get rid of list elements where the value is NULL before applying rbind?

2010-07-22 Thread jim holtman
Here is a function I use to return the non-NULL elements of a list: delete.NULLs <- function (x.list) { x.list[unlist(lapply(x.list, length) != 0)] } On Thu, Jul 22, 2010 at 2:22 PM, Ted Byers wrote: > Here is the function that makes the data.frames in the list: > > funweek <- function(d

Re: [R] Updating a Data Frame

2010-07-22 Thread Nikhil Kaza
Looks like your event id is unique. If that is so, why not just do ##Not checked events <- events[sort(events$event),] dataF <- dataF[sort(data$event),] if(doUpdate == 1){ if(!is.null(dataF) && nrow(dataF) > 0){ events[events$eventid %in% dataF$event, c("timestamp", "isSynchronized","ti

[R] How do I get rid of list elements where the value is NULL before applying rbind?

2010-07-22 Thread Ted Byers
Here is the function that makes the data.frames in the list: funweek <- function(df) if (length(df$elapsed_time) > 5) { res = fitdist(df$elapsed_time,"exp") year = df$sale_year[1] sample = df$sale_week[1] mid = df$m_id[1] estimate = res$estimate sd = res$sd samplesize

[R] Bar Plot Bars "Bleed" off Plotting Area

2010-07-22 Thread Gregory Gilbert
R Community, I have a stupid little barplot I am trying to construct (Windows XP, R.11.1, 32-bit). Whenever I run it my bars run below the horizontal axis. Can anyone (1) reproduce this and (2) offer a solution? Rather simplistic code follows (I am new to the community)> Thanks for your help! Gre

[R] snow: hierarchical parallelization

2010-07-22 Thread Peter Danenberg
I'm parallelizing some computation on hierarchical data, and would find it natural to do something like this (where a call to parLapply is embedded in outer call to parLapply): cl <- makeCluster(rep.int('localhost', 5), type='SOCK') clusterExport(cl, 'cl') parLapply(cl,

[R] Updating a Data Frame

2010-07-22 Thread harsh yadav
Hi, I have a global data-frame in my R script. At some point in my script, I want to update certain columns of this data-frame by calling in an update function. The function looks like this: # get events data. This populates a global event data frame in the R-script events <- getEvents(con, ev

[R] sweep / mapply question

2010-07-22 Thread Claudia Beleites
Dear list, I have a matrix, spc, that should row-wise be interpolated: E.g. spc <- matrix (1:1e6, ncol = 250, nrow = 4000, byrow = TRUE) spc [1:10, 1:10] shifts <- seq_len (nrow (spc)) wl <- seq_len (ncol (spc)) interpolate <- function (spc.row, shift, wl) spline (wl + shift, spc.row, xout =

Re: [R] How to fix slope and estimate intercept

2010-07-22 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Jun Shen > Sent: Thursday, July 22, 2010 10:30 AM > To: R-help > Subject: [R] How to fix slope and estimate intercept > > Dear all, > > Is there anyway I can fix slope in some v

Re: [R] t.test in for loop

2010-07-22 Thread Peter Ehlers
On 2010-07-22 11:28, Arne Schulz wrote: Dear list, I'd like to do several t-test within a for loop. Example follows: data1<- rnorm(1:25) data2<- rnorm(1:25) vars<- c("data1", "data2") for (i in vars) { t.test(i) } Unfortunately, it does not work because of the quotes in the vars

Re: [R] newton method

2010-07-22 Thread Berend Hasselman
saminny wrote: > > Is there a non animation version of newton.method > (http://bm2.genes.nig.ac.jp/RGM2/R_current/library/animation/man/newton.method.html) > for finding roots of a function? It should find the roots without showing > it on the GUI. > Have a look at package nleqslv /Berend --

Re: [R] t.test in for loop

2010-07-22 Thread Henrique Dallazuanna
Try this: apply(Vectorize(get)(ls(patt = 'data')), 2, t.test) On Thu, Jul 22, 2010 at 2:28 PM, Arne Schulz < arne.sch...@student.uni-kassel.de> wrote: > Dear list, > I'd like to do several t-test within a for loop. Example follows: > > data1 <- rnorm(1:25) > data2 <- rnorm(1:25) > vars <- c("da

Re: [R] t.test in for loop

2010-07-22 Thread David Winsemius
On Jul 22, 2010, at 1:28 PM, Arne Schulz wrote: Dear list, I'd like to do several t-test within a for loop. Example follows: data1 <- rnorm(1:25) data2 <- rnorm(1:25) vars <- c("data1", "data2") for (i in vars) { t.test(i) } Unfortunately, it does not work because of the quote

[R] does package "QuantPsych" function lm.beta can handle results of a regression with weights?

2010-07-22 Thread Dimitri Liakhovitski
Hello, and sorry for not providing an example. I run a regular linear regression (using lm) and use weights with it (weights = ...). I use "QuantPsych" package, its function lm.beta to extract standardized regression weights from my lm regression object. When I don't use weights, everything is fin

[R] How to fix slope and estimate intercept

2010-07-22 Thread Jun Shen
Dear all, Is there anyway I can fix slope in some value and only estimate intercept for a linear regression? I understand lm(y~1, data) will NOT have a slope at all. This is not what I want. Thanks. Jun __ R-help@r-project.org mailing list https://stat

[R] t.test in for loop

2010-07-22 Thread Arne Schulz
Dear list, I'd like to do several t-test within a for loop. Example follows: data1 <- rnorm(1:25) data2 <- rnorm(1:25) vars <- c("data1", "data2") for (i in vars) { t.test(i) } Unfortunately, it does not work because of the quotes in the vars-vector (running t.test(data1) by hand

Re: [R] lme4 on Mac OS X

2010-07-22 Thread David Winsemius
On Jul 22, 2010, at 11:34 AM, Nicholas Griffin wrote: I have been trying to get the lme4 package installed on Mac OS X... with no success. The Mac OS binary is not available on any CRAN, and I also can’t install the package from old source. Has anyone found a solution to this problem? I

[R] 64 bit use of odbcConnectExcel

2010-07-22 Thread Jack T.
Hi All, I'm using R 2.11.1 on 64 bit windows XP. The little function I wrote below I use often to import the first 1001 lines in an excel sheet to R. This works fine on the 32 bit version of R but fails on the 64 bit [both on the same machine, using the same function, importing the same .xls f

[R] lme4 on Mac OS X

2010-07-22 Thread Nicholas Griffin
I have been trying to get the lme4 package installed on Mac OS X... with no success. The Mac OS binary is not available on any CRAN, and I also can¹t install the package from old source. Has anyone found a solution to this problem? I am happy to use nlme for now, but I tend to prefer to do my mi

Re: [R] send out put to file in R

2010-07-22 Thread chakri_amateur
[...] > compo[[ which.max(sapply(compo, vcount)) ]] That's better command for obtaining Largest Component Sometimes, I get this error while reading pajek file. Does anybody know what this error message means ? g <- read.graph ("F://data/pfu_raw.net", "pajek") Error in read.graph.pajek(file, ..

[R] Please advise acf and pacf in order to determine order of Arima

2010-07-22 Thread Research student
I have data as below.Please let me know how the ACF and Pacf used to determine the order od arima model. Is there any rules need to be followed to determine order.Please advise > turkey.price.ts Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 2001 1.58 1.75 1.63 1.45 1.56 2.07

Re: [R] how to force a table to be square?

2010-07-22 Thread Peter Ehlers
On 2010-07-22 10:43, Wu Gong wrote: Hi William, I'm curious about that you used d[]<- lapply(d, factor... Could you please tell me if there are any differences between d[] and d? Thank you. Why not try it both ways and inspect the result. d[] <- d <- Obvious? -Peter Ehlers

Re: [R] how to force a table to be square?

2010-07-22 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Wu Gong > Sent: Thursday, July 22, 2010 9:44 AM > To: r-help@r-project.org > Subject: Re: [R] how to force a table to be square? > > > Hi William, > > I'm curious about that yo

Re: [R] how to force a table to be square?

2010-07-22 Thread Wu Gong
Hi William, I'm curious about that you used d[] <- lapply(d, factor... Could you please tell me if there are any differences between d[] and d? Thank you. - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/how-to-force-a-table-to-be-square-tp2298707p2298965.html

[R] decision tree with weighted inputs

2010-07-22 Thread David Shin
I'd like to train a decision tree on a set of weighted data points. I looked into the rpart package, which builds trees but doesn't seem to offer the capability of weighting inputs. (There is a weights parameter, but it seems to correspond to output classes rather than to input points). I'm m

Re: [R] SQL/R

2010-07-22 Thread Brian Diggs
On 7/22/2010 5:01 AM, Allan Engelhardt wrote: There are so many ways Here is one: aggregate(v ~ u, data=X, function(...) length(unique(...))) # u v # 1 T1 2 # 2 T2 1 Hope this helps Here is one other way, using the plyr package (which is very good for taking a data structure (data.frame

Re: [R] how to force a table to be square?

2010-07-22 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Liat > Sent: Thursday, July 22, 2010 8:41 AM > To: r-help@r-project.org > Subject: Re: [R] how to force a table to be square? > > > Thanks Peter! > that worked, and was so easy.

[R] pagebreak in xtable and columns'width

2010-07-22 Thread n.via...@libero.it
Dear list, I'm using the Sweave function in order to get some report. Here one chunk: <>= report<-lapply(repor, function(x) { (print(xtable(data.frame(x[1:2,]), align="|l|rrr|"),floating=FALSE,tabular. environment="longtable",include.colnames=FALSE,size="\\small")) (print(xtable(data.frame(x[3:nro

Re: [R] how to force a table to be square?

2010-07-22 Thread Liat
Thank you!!! -- View this message in context: http://r.789695.n4.nabble.com/how-to-force-a-table-to-be-square-tp2298707p2298876.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mai

Re: [R] how to force a table to be square?

2010-07-22 Thread Liat
Thanks Peter! that worked, and was so easy. LOL. I tried playing with factor and levels before I wrote here, but obviously I didn't do it right. Thanks again, Liat. -- View this message in context: http://r.789695.n4.nabble.com/how-to-force-a-table-to-be-square-tp2298707p2298875.html Sent from t

Re: [R] how to force a table to be square?

2010-07-22 Thread Wu Gong
Hi, try ?levels myData <- matrix(sample(c(LETTERS[1:10],NA),100,replace=T),nrow=25) table(factor(as.vector(myData),levels=LETTERS[1:26]),useNA="ifany") - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/how-to-force-a-table-to-be-square-tp2298707p2298833.html Se

[R] tracking changes

2010-07-22 Thread Albert-Jan Roskam
Hi,   I am trying to write some code that tracks changes that may have been made after a dataframe has been edited using fix(). But if I edit only the first cell (row 1, col 1) of the dataset below, it is like many records were edited. What is the explanation for this error?   require(R.util

Re: [R] how to force a table to be square?

2010-07-22 Thread peter dalgaard
On Jul 22, 2010, at 4:00 PM, Liat wrote: > > Hi guys, > I hope you can help me with this. > Here is the problem: > I have some data (myData) that looks similar to this: > > [,1] [,2] [,3] [,4] > [1,] "A" "A" "B" "B" > [2,] "B" "B" "B" "B" > [3,] "C" "C" "C" "C" > > When I build

  1   2   >