Dear all,

assuming that I do have a dataframe like :

x <- data.frame(TYPE=c("DEL", "DEL", "DUP", "TRA", "INV", "TRA"),
CHRA=c("chr1", "chr1", "chr1", "chr1", "chr2", "chr2"),
POSA=c(10, 15, 120, 340, 100, 220),
CHRB=c("chr1", "chr1", "chr1", "chr2", "chr2", "chr1"),
POSB=c(30, 100, 300, 20, 200, 320)) ,

how could I initiate another 2 columns in x, where each element in these 2
columns is going to be a list (the list could be updated later). Thank you !

Shall I do,

for (i in 1:dim(x)[1]) { x$intersectA[i] <- list()}

for (i in 1:dim(x)[1]) { x$intersectB[i] <- list()}

nothing is happening. Thank you very much !

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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