R: Find Matching Search Term in csv file
<p>I would like to know how to find the exact lower case string under the column Search Terms.</p>

<p>What I currently did: </p>

<p>Using  R studio, I read in a CSV file using this command:</p>

<pre><code>books = read.csv("~/Desktop/R Class /BBbooklist.csv", sep=",",header= TRUE,na.strings = "?",stringsAsFactors = FALSE)
</code></pre>

<p>The csv file has a header:</p>

<pre><code>[1] "Department"         "Search.Term"        "Search.Frequency"   "ASIN"              
[5] "X.1.Clicked.Title"  "Click.Share"        "Conversion.Share"   "ASIN.1"            
[9] "X.2.Clicked.Title"  "Click.Share.1"      "Conversion.Share.1" "ASIN.2"            
[13] "X.3.Clicked.Title"  "Click.Share.2"      "Conversion.Share.2"
</code></pre>

<p>Here is the image of the file called books:</p>

<p><img src="https://i.stack.imgur.com/Wv3kC.jpg" alt="Snapshot of the CSV File"></p>

<p>What I want is to retrieve all rows for the search term: 'adult coloring books'
and save the rows to a new file called <code>keywords.csv</code></p>

<p>I have tried several options like:</p>

<pre><code>dta.subset&lt;-subset(books,Search.Term = 'adult coloring books')
</code></pre>

<p>as well as grep commands like:</p>

<pre><code>grep(pattern = "adult coloring books",x = string, value = T)
</code></pre>