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

rbind with labelled variables (imported with Hmisc) generates an error #1549

Closed
alexkowa opened this issue Feb 26, 2016 · 1 comment
Closed
Assignees
Labels
Milestone

Comments

@alexkowa
Copy link

When calling rbind on 2 data sets with common and new variables, having "labelled" variables in one of the data sets generates an error in rbind. Interestingly, the order of data sets does matter. The functions spss.get in Hmisc generates such variables.

require(data.table);require(Hmisc)
## Generate a labeled numeric
x <- c(1:2)
label(x) <- c("a")

## Generate two data.tables with 1 overlapping and 1 new column x
d1 <- data.table(v1=1:2,x=x)
d2 <- data.table(v1=3:4)

#does not work!?
rbind(d2,d1,fill=TRUE)

#this order works
rbind(d1,d2,fill=TRUE)
@MichaelChirico
Copy link
Member

Indeed appears to be a bug. Do you need the labels? spss.get has an include.value.labels argument which could remove them.

@arunsrinivasan arunsrinivasan added this to the v1.9.8 milestone Mar 1, 2016
@arunsrinivasan arunsrinivasan self-assigned this Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants