Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes # 1699, subtle point of explication in melt dox #2290

Merged
merged 1 commit into from
Aug 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@

5. Printing with `quote = TRUE` now quotes column names as well, [#1319](https://github.com/Rdatatable/data.table/issues/1319). Thanks @jan-glx for the suggestion and @MichaelChirico for the PR.

6. Added a blurb to `?melt.data.table` explicating the subtle difference in behavior of the `id.vars` argument vis-a-vis its analog in `reshape2::melt`, [#1699](https://github.com/Rdatatable/data.table/issues/1699). Thanks @MichaelChirico for uncovering and filing.


### Changes in v1.10.4 (on CRAN 01 Feb 2017)

Expand Down
5 changes: 4 additions & 1 deletion man/melt.data.table.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ load \code{reshape2} package \emph{before} loading \code{data.table}.
\item{data}{ A \code{data.table} object to melt.}
\item{id.vars}{vector of id variables. Can be integer (corresponding id
column numbers) or character (id column names) vector. If missing, all
non-measure columns will be assigned to it.}
non-measure columns will be assigned to it. If integer, must be positive; see Details. }
\item{measure.vars}{vector of measure variables. Can be integer (corresponding
measure column numbers) or character (measure column names) vector. If missing,
all non-id columns will be assigned to it.
Expand Down Expand Up @@ -77,7 +77,10 @@ be coerced to \code{character} type. This is to be compatible with
\code{reshape2}'s \code{melt.data.frame}. To get a \code{factor} column, set
\code{value.factor = TRUE}. \code{melt.data.table} also preserves
\code{ordered} factors.

Note that, as opposed to the (undocumented) behavior of \code{reshape2::melt}, \code{id.vars}, when specified as numbers, must be between 1 and \code{ncol(data)}.
}

\value{
An unkeyed \code{data.table} containing the molten data.
}
Expand Down