Skip to content

Instantly share code, notes, and snippets.

@dialektike
Created July 7, 2016 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dialektike/eae1c9ba77a1d642acaa85435bc98c65 to your computer and use it in GitHub Desktop.
Save dialektike/eae1c9ba77a1d642acaa85435bc98c65 to your computer and use it in GitHub Desktop.
미국 연비(MPG)를 한국 연비로 바꾸기
mpg <- seq(10,40)
kmL <- (mpg * 1.609344)/3.785411784 ## 단순하게 바꾸기
install.packages("datamart") ## 패키지 설치
library(datamart) ## 패키지 설치
uconv(1, "US gal", "l", uset="Volume") ## 1 캘런을 리터로
uconv(1, "mile", "km", uset="Length") ## 1 마일을 킬로미터로
kmL.uconv <- uconv(mpg, "mile", "km", uset="Length")/uconv(1, "US gal", "l", uset="Volume") ## uconv()을 이용하여 바꾸기
kmL == kmL.uconv ## 두 계산 결과 확인
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment