I'm importing a large number of excel files into R using lapply but for a few columns with values, R seems to recognize them as a date column. For example, 7.5 was recognized as 1900-01-07 12:00:00. There are several columns where R does this. Using
as.numeric
on the column results in "-2208427200"
Is there any way to make sure the columns on the 50+ excel files that I import are have the correct structure
Edit: This is the code I'm using to import the data
temp = list.files(pattern="*.XLSX")
list2env(
lapply(setNames(temp, make.names(gsub("*.XLSX$", "", temp))), col_names=FALSE,read_excel,skip=2), envir = .GlobalEnv)
There's 50-53 variables per file. I'm importing with the first two rows as headers. I'm skipping the first two rows and will later rename each file.
The data I'm importing looks kind of like this but I'm dealing with many more variables
Name File# Date Rate Hours TempRate
BOB 101 5/9/19 $20 7.5 $18
ROB 102 5/10/19 $30 0 $20
Nick 103 5/10/19 30 7 $40