简体   繁体   中英

Suppress weights information from nnet package in rmarkdown

Is it possible to suppress the weights information from the nnet package in rmarkdown? If I set include = FALSE, everything will be hidden. message = FALSE does not appear to work.

---
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

```

Do you want this output?

```{r, message = FALSE, echo = FALSE, include = FALSE}
tbl <-
  nnet::multinom(city ~ year, data = crime) %>%
  tbl_regression(exponentiate = TRUE)
```

```{r}
tbl
```

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM