num2month: Transform month numbers to month names

Description Usage Arguments Value Examples

View source: R/num2month.R

Description

num2month transform month numbers to month names

Usage

1

Arguments

date

a month numbers vector

abbreviate

abbreviate months name

ptbr

transalate result to "Portugues (Brasil)".

Value

Return a month names.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
v=c(01,02,03,04,05,06,07,08,09,10,11,12)
num2month(v)
num2month(v,abbreviate=TRUE)
num2month(v,abbreviate=FALSE,ptbr=TRUE)
num2month(v,abbreviate=TRUE,ptbr=TRUE)

v=data.frame('date'=c(01,02,03,04),'values'=c(18,27,10,48))
num2month(v$date)
#or
num2month(v[[1]])

#you can substitute column with function:
v$date = num2month(v$date)
v[[1]] = num2month(v[[1]])

#The data can be a string, but is recommended use numbers,
#see a string examples:
v=c('01','02','03','04','05','06','07','08','09','10','11','12')
num2month(v)

v=c('1','2','3','4','5','6','7','8','9','10','11','12')
num2month(v)

metools documentation built on July 2, 2020, 2:28 a.m.

Related to num2month in metools...