@mdjsjdq
2017-03-27T22:27:08.000000Z
字数 2467
阅读 2401
学习
Notes:
这里的教程是以Windows版本为讲解案例的
下载后的安装文件默认放在C盘的下载
目录
R语言代码:
# input data
age <-c(3,12,9,3,9,11,2,5,3,1)
weight <-c(6.1,10.2,10.4,6,7.3,8.5,5.2,7.2,5.3,4.4)
# Mean Analysis
mean(age)
mean(weight)
# Standard Deviation
sd(age)
sd(weight)
# Correlation Analysis
cor(age,weight)
# Draw plot
plot(age,weight)
Notes:
最后的界面
点击
Run
可以运行代码,分析结果
里面的内容很适合初学者快速的去了解R的语法,以及一些关于数据分析的操作。
pandoc: pdflatex not found. pdflatex is needed for pdf output.
错误: pandoc document conversion failed with error 41
停止执行No TeX installation detected (TeX is required to create PDF output). You should install a recommended TeX distribution for your platform:
Windows: MiKTeX (Complete) - http://miktex.org/2.9/setup
(NOTE: Be sure to download the Complete rather than Basic installation)Mac OS X: TexLive 2013 (Full) - http://tug.org/mactex/
(NOTE: Download with Safari rather than Chrome strongly recommended)
Linux: Use system package manager
rmarkdown
intall.package("rmarkdown")
或者运行另一个命令
install.packages("rmarkdown", repos = "https://cran.revolutionanalytics.com")
安装pandoc
Pandoc官方网站
安装MacTex
Some RStudio users who have recently downloaded MRO 3.2.3 may encounter an error when they try to create a new R Markdown file from the RStudio IDE. The error informs the user that the available rmarkdown package is not the version required by RStudio. It appears that the rmarkdown package was updated on 1/1/2016 just after the CRAN snapshot was taken that day. Since MRO 3.2.3 uses the 1/1/2016 static CRAN snapshot by default, the fix is as easy as pointing to a more recent version of the package or a more recent repository.
Here’s how. Use ONE of the following solutions:
Get the latest version of the
rmarkdown
package using
install.packages("rmarkdown", repos = "https://cran.revolutionanalytics.com")
Get the 0.9.2 version of thermarkdown
package using:
install.packages("rmarkdown", repos = "https://mran.revolutionanalytics.com/snapshot/2016-01-02")
Use the Roptions()
function:
options(repos = "https://mran.revolutionanalytics.com/snapshot/2016-01-02")
By default, Microsoft R Open offers its users predictability using a static CRAN snapshot date. For example, the CRAN repository for MRO 3.2.3 is configured to point to a snapshot date of Jan 1, 2016. Consequently, with MRO 3.2.3 you'll always get packages as they were at midnight UTC on Jan 1, 2016 by default whenever you use install.packages. However, as demonstrated above, it is still possible to get packages, such as rmarkdown from another date.
sudo tlmgr update --self
sudo tlmgr install framed