Skip to content

francisbarton/myrmidon

Repository files navigation

myrmidon

R-CMD-check

Personal functions and templates, from the whimsical to the useful to the rather experimental.

The Myrmidons of Greek myth were known for their loyalty to their leaders, so that in pre-industrial Europe the word "myrmidon" carried many of the same connotations that "robot" does today. wikipedia

Myrmidon cartoon by Horacio Gonzalez. A

Myrmidon cartoon – represented as a half-ant, half-human warrior creature – by Horacio Gonzalez.

What do ants best represent in the cosmos? [Carol] Anelli reports [E.O.] Wilson insisting that they "do it all" and dominate on a number of fronts. They are exceedingly diverse -- predators, farmers, architects -- and are highly social. Delahoyde & Hughes, 2008

Functions

Some useful functions you will find in here:

  • postcode_data_join: Get postcode data from postcodes.io and join it to an existing df
  • batch_it: Turn a vector into a batched list
  • patch_join: (AKA coalesce join) Join 2 data frames, using values in y to patch NAs in x
  • project_mascot: Get a cute emoji mascot for your latest project - or even just for your current R session
  • reprex_to_gist: Send reprex code and output to a new GH gist (based on Mickaël Canouil's code here)
  • save_it: Wrapper for saveRDS - a quick way to save an object to an Rds file
  • extract_col_types: A helper for the col_types argument to readr::read_csv() and similar
  • hcl_msoa_names: A simple function to get the latest House of Commons Library MSOA Names
  • commonest: a function that returns the mode (most common value) from a vector
  • gmaps_to_sf: Convert Google Maps lat-lon Data to a Geospatial sf object
  • year_dates: Create vectors of dates for one or more years (and/or months)
  • bbox_to_poly: Convert a bbox to an sf geospatial polygon (rectangle)

Examples

postcode_data_join

postcodes <- c("HD1 2UT", "HD1 2UU", "HD1 2UV")
test_df1 <- dplyr::tibble(place = paste0("place_", 1:3), postcode = postcodes)
postcode_data_join(test_df1)

HTML5 RMarkdown template

details, details, details...

About

A package containing functions I want to have available most times I start up R, as well as my own HTML5 RMarkdown template.

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks