Skip to content

Instantly share code, notes, and snippets.

🍣
Nobody loves you

Hiroaki Yutani yutannihilation

🍣
Nobody loves you
Block or report user

Report or block yutannihilation

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View tidymodels_xgboost_early_stopping.md

Based on the example code on https://www.tidymodels.org/learn/models/parsnip-nnet/

library(tidymodels)
#> ─ Attaching packages ──────────────────────────────────────────── tidymodels 0.1.0 ─
#> ✓ broom     0.5.6          ✓ recipes   0.1.12    
#> ✓ dials     0.0.6          ✓ rsample   0.0.6     
#> ✓ dplyr     0.8.5          ✓ tibble    3.0.1     
#> ✓ ggplot2   3.3.0.9000     ✓ tune      0.1.0     
#> ✓ infer     0.5.1          ✓ workflows 0.1.1     
View arrow_install.sh
cd cpp
mkdir build
cd build
ARROW_BUILD_TOOLCHAIN=/usr ORC_HOME=/usr DOUBLE_CONVERSION_HOME=/usr cmake \
.. -DARROW_DEPENDENCY_SOURCE=SYSTEM \
-DARROW_PYTHON=ON \
-DCMAKE_BUILD_TYPE=Release \
-DARROW_BUILD_TESTS=ON \
-DARROW_ALTIVEC=OFF \
View 和牛.md
library(estatapi)
#> このサービスは、政府統計総合窓口(e-Stat)のAPI機能を使用していますが、サービスの内容は国によって保証されたものではありません。
library(dplyr, warn.conflicts = FALSE)
library(ggplot2)

d <- estat_getStatsData(appId = keyring::key_get("estatapi"), statsDataId = "0003368797")
#> Fetching record 1-2120... (total: 2120 records)

d %>% 
View different_problems.md
library(readr)

bad_df1 <- readr::read_csv("a,b\n1,2\n-,2", col_types = "nn")
#> Warning: 1 parsing failure.
#> row col expected actual         file
#>   2   a a number      - literal data
bad_df2 <- readr::read_csv("a,b\n1,2\n2,-", col_types = "nn")
#> Warning: 1 parsing failure.
#> row col expected actual         file
View delika_client.md
library(httr)

delika_new_jwt <- function() {
  # TODO
  browseURL("https://api.delika.io/v1/auth/token")
}

delika_verb <- function(verb, path, ...) {
  secret <- jsonlite::fromJSON("~/.delika/token.json")
View 東京23区推移0403.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Moved to: https://github.com/yutannihilation/covid19-tokyo-daily-de-facto-population
View chromote_wait_for_error.md
library(chromote)

Sys.setenv(CHROMOTE_CHROME="/usr/bin/chromium")

b <- ChromoteSession$new()
b$Page$navigate("https://www.instagram.com/")
#> $frameId
#> [1] "7A4B060856C628A9F30A449F9F443F42"
#> 
View capture_ggplot2.md
library(ggplot2)
library(rlang)

ggplot <- function(...) {
  f <- function(...) list(clone = f)
  structure(
    list(
      call = sys.call()
    ),
View crash_course_curly_curly.md
library(dplyr, warn.conflicts = FALSE)

# c.f. https://github.com/r-lib/rlang/issues/906
quatro_curly <- function(data, what) {
  data %>% summarise("{{ what }}" := mean({{ what }}))
}
quatro_curly(mtcars, mpg)
#>        mpg
#> 1 20.09062
View caTools-package.diff
diff -uprN caTools_archives/1.17.1.3/man/caTools-package.Rd caTools_archives/1.17.1.4/man/caTools-package.Rd
--- caTools_archives/1.17.1.3/man/caTools-package.Rd 2014-04-21 17:24:51.000000000 +0900
+++ caTools_archives/1.17.1.4/man/caTools-package.Rd 2020-01-14 00:24:16.000000000 +0900
@@ -50,6 +50,7 @@ trapz Trapezoid Rule N
scale="always", comment="Maunga Whau Volcano")
y = read.gif("volcano.gif", verbose=TRUE, flip=TRUE)
image(y$image, col=y$col, main=y$comment, asp=1)
+ file.remove("volcano.gif")
# test runmin, runmax and runmed
You can’t perform that action at this time.