47 total open issues
Thanks for these composite maps and tools, very useful! I sometimes get requests for including Puerto Rico on Albers USA composite maps. I’m not sure if there’s a more official way to represent this, maybe something like https://bl.ocks.org/mbostock/5629120? Could this be added to counties_sf
and state_sf
?
Moving the discussion started in #10 to here. Some examples of using the Unix socket API using curl
:
library(curl)
library(jsonlite)
library(openssl)
docker_auth <- function(username=Sys.getenv("DOCKER_USERNAME"),
password=Sys.getenv("DOCKER_PASSWORD"),
email=Sys.getenv("DOCKER_EMAIL"),
server_address=Sys.getenv("DOCKER_REGISTRY"),
encode=TRUE) {
toJSON(
list(
username=unbox(username),
password=unbox(password),
email=unbox(email),
auth=unbox(""),
serveraddress=unbox(server_address)
)
) -> auth_json
if (encode) auth_json <- openssl::base64_encode(auth_json)
auth_json
}
docker_handle <- function(verbose=FALSE) {
h <- curl::new_handle()
h <- curl::handle_reset(h)
h <- curl::handle_setopt(h, UNIX_SOCKET_PATH = "/var/run/docker.sock")
h <- curl::handle_setopt(h, VERBOSE = verbose)
h <- curl::handle_setheaders(h,
`Content-Type` = "application/json",
`X-Registry-Auth` = docker_auth())
h
}
# Auth check ------------------------------------------------------------------------
h <- docker_handle(TRUE)
handle_setopt(h, copypostfields = docker_auth(encode=FALSE))
res <- curl_fetch_memory(url = "http://v1.26/auth", handle = h)
str(fromJSON(rawToChar(res$content)))
# Docker info -----------------------------------------------------------------------
h <- docker_handle()
res <- curl_fetch_memory(url = "http://v1.26/info", handle = h)
str(fromJSON(rawToChar(res$content)))
# Docker version --------------------------------------------------------------------
h <- docker_handle()
res <- curl_fetch_memory(url = "http://v1.26/version", handle = h)
str(fromJSON(rawToChar(res$content)))
# Docker ping -----------------------------------------------------------------------
h <- docker_handle()
res <- curl_fetch_memory(url = "http://v1.26/_ping", handle = h)
cat(rawToChar(res$content))
# Data usage ------------------------------------------------------------------------
h <- docker_handle()
res <- curl_fetch_memory(url = "http://v1.26/system/df", handle = h)
str(fromJSON(rawToChar(res$content)))
# List images -----------------------------------------------------------------------
h <- docker_handle()
res <- curl_fetch_memory(url = "http://v1.26/images/json", handle = h)
str(fromJSON(rawToChar(res$content)))
# Search images ---------------------------------------------------------------------
h <- docker_handle()
res <- curl_fetch_memory(url = "http://v1.26/images/search?term=alpine&limit=10", handle = h)
str(fromJSON(rawToChar(res$content)))
# Pull an image ---------------------------------------------------
h <- docker_handle(verbose = TRUE)
handle_setopt(h, copypostfields = '')
res <- curl_fetch_memory(url = "http://v1.26/images/create?fromImage=alpine&tag=latest", handle = h)
cat(rawToChar(res$content))
# List running containers -----------------------------------------------------------
h <- docker_handle()
res <- curl_fetch_memory(url = "http://v1.26/containers/json", handle = h)
str(fromJSON(rawToChar(res$content)))
# all: true/false
# limit: int
# size: true/false
# filters: json
h <- docker_handle()
res <- curl_fetch_memory(url = "http://v1.26/containers/json", handle = h)
str(fromJSON(rawToChar(res$content)))
# Inspect a container ---------------------------------------------------------------
# size: true/false
h <- docker_handle(verbose = TRUE)
res <- curl_fetch_memory(url = "http://v1.26/containers/b834259b9e9ed70cd00a43c9a539ab0601dab68a5966e531fea76ec91bc76940/json", handle = h)
str(fromJSON(rawToChar(res$content)))
# List container processes ----------------------------------------------------------
# ps_args: string
h <- docker_handle(verbose = TRUE)
res <- curl_fetch_memory(url = "http://v1.26/containers/b834259b9e9ed70cd00a43c9a539ab0601dab68a5966e531fea76ec91bc76940/top", handle = h)
str(fromJSON(rawToChar(res$content)))
# Get container logs ----------------------------------------------------------------
# follow: true/false
# stdout: t/f
# stderr: r/f
# since: int
# timestamps: t/f
# tail: string
h <- docker_handle(verbose = TRUE)
res <- curl_fetch_memory(url = "http://v1.26/containers/b834259b9e9ed70cd00a43c9a539ab0601dab68a5966e531fea76ec91bc76940/logs?stdout=true&stderr=true", handle = h)
cat(rawToChar(res$content[res$content > 0x09]))
# Run a container -------------------------------------------------------------------
h <- docker_handle()
handle_setopt(h, copypostfields = '{"Image": "alpine", "Cmd": ["echo", "hello world"]}')
res <- curl_fetch_memory(url = "http:/v1.26/containers/create", handle = h)
str(fromJSON(rawToChar(res$content)))
Hi, Following the instructions reported on this blog post, I got stuck when executing install_splash(). The provided error is the following one: Error in sys::exec_internal(docker, args = args, error = TRUE) : Executing '/usr/bin/docker' failed with status 1
despite the fact that I can definitely execute docker by typing /usr/bin/docker
or even only docker
in the terminal. My OS is Ubuntu 16.04.2 LTS.
It would be cool to group geom_lollipop
s by different aesthetics and position them side-by-side. Right now it ignores position
as a parameter, which makes sense—there’s not really a way to do position_stack
or other positioning algorithms with lollipop plots. However, lollipop plots can be dodged.
This can be done by setting xmin=0
in ggstance::geom_pointrangeh
, but it would be nice to have control over the line color and point color and size separately, as in geom_lollipop
:
library(tidyverse)
library(ggalt)
library(ggstance)
set.seed(1234)
df <- crossing(trt = LETTERS[1:6],
grp = LETTERS[7:8]) %>%
mutate(x = sample(10:90, n()))
ggplot(df, aes(y=trt, x=x, colour=grp)) +
geom_lollipop(horizontal=TRUE, position="dodge")
#> Warning: Ignoring unknown parameters: position
ggplot(df, aes(y=trt, x=x, colour=grp)) +
geom_pointrangeh(aes(xmin=0, xmax=x), position=position_dodgev(height=0.5))