在 rmarkdown 中抑制来自 nnet 包的权重信息
Suppress weights information from nnet package in rmarkdown
是否可以在rmarkdown中抑制来自nnet包的权重信息?如果我设置 include = FALSE,所有内容都将被隐藏。 message = FALSE 似乎不起作用。
---
title: "Crimes"
date: "19/11/2021"
output: word_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, message = FALSE)
library(nnet)
library(gtsummary)
set.seed(20211119)
# dummy data
crime <-
data.frame(
city = sample(c("SF", "AR", "NYC", "MN"), 13000, replace = TRUE),
year = sample(as.factor(c(1990, 2000, 1999, 1989)), 13000, replace = TRUE)
)
```
```{r}
tbl <-
nnet::multinom(city ~ year, data = crime) %>%
tbl_regression(exponentiate = TRUE)
tbl
```
你想要这个输出吗?
```{r, message = FALSE, echo = FALSE, include = FALSE}
tbl <-
nnet::multinom(city ~ year, data = crime) %>%
tbl_regression(exponentiate = TRUE)
```
```{r}
tbl
```
是否可以在rmarkdown中抑制来自nnet包的权重信息?如果我设置 include = FALSE,所有内容都将被隐藏。 message = FALSE 似乎不起作用。
---
title: "Crimes"
date: "19/11/2021"
output: word_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, message = FALSE)
library(nnet)
library(gtsummary)
set.seed(20211119)
# dummy data
crime <-
data.frame(
city = sample(c("SF", "AR", "NYC", "MN"), 13000, replace = TRUE),
year = sample(as.factor(c(1990, 2000, 1999, 1989)), 13000, replace = TRUE)
)
```
```{r}
tbl <-
nnet::multinom(city ~ year, data = crime) %>%
tbl_regression(exponentiate = TRUE)
tbl
```
你想要这个输出吗?
```{r, message = FALSE, echo = FALSE, include = FALSE}
tbl <-
nnet::multinom(city ~ year, data = crime) %>%
tbl_regression(exponentiate = TRUE)
```
```{r}
tbl
```