jimdare wrote:
> Hi, 
>
> I tried to create the following if / else statement but I keep getting the
> error "Error: unexpected '}' in "size="large",center="none")
> }" (I have highlighted the } in bold where the error is occuring).  I can't
> seem to find a reason for this, does anyone know how I can fix it?
>
> Thanks,
> James  
>
> if (nostocks<=3)
>       
>               {data1<-test[,data1stocks];
>               tex1<-latex(data1, file=paste(i$Species[1], "1.tex", sep=""), 
>                            rowname = NULL, 
>                            cgroup = c("Fishstock", stocknames,"Total"), 
>                            n.cgroup = c(1, rep(2,(nostocks+1)), 
>                            colheads = c("Year", rep(c("Catch", "TACC"),
> nostocks+1)),
>               size="large",center="none")
>
> }else)                
>   

the error message tells you that '}' is unexpected here, and that's
because it really is.  you forgot to close one parenthesis up there:

    n.cgroup = c(1, rep(2,(nostocks+1)),

you open three, you close two.  close three and it goes away.

vQ

______________________________________________
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