[R] computing sum of indicator variables

2004-07-26 Thread Stefan Böhringer
My problem is as follows: i is a list of integers of variable length. Now I want to compute a new vector/array that contains 1's at the positions indicated in i. For example: c(2, 4) - c(0, 1, 0, 1) Using something like i = i - c(0, i[2:length(i) - 1]); sapply(i, function(x) c(rep(0, x - 1),

[R] ipred and lda

2004-01-09 Thread Stefan Böhringer
Dear all, can anybody help me with the program below? The function predict.lda seems to be defined but cannot be used by errortest. The R version is 1.7.1 Thanks in advance, Stefan library(MASS); library(ipred); data(iris3); tr - sample(1:50, 25); train -

Re: [R] Lambert's W function

2003-11-26 Thread Stefan Böhringer
On Tue, 2003-11-25 at 12:09, Robin Hankin wrote: Hello List does anyone have an R function for the Lambert W function? I need complex arguments. [the Lamert W function W(z) satisfies W(z)*exp(W(z)) = z but I could'nt even figure out how to use uniroot() for complex z] There

Re: [R] discriminant function

2003-08-27 Thread Stefan Böhringer
Thank you all for the quick responses. However, I'm not sure I unterstand the scaling matrix (denote S henceforth) correcty. An observation x will be transformed by Sx into a new vector space with the properties given by the description. What is now the direction perpendicular to the seperating