Re: [R] multiple groups anova

2014-06-12 Thread Olivier Crouzet
Hi Stanley, You need to convert your dataframe (it's'not a matrix obviously) to a "long format". Each measurement will then be a single line within this "table". Each column will then be viewed as a single statistical variable. Then you will learn to apply relevant anovas on such data. Essenti

Re: [R] Trellis devices and pointize

2014-06-12 Thread Patrick Connolly
On Mon, 09-Jun-2014 at 08:33AM +0100, Prof Brian Ripley wrote: |> The issue here is not trellis.device. |> |> You are using lattice plots (without mentioning lattice), which are |> based on package 'grid' and so using the grid sub-system of a |> device. That sub-system does not use the 'pointsize

Re: [R] Standard Deviation in R

2014-06-12 Thread S Ellison
> > The formula I generally use to compute the standard deviation is the > square root of the variance where the variance is E(X^2) - (E(x))^2. Even if that is what you want, I hope you don't _implement_ it that way (eg as mean(x^2)-mean(x)^2. _Serious_ numerical rounding issues... #Example:

[R] help in writing an R-function for Residual correlated structures

2014-06-12 Thread Laz
Hi R users, I need to write a function that considers the row and column autoregressive residual correlation structures. Usually R=sigma^2_e*Identity matrix of order n, where n is the number of observations and sigma^2_e is the usual residual error. I have to consider an AR1 * AR1 where * stan

[R] How to print something in the same location in console?

2014-06-12 Thread Juan Andres Hernandez
Hi I need to print the iteration number of a procedure but in the same location in console. Using cat with or without fill argument does not produce the desired outcome. Does anybody know how to get it?. for(i in 1:10) cat('Iteration:',i,fill=T) Thank's in advance Juan A. Hernandez [[alt

Re: [R] How to print something in the same location in console?

2014-06-12 Thread Jorge I Velez
Dear Juan, Perhaps the last example in http://stat.ethz.ch/R-manual/R-devel/library/utils/html/txtProgressBar.html is what you are looking for. Best, Jorge.- On Thu, Jun 12, 2014 at 8:49 PM, Juan Andres Hernandez < jhernandezcabr...@gmail.com> wrote: > Hi I need to print the iteration number o

Re: [R] help in writing an R-function for Residual correlated structures

