Hello guys
I have the following dataframe
median_time <- c("4.5", "141.2","33.1","48.3") %>% as.numeric()
second_date_picked <- c("first_canceled_time", "first_in_production_time", "first_canceled_time","first_in_production_time") %>% as.factor()
date <- c("2020-02-22", "2020-02-22", "2020-02-23", "2020-02-23") %>% date()
teste <- data.frame(date, second_date_picked, median_time) %>% as_tibble()
teste %>% pivot_longer(second_date_picked:median_time)
and I basically want to have "first_canceled_time" and "first_in_production_time" as a column.
I am getting the error: "Error: Can't combine second_date_picked
<factor> and median_time
."
So I would like something like this
date first_canceled_time first_in_production_time
2020-02-22. 4.5 141
2020-02-23. 33.1 48.3
What Am I doing wrong here?