Skip to content

error in dput applied to dataframe (PR#9286)

1 message · higgins at nceas.ucsb.edu

#
Full_Name: Daniel F Higgins
Version: 2.4.0
OS: Windows XP and Mac OSX
Submission from: (NULL) (128.111.242.49)


Create a dataframe as indicated below and apply 'dput' to it; note that the
row.names attribute is incorrect!
structure(list(aaa = structure(c(1, 2, 1), .Label = c("AAA", 
"BBB"), class = "factor"), bbb = c(1, 2, 3)), .Names = c("aaa", 
"bbb"), row.names = c(NA, 3), class = "data.frame")
Error in attributes(.Data) <- c(attributes(.Data), attrib) : 
        row names must be 'character' or 'integer', not 'double'
However, if R version 2.3 is used, the value for row.names is:
row.names = c("1", "2", "3")
and the dget command then works