I want to separate a character from a number variable. My data looks like this:
chr pos A1 A2 chr1 1245 T A chr2 6789 G C
I want it to look like this:
chr pos A1 A2 chr_num chr1 1245 T A 1 chr2 6789 G C 2
How can I do this using the command line? Also, anyone know how to do this in R?
I tried this in R, but it didn't exactly work.
chr <- gsub("chr", "", paste(short_sleep_hg38_hg19$chr))