File tree Expand file tree Collapse file tree 2 files changed +25
-9
lines changed
Expand file tree Collapse file tree 2 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -51,14 +51,27 @@ open_device <- function(file_path, resolution = 300) {
5151 stop(" Argument 'resolution' must be a numeric value." , call. = FALSE )
5252 }
5353
54- grDevices :: png(
55- filename = file_path ,
56- width = 4.39 ,
57- height = 5.08 ,
58- units = " cm" ,
59- res = resolution ,
60- bg = " transparent"
61- )
54+ if (.Platform [[" OS.type" ]] == " windows" ) {
55+ grDevices :: png(
56+ filename = file_path ,
57+ width = 4.39 ,
58+ height = 5.08 ,
59+ units = " cm" ,
60+ res = resolution ,
61+ bg = " transparent" ,
62+ type = " cairo" ,
63+ antialias = " none"
64+ )
65+ } else {
66+ grDevices :: png(
67+ filename = file_path ,
68+ width = 4.39 ,
69+ height = 5.08 ,
70+ units = " cm" ,
71+ res = resolution ,
72+ bg = " transparent"
73+ )
74+ }
6275
6376}
6477
Original file line number Diff line number Diff line change 33<!-- badges: start -->
44[ ![ Project Status: Active – The project has reached a stable, usable state and is being actively developed.] ( https://www.repostatus.org/badges/latest/active.svg )] ( https://www.repostatus.org/#active )
55[ ![ R-CMD-check] ( https://github.com/matt-dray/gex/actions/workflows/R-CMD-check.yaml/badge.svg )] ( https://github.com/matt-dray/gex/actions/workflows/R-CMD-check.yaml )
6+ [ ![ Blog posts] ( https://img.shields.io/badge/rostrum.blog-posts-008900?labelColor=000000&logo=data%3Aimage%2Fgif%3Bbase64%2CR0lGODlhEAAQAPEAAAAAABWCBAAAAAAAACH5BAlkAAIAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAEAAQAAAC55QkISIiEoQQQgghRBBCiCAIgiAIgiAIQiAIgSAIgiAIQiAIgRAEQiAQBAQCgUAQEAQEgYAgIAgIBAKBQBAQCAKBQEAgCAgEAoFAIAgEBAKBIBAQCAQCgUAgEAgCgUBAICAgICAgIBAgEBAgEBAgEBAgECAgICAgECAQIBAQIBAgECAgICAgICAgECAQECAQICAgICAgICAgEBAgEBAgEBAgICAgICAgECAQIBAQIBAgECAgICAgIBAgECAQECAQIBAgICAgIBAgIBAgEBAgECAgECAgICAgICAgECAgECAgQIAAAQIKAAAh%2BQQJZAACACwAAAAAEAAQAAAC55QkIiESIoQQQgghhAhCBCEIgiAIgiAIQiAIgSAIgiAIQiAIgRAEQiAQBAQCgUAQEAQEgYAgIAgIBAKBQBAQCAKBQEAgCAgEAoFAIAgEBAKBIBAQCAQCgUAgEAgCgUBAICAgICAgIBAgEBAgEBAgEBAgECAgICAgECAQIBAQIBAgECAgICAgICAgECAQECAQICAgICAgICAgEBAgEBAgEBAgICAgICAgECAQIBAQIBAgECAgICAgIBAgECAQECAQIBAgICAgIBAgIBAgEBAgECAgECAgICAgICAgECAgECAgQIAAAQIKAAA7 )] ( https://www.rostrum.blog/index.html#category=gex )
67<!-- badges: end -->
78
89## What
@@ -95,13 +96,15 @@ That creates this absolutely stunning demo sticker, written to the specified `fi
9596
9697Note that you can't rely on plot-window previews when you're developing your sticker (they lie).
9798You must inspect the generated PNG file instead.
98- From R, you could do this with a ` system() ` call:
99+ You could do this with a ` system() ` call from R :
99100
100101``` r
101102# Open the PNG hex image for inspection
102103system(paste(" open" , temp_path ))
103104```
104105
106+ Try ` start ` rather than ` open ` on Windows.
107+
105108## Related
106109
107110For more established hex-making tools with R, try:
You can’t perform that action at this time.
0 commit comments