π¬
This file contains hidden or 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
| import pandas as pd | |
| import torch | |
| import h5py | |
| from openslide import OpenSlide | |
| import os | |
| import numpy as np | |
| from joblib import Parallel, delayed | |
| from features import extract_features_single_tile | |
| import json | |
| from scipy.stats import mannwhitneyu |
This file contains hidden or 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
| error404 = paste0( | |
| "<!DOCTYPE html>", | |
| "<html lang=\"en\">", | |
| "<head>", | |
| " <meta charset=\"UTF-8\">", | |
| " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">", | |
| " <title>Resources not found</title>", | |
| "</head>", | |
| "<body>", | |
| " <div class=\"main\">", |
This file contains hidden or 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
| #!/usr/bin/env Rscript | |
| library(httr, include.only = c("GET", "add_headers", "content")) | |
| library(jsonlite, include.only = c("fromJSON", "write_json")) | |
| library(glue, include.only = c("glue")) | |
| GITHUB_TOKEN <- Sys.getenv("GITHUB_TOKEN") | |
| JSON_FILE <- "webr-experiments.json" | |
| HTML_FILE <- "webr-experiments/index.html" |
This file contains hidden or 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
| plaka | il_adi | lat | lon | northeast_lat | northeast_lon | southwest_lat | southwest_lon | |
|---|---|---|---|---|---|---|---|---|
| 1 | ADANA | 37.00000000 | 35.32133330 | 37.07200400 | 35.46199500 | 36.93552300 | 35.17470600 | |
| 2 | ADIYAMAN | 37.76416670 | 38.27616670 | 37.82566700 | 38.33546500 | 37.71708600 | 38.18818800 | |
| 3 | AFYONKARAHΔ°SAR | 38.76376000 | 30.54034000 | 38.80210500 | 30.61116700 | 38.71428900 | 30.44232000 | |
| 4 | AΔRI | 39.72166670 | 43.05666670 | 39.74860500 | 43.08524100 | 39.68814400 | 43.00177800 | |
| 5 | AMASYA | 40.65000000 | 35.83333330 | 40.67283400 | 35.85632100 | 40.63691100 | 35.78909100 | |
| 6 | ANKARA | 39.92077000 | 32.85411000 | 40.10098100 | 33.02486600 | 39.72282100 | 32.49909700 | |
| 7 | ANTALYA | 36.88414000 | 30.70563000 | 36.97517800 | 30.84095300 | 36.78586600 | 30.51609500 | |
| 8 | ARTVΔ°N | 41.18333330 | 41.81666670 | 41.20707800 | 41.85479900 | 41.15541500 | 41.77736100 | |
| 9 | AYDIN | 37.84440000 | 27.84580000 | 37.87099700 | 27.88535500 | 37.81957300 | 27.79052200 |
This file contains hidden or 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
| library(dplyr) | |
| library(ggplot2) | |
| library(patchwork) | |
| library(ggiraph) | |
| dat <- gapminder::gapminder |> | |
| janitor::clean_names() |> | |
| mutate( | |
| # ID that is shared for boxplots (this one uses factors, i.e. numbers, as ID instead of continents) |
This file contains hidden or 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
| # a combination of | |
| # https://stackoverflow.com/questions/1815606/determine-path-of-the-executing-script/15373917#15373917 | |
| # https://stackoverflow.com/questions/1815606/determine-path-of-the-executing-script/7585599#7585599 | |
| # https://stackoverflow.com/questions/47044068/get-the-path-of-current-script/47045368#47045368 | |
| # https://stackoverflow.com/questions/53512868/how-to-automatically-include-filepath-in-r-markdown-document/53516876#53516876 | |
| stub <- function() {} | |
| thisPath <- function() { | |
| cmdArgs <- commandArgs(trailingOnly = FALSE) | |
| if (length(grep("^-f$", cmdArgs)) > 0) { | |
| # R console option |
This file contains hidden or 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
| check_rproj_dupes <- function() { | |
| os <- .Platform$OS.type | |
| if (os == "unix") { | |
| ps_out <- system("ps -e", intern = TRUE) | |
| ps_rproj <- ps_out[grepl(".Rproj", ps_out)] | |
| ps_split <- strsplit(ps_rproj, "\\s") | |
| rproj_paths <- lapply(ps_split, function(x) x[grepl(".Rproj$", x)]) |
This file contains hidden or 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
| library(tidyverse) | |
| color_palette <- thematic::okabe_ito(8) | |
| flights <- nycflights13::flights | |
| counts <- flights %>% | |
| mutate( | |
| date = lubridate::make_date(year = year, month = month, day = day) | |
| ) %>% | |
| count(date) %>% | |
| mutate( |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script> | |
| var data | |
| var formId = 'form' | |
| function drawForm() { | |
| if (!data) return | |
| var outputEl = document.getElementById(formId); |
This file contains hidden or 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
| <div style="font-family: sans-serif;"> | |
| <? var data = valid(); ?> | |
| <form id="form" name="form"> | |
| <? if(Object.prototype.toString.call(data) === '[object Array]') { ?> | |
| <? for (var i = 0; i < data.length; i++) { ?> | |
| <? for (var j = 0; j < data[i].length; j++) { ?> | |
| <input type="checkbox" id="ch<?= '' + i + j ?>" name="ch<?= '' + i + j ?>" value="<?= data[i][j] ?>"><?= data[i][j] ?><br> | |
| <? } ?> | |
| <? } ?> | |
| <? } else { ?> |
NewerOlder