This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## transform the input to the output using rubiks-cube transformations and dplyr | |
require(dplyr) | |
## provided input | |
input <- data.frame(matrix(c("h","a","t","t","i","v","i","g","k","s","g","n","n","g","n","i"), | |
4, | |
4, | |
byrow=TRUE, | |
dimnames=list(NULL,paste0("col",1:4))), | |
stringsAsFactors=FALSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## libraries used to create these maps | |
library(maps) ## world.cities data | |
library(dplyr) ## group_by(), summarise(), and imported %>% | |
library(ggplot2) ## plotting | |
## the raw data | |
## `citation("maps")` | |
data("world.cities") | |
## limit the data to the latitude, lonitude, and population |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setwd("WORKINGDIRECTORY") | |
library(png) ## split .png into component matrices | |
library(RSAGA) ## grid.to.xyz, load before dplyr | |
library(dplyr) ## group_by(), summarise(), %>% | |
library(ggplot2) ## plotting | |
library(ggExtra) ## ggMarginal | |
## load the .png file | |
img <- png::readPNG("file10a566a2b4dc3.png") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# myAPIkey <- "PlAcEyOuRkEyHeRe" | |
library(ggplot2) | |
library(ggmap) | |
library(ggthemes) | |
library(png) | |
library(grid) | |
library(RCurl) | |
findXnearY <- function(X = "coffee", # default: coffee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 52vis challenges, week 2 | |
## originally seen at | |
## https://rud.is/b/2016/04/06/52vis-week-2-2016-week-14-honing-in-on-the-homeless/ | |
## this version blogged @ http://jcarroll.com.au/2016/04/10/52vis-week-2-challenge/ | |
## github: github.com/jonocarroll/2016-14 | |
## This script produces a choropleth for the USA homeless population | |
## as a per mille proportion of each state's population, with the | |
## colorscale set to white at the national median, blue at the | |
## lowest value, and capped at 3x the national median in red. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 52vis challenges, week 2 -- adapted for Australian statistics | |
## otherwise follows procedures found at | |
## github.com/jonocarroll/2016-14 | |
## http://jcarroll.com.au/2016/04/10/52vis-week-2-challenge/ | |
## this version blogged @ http://jcarroll.com.au/2016/04/12/australian-homeless/ | |
## This script produces a chloropleth for the Australian homeless population | |
## as a per mille proportion of each state's population, with the | |
## colorscale set to the same as the USA homeless graph (white at the national | |
## median, blue at the lowest value, and capped at 3x the national median in red). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Inspired by http://www.milanor.net/blog/how-to-sort-a-list-of-dataframes-in-r/ | |
## as seen on R-bloggers http://www.r-bloggers.com/how-to-sort-a-list-of-dataframes/ | |
## | |
## Blogged @ http://jcarroll.com.au/2016/04/14/simpler-isnt-always-faster/ | |
## | |
## input data.frame | |
df_list_in <- list ( | |
df_1 = data.frame(x = 1:5, y = 5:1), | |
df_2 = data.frame(x = 6:10, y = 10:6), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Create a world timezone map of the #auunconf slack users' timezones | |
## data extracted via hrbrmstr/slackr | |
## Timezone shapefile: http://efele.net/maps/tz/world/ | |
## | |
## Blogged @ http://jcarroll.com.au/2016/04/14/slack-timezones/ | |
## load relevant packages | |
pacman::p_load(rgdal, maptools, ggplot2) | |
pacman::p_load(ggthemes, albersusa, ggalt) | |
pacman::p_load(extrafont) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Optimising an expression subject to inequality constriaints | |
## as seen on | |
## http://fivethirtyeight.com/features/you-have-1-billion-to-win-a-space-race-go/ | |
## https://xianblog.wordpress.com/2016/04/21/an-integer-programming-riddle/ | |
## http://www.r-bloggers.com/an-integer-programming-riddle/ | |
## Blogged @ http://jcarroll.com.au/2016/04/27/solving-inequality-the-math-kind/ | |
## The expression to optimise: | |
## 200a + 100b + 50c + 25d | |
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bob Rudis | |
# @hrbrmstr | |
# Lazy cyber tweet: what prod/dev has this port combo? | |
# 110,111,143,21,22,23,25,3389,389,443,465,587,5900,8080,8081,8443,8888,9100,990,993,995 | |
# install.packages("rvest") | |
library(rvest) | |
html <- read_html("https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers") | |
ports1 <- html_table(html_nodes(html, "table")[5])[[1]] |
OlderNewer