title: R data frame column to list (matrix row names)
body: <p>I need to update my matrix row names according to the values coming from a data frame column. I know that I can update my matrix row names like that:</p>
  
  <pre><code>dimnames(A) = list( 
    +   c("row1", "row2"),         # row names 
    +   c("col1", "col2", "col3")) # column names 
  </code></pre>
  
  <p>However, the names "row1" , "row2"... should come from the values of a data frame column that have these values:</p>
  
  <pre><code>products[,2]
   [1] "Samsung UN48H6350 48\""                                                       "Sharp LC-60LE650U 60"                                                        
   [3] "Roku Streaming Stick with remote"                                             "Samsung Galaxy Tab Pro 8.4 16GB, Wi-Fi, 8.4in - White"                       
   [5] "GoPro Here 3 silver"                                                          "Brunswick T Zone 16 lb. bowling ball"                                        
   [7] "SDBS-150 weight set"                                                          "Aventus by Creed Eau De Parfum Spray 4 oz Men"                               
   [9] "Sunny SF-E906"                                                                "Sabrent 4-Port USB 2.0 Hub with Individual Power Switches and LEDs (HB-UMLS)"
  [11] "Magnasonic MAG-MM176K"                                                        "NETGEAR Nighthawk AC1900  (R7000)"                                           
  [13] "FIDO U2F Security Key"                                                        "Foscam FI9821W V2 white"                                                     
  [15] "Samsung UN22F5000"                                                            "D&amp;K Seamless Full Length Leggings"                                           
  [17] "Taste of the Wild Dry Dog Food, Hi Prairie Canine Formula with Roasted Bison" "Tidy Cats 4 Count Breeze Litter Pad Refill (Pack of 10)"                     
  [19] "PetSafe 6-Volt Lithium Battery (2 Batteries per Pack)"                        "Hakko CHP-170 Micro Clean Cutter"                                            
  [21] "Farm Innovators CC-2 Cord Connect Water-Tight Cord Lock - Green"              "Komelon SL2925 Self Lock Speed Mark"                                         
  [23] "SanDisk 32GB Ultra Class 10 Micro SDHC"                                       "Samsung (MB-MP32DA/AM)"                                                      
  [25] "Panasonic ER-GN30-K"                                                          "Ubervita W700"                                                               
  [27] "Baby Einstein Take Along Tunes"                                               "Nosefrida The Snotsucker Nasal Aspirator"                                    
  [29] "Baby Einstein Bendy Ball"                                                     "Mommy's Helper Outlet Plugs 36 Pack"                                         
  [31] "Marcy Recumbent Exercise Bike: ME-709"                                        "Doc McStuffins Get Better Talking Mobile Cart"                               
  [33] "Call of Duty: Advanced Warfare Day Zero Edition (PS3)"                        "VIZIO E320i-B2"                                                              
  [35] "Peg Perego John Deere Gator XUV"                                              "KidKraft Uptown Play Kitchen, Espresso"                                      
  [37] "Lifetime 44\" Pro Court Height-Adjustable Portable Basketball Hoop"           "Canon PIXMA MG2920 printer"                                                  
  [39] "Roadmaster Granite Peak 26\" Men's Mountain Bike, Black"                      "Zoomer Zuppies Interactive Puppy, Roxy"                                      
  [41] "Butterball Digital Electric Extra-Large Fryer"                                "Mongoose Dolomite Mens 7-speed"                                              
  [43] "LEGO Cuusoo Minecraft Building Set"                                           "Hoover SteamVac F5914900"                                                    
  [45] "Razor RipRider 360 Ride-On, Blue"                                             "Cosco - Scenera Convertible Car Seat Renaissance"                            
  [47] "Brother PE770"                                                                "RCA RTD317W"                                                                 
  [49] "iPads, Tablets &amp; eBook Readers"                                               "Televisions"                                                                 
  [51] "iPads, Tablets &amp; eBook Readers"                                               "Vacuum Cleaners"   
  </code></pre>
  
  <p>My question is actually how to extract the values of this data frame column so it would be in the form of:</p>
  
  <pre><code>"Samsung UN48H6350 48\"" , "Sharp LC-60LE650U 60"  , "Roku Streaming Stick with remote"  ... 
  </code></pre>
  
  <p>So I could take this list and pass it as parameter to dimnames(A) 
  I tried:</p>
  
  <pre><code>rownames(products) &lt;- products[,2] 
  Error in rownames&lt;-(*tmp*, value = c("Samsung UN48H6350 48\"", "Sharp LC-60LE650U 60", : length of 'dimnames' [1] not equal to array extent
  
  &gt; dput(products)
  structure(list(id = 1:53, keywords = c("Samsung UN48H6350 48\"", 
  "Sharp LC-60LE650U 60", "Roku Streaming Stick with remote", "Samsung Galaxy Tab Pro 8.4 16GB, Wi-Fi, 8.4in - White", 
  "GoPro Here 3 silver", "Brunswick T Zone 16 lb. bowling ball", 
  "SDBS-150 weight set", "Aventus by Creed Eau De Parfum Spray 4 oz Men", 
  "Sunny SF-E906", "Sabrent 4-Port USB 2.0 Hub with Individual Power Switches and LEDs (HB-UMLS)", 
  "Magnasonic MAG-MM176K", "NETGEAR Nighthawk AC1900  (R7000)", 
  "FIDO U2F Security Key", "Foscam FI9821W V2 white", "Samsung UN22F5000", 
  "D&amp;K Seamless Full Length Leggings", "Taste of the Wild Dry Dog Food, Hi Prairie Canine Formula with Roasted Bison", 
  "Tidy Cats 4 Count Breeze Litter Pad Refill (Pack of 10)", "PetSafe 6-Volt Lithium Battery (2 Batteries per Pack)", 
  "Hakko CHP-170 Micro Clean Cutter", "Farm Innovators CC-2 Cord Connect Water-Tight Cord Lock - Green", 
  "Komelon SL2925 Self Lock Speed Mark", "SanDisk 32GB Ultra Class 10 Micro SDHC", 
  "Samsung (MB-MP32DA/AM)", "Panasonic ER-GN30-K", "Ubervita W700", 
  "Baby Einstein Take Along Tunes", "Nosefrida The Snotsucker Nasal Aspirator", 
  "Baby Einstein Bendy Ball", "Mommy's Helper Outlet Plugs 36 Pack", 
  "Marcy Recumbent Exercise Bike: ME-709", "Doc McStuffins Get Better Talking Mobile Cart", 
  "Call of Duty: Advanced Warfare Day Zero Edition (PS3)", "VIZIO E320i-B2", 
  "Peg Perego John Deere Gator XUV", "KidKraft Uptown Play Kitchen, Espresso", 
  "Lifetime 44\" Pro Court Height-Adjustable Portable Basketball Hoop", 
  "Canon PIXMA MG2920 printer", "Roadmaster Granite Peak 26\" Men's Mountain Bike, Black", 
  "Zoomer Zuppies Interactive Puppy, Roxy", "Butterball Digital Electric Extra-Large Fryer", 
  "Mongoose Dolomite Mens 7-speed", "LEGO Cuusoo Minecraft Building Set", 
  "Hoover SteamVac F5914900", "Razor RipRider 360 Ride-On, Blue", 
  "Cosco - Scenera Convertible Car Seat Renaissance", "Brother PE770", 
  "RCA RTD317W", "iPads, Tablets &amp; eBook Readers", "Televisions", 
  "iPads, Tablets &amp; eBook Readers", "Vacuum Cleaners", "Bicycless"
  ), categories = c("11071", "11071", "168058", "171485", "625", 
  "36105", "888", "26396", "15273", NA, NA, NA, NA, NA, NA, NA, 
  NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
  NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
  "171485", "11071", "171485", "20614", "20614"), buyer_postal_code = c("90210", 
  "90210", "90210", "90210", "90210", "90210", "90210", "90210", 
  "90210", "90210", "90210", "90210", "90210", "90210", "90210", 
  "90210", "90210", "90210", "90210", "90210", "90210", "90210", 
  "90210", "90210", "90210", "90210", "90210", "90210", "90210", 
  "90210", "90210", "90210", "90210", "90210", "90210", "90210", 
  "90210", "90210", "90210", "90210", "90210", "90210", "90210", 
  "90210", "90210", "90210", "90210", "90210", "90210", "90210", 
  "90210", "90210", "90210"), min_price = c(200, 200, 0, 0, 100, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, NA, NA, NA, NA), seller_item_id = c(NA, NA, NA, NA, 
  NA, NA, "111384136042", "111423002580", "191217437226", NA, NA, 
  NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
  NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
  NA, NA, NA, NA, NA, "", NA, NA, NA, NA)), .Names = c("id", "keywords", 
  "categories", "buyer_postal_code", "min_price", "seller_item_id"
  ), row.names = c(NA, -53L), class = "data.frame")
  </code></pre>