小编Min*_*Han的帖子

如何在 factoextra 的 fviz_pca_var 中设置数据标签的字体大小

当我向期刊提交论文时,期刊要求我将字体大小设置为7.5,但是当我使用以下代码时,只有轴文本发生了变化,标签大小保持不变,

    library(ggplot2)
    library(FactoMineR)
    library(factoextra)

    irispca <- PCA(iris,quali.sup = 5)
    fviz_pca_var(irispca)+
   theme(text = element_text(size = 7.5),
         axis.title = element_text(size = 7.5),
         axis.text = element_text(size = 7.5)
         )
Run Code Online (Sandbox Code Playgroud)

任何建议都可以告诉我应该使用什么代码来更改标签大小?

在此处输入图片说明

r ggplot2

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

如何在输出PDF时将第二级标题与Bookdown中的左侧对齐?

默认的是中心,我希望它对齐为左.

默认

最终效果

我的bookdown示例中的latex文件夹中的template.tex是粘贴的,需要我在某处更改以调整二级标题的样式吗?任何建议表示赞赏.我搜索标题没有找到有用的东西 我应该调整哪一部分以满足我的要求?

\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
$if(beamerarticle)$
\usepackage{beamerarticle} % needs to be loaded first
$endif$
$if(fontfamily)$
\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
$else$
\usepackage{lmodern}
$endif$
$if(linestretch)$
\usepackage{setspace}
\setstretch{$linestretch$}
$endif$
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
  \usepackage[utf8]{inputenc}
$if(euro)$
  \usepackage{eurosym}
$endif$
\else % if luatex or xelatex
  \ifxetex
    \usepackage{xltxtra,xunicode}
  \else
    \usepackage{fontspec}
  \fi
  \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
$for(fontfamilies)$
  \newfontfamily{$fontfamilies.name$}[$fontfamilies.options$]{$fontfamilies.font$}
$endfor$
$if(euro)$
  \newcommand{\euro}{€}
$endif$
$if(mainfont)$
    \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
$endif$
$if(sansfont)$
    \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
$endif$
$if(monofont)$
    \setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$}
$endif$
$if(CJKmainfont)$
    \usepackage{xeCJK}
    \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
$endif$
\fi
% use upquote if available, for straight quotes …
Run Code Online (Sandbox Code Playgroud)

markdown r bookdown

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

为什么有些R代码必须包含在Bookdown的index.Rmd中?

我在Bookdown中文演示中下载了bookdown-chinese 并删除了所有.Rmd文件,除了index.Rmd.当我构建这本书时,为什么必须包含一些R代码index.Rmd,.

```{r}
 sessionInfo()
```
Run Code Online (Sandbox Code Playgroud)

否则会提示一些错误

! Undefined control sequence.
l.105 \RecustomVerbatimEnvironment
                              {Highlighting}{Verbatim}{commandchars=\\\{...

Error: Failed to compile bookdown.tex. See bookdown.log for more info.
Please delete bookdown.Rmd after you finish debugging the error.
Execution halted

Exited with status 1.
Run Code Online (Sandbox Code Playgroud)

事实上我编辑了一本没有块R代码的书,发现我必须保留这些R代码或改变其他R代码index.Rmd才能构建这本书.

markdown r r-markdown

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

如何在 VS 代码中使用带有 R 内核的 jupyter notebook?

现在我可以在 Web 浏览器中使用带有 R 内核的 jupyter lab 并使用 VS Code 使用 python 内核编辑 jupyter 笔记本代码,是否可以使用 jupyter notebook 模式在 VS Code 中编辑 R 代码?感谢您的评论和解决方案。

r visual-studio-code

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

如何在Bookdown中更改为另一种书目风格

我想使用另一种书目风格,而不是Bookdown中的apalike,当我改变为自然风格(数字风格)并制作这本书时,它提示我,

????: Failed to build the bibliography via bibtex
Please delete bookdown.Rmd after you finish debugging the error.
?????

Exited with status 1.
Run Code Online (Sandbox Code Playgroud)

有解决方案吗?标题作者和描述中有一些汉字,这是原因吗?

YAML标头

--- 
title: "title"
author: "aa"
date: "`r Sys.Date()`"
documentclass: ctexbook
bibliography: [book.bib]
biblio-style: nature
link-citations: yes
colorlinks: yes
lot: no
lof: no
geometry: [b5paper, tmargin=2.5cm, bmargin=2.5cm, lmargin=3.5cm, rmargin=2.5cm]
site: bookdown::bookdown_site
description: "dd?"
github-repo: yihui/bookdown-chinese
#cover-image: images/cover.jpg
---
Run Code Online (Sandbox Code Playgroud)

会议:

R version 3.5.0 (2018-04-23)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: …
Run Code Online (Sandbox Code Playgroud)

markdown r bookdown

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

Rmarkdown到Word输出-为Word文档插入页码

我正在编辑一个Rmarkdown文件,我想知道是否存在一种在rmd文件中插入单词的页码的解决方案,它将输出到Word文档。

---
title: "title"
output:
word_document:
    reference_docx: ../template/template.docx
Run Code Online (Sandbox Code Playgroud)

markdown r r-markdown

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

是否有 R 函数可以从前两个相邻值中获取结果?

例如

a <- c(7, 10, 5, 4, 11)

我想 b 为:

b[1] = 0,

b[2] = a[2] - a[1],

b[3] = a[3] - a[2],

b[4]​​ = a[4] - a[3],

b[5] = a[5] - a[4]

是否有自动获取这些值的功能?

r

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

标签 统计

r ×7

markdown ×4

bookdown ×2

r-markdown ×2

ggplot2 ×1

visual-studio-code ×1