Re: [R] Matrix in R

2012-11-13 Thread Haszun
It's a bit complicated. Is there any shorter way? Is there possibility to read datas from .csv as matrix, like this which i want to have? -- View this message in context: http://r.789695.n4.nabble.com/Matrix-in-R-tp4649426p4649429.html Sent from the R help mailing list archive at Nabble.com. _

[R] Matrix in R

2012-11-13 Thread Haszun
Is there posiibility to read.table change in matrix? When i used read.table it gave me: V1 V2 V3 V4 [1,] "OsobaA" "10,00" "9,00" "8,00" [2,] "OsobaB" "2,00" "3,00" "1,00" [3,] "OsobaC" "5,00" "6,00" "4,00" I want to change it in: [1,] [2,] [3,] [4,

Re: [R] Problem with if

2012-11-10 Thread Haszun
Thank you for help. -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-if-tp4649180p4649182.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

[R] Problem with if

2012-11-10 Thread Haszun
Why it always gives me a 3? > fun=function(x) { + if (x<-3) { + return(x) + } else { + if(x<2) { + return(x^2-1) + } else { + return(log(x)) + }}} > > fun(-5) [1] 3 > fun(0) [1] 3 > fun(10) [1] 3 > fun(-10) [1] 3 > -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-

Re: [R] Problem with recursion

2012-11-10 Thread Haszun
Thank you for help. -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-recursion-tp4649162p4649166.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailm

[R] Problem with recursion

2012-11-10 Thread Haszun
I know that maybe it will be stupid question. What iswrong with it (i think that i have to do the "stop moment", but i dont know how) fibbonacci=function(x) { while(x>0) { if (x==1 || x==2) { return(1) } else fibbonacci(x-1)+fibbonacci(x-2) } } -- View this message in context: http://r.78969

Re: [R] Problem with

2012-11-10 Thread Haszun
Thanks for help, now its working. -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-tp4649082p4649161.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/ma

[R] Problem with

2012-11-09 Thread Haszun
Hi, can someone tell me what is wrong in this function: ilecyfr=function(x){ if (x=0){ return(1) } else { k=0 while (abs(x)/10^k >0) { k=k+1 } return(k) }} -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-tp4649082.html Sent from the R help mailing list archive at N

Re: [R] Problem with

2012-11-09 Thread Haszun
* ilecyfr=function(x){ if (x=0){ return(1) } else { k=0 while (abs(x)/10^k >1) { k=k+1 } return(k) }} -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-tp4649082p4649084.html Sent from the R help mailing list archive at Nabble.com. ___