데이터 분석
R언어 POSIXct 형의 변환 코드
UnHa Kim
2019. 8. 1. 13:27
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='<변환코드>')