Re: [R] SOLVED: Speed Optimization: Faster Way of Accessing array (was: data.frame) in a Loop?

2006-11-23 Thread Sven C. Koehler
On Sat, Nov 11, 2006 at 05:22:30AM +, Prof Brian Ripley wrote: I don't see how this code can work at all. '[-.data.frame' does not accept three arguments, e.g. women[1,2,3] - 17 Error in `[-.data.frame`(`*tmp*`, 1, 2, 3, value = 17) : unused argument(s) (3) If df is in fact

[R] Is there a faster way to change parts of this array?

2006-11-23 Thread Sven C. Koehler
Hello, I have another question on accessing arrays: | a- array(0, c(1, 100, 10)) | b - c(1,4) | for (i in 1:1) { for (j in 1:100) { a[i,j,b] - (1:10)[b] }} Is there a way to replace the nested for loops by a faster operation? I tried to use `a[1:1, 1:100, b] - (1:10)[b]' but that

[R] Speed Optimization: Faster Way of Accessing data.frame in a Loop?

2006-11-10 Thread Sven C. Koehler
C. Koehler __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] Overlaying Barplots

2005-06-08 Thread Sven C. Koehler
Hello! I would like to overlay barplot(1:10) with a barplot(seq(1:5, each=2)), indicating that 50% of each bar belongs to category X. How do I do this in R? Best wishes, Sven C. Koehler __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch

[R] #R IRC channel on freenode

2005-06-06 Thread Sven C. Koehler
Hello! Someone pointed out that it's not well publicized. There is an #R channel on irc.freenode.net:6667, currently with about five users. You are welcome to join. Best regards, Sven __ R-help@stat.math.ethz.ch mailing list

[R] Dynamic Dictionary Data Type?

2005-06-02 Thread Sven C. Koehler
Hello! I have an algorithm which performs lengthy operations and I would like to cache results. Other languages usually offer a dictionary data type which I can use as an efficient way to dynamically cache already calculated results - what's the best way to do this in R? Best wishes, Sven C

[R] Finding Equal Elements in Vectors

2005-02-27 Thread Sven C. Koehler
Hello! I have two vectors and want to know how many of their elements are equal - what's the best way to do this in R? Best regards, Sven __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] can't understand R

2004-09-21 Thread Sven C. Koehler
/. Regards Sven C. Koehler __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] Using MASSv3's example from 8.7 in R?

2004-08-03 Thread Sven C. Koehler
be of help for me. However, I am not sure how I can convert the use of ms() using optim()--is there an explanation how to do this somewhere? Thanks. Best wishes, Sven C. Koehler = Example from MASSv3 8.7

[R] Easiest way to get the mean of a row of a data.frame?

2003-12-17 Thread Sven C. Koehler
Dear r-helpers! I am kind of new to R. I would like to calculate the mean of the numbers of this expression: data(USArrests) USArrests[row.names(M) == Alabama,] class() tells me it's a ``data.frame,'' what I actually desire is to get all numbers of a row as a vector or a list to let

Re: [R] Easiest way to get the mean of a row of a data.frame?

2003-12-17 Thread Sven C. Koehler
Thanks, you've helped me alot! -S. On Wed, Dec 17, 2003 at 09:43:44AM +0100, Philipp Pagel wrote: rowMeans(USArrest) does what you want. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help