I appreciate this is a very basic question but I'm new to the R game so any help offered would be very much appreciated.
I have a column called "SNP" in a very large genetics dataset (~8million SNPs). The format of the data in each row of the SNP column is exactly the same, e.g. x1.752566.G.A_G.
All I need to do is to create 2 new columns:
- "chr" which takes the number after the letter x and before the first full stop
- "bp" which takes the number between the two full stops
Can anyone please tell me how to do this in R???