Entering edit mode
2.3 years ago
Hyper_Odin
▴
320
Hello all,
I got this matrix after pivoting the data, now I am looking for a solution where
can be converted to
this deletion; snv
.
I am not able to figure out how to do this. I have tried separate(), but it doesn't work
I would be grateful if somebody could at least give me a hint on how to do it!
Thanks
Please use
dput()
to provide example data.Here it is :
Could you specify what you want to achieve? This is a data frame with columns as lists.If you want to work only on the selected column something like this should work :
But if you want do such conversion for all columns that's a different story.
Hi Hamid, So, in a partcular columns i have something like this
[1] " "
[2] "insertion"
[3] "deletion"
[4] "c(\"deletion\", \"SNV\", \"SNV\", \"SNV\")"
[5] "SNV"
[6] "c(\"SNV\", \"SNV\", \"SNV\", \"SNV\", \"SNV\", \"SNV\")"
[7] "c(\"SNV\", \"SNV\", \"SNV\", \"SNV\")"
[8] "c(\"SNV\", \"SNV\", \"SNV\", \"SNV\", \"SNV\", \"SNV\", \"SNV\")"
i want to remove the repeating terms and the c() and keep only one term. For example, i want my output to look like this
[1] " "
[2] "insertion"
[3] "deletion"
[4] "deletion", "SNV"
[5] "SNV"
[6] "SNV"
[7] "SNV"
[8] "SNV"
thank you so much