##實際把資料列出來看看。
head(women)
##   height weight
## 1     58    115
## 2     59    117
## 3     60    120
## 4     61    123
## 5     62    126
## 6     63    129
## type 型式
#“p”: Points 
#“l”: Lines 
#“b”: Both 
#“c”: The lines part alone of “b”
#“o”: Both “overplotted”
#“h”: Histogram like (or high-density) vertical lines
#“n”: No plotting

##畫women資料,不畫圖,用point顯示women第一筆資料
plot(women, type='n')
points(women[1,])




##使用lattice劃出XY圖,weight為Y軸,height為X軸,使用資料women,以women的子集合選擇第一列的資料,以point表示。
lattice::xyplot(weight ~ height, 
  data=women,
  subset=row.names(women)==1, type='p')

##調用ggplot畫圖,使用women第一筆資料,以aes管理座標軸,與xyploy坐標軸的code順序相反,先填height再填weight表示XY座標,再畫出point
library(ggplot2)
ggplot(data=women[1,], aes(height, weight))+
  geom_point()

##參考資料
# https://molecular-service-science.com/2013/11/27/r-ggplot-tutorial-1/