File: embed.R

package info (click to toggle)
r-cran-diffobj 0.3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,432 kB
  • sloc: ansic: 455; javascript: 96; sh: 32; makefile: 8
file content (68 lines) | stat: -rw-r--r-- 1,967 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
## ----echo=FALSE---------------------------------------------------------------
library(diffobj)

## ----results='asis'-----------------------------------------------------------
cat(
  as.character(
    diffPrint(
      1:5, 2:6,
      format="html",
      style=list(html.output="diff.w.style")
) ) )

## ----results='asis'-----------------------------------------------------------
cat(
  as.character(
    diffPrint(
      1:5, 2:6,
      format="html",
      style=list(html.output="diff.only")   # notice this changed
) ) )

## ----eval=FALSE---------------------------------------------------------------
#  options(
#    diffobj.format="html",
#    diffobj.style=list(html.output="diff.only")
#  )

## ----echo=FALSE---------------------------------------------------------------
old.opts <- options(
  diffobj.format="html",
  diffobj.style=list(html.output="diff.only")
)

## ----results='asis'-----------------------------------------------------------
cat(as.character(diffPrint(1:5, 2:6)))

## ----echo=FALSE---------------------------------------------------------------
options(old.opts)

## ---- eval=FALSE--------------------------------------------------------------
#  library(shiny)
#  shinyApp(
#    ui=fluidPage(htmlOutput('diffobj_element')),
#    server=function(input, output) {
#      output$diffobj_element <- renderUI({
#        HTML(
#          as.character(
#            diffPrint(
#              1:5, 2:6,
#              format="html",
#              style=list(html.output="diff.w.style")
#  ) ) )}) } )

## ---- eval=FALSE--------------------------------------------------------------
#  options(
#    diffobj.format="html",
#    diffobj.style=list(html.output="diff.only")
#  )
#  shinyApp(
#    ui=fluidPage(
#      includeCSS(diffobj_css()),
#      htmlOutput('diffobj_element')
#    ),
#    server=function(input, output) {
#      output$diffobj_element <- renderUI({
#        HTML(as.character(diffPrint(1:5, 2:6,)))
#  }) } )