一些在 Rmarkdown 中打印没有问题但没有使用 papaja 模板打印的 R 对象。它不会生成任何错误消息。例如,假设我写了一个降价文件,如下所示:
```{r setup, include = FALSE}
knitr::opts_chunk$set(include = FALSE)
```
```{r}
library("pacman")
p_load(plyr, dplyr, ggplot2, lmSupport, lme4, psycho, psych,
GPArotation, tidyverse, tinytex, afex, foreign,purrr, lavaan, citr,
papaja)
options(scipen = 0, digits = 3)
DF <- data.frame(id = paste0("ID.", 1:200),
x = sample(c("control", "treat"), 200, replace = TRUE),
y = rnorm(200))
m <- lm(y ~x, data= DF)
summary(m)
s1<-apa_print.lm(m)
s1$statistic[2]
```
# Result
I fitted a linear regression model in which condition (control vs.
treat) predicts scores. Treat group showed significantly higher scores
compared to control group, `r s1$estimate[2]`, `r s1$statistic[2]`.