search for: stcmsid

Displaying 1 result from an estimated 1 matches for "stcmsid".

Did you mean: stcmd
2010 May 25
1
Merging dataframe with list
...a to this list, keeping the list components intact? Let's assume I have a dataframe that looks like this: df <- data.frame(id=rep(1:100),data=runif(100, min=0, max=1)) I want to add the column 'df$data' to 'test.sav' by matching the columns 'd$id' with 'test.sav$stcmsid'. If I use 'merge', the resulting class is 'data.frame', hence the variable labels from 'test.sav' will be silently dropped. Is there an elegant way to merge data to a list like 'test.sav', or should I just save 'attr(test.sav, "variable.labels")...