How do i change the type of a colume of a dataframe in a list in R

57 views Asked by At

I imported some cleaned excel datas into R

files <- list.files(pattern=".xlsx")
files
combined_2023 <- setNames(lapply(files, read.xlsx), files)

Then i proceeded to combining the rows of the list using bind_rows combined_23 <- bind_rows(combined_2023) I got the error

! Can't combine `..1$ride_length` <double> and `..7$ride_length` <character>.

checked and found out one of the ride length is formatted as character instead of double been trying to fix to no avail. I am a newbie

enter image description here

I tried formatting the file as "time" in excel as i did to all other ride_length column of other data frames in the list but only that particular one still shows "chr"

0

There are 0 answers