[R] Decimal places

2012-11-18 Thread Rlotus
I am a beginner in programmin in general and R specifically. I would like to generate a set of random numbers in a normal distribution but to limit the decimal places in these numbers to only 2. I have been using x1 <- runif(1,0,1) to generate my numbers. Can I add something to it to enable me t

[R] How to fix it?

2012-11-18 Thread Rlotus
Gives a mistake that "probability" is not found x<- runif(1,0,1) y<-x^5+x^8+(cos(x))^3 yrandom<- runif(10,0,3) if (yhttp://r.789695.n4.nabble.com/How-to-fix-it-tp4649955.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.

Re: [R] area under the curve

2012-11-18 Thread Rlotus
I mean i need to put random x in equation in order to determine value y. i used runifbut it doesn work... y= (runif(0,1))^5+(runif(0,1))^8+((cos runif(0,1)))^3; (<=it doesnt work properly) now i have value y need to determine whether y is above or below my function. so after that y1=r

[R] area under the curve

2012-11-18 Thread Rlotus
I have function y=x^5+x^8+ (cos(x))^3; I need to get random x; random y; and after that determine whether y below or above the given function. I tried a lot of version. but my code even doesnt workplz help with this expressions ;( I am a begiiner in R -- View this message in context: http:

Re: [R] How to draw the graph???

2012-10-26 Thread Rlotus
thank u so much for helping -- View this message in context: http://r.789695.n4.nabble.com/How-to-draw-the-graph-tp4647464p4647557.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch

[R] Why my code does not draw? how to fix it? plz....

2012-10-26 Thread Rlotus
number<-c(0,1,3,4,5,6,8) rsidp<-function(x){ i=0 {y<-sample(number,x,replace=TRUE)} return(y) } plot(o, xlim=c(0,20), ylim(0,20), type="n", xlab="Sample size", ylab="Sample variance") for (i in seq(1:20)){ retVal=rsidp(i) var(rsidpVector) points (i, v

Re: [R] wanna create all points.....

2012-10-25 Thread Rlotus
One dote..and its a last dote of the loop ;( -- View this message in context: http://r.789695.n4.nabble.com/wanna-create-all-points-tp4647494p4647495.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailin

[R] wanna create all points.....

2012-10-25 Thread Rlotus
Plz help me ;(( I lost 7 hours for thinking and doing this code ;( I need to create points.20 points(dots). All these dots have to be in one graph... when i run this codeit gives me only one dote. number<- (0,2,3,4,5,6,8) for (i in seq(1:20)) {rsidpVector=rsidp(i) mean(rsidpVector) pl

Re: [R] How to draw the graph???

2012-10-25 Thread Rlotus
plot(y,x, ylab="sample mean",xlab="sample size") for (i in seq(1:20)) > {rsidpVector= rsidp(1) > x<-mean(rsidpVector) > y<-length(number) >print (rsidpVector) > print(x) sorry, but how i can use points function in the loop? -- View this message in context: http://r.789695.n4.nabble.com/Ho

[R] Demo code

2012-10-25 Thread Rlotus
I have code in R. I need also demo code of my output and demo code of code. I dont know what is demo. An d how to create it...can you tell how to do that plz. thank you. -- View this message in context: http://r.789695.n4.nabble.com/Demo-code-tp4647471.html Sent from the R help mailing list arc

[R] How to draw the graph???

2012-10-25 Thread Rlotus
I have his code. I wanna draw the graph according to x and y. But at the end when I run the code it gives me only one dot...it is strange cuz from the loop it has to give 20 dots. Help me plz to draw a graph((( for (i in seq(1:20)) {rsidpVector= rsidp(1) x<-mean(rsidpVector) y<-length(number

Re: [R] How generate random numbers from given vector???

2012-10-25 Thread Rlotus
thank u so much! i got it. -- View this message in context: http://r.789695.n4.nabble.com/How-generate-random-numbers-from-given-vector-tp4647447p4647469.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing li

[R] How generate random numbers from given vector???

2012-10-25 Thread Rlotus
I wanna generate random numbers from a vector... for example number<-c(0,1,3,4,5,6,8) so rsidp<-function(x){ i=0 for (i in seq(1:x)) {y<-sample(number,x, replace=T)} return(y) } so all random numbers have to be from vector "number"; so if I type rsidp(5). i

Re: [R] Help plz to fix it

2012-10-22 Thread Rlotus
Thank u so much for helping! Now I got it ;) -- View this message in context: http://r.789695.n4.nabble.com/Help-plz-to-fix-it-tp4647051p4647089.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https:

[R] Help plz to fix it

2012-10-22 Thread Rlotus
I have an array of probabilitiesit is p. So if user types x=1 then probability is p1=1/10. If user types x=2 it means that p2= p1+p2 if user types x=3 it means that p3=p1+p2+p3and so on. So i created a code. but it doesnt work properly. Help me plz to fix it) Thank u in advance. psidp

Re: [R] Help me please to code....

2012-10-22 Thread Rlotus
thank you so much for helping! Now i got how to do it ;) -- View this message in context: http://r.789695.n4.nabble.com/Help-me-please-to-code-tp4646932p4647050.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mai

[R] Help me please to code....

2012-10-21 Thread Rlotus
User has to type (input) x. After inputcode has to check X with statement if There is a statement IF. If X=0 then Y=5/2 else =7; How to code it please. I tried but my code does not work ;( I wanna see how it looks like( thank u in advance( -- View this message in context: http://r.7896