-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenlogo.R
57 lines (51 loc) · 1.5 KB
/
genlogo.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
#install.packages("hexSticker")
library(hexSticker)
#install.packages("ggplot2")
library(ggplot2)
#install.packages("emojifont")
library(emojifont)
# fa4
#r <- ggplot() + geom_fontawesome("fa-calculator", color='red', size = 20) + theme_void()
# fa5
#install.packages("fontawesome")
library(fontawesome)
aaa=fa(name = "fab fa-contao", fill = "orange")
print_fontawesome<- function (x, view = interactive(), ...)
{
dots <- list(...)
html <- paste(x, collapse = "\n")
c("<!DOCTYPE html>", "<html>", "<head>", "<meta charset=\"utf-8\">",
"</head>", "<body>", html, "</body>", "</html>") %>%
paste(collapse = "\n") %>% htmltools::HTML() %>% htmltools::html_print()
return(html)
}
library(rsvg)
cat(print_fontawesome(aaa, view=FALSE),file="man/figures/fa-contao.svg")
SVGres <- rsvg_svg("man/figures/fa-contao.svg","man/figures/Cairo-fa-contao.svg")
SVGres <- rsvg_svg("man/figures/fa-contao.svg")
PDFres <- rsvg_pdf("man/figures/fa-contao.svg","man/figures/Cairo-fa-contao.pdf")
PDFres <- rsvg_pdf("man/figures/fa-contao.svg")
library(png)
library(grid)
library(cowplot)
library(magick)
theme_set(theme_cowplot())
r = ggdraw() +
draw_image("man/figures/Cairo-fa-contao.pdf", scale = .55)
sticker(
r,
package = "plsRcox",
p_size = 8,
s_x = .98,
s_y = 0.7,
s_width = 1.7,
s_height = 1.3,
p_x = 1,
p_y = 1.3,
url = "https://cran.r-project.org/package=plsRcox",
u_color = "white",
u_size = 1.1,
h_fill = "black",
h_color = "grey",
filename = "man/figures/logo.png"
)