Coder Social home page Coder Social logo

r-ninja's Issues

bookdown对于pdf中文的支持问题?

我尝试使用bookdown来写中文文章(使用xelatex编译),发现bookdown对于作者名称、文章标题,章节的中文的支持都有问题,可以提供一个模板么?多谢!

编译的错误

刚接触 bookdown,找到了这个模板,按着 bookdown 建议的步骤,除了 pandoc 版本比较落后外,其他都更新到最新了。出现如下这个问题,可以哪位遇到过。谢谢。

sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Deepin 15

Matrix products: default
BLAS: /usr/lib/openblas-base/libblas.so.3
LAPACK: /usr/lib/libopenblasp-r0.2.19.so

locale:
 [1] LC_CTYPE=zh_CN.UTF-8       LC_NUMERIC=C               LC_TIME=zh_CN.UTF-8       
 [4] LC_COLLATE=zh_CN.UTF-8     LC_MONETARY=zh_CN.UTF-8    LC_MESSAGES=zh_CN.UTF-8   
 [7] LC_PAPER=zh_CN.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=zh_CN.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_3.4.1  backports_1.1.0 bookdown_0.5    magrittr_1.5    rprojroot_1.2  
 [6] htmltools_0.3.6 tools_3.4.1     yaml_2.1.14     Rcpp_0.12.12    stringi_1.1.5  
[11] rmarkdown_1.6   knitr_1.17      stringr_1.2.0   digest_0.6.12   evaluate_0.10.1

弹出的错误如下,点击 build book(bookdown::pdf_book)。

Quitting from lines 933-937 (r-ninja.Rmd) 
Error in library(rmini) : there is no package called 'rmini'
Calls: <Anonymous> ... withCallingHandlers -> withVisible -> eval -> eval -> library
此外: Warning message:
In 1:3 + 1:2 : 长的对象长度不是短的对象长度的整倍数
Please delete r-ninja.Rmd after you finish debugging the error.
停止执行

在macOS下编译的两个问题

刚开始用bookdown,macOS 10.12.3,RStudio 1.0.138,遇到两个问题:

  1. Build Book时出现如下错误信息:
Quitting from lines 399-404 (r-ninja.Rmd) 
Error in file(con, "r") : cannot open the connection
Calls: <Anonymous> ... withCallingHandlers -> withVisible -> eval -> eval -> readLines -> file
Execution halted

Exited with status 1.

发现出问题的行是402行xie = readLines('http://yihui.name') # 我的主页,在命令行下访问 https://yihui.name 成功,但是http会出错。

  1. 修改之后再点Build Book,错误依旧,发现修改被重置了……

knitr包 中奇怪的 Rmd 与 Rhtml 全局选项

5.2 knitr包 中

  • Rhtml 全局选项放在<!--roptions -->
  • Rmd 全局选项放在 `ro or`

是什么意思啊? 在 R chunk 用 opts_chunk$set() 不就好了吗。表示从来没有听说过,放狗搜也找不到

roxygen annotation

This book is really useful. A naive question: Which files need to provide roxygen annotation? roxygenize('rmini') will creat all the Rd files right? How to determine the fileanme of the Rd files?

参考文献设置问题

在18-renferences.Rmd
r if (knitr:::is_html_output()) '# 参考文献 {#reference .unnumbered}'

knitr::write_bib(
  .packages(),
  'packages.bib'
)

我们可以看到packages.bib被生成,
内容如下
@Manual{R-base,
title = {R: A Language and Environment for Statistical Computing},
author = {{R Core Team}},
organization = {R Foundation for Statistical Computing},
address = {Vienna, Austria},
year = {2016},
url = {https://www.R-project.org/},
}
@Manual{R-rmini,
title = {rmini: A Minimal R Package as an Example of Writing R Packages},
author = {Yihui Xie},
year = {2014},
note = {R package version 0.0.4},
url = {https://github.com/yihui/rmini},
}

但是生成的html中的参考文献只有
R Core Team. 2016. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.

为什么对不上?

是我哪里错了么?

@yihui

thanks

写作规范

我看你给现在还open的那个Pull request提了很多意见@yihui, 不如专门发布一个写作规范吧。省得提交新内容后又得改同样的错误。 粗略整理如下

  1. 标点格式

    1. 破折号和书名号之间不必空格
    2. 标点一律用中文的,包括():等
    3. 中英文之间暂时不要空格吧,将来xeCJK可以自动调整空格。
    4. 列表项统一用-,打字方便,少按一次Shift
    5. 包的名字用粗体,俩星号围起来
  2. 内容风格

    1. 不写明版本号,如R-x.x.x.tar.gz
    2. 参考文献不列就不列,要列的话就直接在正文中写好了,以正文或脚注形式(比如Tufte样式)。
    3. R的手册提名字和大概位置就可以了,不必列入文献
    4. 图片使用PNG格式(请传imgur.com,完稿统一下载到本地)……GIF难入TeX大门。
    5. 能写例子的时候就多写点例子,不要让读者去想象去猜去查。

How to convert .Rmd into .MediaWiki format in R studio?

Hi Yihui,

Hope to get some suggestion from you about How to convert .Rmd into .MediaWiki format in R studio?

I have done that in linux server since in the linux, Rmd will creat md temporary file, and I can transfer md to MediaWiki by pandoc. however, in the windows, md is not created and no output: MediaWiki option.

Another question is when I output Rmd to html, the figures will insert into the html page? what will happened if I transfer Rmd to md? where the figure can be found in this situation?

Thanks.

Shicheng

安装开发的包时自动安装所必须的其他包的问题

我工作中遇到个问题,我自己开发了一个包,要分享给同事用。但是由于项目保密需要,不能放在cran或者其他公开平台上,只能用zip包从本地安装。然后遇到的问题就是,同事安装完我自己开发的包,还是要根据提示手动把其他需要的包一个个下载安装好,请问没有没什么办法可以像cran上安装包那样自动检测并安装必须的所有的包呢?谢谢!我觉得这部分放在package这章应该挺有用的。

R 3.4.1又可以选择了不安装消息翻译文件了

2.1.1 中 「用自定义方式安装」的写作策略需调整, 3.4.1又可以选择了不安装消息翻译文件了 @yihui

新的截图如下
r 3 4 1

顺便说一句,即使你不勾选翻译文件,用RStudio时也还是会给你蹦出几个汉字来。还是得设置Rconsole才能让R老老实实地说英语。

两个问题

@yihui github不支持对md文件的按行评论?连md文件的按行引用也木有?

  • setup一章中 language = enen 似乎用大写的 EN 更准确?
  • setup一章中 「用自定义方式安装」的写作策略需调整 2.15.0抛弃了多数安装选项 基本不可定制了 截图也需要更新

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.