Re: [R] Newbie: Simple loops: complex troubles

2007-04-04 Thread jim holtman
One of the things about R that you have to learn is vector operations. You try to avoid loops and also 'generating' variables -- this is where a list comes in very handy. To relate to Java, it is similar to 'struct'. Here is a program that does what you want to do; it uses lists and vectorized

Re: [R] Newbie: Simple loops: complex troubles

2007-04-04 Thread projection83
This helped a lot. Thank you so much - im now able to get some basic stuff moving around in R! Petr Klasterecky wrote: Not sure whether this is exactly and everything you want, but at least it may give you some ideas how to proceed. You do not need loops at all: Let's try a simplified

[R] Newbie: Simple loops: complex troubles

2007-04-03 Thread projection83
I am used to java (well, i dont remember it really well, but anyway) I have having a really difficult time making simple loops to work. I got the following to work: ## ##Creates objects Ux1, Ux2, Ux2 etc. that all contain n numbers in a random distribution ##

Re: [R] Newbie: Simple loops: complex troubles

2007-04-03 Thread Petr Klasterecky
Not sure whether this is exactly and everything you want, but at least it may give you some ideas how to proceed. You do not need loops at all: Let's try a simplified example with 3 samples, each of length 10 (just for printing purposes): m - c(1,2,3) v - c(1,4,9) n - 10 means - rep(m,each=n)