# 패키지 설치
install.packages('svDialogs')
library(svDialogs)
# 문자열 입력받기
user.input <- dlgInput('Input income')$res
user.input
# 입력받은 문자열을 숫자로 변환
income <- as.numeric(user.input)
income
# 세금 계산하기
tax <- income * 0.05
cat('세금: ', tax)
'Data Science > R' 카테고리의 다른 글
[R 문법] R 에서 파일(.csv)을 읽고 쓰는 방법 (0) | 2021.10.04 |
---|---|
[R 문법] print() VS cat() (0) | 2021.10.04 |
[R dataset] iris 데이터셋 다뤄보기 (0) | 2021.10.03 |
[R 문법] 매트릭스 VS 데이터프레임 (0) | 2021.10.03 |
[R Terminology] FP(False Positive) VS FN(False Negative) (0) | 2021.10.03 |