Escaping LaTeX control symbols in Hmisc::latex
问题 I have a data frame in R which unfortunately has strings in it containing dollar signs. When the function latex() from the package Hmisc converts this data frame to a LaTeX table, the dollar signs are not escaped. This renders the LaTeX uncompilable. Is there a way within Hmisc to escape dollar signs when formatting values from a data frame? I can't run search and replace over all dollar signs afterwards either, because the Hmisc itself adds dollar signs for the empty cells. Minimal example: