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

[R-Forge #2491] rblindlist could add a column containing the names #591

Closed
arunsrinivasan opened this issue Jun 8, 2014 · 0 comments
Closed
Assignees
Milestone

Comments

@arunsrinivasan
Copy link
Member

Submitted by: Matt Dowle; Assigned to: Nobody; R-Forge link

With a named list L of data.table

rbindlist(L, namesname="Names")

would do apx :

rbind(L)
DT[,Names:=rep(names(L),sapply(L,nrow))]
movecol(DT,"Names",1)

with check that length(unique(names(L))) == length(L) [ i.e. !any(duplicated(names(L))) ]

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

1 participant