2014-06-12 Thread ONKELINX, Thierry
R works faster if you can avoid loops the loops. There is an example. Note that it required global variables (like your function). You better avoid that. rspat <- function(rhox, rhoy, s2e = 1){ require(matlab) R <- s2e * eye(N) i <- rep(seq_len(N), each = N) j <- rep(seq_len(N), N) j <-

Re: [R] Average value in a particular range of a matrix

2014-06-12 Thread John Kane
?mean You need to read tutorial or two, particularly with reference to indexing. The CRAN site has any number of useful papers and books that you can download. John Kane Kingston ON Canada > -Original Message- > From: leonardsqual...@hotmail.com > Sent: Wed, 11 Jun 2014 12:17:02 +

[R] Add points to subplots

2014-06-12 Thread Luca Cerone
Dear all, I am running some analysis using the pamr package (available on CRAN). One of the plots I produce is made using the function "pamr.plotcv". This displays two plots in the same figure (using par(mfrow=c(2,1)). When the figure is created, I would like to be able to add some points and lin

[R] Block Recursion and Structural Vector Autoregressions

2014-06-12 Thread Jim Silverton
Hi, I am trying to get the code for paper entitled "Block recursion and structural vector autoregressions by Tao Zha. Anyone has any R packages. I googled but I did not come up with anything of interest. Any help is greatly appreciated. -- Thanks, Jim. [[alternative HTML version deleted]]

[R] Vegan pca and cor

2014-06-12 Thread Sibylle Stöckli
Dear R colleagues, I applied a pca to 130 farms (sites) and 25 variables (species) using the R package vegan. Besides analyzing the variation explained by the different pca axes and the variables the pca axis are correlated with, I am also interested to analyze the correlation between the varia

[R] help with apply and nleqslv

2014-06-12 Thread Andras Farkas
Dear All, please provide insights into the following problem; this part is the reproducible example: library(nleqslv) S1 <-0.5 S2 <-0.5 Z <-7.2598 M1 <--5.7831 M2 <-24.597 mk501 <-1.2827 mk502 <-4.7964 AL <--0.5623  f <- function(H1){   1 - (S1/(mk501*((H1/(Z-H1))^(1/M1)))+S2/(mk502*((H1/(Z-

Re: [R] Error clmm(){ordinal}

2014-06-12 Thread adesgroux
Dear all, I want now to class my lines (Line) regarding to the model ceated with drop1() I installes packages lsmeans, multcompView, ordinal and RVAideMemoire which permit together to analyse data from clmm model. I ran the following script and had an error. I could find nothing about it on the

[R] Experiment Design

2014-06-12 Thread Chatcher
Good Morning, I would like help with code that creates a RBD experiment. That is I have 18 treatments and I will need three blocks. I cannot seem to find an easy way to do this in R. I think it is a relatively easy thing to do but i tried Agricolae and seem to be getting so "lost" I cannot even get

Re: [R] Average value in a particular range of a matrix

2014-06-12 Thread arun
Hi, Try: set.seed(45) mat1 <- matrix(rnorm(500), ncol=1)  n <- dim(mat1)[1] indx <- as.numeric(gl(n,100,n))  tapply(mat1[,1], indx, FUN= mean, na.rm=TRUE) #  1   2   3   4   5 # 0.08118335 -0.05222418 -0.20042223 -0.03530833 -0.06093053 If you have more t

Re: [R] Average value in a particular range of a matrix

2014-06-12 Thread Pat-74100
Hi @Rolf Turner: So you're wrong, I can guaranty you this is not homework ... but just for a graph I'm trying do plot. @Arun: Yes I've done a mistake, it is 1-100 , 101-200 etc .. or even 1-50,51-100 etc. The range is not important. Thanks > Date: Thu, 12 Jun 2014 02:04:26 -0700 > From: sma

Re: [R] How to print something in the same location in console?

2014-06-12 Thread jim holtman
Here is one way by using 'cat' and doing a 'return' before writing: # writing in same location for (i in 1:3){ cat("\r", format(Sys.time())) flush.console() Sys.sleep(1) } Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, no

[R] Using reduce to merge multiple files

2014-06-12 Thread Kate Ignatius
I have a list of files that I have called like so: main_dir <- '/path/to/files/' directories <- list.files(main_dir, pattern = '[[:alnum:]]', full.names=T) filenames <- list.files(file.path(directories,"/tmpdir/"), pattern = '[[:alnum:][:punct:]]_eat.txt+$', recursive = TRUE, full.names=T) This

Re: [R] Experiment Design

2014-06-12 Thread Sarah Goslee
Sorry, try this again. Does this help: http://www2.warwick.ac.uk/fac/sci/moac/degrees/moac/ch923/lectures/moac_-_designing_experiments_in_r.pdf If not, we need some more specifics about what you've tried and where you are running into problems. Sarah On Thu, Jun 12, 2014 at 11:34 AM, Chatcher

[R] Rscript fails where Rterm works

2014-06-12 Thread Bond, Stephen
I have a script which loads library(XLConnect) wb <- loadWorkbook("wbname") the code works without errors when run from ESS which uses R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i386-w64-mingw32/i386 (32-bit) But fails whe

Re: [R] Rscript fails where Rterm works

2014-06-12 Thread Jeff Newmiller
You seem to be using different versions of R for these two trials. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

Re: [R] Rscript fails where Rterm works

2014-06-12 Thread Hadley Wickham
Explicitly load the methods package: library(methods) Hadley On Thu, Jun 12, 2014 at 2:22 PM, Bond, Stephen wrote: > I have a script which loads > > library(XLConnect) > wb <- loadWorkbook("wbname") > > the code works without errors when run from ESS which uses > R version 3.0.1 (2013-05-16) --

Re: [R] Using reduce to merge multiple files

2014-06-12 Thread Henrik Bengtsson
On Thu, Jun 12, 2014 at 10:16 AM, Kate Ignatius wrote: > I have a list of files that I have called like so: > > main_dir <- '/path/to/files/' > directories <- list.files(main_dir, pattern = '[[:alnum:]]', full.names=T) > > filenames <- list.files(file.path(directories,"/tmpdir/"), pattern = > '[[

Re: [R] Average value in a particular range of a matrix

2014-06-12 Thread David Winsemius
On Jun 12, 2014, at 5:11 AM, Pat-74100 wrote: > > Hi > > @Rolf Turner: So you're wrong, I can guaranty you this is not homework ... > but just for a graph I'm trying do plot. > > @Arun: Yes I've done a mistake, it is 1-100 , 101-200 etc .. or even > 1-50,51-100 etc. The range is not importan

Re: [R] Add points to subplots

2014-06-12 Thread David Winsemius
On Jun 12, 2014, at 8:06 AM, Luca Cerone wrote: > Dear all, > I am running some analysis using the pamr package (available on CRAN). > > One of the plots I produce is made using the function "pamr.plotcv". > This displays two plots in the same figure (using par(mfrow=c(2,1)). > > When the figur