[R] New Eyes Needed to See Syntax Error

baptiste auguie baptiste.auguie at googlemail.com
Fri May 18 01:42:08 CEST 2012


Your log10(HCO3 and sqrt(HCO3 seem to be missing closing brackets.

HTH,

baptiste

On 18 May 2012 11:34, Rich Shepard <rshepard at appl-ecosys.com> wrote:
>  One of many scripts to produce 4 lattice plots on one page keeps throwing
> an error. I've tried manipulating the file to eliminate the error, but have
> not been able to do so. The error is:
>
>> source('bicarb.R')
>
> Error in source("bicarb.R") : bicarb.R:15:1: unexpected symbol
> 14: 15: hco33
>   ^
>
>  The 'h' is in column 0 so the caret would be column -1, but it's presented
> as column 1. The file, bicarb.R is:
>
> hco31 <- qqmath(~ HCO3 | factor(basin), data = surfchem.cast, main =
> 'Bicarbonate (Raw)',
>  prepanel = prepanel.qqmathline,
>  panel = function(x, ...) {
>    panel.qqmathline(x, ...)
>    panel.qqmath(x, ...)
>  })
>
> hco32 <- qqmath(~ log10(HCO3 | factor(basin), data = surfchem.cast, main =
> 'Bicarbonate (Log10)',
>  prepanel = prepanel.qqmathline,
>  panel = function(x, ...) {
>    panel.qqmathline(x, ...)
>    panel.qqmath(x, ...)
>  })
>
> hco33 <- qqmath(~ sqrt(HCO3 | factor(basin), data = surfchem.cast, main =
> 'Bicarbonate (Square Root)',
>  prepanel = prepanel.qqmathline,
>  panel = function(x, ...) {
>    panel.qqmathline(x, ...)
>    panel.qqmath(x, ...)
>  })
>
> hco34 <- qqmath(~ HCO3^1/3 | factor(basin), data = surfchem.cast, main =
> 'Bicarbonate (Cubic Root)',
>  prepanel = prepanel.qqmathline,
>  panel = function(x, ...) {
>    panel.qqmathline(x, ...)
>    panel.qqmath(x, ...)
>  })
>
> pdf('hco3.pdf')
> plot(hco31, split = c(1,1,2,2), more = TRUE)
> plot(hco32, split = c(1,1,2,2), more = TRUE) plot(hco33, split = c(1,2,2,2),
> more = TRUE)
> plot(hco34, split = c(2,2,2,2), more = FALSE)
> dev.off()
>
>  If the error is not apparent to you, please suggest what I could try to
> isolate the cause.
>
> Rich
>
> --
> Richard B. Shepard, Ph.D.          |   Integrity - Credibility - Innovation
> Applied Ecosystem Services, Inc.   |    Helping Ensure Our Clients' Futures
> <http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863
>
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list