yihui / r-ninja Goto Github PK
View Code? Open in Web Editor NEWR语言忍者秘笈
Home Page: https://bookdown.org/yihui/r-ninja/
R语言忍者秘笈
Home Page: https://bookdown.org/yihui/r-ninja/
我尝试使用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.
停止执行
刚开始用bookdown,macOS 10.12.3,RStudio 1.0.138,遇到两个问题:
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会出错。
请问用R通过Rcharts接口,调用echarts时,怎样配置opt参数?
5.2 knitr包 中
<!--roptions -->
中`ro or`
中是什么意思啊? 在 R chunk 用 opts_chunk$set()
不就好了吗。表示从来没有听说过,放狗搜也找不到
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?
大纲
[
[[
比方说没有02, 05到10等等。。
在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/.
为什么对不上?
是我哪里错了么?
thanks
我看你给现在还open的那个Pull request提了很多意见@yihui, 不如专门发布一个写作规范吧。省得提交新内容后又得改同样的错误。 粗略整理如下
标点格式
内容风格
how to pow
项目需要部署在客户的服务器上,想进行简单的混淆或者加密,发现R没有这方面的工具,除了定制R解释器外,还有什么办法么?
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这章应该挺有用的。
2.1.1 中 「用自定义方式安装」的写作策略需调整, 3.4.1又可以选择了不安装消息翻译文件了 @yihui
顺便说一句,即使你不勾选翻译文件,用RStudio时也还是会给你蹦出几个汉字来。还是得设置Rconsole才能让R老老实实地说英语。
关于Linux要写些什么?
力所能及的话,那我就去挖坑了。
@yihui github不支持对md文件的按行评论?连md文件的按行引用也木有?
language = en
的 en
似乎用大写的 EN
更准确?A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.