1. Set options for R markdown chunks
library(knitr)
opts_chunk$set(echo=TRUE, results="hide", fig.width=5, fig.height = 3)
# it works for the following chunks


  1. 可用用数学公式中的方式控制换行,或者空格。

\(what \; \: \; life \quad \qquad \\ will \\ be\)

  1. List the datasets in a R package
data(package = .packages(all.available = TRUE))
data(package="fda")  
  1. 两个冒号的功能
ggplot2::qplot(mpg,drat,data = mtcars, colour = as.factor(cyl),geom = "point")

  1. 添加knit后不显示的注释
    • 方法一: 用R代码添加,设置成echo = F

    • 方法二:<what life will be>添加,相当于把文字当成标签。

  1. 寻找模板文件路径 rticles::acs_article()

  2. 表格语法中, “|” 表示纵向边界,“-” 表示隔开, “:” 表示对齐。

  3. 上下标可以用“^” and “~”。 E+, H2SO4, 子项目的时候可以这样:

More information about pandoc markdown expansion

Get help

It is so import know how to get help quickly! quick Getting Help with R is a collection of websites where you can get help.

CRAN Task views:

Click R help on the menu Help, you will find the item CRAN Task Views on the right bottom.

This page give a well organised instructions of what R could do and packages to use.

# To automatically install these views, the ctv package needs to be installed, e.g., via
install.packages("ctv")
library("ctv")
install.views("Econometrics")
update.views("Econometrics")

https://www.rstudio.com/products/rpackages/ give us a guide to use those packages too

R on Stackoverflow: You could search questions on the website https://stackoverflow.com/questions/tagged/r

demo(package = "fda")
# Son of Bitch!!! 
直接在R中点不开连接,但是帮助页面在浏览器中点开以后就可以点击Code demos运行了

Problems

  1. 如何创造一份Rmd模板并且使用?

  2. 如何在markdown中输入英语音标?很多音标可以直接用字母输入,如l,e, k,b 等。在latex中可以使用如下方法:

尝试在标题栏加上usepackage{tipa}没有效果。

  1. 如何用Python引擎,并且编译呢?下面这样不行的。
    ```{python}
    1 + 1
    ```

这样呢?

1+1
print 1+1
## 2

Perfect!

  1. 每个package有Demo部分,可以用来展示基本函数的使用和代码!!!