R语言,在shiny中给文本加底色和注释笔记

2021-08-30  本文已影响0人  youmigo

R语言,在shiny中给文本加底色和注释笔记

image.png
image.png
# Tue Aug 10 16:27:49 2021 -

# 字符编码:UTF-8
# R 版本:R x64 4.1 for window 11
# cgh163email@163.com
# 个人笔记不负责任,拎了个梨🍐🍈
#.rs.restartR()
require(recogito)
rm(list = ls());gc()

txt <- "Josh went to the bakery in Brussels.\nWhat an adventure!"
x   <- recogito(inputId = "annotations", txt)
x
x   <- recogito(inputId = "annotations", txt, type = "tags",
                tags = c("LOCATION", "TIME", "PERSON"))
x
txt <- "Lorem ipsum dolor sit amet consectetur adipiscing elit Quisque tellus urna
  placerat in tortor ac imperdiet sollicitudin mi Integer vel dolor mollis feugiat
  sem eu porttitor elit Sed aliquam urna sed placerat euismod In risus sem ornare
  nec malesuada eu ornare quis dui Nunc finibus fermentum sollicitudin Fusce vel
  imperdiet mi ac faucibus leo Cras massa massa ultricies et justo vitae molestie
  auctor turpis Vestibulum euismod porta risus euismod dapibus Nullam facilisis
  ipsum sed est tempor et aliquam sapien auctor Aliquam velit ligula convallis a
  dui id varius bibendum quam Cras malesuada nec justo sed
  aliquet Fusce urna magna malesuada"
x   <- recogito(inputId = "annotations", txt)
x
x   <- recogito(inputId = "annotations", txt, type = "tags",
                tags = c("LOCATION", "TIME", "PERSON", "OTHER"))
x

##
## Color the tags by specifying CSS - they should have .tag-{TAGLABEL}
##
library(htmltools)
cat(readLines(system.file(package = "recogito", "examples", "example.css")), sep = "\n")
tagsetcss <- htmlDependency(name = "mytagset", version = "1.0",
                            src = system.file(package = "recogito", "examples"),
                            stylesheet = "example.css")
x   <- recogito(inputId = "annotations", txt,
                tags = c("LOCATION", "TIME", "PERSON", "OTHER"),
                dependencies = tagsetcss)
x
# Tue Aug 10 16:41:46 2021 --end
上一篇下一篇

猜你喜欢

热点阅读