When reading.csv with R, I want to convert the date type column to a numeric type for import, and even if I format the column numerically in the spreadsheet from which the csv is based, if I import it into R, it will be treated as a character type (chr).
What should be done in advance on Spreadsheet to make the column numeric when CSV is imported?
r
You can use the read_csv
package.
#Read data
data<-read_csv('filepath.csv')
# Checking Column Types
str(data)
© 2024 OneMinuteCode. All rights reserved.