I am looking for a code to remove the characters from an alphanumeric vector of a data frame. This my data column below:
F9667968CU
67968PX11
3666SP
6SPF10
2323DL1
23DVL10
2016PP07
And this is the code I have used:
for(i in 1: length(rownames(testsample)))
{
testsample$column1[i]<-gsub("[a-zA-Z]","",testsample$column1[i])
}
And below is the output I am expecting:
9667968
6796811
3666
610
23231
2310
201607