Skip to content

Commit

Permalink
wide to long, long to wide
Browse files Browse the repository at this point in the history
  • Loading branch information
sehee-lim committed Feb 10, 2023
1 parent 4a87b7f commit 912f3d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/data.table/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ dt[, .N, keyby = "RN_INDI"]

## melt {.smaller}

일부 열을 제외한 나머지 열을 **stack 처리**
wide to long

```{r, echo = TRUE}
dt.long1 <- melt(dt,
Expand All @@ -466,7 +466,7 @@ dt.long2

## dcast {.smaller}

melt 함수로 재구조화한 것을 다시 **분리**
long to wide

```{r, echo = TRUE}
dt.wide1 <- dcast(dt.long1, EXMD_BZ_YYYY + RN_INDI + HME_YYYYMM ~ Lipid, value.var = "Value")
Expand Down

0 comments on commit 912f3d1

Please sign in to comment.