forked from isubirana/compareGroups
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_logo.R
73 lines (53 loc) · 2.29 KB
/
build_logo.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
devtools::install_github("GuangchuangYu/hexSticker")
library(hexSticker)
library(compareGroups)
data(predimed)
png("man/figures/favicon.png", 480*10/7, 480*7/7)
par(mar=c(0,0,0,0))
plot(1, 1, type="n", axes=FALSE, xlim=c(0,1), ylim=c(0,1), xlab="", ylab="")
abline(v=c(0.15,0.85), h=0.85, lwd=3)
mtext("N", 3, line=-4, cex=4)
mtext(expression(bar(x) %+-% sigma), 3, line=-9, cex=4)
mtext("n (%)", 3, line=-14, cex=4)
mtext("Med [Q1;Q3]", 3, line=-19, cex=4)
dev.off()
png("man/figures/subplot.png", 480*7/5, 480*7/7,bg = "transparent")
par(mar=c(0,0,0,0))
plot(1, 1, type="n", axes=FALSE, xlim=c(0,2), ylim=c(0,2), xlab="", ylab="")
# text(1, 1, expression(bar(x) %+-% sigma),cex=10, adj = c(0.5, 0.5), font=3, col="white")
# mtext("n (%)", 3, line=-20, cex=8)
dev.off()
png("man/figures/subplot.png", 480*7/4, 480*7/7,bg = "transparent")
par(mar=c(0,0,0,0))
boxplot(iris[,1]~iris[,5],col=2:4,axes=FALSE,lwd=3,border="white")
# plot(1, 1, type="n", axes=FALSE, xlim=c(0,2), ylim=c(0,2), xlab="", ylab="")
# text(1, 1, expression(bar(x) %+-% sigma),cex=10, adj = c(0.5, 0.5), font=3, col="white")
# mtext("n (%)", 3, line=-20, cex=8)
dev.off()
png("man/figures/subplot.png", 480*7/4, 480*7/7,bg = "transparent")
par(mar=c(0,0,0,0))
plot(1,1,xlim=c(-1,1),ylim=c(-1,1),axes=FALSE, xlab="",ylab="")
abline(v=0,h=0,lwd=4,col="white")
text(-0.5,0.5,expression(bar(x)), cex=9,col="white")
text(0.5,0.5,expression(sigma^2), cex=9,col="white")
text(-0.5,-0.5,"N", cex=9,col="white")
text(0.5,-0.5,"%", cex=9,col="white")
dev.off()
library(showtext)
## Loading Google fonts (http://www.google.com/fonts)
font_add_google("Gochi Hand", "gochi")
font_add_google("Knewave", "knewave")
## Automatically use showtext to render text for future devices
showtext_auto()
sticker("man/figures/subplot.png",
package="compareGroups", dpi=300,
p_size=17, p_family="knewave",p_x=1, p_y=0.60, # "wqy-microhei"
s_x=1, s_y=1.20, s_width=0.85, s_height=0.60,
spotlight = TRUE, l_x=1, l_y=0.9,asp = 1,
filename="man/figures/logo.png")
library(pkgdown)
build_favicon()
build_home()
build_site()
export2md(descrTable(group~., predimed, hide.no="no", type=1, sd.type=3)[1:5],strip = TRUE,
first=TRUE,background=grey(0.9),header.background="blue",header.color="white", header.label=c("p.overall"="p-value"))