melt error message for bad measure.vars could be more informative/specific

Open
#6,512 4 comments 2 reactions 2 assignees View on GitHub

@venom1204 is already working on this.

Since Jun 27, 2025.

Assessment

This issue has not been assessed yet.

Description

beginner-task reshape

Right now we have the following error message, which is ok:

> melt(data.table(x1=1,x2=2,y1=3,y2=4),measure.vars=c("x1","x2","z1"))
Error in melt.data.table(data.table(x1 = 1, x2 = 2, y1 = 3, y2 = 4), measure.vars = c("x1",  : 
  One or more values in 'measure.vars' is invalid.

it would be even better if we could tell the user specifically which entries are invalid, and how to fix the issue, for example "One or more values in 'measure.vars' is invalid; please fix by removing [z1]"

Dominant language
R
Stars
3.9k
Forks
1.1k
Avg merge
14h 4m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Rdatatable/data.table

All issues in Rdatatable/data.table

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.