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
On Thu, 17 May 2012, Rich Shepard wrote:> Error in source("bicarb.R") : bicarb.R:15:1: unexpected symbol > 14: > 15: hco33 > ^These two lines were concatenated in the message on the mail list. 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
On 12-05-17 04:34 PM, Rich Shepard wrote:> hco32 <- qqmath(~ log10(HCO3 | factor(basin), data = surfchem.cast, > main = 'Bicarbonate (Log10)', > prepanel = prepanel.qqmathline, > panel = function(x, ...) { > panel.qqmathline(x, ...) > panel.qqmath(x, ...) > })Missing a closing parenthesis after log10. It should be : log10(HCO3 | factor(basin)) Eloi -- Eloi Mercier Bioinformatics PhD Student, UBC Paul Pavlidis Lab 2185 East Mall University of British Columbia Vancouver BC V6T1Z4
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.