r - 在Shiny-Server中发布后如何在Rmarkdown中启用表情符号以显示

标签 r shiny r-markdown emoji shiny-server

我有以下Rmarkdown代码,该代码使用Hadley的 emo(ji) 软件包。

---
title: "My First Shiny"
runtime: shiny
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    vertical_layout: scroll
---


```{r setup, include=FALSE}
```


Rows {data-height=800}
-----------------------------------------------------------------------

### Section1 `r strrep(emo::ji("heart_eyes_cat"), 5)`

Some text

在我的Rstudio IDE中,生成此文件没有问题:

enter image description here

由于图像中的表情符号太高,因此表情符号无法显示在我的 local Shiny-server.

如何启用它?

最佳答案

根据github documentation,您的文件应读取以下内容:

S3method(print,emoji)
export(ji)
export(ji_find)
export(ji_p)


ji_p <- function(x) {
   stopifnot(is.numeric(x))

   out <- stats::symnum(x,
     corr = FALSE,
     na = FALSE,
     cutpoints = c(0, 1e-5, 0.001, 0.01, 0.05, 0.1, 1),
     symbols = c(ji("laughing"), ji("joy"), ji("grin"), ji("smile"), ji("thinking"), ji("poop"))
   )

   structure(out, class = c("emoji", class(out)))

 }

我没有看到任何简写形式,因为您似乎已经在代码中使用了(使用, 5),并且r前缀现在似乎已被删除;内联使用时,可以使用它,但是需要在其前后使用额外的“滴答”,如下所示:
 `` `r emo::ji("smile")` ``

您使用的是较早版本的提交吗?不再需要编织物,现在只需要点缀即可。检查this latest commit doc out

我希望这会有所帮助

关于r - 在Shiny-Server中发布后如何在Rmarkdown中启用表情符号以显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44943215/

相关文章:

r - 在 R 中转换因子变量分钟 :second to numerical variable minute. 秒

javascript - R Shiny 仪表板 valueBox : Animation from one number to another

html - R shiny - 使用 titlePanel 在浏览器窗口中添加 Logo

r - 如何在r中查看类似表格样式的列表

r - 使用knitr和latex在Beamer中编码 block 字体大小

r - 如何在 R Markdown 中将选项传递给 LaTeX 字体?

r - 使用 gsub() 替换除某些子字符串之外的所有数字

javascript - 处理后从plotly select中清除event_data

r - backtransform `scale()` 用于绘图

jquery - 使用 ajax 的带有子行的 Shiny 数据表