title: using dplyr can we change to numeric data type only those columns for which data type is integer
body: <p>I wonder if there is any way to convert only those columns which are integer data types to numeric using dplyr or base package?</p>
  
  <p>My dataset is something like this:</p>
  
  <pre><code>structure(list(V1 = c("AA0101", "AA0101", "AA0102", "AA0102", "AA0103", "AA0103"), 
                 V2 = 38080:38085, 
                 V3 = c(0L, 50353564L, 13000567L, 50395060L, 0L, 0L),
                 V4 = c(0L, 2L, 2L, 1L, 0L, 0L), 
                 V5 = c("PS", "NW", "PS", "NW", "PS", "NW"), 
                 V6 = c("4/1/2019", "4/1/2019", "4/1/2019", "4/1/2019", "4/1/2019", "4/1/2019"), 
                 V7 = c("20:06:04", "20:22:17", "20:41:53", "21:31:04", "21:58:51", "23:08:04"), 
                 V8 = c("20:06:14", "20:22:22", "20:41:58", "21:31:11", "21:59:01", "23:08:10"), 
                 V9 = c(10L, 5L, 5L, 7L, 10L, 6L), 
                 V10 = c("0:00:00", "20:22:22", "20:41:58", "21:31:11", "0:00:00", "0:00:00"), 
                 V11 = c("0:00:00", "20:23:58","20:42:55", "21:31:31", "0:00:00", "0:00:00"), 
                 V12 = c(0L, 96L, 57L, 20L, 0L, 0L), 
                 V13 = c("AGENT", "AGENT", "AGENT","AGENT", "AGENT", "HANG"), 
                 V14 = c("20:06:13", "20:23:57", "20:42:54", "21:31:30", "21:59:00", "0:00:00"), 
                 V15 = c("20:08:07", "20:25:41", "20:43:43", "21:34:52", "22:01:03", "0:00:00"), 
                 V16 = c(114L, 104L, 49L, 202L, 123L, 0L), 
                 V17 = c("DORIT", "SHLOMO", "DORIT", "ZOHARI", "DORIT", "NO_SERVER")))
  </code></pre>
  
  <p>When I did:</p>
  
  <pre><code> str(dat)
  </code></pre>
  
  <p>It returned me the following:</p>
  
  <pre><code>Classes ‘data.table’ and 'data.frame':  6 obs. of  17 variables:
   $ V1 : chr  "AA0101" "AA0101" "AA0102" "AA0102" ...
   $ V2 : int  38080 38081 38082 38083 38084 38085
   $ V3 : int  0 50353564 13000567 50395060 0 0
   $ V4 : int  0 2 2 1 0 0
   $ V5 : chr  "PS" "NW" "PS" "NW" ...
   $ V6 : chr  "4/1/2019" "4/1/2019" "4/1/2019" "4/1/2019" ...
   $ V7 : chr  "20:06:04" "20:22:17" "20:41:53" "21:31:04" ...
   $ V8 : chr  "20:06:14" "20:22:22" "20:41:58" "21:31:11" ...
   $ V9 : int  10 5 5 7 10 6
   $ V10: chr  "0:00:00" "20:22:22" "20:41:58" "21:31:11" ...
   $ V11: chr  "0:00:00" "20:23:58" "20:42:55" "21:31:31" ...
   $ V12: int  0 96 57 20 0 0
   $ V13: chr  "AGENT" "AGENT" "AGENT" "AGENT" ...
   $ V14: chr  "20:06:13" "20:23:57" "20:42:54" "21:31:30" ...
   $ V15: chr  "20:08:07" "20:25:41" "20:43:43" "21:34:52" ...
   $ V16: int  114 104 49 202 123 0
   $ V17: chr  "DORIT" "SHLOMO" "DORIT" "ZOHARI" ...
   - attr(*, ".internal.selfref")=&lt;externalptr&gt; 
  </code></pre>