반응형
반응형
본문 바로가기

공부/R Programming51

R 기초; 함수 Function R 기초; 함수 Function # 예시 함수 #01 transLength 2021. 1. 16.
R 기초; 출력 R 기초; 출력 2021. 1. 15.
R 기초; 입력 R 기초; 입력 # 파일 읽기 read.csv(file="product.csv") # 도움말 보기 ?read.csv read.csv(file="product-with-no-header.csv", header=FALSE) read.table(file="product.txt") read.table(file="product.txt", header=TRUE) read.table(file="product-colon.txt", header=TRUE, sep=":") read.table(file="product-mssing.txt", header=TRUE) read.table(file="product-missing.txt", header=TRUE, na.strings=".") read.fwf(file= "produc.. 2021. 1. 15.
R 기초; 날짜와 시간 R 기초; 날짜와 시간 # 날짜 출력 Sys.Date() [1] "2021-01-15" # 날짜 + 시간 출력 date() [1] "Fri Jan 15 09:00:40 2021" # 날짜 + 시간 출력 Sys.time() [1] "2021-01-15 09:00:44 KST" class(Sys.Date()) [1] "Date" as.Date("2025-12-31") [1] "2025-12-31" as.Date("2025/12/31") [1] "2025-12-31" as.Date("12/31/2025") Error in charToDate(x) : 문자열이 표준서식을 따르지 않습니다 as.Date("12/31/2025", format("%m/%d/%y)) [1] "2020-12-31" # 도움말 보기 ?st.. 2021. 1. 15.
R 기초; 웹 스크레이핑 stringr 패키지 R 기초; 웹 스크레이핑 stringr 패키지 string 2021. 1. 15.
R 기초; 웹스크레이핑 base 패키지 R 기초; 웹스크레이핑 base 패키지 string 2021. 1. 14.
R 기초; 텍스트 R 기초; 텍스트 x 2021. 1. 13.
R 기초; 데이터프레임 인덱싱-3 R 기초; 데이터프레임 인덱싱-3 # 자동차 모델 별 자동차 정보 데이터 불러오기 head(mtcars) mpg cyl disp hp drat wt qsec vs am gear carb Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4 Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1 Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1 Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2 Valiant 18.1 6 225 105 2.76.. 2021. 1. 10.
R기초; 데이터프레임 인덱싱 - 2 R기초; 데이터프레임 인덱싱 - 2 # R기초; 데이터프레임 인덱싱 - 2 # Iris 데이터 불러오기 head(iris) sepal.length sepal.width petal.length petal.width species 1 5.1 3.5 1.4 0.2 setosa 2 4.9 3.0 1.4 0.2 setosa 3 4.7 3.2 1.3 0.2 setosa 4 4.6 3.1 1.5 0.2 setosa 5 5.0 3.6 1.4 0.2 setosa 6 5.4 3.9 1.7 0.4 setosa r 2021. 1. 10.

반응형