Skip to content

Commit

Permalink
Update vignette text (#6621)
Browse files Browse the repository at this point in the history
  • Loading branch information
iagogv3 authored Nov 19, 2024
1 parent 03c647f commit e9a511d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vignettes/datatable-reshape.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ dcast(DT.m1, family_id ~ ., fun.agg = function(x) sum(!is.na(x)), value.var = "d

Check `?dcast` for other useful arguments and additional examples.

## 2. Limitations in current `melt/dcast` approaches
## 2. Limitations in previous `melt/dcast` approaches

So far we've seen features of `melt` and `dcast` that are implemented efficiently for `data.table`s, using internal `data.table` machinery (*fast radix ordering*, *binary search* etc.).

Expand Down Expand Up @@ -170,7 +170,7 @@ str(DT.c1) ## gender column is class IDate now!

As an analogy, imagine you've a closet with four shelves of clothes and you'd like to put together the clothes from shelves 1 and 2 together (in 1), and 3 and 4 together (in 3). What we are doing is more or less to combine all the clothes together, and then split them back on to shelves 1 and 3!

2. The columns to `melt` may be of different types, as in this case (`character` and `integer` types). By `melt`ing them all together, the columns will be coerced in result, as explained by the warning message above and shown from output of `str(DT.c1)`, where `gender` has been converted to *`character`* type.
2. The columns to `melt` may be of different types. By `melt`ing them all together, the columns will be coerced in result.

3. We are generating an additional column by splitting the `variable` column into two columns, whose purpose is quite cryptic. We do it because we need it for *casting* in the next step.

Expand Down

0 comments on commit e9a511d

Please sign in to comment.