Displaying 1 result from an estimated 1 matches for "newcolm".
Did you mean:
newcol
2011 Oct 29
1
Add col in data.frame
...ead.spss().
When I used cbind to add a new variable(column).
library(foreign)
mydf<-read.spss(file="C:/myspss.sav",use.value.labels=FALSE,
to.data.frame=TRUE,use.missings=FALSE)
attr(mydf,"variable.labels")
## it gives you all the labels
##Adding a new variable(col) to mydf
newcolm <- list(frt="grapes")
mydf <- cbind(mydf, newrow)
##Now checking to see labels again
attr(mydf,"variable.labels")
## And you get NULL
Can anyone please help me to achieve this without loosing any default
attribute that was there?
Thanks and Regards
--
SmartG
[[alter...