Hi,
I am a beginner in R. I want to grep "x" from file1 and pipe it with line count command to know how many lines in file1 contain "X". What is the command for it? 
Let's say we have below file:

**file1.txt**

    texst1	test1
    test2	test1
    test3	test1
    test4	xtexst1
    test5x	test1

We can read the file, and use `grepl` to search for *"x"*. `grepl` returns *TRUE* for matches, then we can `sum` to get the count.

    myFile <- readLines("file1.txt")
    sum(grepl(pattern = "x", x = myFile))
    # [1] 3

