如何在flextable中包含超链接?

时间:2018-02-17 23:55:05

标签: r flextable officer

我正在尝试使用包含其单元格中包含超链接的表格的官员创建一个powerpoint文件,但我找不到如何操作的方法。

E.g。幻灯片上2列表格中的一行可以包括“Ensembl”。在第1栏中,第2栏会说' ENSG00000165025'然后单击它将打开浏览器“uswest.ensembl.org/Homo_sapiens/Gene/Summary?g = ENSG00000165025'”。第二列中的某些值可能只是纯文本。

这可能实现吗?

2 个答案:

答案 0 :(得分:0)

使用github上的新版本,您将能够在下面的演示中包含超链接:

Error:E/AndroidRuntime: FATAL EXCEPTION: main
Process: , PID: 32171 com.google.gson.JsonSyntaxException: java.io.EOFException: End of input at line 1 column 65536 path $[555].bBsid

答案 1 :(得分:0)

`

dat <- data.frame(
    col = "entrez", 
    href = "https://www.ncbi.nlm.nih.gov/gene?cmd=Retrieve&dopt=full_report&list_uids=6850", 
    stringsAsFactors = FALSE)

ft <- flextable(dat)
ft <- display(
    ft, col_key = "col", pattern = "# {{mylink}}",
    formatters = list(mylink ~ hyperlink_text(href, col) )
)
ft # works fine

doc <- read_pptx() %>% 
    add_slide(layout = 'Title and Content', 'Office Theme') %>% 
    ph_with_flextable(ft) # error
  

doc_parse_raw中的错误(x,encoding = encoding,base_url = base_url,   as_html = as_html,:EntityRef:expecting';' [23]

重复:

dat <- data.frame(
    col = "entrez", href = URLencode("https://www.ncbi.nlm.nih.gov/gene?cmd=Retrieve&dopt=full_report&list_uids=6850", reserved = TRUE),
    stringsAsFactors = FALSE)

ft <- flextable(dat)
ft <- display(
    ft, col_key = "col", pattern = "# {{mylink}}",
    formatters = list(mylink ~ hyperlink_text(href, col) )
)
ft # clicking the link in rstudio fails

doc <- read_pptx() %>% 
    add_slide(layout = 'Title and Content', 'Office Theme') %>% 
    ph_with_flextable(ft) # fine, no error message, but error message when opening pp file