Nothing to worry about. It just means that R-base & lubridate have functions with the same name. R will use the lubridate functions as the default in this session. If yo need to use the base functions instead (very unlikily) you can specify the funtion by
I tried the syntax again and this is the output error:
#> Error in group_by():
! Must group by variables found in .data. Column weekday is not found.
Run rlang::last_trace() to see where the error occurred.
Thank you for your support. I started the cleaning process again from scratch.
Despite installing and loading all the packages required
The ridership data by type and weekday could not be analyzed
here is the syntax:
mutate(weekday = wday(started_at, label = TRUE)) %>%
group_by(member_casual, weekday) %>%
summarise(number_of_rides = n()
,average_duration = mean(ride_length)) %>%
arrange(member_casual, weekday)```
#> And here is the error prompt:
Error in `mutate()`:
ℹ In argument: `weekday = wday(started_at, label = TRUE)`.
Caused by error in `wday()`:
! unused argument (label = TRUE)
Run `rlang::last_trace()` to see where the error occurred.
# Your professional guidance is appreciated
# Thank you!
Thank you for your support. I started the cleaning process again from scratch.
Despite installing and loading all the packages required
The ridership data by type and weekday could not be analyzed
here is the syntax:
mutate(weekday = wday(started_at, label = TRUE)) %>%
group_by(member_casual, weekday) %>%
summarise(number_of_rides = n()
,average_duration = mean(ride_length)) %>%
arrange(member_casual, weekday)```
#> And here is the error prompt:
Error in `mutate()`:
ℹ In argument: `weekday = wday(started_at, label = TRUE)`.
Caused by error in `wday()`:
! unused argument (label = TRUE)
Run `rlang::last_trace()` to see where the error occurred.
# Your professional guidance is appreciated
# Thank you!
is the key—what kind of date representation is this?
library(lubridate)
#>
#> Attaching package: 'lubridate'
#> The following objects are masked from 'package:base':
#>
#> date, intersect, setdiff, union
# ISO formatted date string works
wday("2023-07-22",label = TRUE)
#> [1] Sat
#> Levels: Sun < Mon < Tue < Wed < Thu < Fri < Sat
# system date works
wday(Sys.Date(),label = TRUE)
#> [1] Sat
#> Levels: Sun < Mon < Tue < Wed < Thu < Fri < Sat
# epoachal date seems to quarter work
wday(system("date"))
#> [1] 0
# but not really, since it is day 0
# and 1970-01-01 was a Thurday, day 5
as.Date(system("date"))
#> [1] "1970-01-01"
wday(as.Date(system("date")))
#> [1] 5
stringsAsFactors = FALSE,
date = c("2019-04-01","2019-04-01",
"2019-04-01","2019-04-01","2019-04-01","2019-04-01",
"2019-04-01","2019-04-01","2019-04-01","2019-04-01"),
day_of_week = c("Monday","Monday","Monday",
"Monday","Monday","Monday","Monday","Monday","Monday",
"Monday")```
# the first ten observations in the date column.
it is important you also know that at one point of the data processing. I created a new vesion of the dataframe (v2).
As indicated in the guide note for the data cleaning (# We will create a new version of the dataframe (v2) since data is being removed) and this syntax was implemented to create a new version of the dataframe because bad data is beign removed: r all_trips_v2 <- all_trips[!(all_trips$start_station_name == "HQ QR" | all_trips$ride_length<0),]
I hope you will find it useful as you try to help me.
here is the dataframe (v2)
date = c("2019-04-01","2019-04-01","2019-04-01",
"2019-04-01","2019-04-01","2019-04-01","2019-04-01",
"2019-04-01","2019-04-01","2019-04-01"),
day_of_week = c("Monday","Monday","Monday","Monday",
"Monday","Monday","Monday","Monday","Monday","Monday")```
@technocrat Thank you! I appreciate your effort and prompt response.
here is what happened after trying the syntax:
Error in lapply(list(...), .num_to_date) : object 'd' not found
> d$dow <- wday(d$date)
Error in wday(d$date) : object 'd' not found
> ```
# now that you know what the data.frame looks like.
# what would you suggest to be best possible way to -
analyze the rideship data by type and weekday?