Hi,
Try:
 dat <- data.frame(id=1:4, contacts_list=I(list(3:4,c(1,3,4), c(4,2,1), 1)), 
`number of contacts`=c(2,3,3,1),check.names=FALSE)

attr(dat$contacts_list,"class") <- NULL #if needed
 dat
A.K.



Dear Group,
I have data like the following

id   contacts_list   number of contacts
---------------------------------------------------
1   3 4                               2
2   1 3 4                            3
3    4 2 1                           3
4    1                                1
------------------------------------------------------


can you kindly please sugest a data type in R to use for it?
i thought about data frame that consists of a  list element. but  lists are not 
in  the same length, any  solutions?
thanks in advance
RAE 


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to