Re: [R] Basic misunderstanding, or problem with my installation?

2014-01-01 Thread David Parkhurst
Thanks to the three people who saw what I missed. I typed my code in Libre Office as followed by -, and that program converted those two characters into a single left arrow symbol. I copied the commands from Libre into R without noticing that that had happened. Wierd. On 12/31/2013 7:54 PM,

Re: [R] Basic misunderstanding, or problem with my installation?

2014-01-01 Thread Barry Rowlingson
On Wed, Jan 1, 2014 at 4:36 AM, David Parkhurst parkh...@imap.iu.edu wrote: Thanks to the three people who saw what I missed. I typed my code in Libre Office as followed by -, and that program converted those two characters into a single left arrow symbol. I copied the commands from Libre

Re: [R] howto join matrices produced by rcorr()

2014-01-01 Thread Frank Harrell
This is an unstable process. I suggest using the bootstrap to get a confidence interval for the rank of each correlation coefficient among all non-diagonal correlations. - Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context:

[R] expression in xlab for a plot

2014-01-01 Thread Andras Farkas
Dear All, Happy new year! wonder if you could help with the following: we have: hist(runif(1000,0,100),xlab=expression(AUC[0 - 24]~ (xyz)),ylab=Frequency) the plan is to have part of the xlab expression change dynamically, specifically the values of 0 and 24 should be able to update

Re: [R] expression in xlab for a plot

2014-01-01 Thread arun
Hi,May be this helps:   hist(runif(1000,0,100),xlab=bquote(AUC[.(low) - .(high)]~ (xyz)),ylab=Frequency) A.K. On Wednesday, January 1, 2014 10:30 AM, Andras Farkas motyoc...@yahoo.com wrote: Dear All, Happy new year! wonder if you could help with the following: we have:

Re: [R] expression in xlab for a plot

2014-01-01 Thread arun
HI, Another way would be to use ?substitute() hist(runif(1000,0,100),xlab=substitute(expression(AUC[low - high]~ (xyz)),list(low=low,high=high)),ylab=Frequency) A.K. On Wednesday, January 1, 2014 10:36 AM, arun smartpink...@yahoo.com wrote: Hi,May be this helps:  

[R] mgcv - markeov random field option

2014-01-01 Thread Helena Baptista
Dear R-users, Happy new year to all! I have been using the mgcv package, and I have run some models using the option mrf, for saptial data. But I have found quite hard to interpret the results. I could not find a lot of documentation on that, examples and so on, so I was wondering if anyone can

[R] to modify a dataframe

