2024-10-26

download.file("https://github.com/devbabar/realestate_data_analysis/blob/master/Sacramento_realestate_transactions.csv?raw=true", destfile="dane.csv", mode="wb")
dane <- read.csv("dane.csv")
attach(dane)
library(tidyverse)

{r}ZADANIE 1

dane %>%
  filter(city == "SACRAMENTO") %>%
  group_by(type) %>%
  summarise(
    średnia = mean(price, na.rm = TRUE),
    mediana = median(price, na.rm=TRUE),
    minimum = min(price),
    maksimum = max(price),
    liczba = n(),
  )
## # A tibble: 3 × 6
##   type         średnia mediana minimum maksimum liczba
##   <chr>          <dbl>   <dbl>   <int>    <int>  <int>
## 1 Condo        137691.  110700   40000   360000     27
## 2 Multi-Family 214190.  187290  100000   416767     10
## 3 Residential  201360.  180000   55422   699000    402