在游猴中新建一个脚本,然后在头部信息中引用外部文件即可(前提是在Chrome的游猴插件中设置了允许插件访问本地文件
后)。
// @require file:/*.js
R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out" | |
Copyright (C) 2020 The R Foundation for Statistical Computing | |
Platform: x86_64-apple-darwin17.0 (64-bit) | |
R is free software and comes with ABSOLUTELY NO WARRANTY. | |
You are welcome to redistribute it under certain conditions. | |
Type 'license()' or 'licence()' for distribution details. | |
Natural language support but running in an English locale |
shim_system_file <- function(package) { | |
imports <- parent.env(asNamespace(package)) | |
pkgload:::unlock_environment(imports) | |
imports$system.file <- pkgload:::shim_system.file | |
} | |
shim_system_file("htmlwidgets") | |
shim_system_file("htmltools") | |
# After the code above has been run, you can load an in-development package |
Nothing |
library(tabulizer) | |
library(data.table) | |
library(purrr) | |
location <- "https://www.mhlw.go.jp/content/10900000/000626159.pdf" | |
out <- extract_tables(location) | |
final <- do.call(rbind, out[length(out)]) | |
dt <- data.table(final) |
signateDetail<- fread(paste0(DATA_PATH, 'SIGNATE COVID-2019 Dataset - 罹患者.csv'), header = T) | |
signateDetail$公表日 <- as.Date(signateDetail$公表日) | |
signateDetail[, 受診都道府県 := gsub('県', '', 受診都道府県)] | |
signateDetail[, 受診都道府県 := gsub('府', '', 受診都道府県)] | |
signateDetail[, 受診都道府県 := gsub('東京都', '東京', 受診都道府県)] | |
signateDetail[, regionId := paste0(都道府県コード, '-', 都道府県別罹患者No)] | |
oldYear <- c('0 - 9', '10 - 19', '20 - 29', '30 - 39', '40 - 49', '50 - 59', '60 - 69', '70 - 79', '80 - 89', '-90', '非公表', '', NA) | |
newYear <- c(10, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 100, 100) | |
names(oldYear) <- newYear |
// go on you labels pages | |
// eg https://github.com/cssnext/cssnext/labels | |
// paste this script in your console | |
// copy the output and now you can import it using https://github.com/popomore/github-labels ! | |
var labels = []; | |
[].slice.call(document.querySelectorAll(".label-link")) | |
.forEach(function(element) { | |
labels.push({ | |
name: element.textContent.trim(), |
These rules are adopted from the AngularJS commit conventions.
file <- list.files() | |
file <- file[grepl("(.ass)|(.ASS)|(.srt)|(.SRT)$", file)] | |
if (length(file) > 0) { | |
output <- sapply(file, function(x) { | |
text <- readLines(x, encoding = "UTF-8") | |
if(grepl(pattern = "(.srt)|(.SRT)$", x = x)) { | |
text.1 <- strsplit(x = paste0(text, collapse = "&"), split = "&&") | |
text <- gsub("&", " ", text.1[[1]]) |
calMAValue <- function(data, data.cl){ | |
group <- levels(factor(data.cl)) | |
if (length(group) == 2) { | |
#遺伝子ごとにG1群とG2の平均の対数を計算した結果 | |
mean_G1 <- log2(apply(as.matrix(data[,data.cl==group[1]]), 1, mean)) | |
mean_G2 <- log2(apply(as.matrix(data[,data.cl==group[2]]), 1, mean)) | |
#「G1群の平均値」と「G2群の平均値」の平均をとったものがM-A plotのA(x軸の値)に相当する | |
x_axis <- (mean_G1 + mean_G2)/2 | |
#いわゆるlog比(logの世界での引き算)がM-A plotのM(y軸の値)に相当する | |
y_axis <- mean_G2 - mean_G1 |