summary(women)
##      height         weight     
##  Min.   :58.0   Min.   :115.0  
##  1st Qu.:61.5   1st Qu.:124.5  
##  Median :65.0   Median :135.0  
##  Mean   :65.0   Mean   :136.7  
##  3rd Qu.:68.5   3rd Qu.:148.0  
##  Max.   :72.0   Max.   :164.0
print('mean height') 
## [1] "mean height"
mean(women$height)
## [1] 65
print('mean weight')
## [1] "mean weight"
mean(women$weight)
## [1] 136.7333
print('median height')
## [1] "median height"
median(women[,1])
## [1] 65
print('median weight')
## [1] "median weight"
median(women[,2])
## [1] 135
s_height <- c(women$height[1:10])
s_weight <- c(women$weight[1:10])
short_women <- data.frame(list(s_height, s_weight), stringsAsFactors = FALSE)
names(short_women) <- list("Height-inches", "Weight-lbs")
print(short_women)
##    Height-inches Weight-lbs
## 1             58        115
## 2             59        117
## 3             60        120
## 4             61        123
## 5             62        126
## 6             63        129
## 7             64        132
## 8             65        135
## 9             66        139
## 10            67        142
summary(short_women)
##  Height-inches     Weight-lbs   
##  Min.   :58.00   Min.   :115.0  
##  1st Qu.:60.25   1st Qu.:120.8  
##  Median :62.50   Median :127.5  
##  Mean   :62.50   Mean   :127.8  
##  3rd Qu.:64.75   3rd Qu.:134.2  
##  Max.   :67.00   Max.   :142.0
print('mean height') 
## [1] "mean height"
mean(short_women[,1])
## [1] 62.5
print('mean weight')
## [1] "mean weight"
mean(short_women[,2])
## [1] 127.8
print('median height')
## [1] "median height"
median(short_women[,1])
## [1] 62.5
print('median weight')
## [1] "median weight"
median(short_women[,2])
## [1] 127.5
mytrial = short_women[short_women ==59]=40;short_women
##    Height-inches Weight-lbs
## 1             58        115
## 2             40        117
## 3             60        120
## 4             61        123
## 5             62        126
## 6             63        129
## 7             64        132
## 8             65        135
## 9             66        139
## 10            67        142
mytrial = short_women[short_women ==64]=70;short_women
##    Height-inches Weight-lbs
## 1             58        115
## 2             40        117
## 3             60        120
## 4             61        123
## 5             62        126
## 6             63        129
## 7             70        132
## 8             65        135
## 9             66        139
## 10            67        142
mytrial = short_women[short_women ==115]=100;short_women
##    Height-inches Weight-lbs
## 1             58        100
## 2             40        117
## 3             60        120
## 4             61        123
## 5             62        126
## 6             63        129
## 7             70        132
## 8             65        135
## 9             66        139
## 10            67        142