When reading data from SPSS or Stata into R, the metadata will also be inherited to the dataset. Sometimes it can be useful for extra information, but most of the time it’s not needed. To get rid of these metadata then do this:
- For specific columns ie.
VAR
with attributeformat.stata
, use one of these
attr(myData$VAR, "format.stata") <- NULL
attribute(myData$VAR) <- NULL
- For all attributes of a dataset as
data.frame
ordata.table
df[] <- lapply(df, as.vector)
df <- df[, lapply(.SD, as.vector)]
References from StackOverflow