Re: [R] for loop with multiple conditions in R (e.g. for(i in x j in y)

2014-02-22 Thread arun
Hi, May be this helps: res.i - NULL  for(i in seq_along(x)){ res.i - c(res.i,x[i]-y[i])} #or using your nested loop: res.ij - NULL  for(i in seq_along(x)){  for(j in seq_along(y)){  if(i==j){  res.ij - c(res.ij,x[i]-y[j])  }  }} identical(x-y,res.i) #[1] TRUE identical(res.i,res.ij) #[1] TRUE

[R] Help: Split-Split model nested in a nested structure

2014-02-22 Thread Zia Ahmed
Dear list members. We are trying see effect of N on yield of three wheat genotypes under late and early planting conditions in saline and non-saline environments. Our experimental structure as follows: Districts (2: DIST01 and DIST02) - Not randomly selected ENV (Saline and Non-Saline) - One

Re: [R] shapiro.test

2014-02-22 Thread Rui Barradas
Hello, Inline Em 21-02-2014 23:13, Rolf Turner escreveu: On 22/02/14 11:04, Rui Barradas wrote: Hello, Not answering directly to your question, if the sample size is a documented problem with shapiro.test and you want a normality test, why don't you use ?ks.test? m - mean(HP_TrinityK25$V2)

Re: [R] shapiro.test

2014-02-22 Thread Rui Barradas
Second. Rui Barradas Em 21-02-2014 23:44, Rolf Turner escreveu: On 22/02/14 11:53, Greg Snow wrote: SNIP Why are you testing your data for normality? For large sample sizes the normality tests often give a meaningful answer to a meaningless question (for small samples they give a

[R] Math symbols in ggplot facets

2014-02-22 Thread Lars Bishop
Hello, I would like to show in my facet labels the equivalent in LaTex of $\sigma_{0}= \sqrt{2}$. I think I'm close below, but not yet as it shows $(\sigma_{0}, \sqrt{2})$ m - mpg levels(m$drv) - c(sigma[0]=sqrt(2), sigma[0]=2 * sqrt(2), sigma[0]= 3 * sqrt(2)) ggplot(m, aes(x = displ, y = cty))

Re: [R] dependent column(s) in data frame

2014-02-22 Thread PQuery
Many thanks David, I will have a look on logistic regression for my case. Do you know about a good example regarding logistic regression ? I was thinking also of using Multiple Factor Analysis too (MFA - like in FactoMineR). However I am not sure how successful this is going to be. Best, P.

[R] Exposures in bernoulli glm()

2014-02-22 Thread Marco Inacio
Hi, is it possible to add exposures to a glm with family=binomial()? It's easy to do it for a Poisson/negative binomial: just multiply the mean by the exposure, that is, offset(log(exposure)): but this obviously wrong for a binomial/Bernoulli since the mean must be no bigger than 1. My goal

[R] Learn R in a Day - new ebook

2014-02-22 Thread Steve Murray
Dear all, I'd like to make you aware of my new ebook - Learn R in a Day - which provides the reader with key programming skills through an examples-oriented approach and is ideally suited for academics, scientists, mathematicians and engineers. Amazon.com:

[R] Hi everybody, your help would be very appreciate, thanks !

2014-02-22 Thread varin sacha
Hi everybody, I have realized a multiple linear regression.  To know how well my model does in terms of prediction, I can compute prediction intervals bands and decide if they are narrow enough to be of use. If they are too wide, then they probably are not useful. Using R, I have written these

[R] hist: argument '...' is not made use of

2014-02-22 Thread Jennifer Lyon
Hi: When converting some code to use plot = F in a call to hist(), I received the following warning (with a much simplified example). moo-1:10 hist(moo, las=1, plot=F) Warning message: In hist.default(moo, las = 1, plot = F) : argument '...' is not made use of From the help page, I was able to

[R] create video?

2014-02-22 Thread Spencer Graves
Hello: Might someone have experience with video production? The animation package in R can produce video clips. These could presumably be merged and synced with audio using something like Avidemux. I have not done this, but it looks like it might be a relatively easy way for an R

Re: [R] how to plot a logarithmic regression line

2014-02-22 Thread arun
HI, Try ?curve fit - lm(Mean_Percent_of_Range~log(No.ofPoints))  coef(fit)  #    (Intercept) log(No.ofPoints)   #     -74.52645 46.14392  plot(Mean_Percent_of_Range ~ No.ofPoints) curve(coef(fit)[[1]]+coef(fit)[[2]]*log(x),add=TRUE,col=2) A.K. I realize this is a stupid

Re: [R] dependent column(s) in data frame

2014-02-22 Thread David Winsemius
On Feb 22, 2014, at 4:28 AM, PQuery wrote: Many thanks David, I will have a look on logistic regression for my case. Do you know about a good example regarding logistic regression ? I was thinking also of using Multiple Factor Analysis too (MFA - like in FactoMineR). However I am not sure

Re: [R] how to plot a logarithmic regression line

2014-02-22 Thread David Winsemius
On Feb 22, 2014, at 1:06 PM, arun wrote: HI, Try ?curve fit - lm(Mean_Percent_of_Range~log(No.ofPoints)) coef(fit) #(Intercept) log(No.ofPoints) # -74.52645 46.14392 plot(Mean_Percent_of_Range ~ No.ofPoints)

Re: [R] Math symbols in ggplot facets

2014-02-22 Thread Dennis Murphy
Hi: You were close... library(ggplot2) m - mpg # Set the factor labels with plotmath code (note the ==) m$drv - factor(m$drv, labels = c(sigma[0] == sqrt(2), sigma[0] == 2 * sqrt(2), sigma[0] == 3 * sqrt(2))) ggplot(m, aes(x =

[R] equivalent of $\check Y$ in plotmath

2014-02-22 Thread Ranjan Maitra
Hi, I am trying to put the expression which in LaTeX would be $\check Y$ as a label on the axis of a plot. How does one get the \check part of the above to produce a similar symbol in plotmath in R? I looked around plotmath's help but could not see this in the documentation. Many thanks for

[R] seeking alternative method to copy a large section of my R program

2014-02-22 Thread Julie Royster
Is there any way I can insert markers at the beginning and end of a large section of R statements and then copy all text in between to clipboard? I have trouble scrolling to select long sections, so if there is another way I would like to know it! Julie (for husband Larry) [[alternative

Re: [R] seeking alternative method to copy a large section of my R program

2014-02-22 Thread Jeff Newmiller
This is a function of the editor you use and the operating system you use, neither of which is on topic here. That said, many popular GUI editors allow you to select by holding the shift key down while moving the cursor with arrow keys. Note that in the long run using the source function to

Re: [R] seeking alternative method to copy a large section of my R program

2014-02-22 Thread David Winsemius
On Feb 22, 2014, at 1:57 PM, Julie Royster wrote: Is there any way I can insert markers at the beginning and end of a large section of R statements and then copy all text in between to clipboard? I have trouble scrolling to select long sections, so if there is another way I would like to