round() 使用Sweave/knitr时有没有办法避免这个功能?round(,2)每次写作都真烦人\Sexpr{}.我希望在整个文档中有两个小数位.
感谢您的帮助
Macs
我在Win7下使用Rstudio.knitr有没有办法自动逃脱角色?请参阅下面的简单示例:
\documentclass[a4]{article}
\title{Example}
\author{Stat-R}
\begin{document}
\maketitle
<<nothing,echo=FALSE>>=
my_name <- 'hari'
my_number <- 100
df1 <- data.frame(my_name,my_number)
df1
# names(df1)
@
\section{Testing only}
Now I will print the columnnames of my data frame df1
$\Sexpr{names(df1)}$
\end{document}
Run Code Online (Sandbox Code Playgroud)
我得到以下输出...

但我想要以下内容

我必须在我的tex文件中将所有'_'更改为'_'.有没有办法在sweave文件中直接执行它.我将不胜感激任何有关这方面的建议......