User Tools

Site Tools


convert_datetime_characters_to_date_and_then_get_the_difference_in_number_of_days
  • read csv using the option
file <- read.csv("file.csv", stringsAsFactor = FALSE
  • convert it to Date format
file$created_at <- substr(file$created_at,1,10)
  • convert it to Date format
a <- as.Date(file$created_at)
class(a)(file$created_at) "Date"
convert_datetime_characters_to_date_and_then_get_the_difference_in_number_of_days.txt · Last modified: 2015/07/28 19:26 by vincenzo