data analysis & visualization


expand.grid(rep(list,n)) : 각각의 list에 대해 모든 조합을 생성


예제


com=function(kb_station,cn){

data=as.matrix(expand.grid(rep(list(kb_station),cn)))

for(i in 1:(ncol(data)-1)){

  data=data[data[,i]>data[,i+1],]}

return(data)}


cn=2

kb_station=1:11

temp=com(kb_station,cn)

temp=cbind(temp,NA)



com=function(kb_station,cn){

n=0;ls=list()

while(T){

  n=n+1

  ls[[cn-n+1]]=kb_station

  kb_station=kb_station[-1]

  if(n==cn)break

}

data=as.matrix(expand.grid(ls))

for(i in 1:(ncol(data)-1)){

  data=data[data[,i]>data[,i+1],]}

return(data)}

'R > handling' 카테고리의 다른 글

scaling  (0) 2019.04.16
reshape  (0) 2019.04.14
plyr 패키지를 통한 핸들링  (0) 2019.04.12
파일 불러오기  (0) 2019.04.08

scaling

R/handling2019. 4. 16. 05:37
RPubs - 표준화


'R > handling' 카테고리의 다른 글

expand.grid를 복수로 생성할 때  (0) 2019.05.25
reshape  (0) 2019.04.14
plyr 패키지를 통한 핸들링  (0) 2019.04.12
파일 불러오기  (0) 2019.04.08

reshape

R/handling2019. 4. 14. 05:28
RPubs - reshape패키지 활용


'R > handling' 카테고리의 다른 글

expand.grid를 복수로 생성할 때  (0) 2019.05.25
scaling  (0) 2019.04.16
plyr 패키지를 통한 핸들링  (0) 2019.04.12
파일 불러오기  (0) 2019.04.08

RPubs - plyr패키지 활용


'R > handling' 카테고리의 다른 글

expand.grid를 복수로 생성할 때  (0) 2019.05.25
scaling  (0) 2019.04.16
reshape  (0) 2019.04.14
파일 불러오기  (0) 2019.04.08

파일 불러오기

R/handling2019. 4. 8. 03:34
RPubs - 파일불러오기


'R > handling' 카테고리의 다른 글

expand.grid를 복수로 생성할 때  (0) 2019.05.25
scaling  (0) 2019.04.16
reshape  (0) 2019.04.14
plyr 패키지를 통한 핸들링  (0) 2019.04.12