在R教程包中加载包

时间:2018-08-27 18:38:11

标签: r package

我是tutorial package的新手。确实很棒,但是我不知道如何设置练习以便预先加载软件包。

我已经尝试过了,但是当我在浏览器中打开html文件时,它基本上不会安装和加载软件包。

---
title: "Example"
author: "Author"
date: '2018-08-27'
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
#The following line is only included if you need to install the tutorial package
#install.packages('tutorial', repos='https://mirror.its.sfu.ca/mirror/CRAN/')
library(tutorial)
```

```{r, include=FALSE, eval=T}
tutorial::go_interactive()
```

```{r ex='loading-data', type='pre-exercise-code'}
install.packages('tidyverse')
install.packages('haven')
library(tidyverse)
library(haven)
```


```{r ex='loading-data', type='sample-code'}
ces<-read_sav(
'https://github.com/sjkiss/2018/raw/master/Materials/R/ces15.sav'
)

head(ces)
```

0 个答案:

没有答案