In R, there are special time series objects - called as Date-time objects which are designed to work best with many time series statistical models and visualisation libraries such as ggplot2.
These date time objects ensure that each observations time and value are "tied toether" so that they are not easily separated during analysis.
It is very common to have the time component (date,time etc.) of the time series data as Character object and not as date-time object. R has special classes called as Date and POSIXct class, that are designed to handle time series data. These classes have special methods that work very efficiently with time series data. R will only recognize the objects belonging to these clasees as date-time objects.
In this video, we will learn how to convert the character class objects into Date/POSIXct class objects using various parsing functions from lubridate package. We will use stock pricing data and IoT sensor data. These data-sets have time component (date variable) class as character class. We will convert this class into either Date or POSIXct class using parsing functions.
Datasets and Rmarkdown file can be found at Git repo:
github.com/sid...
13 окт 2024