commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
cfdf6e9e6a715fc0625879ee95cfae2ccea0dc38 | check hg38 db exists | shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl | lib/QC/ChipseqQC.r | lib/QC/ChipseqQC.r | options(bitmapType='cairo')
options(expressions=102400)
args = commandArgs(trailingOnly = TRUE)
library(ChIPQC)
configFile=args[1]
annotationName=args[2]
chromosomes=args[3]
if (annotationName == "hg38") {
library(TxDb.Hsapiens.UCSC.hg38.knownGene)
}
cat("configFile=", configFile, "\n")
cat("annotationName=", an... | options(bitmapType='cairo')
options(expressions=102400)
args = commandArgs(trailingOnly = TRUE)
library(ChIPQC)
configFile=args[1]
annotationName=args[2]
chromosomes=args[3]
cat("configFile=", configFile, "\n")
cat("annotationName=", annotationName, "\n")
cat("chromosomes=", chromosomes, "\n")
rdatafile = paste0(c... | apache-2.0 | R |
aa75c91dae246d3ba6510db67a5c19e00872cd3c | add width, height | shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl | lib/scRNA/seurat_bubblemap_multires.r | lib/scRNA/seurat_bubblemap_multires.r | rm(list=ls())
outFile='PL_7114_human'
parSampleFile1='fileList1.txt'
parSampleFile2='fileList2.txt'
parSampleFile3=''
parFile1='C:/projects/nobackup/h_turner_lab/shengq2/20220805_7114_scRNA_human/seurat_sct_harmony_multires_03_choose/result/PL_7114_human.final.rds'
parFile2=''
parFile3=''
setwd('C:/projects/nobackup... | #rm(list=ls())
outFile='PL_7114_human'
parSampleFile1='fileList1.txt'
parSampleFile2='fileList2.txt'
parSampleFile3=''
parFile1='C:/projects/nobackup/h_turner_lab/shengq2/20220805_7114_scRNA_human/seurat_sct_harmony_multires_03_choose/result/PL_7114_human.final.rds'
parFile2=''
parFile3=''
setwd('C:/projects/nobacku... | apache-2.0 | R |
6a1b6dea6acbe640155496fe2a095209ac594996 | 更新:第七章fig7-12 | shuaimeng/r | thesis/chap7/fig7-12.r | thesis/chap7/fig7-12.r | dyn.load('/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/server/libjvm.dylib')
library(rJava)
setwd("/Users/mengmengjiang/all datas/print")
library(xlsx)
# reading ux and sy
k1<-read.xlsx("doty.xlsx",sheetName="600",header=TRUE)
k2<-read.xlsx("doty.xlsx",sheetName="1khz",header=TRUE)
k3<-r... | mit | R | |
ea27ae5e5d0b16d3b5019950a38f685055996544 | Update libraries.r | GalDrnovsek/APPR-2015-16 | lib/libraries.r | lib/libraries.r | library(knitr)
library(dplyr)
library(rvest)
library(gsubfn)
library(ggplot2)
library(sp)
library(maptools)
library(digest)
# Uvozimo funkcije za delo z datotekami XML.
source("lib/xml.r", encoding = "UTF-8")
# Uvozimo funkcije za pobiranje in uvoz zemljevida.
source("lib/uvozi.zemljevid.r", encoding = "UTF-8")
| library(knitr)
require(dplyr)
require(rvest)
require(gsubfn)
require(ggplot2)
# Uvozimo funkcije za delo z datotekami XML.
source("lib/xml.r", encoding = "UTF-8")
# Uvozimo funkcije za pobiranje in uvoz zemljevida.
source("lib/uvozi.zemljevid.r", encoding = "UTF-8")
| mit | R |
09f31b9f2554a6e24781a4c7d6fca714e6fa3573 | Update function | Nektar-io/LvWS | R/api-methods.r | R/api-methods.r | library(XML)
library(httr)
# General methods
fetch_data <- function(path, query, nodes) {
url <- modify_url(url = .url,
path = file.path(.path, path),
query = query
)
get_xml(url, nodes)
}
get_xml <- function(url, nodes) {
x <- paste(readLines(url, warn = FA... | library(XML)
library(httr)
# General methods
fetch_data <- function(path, query) {
url <- modify_url(url = .url,
path = file.path(.path, path),
query = query
)
get_xml(url)
}
get_xml <- function(url) {
xml <- paste(readLines(url, warn = FALSE), collapse="")
... | agpl-3.0 | R |
b030865e1f95d2fb6a82225d2fca2c988940c7c3 | Use hashing for more efficient lookup | klmr/codons,klmr/codons | scripts/cache.r | scripts/cache.r | decorate = modules::import('decorate', attach = TRUE)
modules::import('ebits/base', attach = c('closure', 'match_call_defaults'))
# FIXME: Doesn’t work with recursive functions
# Reproduce: fib = .cache %@% function (n) if (n < 2) 1 else fib(n - 1) + fib(n - 2)
# Suspicion: somehow, the state of the function is shared... | decorate = modules::import('decorate', attach = TRUE)
modules::import('ebits/base', attach = c('closure', 'match_call_defaults'))
# FIXME: Doesn’t work with recursive functions
# Reproduce: fib = .cache %@% function (n) if (n < 2) 1 else fib(n - 1) + fib(n - 2)
# Suspicion: somehow, the state of the function is shared... | apache-2.0 | R |
0df84ce03fada9d5c115143d52091f7c6517fbf9 | Fix printing multiple lines of output from one cell | rgbkrk/IRkernel,gdtm86/IRkernel,elaOnMars/IRkernel,ibm-et/IRkernel,JanSchulz/IRkernel,mikecroucher/IRkernel,ibm-et/IRkernel,ChinaQuants/IRkernel,Phobia0ptik/IRkernel,chendaniely/IRkernel | R/execution.r | R/execution.r | Executor = setRefClass("Executor",
fields=c("execution_count", "userenv", "kernel"),
methods = list(
execute = function(request) {
send_response = kernel$send_response
send_response("status", request, 'iopub', list(execution_state="busy"))
send_response("pyin", request, 'iopub',
... | Executor = setRefClass("Executor",
fields=c("execution_count", "userenv", "kernel"),
methods = list(
execute = function(request) {
send_response = kernel$send_response
send_response("status", request, 'iopub', list(execution_state="busy"))
send_response("pyin", request, 'iopub',
... | mit | R |
0705ba19113b5dfea86530145a3bf5985fcad760 | add tidyverse R package | felipenoris/math-server-docker,felipenoris/math-server-docker,felipenoris/AWSFinance,felipenoris/AWSFinance | libs/r-packages.r | libs/r-packages.r |
pkgs <- c(
"alabama",
"base64enc",
"bootStepAIC",
"caret",
"cubature",
"data.table",
"DEoptim",
"devtools",
"doParallel",
"doSNOW",
"dplyr",
"dyn",
"dynlm",
"extrafont",
"feather",
"fAsianOptions",
"fAssets",
"fBasics",
"fBonds",
"fCopulae",
"fExoticOptions",
"fExtremes",
"fGarch",
"fImport",
... |
pkgs <- c(
"alabama",
"base64enc",
"bootStepAIC",
"caret",
"cubature",
"data.table",
"DEoptim",
"devtools",
"doParallel",
"doSNOW",
"dplyr",
"dyn",
"dynlm",
"extrafont",
"feather",
"fAsianOptions",
"fAssets",
"fBasics",
"fBonds",
"fCopulae",
"fExoticOptions",
"fExtremes",
"fGarch",
"fImport",
... | mit | R |
bf478fe9802e18c0590857b3d517019562b2f56f | Install cowplot from github | berkeley-dsep-infra/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub | deployments/r/image/extras.d/ph-142.r | deployments/r/image/extras.d/ph-142.r | #!/usr/bin/env Rscript
# From https://github.com/berkeley-dsep-infra/datahub/issues/881
print("Installing packages for PH142")
source("/tmp/class-libs.R")
class_name = "PH142"
class_libs = c(
"fGarch", "3042.83.1",
"SASxport", "1.6.0",
"googlesheets", "0.3.0",
"googledrive", "0.1.3",
"ggrepel", "... | #!/usr/bin/env Rscript
# From https://github.com/berkeley-dsep-infra/datahub/issues/881
print("Installing packages for PH142")
source("/tmp/class-libs.R")
class_name = "PH142"
class_libs = c(
"fGarch", "3042.83.1",
"SASxport", "1.6.0",
"googlesheets", "0.3.0",
"googledrive", "0.1.3",
"ggrepel", "... | bsd-3-clause | R |
265e59edca441cab68a117d709616e09a5f0f232 | use built-in interpolation | sushilashenoy/zoom.plot | R/extend_color_range.r | R/extend_color_range.r | #' @export
extend.color.range <- function(colors, n, weight=rep(1, length(colors)-1)) {
if ( n < length(colors) ) return ( colors )
if ( length(weight) != length(colors)-1 ) stop('Must be one fewer weights than colors.')
red.part <- strtoi(paste('0X', substring(colors, 2, 3), sep=''))/2^8
grn.part <- strtoi(... |
# Function to print out maximum intervals where vec==1
find.intervals <- function(vec) {
ints <- NULL
j <- 1
n <- length(vec)
for ( k in 1:sum(vec) ) {
i <- which.max(vec[j:n])+j-1
j <- which.min(vec[i:n])+i-1
if ( i == j )
break
ints <- rbind(ints, c(i, j-1))
}
if ( vec[n]... | mit | R |
0d74f66fd904e2e0ee8ef5606f79c4088e3c61d2 | Fix stupid errors | hadley/crantastic,tenforwardconsulting/crantastic,tenforwardconsulting/crantastic,hadley/crantastic,tenforwardconsulting/crantastic,tenforwardconsulting/crantastic,hadley/crantastic | lib/r/db.r | lib/r/db.r | suppressMessages(require(RSQLite, quiet=TRUE))
FILE <- (function() {
attr(body(sys.function()), "srcfile")
})()$filename
PATH <- normalizePath(dirname(FILE))
dbpath <- normalizePath(file.path(PATH, "/../../db/"))
if (Sys.info()["nodename"] == "hadley") {
dbname <- "production.sqlite3"
} else {
dbname <- "devel... | suppressMessages(require(RSQLite, quiet=TRUE))
FILE <- (function() {
attr(body(sys.function()), "srcfile")
})()$filename
PATH <- normalizePath(dirname(FILE))
dbpath <- normalizePath(file.path(PATH, "/../../db/"))
if (Sys.info()$["nodename"] == "hadley") {
dbname <- "production.db"
} else {
dbname <- "developme... | mit | R |
16f01edc2a5925cce242ef581c7d1d565c8e3f59 | Update the version to 3.1 | zsx/r3,zsx/r3,zsx/r3,zsx/r3 | src/boot/version.r | src/boot/version.r | 3.1.0.3.1
| 3.0.99.3.1
| apache-2.0 | R |
876df3b6d5945209d9ce7e5162e3528b5ead68d0 | correct tests | khufkens/phenor | tests/testthat/test_data_downloads.r | tests/testthat/test_data_downloads.r | # Phenor unit tests
# test all data downloads
test_that("test data downloads",{
# download npn data
npn_data = try(download_npn(species = 3,
path = tempdir(),
internal = FALSE))
# download npn data internal
npn_data_internal = try(download_npn(speci... | # Phenor unit tests
# test all data downloads
test_that("test data downloads",{
# download npn data
npn_data = try(download_npn(species = 3,
path = paste0(tempdir(),"/npn_test.rds"),
internal = FALSE))
# download npn data internal
npn_data_internal ... | agpl-3.0 | R |
351cca9d1cc6a7b39b6a2dc6e702c626e96041d1 | Fix a typo causing excessive warnings | klmr/modules,klmr/modules | R/import_package.r | R/import_package.r | #' @param package a character string specifying the package name
#'
#' @rdname import
#' @details
#' \code{pkg = import_package('pkg')} imports a package and treats it much as if
#' it were a module, making package contents available in the \code{pkg}
#' variable.
#' @examples
#' \dontrun{
#' dplyr = import_package('dp... | #' @param package a character string specifying the package name
#'
#' @rdname import
#' @details
#' \code{pkg = import_package('pkg')} imports a package and treats it much as if
#' it were a module, making package contents available in the \code{pkg}
#' variable.
#' @examples
#' \dontrun{
#' dplyr = import_package('dp... | apache-2.0 | R |
093cdefa0531bbf957407e2f47a98deccfe2eaea | Fix file paths | klmr/modules,klmr/modules | vignettes/rcpp/__install__.r | vignettes/rcpp/__install__.r | # Helper functions.
rootname = function (file, ext = '')
paste0(sub('\\.[^.]*$', '', file), '.', ext)
rxescape = function (str)
gsub('([.?*+^$()\\{\\}|-]|\\[|\\])', '\\\\\\1', str)
# C++ source; could potentially be more than one file.
file = modules::module_file('convolve.cpp')
# The following uses Rcpp t... | # Helper functions.
rootname = function (file, ext = '')
paste0(sub('\\.[^.]*$', '', file), '.', ext)
rxescape = function (str)
gsub('([.?*+^$()\\{\\}|-]|\\[|\\])', '\\\\\\1', str)
# C++ source; could potentially be more than one file.
file = 'convolve.cpp'
# The following uses Rcpp to compile (and later, ... | apache-2.0 | R |
72c21c18fcf21bdc95c71e7d3127d10dfb22e8b6 | handle factors | perishky/meffil,perishky/meffil | R/cell-type-specific-methylation.r | R/cell-type-specific-methylation.r | #' Reduce methylation profiles to most cell-type specific sites
#'
#' @param beta Numeric matrix (values = 0..1; rows = CpG sites; columns = samples).
#' @param cell.types Name of cell type for each column of beta.
#' @param number.sites For each cell type, the number of sites less methylated and the number
#' more met... | #' Reduce methylation profiles to most cell-type specific sites
#'
#' @param beta Numeric matrix (values = 0..1; rows = CpG sites; columns = samples).
#' @param cell.types Name of cell type for each column of beta.
#' @param number.sites For each cell type, the number of sites less methylated and the number
#' more met... | artistic-2.0 | R |
6076866cac0f1b25c4c9a305f701eb4ccae8a0c3 | Update dataVisualisation.r | svobodam/Deep-Learning-Text-Summariser,svobodam/Deep-Learning-Text-Summariser,svobodam/Deep-Learning-Text-Summariser | dataVisualisation/dataVisualisation.r | dataVisualisation/dataVisualisation.r | # Script to perform data visualisation
# All visualise stored in dataVisualisation/Plots
# Load required libraries
library(wordcloud)
library(ggplot2)
library(SnowballC)
library(plyr)
library(RColorBrewer)
library(sentimentr)
library(tm)
library(data.table)
library(ggrepel)
# ***Functions***
# Sentiment Analysis
# r... | # Script to perform data visualisation
# All visualise stored in dataVisualisation/Plots
# Load required libraries
library(wordcloud)
library(ggplot2)
library(SnowballC)
library(plyr)
library(RColorBrewer)
library(sentimentr)
library(tm)
library(data.table)
# ***Functions***
# Sentiment Analysis
# return sentiment
s... | mit | R |
1851673cccc668d9965cf095d71a90119dbe8df0 | Add sample configs to export past FRAM years | PSC-CoTC/PSC-FRAM-Admin,PSC-CoTC/PSC-FRAM-Admin | config/export_fram_fishery_config.r | config/export_fram_fishery_config.r |
########### 2015 Post Season Catch #################
fram.db.name <- "./fram db/Final pre and post databases/FramVS2-PSC-Coho-PostSeason.mdb"
fram.run.name <- "bc-bkCoho2015 Final"
run.year <- 2015
########### 2014 Post Season Catch #################
#fram.db.name <- "./fram db/FramVS2-PSC-Coho-Backwards-for 2013... |
fram.db.name <- "./fram db/Final pre and post databases/FramVS2-PSC-Coho-PostSeason.mdb"
fram.run.name <- "bc-bkCoho2015 Final"
run.year <- 2015 | mit | R |
1cf3b6f776f60deaaf87da9ddd0631b53b695d9b | Update vizualizacija.r | GalDrnovsek/APPR-2015-16 | vizualizacija/vizualizacija.r | vizualizacija/vizualizacija.r | # 3. faza: Izdelava zemljevida
# Uvozimo zemljevid.
#zemljevid <- uvozi.zemljevid("http://e-prostor.gov.si/fileadmin/BREZPLACNI_POD/RPE/OB.zip",
# "OB/OB", encoding = "Windows-1250")
# Preuredimo podatke, da jih bomo lahko izrisali na zemljevid.
#druzine <- preuredi(druzine, zemljevid, "OB... | # 3. faza: Izdelava zemljevida
# Uvozimo zemljevid.
#zemljevid <- uvozi.zemljevid("http://e-prostor.gov.si/fileadmin/BREZPLACNI_POD/RPE/OB.zip",
# "OB/OB", encoding = "Windows-1250")
# Preuredimo podatke, da jih bomo lahko izrisali na zemljevid.
#druzine <- preuredi(druzine, zemljevid, "OB... | mit | R |
afc9f9df7351334e83e74563e948ea07041e7421 | update stat20pkg with flights data | ryanlovett/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,berkeley-dsep-infra/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub | deployments/datahub/images/default/r-packages/stat-20.r | deployments/datahub/images/default/r-packages/stat-20.r | #!/usr/bin/env Rscript
print("Installing packages for stat-20")
source("/tmp/class-libs.R")
class_name = "stat-20"
class_libs = c(
"tidycensus", "1.0",
"openintro", "2.2.0",
"infer", "1.0.0",
"patchwork", "1.1.1",
"tigris", "1.0",
"googlesheets4", "0.2.0",
"xaringanthemer", "0.4.0",
"... | #!/usr/bin/env Rscript
print("Installing packages for stat-20")
source("/tmp/class-libs.R")
class_name = "stat-20"
class_libs = c(
"tidycensus", "1.0",
"openintro", "2.2.0",
"infer", "1.0.0",
"patchwork", "1.1.1",
"tigris", "1.0",
"googlesheets4", "0.2.0",
"xaringanthemer", "0.4.0",
"... | bsd-3-clause | R |
790ea38024fd3d48383ddd922504aba84e7d5783 | Update pvap.r | alfcrisci/rBiometeo,alfcrisci/rBiometeo | R/pvap.r | R/pvap.r | #' pvap
#'
#' Vapour pressure estimate from relative humidity.
#'
#' @param numeric t Air temperature in Celsius degrees.
#' @param numeric rh Air Relative humidity in percentage.
#' @return vapour pressure in hPa.
#'
#'
#' @author Istituto di Biometeorologia Firenze Italy Alfonso Crisci \email{a.crisci@@ibimet.cnr.i... | #' pvap
#'
#' Vapour pressure estimate from relative humidity.
#'
#' @param numeric t Air temperature in Celsius degrees.
#' @param numeric rh Air Relative humidity in percentage.
#' @return vapour pressure in hPa.
#'
#'
#' @author Istituto di Biometeorologia Firenze Italy Alfonso Crisci \email{a.crisci@@ibimet.cnr.i... | mit | R |
acd0cc8b504c758d6705bf8cc504d12cd6fcb2b6 | Update Server.r | mmjazzar/Load_dashboard,mmjazzar/TimeSeries_Forecasting | Server.r | Server.r | library(shiny)
library(ggplot2)
function(input, output, session) {
# added "session" because updateSelectInput requires it
data <- reactive({
req(input$file1) ## ?req # require that the input is available
inFile <- input$file1
df <- read.csv(inFile$datapath, header = TRUE, sep = input$s... |
library(shiny)
function(input, output) {
output$contents <- renderTable({
# input$file1 will be NULL initially. After the user selects
# and uploads a file, it will be a data frame with 'name',
# 'size', 'type', and 'datapath' columns. The 'datapath'
# column will contain the local filenames ... | apache-2.0 | R |
a8efcdef31530225d76f07d3ec96ceb53b6e505a | Add visualization script for ldavis | HIIT/digivaalit-2015,HIIT/digivaalit-2015,HIIT/digivaalit-2015 | topics/topics.r | topics/topics.r | create_dtm <- function( path ) {
library(tm)
a <- Corpus( DirSource( path ) )
a <- tm_map(a, removeNumbers)
a <- tm_map(a , stripWhitespace)
a <- tm_map(a, removePunctuation)
a <- tm_map(a, content_transformer(tolower) )
a <- tm_map(a, removeWords, stopwords("finnish") )
dtm <-DocumentTermMatrix(a)
... | create_dtm <- function( path ) {
library(tm)
a <- Corpus( DirSource( path ) )
a <- tm_map(a, removeNumbers)
a <- tm_map(a , stripWhitespace)
a <- tm_map(a, removePunctuation)
a <- tm_map(a, content_transformer(tolower) )
a <- tm_map(a, removeWords, stopwords("finnish") )
dtm <-DocumentTermMatrix(a)
... | mit | R |
678c5cbfe4da27f504a6e3547884dc0ed04010d3 | add test for #93 | mschubert/clustermq,mschubert/clustermq,mschubert/clustermq | tests/testthat/test-5-qsys_impl.r | tests/testthat/test-5-qsys_impl.r | context("qsys implementations")
has_network = has_connectivity(Sys.info()[['nodename']])
avail = Sys.which(c("bsub", "qsub", "sbatch", "fake_scheduler.sh"))
avail = as.list(nchar(avail) != 0)
#TODO: factor out in "test worker api"?
test_that("qsys_multicore", {
skip_on_os("windows")
fx = function(x) x*2
w... | context("qsys implementations")
has_network = has_connectivity(Sys.info()[['nodename']])
avail = Sys.which(c("bsub", "qsub", "sbatch", "fake_scheduler.sh"))
avail = as.list(nchar(avail) != 0)
test_that("qsys_lsf", {
skip_if_not_installed('clustermq')
skip_if_not(with(avail, bsub))
skip_if_not(has_network)... | apache-2.0 | R |
e3cf250ac6bc0738029e8670be7b5c0f341a36d9 | Update 1.r | glor/R,glor/R | aufgaben/blatt07/1.r | aufgaben/blatt07/1.r | #Blatt 7
#1.1
#Anzahl Prediktorstufen: plot: 4
#Zahl Wiederholungen: plot: jeweils 3
sulphur = read.table(file="[036]sulphur.txt", dec=".", sep="\t", header = TRUE)
plot(sulphur$concentration, sulphur$scab)
#Varianzhomogenitaet mit LeveneTest
model = lm(formula=scab~concentration, data=sulphur)
abline(reg=... | bsd-2-clause | R | |
838b41aa31f6d15b29113250c1be446fa9986766 | add option to do partial perfect info | wkmor1/voiWoodland | R/pre_posterior.r | R/pre_posterior.r | pre_posterior <- function(x, n, size, px=FALSE) {
eta <- sum(x == 0) / length(x)
if(max(x) > 0) {
if(var(x[x != 0])) shape <- mmbeta(x[x != 0]) else shape <- NULL
}
p <- unname(sample(x, n, replace=TRUE))
update <- function(phi, x, size, eta, shape) {
m <- rbinom(1, size, phi)
if(max(x... | pre_posterior <- function(x, n, size) {
eta <- sum(x == 0) / length(x)
if(max(x) > 0) {
if(var(x[x != 0])) shape <- mmbeta(x[x != 0]) else shape <- NULL
}
p <- unname(sample(x, n, replace=TRUE))
update <- function(phi, x, size, eta, shape) {
m <- rbinom(1, size, phi)
if(max(x) > 0) {
... | mit | R |
6236d232c3dc3841d81426c9bcb8f09c1eb07601 | Tweak CRP graphs. | jtobin/bnp | chinese-restaurant-process/src/simulation_crp.r | chinese-restaurant-process/src/simulation_crp.r | require(dplyr)
require(ggplot2)
require(reshape2)
source('crp.r')
design = expand.grid(epochs = 100, n = 1000, a = c(1, 10, 100))
simulate = function(epochs, n, a) replicate(epochs, list(crp(n, a)))
experiment = apply(
design
, MARGIN = 1
, function(row) { simulate(row[1], row[2], row[3]) }
)
results ... | require(dplyr)
require(ggplot2)
require(reshape2)
source('crp.r')
design = expand.grid(epochs = 100, n = 1000, a = c(1, 10, 100))
simulate = function(epochs, n, a) replicate(epochs, list(crp(n, a)))
experiment = apply(
design
, MARGIN = 1
, function(row) { simulate(row[1], row[2], row[3]) }
)
results ... | mit | R |
c8c6309ed036f50ef369290cfe415baff1dab333 | remove third argument | phnmnl/workflow-demo,phnmnl/workflow-demo,phnmnl/workflow-demo,phnmnl/workflow-demo | CV/CV.r | CV/CV.r | args <- commandArgs(trailingOnly = TRUE)
input = args[1]
output = args[2]
x<-read.table(input,sep='\t',header=T)
calc.cv <- function(x) {
c=abs(sd(as.numeric(x))/mean(as.numeric(x)))
return(c)
}
cv <- apply(x, 1, calc.cv)
write.table(cv,file=output,sep='\t',row.names=F)
| args <- commandArgs(trailingOnly = TRUE)
input = args[1]
output = args[2]
folder = args[3]
x<-read.table(paste(folder,input,sep="/"),sep='\t',header=T)
calc.cv <- function(x) {
c=abs(sd(as.numeric(x))/mean(as.numeric(x)))
return(c)
}
cv <- apply(x, 1, calc.cv)
ifelse(!dir.exists(paste(folder, output, sep="/")... | apache-2.0 | R |
a556fe88a04347e54819a354dcec8c4d428caf88 | Refactor extrafont DB recreation | klmr/ggplots | fonts.r | fonts.r | create_extrafontdb = function () {
extrafontdb_path = function ()
system.file('metrics', package = 'extrafontdb', mustWork = TRUE)
path = try(extrafontdb_path(), silent = TRUE)
# If extrafontdb doesn’t exist, this means that the extrafont package isn’t
# installed. Reinstalling it will re-crea... | extrafontdb_path = try(system.file('metrics', package = 'extrafontdb', mustWork = TRUE), silent = TRUE)
rebuild_cache = function (path) {
if (inherits(path, 'try-error')) {
# Build extrafontdb cache
extrafontdb = try(loadNamespace('extrafont'), silent = TRUE)
if (inherits(extrafont, 'try-er... | apache-2.0 | R |
f95ded583306be72af961ad71174789c7e2b67ec | Add spdplyr | jkarl/LandscapeToolbox,jkarl/LandscapeToolbox,jkarl/LandscapeToolbox | package_installation.r | package_installation.r | ###############################################
### COMMONLY USED PACKAGES IN AIM R SCRIPTS ###
###############################################
#### THE CORE ####
install.packages("tidyverse")
## The tidyverse package includes a number of packages also listed below. It's a quick way to bootstrap up a new install of R.... | ###############################################
### COMMONLY USED PACKAGES IN AIM R SCRIPTS ###
###############################################
#### THE CORE ####
install.packages("tidyverse")
## The tidyverse package includes a number of packages also listed below. It's a quick way to bootstrap up a new install of R.... | cc0-1.0 | R |
6798d5fe0da992452c35343f4910f318114fd9f5 | make 10 graphs | davidmoten/rtree-3d,davidmoten/rtree-3d | src/test/r/source.r | src/test/r/source.r | #!/usr/bin/Rscript
#X11(type="Xlib")
#install.packages("plot3D")
library("plot3D")
for (i in 0:9) {
filename = paste("../../../target/out",i,".txt", sep="")
print(paste("reading", filename))
mat <- read.csv(file = filename, header = FALSE)
png(paste("../../../target/plot",i,".png",sep=""), height = 700,... | #!/usr/bin/Rscript
#X11(type="Xlib")
#install.packages("plot3D")
library("plot3D")
for (i in 0:10) {
filename = paste("../../../target/out",i,".txt", sep="")
print(paste("reading", filename))
mat <- read.csv(file = filename, header = FALSE)
png(paste("../../../target/plot",i,".png",sep=""), height = 700... | apache-2.0 | R |
8229dbba0da2a95129cd5c911b783be7968e144e | tweak map ranges | jae0/bio.snowcrab,jae0/bio.snowcrab | R/load.environment.r | R/load.environment.r |
# ----------------------------------------------------------------------------------
# NOTE to all: The year of "year.assessment must be changed every year before any other run
# It cannot be automatically loaded together with the "load.snowcrab.environment". This is because
# running in parallel ... |
# ----------------------------------------------------------------------------------
# NOTE to all: The year of "year.assessment must be changed every year before any other run
# It cannot be automatically loaded together with the "load.snowcrab.environment". This is because
# running in parallel ... | mit | R |
1a40a97c45c5128a03a44c3dc7656af07139853a | fix input variable | ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs... | math/basic/Smallest_digit_in_number/R/smallestDigit.r | math/basic/Smallest_digit_in_number/R/smallestDigit.r | {
x = as.integer(readline(prompt = "Enter a number :"))
s = 9
while (x > 0) {
y = x %% 10
if (s > y) {
s = y
}
x = x %/% 10
}
print(paste("Smallest digit:", s))
} | {
n = as.integer(readline(prompt = "Enter a number :"))
s = 9
while (x > 0) {
y = x %% 10
if (s > y) {
s = y
}
x = x %/% 10
}
print(paste("Smallest digit:", s))
} | cc0-1.0 | R |
ed642b51a75657595133f657e911f386d03e35ea | Update analiza.r | Anchiqua/APPR-2015-16 | analiza/analiza.r | analiza/analiza.r | # 4. faza: Analiza podatkov
#naredimo skupine za države glede na število igralcev in točk
tabela4 <- inner_join(tabela3, tabela2)
rownames(tabela4) <- tabela4$drzava
tabela4.norm <- tabela4 %>% select(-drzava) %>% scale()
k1 <- kmeans(tabela4.norm, 5)
#head(k$cluster, n = 15, nstart=1000)
table(k$cluster)
k1 <- km... | # 4. faza: Analiza podatkov
#naredimo skupine za države glede na število igralcev in točk
tabela4 <- inner_join(tabela3, tabela2)
rownames(tabela4) <- tabela4$drzava
tabela4.norm <- tabela4 %>% select(-drzava) %>% scale()
k1 <- kmeans(tabela4.norm, 5)
#head(k$cluster, n = 15, nstart=1000)
table(k$cluster)
k1 <- km... | mit | R |
e5a4ff40efaf78011c16b8c4c232a09a4149071f | Add code to calculate binding scores | dennisaldea/genetic-heatmaps,dennisaldea/genetic-heatmaps | analysis-engine.r | analysis-engine.r | #!/usr/bin/env Rscript
#===============================================================================
# TITLE : analysis-engine.r
# ABSTRACT : An R script that combines RNA-seq data files and BETA gene lists to
# generate combined gene activity TSV files
#
# AUTHOR : Dennis Aldea <dennis.aldea@gmail.... | #!/usr/bin/env Rscript
#===============================================================================
# TITLE : analysis-engine.r
# ABSTRACT : An R script that combines RNA-seq data files and BETA gene lists to
# generate combined gene activity TSV files
#
# AUTHOR : Dennis Aldea <dennis.aldea@gmail.... | mit | R |
1d6ae4c0d32602b24551da3beecdd04966424ea9 | add help renderers | wrathematics/TAG,wrathematics/TAG,XSEDEScienceGateways/TAG,wrathematics/TAG,XSEDEScienceGateways/textgateway,XSEDEScienceGateways/TAG,XSEDEScienceGateways/textgateway,XSEDEScienceGateways/TAG,XSEDEScienceGateways/textgateway | inst/tag/shiny/utils/help.r | inst/tag/shiny/utils/help.r | ### Modified from Vincent Nijs' Radiant: https://github.com/vnijs/radiant
render_helpfile <- function(title, file)
{
file <- paste0("shiny/help/", file)
body <- markdown::markdownToHTML(file, fragment.only=TRUE, options=c(""))
link <- paste0(gsub(title, pattern=" ", replacement=""), "_help")
thisyear <- fo... | ### Modified from Vincent Nijs' Radiant: https://github.com/vnijs/radiant
render_helpfile <- function(title, file)
{
file <- paste0("shiny/help/", file)
body <- markdown::markdownToHTML(file, fragment.only=TRUE, options=c(""))
link <- paste0(gsub(title, pattern=" ", replacement=""), "_help")
thisyear <- fo... | agpl-3.0 | R |
699bcff5f176c2415f156eb6fa0a7076967cbb18 | Fix the order of arguments are wrong. | snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3 | q3/docs/InputBoxFunction.rd | q3/docs/InputBoxFunction.rd | =begin
=@InputBox
String @InputBox(String message, Boolean multiline?, String default?)
==
[Uɓ͂߂邽߂̃_CAO\A͂ꂽԂ܂Bmessageɂ͕\郁bZ[Ww肵܂Bdefaultw肷ƃ_CAOJƂɂ͗̕ɕ\܂B
multilineɂ̓_CAÕ^Cvw肵܂Bwł͈̂ȉ̂ƂłB
::INPUT-SINGLELINE
Ps̓͂߂_CAO
((<Ps̓_CAO|"IMG:images/SingleLineInputBoxDialog.png">))
::INPUT-MULTILINE
... | =begin
=@InputBox
String @InputBox(String message, String default?, Boolean multiline?)
==
[Uɓ͂߂邽߂̃_CAO\A͂ꂽԂ܂Bmessageɂ͕\郁bZ[Ww肵܂Bdefaultw肷ƃ_CAOJƂɂ͗̕ɕ\܂B
multilineɂ̓_CAÕ^Cvw肵܂Bwł͈̂ȉ̂ƂłB
::INPUT-SINGLELINE
Ps̓͂߂_CAO
((<Ps̓_CAO|"IMG:images/SingleLineInputBoxDialog.png">))
::INPUT-MULTILINE
... | mit | R |
e22a26b5764967746b050ebbca79ee679c12cbd4 | make array/subset usable for logical indexing, remove plyr dep | mschubert/narray,mschubert/narray | subset.r | subset.r | #' Subsets an array using a list with indices or names
#'
#' @param X The array to subset
#' @param index A list of vectors to use for subsetting, or vector if along is given
#' @param along Along which dimension to subset if index is a vector; default is last dimension
#' @return The subset of the array
s... | #' Subsets an array using a list with indices or names
#'
#' @param X The array to subset
#' @param index A list of vector to use for subsetting
#' @param along Along which dimension to subset if index is a vector; default is last dimension
#' @return The subset of the array
subset = function(X, index, alo... | apache-2.0 | R |
6951dfc4c6c698ead4b41dd259c8ae09bd543e55 | add test for #issue 796 | NikolayShubenkovProgSchool/red,rheber/red,red-eco/red,vehar/red,rheber/red,red-eco/red,NikolayShubenkovProgSchool/red,vehar/red | tests/source/compiler/print-test.r | tests/source/compiler/print-test.r | REBOL [
Title: "Red print test script"
Author: "Peter W A Wood"
File: %print-test.r
Tabs: 4
Rights: "Copyright (C) 2011-2012 Peter W A Wood. All rights reserved."
License: "BSD-3 - https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt"
]
~~~start-file~~~ "Red print"
--test-- "Red print 1"
... | REBOL [
Title: "Red print test script"
Author: "Peter W A Wood"
File: %print-test.r
Tabs: 4
Rights: "Copyright (C) 2011-2012 Peter W A Wood. All rights reserved."
License: "BSD-3 - https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt"
]
~~~start-file~~~ "Red print"
--test-- "Red print 1"
... | bsd-3-clause | R |
e738fa74c19afb9a7f2aef374b91a3092fa5892a | Fix path handling when not appending dtm... | HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core | hybra/analysis/topicmodel/create_topics.r | hybra/analysis/topicmodel/create_topics.r | source('topics.r')
##source('stm.r')
args <- commandArgs(trailingOnly = TRUE)
dtm_path <- args[1]
if( ! grepl( '.rdata', dtm_path ) ) {
dtm_path <- paste( dtm_path, '/dtm.rdata', sep='' )
}
load( dtm_path )
k <- as.integer( args[2] )
model <- create_model( dtm , k )
path <- paste( dtm_path , 'topic-', args[2]... | source('topics.r')
##source('stm.r')
args <- commandArgs(trailingOnly = TRUE)
dtm_path <- args[1]
if( ! grepl( '.rdata', dtm_path ) ) {
dtm_path <- paste( dtm, 'dtm.rdata', sep='' )
}
load( dtm_path )
k <- as.integer( args[2] )
model <- create_model( dtm , k )
path <- paste( dtm_path , 'topic-', args[2], '.rd... | mit | R |
88cc0a75368031ab39e92db96d1d835dcb4449a7 | Update ui.r | tao255r/MyShinyApps,dipanjanS/MyShinyApps | twitter-analysis/ui.r | twitter-analysis/ui.r | library(shiny)
library(shinyIncubator)
shinyUI(fluidPage(
headerPanel("Twitter Analytics - Sentiment Analysis and more"),
# Getting User Inputs
sidebarPanel(
wellPanel(
textInput("entity1", "Handle 1: ","#thrilled"),
textInput ("entity2","Handle 2: ","#frustrated"... | library(shiny)
library(shinyIncubator)
shinyUI(fluidPage(
headerPanel("Twitter Analytics - Sentiment Analysis and more"),
# Getting User Inputs
sidebarPanel(
wellPanel(
textInput("entity1", "Handle 1: ","#thrilled"),
textInput ("entity2","Handle 2: ","#frustrated"... | mit | R |
b06e4e1c0f8379cfa9865882ffee8226acaf1087 | Adjust aesthetics. | IndyActuaries/epic-fhir,IndyActuaries/epic-fhir | r/plots.r | r/plots.r | #' ## Code Owners: Kyle Baird, Shea Parkes
#' ### OWNERS ATTEST TO THE FOLLOWING:
#' * The `master` branch will meet Milliman QRM standards at all times.
#' * Deliveries will only be made from code in the `master` branch.
#' * Review/Collaboration notes will be captured in Pull Requests (prior to merging).
#'
#'... | #' ## Code Owners: Kyle Baird, Shea Parkes
#' ### OWNERS ATTEST TO THE FOLLOWING:
#' * The `master` branch will meet Milliman QRM standards at all times.
#' * Deliveries will only be made from code in the `master` branch.
#' * Review/Collaboration notes will be captured in Pull Requests (prior to merging).
#'
#'... | mit | R |
5fb0b8a58403cb31e0716cc18f624538a3d344fa | Update UTCI.r | alfcrisci/rBiometeo,alfcrisci/rBiometeo | R/UTCI.r | R/UTCI.r | #' UTCI
#'
#' Calculate Universal Thermal Climate Index ( UTCI) index.
#'
#' @param numeric t Air temperature in Celsius degrees.
#' @param numeric rh Air Relative humidity in percentage.
#' @param numeric wind Wind speed in meter per second.
#' @param numeric tr Mean radiant temperature in Celsius degrees
#' @return U... | #' UTCI
#'
#' Calculate Universal Thermal Climate Index ( UTCI) index.
#'
#' @param numeric t Air temperature in Celsius degrees.
#' @param numeric rh Air Relative humidity in percentage.
#' @param numeric wind Wind speed in meter per second.
#' @param numeric tr Mean radiant temperature in Celsius degrees
#' @return U... | mit | R |
cd4ce0f2904e56a501fe33f19a3e52d424a116bf | Fix font existence check | klmr/ggplots | fonts.r | fonts.r | extrafontdb_path = try(system.file('metrics', package = 'extrafontdb', mustWork = TRUE), silent = TRUE)
# FIXME: Make this work with un-gzipped font metrics as well.
# FIXME: Make this work with incomplete fonts.
complete_font_set = paste0(c('-Regular', '-Bold', '-Italic', '-BoldItalic'), '.afm.gz')
rebuild_cache = fu... | extrafontdb_path = try(system.file('metrics', package = 'extrafontdb', mustWork = TRUE), silent = TRUE)
# FIXME: Make this work with un-gzipped font metrics as well.
# FIXME: Make this work with incomplete fonts.
complete_font_set = paste0(c('-Regular', '-Bold', '-Italic', '-BoldItalic'), '.afm.gz')
rebuild_cache = fu... | apache-2.0 | R |
99f688f4e00a020c289b8d0008cd8b5575c9aea9 | Update error.r | bgweber/RServer,bgweber/RServer,bgweber/RServer,bgweber/RServer | tasks/userDemo/error.r | tasks/userDemo/error.r | # Copyright (C) 2016 Electronic Arts Inc. All rights reserved.
warning("This is a warning!")
tryCatch({
stop("This is an error!")
}, error = function(cond) {
message("Caught the error.")
})
stop("This is an error!")
print("Reached end of script!")
| warning("This is a warning!")
tryCatch({
stop("This is an error!")
}, error = function(cond) {
message("Caught the error.")
})
stop("This is an error!")
print("Reached end of script!")
| bsd-3-clause | R |
9ca1638572f7d44e1070a7d5c42f35714ae822a7 | disable BiocParallel test (r-devel pkg warning) | mschubert/clustermq,mschubert/clustermq,mschubert/clustermq | tests/testthat/test-7-foreach.r | tests/testthat/test-7-foreach.r | context("foreach")
foreach = foreach::foreach
`%dopar%` = foreach::`%dopar%`
`%do%` = foreach::`%do%`
register_dopar_cmq(n_jobs=0)
test_that("simple foreach registration works", {
res = foreach(i=1:3) %dopar% sqrt(i)
cmp = foreach(i=1:3) %do% sqrt(i)
expect_equal(res, cmp)
})
test_that(".export objects ... | context("foreach")
foreach = foreach::foreach
`%dopar%` = foreach::`%dopar%`
`%do%` = foreach::`%do%`
register_dopar_cmq(n_jobs=0)
test_that("simple foreach registration works", {
res = foreach(i=1:3) %dopar% sqrt(i)
cmp = foreach(i=1:3) %do% sqrt(i)
expect_equal(res, cmp)
})
test_that(".export objects ... | apache-2.0 | R |
560b651a7909a2ad21c0ff4fc594e3ad75bf0fc1 | Add script for plotting number of quadwords. | danluu/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,danluu/BitFunnel | src/Scripts/plot-qwords.r | src/Scripts/plot-qwords.r | library("ggplot2")
setwd("~/dev/BitFunnel/src/Scripts")
png(filename="qwords.png",width=1600,height=1200)
queries <- read.csv(header=TRUE, file="/tmp/QueryPipelineStatistics.csv")
pos = seq(1, length(queries$quadwords))
df <- data.frame(pos, queries$quadwords)
ggplot(df, aes(x=pos,y=queries.quadwords)) +
theme_bw() +... | mit | R | |
1582a0a647df9613c0294cf1bdbb5a163d241d67 | add new R program to calculate eqm tariff under DGH-style model | kbuzard/SOP_repeated | DGH.r | DGH.r | #reserve space for loop output
tau = seq(0.001,.166,0.001) #this will be counter variable in loop
PSx = matrix(NA,length(tau),1)
CSx = matrix(NA,length(tau),1)
TR = matrix(NA,length(tau),1)
PSy = matrix(NA,length(tau),1)
CSy = matrix(NA,length(tau),1)
#calculate government welfare when tau = 0 (baseline)
b = ((2 +2*0)... | mit | R | |
b4ebaa3085a25141198d2204f9edcded71b1373e | 更新:第四章fig4-18 | shuaimeng/r | thesis/chap4/fig4-18.r | thesis/chap4/fig4-18.r | dyn.load('/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/server/libjvm.dylib')
library(rJava)
setwd("/Users/mengmengjiang/all datas/chap4")
library(xlsx)
#读取数据
q2 <- read.xlsx("dvsfv.xlsx", sheetName = "q15", header = TRUE)
#q3 <- read.xlsx("dvsfv.xls", sheetName = "q27", header = TRUE)
#q4 <... | mit | R | |
35155d2c493e286f32afb3463239057397ffbe73 | Create function.r | Sokel/R-shchu | function.r | function.r |
my_calc <- function(x, y){
s <- x+y
return(s)
}
result <- my_calc(1,1)
my_calc <- function(x, y){
s <- x+y
d <- x-y
return(c(s,d))
}
result <- my_calc(1,1)
my_calc2 <- function(x, y, z = 10){
s <- x+y+z
d <- x-y-z
return(c(s,d))
}
my_calc2(1,2)
distr1 <- rnorm(100)
hist(distr1)
distr1[1:30] <- NA... | apache-2.0 | R | |
4da74d169bae032acc51d96ae10cc02aec4dfd65 | Add R script to plot RMSE. (Not yet working). | ntnu-smartmedia/goldfish,monsendag/goldfish,monsendag/goldfish,ntnu-smartmedia/goldfish,monsendag/goldfish,ntnu-smartmedia/goldfish | graphs/rmse.r | graphs/rmse.r | #!/usr/bin/env Rscript
args <- commandArgs(trailingOnly = TRUE)
file = args[1]
x <- read.csv(file, header=T)
library(ggplot2)
library(methods)
ggplot(x, aes(x = filename, fill = variable)) +
geom_bar(stat="identity", ymin=0, aes(y=value, ymax=value), position="dodge") +
geom_text(aes(x=filename, y=value, ymax=va... | mit | R | |
9b5ffc3bd7410b1a6bb6e39fbd75bf611747e44f | add spare r file for difusion | RyanCarey/abm-platform | diffusion1.r | diffusion1.r |
integrand <- function(tau,D,t,x,A){
result = A*exp(-x**2/(4*D*(t-tau)))/(4.0*D*t*pi)
return(result)
}
A = 100
D = 10
t = 30
x1 = seq(0.1,100,1)
tau0 = 30
res = rep(NA,length(x1))
for(i in 1:length(x1)){
res[i] = integrate(integrand,lower=0, upper=min(tau0,t),D,t,x1[i],A)[[1]]... | mit | R | |
626d86c2ed83be0e8646359c7a23d4a6af7b95bb | Create tTest.r | Sokel/R-shchu | tTest.r | tTest.r |
df <- iris
df1 <- subset(iris, Species != "setosa")
table(df1$Species)
hist(df1$Sepal.Length)
library(ggplot2)
ggplot(df1, aes(x = Sepal.Length))+
geom_histogram(fill = 'white', col = 'black', binwidth = 0.4)+
facet_grid(Species ~ .)
ggplot(df1, aes(x= Sepal.Length, fill = Species))+
geom_density(alpha = 0.5... | apache-2.0 | R | |
0f40edd6681d0b5b7623fde13f64e592c15b7e96 | Create Tet1_Dnmt3_co_regulated_gene_heatmap.r | crazyhottommy/some-unorganized-old-scripts,crazyhottommy/some-unorganized-old-scripts,crazyhottommy/some-unorganized-old-scripts | R_scripts/Tet1_Dnmt3_co_regulated_gene_heatmap.r | R_scripts/Tet1_Dnmt3_co_regulated_gene_heatmap.r | library(gplots)
getwd()
setwd("/home/tommy/Tet1/shDnmt3L")
d<- read.table("co_up_or_down_uniq.txt", header=T)
# heatmap.2 works only with matrix, convert the dataframe to matrix
m<-as.matrix(d[,2:3])
rownames(m)<- d$genes # add the gene names as the row lable
png(filename = "co_regulated1.png", width=400, height = 80... | mit | R | |
21952bf5887f113a19f32a8870f2c209b8e33256 | Create ZMB_elections._analysis.r | tessam30/Zambia,tessam30/Zambia | ZMB_elections._analysis.r | ZMB_elections._analysis.r | library(rvest)
library(tidyverse)
library(stringr)
library(foreign)
library(stringi)
# Url information
cand_prof <- c("lungu,edgar,pf", "hichilema,hakainde,upnd", "nawakwi,edith,fdd",
"banda,andyford,pac", "kabimba,wynter,rainbow", "chishimba,saviour,upp",
"kaunda,tilyenji,unip", "sinka... | mit | R | |
1ce555e4ea747122f48479eaec10c90813235739 | Add function | biotcm/PICheM,biotcm/PICheM,biotcm/PICheM | ProteinSpace/Networks/SignalPathway/GetGeneList.r | ProteinSpace/Networks/SignalPathway/GetGeneList.r | # This function gets certain downstream/upstream genes in given kegg pathways
## === input ===
### file: pathway file name;
### id: list of kegg pathway ids (in the form of hsaXXXXXX)
### gene = NA: default as return all the genes
### direction: 1 for downstream; -1 for upstream
### step = 20: default as all th... | mit | R | |
66a9a5706a992e5bf0e8e0579d56cdaf143f883d | Add CRP simulation. | jtobin/bnp | chinese-restaurant-process/src/simulation_crp.r | chinese-restaurant-process/src/simulation_crp.r | require(dplyr)
require(ggplot2)
require(reshape2)
source('crp.r')
design = expand.grid(epochs = 100, n = 1000, a = c(1, 10, 100))
simulate = function(epochs, n, a) replicate(epochs, list(crp(n, a)))
experiment = apply(
design
, MARGIN = 1
, function(row) { simulate(row[1], row[2], row[3]) }
)
results ... | mit | R | |
fca31b33eb70d8bc3458f31268a2d2be34746a68 | Add demo for predicting worst FVC. | pschulam-attic/sclero | demo/predict-worst.r | demo/predict-worst.r | # Predict the worst FVC measurements that a person will have base on
# demographic data.
library(sclero)
library(ggplot2)
library(reshape2)
library(plyr)
data(patient)
data(pft)
patient.worst <- ddply(pft, ~ patient.id + test.type, summarize, lifetime.worst = lifetime_worst(perc.of.predicted))
patient.worst <- dcast... | mit | R | |
5b1992aad4f60695ada25c19a036f3d944eb67e3 | Update static/vendors/ace-builds/demo/kitchen-sink/docs/r.r | apipanda/openssl,apipanda/openssl,apipanda/openssl,apipanda/openssl | static/vendors/ace-builds/demo/kitchen-sink/docs/r.r | static/vendors/ace-builds/demo/kitchen-sink/docs/r.r | Call:
lm(formula = y ~ x)
Residuals:
1 2 3 4 5 6
3.3333 -0.6667 -2.6667 -2.6667 -0.6667 3.3333
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -9.3333 2.8441 -3.282 0.030453 *
x 7.0000 0.7303 9.585 0.000662 ***
---
Signif. codes: 0 ‘... | mit | R | |
8541f48ea8408959cafce3d9eb20a3b4b3a122e5 | Add copy&paste convience functions to R | klmr/.files,klmr/.files,klmr/.files | .R/copypaste.r | .R/copypaste.r | pbcopy = function (object, transform = NULL) {
if (! is.null(transform))
object = capture.output(transform(object))
on.exit(close(f))
f = pipe('pbcopy', 'w')
writeLines(object, f)
}
pbpaste = function () {
on.exit(close(f))
f = pipe('pbpaste')
readLines(f)
}
| apache-2.0 | R | |
131a431bd047ae813440c1dc55ab2862f7133100 | Add script to fit UNREST model | e3bo/2015phylo,e3bo/2015phylo,e3bo/2015phylo | src/run-rphast.r | src/run-rphast.r | #!/usr/bin/Rscript
library(rphast)
tree <- read.tree('mcc.nh')
load('regDNA.RData')
locMsa <- msa(regDNA, names(regDNA), alphabet='ACTGN')
treeChar <- write.tree(tree)
mod <- phyloFit(locMsa, tree=treeChar, subst.mod='UNREST', no.opt='branches', ninf.sites=1)
mod$tree <- treeChar
mod2 <- phyloFit(locMsa, init.mod=... | cc0-1.0 | R | |
dfc1e42c8e48781c6dc82ff582b18c1c77157da9 | Create KLTepigenome.r | pmb59/KLTepigenome,pmb59/KLTepigenome | KLTepigenome.r | KLTepigenome.r | artistic-2.0 | R | ||
2418bb26f41e23c4b56090bf1d9dd696420cca51 | Create UnixtimeStamp.r | jluzuria2001/codeSnippets,jluzuria2001/codeSnippets,jluzuria2001/codeSnippets,jluzuria2001/codeSnippets | UnixtimeStamp.r | UnixtimeStamp.r | # Convert Unix timestamp into datetime in R
value <- 1465507827
# just the date "2016-06-09"
as.Date(as.POSIXct(value, origin="1970-01-01"))
# the date with hours:mins:secs "2016-06-09 23:30:27 CEST"
as.POSIXct(value, origin="1970-01-01")
| mit | R | |
dfed6a0d770ae34d8112d6313a7cc9ecdc7eac29 | Create stage_topology_processing.r | dpbroman/floodforecasting | stage_topology_processing.r | stage_topology_processing.r | #######DESCRIPTION###############################
#processes stage topology table from GIS analysis
#stage stations upstream of a given station
#################################################
##load libraries
library(dplyr)
library(data.table)
library(stringr)
library(tidyr)
library(readr)
##user inputs
dir_ref = '/... | mit | R | |
310ede3114c3efc69ef55b252c92c5a99f3017eb | Add missing data plots. | pschulam-attic/sclero | demo/missing.r | demo/missing.r | require(plyr)
require(reshape2)
require(sclero)
require(ggplot2)
require(GGally)
data(patient)
data(clinic)
data(pft)
data(sero)
npatients <- length(unique(patient$patient.id))
nclinic <- length(unique(clinic$patient.id))
npft <- length(unique(pft$patient.id))
nsero <- length(unique(sero$patient.id))
worst.pft <- dd... | mit | R | |
4f8b3ccf3cee4f6dbd3bc361b9bb18ac5fe17e9c | test rule for msicompound_archive_object | irods/contrib,irods/contrib,irods/contrib,irods/contrib | microservices/administration/msicompound_archive_object/move2DA.r | microservices/administration/msicompound_archive_object/move2DA.r | # move an object to a deep archive resource
# example:
# irule -F rules/move2DA.r "'s3resc;s3archive'" "'/tempZone/home/rods/testfile'" "'/my_bucket/home/rods/testfile'"
move_to_deep_archive {
msicompound_archive_object(*resc_hier, *logical_path, *physical_path);
}
INPUT *resc_hier=$1, *logical_path=$2, *physical_path... | bsd-3-clause | R | |
29f9e4a3e7513a3fae8d1c152cce2717a31a5bdd | Add Dirichlet process. | jtobin/bnp | dirichlet-process/src/dp.r | dirichlet-process/src/dp.r | BNP_DIR = "/Users/jtobin/projects/bnp"
SBP_SRC = paste(BNP_DIR, "stick-breaking-process/src/sbp.r", sep = "/")
source(SBP_SRC)
# ex: gaussian base measure
#
# > dp(10, 1, function() { rnorm(1) })
dp = function(n, a, h) {
p = sbp(n - 1, a)
g = replicate(length(p), h())
list(p, g)
}
| mit | R | |
cbb6cd8c03cbcff73dc80d76f51bb3c279e5a6db | Add R version of the K-Nearest Neighbor algorithm | a-holm/MachinelearningAlgorithms,a-holm/MachinelearningAlgorithms | Classification/K-NearestNeighbors/regularKNearestNeighbors.r | Classification/K-NearestNeighbors/regularKNearestNeighbors.r | # K-Nearest Neighbor classification model for machine learning.
#
# The idea of K Nearest Neighbors classification is to best divide and separate
# the data based on clustering the data and classifying based on the proximity
# to it's K closest neighbors and their classifications.
# Importing the data set
dataset = r... | mit | R | |
1e2a94893a5f55f12211c206b58d3aec9f6374ad | Create check_cfsv2_ts.r | dpbroman/hydroforecast | check_cfsv2_ts.r | check_cfsv2_ts.r | ###########################################
# get_cfsv2_ncdc.r
# pulls cfsv2 forecasts from NCDC archive
# subsets to gbm and africa domains
# pulls out precip. surface temp, winds, and latent
# heat flux
###########################################
## load libraries
library(stringr)
library(dplyr)
library(data.table)
... | mit | R | |
2ff1b8e7c00d885b1271958f375b57ef64db6122 | Add test file for #79 | klmr/modules,klmr/modules | inst/tests/modules/issue79.r | inst/tests/modules/issue79.r | devtools::load_all(quiet = TRUE)
options(import.path = 'inst/tests/modules')
before = module_name()
a = import('a')
after = module_name()
before; after
| apache-2.0 | R | |
bbd5429016efc96338943c2365cc156cc3e58736 | add postgres compatible plotting script | simbuerg/benchbuild,simbuerg/benchbuild | pjit-r/pprof-sql.r | pjit-r/pprof-sql.r | library(RPostgreSQL)
library(ggplot2)
library(reshape)
library(scales)
plot_experiment <- function(experiment, connection) {
cat(experiment)
rt_query <- sprintf(paste("SELECT project_name, region, metric, SUM(value) ",
"FROM public.run, public.likwid ",
"WHER... | mit | R | |
e5343c271ce71227c85985443f9259545c222d6b | Add plot script | jeannekamikaze/timing,jeannekamikaze/timing | plot.r | plot.r | args = commandArgs(trailingOnly = TRUE);
if (length(args) >= 1) {
file = args[1];
} else {
file = "C:/Users/Marc/framestats.txt";
}
data = read.table(file=file, comment.char=';');
regions = unique(data[,1])
num_regions = length(regions);
num_frames = length(data[,1]) / num_regions;
# If the number ... | bsd-2-clause | R | |
ae2a91b317a7e6122781a3022d2cc13e101d0130 | Create geom_bar_star.r | hclimente/ggstars | R/geom_bar_star.r | R/geom_bar_star.r | mit | R | ||
8f484a2473f6191740a0dc80f07d18ea0a22bb63 | Create var-vector-list.r | Sokel/R-shchu | var-vector-list.r | var-vector-list.r | # int array-vector
age <- c(16, 18 , 22 , 27)
# float array-vector
age <- c(16, 18 , 22 , 27)
# bool array-vector
is_marriage <- c(FALSE, FALSE, TRUE, TRUE)
# string array-vector
name <- c("Olga", "Maria", "Nastya", "Polina")
# list definition
data <- list(age, is_marriage)
# list element access
data[[1]][1]
... | apache-2.0 | R | |
d2edb959a3f77085694f184489c590aeed442464 | Add an example | tisp-lang/tisp,raviqqe/tisp,raviqqe/tisp,tisp-lang/tisp,raviqqe/tisp | examples/foo.r | examples/foo.r | (let foo 123)
(let bar 456)
(print (+ foo bar))
| mit | R | |
96fa3c2a6e50f6d7c049b5d4ca026d1d158e26c8 | Create fibonacci.r | phase/refract,phase/refract | examples/fibonacci.r | examples/fibonacci.r | 0:n84*o1:nv
n:+@:o*48<
| mit | R | |
bb54492f9f3dbcf092c45a4fb2318b827fad7e7d | Create power.composite.ttest.r | aomidpanah/power | power.composite.ttest.r | power.composite.ttest.r | power.t.test.composite <- function(n1, n2=NULL, c1, c2=NULL, d, s1, s2=NULL, sig.level=0.05, tside=2, ...) {
if (is.null(n2)) n2 <- n1
if (is.null(c2)) c2 <- c1
if (is.null(s2)) s2 <- s1
ncp <- d / sqrt(s1^2/n1 + s2^2/n2)
edf <- n1%/%c1 + n2%/%c2 - 2
pt(qt(1-sig.level/tside, edf, lower = TRUE), df=edf, n... | lgpl-2.1 | R | |
f11ea64a117c8a108ad3c341788dfb5f4e82dbd3 | add test for worker control flow | mschubert/clustermq,mschubert/clustermq,mschubert/clustermq | tests/testthat/test-worker.r | tests/testthat/test-worker.r | context("worker")
context = rzmq::init.context()
socket = rzmq::init.socket(context, "ZMQ_REP")
rzmq::bind.socket(socket, "tcp://*:55443")
test_that("control flow", {
worker_id = "1"
p = parallel::mcparallel(worker(worker_id, "tcp://localhost:55443", 1024))
msg = rzmq::receive.socket(socket)
testthat::expect_equ... | apache-2.0 | R | |
ff7f24b8ad466d39a64cab7d7629a2e7002ab1d6 | Load sensible knitr defaults | klmr/codons,klmr/codons | scripts/knit.r | scripts/knit.r | library = function (...) suppressMessages(base::library(...))
assign('library', library, globalenv())
library(knitr)
library(modules)
options(stringsAsFactors = FALSE,
import.path = file.path(Sys.getenv('HOME'), 'Projects/R'))
#opts_chunk$set(cache = TRUE)
# Pretty-print tables
library(pander)
panderOptio... | apache-2.0 | R | |
21e6df4109fe4aaf425b15c0279e21842dd95599 | Add slurm-settings.r | jmousseau/Stain | R/slurm-settings.r | R/slurm-settings.r | #' SlurmSettings R6 object.
#'
#' An interface to SBATCH settings.
#'
#' @export
SlurmSettings <- R6::R6Class("SlurmSettings")
| mit | R | |
85a2e208be16b632ae9d2f5d8c8cb74a77825863 | add dplyr's test | TobCap/demagrittr | tests/testthat/test-dplyr-adhoc.r | tests/testthat/test-dplyr-adhoc.r | context("test for examples of magrittr's vegnettes")
suppressMessages(library("magrittr"))
suppressMessages(library("dplyr"))
testthat::test_that("equiv value3", {
e1 <- quote(iris %>% filter(Sepal.Width %>% is_greater_than(4.3)))
expect_identical(eval(e1), eval(demagrittr(e1)))
})
| mit | R | |
be22bd6c7db918ddcdeca626186157c76b2ba445 | Add slurm-bash-script.r | jmousseau/Stain | R/slurm-bash-script.r | R/slurm-bash-script.r | #' SlurmBashScript R6 object.
#'
#' Generates the necessary bash script to submit through
#' the `sbatch` command.
SlurmBashScript <- R6::R6Class("SlurmBashScript")
| mit | R | |
1e9945fc6dada987d1fdb9f2ab415e197f8ba88f | Add script that summarizes experimental record | liveontologies/elk-justifications,liveontologies/elk-justifications,liveontologies/elk-justifications,liveontologies/elk-justifications | src/scripts/record_summary.r | src/scripts/record_summary.r | #!/usr/bin/env Rscript
queryCol = "query"
timeoutCol = "didTimeOut"
args <- commandArgs(TRUE)
requiredArgCount = 1
if(length(args) < requiredArgCount) {
cat(sprintf("Expected %d arguments!\n", requiredArgCount))
q(status=1)
}
X <- read.csv(args[1])
nRecords = length(X[[queryCol]])
nTimeouts = sum(X[[timeoutCol]])... | apache-2.0 | R | |
a94bbb2c5e847c211181539b507769072fc485eb | Add script for prepping clinical data. | pschulam-attic/sclero | inst/R/create-clinic-data.r | inst/R/create-clinic-data.r | options(stringsAsFactors = FALSE)
library(plyr)
library(reshape2)
source("inst/R/sclerodata-path.r")
clinic.csv <- file.path(sclerodata.path, "tVisit.csv")
clinic.rdata <- file.path("data", "clinic.rdata")
clinic.raw <- read.csv(clinic.csv)
keep.columns <- c(
"PtID", "Visit.Date", "Total.Skin.Score",
"Skin.S... | mit | R | |
4830dfea98eca51a938e5a018830c301302cc4f7 | Create runShinyApp.r | xiaodaigh/shinydistro | windows/runShinyApp.r | windows/runShinyApp.r | options(browser = "../../../../Apps/GoogleChromePortable/GoogleChromePortable.exe")
.libPaths("../library")
shiny::runApp("../../../../Apps/your_app/Shiny/",port=8888,launch.browser=TRUE)
| mit | R | |
da2604e96c6526239e81219b30f60cb94af0a998 | Add path helper functions for testing | klmr/modules,klmr/modules | inst/tests/helper-paths.r | inst/tests/helper-paths.r | realpath = function (path) {
if (.Platform$OS.type == 'unix')
system(paste('realpath -m -s', shQuote(path.expand(path))), intern = TRUE)
else
normalizePath(path, mustWork = FALSE)
}
expect_paths_equal = function (actual, expected) {
actual_norm = realpath(merge_path(actual))
expected_no... | apache-2.0 | R | |
d5b5262da25fad1615b1d2fd2981e3fa00b2651e | 更新:第七章fig7-13 | shuaimeng/r | thesis/chap7/fig7-13.r | thesis/chap7/fig7-13.r | dyn.load('/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/server/libjvm.dylib')
library(rJava)
setwd("/Users/mengmengjiang/all datas/print")
library(xlsx)
# reading ux and sy
k1<-read.xlsx("doty.xlsx",sheetName="600",header=TRUE)
k2<-read.xlsx("doty.xlsx",sheetName="1khz",header=TRUE)
k3<-r... | mit | R | |
987d196cc29466d759ca3abf4e896c6ec840ada4 | Create try.xgboost.v3.r | minesh1291/MachineLearning,minesh1291/MachineLearning,minesh1291/MachineLearning | myPracticeGCE/try.xgboost.v3.r | myPracticeGCE/try.xgboost.v3.r | rm(list=ls())
#library(caret) # for dummyVars
#library(RCurl) # download https data
library(Metrics) # calculate errors
library(xgboost) # model
###############################################################################
MultiLogLoss <- function(act, pred)
{
eps = 1e-15;
nr <- nrow(pred)
pred = matrix(sappl... | apache-2.0 | R | |
259b43390b326d0b540a23e26871fee8b18070bf | Create unit test | bcohn12/figure_6_histogram_heatmap | unit_test.r | unit_test.r |
library(testthat)
#library("pkg")
#test_package("pkg")
source('vectormap.r')
source('distal_progression_csv_filename_list.r')
test_that('Sort the list in numerical ascending order', {
test_list <- c(
"finger_forcevector_0.0_1484767835427.csv",
"finger_forcevector_0.461446320481747_1484785251285.csv",
"fi... | mit | R | |
0a20d3ddebe692ead011ddaab38b408a4f4c952a | make rarefraction plots | jason-weirather/Au-public,jason-weirather/Au-public,jason-weirather/Au-public,jason-weirather/Au-public | iron/code/lr_qc/utilities/plot_annotation_rarefractions.r | iron/code/lr_qc/utilities/plot_annotation_rarefractions.r | #!/opt/R/3.2.1/bin/Rscript
args=commandArgs(trailingOnly=TRUE)
outfile = args[1]
type = args[2]
remainder = args[seq(3,length(args))]
names = remainder[seq(1,length(remainder),2)]
errcol = remainder[seq(2,length(remainder),2)]
filex = substr(outfile,nchar(outfile)-2,nchar(outfile))
if(filex=="pdf") {
pdf(outfile)
}... | apache-2.0 | R | |
12f0cc176200dbede28f11d8a1321b8e9f8b007e | Create slc_vaccination_heatmap.r | chakers/R-Vaccination-Heatmap | slc_vaccination_heatmap.r | slc_vaccination_heatmap.r | #First we need to load the RSocrata package. You may need to install it first.
require(RSocrata)
#Next we will need the plyr package.
require(plyr)
#Now we'll load the dataframe.
slc <- read.socrata("https://opendata.utah.gov/Health/Salt-Lake-School-District-Vaccinations-2014/yud6-5333")
head(slc) #Let's see wha... | cc0-1.0 | R | |
38347f08fe5a7af9b3953dec6bc09807dbbbda0c | Add computing_frequencies function | dennis95stumm/bioinformatics_algorithms,dennis95stumm/bioinformatics_algorithms | computing_frequencies.r | computing_frequencies.r | source("pattern_to_number.r")
computing_frequencies <- function(text, k) {
frequency_array <- array(0, 4^k)
for(i in 0:(nchar(text) - k)) {
pattern <- substr(text, i + 1, i + k)
j <- pattern_to_number(pattern)
frequency_array[j + 1] <- frequency_array[j + 1] + 1
}
return(frequency_array)
}
# mess... | mit | R | |
bcedf08a8f1c67cd8c881e1aecf4ead582f60653 | Add some R codes for ex.1.9.6. | fenguoerbian/NotesAndSolutions | A_Probability_Path/Codes/ex.1.9.6.plot.r | A_Probability_Path/Codes/ex.1.9.6.plot.r | x <- 1
y <- 1
theta <- 2/5
n <- 100
plot(c(-2,2),c(-2,2),type="n")
abline(v=0)
abline(h=0)
for(i in 0:n) {
angle <- complex(real = cos(2*pi*theta*i), imaginary = sin(2*pi*theta*i))
point <- complex(real = x, imaginary = y)
point0 <- point * angle
x1 <- Re(point0)
y1 <- Im(point0)
segments(x1,y1,-y1,x1,col... | agpl-3.0 | R | |
15d1f8cecd5b9bd4842252164417936ef750a3f8 | Add viz for common point data | tdunning/log-synth,parrottsquawk/log-synth,smarthi/log-synth,smarthi/log-synth,samklr/log-synth,samklr/log-synth,tdunning/log-synth,codeaudit/log-synth,codeaudit/log-synth,tdunning/log-synth,parrottsquawk/log-synth,parrottsquawk/log-synth,codeaudit/log-synth,smarthi/log-synth,samklr/log-synth | src/test/R/plot-fraud.r | src/test/R/plot-fraud.r | scores = read.delim("scores.tsv")
counts = read.delim("counts.tsv")
growth = read.delim("growth.tsv")
pdf("scores.pdf", width=4, height=3, pointsize=10)
old = par(mar=c(5.1, 4.5,3.1,2.1))
plot(score ~ merchant, data=scores, cex=0.5, col=rgb(0,0,0,alpha=0.7), pch=21,
main="LLR score for different merchants", ylab=... | apache-2.0 | R | |
68aa66eb4b645a780e9a05310b620a4e88093228 | Add libraries for Stat 131a. | berkeley-dsep-infra/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub,ryanlovett/datahub | deployments/r/image/extras.d/stat-131a.r | deployments/r/image/extras.d/stat-131a.r | #!/usr/bin/env Rscript
source("/tmp/class-libs.R")
class_name = "Stat 131a"
class_libs = c(
"learnr", "0.9.2"
)
class_libs_install_version(class_name, class_libs)
devtools::install_github('DataComputing/DataComputing', ref='d5cebba', upgrade_dependencies = FALSE)
| bsd-3-clause | R | |
702a01a1f8eaf3afa4485447cc6f9a3baf21be1b | Add script to tidy heatmap.r nested structure into dfs by station | isithot/isithotrightnow,isithot/isithotrightnow,isithot/isithotrightnow,isithot/isithotrightnow,isithot/isithotrightnow | heatmap-tidy.r | heatmap-tidy.r | # heatmap-tidy.r: take the nested list structure of station_set
# (from heatmap.r) and convert it to a tidy dataframe of all obs and
# all stations. then chop it up by station nand year and export to csv
# so that main_static.r can use it.
library(tidyverse)
library(purrr)
select = dplyr::select
filter = dplyr::filter... | mit | R | |
d79d5a86dab94ab4704c7bd55c3f318228ec0a2c | Create WDIplot.r | tessam30/ggplotFun | WDIplot.r | WDIplot.r | # ---- Download WDI package and install
# --- Install World Development Indicators API if not already installed
install.packages("WDI")
# --- Clear the workspace
remove(list = ls())
# --- Load libraries & set working directory
libs <- c ("ggplot2", "dplyr", "RColorBrewer", "grid", "WDI", "zoo", "lubridate")
# --- L... | apache-2.0 | R | |
caf8e9389ce6215c66b454d904ea1a808069269b | Refactor codon-anticodon calculation | klmr/codons,klmr/codons | scripts/translation-efficiency-test-sets.r | scripts/translation-efficiency-test-sets.r | define_contrasts = function (config) {
all_celltypes = unique(data$mrna_design(config)$Celltype)
healthy_celltypes = intersect(all_celltypes, c('Liver-Adult', 'E15.5'))
cancer_celltypes = setdiff(all_celltypes, healthy_celltypes)
all_contrasts = expand.grid(Codon = unique(all_celltypes),
... | apache-2.0 | R | |
bdc9057e2eeef287d2da275711b476218a9eeb39 | Create power.communityInterven.r | aomidpanah/power | power.communityInterven.r | power.communityInterven.r | ## program:
## purpose: community intervention setting where intervention is rolled out 3 years after control
## follow-up. There is unknown attrition and we are interested in estimating the effect
## of intervention accounting for time dependent trends
nyear <- 4
year <- seq(0, nyear-1)
denom <- rep... | lgpl-2.1 | R | |
59c82b31f7ed51ba46b4b5c7041e100a0be22a05 | Create plot_traffic.r | msmith91/google_traffic,msmith91/google_traffic | plot_traffic.r | plot_traffic.r | #Script to read in the data output from traffic_times.py and plot the average
#travel durations at each 10 minute interval across the three model types
traffic=read.csv('/Users/Mike/Downloads/schaumburg_traffic.csv')
traffic$time = paste(traffic$hour,traffic$minute,sep='.')
traffic$time_nb = as.numeric(traffic$time)
... | mit | R |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.