out<-split(df,df$Dept)
out[[1]]
# などでデータフレームにアクセス
また
out$Dept1
具体例を挙げる
df<-data.frame(Dept=c('a','a','b','b','c','d','d'),acs=c(111,112,222,223,333,444,445))
out<-split(df,df$Dept)
out
> out
$a
Dept acs
1 a 111
2 a 112
$b
Dept acs
3 b 222
4 b 223
$c
Dept acs
5 c 333
$d
Dept acs
6 d 444
7 d 445
dept.names<-names(out)
> dept.names[1]
[1] "a"
> out[[dept.names[1]]] # dataframe for department 1
Dept acs
1 a 111
2 a 112
> out[[dept.names[2]]] # dataframe for department 2
Dept acs
3 b 222
4 b 223
> is.data.frame(out[[dept.names[2]]])
[1] TRUE