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

[Request] Truncate warnings differently #1752

Closed
franknarf1 opened this issue Jun 23, 2016 · 1 comment
Closed

[Request] Truncate warnings differently #1752

franknarf1 opened this issue Jun 23, 2016 · 1 comment

Comments

@franknarf1
Copy link
Contributor

I have data in an obnoxious format involving a ton of columns with long names.

I figure I can melt part of the data to make it more manageable:

geoDT = melt(DT[, names(DT) %like% "(^Id[0-9]*$)|GEOGRAPHIC AREA CODES", with=FALSE], id=1:2)

Warning message:
In melt.data.table(DT[, names(DT) %like% "(^Id[0-9]*$)|GEOGRAPHIC AREA CODES", :
'measure.vars' [GEOGRAPHIC AREA CODES - Region, GEOGRAPHIC AREA CODES - Division, GEOGRAPHIC AREA CODES - State (FIPS), GEOGRAPHIC AREA CODES - County, GEOGRAPHIC AREA CODES - FIPS County Class Code, GEOGRAPHIC AREA CODES - County Size Code, GEOGRAPHIC AREA CODES - County Subdivision (FIPS), GEOGRAPHIC AREA CODES - FIPS County Subdivision Class Code, GEOGRAPHIC AREA CODES - County Subdivision Size Code, GEOGRAPHIC AREA CODES - Place (FIPS), GEOGRAPHIC AREA CODES - FIPS Place Class Code, GEOGRAPHIC AREA CODES - Place Size Code, GEOGRAPHIC AREA CODES - Census Tract, GEOGRAPHIC AREA CODES - Block Group, GEOGRAPHIC AREA CODES - Block, GEOGRAPHIC AREA CODES - Internal Use Code, GEOGRAPHIC AREA CODES - Consolidated City (FIPS), GEOGRAPHIC AREA CODES - FIPS Consolidated City Class Code, GEOGRAPHIC AREA CODES - Consolidated City Size Code, GEOGRAPHIC AREA CODES - American Indian Area/Alaska Native Area/Hawaiian Home Land (Census), GEOGRAPHIC AREA CODES - American Indian Area/Alaska Native Area [... truncated]

My problem is that I cannot see what the actual warning message is because too many columns are involved, so I hit "[... truncated]" first. I know from experience that the warning is

[$cols] are not all of the same type. By order of hierarchy, the molten data value column will be of type '$type'. All measure variables not of type '$type' will be coerced to. Check DETAILS in ?melt.data.table for more on coercion.

I think it would be better if my col list were truncated earlier so I could see the important part of the message.

@arunsrinivasan
Copy link
Member

+1. Makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants