Learn R Programming

shide (version 0.2.1)

sh_year: Get/set the year component of Jalali date-time objects

Description

Get/set the year component of Jalali date-time objects

Usage

sh_year(x)

# S3 method for jdate sh_year(x)

# S3 method for jdatetime sh_year(x)

sh_year(x) <- value

# S3 method for jdate sh_year(x) <- value

# S3 method for jdatetime sh_year(x) <- value

Value

The year component of x as an integer.

Arguments

x

A vector of jdate or jdatetime objects.

value

A numeric vector.

Details

For assignment, x and value are recycled to their common size using tidyverse recycling rules.

Examples

Run this code
x <- jdate("1402-12-14")
sh_year(x)
sh_year(x) <- 1400:1401

Run the code above in your browser using DataLab