0

I am trying to grep all the records of a dataframe which has a full stop in it. But it returns all the records in the dataframe no matter it has a full stop or not.

dot=e[grep(".", e$e1),]
View(dot)

Can anyone help me to do this in the correct way please?

Cyrus
  • 84,225
  • 14
  • 89
  • 153
andy
  • 643
  • 2
  • 12
  • 20

1 Answers1

1

You can either use the fixed=True argument, or use "\."

dot=e[grep(".", e$e1, fixed=T),]

or

dot=e[grep("\\.", e$e1),]

The first option is probably preferable.

lmo
  • 37,904
  • 9
  • 56
  • 69