-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtesting.R
100 lines (55 loc) · 2.14 KB
/
testing.R
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
## 616 base XML
library(opendocx)
doc <- Doc$new()
doc$document <- readLines("C:/Users/Alex/Desktop/doc1/word/document.xml", warn = FALSE)[[2]]
x <- iris[1:4,]
doc$document <- write.docx(x, layout = "portrait")
writeLines(xml, "c:/users/alex/desktop/testing.xml")
##
install.packages("opendocx_1.0.5.tar.gz", repos = NULL, type = "source")
doc <- Doc$new()
doc$document <- doc$buildTable(x, layout = layout, colour = colour)
doc$styles <- c(doc$styles, makeTableStyle())
doc$stylesWithEffects <- ""
saveDoc(doc = doc, file = file, overwrite = overwrite)
x <- iris[1:5,1:5]
doc <- write.docx(x, "c:/users/alex/desktop/testing.docx", layout = "portrait", colour = NULL)
shell("c:/users/alex/desktop/testing.docx")
doc <- write.docx(x, "c:/users/alex/desktop/testing1.docx", layout = "portrait", colour = "#4f81BD")
shell("c:/users/alex/desktop/testing1.docx")
doc <- write.docx(x, "c:/users/alex/desktop/testing2.docx", layout = "landscape", colour = "#C0504D")
shell("c:/users/alex/desktop/testing2.docx")
doc$document
doc$document
cat(doc$document)
grepl('943634', doc$styles)
doc$document
write.docx(x, "c:/users/alex/desktop/testing2.docx", layout = "landscape")
shell("c:/users/alex/desktop/testing.docx")
## plain table
<w:style w:type="table" w:styleId="TableGrid">
<w:name w:val="Table Grid"/>
<w:basedOn w:val="TableNormal"/>
<w:uiPriority w:val="59"/>
<w:rsid w:val="00D9152C"/>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
</w:pPr>
<w:tblPr>
<w:tblInd w:w="0" w:type="dxa"/>
<w:tblBorders>
<w:top w:val="single" w:sz="4" w:space="0" w:color="auto"/>
<w:left w:val="single" w:sz="4" w:space="0" w:color="auto"/>
<w:bottom w:val="single" w:sz="4" w:space="0" w:color="auto"/>
<w:right w:val="single" w:sz="4" w:space="0" w:color="auto"/>
<w:insideH w:val="single" w:sz="4" w:space="0" w:color="auto"/>
<w:insideV w:val="single" w:sz="4" w:space="0" w:color="auto"/>
</w:tblBorders>
<w:tblCellMar>
<w:top w:w="0" w:type="dxa"/>
<w:left w:w="108" w:type="dxa"/>
<w:bottom w:w="0" w:type="dxa"/>
<w:right w:w="108" w:type="dxa"/>
</w:tblCellMar>
</w:tblPr>
</w:style>