Re: [R] input a list into a function

2009-12-25 Thread Don MacQueen
It works for me, without changes. See below. But I can recreate your error if I type the plus signs at the beginning of second and third lines. For your example, don't type any plus signs, except for the one in print(g[i]+x)} By the way, nothing that you did fits the description "input a l

Re: [R] input a list into a function

2009-12-25 Thread Patrick Connolly
On Fri, 25-Dec-2009 at 05:27PM -0800, Cat Morning wrote: |> ? |> I want to input a list into a function. But i get the error "Error in +{ : invalid argument to unary operator". How do I avoid this error? |> ? |> Here is an example of this problem: |> ? |> > g = c(2, 4, 8, 16, 32, 64, 128, 122,

[R] input a list into a function

2009-12-25 Thread Cat Morning
  I want to input a list into a function. But i get the error "Error in +{ : invalid argument to unary operator". How do I avoid this error?   Here is an example of this problem:   > g = c(2, 4, 8, 16, 32, 64, 128, 122, 110, 86, 38, 76, 18, 36, 72, 10, 20, 40, > 80, 26) > for (i in 1:20)  + {f