I have a table which include some domain names
site
1 Google.com
2 yahoo.in
3 facebook.com
4 badge.net
So, I want to remove all the words after "." for example ( .com, .net, .in). I used below function but that convert my string into numeric form.
gsub("\\..*","",df)