Re: [R] scalar assignment within a vector within function

2012-03-30 Thread Benjamin Caldwell
dwell > > Sent: Friday, March 30, 2012 12:09 PM > > To: Peter Langfelder > > Cc: r-help > > Subject: Re: [R] scalar assignment within a vector within function > > > > Thanks all - ended up going with > > test<<-test > > > > On Thu, Mar 29, 2

Re: [R] scalar assignment within a vector within function

2012-03-30 Thread Benjamin Caldwell
Thanks all - ended up going with test<<-test On Thu, Mar 29, 2012 at 4:40 PM, Peter Langfelder < peter.langfel...@gmail.com> wrote: > On Thu, Mar 29, 2012 at 3:49 PM, Benjamin Caldwell > wrote: > > Hello, > > > > I'm trying to create a vector of r^2 values for using a function which I > > will

Re: [R] scalar assignment within a vector within function

2012-03-29 Thread Rui Barradas
Hello, btc1 wrote > > Hello, > > I'm trying to create a vector of r^2 values for using a function which I > will run in a "for" loop. Example: > > per<-rnorm(100,.5,.2)^2 > x<-rnorm(100,10,5) > y<-rnorm(100,20,5) > fr<-data.frame(x,y,per) > > test<-rep(0,9) > > plotter<-function(i){ > temp.i

Re: [R] scalar assignment within a vector within function

2012-03-29 Thread Peter Langfelder
On Thu, Mar 29, 2012 at 3:49 PM, Benjamin Caldwell wrote: > Hello, > > I'm trying to create a vector of r^2 values for using a function which I > will run in a "for" loop. Example: > > per<-rnorm(100,.5,.2)^2 > x<-rnorm(100,10,5) > y<-rnorm(100,20,5) > fr<-data.frame(x,y,per) > > test<-rep(0,9) >

[R] scalar assignment within a vector within function

2012-03-29 Thread Benjamin Caldwell
Hello, I'm trying to create a vector of r^2 values for using a function which I will run in a "for" loop. Example: per<-rnorm(100,.5,.2)^2 x<-rnorm(100,10,5) y<-rnorm(100,20,5) fr<-data.frame(x,y,per) test<-rep(0,9) plotter<-function(i){ temp.i<-fr[fr$per <=(i*.10),] with(temp.i, plot(x, y, mai