0

My file is like this(1822306 long file)-

colIDs  rowIDs
1   NBAS    NBAS
2   DNAH9   DNAH9
3   NRAS    NRAS
4   NRAS.1  NRAS
5   TP53    TP53
6   TP53.1  TP53
7   SCYL2   TP53
8   RNF19A  SCYL2

I want to remove after decimal value including decimal(.) from this file

G5W
  • 36,531
  • 10
  • 47
  • 80
xrxrxrxxr
  • 89
  • 1
  • 7

1 Answers1

0

You can do this with sub and a regular expression.

Data$colIDs = sub("\\..*", "", Data$colIDs)

\\. selects the (first) period and .* includes everything afterwards. These are replaced with the empty string.

G5W
  • 36,531
  • 10
  • 47
  • 80