Hi JackDavison,
Yes you are right, after re-assigning the mutate step to the global environment, I re-run the structure code to observe but found something strange.
> str(Oct2021)
spec_tbl_df [631,226 x 13] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
$ ride_id : chr [1:631226] "620BC6107255BF4C" "4471C70731AB2E45" "26CA69D43D15EE14" "362947F0437E1514" ...
$ rideable_type : chr [1:631226] "electric_bike" "electric_bike" "electric_bike" "electric_bike" ...
$ started_at : POSIXct[1:631226], format: "2021-10-22 12:46:00" "2021-10-21 09:12:00" "2021-10-16 16:28:00" "2021-10-16 16:17:00" ...
$ ended_at : POSIXct[1:631226], format: "2021-10-22 12:49:00" "2021-10-21 09:14:00" "2021-10-16 16:36:00" "2021-10-16 16:19:00" ...
$ start_station_name: chr [1:631226] "Kingsbury St & Kinzie St" NA NA NA ...
$ start_station_id : chr [1:631226] "KA1503000043" NA NA NA ...
$ end_station_name : chr [1:631226] NA NA NA NA ...
$ end_station_id : chr [1:631226] NA NA NA NA ...
$ start_lat : num [1:631226] 41.9 41.9 41.9 41.9 41.9 ...
$ start_lng : num [1:631226] -87.6 -87.7 -87.7 -87.7 -87.7 ...
$ end_lat : num [1:631226] 41.9 41.9 41.9 41.9 41.9 ...
$ end_lng : num [1:631226] -87.6 -87.7 -87.7 -87.7 -87.7 ...
$ member_casual : chr [1:631226] "member" "member" "member" "member" ...
- attr(*, "spec")=
.. cols(
.. ride_id = col_character(),
.. rideable_type = col_character(),
.. started_at = col_character(),
.. ended_at = col_character(),
.. start_station_name = col_character(),
.. start_station_id = col_character(),
.. end_station_name = col_character(),
.. end_station_id = col_character(),
.. start_lat = col_double(),
.. start_lng = col_double(),
.. end_lat = col_double(),
.. end_lng = col_double(),
.. member_casual = col_character()
.. )
- attr(*, "problems")=<externalptr>
As you can see, under the spec_table_df, 'started_at' and 'ended_at' are now both POSIXct type. However, in the attr(*, "spec")= section, these 2 variables are still stated as col_character(). Any idea why this is so?
Thanks!