1 Zakład Bioinformatyki, Instytut Informatyki, Uniwersytet w Białymstoku
✉ Correspondence: Jarosław Kotowicz <j.kotowicz@uwb.edu.pl>
Registered S3 method overwritten by 'dplyr':
method from
print.rowwise_df
Registered S3 methods overwritten by 'dbplyr':
method from
print.tbl_lazy
print.tbl_sql
[30m-- [1mAttaching packages[22m --------------------------------------- tidyverse 1.3.0 --[39m
[30m[32m<U+221A>[30m [34mggplot2[30m 3.3.0 [32m<U+221A>[30m [34mpurrr [30m 0.3.3
[32m<U+221A>[30m [34mtibble [30m 2.1.3 [32m<U+221A>[30m [34mdplyr [30m 0.8.4
[32m<U+221A>[30m [34mtidyr [30m 1.0.2 [32m<U+221A>[30m [34mstringr[30m 1.4.0
[32m<U+221A>[30m [34mreadr [30m 1.3.1 [32m<U+221A>[30m [34mforcats[30m 0.5.0[39m
[30m-- [1mConflicts[22m ------------------------------------------ tidyverse_conflicts() --
[31mx[30m [34mdplyr[30m::[32mfilter()[30m masks [34mstats[30m::filter()
[31mx[30m [34mdplyr[30m::[32mlag()[30m masks [34mstats[30m::lag()[39m
Przykład (skopiowany kod i następnie uporządkowany)
acsNY <- read_csv("https://jaredlander.com/data/acs_ny.csv",
col_types = cols(ElectricBill = col_integer(),
FamilyIncome = col_integer(),
FamilyType = col_factor(levels = c("Married", "Female Head", "Male Head")),
HouseCosts = col_integer(),
Insurance = col_integer(),
NumBedrooms = col_integer(),
NumChildren = col_integer(),
NumPeople = col_integer(),
NumRooms = col_integer(),
NumVehicles = col_integer(),
NumWorkers = col_integer()))
f(a,b) jest to a %>% f(b)
f(a,b) jest to b %>% f(a,.) f(a,b) Uwaga: Kropka wskazuje miejsca wstawienia zmiennej.
g(f(a)) jest to a %>% f %>% g
Acres FamilyIncome FamilyType NumBedrooms NumChildren NumPeople NumRooms
Length:22745 Min. : 50 Married :18326 Min. :0.000 Min. : 0.0000 Min. : 2.00 Min. : 1.000
Class :character 1st Qu.: 52540 Female Head: 3266 1st Qu.:3.000 1st Qu.: 0.0000 1st Qu.: 2.00 1st Qu.: 6.000
Mode :character Median : 87000 Male Head : 1153 Median :3.000 Median : 0.0000 Median : 3.00 Median : 7.000
Mean : 110281 Mean :3.385 Mean : 0.9012 Mean : 3.39 Mean : 7.175
3rd Qu.: 133800 3rd Qu.:4.000 3rd Qu.: 2.0000 3rd Qu.: 4.00 3rd Qu.: 8.000
Max. :1605000 Max. :8.000 Max. :12.0000 Max. :18.00 Max. :21.000
NumUnits NumVehicles NumWorkers OwnRent YearBuilt HouseCosts ElectricBill
Length:22745 Min. :0.000 Min. :0.000 Length:22745 Length:22745 Min. : 4 Min. : 1
Class :character 1st Qu.:2.000 1st Qu.:1.000 Class :character Class :character 1st Qu.: 650 1st Qu.:100
Mode :character Median :2.000 Median :2.000 Mode :character Mode :character Median :1200 Median :150
Mean :2.113 Mean :1.745 Mean :1480 Mean :175
3rd Qu.:3.000 3rd Qu.:2.000 3rd Qu.:2000 3rd Qu.:220
Max. :6.000 Max. :3.000 Max. :7090 Max. :580
FoodStamp HeatingFuel Insurance Language
Length:22745 Length:22745 Min. : 0.0 Length:22745
Class :character Class :character 1st Qu.: 400.0 Class :character
Mode :character Mode :character Median : 720.0 Mode :character
Mean : 960.9
3rd Qu.:1200.0
Max. :6600.0
acsNew <- read_csv("https://www.jaredlander.com/data/acsNew.csv",
col_types = cols(ElectricBill = col_integer(),
FamilyIncome = col_integer(),
FamilyType = col_factor(levels = c("Married", "Female Head", "Male Head")),
HeatingFuel = col_factor(levels = c("Wood", "Oil", "Electricity", "Gas", "Coal", "Other", "None")),
HouseCosts = col_integer(),
Income = col_factor(levels = c("Below", "Above")),
Insurance = col_integer(),
NumBedrooms = col_integer(),
NumChildren = col_integer(),
NumPeople = col_integer(),
NumRooms = col_integer(),
NumVehicles = col_integer(),
NumWorkers = col_integer()))
Acres FamilyIncome FamilyType NumBedrooms NumChildren NumPeople NumRooms
Length:2273 Min. : 1125 Married :1831 Min. :0.000 Min. :0.0000 Min. : 2.000 Min. : 1.000
Class :character 1st Qu.: 53700 Female Head: 327 1st Qu.:3.000 1st Qu.:0.0000 1st Qu.: 2.000 1st Qu.: 6.000
Mode :character Median : 89200 Male Head : 115 Median :3.000 Median :0.0000 Median : 3.000 Median : 7.000
Mean : 110982 Mean :3.404 Mean :0.8847 Mean : 3.401 Mean : 7.241
3rd Qu.: 136630 3rd Qu.:4.000 3rd Qu.:2.0000 3rd Qu.: 4.000 3rd Qu.: 8.000
Max. :1014000 Max. :8.000 Max. :8.0000 Max. :12.000 Max. :21.000
NumUnits NumVehicles NumWorkers OwnRent YearBuilt HouseCosts ElectricBill
Length:2273 Min. :0.000 Min. :0.000 Length:2273 Length:2273 Min. : 4 Min. : 1.0
Class :character 1st Qu.:2.000 1st Qu.:1.000 Class :character Class :character 1st Qu.: 670 1st Qu.:100.0
Mode :character Median :2.000 Median :2.000 Mode :character Mode :character Median :1200 Median :150.0
Mean :2.118 Mean :1.778 Mean :1488 Mean :176.6
3rd Qu.:3.000 3rd Qu.:2.000 3rd Qu.:2000 3rd Qu.:220.0
Max. :6.000 Max. :3.000 Max. :6500 Max. :580.0
FoodStamp HeatingFuel Insurance Language Income
Length:2273 Wood : 117 Min. : 0.0 Length:2273 Below:1817
Class :character Oil : 622 1st Qu.: 400.0 Class :character Above: 456
Mode :character Electricity: 109 Median : 720.0 Mode :character
Gas :1387 Mean : 968.1
Coal : 16 3rd Qu.:1200.0
Other : 18 Max. :6600.0
None : 4
Acres FamilyIncome FamilyType NumBedrooms NumChildren NumPeople NumRooms
Length:22745 Min. : 50 Married :18326 Min. :0.000 Min. : 0.0000 Min. : 2.00 Min. : 1.000
Class :character 1st Qu.: 52540 Female Head: 3266 1st Qu.:3.000 1st Qu.: 0.0000 1st Qu.: 2.00 1st Qu.: 6.000
Mode :character Median : 87000 Male Head : 1153 Median :3.000 Median : 0.0000 Median : 3.00 Median : 7.000
Mean : 110281 Mean :3.385 Mean : 0.9012 Mean : 3.39 Mean : 7.175
3rd Qu.: 133800 3rd Qu.:4.000 3rd Qu.: 2.0000 3rd Qu.: 4.00 3rd Qu.: 8.000
Max. :1605000 Max. :8.000 Max. :12.0000 Max. :18.00 Max. :21.000
NumUnits NumVehicles NumWorkers OwnRent YearBuilt HouseCosts ElectricBill
Length:22745 Min. :0.000 Min. :0.000 Length:22745 Length:22745 Min. : 4 Min. : 1
Class :character 1st Qu.:2.000 1st Qu.:1.000 Class :character Class :character 1st Qu.: 650 1st Qu.:100
Mode :character Median :2.000 Median :2.000 Mode :character Mode :character Median :1200 Median :150
Mean :2.113 Mean :1.745 Mean :1480 Mean :175
3rd Qu.:3.000 3rd Qu.:2.000 3rd Qu.:2000 3rd Qu.:220
Max. :6.000 Max. :3.000 Max. :7090 Max. :580
FoodStamp HeatingFuel Insurance Language
Length:22745 Length:22745 Min. : 0.0 Length:22745
Class :character Class :character 1st Qu.: 400.0 Class :character
Mode :character Mode :character Median : 720.0 Mode :character
Mean : 960.9
3rd Qu.:1200.0
Max. :6600.0
W razie pytań porszę o kontak e-mailowy.