I hereby claim:
- I am tylurp on github.
- I am tylerlittlefield (https://keybase.io/tylerlittlefield) on keybase.
- I have a public key ASAByebDxEEy2klT8b0ma-K6rmx7jt590Ns1wzltKBqhgAo
To claim this, I am signing this object:
| library(echarts4r) | |
| library(magrittr) | |
| les <- jsonlite::fromJSON("https://gist.githubusercontent.com/tyluRp/0d7a53f2a1f55cb3c6ffe22c67618267/raw/0684a839c3e49dac1157721ddd906eff8f9491d4/les-miserables.json") | |
| e_charts() %>% | |
| e_graph( | |
| layout = "circular", | |
| circular = list( | |
| rotateLabel = TRUE |
| /** | |
| * Plugin: "preserve_search" (selectize.js) | |
| * Based on: "preserve_on_blur" of Eric M. Klingensmith | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this | |
| * file except in compliance with the License. You may obtain a copy of the License at: | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software distributed under | |
| * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF |
I hereby claim:
To claim this, I am signing this object:
| library(lubridate) | |
| library(dplyr) | |
| scheduler <- function(day = "monday", n_weeks = 2) { | |
| x <- data.frame(date = seq.Date(as.Date("2021-01-01"), as.Date("2050-01-01"), by = "day")) | |
| x$week <- ceiling(lubridate::week(x$date) / n_weeks) | |
| x$day <- tolower(as.character(lubridate::wday(x$date, abbr = FALSE, label = TRUE))) | |
| suppressWarnings({ | |
| x[x$day %in% day, ] %>% |
| # install.packages('fivethirtyeightdata', repos = 'https://fivethirtyeightdata.github.io/drat/', type = 'source') | |
| # install.packages("fivethirtyeight") | |
| # connect | |
| con <- DBI::dbConnect(odbc::odbc(), "fivethirtyeight") | |
| # get dataset names from each package | |
| x <- tibble::as_tibble(data(package = "fivethirtyeight")$results) | |
| y <- tibble::as_tibble(data(package = "fivethirtyeightdata")$results) |
| compartment <- function(title, ...) { | |
| container_css <- stringr::str_squish( | |
| "border: 3px solid orange; | |
| position: relative; | |
| border-radius: 8px; | |
| padding-top: 20px; | |
| font-family: 'Fira Sans', sans-serif; | |
| margin-top: 25px; | |
| margin-bottom: 25px;" | |
| ) |
| { | |
| "text": "ACME, Inc. Org Chart", | |
| "nodeTypeToStyle": { | |
| "root": ["color1", "strong"], | |
| "1stlevel": ["color2"], | |
| "2ndlevel": ["color3"], | |
| "3rdlevel": ["color4"], | |
| "4thlevel": ["color5"] | |
| }, | |
| "linkToPosition": { |
| compare <- function(x, y) { | |
| list( | |
| "These values are in X but not Y" = setdiff(x, y), | |
| "These values are in Y but not X" = setdiff(y, x), | |
| "These values are shared between X and Y" = intersect(x, y), | |
| "Combined, X and Y returns these values" = union(x, y) | |
| ) | |
| } |
| library(rlang) | |
| library(dplyr) | |
| #> | |
| #> Attaching package: 'dplyr' | |
| #> The following objects are masked from 'package:stats': | |
| #> | |
| #> filter, lag | |
| #> The following objects are masked from 'package:base': | |
| #> | |
| #> intersect, setdiff, setequal, union |
| library(stringr) | |
| library(dplyr) | |
| library(purrr) | |
| library(rlang) | |
| library(text2vec) # for movie reviews data | |
| # favor stringr over base R because stringr handles NAs whereas base R returns | |
| # zero length, base R below: | |
| # regmatches(string, regexpr(x, string, ignore.case = ignore_case)) | |
| pattern_context <- function(string, pattern, n_before = 10, n_after = 10, |