楼主: oliyiyi
1516 4

Tutorial R Markdown [推广有奖]

版主

已卖:2994份资源

泰斗

1%

还不是VIP/贵宾

-

TA的文库  其他...

计量文库

威望
7
论坛币
66105 个
通用积分
31671.0967
学术水平
1454 点
热心指数
1573 点
信用等级
1364 点
经验
384134 点
帖子
9629
精华
66
在线时间
5508 小时
注册时间
2007-5-21
最后登录
2025-7-8

初级学术勋章 初级热心勋章 初级信用勋章 中级信用勋章 中级学术勋章 中级热心勋章 高级热心勋章 高级学术勋章 高级信用勋章 特级热心勋章 特级学术勋章 特级信用勋章

楼主
oliyiyi 发表于 2016-6-18 18:31:03 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
Tutorial R MarkdownJacolien van Rij


Table of contents



Using R Markdown as analysis script

This tutorial describes how to use R Markdown. R Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. Example: this tutorial itself is generated with R Markdown.

For more details on using R Markdown see http://rmarkdown.rstudio.com.

Some advantages of using R Markdown:

  • R code can be embedded in the report, so it is not necessary to keep the report and R script separately. Including the R code directly in a report provides structure to analyses.

  • The report text is written as normal text, so no knowledge of HTML coding is required.

  • The output is an HTML file that includes pictures, code blocks R output and text. No additional files are needed, everything is incorporated in the HTML file. So easy to send the report via mail, or place it as paper package on your website.

  • These HTML reports enhance collaboration: It is much more easy to comment on an analysis when the R code, the R output and the plots are available in the report.




二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:R Markdown Tutorial tutor Down Mark Embedding describes generate simple server

缺少币币的网友请访问有奖回帖集合
https://bbs.pinggu.org/thread-3990750-1-1.html

沙发
oliyiyi 发表于 2016-6-18 18:32:15
How to generate an HTML reportMethod 1: Start a new R Markdown file in R Studio

Open R Studio, then go to File \(\rightarrow\) New file \(\rightarrow\) R Markdown.





缺少币币的网友请访问有奖回帖集合
https://bbs.pinggu.org/thread-3990750-1-1.html

藤椅
oliyiyi 发表于 2016-6-18 18:34:09
11111.png
缺少币币的网友请访问有奖回帖集合
https://bbs.pinggu.org/thread-3990750-1-1.html

板凳
oliyiyi 发表于 2016-6-18 18:34:43

Choose a title and author, but leave the rest as it is, and press the OK button:


The R markdown file you opened, already contains example code.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document:

More info on how to format the HTML report in the section Formatting the report.


缺少币币的网友请访问有奖回帖集合
https://bbs.pinggu.org/thread-3990750-1-1.html

报纸
oliyiyi 发表于 2016-6-18 18:35:10
Method 2: If you really don’t want to use R Studio…

This method requires that pandoc document converter software is installed (see instructions on the pandoc website).

After pandoc is installed, install the R package rmarkdown and it’s dependencies. Type the following command in the R console:

install.packages("rmarkdown", repos="http://cran.us.r-project.org")

Download here a template of a markdown file (from R Studio) and store it in your working directory: download template.

Open the file template.Rmd in a text editor, and add your R code in the code blocks, which start with ```{r}` and end with ```. Around the blocks you could type your report. Example code is provided in the file template.Rmd.

Run the following code in the R console to convert the .Rmd file to an HTML report (courtesy of Martijn Wieling):

# make sure to have the package rmarkdown updated and installed:library(rmarkdown)# generates html file with resultsrender('template.Rmd')

The render function will generate an HTML file in your working directory. You could view the HTML in your browser, or use the following code to view the result in R:

browseURL(sprintf('file://%s%s', 'template.html', file.path(getwd())))

More info on how to format the HTML report in the section Formatting the report.


缺少币币的网友请访问有奖回帖集合
https://bbs.pinggu.org/thread-3990750-1-1.html

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-2 23:33