[R & SAS] proc transpose 가로 세로 변형

 In R Lang

행과 열을 바꿔서 배치, 세로 포멧을 가로 포멧으로

1. SAS

proc transpose data=df1 out=df2;

id id_var;

var trans_var;


2. R

df2 <- reshape(df1, v.names=”trans_var”, idvar=”id_var”, timevar=”seq”, direction=”wide”)

출처: http://raccoonjin.tistory.com/83?category=731290 [지식노동자의 노트]

Recent Posts

Leave a Comment

Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Not readable? Change text. captcha txt