2014-01-01 Thread Arnaud Michel
Dear All, From the dataframe df1 df1 - structure(list(Nom = structure(1:9, .Label = c(A1, A2, A3, B1, B2, C1, C2, C3, C4), class = factor), Pays1 = c(1, 1, 0, 0, 1, 0, 0, 0, 0), Pays2 = c(0, 0, 0, 1, 1, 0, 1, 0, 1), Pays3 = c(0, 0, 0, 0, 1, 0, 0, 0, 0), Pays4 = c(1, 0, 0, 0, 0, 0, 1, 0,

Re: [R] to modify a dataframe

2014-01-01 Thread Bert Gunter
1. Thank you for the clear reproducible example. This made it easy to see what you wanted and provide an answer. Hopefully a correct one! 2. Many ways to do this. Here's one, but others may be better. Step1: First greate a grouping factor for Nom to group the separate row labels into the logical

Re: [R] to modify a dataframe

2014-01-01 Thread Rui Barradas
Hello, Here's one way. lst1 - lapply(split(df1, gsub([0-9], , df1$Nom)), function(x){ x[, -1] - lapply(x[, -1], function(y){ z - if(any(y == 1)) 1 else 0 rep(z, length(y)) }) x }) df3 -

Re: [R] to modify a dataframe

2014-01-01 Thread arun
Hi, You could try:  df3 - df1 library(plyr) df3[,-1] - ddply(df1,.(Nom1=gsub(\\d+,,Nom)),colwise(function(x) rep(max(x),length(x[,-1] attr(df3,row.names) - attr(df2,row.names)  identical(df2,df3) #[1] TRUE A.K. On Wednesday, January 1, 2014 11:56 AM, Arnaud Michel michel.arn...@cirad.fr

Re: [R] seq_len and loops

2014-01-01 Thread William Dunlap
2. However, Bill (and Henrik) raised the question of replacing '1' with '1L'; I understand the meaning of that, but does it matter (in practice)? On 12/22/2013 06:57 PM, William Dunlap wrote: for (i in seq_len(x - 1) + 1) should be efficient and safe. Oops, not safe when x is 0.

Re: [R] looping through columns in a matrix or data frame

2014-01-01 Thread arun
Hi, May be this helps: Using your function: mapply(less,test,4) #or  invisible(mapply(less,test,4)) #[1] 2 3 #[1] 3 #or  for(i in 1:ncol(test)){  less(test[,i],4)} #[1] 2 3 #[1] 3 A.K. Hi, I'm trying to figure out how to loop through columns in a matrix or data frame, but what I've been

[R] Question: reproducibility of random sampling with replacement

2014-01-01 Thread Chee Chen
Dear All, I would like to ask for your help on reproducibility of random sampling with replacement. For example, one re-samples the rows with replacement of a residual matrix and uses the new residual matrix thus obtained to produce a statistic ; repeat this for a certain number of times. My

Re: [R] Question: reproducibility of random sampling with replacement

2014-01-01 Thread Rui Barradas
Hello, Inline. Em 01-01-2014 22:12, Chee Chen escreveu: Dear All, I would like to ask for your help on reproducibility of random sampling with replacement. For example, one re-samples the rows with replacement of a residual matrix and uses the new residual matrix thus obtained to produce a

Re: [R] Question: reproducibility of random sampling with replacement

2014-01-01 Thread Rolf Turner
Why on earth would you expect S and T to be the same given what you have done. I am unable to rightly apprehend the confusion of ideas that could provoke such a question, (Charles Babbage). You have to set the *same* seed before each construction. I.e. do set.seed(123) before creating S; then

Re: [R] Question: reproducibility of random sampling with replacement

2014-01-01 Thread Jeff Newmiller
If you want to reproduce the same sequence twice, then you need to set the seed at the beginning of each calculation. You are only doing it for the second calculation below. --- Jeff NewmillerThe

Re: [R] Question: reproducibility of random sampling with replacement

2014-01-01 Thread Bert Gunter
You have to set the same seed before each random number generation! You did not do this. Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. H. Gilbert Welch On Wed, Jan 1, 2014 at 2:12

[R] How to verify char variables contain at least one value

2014-01-01 Thread Luca Meyer
Happy new year fellows, I am trying to do something I believe should be fairly straightforward but I cannot find my way out. My dataset d2 is 26 rows by 245 columns, exclusively char variables. I would like to check whether at least one column from V13 till V239 (they are in numerical sequence)

[R] R crashes with memory errors on a 256GB machine (and system shoes only 60GB usage)

2014-01-01 Thread Xebar Saram
Hi All, I have a terrible issue i cant seem to debug which is halting my work completely. I have R 3.02 installed on a linux machine (arch linux-latest) which I built specifically for running high memory use models. the system is a 16 core, 256 GB RAM machine. it worked well at the start but in

Re: [R] How to verify char variables contain at least one value

2014-01-01 Thread Jim Lemon
On 01/02/2014 05:17 PM, Luca Meyer wrote: Happy new year fellows, I am trying to do something I believe should be fairly straightforward but I cannot find my way out. My dataset d2 is 26 rows by 245 columns, exclusively char variables. I would like to check whether at least one column from V13

Re: [R] How to verify char variables contain at least one value

2014-01-01 Thread Gerrit Eichner
Hello, Luca, also a happy new year! It's not quite clear to me what you want to do, but note first that the :-operator is a short-cut for seq() with by = 1 (look at ?seq), and that it usually (!) does not work on columns of data frames. Exception: when used for the argument subset of