library(tidyverse)
# Make yard size, the presence/absence of a home garden, and attitudes toward the
# environment all correlated with each other. Home garden will be binary, so I split
# it based on some threshold later. Attitudes toward the environment will be on a
# scale of 1-10, so I rescale and ceiling it later
mu <- c(yard_size = 20000, home_garden = 30, attitude_env = 70)
stddev <- c(yard_size = 10000, home_garden = 15, attitude_env = 40)
π¬
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
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
`<-` <- function(lhs, rhs, envir = parent.frame()) { | |
assign(as.character(substitute(lhs)), rhs, envir) | |
lockBinding(substitute(lhs), envir) | |
invisible(rhs) | |
} |
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
<?php | |
/** | |
* This recipe will redirect you to the levels page after registration | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_redirect_after_register( $user_id ){ |
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
Journal | Total Citations | Citations to Retracted Articles Post Retraction | % of citations to retracted articles | |
---|---|---|---|---|
plos one | 12783331 | 2959 | 0.02% | |
scientific reports | 6295134 | 1227 | 0.02% | |
oncology letters | 802286 | 898 | 0.11% | |
journal of biological chemistry | 10712422 | 866 | 0.01% | |
biomed research international | 1789456 | 806 | 0.05% | |
oncotarget | 1353740 | 791 | 0.06% | |
international journal of molecular sciences | 2380553 | 766 | 0.03% | |
proceedings of the national academy of sciences | 9984417 | 704 | 0.01% | |
molecular medicine reports | 754664 | 646 | 0.09% |
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
#### 1. Sign up at GitHub.com ################################################ | |
## If you do not have a GitHub account, sign up here: | |
## https://github.com/join | |
# ---------------------------------------------------------------------------- | |
#### 2. Install git ########################################################## | |
## If you do not have git installed, please do so: |
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
<?php | |
/** | |
* This recipe adds billing fields to the Membership Profile page. | |
* | |
* It is intended for use with the Register Helper Add On: | |
* https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/ | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. |
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 |
NewerOlder