Apologies in advance if this has already been asked elsewhere, but I've tried different attempts and nothing has worked so far.
I wish to open a big Excel file (> 21000 rows) using :
myData <- read.xlsx("....xlsx", sheet = 1, colNames = TRUE)
I have two columns with dates that I need to convert in "01-01-2019" format instead of "43000". Therefore I use :
myData$Begin.Date <- convertToDate(myData$Begin.Date)
myData$End.Date <- convertToDate(myData$End.Date)
Then, I also have two columns in the Excel file with Times (in hours:min ranging from 00:00 to 23:59). However, when I read the Excel file in R, all the hours are converted in values from 0 to 0,99. How can I convert these two colums to keep the "hours:min" format ? If I use the convertToDate function, the values 00:00 that appear as 0 now will be converted in "1899-12-30"
myData$Begin.Time <- ??(myData$Begin.Time)
myData$End.Time <- ??(myData$End.Time)
Here is what I've obtained up to now :
> myData <- read.xlsx("....xlsx", sheet = 1, colNames = TRUE)
> myData$Begin.Date <- with(myData, convertToDateTime(Begin.Date))
> myData$End.Date <- with(myData, convertToDateTime(End.Date))
> myData$Begin.Time <- with(myData, convertToDateTime(Begin.Time))
> myData$End.Time <- with(myData, convertToDateTime(End.Time))
> head(myData, 2)
xxxxx yyyyy zzzzz aaaaa bbbbb nnnnnn qqqqq ssssss
1 xxx yyy zzz aaa yyyyyy tttttt B rrr
2 xxx yyy zzz aaa yyyyyy tttttt B rrr
kkkkkk mmmmmm ooooo Begin.Date Begin.Time End.Date End.Time
1 u yyy y 2019-01-01 1899-12-30 2019-01-29 1899-12-30
2 u yyy y 2019-01-01 1899-12-30 2019-01-29 1899-12-30
dput(head(myData,3))
structure(list(Sample_ID = c("...", "...", "..."), Locality.Name = c("...", "...", "..."), Code = c("...", "...", "..."), Catchment = c("...",
"...", "..."), Decimal.Latitude = c(..., ..., ...), Decimal.Longitude = c(..., ..., ...), Sample.type = c("...",
"...", "..."), Sample.Treatment = c(".", ".", "."), Chemicals = c("...", "...", "..."), Apparatus.Type = c(".", ".", "."),
Begin.Date = c(43466, 43466, 43466), Begin.Time = c(0, 0, 0), End.Date = c(43494, 43494, 43494), End.Time = c(0, 0, 0), Value = c(..., ..., .), Value.Type = c("A", "A", "A"), Measuring.Unit = c("...", "...", "..."), Uncertainty.Value = c(..., .., ..), Uncertainty.Type = c(".", ".","."), Uncertainty.Unit = c("...", "...", "..."), Laboratory = c("...", "...", "..."), class = "data.frame")