Entering edit mode
6.2 years ago
sofie_carolina
▴
30
New to R,using VCFR package. I have to break the repeated col. values into same col vertically displaying the output.
Sample Chr p-value AF MQ Sample Chr p-value AF MQ Sample Chr p-value AF MQ
A1 1 0.0533 30 40 A1 1 0.0633 35 45 A1 2 0.0753 35 45
I am trying to get the output,
Sample Chr p-value AF MQ
A1 1 0.0533 30 40
A1 1 0.0633 35 45
A1 2 0.0753 35 45
.......
.....
..
So on ..
I am using VCFR package to Read VCF Files and splitting their info field.
Thanks Ryan, I'll try this also. But, assume if we have "n" nu of cols then how to use .. ? I have shown only 5 cols, in some case there will be more than 40/50 cols and this is dynamic..
Also, can u pls say what is "c" and "d" ?
Thanks ..
d
is your data frame,c
is the standard Rc
function for defining vectors. For a dynamic number, I'd probably just create a string andeval()
it. I'm sure there's a much more elegant way to do that, but it's simple to implement.Can you pls update your script once ?
You can try to figure that our yourself first.