小编Die*_*ona的帖子

将 Rmarkdown 与 CDN 中的 CSS 结合使用

我想使用 CDN 中的 Bootstrap CSS 创建 Rmarkdown ( http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css )。

我正在尝试这样做,但没有成功......

这就是我尝试过的(我尝试不使用 NULL,也不使用“”,但我遇到了同样的错误)

---
title: "Habits"
output:
  html_document:
    theme: NULL
    highlight: NULL
    css: "http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"

---
Run Code Online (Sandbox Code Playgroud)

产生的错误是:

"E:/Program Files/R/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS teste.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output teste.html --smart --email-obfuscation none --self-contained --standalone --section-divs --template "C:\Users\diego\Documents\R\win-library\3.2\rmarkdown\rmd\h\default.html" --css "http:\\maxcdn.bootstrapcdn.com\bootstrap\3.3.6\css\bootstrap.min.css" --mathjax --variable "mathjax-url:https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --no-highlight 
output file: teste.knit.md

pandoc.exe: Could not fetch http:\\maxcdn.bootstrapcdn.com\bootstrap\3.3.6\css\bootstrap.min.css
InvalidUrlException "http:%5C%5Cmaxcdn.bootstrapcdn.com%5Cbootstrap%5C3.3.6%5Ccss%5Cbootstrap.min.css" "URL must be absolute"
Error: pandoc document conversion failed with error 67
Besides that: Warning message:
command execution …
Run Code Online (Sandbox Code Playgroud)

css r twitter-bootstrap knitr r-markdown

4
推荐指数
1
解决办法
1855
查看次数

将Quanteda包中的dfmSparse转换为R中的数据帧或数据表

我有一个dfmSparse对象(大,2.1GB),它被标记化并使用ngrams(unigrams,bigrams,trigrams和fourgrams),我想将它转换为数据框或数据表对象的列:内容和频率.

我试图取消列出......但没有奏效.我是NLP的新手,我不知道使用的方法,我没有想法,也没有在这里或谷歌找到解决方案.

有关数据的一些信息:

>str(tokfreq)
Formal class 'dfmSparse' [package "quanteda"] with 11 slots
  ..@ settings    :List of 1
  .. ..$ : NULL
  ..@ weighting   : chr "frequency"
  ..@ smooth      : num 0
  ..@ ngrams      : int [1:4] 1 2 3 4
  ..@ concatenator: chr "_"
  ..@ Dim         : int [1:2] 167500 19765478
  ..@ Dimnames    :List of 2
  .. ..$ docs    : chr [1:167500] "character(0).content" "character(0).content" "character(0).content" "character(0).content" ...
  .. ..$ features: chr [1:19765478] "add" "lime" "juice" "tequila" ...
  ..@ …
Run Code Online (Sandbox Code Playgroud)

nlp r dataframe data.table quanteda

4
推荐指数
1
解决办法
2220
查看次数

即使在示例页面(安装了rmarkdown软件包),Shiny-server也不显示rmarkdown

我在Amazon AWS EC-2(Amazon Linux AMI 2015.09.1(HVM),SSD卷类型 - ami-60b6c60a)上安装了一个闪亮的服务器.服务器适用于Shiny应用程序,但不会渲染.rmd,甚至是示例页面中的rmd.

我只看到这个错误:

错误:运行命令错误

错误

在HTML中:

<div id="__reactivedoc__" class="shiny-html-output shiny-bound-output shiny-output-error">error in running command</div>
Run Code Online (Sandbox Code Playgroud)

我已经安装了rmarkdown软件包,它在Rstudio上工作正常.(我为Rstudio和Shiny服务器使用相同的用户).

我不知道如何获得有关错误的更多信息,我没有看到其他消息.

有人有想法吗?


新信息:我调查来自服务器的日志:这是/ var/log/shiny-server /的输出:

su: ignore --preserve-environment, it's mutually exclusive to --login.

Listening on http://127.0.0.1:52294

/opt/shiny-server/ext/pandoc/pandoc: error while loading shared libraries: libgmp.so.3: cannot open shared object file: No such file or directory
Warning: Error in system: error in running command
Stack trace (innermost first):
    97: system
    96: force
    95: with_pandoc_safe_environment
    94: get_pandoc_version
    93: FUN
    92: lapply
    91: …
Run Code Online (Sandbox Code Playgroud)

r r-markdown shiny shiny-server

3
推荐指数
1
解决办法
1657
查看次数