在.Rnw
中,我试图用从R代码动态生成的值构建表。我想在观星台生成的表中添加希腊字母名称。
(我正在使用R studio)。有问题的块看起来像这样。
<> = aux <-setNames(c(0.334,0.301,3.093,-0.242,0.049,0.018,0,0.012,0.022),c(“ $ \ beta_ {0} $”,“ kappa”,“ mu”,“ lambda” ,“ xi1”,“ xi2”,“ xi3”,“ xi4”,“ xi5”))
stargazer(aux,title =“我的桌子”,输入=“ latex”) @
我得到以下内容-显然,用pdf编译时无法理解“ beta”。
\begin{table}[!htbp] \centering
\caption{Comparison of results}
\label{}
\begin{tabular}{@{\extracolsep{5pt}} ccccccccc}
\\[-1.8ex]\hline
\hline \\[-1.8ex]
\$\$\textbackslash beta\_\{0\}\$\$ & kappa & mu & lambda & xi1 & xi2 & xi3 & xi4 & xi5 \\
\hline \\[-1.8ex]
$0.334$ & $0.301$ & $3.093$ & $$-$0.242$ & $0.049$ & $0.018$ & $0$ & $0.012$ & $0.022$ \\
\hline \\[-1.8ex]
\end{tabular}
\end{table}