Skip to content

Instantly share code, notes, and snippets.

View daniel-wells's full-sized avatar

Daniel Wells daniel-wells

View GitHub Profile
@daniel-wells
daniel-wells / list_objects_by_size.R
Created January 11, 2018 18:56
R List objects by size
# data.table version of https://stackoverflow.com/questions/1395270/determining-memory-usage-of-objects
data.table(Size_MB=sapply(ls(),function(x){round(object.size(get(x))/(10^6),2)}), Object=ls())[order(-Size_MB)]
@daniel-wells
daniel-wells / emmoenergy_advert.R
Created January 7, 2018 22:13
Recreation of a barplot used in Emmoenergy advertising
# original advert at https://twitter.com/emmoenergyltd/status/897488236527931392
library(data.table)
library(ggplot2)
data <- data.table(supplier=c(1:10), price=c(18.83, 20.36, 20.83, 18.26, 21.46, 17.66, 22.41, 21.36, 20.23, 9.9))
ggplot(data, aes(supplier, price)) +
geom_col(alpha = 0.5, colour="black") +
ylab("Pence per kWh") +
### Keybase proof
I hereby claim:
* I am daniel-wells on github.
* I am danielwells (https://keybase.io/danielwells) on keybase.
* I have a public key whose fingerprint is EF43 5A53 1FA7 B8A6 2961 7469 E3CE 2D43 84E6 1B5F
To claim this, I am signing this object: