Hi Rich,

 

I’m not doing the same thing as Hmisc::latex().  That generates a .tex file and 
compiles it (or at least it appears to try to do that on my system, but it 
stopped partway through for me).

 

When I ran

 

Hmisc::latex(a~b)

 

It generated a .tex file for a table:

 

\begin{table}[!tbp]

\begin{center}

\begin{tabular}{l}

\hline\hline

\multicolumn{1}{c}{}\tabularnewline

\hline

~\tabularnewline

a\tabularnewline

b\tabularnewline

\hline

\end{tabular}\end{center}

\end{table}

 

While I’m wanting an equation:

 

$$a = b$$

 

Thanks,

 

Bill

 

From: Richard M. Heiberger <r...@temple.edu> 
Sent: Monday, February 17, 2020 10:31 AM
To: b...@denney.ws
Cc: r-package-devel@r-project.org
Subject: Re: [R-pkg-devel] Private S3 Method not Found

 

Please be consistent with the latex() function in the Hmisc package.  For 
example, for an array x, latex (x) produces a complete latex table environment. 
 See the ?latex helpfile for details.

 

Rich

 

On Mon, Feb 17, 2020 at 10:07 <b...@denney.ws <mailto:b...@denney.ws> > wrote:

Hello,



I'm working on a function in a package that will provide an exported
function that will convert formula to LaTeX equations.  For that, it
recursively goes through the formula converting objects of class "formula",
"call", "name", and "(" to LaTeX.



I have a private S3 generic function that I'm using for the conversion, but
for some reason, the generic is not detected, and checking the package fails
for that reason
(https://travis-ci.org/billdenney/bsd.report/jobs/651510333):



no applicable method for 'knit_print_helper_formula' applied to an object of
class "name"

Backtrace:

  1. testthat::expect_equal(...)

  4. bsd.report:::knit_print.formula(a ~ b(c))

  6. bsd.report:::knit_print_helper_formula.formula(x, ..., replacements =
replacements)

  9. bsd.report:::knit_print_helper_formula.call(x[[3]], ...)

10. bsd.report:::knit_print_helper_formula.function_call(x, ...)

11. base::sapply(...)

12. base::lapply(X = X, FUN = FUN, ...)

13. bsd.report:::FUN(X[[i]], ...)



But, there is a knit_print_helper_formula.name 
<http://knit_print_helper_formula.name>  function call defined
(https://github.com/billdenney/bsd.report/blob/master/R/knit_print.formula.R 
<https://github.com/billdenney/bsd.report/blob/master/R/knit_print.formula.R#L60-L79>
 
#L60-L79):



knit_print_helper_formula <- function(x, ...) {

  UseMethod("knit_print_helper_formula")

}



# Some other methods



knit_print_helper_formula.name <http://knit_print_helper_formula.name>  <- 
function(x, ...) {

# Function body

}



Does anyone know why the S3 method for name class objects is not found when
checking the package?



Thanks,



Bill


        [[alternative HTML version deleted]]

______________________________________________
R-package-devel@r-project.org <mailto:R-package-devel@r-project.org>  mailing 
list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


        [[alternative HTML version deleted]]

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to