[R] removing blanks from a string

2008-06-27 Thread juli pausas
Hi Is there a way to remove blank characters from the end of strings in a vector? Something like the =TRIM functions of the OpenOffice spreadsheet. E.g., a <- c("hola", "Yes ", "hello ")# I'd like to get: c("hola", "Yes", "hello") Thanks Juli -- http://www.ceam.es/pausas

[R] write.table a df with specific column order

2008-06-26 Thread juli pausas
Hi I'd like to write.table a dataframe, but with an specific order of columns. Is there a direct way to do it? or I have to generate a new dataframe as follows: t <- data.frame(c=1:10, b=11:20, a=letters[1:10]) t2 <- data.frame(a=t$a, b=t$b, c=t$c) write.table(t2, row.names=F) Thanks for any com

[R] envelope line from a cloud of points

2008-05-05 Thread juli pausas
Hi, Is there a way in R to plot an envelope line from a cloud of points (x, y data) ? That is, a smooth line that include all points, where the points do not follow a strait linear pattern. Could somebody redirect me to some package or function for this? Thanks in advance. Juli -- http://www.cea

Re: [R] glm binomial with no successes

2008-02-27 Thread juli pausas
drop1(glm(sf ~ tr, family="binomial", subset=(tr %in% c("1", "3"))), test="Chisq") # significant, as expected Is this the correct approach? Many thanks Juli On Wed, Feb 27, 2008 at 12:13 PM, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > On Wed, 27 Feb

[R] glm binomial with no successes

2008-02-27 Thread juli pausas
Dear all, I have a question on glm, family binomial. I do not see significant differences between the levels of a factor (treatment) if all data for a level is 0; and replacing a 0 for a 1 (in fact reducing the difference), then I detect the significant difference that I expected. Is there a way to

[R] reshape

2008-02-10 Thread juli pausas
the tr variable in different columns (as a timevar) with their value (val). sp code tr.A tr.B tr.C aa1 31NANA aa2 NA32NA aa2 NA33NA** aa3 NANA34 ba3 3536NA ba4 NANA37 ca4 38 NA NA d

[R] repeated measures - aov, lme, lmer - help

2007-10-14 Thread juli pausas
Dear all, I'm not very sure on the use of repeated measures in R, so some advice would be very appreciate. Here is a simple example similar to my real problem (R 2.6.0 for windows): Lets supose I have annual tree production measured in 9 trees during 3 years; the 9 trees are located in 3 different

[R] reshape help

2007-09-12 Thread juli pausas
Hi, I'm trying to use reshape but I cannot quite understand how it works. Could somebody help me on this? Example, my data is something like: mydat <- data.frame(tree= 1:10, serra=rep(1:2, c(5,5)), bt01= 101:110, bt02= 201:210, bt03= 301:310, mm01= 9101:9110, mm02= 9201:9210, mm03= 9301:9310) >