功能不Knitr发现(Function is not found in Knitr)

2019-10-24 14:53发布

编译如下文档时,我有一个奇怪的问题。 se.ranef(model)se.fixef(model)在工作的罚款R 但是,如下图所示,突然,他们可能不会被发现。 出了什么问题吗? 谁能帮帮我,好吗? 谢谢!

\documentclass[english]{exam}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{bigints}
\usepackage[stable]{footmisc}
\usepackage{ulem}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{booktabs}
\usepackage{pdfpages}

\printanswers
\unframedsolutions

\begin{document}

\begin{questions}

\question 

\begin{solution}

<<>>=
library(lme4)
X <- 1:24
coag <- c(62, 60, 63, 59, 63, 67, 71, 64, 65, 66, 68, 66, 
          71, 67, 68, 68, 56, 62, 60, 61, 63, 64, 63, 59)
diet <- c("A", "A", "A",  "A",  "B",  "B",  "B",  "B",  "B",  "B", "C", 
          "C", "C", "C", "C", "C", "D", "D", "D", "D",  "D", "D", "D", "D")
#coag <- data.frame(cbind(X, coag, diet))
#coag <- read.table("coag.csv", sep=",", header=TRUE)
model <- lmer(coag~(1|diet))
@

<<>>=
se.ranef(model)
@

<<>>=
se.fixef(model)
@

\end{solution}

\end{questions}

\end{document}

Answer 1:

se.fixefse.ranef是从基,或功能不nlmeknitr开始当你运行一个新的环境,因此,任何其他包不会被加载。

尝试加载你从第一次得到了他们的图书馆,它添加到这里装载nlme

library(arm)


文章来源: Function is not found in Knitr