SlideShare a Scribd company logo
1 of 25
Download to read offline
It’s all going to be fine
Monzo, Carbon-R-a, and the end of the world
Who
We build mobile products. We are very good at it.
Head of Product at Novoda
Useless, but at scale
I’m a generalist amongst specialists
Twitter is killing us all slowly
@rynbtmn
Github profiles are a poor indicator of your worth as a developer
@ryanbateman
Climate change and refugees
CarbonR-a
An R hack project
intended to nudge users
to carbon-offset their flights
CarbonR-a
An R hack project
intended to nudge users
to carbon-offset their flights
This is it.
This is the whole
thing.
CarbonR-a
An R hack project
intended to nudge users
to carbon-offset their flights
R
A language for data-science, statistical
analysis,
and graphical visualisation
R: example 1
10 years of
financial data
painstakingly
extracted from
a legacy bank
R: example 2
Histogram of
spending by
category
Map tiles by Stamen Design, under CC BY 3.0.
Data by OpenStreetMap, under ODbL.
R: example 3
Monzo card use
density map
CarbonR-a
An R hack project
intended to nudge users
to carbon-offset their flights
Nudge theory
https://www.amazon.co.uk/gp/product/014311526X/
Nudge theory
Examples include:
• Auto-savings schemes
• (Good) app ratings prompts
• Political influence campaigns
https://www.amazon.co.uk/gp/product/014311526X/
CarbonR-a
An R hack project
intended to nudge users
to carbon-offset their flights
Carbon offsetting
Offsetting of personal carbon emission caused by everyday use
through payments to
a scheme invested in, for example, renewable energy
~£8 / 1 tonne of carbon
See: https://www.myclimate.org/fileadmin/myc/files_myc_perf/12_flight_calculator_documentation_EN.pdf
Flight emission kgs = (𝑎𝑥2 + 𝑏𝑥 + 𝑐)/(𝑆 × 𝑃𝐿𝐹) × (1 − 𝐶𝐹) × 𝐶𝑊 × (𝐸𝐹 × 𝑀 + 𝑃)
Distance,
given fixed
take-off/landing cost
Avg. Seats x
Passenger Load Factor
Cargo factor
Cabin Class
Weighting
Fuel type, pre-flight fuel costs
CarbonR-a
An R hack project
intended to nudge users
to carbon-offset their flights
How?
…
"notes": "Booking reference L58JJQ",
"metadata": {
"carrier_code": "OE",
"city_of_destination_airport_code": "CFU",
"city_of_origin_airport_code": "LHR",
"customer_code": "XXXXX",
"ledger_insertion_id": "XXXXXXX",
"mastercard_auth_message_id": "XXXXXXX",
"mastercard_lifecycle_id": "XXXXXXXX",
"notes": "Booking reference XXXXXXX",
"travel_date": “XXXXXXXX"
}
…
Monzo introduced some flight
data recently
Callflow
MONZOCARBONRA
Webhook fires new flight transaction
Look up airports’ lat/lon
Calculate Haversine distance
Calculate carbon emissions
Create new feed item
How?
calculateOffset <- function(startAirport = NULL, endAirport = NULL) {
airports <- read.csv("data/airports.csv", sep = ",")
airports <- airports[which(airports$iata_code %in% c(startAirport, endAirport)), ]
startAirport <- airports[which(airports$iata_code == startAirport), ]
endAirport <- airports[which(airports$iata_code == endAirport), ]
distance <- distHaversine(
c(startAirport$latitude_deg, startAirport$longitude_deg),
c(endAirport$latitude_deg, endAirport$longitude_deg)
)
costPerKilogram = 0.008
AverageSeatNumber = 158.44
PassengerLoadFactor = 0.77
DetourConstant = 50
InverseCargoFactor = 0.951
EconomyClassWeight = 0.960
EmissionFactor = 3.150
PreProduction = 0.51
Multiplier = 2
a = 0.0000387871
b = 2.9866
c = 1263.42
emissions <- ((a*distance^2 + b*distance + c) / (AverageSeatNumber *
PassengerLoadFactor)) * InverseCargoFactor * EconomyClassWeight *
(EmissionFactor * Multiplier + PreProduction)
How?
calculateOffset <- function(startAirport = NULL, endAirport = NULL) {
airports <- read.csv("data/airports.csv", sep = ",")
airports <- airports[which(airports$iata_code %in% c(startAirport, endAirport)), ]
startAirport <- airports[which(airports$iata_code == startAirport), ]
endAirport <- airports[which(airports$iata_code == endAirport), ]
distance <- distHaversine(
c(startAirport$latitude_deg, startAirport$longitude_deg),
c(endAirport$latitude_deg, endAirport$longitude_deg)
)
costPerKilogram = 0.008
AverageSeatNumber = 158.44
PassengerLoadFactor = 0.77
DetourConstant = 50
InverseCargoFactor = 0.951
EconomyClassWeight = 0.960
EmissionFactor = 3.150
PreProduction = 0.51
Multiplier = 2
a = 0.0000387871
b = 2.9866
c = 1263.42
emissions <- ((a*distance^2 + b*distance + c) / (AverageSeatNumber *
PassengerLoadFactor)) * InverseCargoFactor * EconomyClassWeight *
(EmissionFactor * Multiplier + PreProduction)
How?
calculateOffset <- function(startAirport = NULL, endAirport = NULL) {
airports <- read.csv("data/airports.csv", sep = ",")
airports <- airports[which(airports$iata_code %in% c(startAirport, endAirport)), ]
startAirport <- airports[which(airports$iata_code == startAirport), ]
endAirport <- airports[which(airports$iata_code == endAirport), ]
distance <- distHaversine(
c(startAirport$latitude_deg, startAirport$longitude_deg),
c(endAirport$latitude_deg, endAirport$longitude_deg)
)
costPerKilogram = 0.008
AverageSeatNumber = 158.44
PassengerLoadFactor = 0.77
DetourConstant = 50
InverseCargoFactor = 0.951
EconomyClassWeight = 0.960
EmissionFactor = 3.150
PreProduction = 0.51
Multiplier = 2
a = 0.0000387871
b = 2.9866
c = 1263.42
emissions <- ((a*distance^2 + b*distance + c) / (AverageSeatNumber *
PassengerLoadFactor)) * InverseCargoFactor * EconomyClassWeight *
(EmissionFactor * Multiplier + PreProduction)
How?
addItemToFeed(title = cat("Offset your flight to ", dest$name),
itembody = cat("Offsetting the flight would cost ", offsetCost),
image_url = “https://carbonra.example.com/icon”,
background_colour = "#ff00ff")
}
CarbonR-a
…so now what?
- use Pots to save for donations?
- build item URL for easier donation?
- a cause-related nudge program across all
transactions?
- build an ark?
I don’t know.
Let’s fucking do something then
I’ll be donating £1000 and
matching donations up to £3000.
Send donation receipt/email to @rynbtmn or ryan.bateman@gmail.com
Thanks!
Monzor, the R Monzo API library: http://github.com/ryanbateman/monzor
Novoda: www.novoda.com
Send donation receipt/email to @rynbtmn or ryan.bateman@gmail.com
These slides: https://goo.gl/Z24fqR

More Related Content

What's hot

10 - Scala. Co-product type (sum type)
10 - Scala. Co-product type (sum type)10 - Scala. Co-product type (sum type)
10 - Scala. Co-product type (sum type)Roman Brovko
 
Abstracción sobre polis griegas
Abstracción sobre polis griegasAbstracción sobre polis griegas
Abstracción sobre polis griegasDaniel711
 
Groovify your java code by hervé roussel
Groovify your java code by hervé rousselGroovify your java code by hervé roussel
Groovify your java code by hervé rousselHervé Vũ Roussel
 
Chapter 8 travel demand
Chapter 8 travel demandChapter 8 travel demand
Chapter 8 travel demandDharmes Patel
 
Language-side Foreign Function Interfaces with NativeBoost
Language-side Foreign Function Interfaces with NativeBoostLanguage-side Foreign Function Interfaces with NativeBoost
Language-side Foreign Function Interfaces with NativeBoostESUG
 

What's hot (7)

10 - Scala. Co-product type (sum type)
10 - Scala. Co-product type (sum type)10 - Scala. Co-product type (sum type)
10 - Scala. Co-product type (sum type)
 
Abstracción sobre polis griegas
Abstracción sobre polis griegasAbstracción sobre polis griegas
Abstracción sobre polis griegas
 
Groovify your java code by hervé roussel
Groovify your java code by hervé rousselGroovify your java code by hervé roussel
Groovify your java code by hervé roussel
 
Chapter 8 travel demand
Chapter 8 travel demandChapter 8 travel demand
Chapter 8 travel demand
 
Language-side Foreign Function Interfaces with NativeBoost
Language-side Foreign Function Interfaces with NativeBoostLanguage-side Foreign Function Interfaces with NativeBoost
Language-side Foreign Function Interfaces with NativeBoost
 
MFC Check
MFC CheckMFC Check
MFC Check
 
App geolocation spanish industrial confidence
App geolocation spanish industrial confidenceApp geolocation spanish industrial confidence
App geolocation spanish industrial confidence
 

Similar to Monzor, Carbon-R-a, and the end of the world

big data slides.pptx
big data slides.pptxbig data slides.pptx
big data slides.pptxBSwethaBindu
 
A Linear Programming Solution To The Gate Assignment Problem At Airport Termi...
A Linear Programming Solution To The Gate Assignment Problem At Airport Termi...A Linear Programming Solution To The Gate Assignment Problem At Airport Termi...
A Linear Programming Solution To The Gate Assignment Problem At Airport Termi...Hannah Baker
 
Railway reservation(c++ project)
Railway reservation(c++ project)Railway reservation(c++ project)
Railway reservation(c++ project)Debashis Rath
 
Railway reservation(c++ project)
Railway reservation(c++ project)Railway reservation(c++ project)
Railway reservation(c++ project)Debashis Rath
 
cbse 12 computer science IP
cbse 12 computer science IPcbse 12 computer science IP
cbse 12 computer science IPD. j Vicky
 
cbse 12 computer science investigatory project
cbse 12 computer science investigatory project  cbse 12 computer science investigatory project
cbse 12 computer science investigatory project D. j Vicky
 
cbse 12 computer science investigatory project
cbse 12 computer science investigatory project  cbse 12 computer science investigatory project
cbse 12 computer science investigatory project D. j Vicky
 
Barbara Nelson [InfluxData] | How Can I Put That Dashboard in My App? | Influ...
Barbara Nelson [InfluxData] | How Can I Put That Dashboard in My App? | Influ...Barbara Nelson [InfluxData] | How Can I Put That Dashboard in My App? | Influ...
Barbara Nelson [InfluxData] | How Can I Put That Dashboard in My App? | Influ...InfluxData
 
INAC Online Hazards Database App
INAC Online Hazards Database AppINAC Online Hazards Database App
INAC Online Hazards Database AppGerry James
 
Shortest Path search for real road networks with pgRouting
Shortest Path search for real road networks with pgRoutingShortest Path search for real road networks with pgRouting
Shortest Path search for real road networks with pgRoutingDaniel Kastl
 
Open Data Hub - Gianluca Antonacci - CISMA - From raw traffic data to air pol...
Open Data Hub - Gianluca Antonacci - CISMA - From raw traffic data to air pol...Open Data Hub - Gianluca Antonacci - CISMA - From raw traffic data to air pol...
Open Data Hub - Gianluca Antonacci - CISMA - From raw traffic data to air pol...South Tyrol Free Software Conference
 
Map reduce hackerdojo
Map reduce hackerdojoMap reduce hackerdojo
Map reduce hackerdojonagwww
 
Scaling Experimentation & Data Capture at Grab
Scaling Experimentation & Data Capture at GrabScaling Experimentation & Data Capture at Grab
Scaling Experimentation & Data Capture at GrabRoman
 
Optimizing the Performance of an Unpredictable UAV Swarm for Intruder Detection
Optimizing the Performance of an Unpredictable UAV Swarm for Intruder DetectionOptimizing the Performance of an Unpredictable UAV Swarm for Intruder Detection
Optimizing the Performance of an Unpredictable UAV Swarm for Intruder DetectionDaniel H. Stolfi
 
CSCI2312 – Object Oriented Programming Section 003 Homewo
CSCI2312 – Object Oriented Programming  Section 003 HomewoCSCI2312 – Object Oriented Programming  Section 003 Homewo
CSCI2312 – Object Oriented Programming Section 003 Homewosimisterchristen
 
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeGDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeKAI CHU CHUNG
 
Air Travel Analytics in SAS
Air Travel Analytics in SASAir Travel Analytics in SAS
Air Travel Analytics in SASRohan Nanda
 

Similar to Monzor, Carbon-R-a, and the end of the world (20)

big data slides.pptx
big data slides.pptxbig data slides.pptx
big data slides.pptx
 
A Linear Programming Solution To The Gate Assignment Problem At Airport Termi...
A Linear Programming Solution To The Gate Assignment Problem At Airport Termi...A Linear Programming Solution To The Gate Assignment Problem At Airport Termi...
A Linear Programming Solution To The Gate Assignment Problem At Airport Termi...
 
Railway reservation(c++ project)
Railway reservation(c++ project)Railway reservation(c++ project)
Railway reservation(c++ project)
 
Railway reservation(c++ project)
Railway reservation(c++ project)Railway reservation(c++ project)
Railway reservation(c++ project)
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
 
cbse 12 computer science IP
cbse 12 computer science IPcbse 12 computer science IP
cbse 12 computer science IP
 
Flying better
Flying betterFlying better
Flying better
 
cbse 12 computer science investigatory project
cbse 12 computer science investigatory project  cbse 12 computer science investigatory project
cbse 12 computer science investigatory project
 
cbse 12 computer science investigatory project
cbse 12 computer science investigatory project  cbse 12 computer science investigatory project
cbse 12 computer science investigatory project
 
Barbara Nelson [InfluxData] | How Can I Put That Dashboard in My App? | Influ...
Barbara Nelson [InfluxData] | How Can I Put That Dashboard in My App? | Influ...Barbara Nelson [InfluxData] | How Can I Put That Dashboard in My App? | Influ...
Barbara Nelson [InfluxData] | How Can I Put That Dashboard in My App? | Influ...
 
INAC Online Hazards Database App
INAC Online Hazards Database AppINAC Online Hazards Database App
INAC Online Hazards Database App
 
Shortest Path search for real road networks with pgRouting
Shortest Path search for real road networks with pgRoutingShortest Path search for real road networks with pgRouting
Shortest Path search for real road networks with pgRouting
 
Open Data Hub - Gianluca Antonacci - CISMA - From raw traffic data to air pol...
Open Data Hub - Gianluca Antonacci - CISMA - From raw traffic data to air pol...Open Data Hub - Gianluca Antonacci - CISMA - From raw traffic data to air pol...
Open Data Hub - Gianluca Antonacci - CISMA - From raw traffic data to air pol...
 
Map reduce hackerdojo
Map reduce hackerdojoMap reduce hackerdojo
Map reduce hackerdojo
 
Poster
PosterPoster
Poster
 
Scaling Experimentation & Data Capture at Grab
Scaling Experimentation & Data Capture at GrabScaling Experimentation & Data Capture at Grab
Scaling Experimentation & Data Capture at Grab
 
Optimizing the Performance of an Unpredictable UAV Swarm for Intruder Detection
Optimizing the Performance of an Unpredictable UAV Swarm for Intruder DetectionOptimizing the Performance of an Unpredictable UAV Swarm for Intruder Detection
Optimizing the Performance of an Unpredictable UAV Swarm for Intruder Detection
 
CSCI2312 – Object Oriented Programming Section 003 Homewo
CSCI2312 – Object Oriented Programming  Section 003 HomewoCSCI2312 – Object Oriented Programming  Section 003 Homewo
CSCI2312 – Object Oriented Programming Section 003 Homewo
 
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeGDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
 
Air Travel Analytics in SAS
Air Travel Analytics in SASAir Travel Analytics in SAS
Air Travel Analytics in SAS
 

Recently uploaded

Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 

Recently uploaded (20)

Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 

Monzor, Carbon-R-a, and the end of the world

  • 1. It’s all going to be fine Monzo, Carbon-R-a, and the end of the world
  • 2. Who We build mobile products. We are very good at it. Head of Product at Novoda Useless, but at scale I’m a generalist amongst specialists Twitter is killing us all slowly @rynbtmn Github profiles are a poor indicator of your worth as a developer @ryanbateman
  • 4. CarbonR-a An R hack project intended to nudge users to carbon-offset their flights
  • 5. CarbonR-a An R hack project intended to nudge users to carbon-offset their flights This is it. This is the whole thing.
  • 6. CarbonR-a An R hack project intended to nudge users to carbon-offset their flights
  • 7. R A language for data-science, statistical analysis, and graphical visualisation
  • 8. R: example 1 10 years of financial data painstakingly extracted from a legacy bank
  • 9. R: example 2 Histogram of spending by category
  • 10. Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL. R: example 3 Monzo card use density map
  • 11. CarbonR-a An R hack project intended to nudge users to carbon-offset their flights
  • 13. Nudge theory Examples include: • Auto-savings schemes • (Good) app ratings prompts • Political influence campaigns https://www.amazon.co.uk/gp/product/014311526X/
  • 14. CarbonR-a An R hack project intended to nudge users to carbon-offset their flights
  • 15. Carbon offsetting Offsetting of personal carbon emission caused by everyday use through payments to a scheme invested in, for example, renewable energy ~£8 / 1 tonne of carbon See: https://www.myclimate.org/fileadmin/myc/files_myc_perf/12_flight_calculator_documentation_EN.pdf Flight emission kgs = (𝑎𝑥2 + 𝑏𝑥 + 𝑐)/(𝑆 × 𝑃𝐿𝐹) × (1 − 𝐶𝐹) × 𝐶𝑊 × (𝐸𝐹 × 𝑀 + 𝑃) Distance, given fixed take-off/landing cost Avg. Seats x Passenger Load Factor Cargo factor Cabin Class Weighting Fuel type, pre-flight fuel costs
  • 16. CarbonR-a An R hack project intended to nudge users to carbon-offset their flights
  • 17. How? … "notes": "Booking reference L58JJQ", "metadata": { "carrier_code": "OE", "city_of_destination_airport_code": "CFU", "city_of_origin_airport_code": "LHR", "customer_code": "XXXXX", "ledger_insertion_id": "XXXXXXX", "mastercard_auth_message_id": "XXXXXXX", "mastercard_lifecycle_id": "XXXXXXXX", "notes": "Booking reference XXXXXXX", "travel_date": “XXXXXXXX" } … Monzo introduced some flight data recently
  • 18. Callflow MONZOCARBONRA Webhook fires new flight transaction Look up airports’ lat/lon Calculate Haversine distance Calculate carbon emissions Create new feed item
  • 19. How? calculateOffset <- function(startAirport = NULL, endAirport = NULL) { airports <- read.csv("data/airports.csv", sep = ",") airports <- airports[which(airports$iata_code %in% c(startAirport, endAirport)), ] startAirport <- airports[which(airports$iata_code == startAirport), ] endAirport <- airports[which(airports$iata_code == endAirport), ] distance <- distHaversine( c(startAirport$latitude_deg, startAirport$longitude_deg), c(endAirport$latitude_deg, endAirport$longitude_deg) ) costPerKilogram = 0.008 AverageSeatNumber = 158.44 PassengerLoadFactor = 0.77 DetourConstant = 50 InverseCargoFactor = 0.951 EconomyClassWeight = 0.960 EmissionFactor = 3.150 PreProduction = 0.51 Multiplier = 2 a = 0.0000387871 b = 2.9866 c = 1263.42 emissions <- ((a*distance^2 + b*distance + c) / (AverageSeatNumber * PassengerLoadFactor)) * InverseCargoFactor * EconomyClassWeight * (EmissionFactor * Multiplier + PreProduction)
  • 20. How? calculateOffset <- function(startAirport = NULL, endAirport = NULL) { airports <- read.csv("data/airports.csv", sep = ",") airports <- airports[which(airports$iata_code %in% c(startAirport, endAirport)), ] startAirport <- airports[which(airports$iata_code == startAirport), ] endAirport <- airports[which(airports$iata_code == endAirport), ] distance <- distHaversine( c(startAirport$latitude_deg, startAirport$longitude_deg), c(endAirport$latitude_deg, endAirport$longitude_deg) ) costPerKilogram = 0.008 AverageSeatNumber = 158.44 PassengerLoadFactor = 0.77 DetourConstant = 50 InverseCargoFactor = 0.951 EconomyClassWeight = 0.960 EmissionFactor = 3.150 PreProduction = 0.51 Multiplier = 2 a = 0.0000387871 b = 2.9866 c = 1263.42 emissions <- ((a*distance^2 + b*distance + c) / (AverageSeatNumber * PassengerLoadFactor)) * InverseCargoFactor * EconomyClassWeight * (EmissionFactor * Multiplier + PreProduction)
  • 21. How? calculateOffset <- function(startAirport = NULL, endAirport = NULL) { airports <- read.csv("data/airports.csv", sep = ",") airports <- airports[which(airports$iata_code %in% c(startAirport, endAirport)), ] startAirport <- airports[which(airports$iata_code == startAirport), ] endAirport <- airports[which(airports$iata_code == endAirport), ] distance <- distHaversine( c(startAirport$latitude_deg, startAirport$longitude_deg), c(endAirport$latitude_deg, endAirport$longitude_deg) ) costPerKilogram = 0.008 AverageSeatNumber = 158.44 PassengerLoadFactor = 0.77 DetourConstant = 50 InverseCargoFactor = 0.951 EconomyClassWeight = 0.960 EmissionFactor = 3.150 PreProduction = 0.51 Multiplier = 2 a = 0.0000387871 b = 2.9866 c = 1263.42 emissions <- ((a*distance^2 + b*distance + c) / (AverageSeatNumber * PassengerLoadFactor)) * InverseCargoFactor * EconomyClassWeight * (EmissionFactor * Multiplier + PreProduction)
  • 22. How? addItemToFeed(title = cat("Offset your flight to ", dest$name), itembody = cat("Offsetting the flight would cost ", offsetCost), image_url = “https://carbonra.example.com/icon”, background_colour = "#ff00ff") }
  • 23. CarbonR-a …so now what? - use Pots to save for donations? - build item URL for easier donation? - a cause-related nudge program across all transactions? - build an ark? I don’t know.
  • 24. Let’s fucking do something then I’ll be donating £1000 and matching donations up to £3000. Send donation receipt/email to @rynbtmn or ryan.bateman@gmail.com
  • 25. Thanks! Monzor, the R Monzo API library: http://github.com/ryanbateman/monzor Novoda: www.novoda.com Send donation receipt/email to @rynbtmn or ryan.bateman@gmail.com These slides: https://goo.gl/Z24fqR