Hello, I am a new member, and I need your help. For my work (thesis), I use the package rpart to construct trees. But, to continu my studies, I need to calcule the 'variable importance'. But, I don't find a program to do this in the implementation of R. Is there someone who know if there exist a program which calculate the 'variable importance', notion defined by Breiman and al. in CART ? If this program exists, could you tell me where I can find it, to use it? Thanks a lot, and sorry for my english. Christine Tuleau
I want to extract the first non-zero digit of any vector, as for example from a<-runif(100,0,1). Tried it using grep (...) but didn?t work. Any help is very much appreciated. Thanks, Manica -- visite http://ipimar-iniap.ipimar.pt/neomav/
> I want to extract the first non-zero digit of any vector, as for example > from a<-runif(100,0,1).a[min((1:length(a))[a!=0])] _____________________________________________________________________> Simon Wood simon at stats.gla.ac.uk www.stats.gla.ac.uk/~simon/ >> Department of Statistics, University of Glasgow, Glasgow, G12 8QQ >>> Direct telephone: (0)141 330 4530 Fax: (0)141 330 4814
Manica wrote:> I want to extract the first non-zero digit of any vector, as for example > from a<-runif(100,0,1). > Tried it using grep (...) but didn?t work. > > Any help is very much appreciated. > Thanks, > Manica > >How about: a <- runif(10, 0, 1) b <- as.character(a) nonzero <- regexpr("[1-9]", b) as.numeric(substr(b, nonzero, nonzero)) -sundar P.S. in the future, it would be helpful to see an example of the output you expect to avoid any confusion in the question.
I guess what you want is: a <- abs(a) floor( a / 10^floor( log10( a ) ) ) Bendix ---------------------- Bendix Carstensen Senior Statistician Steno Diabetes Center Niels Steensens Vej 2 DK-2820 Gentofte Denmark tel: +45 44 43 87 38 mob: +45 30 75 87 38 fax: +45 44 43 07 06 bxc at steno.dk www.biostat.ku.dk/~bxc ----------------------> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Manica > Sent: Friday, March 12, 2004 3:15 PM > To: r-help at stat.math.ethz.ch > Subject: [R] help > Importance: High > > > I want to extract the first non-zero digit of any vector, as > for example from a<-runif(100,0,1). Tried it using grep (...) > but didn?t work. > > Any help is very much appreciated. > Thanks, > Manica > > > -- > visite > http://ipimar-iniap.ipimar.pt/neomav/ > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo> /r-help > PLEASE > do read the posting guide! > http://www.R-project.org/posting-guide.html >