Learn R Programming

datetoiso (version 1.2.1)

check_if_only_year_entered: Check if a Vector Contains only Year

Description

This function determines whether the elements of a vector contain only **year** It returns a logical vector indicating which elements meet this criterion.

Usage

check_if_only_year_entered(
  data_frame,
  column_name,
  separator = "-",
  month = "UNK",
  day = "UN"
)

Value

A logical vector

Arguments

data_frame

data frame

column_name

name of column that keeps dates to be imputed

separator

by default "-" it is a day-month-year separator, for example "2024-10-21" has "-" separator

month

by default "UNK" - the format of unknown month

day

by default "UN" - the format of unknown day

Author

Lukasz Andrzejewski