Add & Subtract Days to & from Date in R (2 Examples) | Calculate Dates | as.Date & class Functions

Описание к видео Add & Subtract Days to & from Date in R (2 Examples) | Calculate Dates | as.Date & class Functions

How to attach or deduct a certain number of days from a date object in the R programming language. More details: https://statisticsglobe.com/add-and-s...
R code of this video:

my_date <- "2021-10-05" # Create example date
my_date # Print example date

class(my_date) # Check class of date

my_date_new <- as.Date(my_date) # Convert character to Date
my_date_new # Print updated date

class(my_date_new) # Class of updated date

my_date_new + 100 # Add to date

my_date_new - 100 # Subtract from date

Follow me on Social Media:
Facebook:   / statisticsglobecom  
LinkedIn:   / statisticsglobe  
Reddit:   / joachimschork  
Twitter:   / joachimschork  

Комментарии

Информация по комментариям в разработке