목록Coding/R-programming (22)
exestudiary
Review # 내장 데이터 iris3 불러오기 data(iris3) # iris3의 데이터 구조 파악하기 str(iris3) # iris3의 세 번째 페이지의 행의 수 구하기 nrow(iris[,,3]) # iris3의 세 번째 페이지의 변수 Sepal L.의 분산 구하기 var(iris3[,"Sepal L.",3]) # 값 "A", "B", "C"를 중복 허락하여 iris3의 세 번째 페이지의 행의 수만큼 추출한 벡터 label 생성하기 label = sample(c("A", "B", "C")nrow(iri3[,,3]), replace = True) 외부 데이터 불러오기 read.csv(file, header = TRUE, ..) read_excel(path, col_names = TRUE, ...)..
Review A = matrix(seq(-5, 5, length = 25)) B = matrix(seq(5, 10, length = 25)) det A ; det B A %*% B k = matrix(0, nr = 3, nc = 3) # matrix(c(1,0,0,0,1,0,0,0,1), nr =3) diag(k) = 1 #(diagonal elements - 대각성분) R에서 데이터 만들기 (출처: Psycological Effects of COVID Answers to survey taken in 2020 to understand people's opinion on lockdown kaggle.com/datasets/psycological-effects-of-covid) ex = data.frame(..
