magick
패키지는 문제를 해결하는 열쇠였다
# Load the package
require(magick)
# Create white canvas initializing magick graphical device
img <- image_graph(width = 140, height = 40, bg = "white", pointsize = 20,
res = 120, clip = TRUE, antialias = TRUE)
# Set margins to 0
par(mar = c(0,0,0,0))
# Initialize plot & print text
plot(c(0,1), axes = FALSE, main = "", xlab = "", ylab = "", col = "white")
text(0.95, 0.42, "Test", pos = 4, family = "mono", font = 2)
# Close the magick image device
dev.off()
# Convert to grayscale & extract pixelmatrix as integers
img <- image_convert(img, colorspace = "gray")
target <- drop(as.integer(img[[1]]))
당신은 아마 magik` 패키지 '와 함께이 작업을 수행 할 수 있습니다
-하지만 그래픽 장치를 사용합니다 –