Time Series in R
R
How to Extract Year from Date in R (With Examples)
There are two ways to quickly extract the year from a date in R:
Method 1: Use format()
df$year as.Date(df$date, format="%d/%m/%Y"),"%Y")
Method 2: Use the lubridate package
library(lubridate)
df$year...
R
How to Aggregate Daily Data to Monthly and Yearly in R
Occasionally you may want to aggregate daily data to weekly, monthly, or yearly data in R.
This tutorial explains how to easily do so using...
R
How to Plot a Time Series in R (With Examples)
Often you may want to plot a time series in R to visualize how the values of the time series are changing over time.
This...
R
How to Calculate MSE in R
One of the most common metrics used to measure the prediction accuracy of a model is MSE, which stands for mean squared error. It is calculated...
R
How to Calculate RMSE in R
The root mean square error (RMSE) is a metric that tells us how far apart our predicted values are from our observed values in a regression...
R
How to Calculate MAPE in R
One of the most common metrics used to measure the forecasting accuracy of a model is MAPE, which stands for mean absolute percentage error.
The formula to...
Subscribe
- Never miss a story with notifications
- Gain full access to our premium content
- Browse free from up to 5 devices at once
Must read