Re: [R] question about mean

2010-06-09 Thread Peter Langfelder
apply(iris[, -5], 2, tapply, iris$Species, mean) On Wed, Jun 9, 2010 at 3:43 PM, SH.Chou cls3...@gmail.com wrote: Hi there: I have a question about generating mean value of a data.frame. Take iris data for example, if I have a data.frame looking like the following: -

Re: [R] classification algorithms with distance matrix

2010-06-07 Thread Peter Langfelder
On Mon, Jun 7, 2010 at 9:05 AM, sidahmed BENABDERRAHMANE sidahmed.benabderrahm...@loria.fr wrote: Dear all, I have a problem when using some classification functions (Kmeans, PAM, FANNY...)  with a distance matrix, and i would to understand how it proceeds for the positioning of centroids

Re: [R] Wrong symbol rendering in plots (Ubuntu)

2010-06-04 Thread Peter Langfelder
On Fri, Jun 4, 2010 at 1:44 PM, Ben Bolker bol...@ufl.edu wrote: Eduardo J. Chica ejchica at gmail.com writes: Hi I am having problems with the rendering of scientific symbols (mu and degree) in my plots. Whenever I use these symbols they are rendered changed (mu is changed to the

Re: [R] Wrong symbol rendering in plots (Ubuntu)

2010-06-04 Thread Peter Langfelder
This issue is already in the Notes section of ?pdf.  It remains to be seen if the OP's problem was this exact one, since they didn't specify an example. aahhh, thank you for pointing this out. I never noticed this note. Peter __

Re: [R] 380x380 dataframe to list

2010-06-04 Thread Peter Langfelder
c(as.matrix(data)) will not do it? Peter On Fri, Jun 4, 2010 at 5:47 PM, Nick Matzke mat...@berkeley.edu wrote: Hi, This can't be hard, but I can't find the solution.  I have a 380x380 data frame of numbers.  I would like to turn it into a single column so I can do e.g. hist and mean on it

Re: [R] Problem using apply

2010-06-01 Thread Peter Langfelder
Well, your example matrix is symmetric, so row and column operations naturally return the same values. You may want to note though that if you apply your function to a matrix along rows, the results will be stored in the __columns__ of the resulting matrix. Thus, if you want to simply divide the

Re: [R] if negative value, make zero

2010-05-28 Thread Peter Langfelder
temp2 = tempr temp2[temp20] = 0 HTH On Fri, May 28, 2010 at 8:37 AM, ecvet...@uwaterloo.ca wrote: I have a data frame with both positive and negative values, and I want to make all the negative values equal zero, so i can eventually take an average. I've tried temp2 - ifelse(tempr0, 0,

Re: [R] list of complex objects?

2010-05-27 Thread Peter Langfelder
) # still works, from original list construction x[3] # but this doesn't work x[4] Cheers! Nick Peter Langfelder wrote: c concatenates all arguments. For example, c(c(0,1,2), c(3,4,5)) gives a vector 0,1,2,3,4,5. Another example: c(list(a=c(0,1), b = c(2,3)), list(c = c(4,5), d = c

Re: [R] R and ATLAS

2010-05-27 Thread Peter Langfelder
Should illicit a multi-CPU response with R/ATLAS?  If so, any suggestions on how to tweak my install to get it working?  Thanks! --j On Wed, May 26, 2010 at 3:17 PM, Peter Langfelder peter.langfel...@gmail.com wrote: If you didn't specify an external BLAS when you ran R configure script

Re: [R] list of complex objects?

2010-05-27 Thread Peter Langfelder
On Thu, May 27, 2010 at 9:43 AM, William Dunlap wdun...@tibco.com wrote: -Original Message- Unlike with vectors, with lists you don't have to specify length and can add as many list components as you want later  The length of the list will automatically adjust. 'Nonrecursive'

Re: [R] R and ATLAS

2010-05-26 Thread Peter Langfelder
If you didn't specify an external BLAS when you ran R configure script, you are not using ATLAS. If you're not sure and you still have the output of the configure script, at the end it'll say whether it uses an external BLAS. Alternatively, you may also want to generate two random 5000x5000

Re: [R] list of complex objects?

2010-05-26 Thread Peter Langfelder
c concatenates all arguments. For example, c(c(0,1,2), c(3,4,5)) gives a vector 0,1,2,3,4,5. Another example: c(list(a=c(0,1), b = c(2,3)), list(c = c(4,5), d = c(5,6))) $a [1] 0 1 $b [1] 2 3 $c [1] 4 5 $d [1] 5 6 So instead of a list of two lists, you get a single list with 4 components.

[R] Optional package dependency

2010-05-24 Thread Peter Langfelder
Hi all, apologies if this has been answered before, I didn't find the answer in the archives. I am putting together a package that I would like to have optional functionality if another package is installed. In normal, non-package code, I would simply write something like if (require(qvalue)) {

<    1   2   3   4   5