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
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,
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
3 matches
Mail list logo