forked from clayholt/Group-Project-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfaq.R
More file actions
21 lines (16 loc) · 889 Bytes
/
faq.R
File metadata and controls
21 lines (16 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
library("dplyr")
# average number of bedrooms in the houses priced over 1 million
bedrooms.average <- toString(round(filter(house.data, price > 1000000) %>%
summarise(mean = mean(bedrooms))))
# average number of bathrooms in the houses with 3 or more bedrooms
bathrooms.average <- toString(round(filter(house.data, bedrooms >= 3) %>%
summarise(mean = mean(bathrooms))))
# average price of the houses in the best condition
best.condition.price <- toString(round(filter(house.data, condition == max(condition)) %>%
summarise(mean = mean(price))))
# price of the house with max/min total area
specific.price <- toString(filter(house.data, total_area == max(total_area)) %>%
select(price))
# average price of th houses with a watefront
waterfront.price <- toString(round(filter(house.data, waterfront ==1) %>%
summarise(mean = mean(price))))