[R] Need help write a function

2005-10-11 Thread Jan Sabee
Dear all, I am still learning R with write a small function for my self. I was wondering if someone can help me to write a R function formula below: Z_k (x) = \sum_{i=0}^{i=k} \binom{n}{i} (m-1)^i Thanks a million in advance, Sincerely, Jan Sabee [[alternative HTML version deleted

[R] How to generate for one vector matrix

2005-10-13 Thread Jan Sabee
(x,n=6) 1,1,2,1,4 1,2,3,0,3 4,0,1,1,1 3,1,0,1,4 0,0,3,0,0 4,1,3,0,4 Could anyone help me. Thanks. Regards, Jan Sabee [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] How to generate for one vector matrix

2005-10-13 Thread Jan Sabee
Yes, that is what I am looking for. Many thanks to Marc Schwartz and Xiaohua for your help. Sincerely, Jan Sabee [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

[R] predict with logistic regression

2006-09-15 Thread Jan Sabee
I am learning about using logistic regression with glm. Suppose I have dataset: duration - c(45,15,40,83,90,25,35,65,95,35,75,45,50,75,30,25,20,60,70,30,60,61,65,15,20,45,15,25,15,30,40,15,135,20,40) type - c(0,0,0,1,1,1,rep(0,5),1,1,1,0,0,1,1,1,rep(0,4),1,1,0,1,0,1,0,0,rep(1,4)) sore -

[R] Count all dataset

2005-03-18 Thread Jan Sabee
= sum of B C = sum of C NA = sum of NA What function can I use? I'm just a beginner in R programming. Best regards, Jan Sabee __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http

[R] Count missing variables in dataset

2005-03-21 Thread Jan Sabee
A B B B C A A B B B B C B B B A I know that my customer only choice A, B and C. Are there any way to count variables that are not include in dataset. I mean D and E is missing in dataset. Thanks for your help. Jan Sabee __ R-help

Re: [R] more classes to one class in one dataset

2005-03-23 Thread Jan Sabee
Thanks. It's work. Jan Sabee On Wed, 23 Mar 2005 11:30:22 +0100, Dimitris Rizopoulos [EMAIL PROTECTED] wrote: try this: split(dat, dat$class) where 'dat' is your data.frame I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School

[R] Mosaicplot with different colors

2005-03-29 Thread Jan Sabee
others package? Thanks in advance for any assistance. Jan Sabee __ 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

[R] Change density and angle in barplot

2005-04-04 Thread Jan Sabee
in Virginia, font = 4)) Thanks for your help. Jan Sabee __ 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

[R] How to make combination data

2005-04-19 Thread Jan Sabee
, Jan Sabee __ 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

Re: [R] How to make combination data

2005-04-19 Thread Jan Sabee
Thanks you very much. Yes, this is exactly what I want. Best wishes, Jan Sabee On 4/19/05, Liaw, Andy [EMAIL PROTECTED] wrote: Is something like this what you're looking for? fixSome - function(..., fixed) { fList - list(...) for (i in fixed) fList[[i]] - fList[[i]][1] do.call

[R] Put one random row dataset to first cell variable

2005-04-20 Thread Jan Sabee
take one random row I put in the first cell in each own variable. Is this possible to make a simple function? Sincerely, Jan Sabee __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http

Re: [R] Put one random row dataset to first cell variable

2005-04-20 Thread Jan Sabee
Yes, this is exactly what I want. Many thanks and best regards, Jan Sabee On 4/20/05, Dimitris Rizopoulos [EMAIL PROTECTED] wrote: maybe something like this could be helpful f - function(..., ref){ lis - list(...) for(i in seq(along=lis)){ x - lis[[i]] r - match

Re: [R] Put one random row dataset to first cell variable

2005-04-20 Thread Jan Sabee
Many thanks Jim. This is the others kind of a random row which I can use. Best wishes, Jan Sabee Assumptions: 1) the object is a data frame. 2) all variables are factors (although I have CMA). 3) you want a list containing vectors of the levels for each value in which the first level

[R] Split dataset as factor and numeric

2005-04-27 Thread Jan Sabee
C 0 B 0 A10 Thanks, Jan Sabee __ 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

[R] Take each one cell

2005-05-02 Thread Jan Sabee
Are there any way to take x - c(0, large, medium, small) x [1] 0 large medium small like x=0 x=large x=medium x=small Best regards Jan Sabee __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] How to handle data continuous to discretized

2005-05-10 Thread Jan Sabee
Dear R-helpers, Could someone point me to explanation/documentation, is there any packages to handle datasets which variables contains continuous to discretized. I would be very happy if anyone could help me. Thank you very much in advance. Kindly regards, Jan Sabee

[R] How to read a row dataset one by one

2005-06-10 Thread Jan Sabee
no 1, [1] a b a c cM1 read row no 2, [1] c b b c cM4 . . . the last row, [1] c c a b aM1 Kind regards, Jan Sabee __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] How to read a row dataset one by one

2005-06-10 Thread Jan Sabee
M2 c c a b aM1 How can I do it. Thanks again for your help. Jan Sabee On 6/10/05, Henrik Bengtsson [EMAIL PROTECTED] wrote: Open a connection a read line by line from that one, e.g. myReadPrint - function(pathname, ...) { con - file(pathname, open=r) on.exit(close(con

[R] make three plot to one plot

2005-10-21 Thread Jan Sabee
Dear all, I want to make three plot below to only one plot together with legend, how can I do that? I have tried with matplot function but I did not succeed. Thanks for your help. Sincerelly, Jan Sabee test.five.x - c(0.02,0.05,0.07,0.09,0.10,0.12,0.13,0.14,0.16,0.17,0.20,0.21,0.34,0.40

Re: [R] make three plot to one plot

2005-10-21 Thread Jan Sabee
Thanks to Marc and Gabor. Have a nice weekend. Best, Jan Sabee On 10/21/05, Jan Sabee [EMAIL PROTECTED] wrote: Dear all, I want to make three plot below to only one plot together with legend, how can I do that? I have tried with matplot function but I did not succeed. Thanks for your help