(I donβt quite understand what error you think you found. Data frames were not created the same.) There are two differences in the var.a and var.b structures: the mode of the elements in the columns: numeric in 'var.a' and integer in 'var.b'; and growth name mode: integer for 'var.a' and character in 'var.b':
> dput(var.b) structure(list(C1 = c(1L, 5L, 9L), C2 = c(1L, 5L, 9L)), .Names = c("C1", "C2"), row.names = c(1L, 5L, 9L), class = "data.frame") > dput(var.a) structure(list(C1 = c(1, 5, 9), C2 = c(1, 5, 9)), .Names = c("C1", "C2"), row.names = c("1", "5", "9"), class = "data.frame") > mode(attr(var.b, "row.names")) [1] "numeric" > storage.mode(attr(var.b, "row.names")) [1] "integer" > mode(attr(var.a, "row.names")) [1] "character"
Note added: if you want to check numerical equality, you should use the 'check.attributes' switch:
> all.equal(var.a, var.b, check.attributes=FALSE) [1] TRUE
If you look at var.b on dput , you will see that outlet names are numeric:
> dput(var.b) structure(list(C1 = c(1L, 5L, 9L), C2 = c(1L, 5L, 9L)), .Names = c("C1", "C2"), row.names = c(1L, 5L, 9L), class = "data.frame")