Go to TogaWare.com Home Page. Data Science Desktop Survival Guide
by Graham Williams
Duck Duck Go



CLICK HERE TO VISIT THE UPDATED SURVIVAL GUIDE

Modify Columns

ds %>%
  select(date, location, pressure_9am)
## # A tibble: 176,747 x 3
##    date       location pressure_9am
##    <date>     <chr>           <dbl>
##  1 2008-12-01 Albury          1008.
##  2 2008-12-02 Albury          1011.
##  3 2008-12-03 Albury          1008.
....

ds %>%
  mutate(pressure_9am=round(pressure_9am, 0)) %>%
  select(date, location, pressure_9am)
## # A tibble: 176,747 x 3
##    date       location pressure_9am
##    <date>     <chr>           <dbl>
##  1 2008-12-01 Albury           1008
##  2 2008-12-02 Albury           1011
##  3 2008-12-03 Albury           1008
....

To convert all character columns to be numeric:

ds %>%
  mutate(across(where(is.character), as.numeric))


Support further development by purchasing the PDF version of the book.
Other online resources include the GNU/Linux Desktop Survival Guide.
Books available on Amazon include Data Mining with Rattle and Essentials of Data Science.
Popular open source software includes rattle and wajig.
Hosted by Togaware, a pioneer of free and open source software since 1984.
Copyright © 2000-2020 Togaware Pty Ltd. . Creative Commons ShareAlike V4.