Excel import and format change

When I import excel, my two columns are changed to decimal format in R. One column in time format in excel (HH:MM:SS) and the other is day of the week (Sunday, Monday, etc.). In excel, these two columns have formula in them to get time and day of the week based of other columns.
How can I bring these data with no format change in R?

Hi @Sunil_Mehta ,

Please post an example of your data and the code you are using as a reproducible example

Just a guess here but have you checked out the read_excel function from the readxl package? That should be able to read your excel file formulas, but just take the values.

You can assign the column types using the col_types function in readxl package. See the documentation here. For e.g.:

data <- read_excel("data.xls",  col_types = c("text", "date", "numeric")) 

It does not allow me to upload xlsx file

when I import into R, last two columns are imported with numbers that I don't recognize.
ride_length and day_of_week are derived from formula.

Could you please share a link to your excel sheet on google drive/ dropbox/ onedrive?

Thank you, Shubham. I don't have import issue any more.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.