subset()函数:
subset(dataset , subset , select )
dataset 是要进行操作的数据集,
subset 是对数据的某些字段进行操作
select 显示指定列(如果不选择则所有列全部输出,另外负号排除指定列)
Example :
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: