1

When I write RMD files, sometimes I get "warning message".

console messages, as belows.

> library('gapminder')
Warning messages:
1: In res[i] <- withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),  :
number of items to replace is not a multiple of replacement length
2: In res[i] <- withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),  :
number of items to replace is not a multiple of replacement length
> gapminder[gapminder$country=='Afghanistan', c('pop','gdpPercap')]
Warning messages:
1: In res[i] <- withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),  :
number of items to replace is not a multiple of replacement length
...

The strange thing is that if I create an R file instead of an RMD, a warning message will not be output for the same command.

So I guess that this warning message is caused by RMD.

---
title: "test"
output:
  html_document:
    number_sections: true
    toc: true
    toc_depth: 6
    toc_float: true
  html_notebook:
    number_sections: true
    toc: true
    toc_depth: 6
    toc_float: true
---
```{r, eval=TRUE}
library('gapminder')
gapminder[gapminder$country=='Afghanistan', c('pop','gdpPercap')]
```
Waylan
  • 37,164
  • 12
  • 83
  • 109
b.joy
  • 11
  • 2
  • 1
    Possible duplicate of [R - Markdown avoiding package loading messages](https://stackoverflow.com/questions/13090838/r-markdown-avoiding-package-loading-messages) – pogibas Jan 07 '19 at 08:51

0 Answers0