# Muat package
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ forcats 1.0.0 ✔ readr 2.1.5
## ✔ ggplot2 3.5.1 ✔ stringr 1.5.1
## ✔ lubridate 1.9.3 ✔ tibble 3.2.1
## ✔ purrr 1.0.2 ✔ tidyr 1.3.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(datasets)
file_path <- "C:/Users/Iffa/Downloads/Tugas Mandarel UAS/taxi_zones.csv"
df <- read.csv(file_path, stringsAsFactors = TRUE)
str(df)
## 'data.frame': 263 obs. of 3 variables:
## $ LocationID: int 1 2 3 4 5 6 7 8 9 24 ...
## $ zone : Factor w/ 260 levels "Allerton/Pelham Gardens",..: 169 126 1 2 3 4 5 6 7 22 ...
## $ borough : Factor w/ 6 levels "Bronx","Brooklyn",..: 3 5 1 4 6 6 5 5 5 4 ...
taxi_new <- df %>%
mutate(zone_length = nchar(as.character(zone)),
cost_perKM = 100,
total_cost = zone_length * cost_perKM)
str(taxi_new)
## 'data.frame': 263 obs. of 6 variables:
## $ LocationID : int 1 2 3 4 5 6 7 8 9 24 ...
## $ zone : Factor w/ 260 levels "Allerton/Pelham Gardens",..: 169 126 1 2 3 4 5 6 7 22 ...
## $ borough : Factor w/ 6 levels "Bronx","Brooklyn",..: 3 5 1 4 6 6 5 5 5 4 ...
## $ zone_length: int 14 11 23 13 13 23 7 12 10 12 ...
## $ cost_perKM : num 100 100 100 100 100 100 100 100 100 100 ...
## $ total_cost : num 1400 1100 2300 1300 1300 2300 700 1200 1000 1200 ...
print(taxi_new)
## LocationID zone borough
## 1 1 Newark Airport EWR
## 2 2 Jamaica Bay Queens
## 3 3 Allerton/Pelham Gardens Bronx
## 4 4 Alphabet City Manhattan
## 5 5 Arden Heights Staten Island
## 6 6 Arrochar/Fort Wadsworth Staten Island
## 7 7 Astoria Queens
## 8 8 Astoria Park Queens
## 9 9 Auburndale Queens
## 10 24 Bloomingdale Manhattan
## 11 10 Baisley Park Queens
## 12 11 Bath Beach Brooklyn
## 13 12 Battery Park Manhattan
## 14 13 Battery Park City Manhattan
## 15 18 Bedford Park Bronx
## 16 25 Boerum Hill Brooklyn
## 17 14 Bay Ridge Brooklyn
## 18 15 Bay Terrace/Fort Totten Queens
## 19 22 Bensonhurst West Brooklyn
## 20 23 Bloomfield/Emerson Hill Staten Island
## 21 16 Bayside Queens
## 22 17 Bedford Brooklyn
## 23 19 Bellerose Queens
## 24 20 Belmont Bronx
## 25 21 Bensonhurst East Brooklyn
## 26 26 Borough Park Brooklyn
## 27 27 Breezy Point/Fort Tilden/Riis Beach Queens
## 28 28 Briarwood/Jamaica Hills Queens
## 29 33 Brooklyn Heights Brooklyn
## 30 29 Brighton Beach Brooklyn
## 31 31 Bronx Park Bronx
## 32 32 Bronxdale Bronx
## 33 30 Broad Channel Queens
## 34 34 Brooklyn Navy Yard Brooklyn
## 35 35 Brownsville Brooklyn
## 36 36 Bushwick North Brooklyn
## 37 37 Bushwick South Brooklyn
## 38 38 Cambria Heights Queens
## 39 39 Canarsie Brooklyn
## 40 40 Carroll Gardens Brooklyn
## 41 41 Central Harlem Manhattan
## 42 45 Chinatown Manhattan
## 43 46 City Island Bronx
## 44 42 Central Harlem North Manhattan
## 45 43 Central Park Manhattan
## 46 44 Charleston/Tottenville Staten Island
## 47 47 Claremont/Bathgate Bronx
## 48 48 Clinton East Manhattan
## 49 49 Clinton Hill Brooklyn
## 50 50 Clinton West Manhattan
## 51 51 Co-Op City Bronx
## 52 52 Cobble Hill Brooklyn
## 53 53 College Point Queens
## 54 54 Columbia Street Brooklyn
## 55 55 Coney Island Brooklyn
## 56 56 Corona Queens
## 57 56 Corona Queens
## 58 58 Country Club Bronx
## 59 59 Crotona Park Bronx
## 60 60 Crotona Park East Bronx
## 61 61 Crown Heights North Brooklyn
## 62 62 Crown Heights South Brooklyn
## 63 63 Cypress Hills Brooklyn
## 64 64 Douglaston Queens
## 65 65 Downtown Brooklyn/MetroTech Brooklyn
## 66 72 East Flatbush/Remsen Village Brooklyn
## 67 66 DUMBO/Vinegar Hill Brooklyn
## 68 67 Dyker Heights Brooklyn
## 69 68 East Chelsea Manhattan
## 70 73 East Flushing Queens
## 71 69 East Concourse/Concourse Village Bronx
## 72 70 East Elmhurst Queens
## 73 71 East Flatbush/Farragut Brooklyn
## 74 79 East Village Manhattan
## 75 80 East Williamsburg Brooklyn
## 76 74 East Harlem North Manhattan
## 77 85 Erasmus Brooklyn
## 78 86 Far Rockaway Queens
## 79 75 East Harlem South Manhattan
## 80 76 East New York Brooklyn
## 81 77 East New York/Pennsylvania Avenue Brooklyn
## 82 78 East Tremont Bronx
## 83 81 Eastchester Bronx
## 84 87 Financial District North Manhattan
## 85 82 Elmhurst Queens
## 86 83 Elmhurst/Maspeth Queens
## 87 84 Eltingville/Annadale/Prince's Bay Staten Island
## 88 88 Financial District South Manhattan
## 89 89 Flatbush/Ditmas Park Brooklyn
## 90 90 Flatiron Manhattan
## 91 125 Hudson Sq Manhattan
## 92 91 Flatlands Brooklyn
## 93 92 Flushing Queens
## 94 93 Flushing Meadows-Corona Park Queens
## 95 94 Fordham South Bronx
## 96 95 Forest Hills Queens
## 97 96 Forest Park/Highland Park Queens
## 98 97 Fort Greene Brooklyn
## 99 98 Fresh Meadows Queens
## 100 99 Freshkills Park Staten Island
## 101 100 Garment District Manhattan
## 102 101 Glen Oaks Queens
## 103 102 Glendale Queens
## 104 103 Governor's Island/Ellis Island/Liberty Island Manhattan
## 105 103 Governor's Island/Ellis Island/Liberty Island Manhattan
## 106 103 Governor's Island/Ellis Island/Liberty Island Manhattan
## 107 106 Gowanus Brooklyn
## 108 107 Gramercy Manhattan
## 109 108 Gravesend Brooklyn
## 110 109 Great Kills Staten Island
## 111 110 Great Kills Park Staten Island
## 112 111 Green-Wood Cemetery Brooklyn
## 113 112 Greenpoint Brooklyn
## 114 113 Greenwich Village North Manhattan
## 115 114 Greenwich Village South Manhattan
## 116 115 Grymes Hill/Clifton Staten Island
## 117 116 Hamilton Heights Manhattan
## 118 117 Hammels/Arverne Queens
## 119 118 Heartland Village/Todt Hill Staten Island
## 120 119 Highbridge Bronx
## 121 120 Highbridge Park Manhattan
## 122 149 Madison Brooklyn
## 123 150 Manhattan Beach Brooklyn
## 124 121 Hillcrest/Pomonok Queens
## 125 122 Hollis Queens
## 126 123 Homecrest Brooklyn
## 127 124 Howard Beach Queens
## 128 126 Hunts Point Bronx
## 129 127 Inwood Manhattan
## 130 128 Inwood Hill Park Manhattan
## 131 129 Jackson Heights Queens
## 132 134 Kew Gardens Queens
## 133 151 Manhattan Valley Manhattan
## 134 130 Jamaica Queens
## 135 139 Laurelton Queens
## 136 131 Jamaica Estates Queens
## 137 132 JFK Airport Queens
## 138 133 Kensington Brooklyn
## 139 140 Lenox Hill East Manhattan
## 140 135 Kew Gardens Hills Queens
## 141 136 Kingsbridge Heights Bronx
## 142 137 Kips Bay Manhattan
## 143 141 Lenox Hill West Manhattan
## 144 142 Lincoln Square East Manhattan
## 145 152 Manhattanville Manhattan
## 146 138 LaGuardia Airport Queens
## 147 143 Lincoln Square West Manhattan
## 148 144 Little Italy/NoLiTa Manhattan
## 149 145 Long Island City/Hunters Point Queens
## 150 146 Long Island City/Queens Plaza Queens
## 151 147 Longwood Bronx
## 152 148 Lower East Side Manhattan
## 153 153 Marble Hill Manhattan
## 154 154 Marine Park/Floyd Bennett Field Brooklyn
## 155 155 Marine Park/Mill Basin Brooklyn
## 156 156 Mariners Harbor Staten Island
## 157 159 Melrose South Bronx
## 158 157 Maspeth Queens
## 159 158 Meatpacking/West Village West Manhattan
## 160 160 Middle Village Queens
## 161 161 Midtown Center Manhattan
## 162 162 Midtown East Manhattan
## 163 163 Midtown North Manhattan
## 164 164 Midtown South Manhattan
## 165 170 Murray Hill Manhattan
## 166 165 Midwood Brooklyn
## 167 166 Morningside Heights Manhattan
## 168 167 Morrisania/Melrose Bronx
## 169 178 Ocean Parkway South Brooklyn
## 170 168 Mott Haven/Port Morris Bronx
## 171 169 Mount Hope Bronx
## 172 171 Murray Hill-Queens Queens
## 173 172 New Dorp/Midland Beach Staten Island
## 174 173 North Corona Queens
## 175 174 Norwood Bronx
## 176 175 Oakland Gardens Queens
## 177 179 Old Astoria Queens
## 178 176 Oakwood Staten Island
## 179 177 Ocean Hill Brooklyn
## 180 180 Ozone Park Queens
## 181 181 Park Slope Brooklyn
## 182 182 Parkchester Bronx
## 183 183 Pelham Bay Bronx
## 184 184 Pelham Bay Park Bronx
## 185 185 Pelham Parkway Bronx
## 186 186 Penn Station/Madison Sq West Manhattan
## 187 189 Prospect Heights Brooklyn
## 188 190 Prospect Park Brooklyn
## 189 187 Port Richmond Staten Island
## 190 188 Prospect-Lefferts Gardens Brooklyn
## 191 191 Queens Village Queens
## 192 192 Queensboro Hill Queens
## 193 193 Queensbridge/Ravenswood Queens
## 194 194 Randalls Island Manhattan
## 195 196 Rego Park Queens
## 196 195 Red Hook Brooklyn
## 197 203 Rosedale Queens
## 198 197 Richmond Hill Queens
## 199 198 Ridgewood Queens
## 200 199 Rikers Island Bronx
## 201 212 Soundview/Bruckner Bronx
## 202 213 Soundview/Castle Hill Bronx
## 203 200 Riverdale/North Riverdale/Fieldston Bronx
## 204 204 Rossville/Woodrow Staten Island
## 205 201 Rockaway Park Queens
## 206 202 Roosevelt Island Manhattan
## 207 205 Saint Albans Queens
## 208 206 Saint George/New Brighton Staten Island
## 209 207 Saint Michaels Cemetery/Woodside Queens
## 210 208 Schuylerville/Edgewater Park Bronx
## 211 209 Seaport Manhattan
## 212 210 Sheepshead Bay Brooklyn
## 213 211 SoHo Manhattan
## 214 214 South Beach/Dongan Hills Staten Island
## 215 215 South Jamaica Queens
## 216 216 South Ozone Park Queens
## 217 217 South Williamsburg Brooklyn
## 218 218 Springfield Gardens North Queens
## 219 219 Springfield Gardens South Queens
## 220 225 Stuyvesant Heights Brooklyn
## 221 220 Spuyten Duyvil/Kingsbridge Bronx
## 222 224 Stuy Town/Peter Cooper Village Manhattan
## 223 226 Sunnyside Queens
## 224 221 Stapleton Staten Island
## 225 222 Starrett City Brooklyn
## 226 223 Steinway Queens
## 227 227 Sunset Park East Brooklyn
## 228 228 Sunset Park West Brooklyn
## 229 229 Sutton Place/Turtle Bay North Manhattan
## 230 230 Times Sq/Theatre District Manhattan
## 231 231 TriBeCa/Civic Center Manhattan
## 232 239 Upper West Side South Manhattan
## 233 232 Two Bridges/Seward Park Manhattan
## 234 233 UN/Turtle Bay South Manhattan
## 235 234 Union Sq Manhattan
## 236 235 University Heights/Morris Heights Bronx
## 237 236 Upper East Side North Manhattan
## 238 237 Upper East Side South Manhattan
## 239 238 Upper West Side North Manhattan
## 240 240 Van Cortlandt Park Bronx
## 241 241 Van Cortlandt Village Bronx
## 242 258 Woodhaven Queens
## 243 242 Van Nest/Morris Park Bronx
## 244 245 West Brighton Staten Island
## 245 263 Yorkville West Manhattan
## 246 243 Washington Heights North Manhattan
## 247 244 Washington Heights South Manhattan
## 248 253 Willets Point Queens
## 249 246 West Chelsea/Hudson Yards Manhattan
## 250 247 West Concourse Bronx
## 251 248 West Farms/Bronx River Bronx
## 252 249 West Village Manhattan
## 253 257 Windsor Terrace Brooklyn
## 254 250 Westchester Village/Unionport Bronx
## 255 251 Westerleigh Staten Island
## 256 252 Whitestone Queens
## 257 254 Williamsbridge/Olinville Bronx
## 258 255 Williamsburg (North Side) Brooklyn
## 259 256 Williamsburg (South Side) Brooklyn
## 260 259 Woodlawn/Wakefield Bronx
## 261 260 Woodside Queens
## 262 261 World Trade Center Manhattan
## 263 262 Yorkville East Manhattan
## zone_length cost_perKM total_cost
## 1 14 100 1400
## 2 11 100 1100
## 3 23 100 2300
## 4 13 100 1300
## 5 13 100 1300
## 6 23 100 2300
## 7 7 100 700
## 8 12 100 1200
## 9 10 100 1000
## 10 12 100 1200
## 11 12 100 1200
## 12 10 100 1000
## 13 12 100 1200
## 14 17 100 1700
## 15 12 100 1200
## 16 11 100 1100
## 17 9 100 900
## 18 23 100 2300
## 19 16 100 1600
## 20 23 100 2300
## 21 7 100 700
## 22 7 100 700
## 23 9 100 900
## 24 7 100 700
## 25 16 100 1600
## 26 12 100 1200
## 27 35 100 3500
## 28 23 100 2300
## 29 16 100 1600
## 30 14 100 1400
## 31 10 100 1000
## 32 9 100 900
## 33 13 100 1300
## 34 18 100 1800
## 35 11 100 1100
## 36 14 100 1400
## 37 14 100 1400
## 38 15 100 1500
## 39 8 100 800
## 40 15 100 1500
## 41 14 100 1400
## 42 9 100 900
## 43 11 100 1100
## 44 20 100 2000
## 45 12 100 1200
## 46 22 100 2200
## 47 18 100 1800
## 48 12 100 1200
## 49 12 100 1200
## 50 12 100 1200
## 51 10 100 1000
## 52 11 100 1100
## 53 13 100 1300
## 54 15 100 1500
## 55 12 100 1200
## 56 6 100 600
## 57 6 100 600
## 58 12 100 1200
## 59 12 100 1200
## 60 17 100 1700
## 61 19 100 1900
## 62 19 100 1900
## 63 13 100 1300
## 64 10 100 1000
## 65 27 100 2700
## 66 28 100 2800
## 67 18 100 1800
## 68 13 100 1300
## 69 12 100 1200
## 70 13 100 1300
## 71 32 100 3200
## 72 13 100 1300
## 73 22 100 2200
## 74 12 100 1200
## 75 17 100 1700
## 76 17 100 1700
## 77 7 100 700
## 78 12 100 1200
## 79 17 100 1700
## 80 13 100 1300
## 81 33 100 3300
## 82 12 100 1200
## 83 11 100 1100
## 84 24 100 2400
## 85 8 100 800
## 86 16 100 1600
## 87 33 100 3300
## 88 24 100 2400
## 89 20 100 2000
## 90 8 100 800
## 91 9 100 900
## 92 9 100 900
## 93 8 100 800
## 94 28 100 2800
## 95 13 100 1300
## 96 12 100 1200
## 97 25 100 2500
## 98 11 100 1100
## 99 13 100 1300
## 100 15 100 1500
## 101 16 100 1600
## 102 9 100 900
## 103 8 100 800
## 104 45 100 4500
## 105 45 100 4500
## 106 45 100 4500
## 107 7 100 700
## 108 8 100 800
## 109 9 100 900
## 110 11 100 1100
## 111 16 100 1600
## 112 19 100 1900
## 113 10 100 1000
## 114 23 100 2300
## 115 23 100 2300
## 116 19 100 1900
## 117 16 100 1600
## 118 15 100 1500
## 119 27 100 2700
## 120 10 100 1000
## 121 15 100 1500
## 122 7 100 700
## 123 15 100 1500
## 124 17 100 1700
## 125 6 100 600
## 126 9 100 900
## 127 12 100 1200
## 128 11 100 1100
## 129 6 100 600
## 130 16 100 1600
## 131 15 100 1500
## 132 11 100 1100
## 133 16 100 1600
## 134 7 100 700
## 135 9 100 900
## 136 15 100 1500
## 137 11 100 1100
## 138 10 100 1000
## 139 15 100 1500
## 140 17 100 1700
## 141 19 100 1900
## 142 8 100 800
## 143 15 100 1500
## 144 19 100 1900
## 145 14 100 1400
## 146 17 100 1700
## 147 19 100 1900
## 148 19 100 1900
## 149 30 100 3000
## 150 29 100 2900
## 151 8 100 800
## 152 15 100 1500
## 153 11 100 1100
## 154 31 100 3100
## 155 22 100 2200
## 156 15 100 1500
## 157 13 100 1300
## 158 7 100 700
## 159 29 100 2900
## 160 14 100 1400
## 161 14 100 1400
## 162 12 100 1200
## 163 13 100 1300
## 164 13 100 1300
## 165 11 100 1100
## 166 7 100 700
## 167 19 100 1900
## 168 18 100 1800
## 169 19 100 1900
## 170 22 100 2200
## 171 10 100 1000
## 172 18 100 1800
## 173 22 100 2200
## 174 12 100 1200
## 175 7 100 700
## 176 15 100 1500
## 177 11 100 1100
## 178 7 100 700
## 179 10 100 1000
## 180 10 100 1000
## 181 10 100 1000
## 182 11 100 1100
## 183 10 100 1000
## 184 15 100 1500
## 185 14 100 1400
## 186 28 100 2800
## 187 16 100 1600
## 188 13 100 1300
## 189 13 100 1300
## 190 25 100 2500
## 191 14 100 1400
## 192 15 100 1500
## 193 23 100 2300
## 194 15 100 1500
## 195 9 100 900
## 196 8 100 800
## 197 8 100 800
## 198 13 100 1300
## 199 9 100 900
## 200 13 100 1300
## 201 18 100 1800
## 202 21 100 2100
## 203 35 100 3500
## 204 17 100 1700
## 205 13 100 1300
## 206 16 100 1600
## 207 12 100 1200
## 208 25 100 2500
## 209 32 100 3200
## 210 28 100 2800
## 211 7 100 700
## 212 14 100 1400
## 213 4 100 400
## 214 24 100 2400
## 215 13 100 1300
## 216 16 100 1600
## 217 18 100 1800
## 218 25 100 2500
## 219 25 100 2500
## 220 18 100 1800
## 221 26 100 2600
## 222 30 100 3000
## 223 9 100 900
## 224 9 100 900
## 225 13 100 1300
## 226 8 100 800
## 227 16 100 1600
## 228 16 100 1600
## 229 29 100 2900
## 230 25 100 2500
## 231 20 100 2000
## 232 21 100 2100
## 233 23 100 2300
## 234 19 100 1900
## 235 8 100 800
## 236 33 100 3300
## 237 21 100 2100
## 238 21 100 2100
## 239 21 100 2100
## 240 18 100 1800
## 241 21 100 2100
## 242 9 100 900
## 243 20 100 2000
## 244 13 100 1300
## 245 14 100 1400
## 246 24 100 2400
## 247 24 100 2400
## 248 13 100 1300
## 249 25 100 2500
## 250 14 100 1400
## 251 22 100 2200
## 252 12 100 1200
## 253 15 100 1500
## 254 29 100 2900
## 255 11 100 1100
## 256 10 100 1000
## 257 24 100 2400
## 258 25 100 2500
## 259 25 100 2500
## 260 18 100 1800
## 261 8 100 800
## 262 18 100 1800
## 263 14 100 1400
view(taxi_new)
head(taxi_new)
## LocationID zone borough zone_length cost_perKM
## 1 1 Newark Airport EWR 14 100
## 2 2 Jamaica Bay Queens 11 100
## 3 3 Allerton/Pelham Gardens Bronx 23 100
## 4 4 Alphabet City Manhattan 13 100
## 5 5 Arden Heights Staten Island 13 100
## 6 6 Arrochar/Fort Wadsworth Staten Island 23 100
## total_cost
## 1 1400
## 2 1100
## 3 2300
## 4 1300
## 5 1300
## 6 2300
glimpse(taxi_new)
## Rows: 263
## Columns: 6
## $ LocationID <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 24, 10, 11, 12, 13, 18, 25, 14,…
## $ zone <fct> Newark Airport, Jamaica Bay, Allerton/Pelham Gardens, Alph…
## $ borough <fct> EWR, Queens, Bronx, Manhattan, Staten Island, Staten Islan…
## $ zone_length <int> 14, 11, 23, 13, 13, 23, 7, 12, 10, 12, 12, 10, 12, 17, 12,…
## $ cost_perKM <dbl> 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100…
## $ total_cost <dbl> 1400, 1100, 2300, 1300, 1300, 2300, 700, 1200, 1000, 1200,…
filtered_taxi_new <- filter(taxi_new, total_cost > 1400)
print(filtered_taxi_new)
## LocationID zone borough
## 1 3 Allerton/Pelham Gardens Bronx
## 2 6 Arrochar/Fort Wadsworth Staten Island
## 3 13 Battery Park City Manhattan
## 4 15 Bay Terrace/Fort Totten Queens
## 5 22 Bensonhurst West Brooklyn
## 6 23 Bloomfield/Emerson Hill Staten Island
## 7 21 Bensonhurst East Brooklyn
## 8 27 Breezy Point/Fort Tilden/Riis Beach Queens
## 9 28 Briarwood/Jamaica Hills Queens
## 10 33 Brooklyn Heights Brooklyn
## 11 34 Brooklyn Navy Yard Brooklyn
## 12 38 Cambria Heights Queens
## 13 40 Carroll Gardens Brooklyn
## 14 42 Central Harlem North Manhattan
## 15 44 Charleston/Tottenville Staten Island
## 16 47 Claremont/Bathgate Bronx
## 17 54 Columbia Street Brooklyn
## 18 60 Crotona Park East Bronx
## 19 61 Crown Heights North Brooklyn
## 20 62 Crown Heights South Brooklyn
## 21 65 Downtown Brooklyn/MetroTech Brooklyn
## 22 72 East Flatbush/Remsen Village Brooklyn
## 23 66 DUMBO/Vinegar Hill Brooklyn
## 24 69 East Concourse/Concourse Village Bronx
## 25 71 East Flatbush/Farragut Brooklyn
## 26 80 East Williamsburg Brooklyn
## 27 74 East Harlem North Manhattan
## 28 75 East Harlem South Manhattan
## 29 77 East New York/Pennsylvania Avenue Brooklyn
## 30 87 Financial District North Manhattan
## 31 83 Elmhurst/Maspeth Queens
## 32 84 Eltingville/Annadale/Prince's Bay Staten Island
## 33 88 Financial District South Manhattan
## 34 89 Flatbush/Ditmas Park Brooklyn
## 35 93 Flushing Meadows-Corona Park Queens
## 36 96 Forest Park/Highland Park Queens
## 37 99 Freshkills Park Staten Island
## 38 100 Garment District Manhattan
## 39 103 Governor's Island/Ellis Island/Liberty Island Manhattan
## 40 103 Governor's Island/Ellis Island/Liberty Island Manhattan
## 41 103 Governor's Island/Ellis Island/Liberty Island Manhattan
## 42 110 Great Kills Park Staten Island
## 43 111 Green-Wood Cemetery Brooklyn
## 44 113 Greenwich Village North Manhattan
## 45 114 Greenwich Village South Manhattan
## 46 115 Grymes Hill/Clifton Staten Island
## 47 116 Hamilton Heights Manhattan
## 48 117 Hammels/Arverne Queens
## 49 118 Heartland Village/Todt Hill Staten Island
## 50 120 Highbridge Park Manhattan
## 51 150 Manhattan Beach Brooklyn
## 52 121 Hillcrest/Pomonok Queens
## 53 128 Inwood Hill Park Manhattan
## 54 129 Jackson Heights Queens
## 55 151 Manhattan Valley Manhattan
## 56 131 Jamaica Estates Queens
## 57 140 Lenox Hill East Manhattan
## 58 135 Kew Gardens Hills Queens
## 59 136 Kingsbridge Heights Bronx
## 60 141 Lenox Hill West Manhattan
## 61 142 Lincoln Square East Manhattan
## 62 138 LaGuardia Airport Queens
## 63 143 Lincoln Square West Manhattan
## 64 144 Little Italy/NoLiTa Manhattan
## 65 145 Long Island City/Hunters Point Queens
## 66 146 Long Island City/Queens Plaza Queens
## 67 148 Lower East Side Manhattan
## 68 154 Marine Park/Floyd Bennett Field Brooklyn
## 69 155 Marine Park/Mill Basin Brooklyn
## 70 156 Mariners Harbor Staten Island
## 71 158 Meatpacking/West Village West Manhattan
## 72 166 Morningside Heights Manhattan
## 73 167 Morrisania/Melrose Bronx
## 74 178 Ocean Parkway South Brooklyn
## 75 168 Mott Haven/Port Morris Bronx
## 76 171 Murray Hill-Queens Queens
## 77 172 New Dorp/Midland Beach Staten Island
## 78 175 Oakland Gardens Queens
## 79 184 Pelham Bay Park Bronx
## 80 186 Penn Station/Madison Sq West Manhattan
## 81 189 Prospect Heights Brooklyn
## 82 188 Prospect-Lefferts Gardens Brooklyn
## 83 192 Queensboro Hill Queens
## 84 193 Queensbridge/Ravenswood Queens
## 85 194 Randalls Island Manhattan
## 86 212 Soundview/Bruckner Bronx
## 87 213 Soundview/Castle Hill Bronx
## 88 200 Riverdale/North Riverdale/Fieldston Bronx
## 89 204 Rossville/Woodrow Staten Island
## 90 202 Roosevelt Island Manhattan
## 91 206 Saint George/New Brighton Staten Island
## 92 207 Saint Michaels Cemetery/Woodside Queens
## 93 208 Schuylerville/Edgewater Park Bronx
## 94 214 South Beach/Dongan Hills Staten Island
## 95 216 South Ozone Park Queens
## 96 217 South Williamsburg Brooklyn
## 97 218 Springfield Gardens North Queens
## 98 219 Springfield Gardens South Queens
## 99 225 Stuyvesant Heights Brooklyn
## 100 220 Spuyten Duyvil/Kingsbridge Bronx
## 101 224 Stuy Town/Peter Cooper Village Manhattan
## 102 227 Sunset Park East Brooklyn
## 103 228 Sunset Park West Brooklyn
## 104 229 Sutton Place/Turtle Bay North Manhattan
## 105 230 Times Sq/Theatre District Manhattan
## 106 231 TriBeCa/Civic Center Manhattan
## 107 239 Upper West Side South Manhattan
## 108 232 Two Bridges/Seward Park Manhattan
## 109 233 UN/Turtle Bay South Manhattan
## 110 235 University Heights/Morris Heights Bronx
## 111 236 Upper East Side North Manhattan
## 112 237 Upper East Side South Manhattan
## 113 238 Upper West Side North Manhattan
## 114 240 Van Cortlandt Park Bronx
## 115 241 Van Cortlandt Village Bronx
## 116 242 Van Nest/Morris Park Bronx
## 117 243 Washington Heights North Manhattan
## 118 244 Washington Heights South Manhattan
## 119 246 West Chelsea/Hudson Yards Manhattan
## 120 248 West Farms/Bronx River Bronx
## 121 257 Windsor Terrace Brooklyn
## 122 250 Westchester Village/Unionport Bronx
## 123 254 Williamsbridge/Olinville Bronx
## 124 255 Williamsburg (North Side) Brooklyn
## 125 256 Williamsburg (South Side) Brooklyn
## 126 259 Woodlawn/Wakefield Bronx
## 127 261 World Trade Center Manhattan
## zone_length cost_perKM total_cost
## 1 23 100 2300
## 2 23 100 2300
## 3 17 100 1700
## 4 23 100 2300
## 5 16 100 1600
## 6 23 100 2300
## 7 16 100 1600
## 8 35 100 3500
## 9 23 100 2300
## 10 16 100 1600
## 11 18 100 1800
## 12 15 100 1500
## 13 15 100 1500
## 14 20 100 2000
## 15 22 100 2200
## 16 18 100 1800
## 17 15 100 1500
## 18 17 100 1700
## 19 19 100 1900
## 20 19 100 1900
## 21 27 100 2700
## 22 28 100 2800
## 23 18 100 1800
## 24 32 100 3200
## 25 22 100 2200
## 26 17 100 1700
## 27 17 100 1700
## 28 17 100 1700
## 29 33 100 3300
## 30 24 100 2400
## 31 16 100 1600
## 32 33 100 3300
## 33 24 100 2400
## 34 20 100 2000
## 35 28 100 2800
## 36 25 100 2500
## 37 15 100 1500
## 38 16 100 1600
## 39 45 100 4500
## 40 45 100 4500
## 41 45 100 4500
## 42 16 100 1600
## 43 19 100 1900
## 44 23 100 2300
## 45 23 100 2300
## 46 19 100 1900
## 47 16 100 1600
## 48 15 100 1500
## 49 27 100 2700
## 50 15 100 1500
## 51 15 100 1500
## 52 17 100 1700
## 53 16 100 1600
## 54 15 100 1500
## 55 16 100 1600
## 56 15 100 1500
## 57 15 100 1500
## 58 17 100 1700
## 59 19 100 1900
## 60 15 100 1500
## 61 19 100 1900
## 62 17 100 1700
## 63 19 100 1900
## 64 19 100 1900
## 65 30 100 3000
## 66 29 100 2900
## 67 15 100 1500
## 68 31 100 3100
## 69 22 100 2200
## 70 15 100 1500
## 71 29 100 2900
## 72 19 100 1900
## 73 18 100 1800
## 74 19 100 1900
## 75 22 100 2200
## 76 18 100 1800
## 77 22 100 2200
## 78 15 100 1500
## 79 15 100 1500
## 80 28 100 2800
## 81 16 100 1600
## 82 25 100 2500
## 83 15 100 1500
## 84 23 100 2300
## 85 15 100 1500
## 86 18 100 1800
## 87 21 100 2100
## 88 35 100 3500
## 89 17 100 1700
## 90 16 100 1600
## 91 25 100 2500
## 92 32 100 3200
## 93 28 100 2800
## 94 24 100 2400
## 95 16 100 1600
## 96 18 100 1800
## 97 25 100 2500
## 98 25 100 2500
## 99 18 100 1800
## 100 26 100 2600
## 101 30 100 3000
## 102 16 100 1600
## 103 16 100 1600
## 104 29 100 2900
## 105 25 100 2500
## 106 20 100 2000
## 107 21 100 2100
## 108 23 100 2300
## 109 19 100 1900
## 110 33 100 3300
## 111 21 100 2100
## 112 21 100 2100
## 113 21 100 2100
## 114 18 100 1800
## 115 21 100 2100
## 116 20 100 2000
## 117 24 100 2400
## 118 24 100 2400
## 119 25 100 2500
## 120 22 100 2200
## 121 15 100 1500
## 122 29 100 2900
## 123 24 100 2400
## 124 25 100 2500
## 125 25 100 2500
## 126 18 100 1800
## 127 18 100 1800
view(filtered_taxi_new)
result_1 <- taxi_new %>%
arrange(desc(total_cost)) %>%
arrange(borough)
print(result_1)
## LocationID zone borough
## 1 200 Riverdale/North Riverdale/Fieldston Bronx
## 2 235 University Heights/Morris Heights Bronx
## 3 69 East Concourse/Concourse Village Bronx
## 4 250 Westchester Village/Unionport Bronx
## 5 208 Schuylerville/Edgewater Park Bronx
## 6 220 Spuyten Duyvil/Kingsbridge Bronx
## 7 254 Williamsbridge/Olinville Bronx
## 8 3 Allerton/Pelham Gardens Bronx
## 9 168 Mott Haven/Port Morris Bronx
## 10 248 West Farms/Bronx River Bronx
## 11 213 Soundview/Castle Hill Bronx
## 12 241 Van Cortlandt Village Bronx
## 13 242 Van Nest/Morris Park Bronx
## 14 136 Kingsbridge Heights Bronx
## 15 47 Claremont/Bathgate Bronx
## 16 167 Morrisania/Melrose Bronx
## 17 212 Soundview/Bruckner Bronx
## 18 240 Van Cortlandt Park Bronx
## 19 259 Woodlawn/Wakefield Bronx
## 20 60 Crotona Park East Bronx
## 21 184 Pelham Bay Park Bronx
## 22 185 Pelham Parkway Bronx
## 23 247 West Concourse Bronx
## 24 94 Fordham South Bronx
## 25 159 Melrose South Bronx
## 26 199 Rikers Island Bronx
## 27 18 Bedford Park Bronx
## 28 58 Country Club Bronx
## 29 59 Crotona Park Bronx
## 30 78 East Tremont Bronx
## 31 46 City Island Bronx
## 32 81 Eastchester Bronx
## 33 126 Hunts Point Bronx
## 34 182 Parkchester Bronx
## 35 31 Bronx Park Bronx
## 36 51 Co-Op City Bronx
## 37 119 Highbridge Bronx
## 38 169 Mount Hope Bronx
## 39 183 Pelham Bay Bronx
## 40 32 Bronxdale Bronx
## 41 147 Longwood Bronx
## 42 20 Belmont Bronx
## 43 174 Norwood Bronx
## 44 77 East New York/Pennsylvania Avenue Brooklyn
## 45 154 Marine Park/Floyd Bennett Field Brooklyn
## 46 72 East Flatbush/Remsen Village Brooklyn
## 47 65 Downtown Brooklyn/MetroTech Brooklyn
## 48 188 Prospect-Lefferts Gardens Brooklyn
## 49 255 Williamsburg (North Side) Brooklyn
## 50 256 Williamsburg (South Side) Brooklyn
## 51 71 East Flatbush/Farragut Brooklyn
## 52 155 Marine Park/Mill Basin Brooklyn
## 53 89 Flatbush/Ditmas Park Brooklyn
## 54 61 Crown Heights North Brooklyn
## 55 62 Crown Heights South Brooklyn
## 56 111 Green-Wood Cemetery Brooklyn
## 57 178 Ocean Parkway South Brooklyn
## 58 34 Brooklyn Navy Yard Brooklyn
## 59 66 DUMBO/Vinegar Hill Brooklyn
## 60 217 South Williamsburg Brooklyn
## 61 225 Stuyvesant Heights Brooklyn
## 62 80 East Williamsburg Brooklyn
## 63 22 Bensonhurst West Brooklyn
## 64 21 Bensonhurst East Brooklyn
## 65 33 Brooklyn Heights Brooklyn
## 66 189 Prospect Heights Brooklyn
## 67 227 Sunset Park East Brooklyn
## 68 228 Sunset Park West Brooklyn
## 69 40 Carroll Gardens Brooklyn
## 70 54 Columbia Street Brooklyn
## 71 150 Manhattan Beach Brooklyn
## 72 257 Windsor Terrace Brooklyn
## 73 29 Brighton Beach Brooklyn
## 74 36 Bushwick North Brooklyn
## 75 37 Bushwick South Brooklyn
## 76 210 Sheepshead Bay Brooklyn
## 77 63 Cypress Hills Brooklyn
## 78 67 Dyker Heights Brooklyn
## 79 76 East New York Brooklyn
## 80 190 Prospect Park Brooklyn
## 81 222 Starrett City Brooklyn
## 82 26 Borough Park Brooklyn
## 83 49 Clinton Hill Brooklyn
## 84 55 Coney Island Brooklyn
## 85 25 Boerum Hill Brooklyn
## 86 35 Brownsville Brooklyn
## 87 52 Cobble Hill Brooklyn
## 88 97 Fort Greene Brooklyn
## 89 11 Bath Beach Brooklyn
## 90 112 Greenpoint Brooklyn
## 91 133 Kensington Brooklyn
## 92 177 Ocean Hill Brooklyn
## 93 181 Park Slope Brooklyn
## 94 14 Bay Ridge Brooklyn
## 95 91 Flatlands Brooklyn
## 96 108 Gravesend Brooklyn
## 97 123 Homecrest Brooklyn
## 98 39 Canarsie Brooklyn
## 99 195 Red Hook Brooklyn
## 100 17 Bedford Brooklyn
## 101 85 Erasmus Brooklyn
## 102 106 Gowanus Brooklyn
## 103 149 Madison Brooklyn
## 104 165 Midwood Brooklyn
## 105 1 Newark Airport EWR
## 106 103 Governor's Island/Ellis Island/Liberty Island Manhattan
## 107 103 Governor's Island/Ellis Island/Liberty Island Manhattan
## 108 103 Governor's Island/Ellis Island/Liberty Island Manhattan
## 109 224 Stuy Town/Peter Cooper Village Manhattan
## 110 158 Meatpacking/West Village West Manhattan
## 111 229 Sutton Place/Turtle Bay North Manhattan
## 112 186 Penn Station/Madison Sq West Manhattan
## 113 230 Times Sq/Theatre District Manhattan
## 114 246 West Chelsea/Hudson Yards Manhattan
## 115 87 Financial District North Manhattan
## 116 88 Financial District South Manhattan
## 117 243 Washington Heights North Manhattan
## 118 244 Washington Heights South Manhattan
## 119 113 Greenwich Village North Manhattan
## 120 114 Greenwich Village South Manhattan
## 121 232 Two Bridges/Seward Park Manhattan
## 122 239 Upper West Side South Manhattan
## 123 236 Upper East Side North Manhattan
## 124 237 Upper East Side South Manhattan
## 125 238 Upper West Side North Manhattan
## 126 42 Central Harlem North Manhattan
## 127 231 TriBeCa/Civic Center Manhattan
## 128 142 Lincoln Square East Manhattan
## 129 143 Lincoln Square West Manhattan
## 130 144 Little Italy/NoLiTa Manhattan
## 131 166 Morningside Heights Manhattan
## 132 233 UN/Turtle Bay South Manhattan
## 133 261 World Trade Center Manhattan
## 134 13 Battery Park City Manhattan
## 135 74 East Harlem North Manhattan
## 136 75 East Harlem South Manhattan
## 137 100 Garment District Manhattan
## 138 116 Hamilton Heights Manhattan
## 139 128 Inwood Hill Park Manhattan
## 140 151 Manhattan Valley Manhattan
## 141 202 Roosevelt Island Manhattan
## 142 120 Highbridge Park Manhattan
## 143 140 Lenox Hill East Manhattan
## 144 141 Lenox Hill West Manhattan
## 145 148 Lower East Side Manhattan
## 146 194 Randalls Island Manhattan
## 147 41 Central Harlem Manhattan
## 148 152 Manhattanville Manhattan
## 149 161 Midtown Center Manhattan
## 150 263 Yorkville West Manhattan
## 151 262 Yorkville East Manhattan
## 152 4 Alphabet City Manhattan
## 153 163 Midtown North Manhattan
## 154 164 Midtown South Manhattan
## 155 24 Bloomingdale Manhattan
## 156 12 Battery Park Manhattan
## 157 43 Central Park Manhattan
## 158 48 Clinton East Manhattan
## 159 50 Clinton West Manhattan
## 160 68 East Chelsea Manhattan
## 161 79 East Village Manhattan
## 162 162 Midtown East Manhattan
## 163 249 West Village Manhattan
## 164 153 Marble Hill Manhattan
## 165 170 Murray Hill Manhattan
## 166 45 Chinatown Manhattan
## 167 125 Hudson Sq Manhattan
## 168 90 Flatiron Manhattan
## 169 107 Gramercy Manhattan
## 170 137 Kips Bay Manhattan
## 171 234 Union Sq Manhattan
## 172 209 Seaport Manhattan
## 173 127 Inwood Manhattan
## 174 211 SoHo Manhattan
## 175 27 Breezy Point/Fort Tilden/Riis Beach Queens
## 176 207 Saint Michaels Cemetery/Woodside Queens
## 177 145 Long Island City/Hunters Point Queens
## 178 146 Long Island City/Queens Plaza Queens
## 179 93 Flushing Meadows-Corona Park Queens
## 180 96 Forest Park/Highland Park Queens
## 181 218 Springfield Gardens North Queens
## 182 219 Springfield Gardens South Queens
## 183 15 Bay Terrace/Fort Totten Queens
## 184 28 Briarwood/Jamaica Hills Queens
## 185 193 Queensbridge/Ravenswood Queens
## 186 171 Murray Hill-Queens Queens
## 187 121 Hillcrest/Pomonok Queens
## 188 135 Kew Gardens Hills Queens
## 189 138 LaGuardia Airport Queens
## 190 83 Elmhurst/Maspeth Queens
## 191 216 South Ozone Park Queens
## 192 38 Cambria Heights Queens
## 193 117 Hammels/Arverne Queens
## 194 129 Jackson Heights Queens
## 195 131 Jamaica Estates Queens
## 196 175 Oakland Gardens Queens
## 197 192 Queensboro Hill Queens
## 198 160 Middle Village Queens
## 199 191 Queens Village Queens
## 200 30 Broad Channel Queens
## 201 53 College Point Queens
## 202 73 East Flushing Queens
## 203 70 East Elmhurst Queens
## 204 98 Fresh Meadows Queens
## 205 197 Richmond Hill Queens
## 206 201 Rockaway Park Queens
## 207 215 South Jamaica Queens
## 208 253 Willets Point Queens
## 209 8 Astoria Park Queens
## 210 10 Baisley Park Queens
## 211 86 Far Rockaway Queens
## 212 95 Forest Hills Queens
## 213 124 Howard Beach Queens
## 214 173 North Corona Queens
## 215 205 Saint Albans Queens
## 216 2 Jamaica Bay Queens
## 217 134 Kew Gardens Queens
## 218 132 JFK Airport Queens
## 219 179 Old Astoria Queens
## 220 9 Auburndale Queens
## 221 64 Douglaston Queens
## 222 180 Ozone Park Queens
## 223 252 Whitestone Queens
## 224 19 Bellerose Queens
## 225 101 Glen Oaks Queens
## 226 139 Laurelton Queens
## 227 196 Rego Park Queens
## 228 198 Ridgewood Queens
## 229 226 Sunnyside Queens
## 230 258 Woodhaven Queens
## 231 82 Elmhurst Queens
## 232 92 Flushing Queens
## 233 102 Glendale Queens
## 234 203 Rosedale Queens
## 235 223 Steinway Queens
## 236 260 Woodside Queens
## 237 7 Astoria Queens
## 238 16 Bayside Queens
## 239 130 Jamaica Queens
## 240 157 Maspeth Queens
## 241 56 Corona Queens
## 242 56 Corona Queens
## 243 122 Hollis Queens
## 244 84 Eltingville/Annadale/Prince's Bay Staten Island
## 245 118 Heartland Village/Todt Hill Staten Island
## 246 206 Saint George/New Brighton Staten Island
## 247 214 South Beach/Dongan Hills Staten Island
## 248 6 Arrochar/Fort Wadsworth Staten Island
## 249 23 Bloomfield/Emerson Hill Staten Island
## 250 44 Charleston/Tottenville Staten Island
## 251 172 New Dorp/Midland Beach Staten Island
## 252 115 Grymes Hill/Clifton Staten Island
## 253 204 Rossville/Woodrow Staten Island
## 254 110 Great Kills Park Staten Island
## 255 99 Freshkills Park Staten Island
## 256 156 Mariners Harbor Staten Island
## 257 5 Arden Heights Staten Island
## 258 187 Port Richmond Staten Island
## 259 245 West Brighton Staten Island
## 260 109 Great Kills Staten Island
## 261 251 Westerleigh Staten Island
## 262 221 Stapleton Staten Island
## 263 176 Oakwood Staten Island
## zone_length cost_perKM total_cost
## 1 35 100 3500
## 2 33 100 3300
## 3 32 100 3200
## 4 29 100 2900
## 5 28 100 2800
## 6 26 100 2600
## 7 24 100 2400
## 8 23 100 2300
## 9 22 100 2200
## 10 22 100 2200
## 11 21 100 2100
## 12 21 100 2100
## 13 20 100 2000
## 14 19 100 1900
## 15 18 100 1800
## 16 18 100 1800
## 17 18 100 1800
## 18 18 100 1800
## 19 18 100 1800
## 20 17 100 1700
## 21 15 100 1500
## 22 14 100 1400
## 23 14 100 1400
## 24 13 100 1300
## 25 13 100 1300
## 26 13 100 1300
## 27 12 100 1200
## 28 12 100 1200
## 29 12 100 1200
## 30 12 100 1200
## 31 11 100 1100
## 32 11 100 1100
## 33 11 100 1100
## 34 11 100 1100
## 35 10 100 1000
## 36 10 100 1000
## 37 10 100 1000
## 38 10 100 1000
## 39 10 100 1000
## 40 9 100 900
## 41 8 100 800
## 42 7 100 700
## 43 7 100 700
## 44 33 100 3300
## 45 31 100 3100
## 46 28 100 2800
## 47 27 100 2700
## 48 25 100 2500
## 49 25 100 2500
## 50 25 100 2500
## 51 22 100 2200
## 52 22 100 2200
## 53 20 100 2000
## 54 19 100 1900
## 55 19 100 1900
## 56 19 100 1900
## 57 19 100 1900
## 58 18 100 1800
## 59 18 100 1800
## 60 18 100 1800
## 61 18 100 1800
## 62 17 100 1700
## 63 16 100 1600
## 64 16 100 1600
## 65 16 100 1600
## 66 16 100 1600
## 67 16 100 1600
## 68 16 100 1600
## 69 15 100 1500
## 70 15 100 1500
## 71 15 100 1500
## 72 15 100 1500
## 73 14 100 1400
## 74 14 100 1400
## 75 14 100 1400
## 76 14 100 1400
## 77 13 100 1300
## 78 13 100 1300
## 79 13 100 1300
## 80 13 100 1300
## 81 13 100 1300
## 82 12 100 1200
## 83 12 100 1200
## 84 12 100 1200
## 85 11 100 1100
## 86 11 100 1100
## 87 11 100 1100
## 88 11 100 1100
## 89 10 100 1000
## 90 10 100 1000
## 91 10 100 1000
## 92 10 100 1000
## 93 10 100 1000
## 94 9 100 900
## 95 9 100 900
## 96 9 100 900
## 97 9 100 900
## 98 8 100 800
## 99 8 100 800
## 100 7 100 700
## 101 7 100 700
## 102 7 100 700
## 103 7 100 700
## 104 7 100 700
## 105 14 100 1400
## 106 45 100 4500
## 107 45 100 4500
## 108 45 100 4500
## 109 30 100 3000
## 110 29 100 2900
## 111 29 100 2900
## 112 28 100 2800
## 113 25 100 2500
## 114 25 100 2500
## 115 24 100 2400
## 116 24 100 2400
## 117 24 100 2400
## 118 24 100 2400
## 119 23 100 2300
## 120 23 100 2300
## 121 23 100 2300
## 122 21 100 2100
## 123 21 100 2100
## 124 21 100 2100
## 125 21 100 2100
## 126 20 100 2000
## 127 20 100 2000
## 128 19 100 1900
## 129 19 100 1900
## 130 19 100 1900
## 131 19 100 1900
## 132 19 100 1900
## 133 18 100 1800
## 134 17 100 1700
## 135 17 100 1700
## 136 17 100 1700
## 137 16 100 1600
## 138 16 100 1600
## 139 16 100 1600
## 140 16 100 1600
## 141 16 100 1600
## 142 15 100 1500
## 143 15 100 1500
## 144 15 100 1500
## 145 15 100 1500
## 146 15 100 1500
## 147 14 100 1400
## 148 14 100 1400
## 149 14 100 1400
## 150 14 100 1400
## 151 14 100 1400
## 152 13 100 1300
## 153 13 100 1300
## 154 13 100 1300
## 155 12 100 1200
## 156 12 100 1200
## 157 12 100 1200
## 158 12 100 1200
## 159 12 100 1200
## 160 12 100 1200
## 161 12 100 1200
## 162 12 100 1200
## 163 12 100 1200
## 164 11 100 1100
## 165 11 100 1100
## 166 9 100 900
## 167 9 100 900
## 168 8 100 800
## 169 8 100 800
## 170 8 100 800
## 171 8 100 800
## 172 7 100 700
## 173 6 100 600
## 174 4 100 400
## 175 35 100 3500
## 176 32 100 3200
## 177 30 100 3000
## 178 29 100 2900
## 179 28 100 2800
## 180 25 100 2500
## 181 25 100 2500
## 182 25 100 2500
## 183 23 100 2300
## 184 23 100 2300
## 185 23 100 2300
## 186 18 100 1800
## 187 17 100 1700
## 188 17 100 1700
## 189 17 100 1700
## 190 16 100 1600
## 191 16 100 1600
## 192 15 100 1500
## 193 15 100 1500
## 194 15 100 1500
## 195 15 100 1500
## 196 15 100 1500
## 197 15 100 1500
## 198 14 100 1400
## 199 14 100 1400
## 200 13 100 1300
## 201 13 100 1300
## 202 13 100 1300
## 203 13 100 1300
## 204 13 100 1300
## 205 13 100 1300
## 206 13 100 1300
## 207 13 100 1300
## 208 13 100 1300
## 209 12 100 1200
## 210 12 100 1200
## 211 12 100 1200
## 212 12 100 1200
## 213 12 100 1200
## 214 12 100 1200
## 215 12 100 1200
## 216 11 100 1100
## 217 11 100 1100
## 218 11 100 1100
## 219 11 100 1100
## 220 10 100 1000
## 221 10 100 1000
## 222 10 100 1000
## 223 10 100 1000
## 224 9 100 900
## 225 9 100 900
## 226 9 100 900
## 227 9 100 900
## 228 9 100 900
## 229 9 100 900
## 230 9 100 900
## 231 8 100 800
## 232 8 100 800
## 233 8 100 800
## 234 8 100 800
## 235 8 100 800
## 236 8 100 800
## 237 7 100 700
## 238 7 100 700
## 239 7 100 700
## 240 7 100 700
## 241 6 100 600
## 242 6 100 600
## 243 6 100 600
## 244 33 100 3300
## 245 27 100 2700
## 246 25 100 2500
## 247 24 100 2400
## 248 23 100 2300
## 249 23 100 2300
## 250 22 100 2200
## 251 22 100 2200
## 252 19 100 1900
## 253 17 100 1700
## 254 16 100 1600
## 255 15 100 1500
## 256 15 100 1500
## 257 13 100 1300
## 258 13 100 1300
## 259 13 100 1300
## 260 11 100 1100
## 261 11 100 1100
## 262 9 100 900
## 263 7 100 700
view(result_1)
result_2 <- taxi_new %>% group_by(zone) %>% summarize (mean=mean(total_cost))
view(result_2)
head(result_2)
## # A tibble: 6 × 2
## zone mean
## <fct> <dbl>
## 1 Allerton/Pelham Gardens 2300
## 2 Alphabet City 1300
## 3 Arden Heights 1300
## 4 Arrochar/Fort Wadsworth 2300
## 5 Astoria 700
## 6 Astoria Park 1200
zone_totalcost <- taxi_new %>% select(zone, total_cost)
print(zone_totalcost)
## zone total_cost
## 1 Newark Airport 1400
## 2 Jamaica Bay 1100
## 3 Allerton/Pelham Gardens 2300
## 4 Alphabet City 1300
## 5 Arden Heights 1300
## 6 Arrochar/Fort Wadsworth 2300
## 7 Astoria 700
## 8 Astoria Park 1200
## 9 Auburndale 1000
## 10 Bloomingdale 1200
## 11 Baisley Park 1200
## 12 Bath Beach 1000
## 13 Battery Park 1200
## 14 Battery Park City 1700
## 15 Bedford Park 1200
## 16 Boerum Hill 1100
## 17 Bay Ridge 900
## 18 Bay Terrace/Fort Totten 2300
## 19 Bensonhurst West 1600
## 20 Bloomfield/Emerson Hill 2300
## 21 Bayside 700
## 22 Bedford 700
## 23 Bellerose 900
## 24 Belmont 700
## 25 Bensonhurst East 1600
## 26 Borough Park 1200
## 27 Breezy Point/Fort Tilden/Riis Beach 3500
## 28 Briarwood/Jamaica Hills 2300
## 29 Brooklyn Heights 1600
## 30 Brighton Beach 1400
## 31 Bronx Park 1000
## 32 Bronxdale 900
## 33 Broad Channel 1300
## 34 Brooklyn Navy Yard 1800
## 35 Brownsville 1100
## 36 Bushwick North 1400
## 37 Bushwick South 1400
## 38 Cambria Heights 1500
## 39 Canarsie 800
## 40 Carroll Gardens 1500
## 41 Central Harlem 1400
## 42 Chinatown 900
## 43 City Island 1100
## 44 Central Harlem North 2000
## 45 Central Park 1200
## 46 Charleston/Tottenville 2200
## 47 Claremont/Bathgate 1800
## 48 Clinton East 1200
## 49 Clinton Hill 1200
## 50 Clinton West 1200
## 51 Co-Op City 1000
## 52 Cobble Hill 1100
## 53 College Point 1300
## 54 Columbia Street 1500
## 55 Coney Island 1200
## 56 Corona 600
## 57 Corona 600
## 58 Country Club 1200
## 59 Crotona Park 1200
## 60 Crotona Park East 1700
## 61 Crown Heights North 1900
## 62 Crown Heights South 1900
## 63 Cypress Hills 1300
## 64 Douglaston 1000
## 65 Downtown Brooklyn/MetroTech 2700
## 66 East Flatbush/Remsen Village 2800
## 67 DUMBO/Vinegar Hill 1800
## 68 Dyker Heights 1300
## 69 East Chelsea 1200
## 70 East Flushing 1300
## 71 East Concourse/Concourse Village 3200
## 72 East Elmhurst 1300
## 73 East Flatbush/Farragut 2200
## 74 East Village 1200
## 75 East Williamsburg 1700
## 76 East Harlem North 1700
## 77 Erasmus 700
## 78 Far Rockaway 1200
## 79 East Harlem South 1700
## 80 East New York 1300
## 81 East New York/Pennsylvania Avenue 3300
## 82 East Tremont 1200
## 83 Eastchester 1100
## 84 Financial District North 2400
## 85 Elmhurst 800
## 86 Elmhurst/Maspeth 1600
## 87 Eltingville/Annadale/Prince's Bay 3300
## 88 Financial District South 2400
## 89 Flatbush/Ditmas Park 2000
## 90 Flatiron 800
## 91 Hudson Sq 900
## 92 Flatlands 900
## 93 Flushing 800
## 94 Flushing Meadows-Corona Park 2800
## 95 Fordham South 1300
## 96 Forest Hills 1200
## 97 Forest Park/Highland Park 2500
## 98 Fort Greene 1100
## 99 Fresh Meadows 1300
## 100 Freshkills Park 1500
## 101 Garment District 1600
## 102 Glen Oaks 900
## 103 Glendale 800
## 104 Governor's Island/Ellis Island/Liberty Island 4500
## 105 Governor's Island/Ellis Island/Liberty Island 4500
## 106 Governor's Island/Ellis Island/Liberty Island 4500
## 107 Gowanus 700
## 108 Gramercy 800
## 109 Gravesend 900
## 110 Great Kills 1100
## 111 Great Kills Park 1600
## 112 Green-Wood Cemetery 1900
## 113 Greenpoint 1000
## 114 Greenwich Village North 2300
## 115 Greenwich Village South 2300
## 116 Grymes Hill/Clifton 1900
## 117 Hamilton Heights 1600
## 118 Hammels/Arverne 1500
## 119 Heartland Village/Todt Hill 2700
## 120 Highbridge 1000
## 121 Highbridge Park 1500
## 122 Madison 700
## 123 Manhattan Beach 1500
## 124 Hillcrest/Pomonok 1700
## 125 Hollis 600
## 126 Homecrest 900
## 127 Howard Beach 1200
## 128 Hunts Point 1100
## 129 Inwood 600
## 130 Inwood Hill Park 1600
## 131 Jackson Heights 1500
## 132 Kew Gardens 1100
## 133 Manhattan Valley 1600
## 134 Jamaica 700
## 135 Laurelton 900
## 136 Jamaica Estates 1500
## 137 JFK Airport 1100
## 138 Kensington 1000
## 139 Lenox Hill East 1500
## 140 Kew Gardens Hills 1700
## 141 Kingsbridge Heights 1900
## 142 Kips Bay 800
## 143 Lenox Hill West 1500
## 144 Lincoln Square East 1900
## 145 Manhattanville 1400
## 146 LaGuardia Airport 1700
## 147 Lincoln Square West 1900
## 148 Little Italy/NoLiTa 1900
## 149 Long Island City/Hunters Point 3000
## 150 Long Island City/Queens Plaza 2900
## 151 Longwood 800
## 152 Lower East Side 1500
## 153 Marble Hill 1100
## 154 Marine Park/Floyd Bennett Field 3100
## 155 Marine Park/Mill Basin 2200
## 156 Mariners Harbor 1500
## 157 Melrose South 1300
## 158 Maspeth 700
## 159 Meatpacking/West Village West 2900
## 160 Middle Village 1400
## 161 Midtown Center 1400
## 162 Midtown East 1200
## 163 Midtown North 1300
## 164 Midtown South 1300
## 165 Murray Hill 1100
## 166 Midwood 700
## 167 Morningside Heights 1900
## 168 Morrisania/Melrose 1800
## 169 Ocean Parkway South 1900
## 170 Mott Haven/Port Morris 2200
## 171 Mount Hope 1000
## 172 Murray Hill-Queens 1800
## 173 New Dorp/Midland Beach 2200
## 174 North Corona 1200
## 175 Norwood 700
## 176 Oakland Gardens 1500
## 177 Old Astoria 1100
## 178 Oakwood 700
## 179 Ocean Hill 1000
## 180 Ozone Park 1000
## 181 Park Slope 1000
## 182 Parkchester 1100
## 183 Pelham Bay 1000
## 184 Pelham Bay Park 1500
## 185 Pelham Parkway 1400
## 186 Penn Station/Madison Sq West 2800
## 187 Prospect Heights 1600
## 188 Prospect Park 1300
## 189 Port Richmond 1300
## 190 Prospect-Lefferts Gardens 2500
## 191 Queens Village 1400
## 192 Queensboro Hill 1500
## 193 Queensbridge/Ravenswood 2300
## 194 Randalls Island 1500
## 195 Rego Park 900
## 196 Red Hook 800
## 197 Rosedale 800
## 198 Richmond Hill 1300
## 199 Ridgewood 900
## 200 Rikers Island 1300
## 201 Soundview/Bruckner 1800
## 202 Soundview/Castle Hill 2100
## 203 Riverdale/North Riverdale/Fieldston 3500
## 204 Rossville/Woodrow 1700
## 205 Rockaway Park 1300
## 206 Roosevelt Island 1600
## 207 Saint Albans 1200
## 208 Saint George/New Brighton 2500
## 209 Saint Michaels Cemetery/Woodside 3200
## 210 Schuylerville/Edgewater Park 2800
## 211 Seaport 700
## 212 Sheepshead Bay 1400
## 213 SoHo 400
## 214 South Beach/Dongan Hills 2400
## 215 South Jamaica 1300
## 216 South Ozone Park 1600
## 217 South Williamsburg 1800
## 218 Springfield Gardens North 2500
## 219 Springfield Gardens South 2500
## 220 Stuyvesant Heights 1800
## 221 Spuyten Duyvil/Kingsbridge 2600
## 222 Stuy Town/Peter Cooper Village 3000
## 223 Sunnyside 900
## 224 Stapleton 900
## 225 Starrett City 1300
## 226 Steinway 800
## 227 Sunset Park East 1600
## 228 Sunset Park West 1600
## 229 Sutton Place/Turtle Bay North 2900
## 230 Times Sq/Theatre District 2500
## 231 TriBeCa/Civic Center 2000
## 232 Upper West Side South 2100
## 233 Two Bridges/Seward Park 2300
## 234 UN/Turtle Bay South 1900
## 235 Union Sq 800
## 236 University Heights/Morris Heights 3300
## 237 Upper East Side North 2100
## 238 Upper East Side South 2100
## 239 Upper West Side North 2100
## 240 Van Cortlandt Park 1800
## 241 Van Cortlandt Village 2100
## 242 Woodhaven 900
## 243 Van Nest/Morris Park 2000
## 244 West Brighton 1300
## 245 Yorkville West 1400
## 246 Washington Heights North 2400
## 247 Washington Heights South 2400
## 248 Willets Point 1300
## 249 West Chelsea/Hudson Yards 2500
## 250 West Concourse 1400
## 251 West Farms/Bronx River 2200
## 252 West Village 1200
## 253 Windsor Terrace 1500
## 254 Westchester Village/Unionport 2900
## 255 Westerleigh 1100
## 256 Whitestone 1000
## 257 Williamsbridge/Olinville 2400
## 258 Williamsburg (North Side) 2500
## 259 Williamsburg (South Side) 2500
## 260 Woodlawn/Wakefield 1800
## 261 Woodside 800
## 262 World Trade Center 1800
## 263 Yorkville East 1400
view(zone_totalcost)