teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

Update

2021/12/31 16:33

投稿

melian
melian

スコア21263

answer CHANGED
@@ -5,8 +5,8 @@
5
5
  ```R
6
6
  png("1.png", width = 600, height = 300, bg="transparent") # 描画デバイスを開く
7
7
  plot(0, 0, type = "n", xlim = c(0, 3), ylim = c(0, 9), xaxt="n", yaxt="n", xlab = "", ylab = "", bty="n")
8
- text(1, 1, intToUtf8(0x1F305), col = "red", cex = 10, adj = 0)
8
+ text(1, 4, intToUtf8(0x1F305), col = "red", cex = 10, adj = 0)
9
- text(1.6, 1, intToUtf8(0x1F38D), col = "red", cex = 10, adj = 0)
9
+ text(1.6, 4, intToUtf8(0x1F38D), col = "red", cex = 10, adj = 0)
10
10
  dev.off()
11
11
  ```
12
- ![emoji](6542242ed94f97de7fee8107f928ae3e.png)
12
+ ![emoji](e2587c2b47453dfedacdd24c3c076c69.png)

1

Update

2021/12/31 16:33

投稿

melian
melian

スコア21263

answer CHANGED
@@ -1,11 +1,12 @@
1
- 参考でに、こちらの環境では絵文字が表示されます。もしかするとフォント設定の問題かもしれませんね。
1
+ `intToUtf8` を使います。
2
2
 
3
- ```r
4
- $ R
5
- R version 4.1.2 (2021-11-01) -- "Bird Hippie"
3
+ [Convert Integer Vectors to or from UTF-8-encoded Character](https://stat.ethz.ch/R-manual/R-devel/library/base/html/utf8Conversion.html)
6
4
 
5
+ ```R
6
+ png("1.png", width = 600, height = 300, bg="transparent") # 描画デバイスを開く
7
+ plot(0, 0, type = "n", xlim = c(0, 3), ylim = c(0, 9), xaxt="n", yaxt="n", xlab = "", ylab = "", bty="n")
7
- > library("remoji")
8
+ text(1, 1, intToUtf8(0x1F305), col = "red", cex = 10, adj = 0)
8
- > message(emoji(list_emoji(), TRUE))
9
+ text(1.6, 1, intToUtf8(0x1F38D), col = "red", cex = 10, adj = 0)
10
+ dev.off()
9
11
  ```
10
-
11
- ![emoji](d36e242856763218114b0e52f8ec659f.png)
12
+ ![emoji](6542242ed94f97de7fee8107f928ae3e.png)