sample(10:20, 30:40, 5)
sample(c(10:20, 30:40), 5)
# 단계 1: 데이터 셋 불러오기
library(RSADBE)              # 패키지를 메모리에 로드
data(Bug_Metrics_Software)  # RSADBE 패키지에서 제공하는 데이터 셋 불러오기
str(Bug_Metrics_Software) # num [1:5, 1:5, 1:2]
Bug_Metrics_Software
Bug_Metrics_Software[,,1]     # 소프트웨어 발표전 자료
# 행 단위 합계와 평균
rowSums(Bug_Metrics_Software[ , , 1])     # 소프트웨어 별 버그 수 합계
rowMeans(Bug_Metrics_Software[ , , 1])     # 소프트웨어 별 버그 수 평균
# 열 단위 합계와 평균 구하기
colSums(Bug_Metrics_Software[ , , 1])      # 버그 종류별 버그 수 합계
colMeans(Bug_Metrics_Software[ , , 1])     # 버그 종류별 버그 수 평균
mat <- matrix(1:25, nrow = 5)
mat
Bug_Metrics_Software[ , , 3] <- mat
rbind(mat, Bug_Metrics_Software)
bug <- Bug_Metrics_Software
bug.new <- array(bug, dim = c(5,5,3))
str(bug.new)
mat <- matrix(1:25, nrow = 5)
Bug_Metrics_Software[ , , 3] <- bug[,,1] - bug[,,2]
bug.new[,,3] <- bug[,,1] - bug[,,2]
str(bug.new)
bug.new
# 조건3) 꽃의 종 별로 산점도 그리기
iris3
# 조건1) iris3 데이터 셋의 칼럼명 확인
names(iris3)
# 조건1) iris3 데이터 셋의 칼럼명 확인
str(iris3)
plot(iris3, main="iris3 전체 데이터 셋의 분포현황")
plot(iris3[,c(3,1),1], main="iris3 데이터 셋의 Setosa 분포현황")
plot(iris3[,c(4,2),2], main="iris3 데이터 셋의 Versicolor 분포현황")
plot(iris3[,c(2,3),3], main="iris3 데이터 셋의 Virginica 분포현황")
# 조건1) iris3 데이터 셋의 자료구조 확인
str(iris3)
# 조건2) Setosa 꽃의 종을 대상으로 x축은 "Petal L." 칼럼,
#        y축은 "Sepal L." 칼럼으로 산점도 그리기
plot(iris3[,3,1], iris3[,1,1])
# 조건2) Setosa 꽃의 종을 대상으로 x축은 "Petal L." 칼럼,
#        y축은 "Sepal L." 칼럼으로 산점도 그리기
plot(iris3[,"Petal L.",1], iris3[,"Sepal L.",1])
# 조건2) Setosa 꽃의 종을 대상으로 x축은 "Petal L." 칼럼,
#        y축은 "Sepal L." 칼럼으로 산점도 그리기
plot(iris3[,"Sepal W.",1], iris3[,"Sepal L.",1])
# 조건3) 꽃의 종 별로 산점도 그리기
parse(iris3[,,2])
iris3[,,2]
# 조건3) 꽃의 종 별로 산점도 그리기
pairs(iris3[,,2])
# 조건1) iris3 데이터 셋의 자료구조 확인
str(iris3)
# 01. Bosten
library(MASS)
# 01. Bosten
library(MASS)
data(Boston)
str(Boston)
barplot(Boston$chas)
barplot(Boston$rad)
# 01. Bosten
women
str(women)
VADeaths
barplot(VADeaths, beside=T,col=rainbow(5),
main="미국 버지니아주 하위계층 사망비율")
legend(19, 71, c("50-54","55-59","60-64","65-69","70-74"),
cex=0.8, fill=rainbow(5))
barplot(VADeaths, beside=T,col=rainbow(5),
main="미국 버지니아주 하위계층 사망비율")
legend(19, 71, c("50-54","55-59","60-64","65-69","70-74"),
cex=0.8, fill=rainbow(5))
?legend
barplot(VADeaths, beside=T,col=rainbow(5),
main="미국 버지니아주 하위계층 사망비율")
legend(x=1, y=71, legend = c("50-54","55-59","60-64","65-69","70-74"),
cex=0.8, fill=rainbow(5))
row_names <- row_names(VADeaths)
row_names <- row_names(VADeaths)
row_names <- row.names(VADeaths)
row_names
legend(x=1, y=71, legend = row_names,
cex=0.8, fill=rainbow(5))
barplot(VADeaths, beside=T,col=rainbow(5),
main="미국 버지니아주 하위계층 사망비율")
# 행이름
row_names <- row.names(VADeaths)
# 범례 추가
legend(x=1, y=71, legend = row_names,
cex=0.8, fill=rainbow(5))
barplot(VADeaths, beside=F, col=rainbow(5))
title(main ="미국 버지니아주 하위계층 사망비율",font.main=4)
legend(3.8, 200, c("50-54","55-59","60-64","65-69","70-74"), cex=0.8, fill=rainbow(5) )
# 누적형
barplot(VADeaths, beside=F, col=rainbow(5))
title(main ="미국 버지니아주 하위계층 사망비율",font.main=4)
legend(x=4, y = 200, legend = row_names,
cex=0.8, fill=rainbow(5) )
barplot(VADeaths, beside=T,col=rainbow(5),
main="미국 버지니아주 하위계층 사망비율")
# 행이름
row_names <- row.names(VADeaths)
# 범례 추가
legend(x=1, y=71, legend = row_names,
cex=0.8, fill=rainbow(5))
# 범례 추가
legend(x=4, y=71, legend = row_names,
cex=0.8, fill=rainbow(5))
# 범례 추가
legend(x=1, y=71, legend = row_names,
cex=0.8, fill=rainbow(5))
barplot(VADeaths, beside=T,col=rainbow(5),
main="미국 버지니아주 하위계층 사망비율")
# 행이름
row_names <- row.names(VADeaths)
# 범례 추가
legend(x=1, y=71, legend = row_names,
cex=0.8, fill=rainbow(5))
# 누적형
barplot(VADeaths, beside=F, col=rainbow(5))
title(main ="미국 버지니아주 하위계층 사망비율",font.main=4)
legend(x=4, y = 200, legend = row_names,
cex=0.8, fill=rainbow(5) )
# 01. Bosten
library(RSADBE)
# 01. Bosten
library(RSADBE)
data(Bug_Metrics_Software)
str(Bug_Metrics_Software)
# 소프트웨어 발표 전 버그 수를 가로막대 시각화
barploat(Bug_Metrics_Software[,,1])
Bug_Metrics_Software[,,1]
# 소프트웨어 발표 전 버그 수를 가로막대 시각화
barploat(Bug_Metrics_Software[,,1], beside =T)
# 소프트웨어 발표 전 버그 수를 가로막대 시각화
barplot(Bug_Metrics_Software[,,1], beside =T)
# 단계1) 소프트웨어 발표 전 버그 수를 대상으로 각 소프트웨어별 버그를
# beside형 가로막대 차트로 시각화하기(각 막대별 색상적용)
barplot(Bug_Metrics_Software[,,1], beside =T, col=rainbow(5))
# 단계2) 소프트웨어 발표 후 버그 수를 대상으로 각 소프트웨어별 버그를
# 누적형 가로막대 차트로 시각화하기(각 막대별 색상적용)
barplot(Bug_Metrics_Software[,,2], beside=F, horiz=F, col=rainbow(5))
# 단계2) 소프트웨어 발표 후 버그 수를 대상으로 각 소프트웨어별 버그를
# 누적형 가로막대 차트로 시각화하기(각 막대별 색상적용)
barplot(Bug_Metrics_Software[,,2], beside=F, horiz=T, col=rainbow(5))
# Species=="virginica"인 경우만 4개 변수 상호비교
iris[iris$Species=="virginica", 1:4]
table(iris$Species)
unique(iris$Species)
table(iris$Species)
unique(iris$Species)
# 꽃의 종별 산점도 : [행=꽃의종, 열]
pairs(iris[iris$Species=="virginica", 1:4])
pairs(iris[iris$Species=="setosa", 1:4])
pairs(iris[iris$Species=="virsicolor", 1:4])
# 꽃의 종별 산점도 : [행=꽃의종, 열]
pairs(iris[iris$Species=="setosa", 1:4])
unique(iris$Species)
pairs(iris[iris$Species=="versicolor", 1:4])
pairs(iris[iris$Species=="virginica", 1:4])
#  조건1) 1번 컬럼 x축, 3번 컬럼 y축으로 차트 작성
#         힌트) plot(x, y)
plot(iris[,1], iris[,3])
plot(iris$Sepal.Length, iris$Petal.Length, col="red") # 모두 빨강색
# 02.  iris 데이터 셋을 대상으로 다음 조건에 맞게 시각화 하시오.
quakes
str(quakes)
table(quakes)
table(quakes$stations)
plot(quakes$long, quakes$lat, col = quakes$stations)
# 02. quakes 데이터 셋을 대상으로 다음 조건에 맞게 시각화 하시오.
data(quakes) # 데이터셋 로드
str(quakes) # 데이터셋 구조보기
#  조건1) 1번 칼럼 : y축, 2번 컬럼 : x축 으로 산점도 시각화
plot(quakes$long, quakes$lat)
#  조건2) 5번 컬럼으로 색상 지정
plot(quakes$long, quakes$lat, col = quakes$stations)
#  조건3) "지진의 진앙지 산점도 차트" 제목 추가
title(main="지진의 진앙지 산점도 차트")
#library(help="RSADBE")
data(Bug_Metrics_Software)
rowSums(Bug_Metrics_Software[,,2])
colMeans(Bug_Metrics_Software)
colMeans(Bug_Metrics_Software[,,2])
apply(Bug_Metrics_Software, 2, summary)
x <- rnorm(10000)
x <- rnorm(10000)
hist(x, freq = F)
density(x)
lines(density(x), col="red")
# col 속성 = 범주형
plot(iris$Sepal.Length, iris$Petal.Length, col=iris$Species)
plot(iris$Sepal.Length, iris$Petal.Length, col=c(1:3))
# 산점도와 히스토그램
plot(iris$Sepal.Length) # 산점도(x축:index)
plot(hist(iris$Sepal.Length)) # 계급의 빈도
hist(iris$Sepal.Length)
plot(hist(iris$Sepal.Length)) # 계급의 빈도
hist(iris$Sepal.Length)
################################
### train/test 과적합 판단
################################
library(UsingR)
idx <- sample(nrow(galton), nrow(galton)*0.7)
train <- galton[idx, ]
test <- galton[-idx, ]
# train set model
model <- lm(child ~ parent, data=train)
pred <- model$fitted.values # child 키 예측
# test set model
model2 <- lm(child ~ parent, data=test)
pred2 <- model2$fitted.values
# train x,y
child <- train$child
parent <- train$parent
# test x,y
child2 <- test$child
parent2 <- test$parent
# train vs test
plot(pred, parent, col='blue', pch = 18)
points(pred2, parent2, col='red', pch = 19)
# 범례
legend("topleft", legend = c("train","test"),
col = c("blue", "red"), pch = c(18, 19))
parent
pred
table(pred)
length(table(pred))
length(table(pred2)) # 12
# model error
error <- (mean(pred) - mean(pred2))**2
error # 0.007936915
summary(VADeaths)
(11.7 + 66) / 2
sum(VADeaths[,1])
sum(VADeaths[,1]) / 5
mean(VADeaths[,1])
quantile(VADeaths[,1])
summary(VADeaths)
quantile(VADeaths[,1])
# 0%  25%  50%  75% 100%
#11.7 18.1 26.9 41.0 66.0
11.7*0.25
11.7+66
# 0%  25%  50%  75% 100%
#11.7 18.1 26.9 41.0 66.0
11.7+66/2 *0.25
# 0%  25%  50%  75% 100%
#11.7 18.1 26.9 41.0 66.0
(11.7+66)/2
# 0%  25%  50%  75% 100%
#11.7 18.1 26.9 41.0 66.0
18.1 - 11.7
18.1 + 6.4
summary(VADeaths)
66-11.7
54.3/4
length(table(pred)) # 12
table(pred)
library(reshape2)
data <- read.csv("D:\\SUNMOON\\2_Rwork\\2_Rwork\\Part-II\\data.csv")
data
library(ggplot2)
names(mpg) # cyl vs drv
head(mpg)
unique(mpg$cyl) # 4 6 8 5
unique(mpg$drv) # "f" "4" "r"
# mpg subset
mpg_df <- subset(mpg,  select = c(cyl, drv, hwy) )
mpg_df
# dcast table
dcast(mpg_df, cyl ~ drv, sum) # 교차셀에 hwy 합계
dcast(mpg_df, cyl ~ drv, length) # 교차셀에 hwy 출현 건수
# 집단변수 간의 빈도수
table(mpg_df$cyl, mpg_df$drv) # 빈도수
# - 긴 형식 변경
long <- melt(wide, id='Customer_ID')
long
# example
data("smiths")
smiths
# wide -> long
long <- melt(id='subject', smiths)
long
melt(id=1:2, smiths)
smiths
# wide -> long
long <- melt(smiths, id='subject')
long
melt(smiths, id=1:2)
long
# long -> wide
wide <- dcast(long, subject~.)
# long -> wide
wide <- dcast(long, subject~..)
# long -> wide
wide <- dcast(long, subject~...)
wide
# 3차원 형식으로 변경
data('airquality') # airquality  New York Air Quality Measurements
airquality
str(airquality) # data.frame':	153 obs. of  6 variables:
# [월, 일] 기준으로 나머지 4개 칼럼을 묶어서 long 형식 변경
air_melt <- melt(airquality, id=c("Month", "Day"), na.rm=TRUE)
dim(air_melt) # 568 4
head(air_melt) # month day variable value
table(air_melt$variable) # OZONE SOLAR.R    WIND    TEMP
tail(air_melt)
head(air_melt) # month day variable value
tail(air_melt) #
table(air_melt$variable) # OZONE SOLAR.R    WIND    TEMP
# acast(dataset, 행 ~ 열 ~ 면)
air_acast<- acast(air_melt, day ~ month ~ variable) # [31,5,4]
# [월, 일] 기준으로 나머지 4개 칼럼을 묶어서 long 형식 변경
air_melt <- melt(airquality, id=c("Month", "Day"), na.rm=TRUE)
# acast(dataset, 행 ~ 열 ~ 면)
air_acast<- acast(air_melt, Day ~ Month ~ variable) # [31,5,4]
air_acast
str(air_acast) # num [1:31, 1:5, 1:4]
air_acast[,,1]
data <- read.csv("c:\\Rwork\\Part-II\\data.csv")
data
wide <- dcast(data, Customer_ID ~ Date, sum)
# Using Buy as value column: use value.var to override.
wide
View(smiths)
# 3) boxplot & 통계 이용
library(ggplot2)
# 3) boxplot & 통계 이용
library(ggplot2)
str(mtcars) # 234
mtcars
boxplot(mtcars$hwy) # 극단치 경계 바깥쪽 2개
boxplot(mtcars$mpg) # 극단치 경계 바깥쪽 2개
str(mtcars) # 234
boxplot(mtcars$drat) # 극단치 경계 바깥쪽 2개
# 이상치 통계
boxplot(mpg$hwy)$stats
boxplot(mtcars$qsec) # 극단치 경계 바깥쪽 2개
boxplot(mtcars$hp) # 극단치 경계 바깥쪽 2개
boxplot(mtcars$mpg) # 극단치 경계 바깥쪽 2개
# 3) boxplot & 통계 이용
library(MASS)
str(Boston) # 234
boxplot(Boston$medv) # 극단치 경계 바깥쪽 2개
boxplot(Boston$medv)$stats # 극단치 경계 바깥쪽 2개
# 3) boxplot & 통계 이용
library(ggplot2)
str(mtcars) # 234
boxplot(mtcars$qsec)$stats # 극단치 경계 바깥쪽 2개
# 06. mtcars 데이터셋의 qsec 변수를 대상으로 극단치(상위 0.3%)를 발견하고, 정제하시오.
library(ggplot2)
str(mtcars) # 234
# 이상치 통계
boxplot(mtcars$qsec)$stats # 1/4마일 소요시간
mtcars_sub <- subset(mtcars, qsec >= 14.5 & qsec <= 20.22)
boxplot(mtcars_sub$qsec)
# (1) 데이터셋 가져오기
setwd("c:\\Rwork\\Part-II")
# (2) 저장된 파일 불러오기/확인
new_data <- read.csv("new_data.csv", header=TRUE)
new_data
dim(new_data) #  231  15
str(new_data)
# 거주지역과 성별 칼럼 시각화
resident_gender <- table(new_data$resident2, new_data$gender2)
resident_gender
gender_resident <- table(new_data$gender2, new_data$resident2)
gender_resident
# 행 기준 : 성별에 따른 거주지역 분포 현황(beside=F  : 누적형)
barplot(resident_gender, beside=T, horiz=T,
col = rainbow(5),
legend = row.names(resident_gender),
main = '성별에 따른 거주지역 분포 현황')
# 행 기준 : 성별에 따른 거주지역 분포 현황(beside=F  : 누적형)
barplot(resident_gender, beside=T, horiz=T,
col = rainbow(5),
legend = row.names(resident_gender),
main = '성별에 따른 거주지역 분포 현황')
# 열 기준 : 성별 기준 색상 적용
mosaicplot(resident_gender, col=rainbow(2)) # 정사각형 기준 빈도에 해당하는 직사각형 시각화
# 거주지역 기준 색상 적용
mosaicplot(gender_resident, col=rainbow(5))
# 거주지역에 따른 성별 분포 현황
barplot(gender_resident, beside=T,
col=rep(c(2, 4),5), horiz=T,
legend=c("남자","여자"),
main = '거주지역별 성별 분포 현황')
# 행 기준 : 성별에 따른 거주지역 분포 현황(beside=F  : 누적형)
barplot(resident_gender, beside=T, horiz=T,
col = rainbow(5),
legend = row.names(resident_gender),
main = '성별에 따른 거주지역 분포 현황')
# 행 기준 : 성별에 따른 거주지역 분포 현황(beside=F  : 누적형)
barplot(resident_gender, beside=T, horiz=T,
col = rainbow(5),
legend = row.names(resident_gender),
main = '성별에 따른 거주지역 분포 현황')
# 열 기준 : 성별 기준 색상 적용
mosaicplot(resident_gender, col=rainbow(2))
# 행 기준 : 성별에 따른 거주지역 분포 현황(beside=F  : 누적형)
barplot(resident_gender, beside=T, horiz=T,
col = rainbow(5),
legend = row.names(resident_gender),
main = '성별에 따른 거주지역 분포 현황')
# 열 기준 : 성별 기준 색상 적용
mosaicplot(resident_gender, col=rainbow(2))
# 거주지역에 따른 성별 분포 현황
barplot(gender_resident, beside=T,
col=rep(c(2, 4),5), horiz=T,
legend=c("남자","여자"),
main = '거주지역별 성별 분포 현황')
# 거주지역 기준 색상 적용
mosaicplot(gender_resident, col=rainbow(5))
# 고급시각화 : 범주형(직업유형)과 나이(범주형 코딩변경) 분포 : 밀도 1기준 색 채우기
library(ggplot2)
ggplot(data=new_data, aes(x=job2, fill=age2)) + geom_bar(position = "fill") # 막대차트 추가
aes_obj <- ggplot(data=new_data, aes(x=job2, fill=age2))
aes_obj + geom_bar(position = "fill") # 막대차트 추가
# 개인사업 : 청,중년층, 공무원 : 중,장년층, 회사원 : 청년층 많음
table(new_data, useNA = always)
# 개인사업 : 청,중년층, 공무원 : 중,장년층, 회사원 : 청년층 많음
table(new_data, useNA = T)
# 개인사업 : 청,중년층, 공무원 : 중,장년층, 회사원 : 청년층 많음
table(new_data, useNA = "always")
# 개인사업 : 청,중년층, 공무원 : 중,장년층, 회사원 : 청년층 많음
table(new_data, useNA = "ifany")
# 개인사업 : 청,중년층, 공무원 : 중,장년층, 회사원 : 청년층 많음
table(new_data$job2, useNA = "ifany")
table(new_data$age2, useNA = "ifany")
table(new_data$job2, new_data$age2)
table(new_data$job2, new_data$age2, useNA = "ifany")
# 개인사업 : 청,중년층, 공무원 : 중,장년층, 회사원 : 청년층 많음
table(new_data$job2, useNA = "ifany")
# x: 직업유형, 색 채우기 : 나이
aes_obj <- ggplot(data=new_data, aes(x=job2, fill=age2)) # 미적객체
aes_obj
aes_obj + geom_bar(position = "fill") # 막대차트 추가
position
str(new_data)
# x: 직업유형, 색 채우기 : 나이
aes_obj <- ggplot(data=new_data, aes(x=job2, fill=age2)) # 미적객체
aes_obj + geom_bar(resident = "fill") # 막대차트 추가
aes_obj + geom_bar(position = "fill") # 막대차트 추가
# 범주형(직업유형)과 나이(범주형 코딩변경) 분포
ggplot(data=new_data, aes(x=job2, fill=age2)) + geom_bar(position = "fill")
# 범주형(직업유형)과 나이(범주형 코딩변경) 분포
ggplot(data=new_data, aes(x=job2, fill=age2)) + geom_bar()
# x: 직업유형, 색 채우기 : 나이
ggplot(data=new_data, aes(x=job2, fill=age2)) + geom_bar()
ggplot(data=new_data, aes(x=job2, fill=age2)) + geom_bar(position="fill")
library(lattice)
library(lattice)
# 카테고리별 시각화 : 나이(숫자형)를 직업유형(범주형)으로 분류
densityplot( ~ age, groups = job2, data=new_data, auto.key = T)
# 카테고리별 시각화 : 나이(숫자형)를 직업유형(범주형)으로 분류
densityplot( ~ age, groups = job2, data=new_data, plot.points=T, auto.key = T)
# 카테고리별 시각화 : 나이(숫자형)를 직업유형(범주형)으로 분류
densityplot( ~ age, groups = job2, data=new_data,
auto.key = T)
# 카테고리별 시각화 : 나이(숫자형)를 직업유형(범주형)으로 분류
densityplot( ~ age, groups = job2, data=new_data,
plot.points=T, auto.key = T)
# 카테고리별 시각화 : 90 line 참고
# 나이(숫자형)를 직업유형(범주형)으로 분류 : 막대차트 빈도수에 색 채우기
qplot(age, data=new_data, fill=job2, geom="bar") # geom=차트유형
# 나이(숫자형)를 직업유형(범주형)으로 분류 : 밀도 1기준, 범주별 색 채우기
ggplot(data=new_data, aes(x=age, fill=job2)) + geom_bar(position = "fill")
# 나이(숫자형)를 성별(범주형)로 분류 : 밀도 1기준, 범주별 색 채우기
ggplot(data=new_data, aes(x=age, fill=gender2)) + geom_bar(position = "fill")
# (1) 구매금액을 성별과 직급으로 분류
densityplot(~ price | factor(gender2), groups = position2,
data=new_data, plot.points=T, auto.key = T)
# (2) 구매금액으로 직급과 성별로 분류
densityplot(~ price | factor(position2), groups = gender2,
data=new_data, plot.points=T, auto.key = T)
# 숫자형 vs 숫자형 vs 명목형
xyplot(price ~ age | factor(gender2), data=new_data) # lattice 제공
# (1) 구매금액을 성별과 직급으로 분류
densityplot(~ price | factor(gender2), groups = position2,
data=new_data, plot.points=T, auto.key = T)
# 숫자형 vs 숫자형
cor(new_data$age, new_data$price) # NA
dim(new_data)
data <- na.omit(new_data)
dim(data)
cor(data$age, data$price) # 0.0881251
plot(data$age, data$price) # 비례관계 없음
# 숫자형 vs 숫자형 vs 명목형
xyplot(price ~ age | factor(gender2), data=new_data) # lattice 제공
library(lattice)
library(mlmRev)
data(Chem97)
# 기본 coplot(y~x | a, data, overlap=0.5, number=6, row=2)
# number : 조건의 사이 간격,
# overlap : 겹치는 구간(0.1~0.9:작을 수록  사이 간격이 적게 겹침)
# row : 패널 행수
coplot(lat~long | depth, data=quakes) # 2행3열, 0.5, 사이간격 6
coplot(lat~long | depth, data=quakes, overlap=0.1) # 겹치는 구간 : 0.1
coplot(lat~long | depth, data=quakes, number=5, row=1) # 사이간격 5, 1행 5열
# 기본 coplot(y~x | a, data, overlap=0.5, number=6, row=2)
# number : 격자 수
# overlap : 겹치는 구간(0.1~0.9:작을 수록  사이 간격이 적게 겹침)
# row : 패널 행수
coplot(lat~long | depth, data=quakes) # 2행3열, 0.5, 사이간격 6
coplot(lat~long | depth, data=quakes, overlap=0.1) # 겹치는 구간 : 0.1
coplot(lat~long | depth, data=quakes, number=5, row=1) # 사이간격 5, 1행 5열
coplot(lat~long | depth, data=quakes, number=5, row=1, panel=panel.smooth)
coplot(lat~long | depth, data=quakes, number=5, row=1,
col='blue',bar.bg=c(num='green')) # 패널과 조건 막대 색
