Matching data with different sizes from different data.frames
Matching data with different sizes from different data.frames
두 개의 데이터 프레임이 있는데, date라는 공통의 컬럼을 가지고 있다. 이때 각각의 date컬럼에서 일치하는 경우 나머지 컬럼을 모아서 하나로 만드는 소스이다. apply같은 걸로 루프를 사용안할 수 도 있을 것 같은데, 바빠서 대강…. a <- data.frame(matrix(c(1,2, 3,4, 5,6, 7,8), nrow=4, byrow=T, dimnames = list(NULL, c("date","price"))) ) b <- data.frame(matrix(c(1,2, 9,4, 3,6, 8,6, 0,6, 7,9), nrow=6, byrow=T, dimnames = list(NULL, c("date","price"))) ) cc <- data.frame() for(i in…
View On WordPress










