Learn R Programming

wikipediatrend (version 2.1.6)

wp_year: Function to extract the year

Description

Function to extract the year from a timestamp of e.g. class POSIXlt, POSIXct, Date, or character. If the option is of type character it should be in the form of yyyy-mm-dd.

Usage

wp_year(timestamp)

# S3 method for POSIXlt wp_year(timestamp)

# S3 method for default wp_year(timestamp)

Arguments

timestamp

Some sort of timestamp e.g. of class POSIXlt, POSIXct, Date, or character. If the option is of type character it should be in the form of yyyy-mm-dd.

Methods (by class)

  • POSIXlt: extract

  • default: extract