title: How to count number of words for each row of a column and then convert to numeric?
body: <p>I have a column in a data frame that lists amenities found in a hotel location. I need to count how many amenities are in each row and then convert this to a number so I can then make another column with these numbers. </p>
  
  <pre><code>&gt; airbnb$amenities[1:25]
   [1] "{TV,Internet,Wifi,\"Air conditioning\",\"Paid parking off premises\",Breakfast,Heating,\"Smoke detector\",\"Carbon monoxide detector\",\"First aid kit\",\"Safety card\",\"Fire extinguisher\",Essentials,Shampoo,\"Lock on bedroom door\",\"24-hour check-in\",Hangers,\"Hair dryer\",Iron,\"Laptop friendly workspace\",\"translation missing: en.hosting_amenity_49\",\"translation missing: en.hosting_amenity_50\",\"Private entrance\",\"Hot water\",\"Patio or balcony\",\"Garden or backyard\",\"Luggage dropoff allowed\",\"Well-lit path to entrance\",\"Host greets you\"}"                                                                                                                                                                                                                                                                                                         
   [2] "{TV,Wifi,\"Air conditioning\",Kitchen,\"Pets live on this property\",Cat(s),\"Free street parking\",Heating,Washer,Dryer,\"Smoke detector\",Essentials,Shampoo,Hangers,\"Hair dryer\",Iron,\"Laptop friendly workspace\",\"Hot water\",\"Luggage dropoff allowed\",Other}"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
   [3] "{TV,\"Cable TV\",Wifi,\"Air conditioning\",Pool,Kitchen,\"Free parking on premises\",Breakfast,Elevator,\"Hot tub\",\"Buzzer/wireless intercom\",Heating,\"Family/kid friendly\",Washer,\"Smoke detector\",\"First aid kit\",Essentials,Shampoo,\"24-hour check-in\",Hangers,\"Hair dryer\",Iron,\"translation missing: en.hosting_amenity_50\"}"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
   [4] "{Internet,Wifi,Pool,Kitchen,\"Free street parking\",\"Buzzer/wireless intercom\",Heating,\"Smoke detector\",Essentials,Hangers,Iron,\"Hot water\",Microwave,\"Coffee maker\",Refrigerator,\"Dishes and silverware\",\"Cooking basics\",\"BBQ grill\",\"Garden or backyard\",\"Long term stays allowed\",\"Host greets you\"}"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
   [5] "{TV,Internet,Wifi,\"Air conditioning\",Kitchen,\"Paid parking off premises\",Elevator,\"Buzzer/wireless intercom\",Heating,Washer,Dryer,\"Smoke detector\",\"First aid kit\",\"Safety card\",Essentials,Shampoo,Hangers,\"Hair dryer\",Iron,\"Laptop friendly workspace\",\"Hot water\",Microwave,Refrigerator,Dishwasher,\"Dishes and silverware\",\"Cooking basics\",Oven,Stove,\"Long term stays allowed\",Other}"     
  </code></pre>
  
  <p>I'm familiar with using grep, gsub and the like but I'm confused as to how to count within each row. I thought that grep('[a-z]', airbnb$amenities) might work to somehow count the patterns in each row but am still confused.</p>