Запустите knitr, используя rmarkdown::render("yourfile.Rmd")
, и он запустится в текущем сеансе.Тогда warnings () сработает.
Например, я не вижу предупреждений из вашего кода, но когда я добавил
for ( i in 1:100)
warning(i)
к коду кода, я получил сообщение вродеваша.Так что я использовал вышеупомянутую идею и увидел
> rmarkdown::render("~/temp/Untitled.Rmd")
processing file: Untitled.Rmd
|................ | 25%
ordinary text without R code
|................................ | 50%
label: global_options (with options)
List of 1
$ include: logi FALSE
|................................................. | 75%
ordinary text without R code
|.................................................................| 100%
label: setup
output file: Untitled.knit.md
'/Applications/RStudio 2.app/Contents/MacOS/pandoc/pandoc' +RTS -K512m -RTS Untitled.utf8.md --to pptx --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash+smart --output Untitled.pptx --slide-level 2
Output created: Untitled.pptx
There were 50 or more warnings (use warnings() to see the first 50)
> warnings()
Warning messages:
1: In eval(expr, envir, enclos) : 1
2: In eval(expr, envir, enclos) : 2
3: In eval(expr, envir, enclos) : 3
4: In eval(expr, envir, enclos) : 4
5: In eval(expr, envir, enclos) : 5
6: In eval(expr, envir, enclos) : 6
7: In eval(expr, envir, enclos) : 7
8: In eval(expr, envir, enclos) : 8
9: In eval(expr, envir, enclos) : 9
10: In eval(expr, envir, enclos) : 10
11: In eval(expr, envir, enclos) : 11
12: In eval(expr, envir, enclos) : 12
13: In eval(expr, envir, enclos) : 13
14: In eval(expr, envir, enclos) : 14
15: In eval(expr, envir, enclos) : 15
16: In eval(expr, envir, enclos) : 16
17: In eval(expr, envir, enclos) : 17
18: In eval(expr, envir, enclos) : 18
19: In eval(expr, envir, enclos) : 19
20: In eval(expr, envir, enclos) : 20
21: In eval(expr, envir, enclos) : 21
22: In eval(expr, envir, enclos) : 22
23: In eval(expr, envir, enclos) : 23
24: In eval(expr, envir, enclos) : 24
25: In eval(expr, envir, enclos) : 25
26: In eval(expr, envir, enclos) : 26
27: In eval(expr, envir, enclos) : 27
28: In eval(expr, envir, enclos) : 28
29: In eval(expr, envir, enclos) : 29
30: In eval(expr, envir, enclos) : 30
31: In eval(expr, envir, enclos) : 31
32: In eval(expr, envir, enclos) : 32
33: In eval(expr, envir, enclos) : 33
34: In eval(expr, envir, enclos) : 34
35: In eval(expr, envir, enclos) : 35
36: In eval(expr, envir, enclos) : 36
37: In eval(expr, envir, enclos) : 37
38: In eval(expr, envir, enclos) : 38
39: In eval(expr, envir, enclos) : 39
40: In eval(expr, envir, enclos) : 40
41: In eval(expr, envir, enclos) : 41
42: In eval(expr, envir, enclos) : 42
43: In eval(expr, envir, enclos) : 43
44: In eval(expr, envir, enclos) : 44
45: In eval(expr, envir, enclos) : 45
46: In eval(expr, envir, enclos) : 46
47: In eval(expr, envir, enclos) : 47
48: In eval(expr, envir, enclos) : 48
49: In eval(expr, envir, enclos) : 49
50: In eval(expr, envir, enclos) : 50