R언어 POSIXct 형의 변환 코드

데이터 분석 2019. 8. 1. 13:27 Posted by UnHa Kim

R에서 시간을 나타내는 자료형 몇 가지 중 자주 사용되는 POSIXct의 경우

 

세부 정보를 추출할 때 사용되는 코드는 다음과 같다.

 

Code Meaning Code Meaning
%a Abbreviated weekday %A Full weekday
%b Abbreviated month %B Full month
%c Locale-specific date and time %d Decimal date
%H Decimal hours (24 hour) %I Decimal hours (12 hour)
%j Decimal day of the year %m Decimal month
%M Decimal minute %p Locale-specific AM/PM
%S Decimal second %U Decimal week of the year (starting on Sunday)
%w Decimal Weekday (0=Sunday) %W Decimal week of the year (starting on Monday)
%x Locale-specific Date %X Locale-specific Time
%y 2-digit year %Y 4-digit year
%z Offset from GMT %Z Time zone (character)

 

사용법

format(POSIXct값 , format='<변환코드>')

 

출처 : https://www.stat.berkeley.edu/~s133/dates.html

'데이터 분석' 카테고리의 다른 글

Go언어로 작성된 백테스트 프레임워크  (0) 2021.12.18
Julia용 JupyterLab 설치  (0) 2021.12.06
과거 기업 재무정보  (0) 2019.08.28
Jupyter Notebook 셀 분할/병합 단축키  (0) 2019.08.01
R용 Jupyter 설치  (0) 2019.07.27