小编Ken*_*jin的帖子

在R Markdown上指定字体类型

如何指定字体类型,即Tahoma在R Markdown上.我使用以下内容来定义我的文档

---
bibliography: bibliography.bib
csl: nature.csl
documentclass: article
fontsize: 12pt
linkcolor: blue
mainfont: Arial
output: 
  pdf_document:
    fig_caption: Yes

---
Run Code Online (Sandbox Code Playgroud)

如何指定图标的字体大小 - 如下图所示

![Figure 2: The impact of malaria disease the factors within the bednet that in turn affect infections and other health issues](climate_change.png)
Run Code Online (Sandbox Code Playgroud)

r knitr r-markdown

8
推荐指数
1
解决办法
1万
查看次数

如何在RMarkdown中的公式中键入波浪号

我试图在RMarkdown上键入方程式来创建PDF,我想使用代字号,我该怎么做呢.我正在尝试这个,但扔了回来pandoc.exe: Error producing PDF from TeX source ....

---
title: "See"
date: "24 September 2016"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

follows a Bernouli distribution 
$$y_i \~ Bernouli(p_i)$$
Run Code Online (Sandbox Code Playgroud)

latex r r-markdown

8
推荐指数
1
解决办法
6826
查看次数

提取|之间的最后一个字 |

我有以下数据集

> head(names$SAMPLE_ID)
[1] "Bacteria|Proteobacteria|Gammaproteobacteria|Pseudomonadales|Moraxellaceae|Acinetobacter|"
[2] "Bacteria|Firmicutes|Bacilli|Bacillales|Bacillaceae|Bacillus|"                            
[3] "Bacteria|Proteobacteria|Gammaproteobacteria|Pasteurellales|Pasteurellaceae|Haemophilus|" 
[4] "Bacteria|Firmicutes|Bacilli|Lactobacillales|Streptococcaceae|Streptococcus|"             
[5] "Bacteria|Firmicutes|Bacilli|Lactobacillales|Streptococcaceae|Streptococcus|"             
[6] "Bacteria|Firmicutes|Bacilli|Lactobacillales|Streptococcaceae|Streptococcus|" 
Run Code Online (Sandbox Code Playgroud)

我想提取||作为新变量之间的最后一个词即

Acinetobacter
Bacillus
Haemophilus
Run Code Online (Sandbox Code Playgroud)

我试过用

library(stringr)
names$sample2 <-   str_match(names$SAMPLE_ID, "|.*?|")
Run Code Online (Sandbox Code Playgroud)

regex r stringr

7
推荐指数
2
解决办法
137
查看次数

在RMarkdown上指定CSL样式

我正在尝试在我的RMarkdown文档上指定CSL样式,如下所示

---
documentclass: article
fontsize: 12pt
linkcolor: blue
output: pdf_document
bibliography: bibliography.bib
csl: biomed-central.csl
---
Run Code Online (Sandbox Code Playgroud)

但这给我一个错误

pandoc-citeproc.exe: biomed-central.csl: openBinaryFile: does not exist (No such file or directory)
pandoc.exe: Error running filter pandoc-citeproc
Error: pandoc document conversion failed with error 83
Run Code Online (Sandbox Code Playgroud)

Windows 7 64 bitR Version 3.1.2RStudio 0.98.1091 如何我可以指定一个CSL样式。

r pandoc rstudio r-markdown csl

5
推荐指数
1
解决办法
2594
查看次数

infoBox Shinydashboard 上的自定义图标

有没有办法infoBoxshinydashboard. 我正在尝试使用hrbrmstr gist上的示例,但我找不到更新infoBox函数的位置。

library(shiny)

ui <- dashboardPage(
  dashboardHeader(title = "Dynamic boxes"),
  dashboardSidebar(),
  dashboardBody(
    fluidRow(
      box(width = 2, actionButton("count", "Count")),
      infoBoxOutput("ibox"),
      valueBoxOutput("vbox")
    )
  )
)

server <- function(input, output) {
  output$ibox <- renderInfoBox({
    infoBox(
      "Title",
      input$count,
      #icon = icon("credit-card")
icon=icon(list(src=x, width="80px"), lib="local")
    )
  })
  output$vbox <- renderValueBox({
    valueBox(
      "Title",
      input$count,
      icon = icon("credit-card")
    )
  })
}

shinyApp(ui, server)
Run Code Online (Sandbox Code Playgroud)

r shiny shinydashboard flexdashboard

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

gsub 中的正则表达式无效

为什么电子邮件regex给人一种errorinvalid regular expression '^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$', reason 'Invalid character range'

blogs.smpl <- "mail:mami@yahoo.com: subject:Lorem Ipsum body:   is simply dummy text of the printing and typesetting industry. 
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s"

blogs.smpl <- gsub("^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$","",blogs.smpl)
Run Code Online (Sandbox Code Playgroud)

regex r gsub

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

标签 统计

r ×6

r-markdown ×3

regex ×2

csl ×1

flexdashboard ×1

gsub ×1

knitr ×1

latex ×1

pandoc ×1

rstudio ×1

shiny ×1

shinydashboard ×1

stringr ×1