티스토리 뷰

R언어

R에서 자주 쓰이는 함수

carrot62 2021. 1. 12. 00:48

head(dataframe, n=10)

comma 단위로 string 쪼개기 - strsplit() 사

string_1 <- "A B C D"
strsplit(string_1, split = " ")
>> [[1]]
   [1] "A" "B" "C" "D"

R에서 문자열에 대한 처리

참고: m.blog.naver.com/PostView.nhn?blogId=nife0719&logNo=220975845463&proxyReferer=https:%2F%2Fwww.google.com%2F

 

[R] R에서 String(문자열) 처리하기

※ 추가적으로 필요한 R Package: stringr (해당 Package가 필요한 부분에는 ⓢ로 표시하였습니다.) ※ ...

blog.naver.com

list 에 key 개수 세기 : length()

length(DF[,1])

cceeddcc.tistory.com/103

 

[R] 리스트 (List)

[사용 함수] 함수명 설명 list() 리스트 생성 str() 데이터 구조(structure) 확인 length() Key 개수 반환 NROW() Key 값들만 하나의 칼럼으로 구성된 형태로 인식 NCOL() Key 값들만 하나의 칼럼으로 구성된 형태

cceeddcc.tistory.com

 

열/행 이름 바꾸기 - colnames, rownames

rownames(AA) <- c(1:625)

r 반복문

for(i in 1:624){
  Capf_df[[i]] <- as.numeric(Capf_df[[i]])
}

ordo.tistory.com/46

행을 열로 변환 - t() transpose 함수 사용하기

AA <- data.frame(Capf_M[1,])
View(AA)
AA <- t(AA)
View(AA)

statools.tistory.com/89