2008/7/22 Angelo Scozzarella <[EMAIL PROTECTED]>:
> Hi,
>
> Why this function doesn't work?

>        return(x$breaks[cl]+
>        (N/2-sum(x$counts[1:(cl-1)]))/(x$densit[cl]*N)
>    } else median(x)
> }

Have you read the error message? I get:

Error: unexpected '}' in:
":(cl-1)]))/(x$densit[cl]*N)
   }"

 which is because you haven't closed the "(" from the "return(" function.

 If you use an editor with syntax highlighting (emacs+ESS, tinn-R,
others) it will flash matching brackets and parentheses so you don't
make this kind of mistake.

Barry

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to