Patrick Giraudoux
2005-Oct-29 07:36 UTC
[R] LaTex error when creating DVI version when compiling package
Dear Listers, I got this message when compiling a package: * creating pgirmess-manual.tex ... OK * checking pgirmess-manual.text ... ERROR LaTex errors when creating DVI version. This typically indicates Rd problems. The message is quite explicit but I struggled a lot before understanding that the trouble comes from a single file "selMod.rd" among 44 topics. Even though I have checked it ten times and even rewrite it on prompt(selMod), I cannot find out what is wrong with it. Can somebody used with LaTex and the format of R *.rd file have a quick look to the attached contents and tell me if he can detect some obvious faulty writing? Thanks in advance, Patrick \name{selMod} \alias{selMod} \alias{selMod.lm} \alias{selMod.glm} \alias{selMod.list} \title{ Model selection according to information theoretic methods } \description{ Handles lm, glm and list of models lm, glm, lme and nlme objects and provides parameters to compare models according to Anderson et al. (1998) } \usage{ selMod(aModel, Order = "AICc", ...) group method selMod.lm(aModel, Order = "AICc", dropNull = FALSE, selconv=TRUE, ...) selMod.list(aModel, Order = "AICc", ...) } \arguments{ \item{aModel}{ a lm or glm model or a list of lm or glm models } \item{dropNull}{ if TRUE, drops the simplest model (e.g. 'y~1') } \item{Order}{ if set to "AICc" (default) sort the models on this parameter, otherwise "AIC" is allowed } \item{selconv}{ if TRUE (default) keep the models for which convergence is obtained (glm object only) and with no anova singularity (lm and glm) } \item{...}{ other parameters to be passed as arguments (not used here) } } \details{ This function provides parameters used in the information theoretic methods for model comparisons. lm and glm objects can be passed directly as the upper scope of term addition (all terms added). Every model from 'y~1' is computed adding one term at a time until the upper scope model is derived. A list of user specified lm, glm, lme or nlme objects can alternately be passed. } \value{ A list with the following items: \item{AIC}{a data.frame including LL, the maximized log-likelihood; K the number of estimated parameters; N2K, number of observations/K; AIC, the Akaike index criterion; deltAIC, the difference between AIC and the lowest AIC value; w_i, the Akaike weights; AICc, the second order Akaike criterion; deltAICc, the difference between AICc and the lowest AICc value; w_ic, the AICc weights } \item{models}{the list of models} } \references{ Anderson, D.R., Link, W.A., Johnson, D.H. and Burnham, K.P. (2001). Suggestions for presenting the results of data analyses. Journal of Wildlife Management, 65, 373-378; Burnham, K.P. and Anderson, D.R. (2002) Model Selection and Multimodel Inference: a Practical Information-Theoretic Approach, 2nd edn., Springer-Verlag, New York. 353 pp } \author{ Patrick Giraudoux and David Pleydell: pgiraudo at univ-fcomte.fr, dpleydel at univ-fcomte.fr } \seealso{ \code{\link{AIC}},\code{\link{logLik}} } \examples{ library(MASS) anorex.1 <- lm(Postwt ~ Prewt*Treat, data = anorexia) selMod(anorex.1) anorex.2 <- glm(Postwt ~ Prewt*Treat, family=gaussian,data = anorexia) selMod(anorex.2) anorex.3<-lm(Postwt ~ Prewt+Treat, data = anorexia) selMod(list(anorex.1,anorex.2,anorex.3)) } \keyword{ models }
Roger Bivand
2005-Oct-29 08:45 UTC
[R] LaTex error when creating DVI version when compiling package
On Sat, 29 Oct 2005, Patrick Giraudoux wrote:> Dear Listers, > > I got this message when compiling a package: > > * creating pgirmess-manual.tex ... OK > * checking pgirmess-manual.text ... ERROR > LaTex errors when creating DVI version. > This typically indicates Rd problems. > > The message is quite explicit but I struggled a lot before understanding > that the trouble comes from a single file "selMod.rd" among 44 topics. > Even though I have checked it ten times and even rewrite it on > prompt(selMod), I cannot find out what is wrong with it. > > Can somebody used with LaTex and the format of R *.rd file have a quick > look to the attached contents and tell me if he can detect some obvious > faulty writing?The general answer is to look through the (often very long) *.log file in the *.Rcheck directory until you find the problem. That will typically give you a line number in the *.tex file, which shows not only where the error occurred, but the *.log file entry often shows what it is. My typical errors are using LaTeX special symbols, and most often having unprotected $ and _. I see quite a lot of _ below in \value{}, so I'd try \_ there first. Roger> > Thanks in advance, > > Patrick > > > > \name{selMod} > \alias{selMod} > \alias{selMod.lm} > \alias{selMod.glm} > \alias{selMod.list} > > \title{ Model selection according to information theoretic methods } > \description{ > Handles lm, glm and list of models lm, glm, lme and nlme objects and > provides parameters to compare models according to Anderson et al. (1998) > } > \usage{ > selMod(aModel, Order = "AICc", ...) group method > > selMod.lm(aModel, Order = "AICc", dropNull = FALSE, selconv=TRUE, ...) > selMod.list(aModel, Order = "AICc", ...) > } > > \arguments{ > \item{aModel}{ a lm or glm model or a list of lm or glm models } > \item{dropNull}{ if TRUE, drops the simplest model (e.g. 'y~1') } > \item{Order}{ if set to "AICc" (default) sort the models on this > parameter, otherwise "AIC" is allowed } > \item{selconv}{ if TRUE (default) keep the models for which > convergence is obtained (glm object only) and with no anova singularity > (lm and glm) } > \item{...}{ other parameters to be passed as arguments (not used here) } > } > > \details{ > This function provides parameters used in the information theoretic > methods for model comparisons. lm and glm objects can be passed directly > as the upper scope of term addition (all terms added). > Every model from 'y~1' is computed adding one term at a time until the > upper scope model is derived. A list of user specified lm, glm, lme or > nlme objects can alternately be passed. > } > > \value{ > A list with the following items: > \item{AIC}{a data.frame including LL, the maximized log-likelihood; K > the number of estimated parameters; N2K, number of observations/K; AIC, > the Akaike index criterion; deltAIC, the difference between AIC and the > lowest AIC value; w_i, the Akaike weights; AICc, the second order Akaike > criterion; deltAICc, the difference between AICc and the lowest AICc > value; w_ic, the AICc weights } > \item{models}{the list of models} > } > \references{ > Anderson, D.R., Link, W.A., Johnson, D.H. and Burnham, K.P. (2001). > Suggestions for presenting the results of data analyses. Journal of > Wildlife Management, 65, 373-378; Burnham, K.P. and Anderson, D.R. > (2002) Model Selection and Multimodel Inference: a Practical > Information-Theoretic Approach, 2nd edn., Springer-Verlag, New York. 353 pp > } > \author{ Patrick Giraudoux and David Pleydell: pgiraudo at univ-fcomte.fr, > dpleydel at univ-fcomte.fr } > > \seealso{ \code{\link{AIC}},\code{\link{logLik}} } > \examples{ > library(MASS) > anorex.1 <- lm(Postwt ~ Prewt*Treat, data = anorexia) > selMod(anorex.1) > anorex.2 <- glm(Postwt ~ Prewt*Treat, family=gaussian,data = anorexia) > selMod(anorex.2) > anorex.3<-lm(Postwt ~ Prewt+Treat, data = anorexia) > selMod(list(anorex.1,anorex.2,anorex.3)) > } > \keyword{ models } > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand at nhh.no
Patrick Giraudoux
2005-Oct-29 09:03 UTC
[R] LaTex error when creating DVI version when compiling package
Thanks both.... Explanations perfectly clear. Also you make me discover there was a 'pgirmess-manual.log', with error lines detected and commented, indeed... (shame on me!!!) which would have been of great help during the past decade... The misuse of _ should be the origin. I should manage with, now. Thank again, Patrick>The general answer is to look through the (often very long) *.log file in >the *.Rcheck directory until you find the problem. That will typically >give you a line number in the *.tex file, which shows not only where the >error occurred, but the *.log file entry often shows what it is. My >typical errors are using LaTeX special symbols, and most often having >unprotected $ and _. I see quite a lot of _ below in \value{}, so I'd try >\_ there first. > >Roger >Berwin A Turlach a ä¾€crit :>G'day Patrick > > > >>>>>>"PG" == Patrick Giraudoux <patrick.giraudoux@univ-fcomte.fr> writes: >>>>>> >>>>>> > > PG> \value{ A list with the following items: \item{AIC}{a > PG> data.frame including LL, the maximized log-likelihood; K the > PG> number of estimated parameters; N2K, number of observations/K; > PG> AIC, the Akaike index criterion; deltAIC, the difference > PG> between AIC and the lowest AIC value; w_i, the Akaike weights; >w_i is LaTeX notation for "w subscript i" and needs to be inside a >maths environment otherwise there will be a LaTeX error. Change this >to, e.g. \eqn{w_i} > > PG> AICc, the second order Akaike criterion; deltAICc, the > PG> difference between AICc and the lowest AICc value; w_ic, the >w_ic is LaTeX notation for "w subscript i followed by c". This needs >to be insite a maths environment to avoid a LaTeX error. But I >presume that your intention is actuall "w subscript {ic}", thus change >this to, e.g. \eqn{w_{ic}} > >HTH. > >Cheers, > > Berwin > >PS: Would make life simple for checker if you sent along the .log > file in future. :) > > >[[alternative HTML version deleted]]