R语言 subset()函数用法

subset() 函数:

subset(dataset , subset , select )

dataset 是 要进行操作的数据集

subset 是对数据的某些字段进行操作

select 选取要显示的字段

 

Example : 

```{r spdep}
hightech
aa = subset(hightech,year==2001&province=="北京",select = c("year","province","PAT"))
bb = subset(hightech,year==2001|province=="北京",select = c("year","province","NPO"))
aa
bb
```

  

 

 aa:

 

 bb:

 

 

posted @ 2020-01-29 11:02  从前有座山,山上  阅读(35457)  评论(0编辑  收藏  举报