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 |
|---|---|---|---|---|---|---|---|---|
dd101c1ee6ca92c29a9e87894ed3876bc753e0fd | fix argument diff checking | mschubert/clustermq,mschubert/clustermq,mschubert/clustermq | R/check_args.r | R/check_args.r | #' Function to check arguments with which Q() is called
#'
#' @param fun A function to call
#' @param iter Objects to be iterated in each function call
#' @param const A list of constant arguments passed to each function call
#' @return Processed iterated argument list if 'iter' is a list
#' @keywords i... | #' Function to check arguments with which Q() is called
#'
#' @param fun A function to call
#' @param iter Objects to be iterated in each function call
#' @param const A list of constant arguments passed to each function call
#' @return Processed iterated argument list if 'iter' is a list
#' @keywords i... | apache-2.0 | R |
09ad9c1693a1a5d268747ed4ba25842b3c3081a8 | set to 0, negative values do not make sense | khufkens/phenor | R/cost_functions.r | R/cost_functions.r | #' A Root Mean Squared Error cost function for model optimization.
#'
#' @param par a vector of parameter values, this is functions specific
#' @param data nested data structure with validation data as returned
#' by format_phenocam() or format_pep725(), or your own dataset adhering
#' to the same data structure.
#' @p... | #' A Root Mean Squared Error cost function for model optimization.
#'
#' @param par a vector of parameter values, this is functions specific
#' @param data nested data structure with validation data as returned
#' by format_phenocam() or format_pep725(), or your own dataset adhering
#' to the same data structure.
#' @p... | agpl-3.0 | R |
6664f3f66c3ec1caafbed4389595868fa1f0f498 | Clean up multivariate models. | jtobin/bnp | finite-gaussian-mixture/src/fmm_multivariate_generative.r | finite-gaussian-mixture/src/fmm_multivariate_generative.r | require(gtools)
require(magrittr)
require(mvtnorm)
mixing_model = function(k, a) drop(rdirichlet(1, (rep(a, k))))
label_model = function(n, p) {
vals = drop(rmultinom(1, size = n, prob = p))
delabel(lapply(vals, list))
}
location_model = function(k, l, r) {
vals = rmvnorm(k, l, solve(r))
delabel(apply(vals,... | require(gtools)
require(magrittr)
require(mvtnorm)
mixing_model = function(k, a) drop(rdirichlet(1, (rep(a, k))))
label_model = function(n, p) drop(rmultinom(1, size = n, prob = p))
location_model = function(k, l, r) rmvnorm(k, l, solve(r))
precision_model = function(k, b, w) rinvwishart(k, b, solve(w))
param... | mit | R |
0930214af96f95d5aeccdce323f15f0a35ecdb51 | Send content-length header | earl/rebol3 | scripts/shttpd.r | scripts/shttpd.r | REBOL [title: "A tiny static HTTP server" author: 'abolka date: 2009-11-04]
code-map: make map! [200 "OK" 400 "Forbidden" 404 "Not Found"]
mime-map: make map! [
"html" "text/html" "css" "text/css" "js" "application/javascript"
"gif" "image/gif" "jpg" "image/jpeg" "png" "image/png"
"r" "text/plain" "r3" "te... | REBOL [title: "A tiny static HTTP server" author: 'abolka date: 2009-11-04]
code-map: make map! [200 "OK" 400 "Forbidden" 404 "Not Found"]
mime-map: make map! [
"html" "text/html" "css" "text/css" "js" "application/javascript"
"gif" "image/gif" "jpg" "image/jpeg" "png" "image/png"
"r" "text/plain" "r3" "te... | apache-2.0 | R |
737342701d6b837f4a7b642dedbb33f96dc3a2fe | make shinyapps.io happy when we include a markdown document in the app | smouksassi/interactiveforestplot | global.r | global.r | suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(tidyr))
suppressPackageStartupMessages(library(egg))
suppressPackageStartupMessages(library(ggplot2))
suppressPackageStartupMessages(library(ggstance))
suppressPackageStartupMessages(library(shiny))
suppressPackageStartupMessages(l... | suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(tidyr))
suppressPackageStartupMessages(library(egg))
suppressPackageStartupMessages(library(ggplot2))
suppressPackageStartupMessages(library(ggstance))
suppressPackageStartupMessages(library(shiny))
suppressPackageStartupMessages(l... | mit | R |
d4711b11ccc0c78f695af1fa48d46b5f565e8cb7 | Check against double-registration of methods | klmr/modules,klmr/modules | R/S3.r | R/S3.r | register_S3_method = function (name, class, method) {
module = environment(method)
attr(module, 'S3') = c(attr(module, 'S3'), paste(name, class, sep = '.'))
registerS3method(name, class, method, module)
}
#' @param function_name function name as character string
is_S3_user_generic = function (function_name... | register_S3_method = function (name, class, method) {
module = environment(method)
attr(module, 's3') = c(attr(module, 's3'), method)
registerS3method(name, class, method, module)
}
#' @param function_name function name as character string
is_S3_user_generic = function (function_name, envir = parent.frame(... | apache-2.0 | R |
6ceb7c3be63517d30359b8cc44b570ca0ac8c763 | Use with block | thoolihan/GoogleAnalyticsRExample | explore.r | explore.r |
data <- read.csv("~/workspace/data/ga2-hoolihan.csv", sep=",")
with(data, {
Day.Index <- as.Date(Day.Index, format="%m/%d/%Y")
plot(Day.Index,
Pageviews,
xlab = "Date",
type = "b")
})
|
# data <- read.csv("~/workspace/data/ga-hoolihan.csv", sep=",")
data <- read.csv("~/workspace/data/ga2-hoolihan.csv", sep=",")
data$Day.Index <- as.Date(data$Day.Index, format="%m/%d/%Y")
plot(data$Day.Index,
data$Pageviews,
xlab = "Date",
type = "b")
| unlicense | R |
87d26b2badb42d15e55cb124312a30c4b75ab2bd | fix random forest | CodeMySky/KDD99 | ood/hybrid.train.test.r | ood/hybrid.train.test.r | hybrid.train.test <- function(data.set) {
#feature.selection = c(2,3,4,5,6,12,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41)
feature.selection = 1:41
train.data = data.set[['training']]
test.data = data.set[['testing']]
# First layer, use decision tree to classify is.attack
println('Training n... | hybrid.train.test <- function(data.set) {
#feature.selection = c(2,3,4,5,6,12,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41)
feature.selection = 1:41
train.data = data.set[['training']]
test.data = data.set[['testing']]
# First layer, use decision tree to classify is.attack
println('Training n... | mit | R |
20fe2d98b383feee1fe429c8a519852b2603cbd3 | remove rescaling in sensitivity analysis to prevent overflow | wkmor1/voiWoodland | R/sensitivity_BI.r | R/sensitivity_BI.r | sensitivity_BI <- function(dir, newdata, manage, param, n, verbose=FALSE) {
sensitivity_BI_obj <- vector('list', n); gc(FALSE)
param_values <- seq(
min(newdata[[manage]][, param]),
max(newdata[[manage]][, param]),
length=n)
for (i in seq_len(n)) {
inputs <- newdata
inputs[[manage]... | sensitivity_BI <- function(dir, newdata, manage, param, n, verbose=FALSE) {
sensitivity_BI_obj <- vector('list', n); gc(FALSE)
param_values <- seq(
min(newdata[[manage]][, param]),
max(newdata[[manage]][, param]),
length=n)
for (i in seq_len(n)) {
inputs <- newdata
inputs[[manage]... | mit | R |
e66fd8313dbf0cc558055f22b97c31b93aa80d0d | make generated binaries owner-executable | rheber/red,NikolayShubenkovProgSchool/red,vehar/red,red-eco/red,iArnold/red,NikolayShubenkovProgSchool/red,rheber/red,iArnold/red,vehar/red,red-eco/red | red-system/linker.r | red-system/linker.r | REBOL [
Title: "Red/System linker"
Author: "Nenad Rakocevic"
File: %linker.r
Rights: "Copyright (C) 2011 Nenad Rakocevic. All rights reserved."
License: "BSD-3 - https://github.com/dockimbel/Red/blob/master/BSD-3-License.txt"
]
linker: context [
verbose: 0 ;-- logs verbosity level
version: 1.0.0
cpu-... | REBOL [
Title: "Red/System linker"
Author: "Nenad Rakocevic"
File: %linker.r
Rights: "Copyright (C) 2011 Nenad Rakocevic. All rights reserved."
License: "BSD-3 - https://github.com/dockimbel/Red/blob/master/BSD-3-License.txt"
]
linker: context [
verbose: 0 ;-- logs verbosity level
version: 1.0.0
cpu-... | bsd-3-clause | R |
46e95998eb2b38775a0d340edc09b803c22de041 | Update ui.r | aleksandrov2/APPR-2015-16 | shiny/ui.r | shiny/ui.r | library(shiny)
shinyUI(
ui <- fluidPage(
titlePanel("Analiza dolga in primankljaja držav v Evropski uniji"),
sidebarLayout(
sidebarPanel(
sliderInput(inputId="leto_1",label="Leto",min=2006,max=2014,value=2007,sep=""),
sliderInput(inputId="leto_2",label="Leto",min=2006,max=2014,value... | library(shiny)
shinyUI(
ui <- fluidPage(
titlePanel("Analiza dolga in primankljaja držav v Evropski uniji"),
sidebarLayout(
sidebarPanel(
sliderInput(inputId="leto_1",label="Leto",min=2006,max=2014,value=2007,step=1),
sliderInput(inputId="leto_2",label="Leto",min=2006,max=2014,value=2007,step=1),... | mit | R |
52fee1d07e1be1c37dd90a2cc4e48b709660a42e | use older version of colorspace package | davesteps/heroku-buildpack-r,davesteps/heroku-buildpack-r,hrbrmstr/heroku-buildpack-r,garfieldsam/r-buildpack-test,brenocarvalho/heroku-buildpack-r,garfieldsam/r-buildpack-test,brenocarvalho/heroku-buildpack-r,garfieldsam/r-buildpack-test,davesteps/heroku-buildpack-r,garfieldsam/r-buildpack-test,adriancowham/heroku-bui... | test/ggplot2/init.r | test/ggplot2/init.r | #
# Example R code to install packages
# See http://cran.r-project.org/doc/manuals/R-admin.html#Installing-packages for details
#
###########################################################
# Update this line with the R packages to install:
# install older version of colorspace package
install.packages("http://cran.r... | #
# Example R code to install packages
# See http://cran.r-project.org/doc/manuals/R-admin.html#Installing-packages for details
#
###########################################################
# Update this line with the R packages to install:
my_packages = c("ggplot2")
#################################################... | mit | R |
cbada6f23fda47774e1135772f694f048a9f2c8f | update sample.rb output. | akr/clockcount,akr/clockcount | README.rd | README.rd | = clockcount
clockcount access processor specific clock counter.
== Usage
require 'clockcount'
p ClockCount()
== Sample Script to Mesure Clock Speed
% ruby sample.rb
0x171faf0c3cbed
0x171fb3e46f666 1.30258316772774[GHz]
0x171fb8a2981c2 1.27298907227854[GHz]
0x171fbd7ae77dc 1.30054508000412[GHz]
0x... | = clockcount
clockcount access processor specific clock counter.
== Usage
require 'clockcount'
p ClockCount()
== Sample Script to Mesure Clock Speed
% ruby sample.rb
371254883337042 1250109646.8873[clock/sec]
371256128197122 1244767967.17043[clock/sec]
371257378461133 1250206501.50093[clock/sec]
... | bsd-2-clause | R |
ea452b7c5f7ac45a92aa62ca844b75bfff2d429a | fix typo | sestaton/sesbio,sestaton/sesbio,sestaton/sesbio,sestaton/sesbio | transposon_annotation/transposon_annotation_R_scripts/hann_lines_analysis.r | transposon_annotation/transposon_annotation_R_scripts/hann_lines_analysis.r | library(plyr)
library(ggplot2)
setwd("Desktop/Hannuus_lines_repeat_analysis")
lines <- read.table("all_lines_family_stats_6-30.tsv",header=T,sep="\t",comment.char="")
lines.filtered <- lines[lines$GenomeFrac >= 0.01,]
ggplot(alllines.filt, aes(x=reorder(Identifier, GenomeFrac), y=GenomeFrac)) + geom_bar(aes(fill=Family... | library(plyr)
library(ggplot2)
setwd("Desktop//Hannuus_lines_repeat_analysis")
lines <- read.table("all_lines_family_stats_6-30.tsv",header=T,sep="\t",comment.char="")
lines.filtered <- lines[lines$GenomeFrac >= 0.01,]
ggplot(alllines.filt, aes(x=reorder(Identifier, GenomeFrac), y=GenomeFrac)) + geom_bar(aes(fill=Famil... | mit | R |
3d660e0ec7d182679ddee97fd9e791899ae7a1ed | Fix typo. | snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3 | q3/docs/AddressCreateMessageAction.rd | q3/docs/AddressCreateMessageAction.rd | =begin
=AddressCreateMessageANV
Ŏw肳ꂽ[AhXẴbZ[W쐬܂BbZ[W̍쐬ɂ́Amailto URL̊֘Atgp܂B
==
:1
[AhX
==LȃEBhEEr[
*AhXEBhE
=end
| =begin
=AddressDeleteANV
Ŏw肳ꂽ[AhXẴbZ[W쐬܂BbZ[W̍쐬ɂ́Amailto URL̊֘Atgp܂B
==
:1
[AhX
==LȃEBhEEr[
*AhXEBhE
=end
| mit | R |
9933e6ba3f12c5a4dbfdcabff1319278487954f8 | Include 2010 | hadley/r-on-github | 1a-search.r | 1a-search.r | library(lubridate)
library(plyr)
source("requests.r")
search_repo <- function(query, page = NULL) {
Sys.sleep(12)
path <- paste0(base, "/search/repositories")
qs <- list(q = paste("language:r", query), per_page = 100, page = page)
req <- GET(path, config, query = qs)
c <- content(req)
if (req$status_cod... | library(lubridate)
library(plyr)
source("requests.r")
search_repo <- function(query, page = NULL) {
Sys.sleep(12)
path <- paste0(base, "/search/repositories")
qs <- list(q = paste("language:r", query), per_page = 100, page = page)
req <- GET(path, config, query = qs)
c <- content(req)
if (req$status_cod... | mit | R |
f2ed79aa897b1801b7a302d11f898dac87243315 | add roxygen help to R/read.r | snoweye/pbdPROF,snoweye/pbdPROF,RBigData/pbdPROF,RBigData/pbdPROF,snoweye/pbdPROF,RBigData/pbdPROF | R/read.r | R/read.r | ### For reading profile outputs.
which.profiler <- function(file.name)
{
test <- readLines(file.name, n=1)
if(length(grep(pattern="FPMPI", x=test)) > 0)
return( 'fpmpi' )
else if(length(grep(pattern="mpiP", x=test)) > 0)
return ('mpip')
else
stop("This profiler is not implemented at this time.")
... | ### For reading profile outputs.
which.profiler <- function(file.name)
{
test <- readLines(file.name, n=1)
if(length(grep(pattern="FPMPI", x=test)) > 0){
return( 'fpmpi' )
} else if(length(grep(pattern="mpiP", x=test)) > 0){
return ('mpip')
} else{
stop("This profiler is not implemented at this t... | mpl-2.0 | R |
ebcd1c295c689bf43eac7379163b9dc354cacd36 | update logo | data-skeptic/dataskeptic,kylepolich/dataskeptic,data-skeptic/dataskeptic,kylepolich/dataskeptic,kylepolich/dataskeptic,data-skeptic/dataskeptic,kylepolich/dataskeptic,data-skeptic/dataskeptic,kylepolich/dataskeptic,data-skeptic/dataskeptic,kylepolich/dataskeptic | logo/logo.r | logo/logo.r | x = seq(-4,4,length=200)
png("logo.png", width=600, height=300)
par(mar=c(4,5,1,1))
plot(x, dnorm(x), type='l', ylab="Pr(x)", xlab=expression(sigma), cex.lab=2, lwd=3, axes=FALSE)
axis(1)
axis(2)
alpha=.2
col = rgb(0,.5,0,alpha)
text(0, .35, expression(mu), col=col, cex=4.5)
text(-.5, .27, expression(delta), col=col, c... | png("logo.png", width=600, height=200)
x = seq(-4,4,length=200)
par(mar=c(4,5,1,1))
png(filename="logo.png")
plot(x, dnorm(x), type='l', ylab="Pr(x)", xlab=expression(sigma), cex.lab=2, lwd=3, axes=FALSE)
axis(1)
axis(2)
alpha=.2
col = rgb(0,.5,0,alpha)
text(0, .35, expression(mu), col=col, cex=4.5)
text(-.5, .27, expr... | cc0-1.0 | R |
3a6c63b0da21dfa00e6bfcbe486904dfd4f0ec39 | Update Main.r | bgweber/RServer,bgweber/RServer,bgweber/RServer,bgweber/RServer | tasks/HelloWorld/Main.r | tasks/HelloWorld/Main.r | # Copyright (C) 2016 Electronic Arts Inc. All rights reserved.
print("Hello World!")
| print("Hello World!")
| bsd-3-clause | R |
89ccb0e0c8c41644243c035a196cf22ed5d9a6b7 | Clean up load | petercarrjones/icc-data,petercarrjones/icc-data,petercarrjones/icc-data | load.r | load.r | #Load Packages
library(XML)
library(tidyr)
library(stringr)
library(magrittr)
library(plyr)
library(dplyr)
library(RWeka)
#Remove non-words from the raw icc texts
get_real_words <- function(word) {
word[!stringr::str_detect(word, "[^a-z ]")]
}
#' Remove unreasonable n-grams containing characters other than letters... | #Load Packages
library(XML)
library(tidyr)
library(stringr)
library(magrittr)
library(dplyr)
library(RWeka)
#load OCR'd ICC Deceisions data into R
icc_dir <- "text"
files <- dir(icc_dir, "*.txt")
raw <- file.path(icc_dir, files) %>%
lapply(., scan, "character", sep = "\n")
names(raw) <- files
icc_texts <- lapply(ra... | mit | R |
40fc45a0d0df62fb438ce41a666516b430b5564d | Update ui.r | aleksandrov2/APPR-2015-16 | shiny/ui.r | shiny/ui.r | library(shiny)
shinyUI(
ui <- fluidPage(
titlePanel("Analiza dolga in primankljaja držav v Evropski uniji"),
tabsetPanel(
tabPanel("Dolg",
sliderInput(inputId="leto_1",label="Leto",min=2006,max=2014,value=2007,sep=""),
plotOutput("dolg")),
tabPanel("Deficit",
... | library(shiny)
shinyUI(
ui <- fluidPage(
titlePanel("Analiza dolga in primankljaja držav v Evropski uniji"),
sidebarLayout(
sidebarPanel(
sliderInput(inputId="leto_1",label="Leto",min=2006,max=2014,value=2007,sep=""),
sliderInput(inputId="leto_2",label="Leto",min=2006,max=2014,value... | mit | R |
90e62e0033dd48c08f1fb06d0074b074deb91e77 | Move initialisation code after function definition | klmr/ggplots | fonts.r | fonts.r | 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... | 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 |
607c1b62599d5239d94988174f1520bb5075ba9d | add default value max_row to 50 | agapow/smartr,thehyve/naa-SmartR,thehyve/heim-SmartR,thehyve/naa-SmartR,thehyve/heim-SmartR,thehyve/naa-SmartR,thehyve/heim-SmartR,agapow/smartr,agapow/smartr,agapow/smartr,thehyve/heim-SmartR | web-app/HeimScripts/heatmap/run.r | web-app/HeimScripts/heatmap/run.r | library(jsonlite)
library(reshape2)
main <- function(max_rows=50){
df <- loaded_variables[[1]] # SmartR does not support multiple HDD nodes yet
if(ncol(df) > 3){
variances <- apply(df[,3:ncol(df)],1,var) # Calculating variance per probe
df["variance"] <- variances
df <- df[with(df, order(-variance)), ... | library(jsonlite)
library(reshape2)
main <- function(max_rows){
df <- loaded_variables[[1]] # SmartR does not support multiple HDD nodes yet
if(ncol(df) > 3){
variances <- apply(df[,3:ncol(df)],1,var) # Calculating variance per probe
df["variance"] <- variances
df <- df[with(df, order(-variance)), ]
... | apache-2.0 | R |
b12294ae24b87b0cb60aeaa445c4a9c5b6254556 | fix main.r | wikimedia-research/Blockr | main.r | main.r | #Blockr - a project to accurately triage data on blocked Wikipedia users, identify
#the underlying rationales and test various hypotheses as to any outcome
#
# @Year = 2013
# @Copyright: Oliver Keyes
# @License = MIT (http://opensource.org/licenses/MIT)
#Load
source(file = file.path(getwd(),"config.r")) #Config variab... | #Blockr - a project to accurately triage data on blocked Wikipedia users, identify
#the underlying rationales and test various hypotheses as to any outcome
#
# @Year = 2013
# @Copyright: Oliver Keyes
# @License = MIT (http://opensource.org/licenses/MIT)
#Load
source(file = file.path(getwd(),"config.r")) #Config variab... | mit | R |
1fcf3f1d187cb30bb8e082df346c7f21844952af | set queries in parallel | QUICC-FOR/STModel-Strip | 1_getFutClim.r | 1_getFutClim.r | # load libs
library("doParallel")
# read list of GCMs
GCM_df <- read.csv("./data/list_GCM.csv")
GCM_df <- subset(GCM_df, scenario == 'rcp85')
windows <- seq(2000,2095,5)
out_folder <- "./data/futClimSTM/"
# open cluster
cl <- makeCluster(20)
registerDoParallel(cl)
for (x in 1:dim(GCM_df)[1]){
system(paste("mkdi... | # open the db connection
source('./con_quicc_db.r')
# load libs
library("RPostgreSQL")
# read list of GCMs
GCM_df <- read.csv("./data/list_GCM.csv")
GCM_df <- subset(GCM_df, scenario == 'rcp85')
windows <- seq(2000,2095,5)
out_folder <- "./out_files/futClimSTM/"
for (x in 1:dim(GCM_df)[1]){
system(paste("mkdir ... | mit | R |
ab540aae1363726de770756ca17364678891d3fe | correct url | AndySouth/coverage | inst/shiny/covmob1/server.r | inst/shiny/covmob1/server.r | #coverage/inst/shiny/covmob1/ui.r
#andy south 12/5/16
#https://andysouth.shinyapps.io/covmob1/
library(shiny)
#library(devtools)
#install_github('AndySouth/coverage')
library(coverage)
library(png)
shinyServer(function(input, output, session) {
################################
output$plot_feed <- renderPlot({
... | #coverage/inst/shiny/covmob1/ui.r
#andy south 12/5/16
#https://andysouth.shinyapps.io/coverage1/
library(shiny)
#library(devtools)
#install_github('AndySouth/coverage')
library(coverage)
library(png)
shinyServer(function(input, output, session) {
################################
output$plot_feed <- renderPlot(... | mit | R |
1afbe2bf9c28fe22f56c6d208744d7bafb687ba2 | update launch | YvesCR/blog_dev_mm,YvesCR/blog_dev_mm,YvesCR/blog_dev_mm,YvesCR/blog_dev_mm | launch.r | launch.r |
## build the blog:
# check the path. Should be "C:/blog/gen"
getwd()
# we don't want split images
options("base64_images")
# serve the blog subfolder:
servr::jekyll(input = "_source", output = "_posts")
|
## build the blog:
# check the path. Should be "C:/blog/gen"
getwd()
# we don't want split images
options("base64_images")
# serve the blog subfolder: basically, the dev version
servr::jekyll(input = "_source", output = "_posts")
| mit | R |
ae3472b3ccf4d83187c7a60828442b1663c2bd5e | Fix xrange to work in data.frame | klmr/.files,klmr/.files,klmr/.files | .R/colon.r | .R/colon.r | `:` = function (a, b) {
if (inherits(a, 'xrange'))
do.call(seq, as.list(c(range(a), by = b)))
else if (inherits(a, 'factor'))
interaction(a, b, sep = ':')
else
structure(seq(a, b), class = c('xrange', 'integer'))
}
print.xrange = function (x)
print(as.numeric(x))
| `:` = function (a, b) {
if (inherits(a, 'xrange'))
do.call(seq, as.list(c(range(a), by = b)))
else if (inherits(a, 'factor'))
interaction(a, b, sep = ':')
else
structure(seq(a, b), class = 'xrange')
}
print.xrange = function (x)
print(as.numeric(x))
| apache-2.0 | R |
9b245a3ac4c97d6ee9f3f0d273304ecd925fb08c | Update 1.r | glor/R,glor/R | aufgaben/blatt03/1.r | aufgaben/blatt03/1.r | #Blatt 3
#1.1 Datei lokal speichern
#1.2
maeuse = read.table(file="mice.txt", sep="t", dec=".", header=TRUE)
#1.3
boxplot(maeuse$speed ~ maeuse$health, date = maeuse, main = "kranke Maeuse" )
# Beide Gruppen sind normalverteilt, es gibt keine Aussreisser. (diese wuerden als Punkte ausserhalb der Boxen darge... | #Blatt 3
#1.1 Datei lokal speichern
#1.2
maeuse = read.table(file="mice.txt", sep="\t", dec=".", header=TRUE)
#1.3
boxplot(maeuse$speed ~ maeuse$health, date = maeuse, main = "kranke Maeuse" )
# Beide Gruppen sind ungefaehr normalverteilt, es gibt keine Aussreisser. (diese wuerden als Punkte ausserhalb ... | bsd-2-clause | R |
c642a8998a2c1edd4b187a4299d9d867d291d5b2 | generalize pdgemm wrapper | wrathematics/pbdBASE,RBigData/pbdBASE,RBigData/pbdBASE,wrathematics/pbdBASE,snoweye/pbdBASE,snoweye/pbdBASE,snoweye/pbdBASE,snoweye/pbdBASE,wrathematics/pbdBASE,RBigData/pbdBASE,RBigData/pbdBASE,wrathematics/pbdBASE | R/base_pblas_level3.r | R/base_pblas_level3.r | # ------------------------------------------------
# PDTRAN: Matrix transpose
# ------------------------------------------------
#' rpdtran
#'
#' Transpose.
#'
#' For advanced users only.
#'
#' @param a
#' Matrix.
#' @param desca,descc
#' ScaLAPACK descriptor array.
#'
#' @export
base.rpdtran <- function(a, desca... | # ------------------------------------------------
# PDTRAN: Matrix transpose
# ------------------------------------------------
#' rpdtran
#'
#' Transpose.
#'
#' For advanced users only.
#'
#' @param a
#' Matrix.
#' @param desca,descc
#' ScaLAPACK descriptor array.
#'
#' @export
base.rpdtran <- function(a, desca... | mpl-2.0 | R |
5bd1735f8e3a9ab38f61540a3994122784b18628 | Add a legend to plot | tdunning/t-digest-benchmark,tdunning/t-digest-benchmark | plot-data.r | plot-data.r | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 | R |
f02b7a0418012685514f333ad4671628c9ffa6d9 | Simplify `lsf` function | klmr/modules,klmr/modules | R/S3.r | R/S3.r | register_S3_method = function (name, class, method) {
module = environment(method)
attr(module, 'S3') = c(attr(module, 'S3'), paste(name, class, sep = '.'))
registerS3method(name, class, method, module)
}
#' @param function_name function name as character string
is_S3_user_generic = function (function_name... | register_S3_method = function (name, class, method) {
module = environment(method)
attr(module, 'S3') = c(attr(module, 'S3'), paste(name, class, sep = '.'))
registerS3method(name, class, method, module)
}
#' @param function_name function name as character string
is_S3_user_generic = function (function_name... | apache-2.0 | R |
2c31a05372bf9e8f8771773178619fecd1cbeb68 | Update 1.r | glor/R,glor/R | aufgaben/blatt09/1.r | aufgaben/blatt09/1.r | #9.1.1 Nein, es ist keine Korrektur erforderlich.
#9.1.2 Bei einer initialen Vermutung (die neue Polymerase ist besser/schlechter), bräuchte ich nur zwei Vergleiche durchführen (mit geplanten Kontrasten). (Alt-Polymerase gegen Neu-Polymerasen in Gruppe, dann die Neu-Polymerasen gegeneinander). Bei keiner Vermutung mus... | #9.1.1 Nein, es ist keine Korrektur erforderlich.
#9.1.2 Bei einer initialen Vermutung (die neue Polymerase ist besser/schlechter), bräuchte ich nur zwei Vergleiche durchführen (mit geplanten Kontrasten). (Alt-Polymerase gegen Neu-Polymerasen in Gruppe, dann die Neu-Polymerasen gegeneinander). Bei keiner Vermutung mus... | bsd-2-clause | R |
830b26b93821a391a80d9e7c854318862ceab2d8 | Update uvoz_tabele2.r | ZavbiA/APPR-2017 | uvoz/uvoz_tabele2.r | uvoz/uvoz_tabele2.r | library(rvest)
library(gsubfn)
library(readr)
library(dplyr)
library(tibble)
library(reshape2)
#tukaj opravim uvoz tabele drzav s stevilom prebivalcev v letih OI
data <- read_csv("podatki/populacija.csv",
skip = 4, locale = locale(encoding = "UTF-8"))
data[2] <- NULL
data[2] <- NULL... | library(rvest)
library(gsubfn)
library(readr)
library(dplyr)
library(tibble)
library(reshape2)
#tukaj opravim uvoz tabele drzav s stevilom prebivalcev v letih OI
data <- read_csv("podatki/populacija.csv",
skip = 4, locale = locale(encoding = "UTF-8"))
data[2] <- NULL
data[2] <- NULL... | mit | R |
4e7a63ab1ba88aef429e3e272da12cd3725b8c45 | Use arghs to make it more clean | HIIT/digivaalit-2015,HIIT/digivaalit-2015,HIIT/digivaalit-2015 | topics/check_k.r | topics/check_k.r | source('topics.r')
library("argparser")
p <- arg_parser("Find the best fit of a topic model thing")
p <- add_argument(p, "--plot", help="create a plot", flag=TRUE)
p <- add_argument(p, "--method", help="choose method in use", default = "logll")
p <- add_argument(p, "folder", help="folders to analyse")
args <- parse... | source('topics.r')
print( commandArgs(trailingOnly=TRUE) )
for( path in commandArgs(trailingOnly=TRUE) ) {
df = data.frame( k = integer(), ll =integer() )
for( f in list.files(path , pattern = '*.rdata') ){
load( paste(path, f, sep = '') )
k <- model@k
ll <- check_fitness_ll( model )
row = c(k, ll)
... | mit | R |
2bc07cfc8a513a0b56f375b031fb4f6412ea13e2 | Improve def example | raviqqe/tisp,raviqqe/tisp,tisp-lang/tisp,raviqqe/tisp,tisp-lang/tisp | examples/def.r | examples/def.r | (def foo 123)
(def bar 456)
(def (func x y)
"This function calculate (x + y)^3 + (x + y)^2 + (x + y)^1"
"It should be very useful."
(def z (+ x y))
(+ (^ z 3) (^ z 2) z))
(print (+ foo bar))
| (def foo 123)
(def bar 456)
(print (+ foo bar))
| mit | R |
3101f1271e967112432faeba3e9c7cc1482716b9 | Update BatchfeatureRemoval.r | phnmnl/workflow-demo,phnmnl/workflow-demo,phnmnl/workflow-demo,phnmnl/workflow-demo | BatchfeatureRemoval/BatchfeatureRemoval.r | BatchfeatureRemoval/BatchfeatureRemoval.r | #####################
# batchfeatures - output batch specific features
# to.remove=remove.batchfeatures(samples)
#
#####################
remove.batchfeatures <- function(samples) {
B1_samples=samples[,grep("B1", names(samples))]
B2_samples=samples[,grep("B2", names(samples))]
B3_samples=samples[,grep("B3", na... | #####################
# batchfeatures - output batch specific features
# to.remove=remove.batchfeatures(samples)
#
#####################
remove.batchfeatures <- function(samples) {
B1_samples=samples[,grep("B1", names(samples))]
B2_samples=samples[,grep("B2", names(samples))]
B3_samples=samples[,grep("B3", na... | apache-2.0 | R |
897994f92a92510fcbc0c5666f99a1cbf8e819a4 | Update ggplot2_formatter.r | jezdata/R,fdryan/R,1R151-1/R | ggplot2_formatter.r | ggplot2_formatter.r |
require(scales)
# ---------------------------------------------------------------------------------------------
# Formatting functions for ggplot graph axis
# ---------------------------------------------------------------------------------------------
#' Human Numbers: Format numbers so they're legible for humans
... |
require(scales)
# ---------------------------------------------------------------------------------------------
# Formatting functions for ggplot graph axis
# ---------------------------------------------------------------------------------------------
#' Human Numbers: Format numbers so they're legible for humans
... | unlicense | R |
4b0688549db2ebac7bda344ef7d1b6b432932015 | Tidy up simulation tests | tdjames1/soay_ibm | code_r/test_ibm.r | code_r/test_ibm.r | set.seed(23020306)
## Simple trial run. Initial population equally distributed between
## genotypes. Constant environment model parameters.
sim.len <- 50
init.pop <- 500
sim.out <- doSim(mParFixEf, sim.length=sim.len, init.pop.size=init.pop)
simRunSum <- summariseSimRun(sim.out)
pG <- (simRunSum$ntGG + 0.5*simRunSum$n... | set.seed(23020306)
## Simple trial run. Initial population equally distributed between
## genotypes. Constant environment model parameters.
sim.len <- 50
init.pop <- 500
sim.out <- doSim(mParFixEf, sim.length=sim.len, init.pop.size=init.pop)
simRunSum <- summariseSimRun(sim.out)
pG <- (simRunSum$ntGG + 0.5*simRunSum$n... | mit | R |
d884be1004403b3fd2665e696859de64e4989005 | Add sbatch_mail_types list | jmousseau/Stain | R/sbatch.r | R/sbatch.r | #' Create an SBATCH option
#'
#' @param key The key for the sbatch option.
#'
#' @return A function that takes a single argument representing
#' the value for the \code{key}.
sbatch_opt <- function(key) {
return(function(value) {
return(paste0("--", key, "=", value))
})
}
#' A list of sbatch options.
... | #' Create an SBATCH option
#'
#' @param key The key for the sbatch option.
#'
#' @return A function that takes a single argument representing
#' the value for the \code{key}.
sbatch_opt <- function(key) {
return(function(value) {
return(paste0("--", key, "=", value))
})
}
#' A list of sbatch options.... | mit | R |
86f7348c49ad97da8a6857776fc0ab49b4d97546 | Add sbatch_opts_insert for set insertion | jmousseau/Stain | R/sbatch.r | R/sbatch.r | #' Create an SBATCH option
#'
#' @param key The key for the sbatch option.
#'
#' @return A function that takes a single argument representing
#' the value for the \code{key}.
sbatch_opt <- function(key) {
return(function(value) {
return(paste0("--", key, "=", value))
})
}
#' Test sbatch options for eq... | #' Create an SBATCH option
#'
#' @param key The key for the sbatch option.
#'
#' @return A function that takes a single argument representing
#' the value for the \code{key}.
sbatch_opt <- function(key) {
return(function(value) {
return(paste0("--", key, "=", value))
})
}
#' Test sbatch options for eq... | mit | R |
86d1233eec612185f1e68256d963ecfa6324093f | move helper to zmq class | mschubert/clustermq,mschubert/clustermq,mschubert/clustermq | tests/testthat/helper-util.r | tests/testthat/helper-util.r | send = function(sock, data) {
send_socket(sock, data)
}
recv = function(p, sock, timeout=3L) {
event = poll_socket(list(sock), timeout=timeout * 1000)
if (is.null(event))
return(recv(p, sock, timeout=timeout))
else if (event[1]) {
re = receive_multipart(sock)
if (length(re) == 1... | send = function(sock, data) {
send_socket(sock, data)
}
recv = function(p, sock, timeout=3L) {
event = poll_socket(list(sock), timeout=timeout * 1000)
if (is.null(event))
return(recv(p, sock, timeout=timeout))
else if (event[1]) {
re = receive_multipart(sock)
if (length(re) == 1... | apache-2.0 | R |
fb52c03905a97abaa352de42495ffc4181285011 | Move to rini for auth details. | owainkenwayucl/stats-plus-plus,owainkenwayucl/stats-plus-plus,owainkenwayucl/stats-plus-plus,owainkenwayucl/stats-plus-plus | r/dbtools.r | r/dbtools.r | # Generic query wrapper to keep the MySQL nastiness out of the code.
dbquery <- function(db, query, mysqlhost="mysql.external.legion.ucl.ac.uk", mysqlport = 3306) {
# Pull in the RMySQL library and my tool for reading Python ini files.
(library(RMySQL))
source("r/rini.r")
# Get authentication information.
authd... | # Generic query wrapper to keep the MySQL nastiness out of the code.
dbquery <- function(db, query, mysqlhost="mysql.external.legion.ucl.ac.uk", mysqlport = 3306) {
# Pull in the RMySQL library and my tool for reading Python ini files.
(library(RMySQL))
source("r/pyconfconv.r")
# Get authentication information.
... | mit | R |
470f757d562e5377f7432e7ba25b8b9a9c15de8b | Fix but that wrongly cached environments | 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 |
a6b2693bd8151769cc799e81bbcc10654a85123e | Solve bug when extract terminal node | MarioJose/r-functions | drop.clade.label/extract.clade.label.r | drop.clade.label/extract.clade.label.r | extract.clade.label <- function(tree, node){
if(!is.vector(node, mode = "character") | length(node) > 1)
stop("'node' parameter must be a character vector of length 1")
if(sum(node %in% tree$node.label) == 0)
stop("tree has not node labels defined in 'node' parameter")
if(!is.rooted(tree))
stop(... | extract.clade.label <- function(tree, node){
if(!is.vector(node, mode = "character") | length(node) > 1)
stop("'node' parameter must be a character vector of length 1")
if(sum(node %in% tree$node.label) == 0)
stop("tree has not node labels defined in 'node' parameter")
if(!is.rooted(tree))
stop(... | mit | R |
afe7e771ca771ca3650be85304886f14ff4e585d | add common data redirect | 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")
start_worker = function(id="1", url="tcp://localhost:55443") {
p = parallel::mcparallel(worker(id, url, 1024))
msg = rzmq::receive.socket(socket)
testthat::expect_equal(msg$id,... | 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 |
671846c591383e0f476b2f46e3787526be71193b | change to try to initiate a travis build | RGLab/preprocessData,RGLab/preprocessData,RGLab/preprocessData | R/dataversion.r | R/dataversion.r |
#' Get the DataVersion for a package
#'
#' Retreives the DataVersion of a package if available
#' @param pkg \code{character} the package name
#' @param lib.loc \code{character} path to library location.
#' @seealso \code{\link[utils]{packageVersion}}
#' @import utils
#' @import futile.logger
#' @export
dataVersion <... |
#' Get the DataVersion for a package
#'
#' Retreives the DataVersion of a package if available
#' @param pkg \code{character} the package name
#' @param lib.loc \code{character} path to library location.
#' @seealso \code{\link[utils]{packageVersion}}
#' @import utils
#' @import futile.logger
#' @export
dataVersion <... | artistic-2.0 | R |
f5744bdfee72d0de5f5454defa690633bbb27733 | Add optional packages for visualisation | PascalLike/OSGeoLive,kalxas/OSGeoLive,OSGeo/OSGeoLive,PascalLike/OSGeoLive,OSGeo/OSGeoLive,astroidex/OSGeoLive,OSGeo/OSGeoLive,guygriffiths/OSGeoLive,astroidex/OSGeoLive,guygriffiths/OSGeoLive,astroidex/OSGeoLive,PascalLike/OSGeoLive,OSGeo/OSGeoLive,astroidex/OSGeoLive,astroidex/OSGeoLive,OSGeo/OSGeoLive,kalxas/OSGeoLi... | app-conf/R/installRpackages.r | app-conf/R/installRpackages.r | core <- c("classInt", "DCluster", "deldir", "geoR", "gstat", "maptools",
"RandomFields", "raster", "RColorBrewer", "rgdal", "sp", "spatstat",
"spdep", "splancs","spgrass6", "rgeos","ncdf", "RSAGA")
#optional <- c("ade4", "adehabitat", "adehabitatHR", "adehabitatHS", "adehabitatLT", "adehabitatMA", "ads", "akima", "ash... | core <- c("classInt", "DCluster", "deldir", "geoR", "gstat", "maptools",
"RandomFields", "raster", "RColorBrewer", "rgdal", "sp", "spatstat",
"spdep", "splancs","spgrass6", "rgeos","ncdf", "RSAGA")
#optional <- c("ade4", "adehabitat", "adehabitatHR", "adehabitatHS", "adehabitatLT", "adehabitatMA", "ads", "akima", "ash... | lgpl-2.1 | R |
789ba72d34024b761ee32e764853ad7c3b3fbc67 | Replace old-style R assignment operator | klmr/.files,klmr/.files,klmr/.files | .R/config.r | .R/config.r | options(pager = file.path(Sys.getenv('HOME'), '.R/pager.sh'),
# Imperial College London
repos = c(CRAN = 'http://cran.ma.imperial.ac.uk/'),
menu.graphics = FALSE, # Seriously, WHAT THE FUCK, R!?
import.path = '~/Projects/R',
devtools.name = 'Konrad Rudolph',
devtools.desc... | options(pager = file.path(Sys.getenv('HOME'), '.R/pager.sh'),
# Imperial College London
repos = c(CRAN = 'http://cran.ma.imperial.ac.uk/'),
menu.graphics = FALSE, # Seriously, WHAT THE FUCK, R!?
import.path = '~/Projects/R',
devtools.name = 'Konrad Rudolph',
devtools.desc... | apache-2.0 | R |
8ab47d3294167cc88516e9b95448330640847958 | Update run_analysis.r | mgazzar/GetNCleanData | run_analysis.r | run_analysis.r | # 1. init
install.packages(c("data.table", "dplyr"))
library(data.table)
library(dplyr)
if (!file.info("UCI HAR Dataset")$isdir) {
dataFile <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip"
dir.create("assignment")
download.file(dataFile, "assignment/UCI-HAR-dataset.zip"... | if (!file.info("UCI HAR Dataset")$isdir) {
dataFile <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip"
dir.create("assignment")
download.file(dataFile, "assignment/UCI-HAR-dataset.zip", method="curl")
unzip("assignment/UCI-HAR-dataset.zip")
}
# 1. Merges the training an... | apache-2.0 | R |
de3263a22c4269f6aed6a1b9e3c49996f9b6458a | Update Readme. | Zaid-Al-Omari/Telegram.Bot.Mvc | README.rd | README.rd | # Telegram.Bot.Mvc

An MVC-like framework to create Telegram bots compatable with *.Net Core 2.0*
* Just like Asp.net MVC.
* Establish command routes. (/start, /help, etc.)
* C... | # Telegram.Bot.Mvc

An MVC-like framework to create Telegram bots compatable with *.Net Core 2.0*
* Just like Asp.net MVC.
* Establish command routes. (/start, /help, etc.)
* ... | mit | R |
ce83d7c90ad188fa50b32cf9535b924f0f2acdbe | Replace undescriptive variable name | klmr/codons,klmr/codons | scripts/norm.r | scripts/norm.r | # Implement various helpers to normalise data.
# All these functions expect tidy data.
# TODO: All functions require documentation.
transform_counts = function (counts, fs, ...)
dplyr::mutate_each_(counts, dplyr::funs_(lazyeval::lazy(fs)),
dplyr:::dots(...))
fpkm = function (counts, transc... | # Implement various helpers to normalise data.
# All these functions expect tidy data.
# TODO: All functions require documentation.
transform_counts = function (counts, fs, ...)
dplyr::mutate_each_(counts, dplyr::funs_(lazyeval::lazy(fs)),
dplyr:::dots(...))
fpkm = function (counts, transc... | apache-2.0 | R |
95802920696f0736ea284180ca039a87193bbd76 | Update config.r | syberia/syberia | R/config.r | R/config.r | .github_packages <- list(
list('productivus', 'robertzk'),
list('Ramd', 'robertzk'),
list('frost', 'robertzk'),
list('stagerunner', 'robertzk'),
list('mungebitsTransformations', 'robertzk'),
list('mungebits', 'robertzk'),
list('tundra', 'robertzk')
)
| .github_packages <- list(
list('productivus', 'robertzk'),
list('Ramd', 'robertzk'),
list('frost', 'robertzk'),
list('stagerunner', 'robertzk')
list('mungebitsTransformations', 'robertzk'),
list('mungebits', 'robertzk'),
list('tundra', 'robertzk')
)
| mit | R |
a2b02cb493ec2914fdd2ab6c25bfdb8ae7194484 | improve `construct` performance (fixes #23) | mschubert/narray,mschubert/narray | R/construct.r | R/construct.r | #' A wrapper around reshape2::acast using a more intuitive formula syntax
#'
#' The construct() function can be called either with the data.frame as the
#' first argument or the formula and then specify `data=<data.frame>`
#'
#' @param data A data frame
#' @param formula A formula: value ~ axis1 [+ axi... | #' A wrapper around reshape2::acast using a more intuitive formula syntax
#'
#' The construct() function can be called either with the data.frame as the
#' first argument or the formula and then specify `data=<data.frame>`
#'
#' @param data A data frame
#' @param formula A formula: value ~ axis1 [+ axi... | apache-2.0 | R |
92cb0301b06efc6923bf638f54e592ddcb203ebf | Switch default MIME type to application/octet-stream | earl/rebol3 | scripts/shttpd.r | scripts/shttpd.r | REBOL [title: "A tiny static HTTP server" author: 'abolka date: 2009-11-04]
code-map: make map! [200 "OK" 400 "Forbidden" 404 "Not Found"]
mime-map: make map! [
"html" "text/html" "css" "text/css" "js" "application/javascript"
"gif" "image/gif" "jpg" "image/jpeg" "png" "image/png"
"r" "text/plain" "r3" "te... | REBOL [title: "A tiny static HTTP server" author: 'abolka date: 2009-11-04]
code-map: make map! [200 "OK" 400 "Forbidden" 404 "Not Found"]
mime-map: make map! [
"html" "text/html" "css" "text/css" "js" "application/javascript"
"gif" "image/gif" "jpg" "image/jpeg" "png" "image/png"
"r" "text/plain" "r3" "te... | apache-2.0 | R |
35a6e123ac33b5ddb60a7e79975d1b9b901802a1 | adjust for relative paths | david-beauchesne/Predict_interactions | Script/serialNext.r | Script/serialNext.r | # Generating serial number for files in case file already exists
# http://stackoverflow.com/questions/25429557/how-to-create-a-new-output-file-in-r-if-a-file-with-that-name-already-exists
serialNext = function(prefix){
if(!file.exists(prefix)){
return(prefix)
}
i=1
repeat {
f = paste... | # Generating serial number for files in case file already exists
# http://stackoverflow.com/questions/25429557/how-to-create-a-new-output-file-in-r-if-a-file-with-that-name-already-exists
serialNext = function(prefix){
if(!file.exists(prefix)){
return(prefix)
}
i=1
repeat {
f = paste... | mit | R |
62c6b51ee0f0dfb13c79ef8b313c5ae757809b03 | Fix problem with comment on last line of cell | rgbkrk/IRkernel,ibm-et/IRkernel,Phobia0ptik/IRkernel,chendaniely/IRkernel,ChinaQuants/IRkernel,JanSchulz/IRkernel,elaOnMars/IRkernel,mikecroucher/IRkernel,gdtm86/IRkernel,ibm-et/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 |
e9f51f7ebca04b77dfc2c43aab03492653b23cf0 | Update 2.r | glor/R,glor/R | aufgaben/blatt05/2.r | aufgaben/blatt05/2.r | #2.1
#Homogenitaetstest, da untersucht wird, ob sich die normalen und die entarteten Zellkulturen bzgl der Exprimierung von p53 unterscheiden.
#2.2
#H0: Die Zellkulturen unterscheiden sich nicht.
#H1: Die Zellkulturen unterscheiden sich.
#2.3
chisq.test(matrix(c(12,9,14,7), ncol=2), correct = FALSE)
#2.4
#X-squared ... | bsd-2-clause | R | |
4c4a85944b911bf592b6f60c8af38bb915e14cdd | Improve the design of the graph | mattm/active-user-cohort-analysis | active-users.r | active-users.r | library("ggplot2")
library("grid")
CSV_PATH = "data/test-data.csv"
CSV_SEPARATOR = "\t"
BACKGROUND_COLOR = "#F6F8FA"
GRID_COLOR = "#DDDDDD"
Run <- function() {
activities <- LoadActivityData()
data <- AnalyzeActiveUserCohorts(activities)
PlotActiveUserCohorts(data)
}
LoadActivityData <- function() {
activities <... | CSV_PATH = "data/test-data.csv"
CSV_SEPARATOR = "\t"
Run <- function() {
activities <- LoadActivityData()
data <- AnalyzeActiveUserCohorts(activities)
PlotActiveUserCohorts(data)
}
LoadActivityData <- function() {
activities <- read.csv(CSV_PATH, sep = CSV_SEPARATOR,
col.names = c("user.id", "date"), header = F... | mit | R |
701d815b53fb87f88712ac4199e47a39192d168b | fix bug in number of tests performed in evsi | wkmor1/voiWoodland | R/evsi_BI.r | R/evsi_BI.r | evsi_BI <- function(sens_pp_BI, manage, BI_output) {
init <- c(1/3, 1/3)
ui <- rbind(c(1, 0), c(0, 1), c(-1, 0), c(0, -1), c(-1, -1))
ci <- c(0, 0, -1, -1, -1)
e_max <- constrOptim(init,
function(x) {
obj_fun_simp(x,
BI_output=BI_output, upd.manage='NONE')},
NULL, ui, ci, control=list(fn... | evsi_BI <- function(sens_pp_BI, manage, BI_output) {
init <- c(1/3, 1/3)
ui <- rbind(c(1, 0), c(0, 1), c(-1, 0), c(0, -1), c(-1, -1))
ci <- c(0, 0, -1, -1, -1)
e_max <- constrOptim(init,
function(x) {
obj_fun_simp(x,
BI_output=BI_output, upd.manage='NONE')},
NULL, ui, ci, control=list(fn... | mit | R |
47e29a6ba81028c264cd868a5cda05ded98841ad | remove rjulia | felipenoris/AWSFinance,felipenoris/math-server-docker,felipenoris/AWSFinance,felipenoris/math-server-docker | 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 |
2fa99acf27941525aee907b0c0b8e6058d38c532 | Disable lots of console spam | owainkenwayucl/stats-plus-plus,owainkenwayucl/stats-plus-plus,owainkenwayucl/stats-plus-plus,owainkenwayucl/stats-plus-plus | r/dbtools.r | r/dbtools.r | # Generic query wrapper to keep the MySQL nastiness out of the code.
dbquery <- function(db, query, mysqlhost="mysql.external.legion.ucl.ac.uk", mysqlport = 3306) {
# Pull in the RMySQL library and my tool for reading Python ini files.
suppressPackageStartupMessages((library(RMySQL)))
source("r/rini.r")
# Get aut... | # Generic query wrapper to keep the MySQL nastiness out of the code.
dbquery <- function(db, query, mysqlhost="mysql.external.legion.ucl.ac.uk", mysqlport = 3306) {
# Pull in the RMySQL library and my tool for reading Python ini files.
(library(RMySQL))
source("r/rini.r")
# Get authentication information.
authd... | mit | R |
708a1ac17ecc91bea38197a7e14216b7c604c328 | Update metabolism igraph script | shiva1387/keggParser,shiva1387/keggParser,etheleon/keggParser,etheleon/keggParser | kegg.0500.igraphMetabolism.r | kegg.0500.igraphMetabolism.r | #!/usr/bin/env Rscript
suppressPackageStartupMessages({
library(tidyverse)
library(igraph)
})
message("Building igraph obj of metabolism")
args = commandArgs(T)
#args = "~/newMeta4j2/misc/"
message("## Generating edgelist")
suppressMessages({
relationships = Sys.glob(sprintf("%s/*rels", args[1])) %>%
... | #!/usr/bin/env Rscript
suppressPackageStartupMessages({
library(dplyr)
library(magrittr)
library(igraph)
})
message("Building igraph obj of metabolism")
args = commandArgs(T)
#args = "~/newMeta4j2/misc/"
relationships <- list.files(args[1], pattern="rels$", full=T) %>%
lapply(read.table, h=T) %>... | mit | R |
9023e99489da7f717cd066bb6b475527f2b3f1d3 | Add additional packages and descriptions | jkarl/LandscapeToolbox,jkarl/LandscapeToolbox,jkarl/LandscapeToolbox | package_installation.r | package_installation.r | ###############################################
### COMMONLY USED PACKAGES IN AIM R SCRIPTS ###
###############################################
#### DATA WRANGLING ####
install.packages(
c(
"dplyr", ## Notably useful for data frame manipulation with group_by(), summarize(), and mutate() and the piping operator %... | ###############################################
### COMMONLY USED PACKAGES IN AIM R SCRIPTS ###
###############################################
#### DATA WRANGLING ####
install.packages(
c(
"dplyr", ## Notably useful for data frame manipulation with group_by(), summarize(), and mutate() and the piping operator %... | cc0-1.0 | R |
0431dbc51710898e8e6532d3c8d8d115263a6eaf | Add test case for `import` in global environment | klmr/modules,klmr/modules | inst/tests/test-basic.r | inst/tests/test-basic.r | context('Basic import test')
test_that('module can be imported', {
a = import('a')
expect_true(is_module_loaded(module_path(a)))
expect_true('double' %in% ls(a))
})
test_that('import works in global namespace', {
local({
a = import('a')
unload(a) # To get rid of attached operators.
... | context('Basic import test')
test_that('module can be imported', {
a = import('a')
expect_true(is_module_loaded(module_path(a)))
expect_true('double' %in% ls(a))
})
test_that('module is uniquely identified by path', {
a = import('a')
ba = import('b/a')
expect_true(is_module_loaded(module_path(... | apache-2.0 | R |
070226ca2aecc689ebf0f836f660b393cc56ebc7 | remove rescaling after prediction to avoid overflow | wkmor1/voiWoodland | R/predict_BI.r | R/predict_BI.r | predict_BI <- function(newdata, dir, verbose=FALSE) {
predict_BI_obj <- vector('list', 3); gc(FALSE)
names(predict_BI_obj) <- c('BIW', 'BIMan', 'BIEco')
for (i in names(predict_BI_obj)) {
predict_BI_obj_i <- vector('list', 3); gc(FALSE)
names(predict_BI_obj_i) <- c('LDW', 'HDW', 'MAT')
... | predict_BI <- function(newdata, dir, verbose=FALSE) {
predict_BI_obj <- vector('list', 3); gc(FALSE)
names(predict_BI_obj) <- c('BIW', 'BIMan', 'BIEco')
for (i in names(predict_BI_obj)) {
predict_BI_obj_i <- vector('list', 3); gc(FALSE)
names(predict_BI_obj_i) <- c('LDW', 'HDW', 'MAT')
... | mit | R |
24c672f1b0f63ca88272f3cc3429c626d99f84c8 | Update uvoz_tabel.r | ZavbiA/APPR-2017 | uvoz/uvoz_tabel.r | uvoz/uvoz_tabel.r | # 2. faza: Uvoz podatkov
# Funkcija, ki uvozi število medalj po državah iz Wikipedije
uvozi.medalje <- function() {
link <- "https://en.wikipedia.org/wiki/All-time_Olympic_Games_medal_table"
stran <- html_session(link) %>% read_html()
tabela <- stran %>% html_nodes(xpath="//table[@class='wikitable sortable']") %... | # 2. faza: Uvoz podatkov
# Funkcija, ki uvozi število medalj po državah iz Wikipedije
uvozi.medalje <- function() {
link <- "https://en.wikipedia.org/wiki/All-time_Olympic_Games_medal_table"
stran <- html_session(link) %>% read_html()
tabela <- stran %>% html_nodes(xpath="//table[@class='wikitable sortable']")... | mit | R |
2648c94d03b415e1b67a098460eaaa5b0e4b10e0 | Update ggplot2_formatter.r | 1R151-1/R,fdryan/R | ggplot2_formatter.r | ggplot2_formatter.r |
require(scales)
# ---------------------------------------------------------------------------------------------
# Formatting functions for ggplot graph axis
# ---------------------------------------------------------------------------------------------
#' Human Numbers: Format numbers so they're legible for humans
... |
require(scales)
# ---------------------------------------------------------------------------------------------
# Formatting functions for ggplot graph axis
# ---------------------------------------------------------------------------------------------
#' Human Numbers: Format numbers so they're legible for humans
... | unlicense | R |
c7316ca7e746efcb0063ae6a9aa13eb8c7a8fed7 | add longitudinalData 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 |
8b566e00315f7b677dace0444d85d3e4ce3049e3 | Update BuildReports.r | bgweber/RServer,bgweber/RServer,bgweber/RServer,bgweber/RServer | tasks/RServerPerf/BuildReports.r | tasks/RServerPerf/BuildReports.r | # Copyright (C) 2016 Electronic Arts Inc. All rights reserved.
libraries <- c("rmarkdown", "yaml", "scales")
for (lib in libraries) {
if (lib %in% rownames(installed.packages()) == FALSE) {
install.packages(lib, repos='http://cran.us.r-project.org')
}
}
require(rmarkdown)
render("Serve... |
libraries <- c("rmarkdown", "yaml", "scales")
for (lib in libraries) {
if (lib %in% rownames(installed.packages()) == FALSE) {
install.packages(lib, repos='http://cran.us.r-project.org')
}
}
require(rmarkdown)
render("ServerReport.Rmd", output_format = "html_document", output_file = "R... | bsd-3-clause | R |
9e664197cf18092d74766f551864544ba26bcd68 | fix save from wrong environment | isezen/sahra,isezen/sahra | code/calcor.r | code/calcor.r | # Saharan Dust Transport Research
# 2016-05-04 Ismail SEZEN
# sezenismail@gmail.com
source("code/correlation.r")
source("code/filehelper.r")
calcor <- function(files = stop("'file' must be specified")) {
pm <- read_pm10()
dir_out <- "data/cor"
dir.create(dir_out, showWarnings = F)
for (f in files) {
w <-... | # Saharan Dust Transport Research
# 2016-05-04 Ismail SEZEN
# sezenismail@gmail.com
source("code/correlation.r")
source("code/filehelper.r")
calcor <- function(files = stop("'file' must be specified")) {
pm <- read_pm10()
dir_out <- "data/cor"
dir.create(dir_out, showWarnings = F)
for (f in files) {
w <-... | mit | R |
adebf800efe4f049273b1da916dd409582714896 | Remove commented portion. | bamos/zsh-history-analysis,bamos/zsh-history-analysis,bamos/zsh-history-analysis | plot.r | plot.r | #!/usr/bin/env Rscript
library(ggplot2)
library(reshape)
hours_m = as.numeric(read.csv("analysis/time-hours.csv",header=F,nrows=1))
hours_stdev = as.numeric(read.csv("analysis/time-hours.csv",header=F,nrows=1,skip=1))
p <- ggplot() +
xlab("Hour of Day") +
ylab("Average Commands Executed") +
geom_bar(stat='iden... | #!/usr/bin/env Rscript
# library(extrafont) # First time: Run font_import() in R shell.
# loadfonts()
library(ggplot2)
library(reshape)
hours_m = as.numeric(read.csv("analysis/time-hours.csv",header=F,nrows=1))
hours_stdev = as.numeric(read.csv("analysis/time-hours.csv",header=F,nrows=1,skip=1))
p <- ggplot() +
x... | mit | R |
64647aee714853db5583b492c54dbd15ef255741 | Add more warnings to R | klmr/.files,klmr/.files,klmr/.files | .R/config.r | .R/config.r | options(pager = file.path(Sys.getenv('HOME'), '.R/pager.sh'),
# Imperial College London
repos = c(CRAN = 'https://cran.ma.imperial.ac.uk/'),
menu.graphics = FALSE, # Seriously, WHAT THE FUCK, R!?
import.path = '~/.R/modules',
devtools.name = 'Konrad Rudolph',
devtools.des... | options(pager = file.path(Sys.getenv('HOME'), '.R/pager.sh'),
# Imperial College London
repos = c(CRAN = 'https://cran.ma.imperial.ac.uk/'),
menu.graphics = FALSE, # Seriously, WHAT THE FUCK, R!?
import.path = '~/.R/modules',
devtools.name = 'Konrad Rudolph',
devtools.des... | apache-2.0 | R |
51a5f878bcf8dc97ad9763a84da48d54be650f8f | Add to_levels to aggr_by | SwedishPensionsAgency/Hierarchy | R/aggr-nodes.r | R/aggr-nodes.r | #' Aggregate by
#'
#' A wrapper function to the path enumeration class to aggregate nodes.
#' The hierarchical data set must have a path enumerated column.
#'
#' @param data data frame
#' @param path column with path enumeration ids
#' @param metrics metric columns
#' @param ids node id (e.g. "1.2.1.3")
#' @param by ... | #' Aggregate by
#'
#' A wrapper function to the path enumeration class to aggregate nodes.
#' The hierarchical data set must have a path enumerated column.
#'
#' @param data data frame
#' @param path column with path enumeration ids
#' @param metrics metric columns
#' @param ids node id (e.g. "1.2.1.3")
#' @param by ... | agpl-3.0 | R |
bace4927f8ab6b5523d054ce52a9d2bbe8eceb79 | Fix unknown main_file path | 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",
public = list(
initialize = function(container, main_file, copy_back = c("*")) {
private$cat_main_file_magic(container$dir, main_fi... | #' SlurmBashScript R6 object.
#'
#' Generates the necessary bash script to submit through
#' the `sbatch` command.
SlurmBashScript <- R6::R6Class("SlurmBashScript",
public = list(
initialize = function(container, main_file, copy_back = c("*")) {
private$cat_main_file_magic(container$dir, main_fi... | mit | R |
481b58cd0c4dba003e80c9ff5ecd8ef39ac48ab5 | Update onLoad.r | alfcrisci/rBiometeo,alfcrisci/rBiometeo | R/onLoad.r | R/onLoad.r | #' @importFrom V8 new_context
.onLoad <- function(libname, pkg){
assign("ct", V8::v8("window"), environment(.onLoad))
ct$source(system.file("js/biometeo.js", package = pkg))
}
| #' @importFrom V8 new_context
ct <- NULL
.onLoad <- function(libname, pkgname){
ct <- V8::new_context()
ct$source(system.file("js/biometeo.js", package = pkgname))
}
| mit | R |
d33e70cb959f919c70264cd3d888d6965737212a | Update splitSupermatrices.r | NathanWhelan/Split_supermatrix_into_partitions,NathanWhelan/Split_supermatrix_into_partitions | splitSupermatrices.r | splitSupermatrices.r | #########################################################################################################################
#This script was written by Nathan Whelan.
# THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY... | #########################################################################################################################
#This script was written by Nathan Whelan.
# THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY... | mit | R |
aed2e3286438ff711e363af3774f723da89f3048 | Fix query | wikimedia-research/Blockr | ComponentFiles/logging.r | ComponentFiles/logging.r | #UserSurvival - a project to accurately triage data on blocked Wikipedia users, identify
#the underlying rationales and test various hypotheses as to any outcome
#
#logging.r outputs similar results to the basic analysis, but for the logging rather than ipblocks table
#
# @Year = 2013
# @Copyright: Oliver Keyes
# @Lice... | #UserSurvival - a project to accurately triage data on blocked Wikipedia users, identify
#the underlying rationales and test various hypotheses as to any outcome
#
#logging.r outputs similar results to the basic analysis, but for the logging rather than ipblocks table
#
# @Year = 2013
# @Copyright: Oliver Keyes
# @Lice... | mit | R |
b8e70fb8fc664e11326975abf7332f681b721fca | Update combined-cord-reference.r | perishky/meffil,perishky/meffil | data-raw/combined-cord-reference.r | data-raw/combined-cord-reference.r | ## Gervin, K., Salas, L.A., Bakulski, K.M. et al. Systematic evaluation and validation of reference
## and library selection methods for deconvolution of cord blood DNA methylation data.
## Clin Epigenet 11, 125 (2019). https://doi.org/10.1186/s13148-019-0717-y
## recreate the FlowSorted.CordBloodCombined.450k refer... | ## recreate the FlowSorted.CordBloodCombined.450k reference in meffil
create.combined.cord.reference <- function(verbose=T) {
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
if (!requireNamespace("minfi", quietly = TRUE))
BiocManager::install("minfi")
if... | artistic-2.0 | R |
90e217bdb4808cef6f7f6629441ff6eda1e675f7 | add a histogram | tpoisot/ddesss | random_plot.r | random_plot.r | # Some comments
sample_size <- 1e3
plot(runif(sample_size))
hist(runif(sample_size))
| sample_size <- 1e4
plot(runif(sample_size))
| mit | R |
2ad755d6a1da0ae86abc9b5a6daabd0362c16e0a | add fivethirtyeight | berkeley-dsep-infra/datahub,ryanlovett/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub,berkeley-dsep-infra/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 |
7d611449d99b99954afa335f56ccff9c6ef4f2fb | Fix existing tests | TobCap/demagrittr | tests/testthat/test-magrittr-readme.r | tests/testthat/test-magrittr-readme.r | context("magrittr readme")
suppressMessages(library("magrittr"))
test_that("equiv value", {
# https://github.com/smbache/magrittr/blob/master/README.md
# More advanced right-hand sides and lambdas
e1 <- quote({
set.seed(1)
iris %>%
{
n <- sample(1:10, size = 1)
H <- hea... | context("magrittr readme")
suppressMessages(library("magrittr"))
test_that("equiv value", {
# https://github.com/smbache/magrittr/blob/master/README.md
# More advanced right-hand sides and lambdas
e1 <- quote({
set.seed(1)
iris %>%
{
n <- sample(1:10, size = 1)
H <- hea... | mit | R |
dc63f13d4901785a59988d9f0405c638758f6795 | Test updated: Objects within testthat are invisible. | felixlindemann/HNUORTools,felixlindemann/HNUORTools | inst/tests/testhnulink.r | inst/tests/testhnulink.r | context("Testing HNU Links")
#create 4 Nodes
# HNU Link
n1<- HNUNode.create(x=10, y=20)
n2<- HNUNode.create(x=13, y=24)
n3<- new("HNUNode", x=7, y=16)
n4<- new("HNUNode", x=7, y=20)
#create links
#
l1 <- HNULink.create(n1,n2)
l2 <- HNULink.create(n1,n3)
l3 <- HNULink.create(n1,n4)
l4 <- HNULink.create(n3,n4)
... | context("Testing HNU Links")
#create 4 Nodes
# HNU Link
n1<- HNUNode.create(x=10, y=20)
n2<- HNUNode.create(x=13, y=24)
n3<- new("HNUNode", x=7, y=16)
n4<- new("HNUNode", x=7, y=20)
context("\tTest 01: Are Objects created correctly?")
test_that("Test for creating objects without Messages", {
l1 <- HNULink.creat... | mit | R |
cf1d22d0a739e9eef5f27c894b978e49895e685c | modify column names correctly | koji-to/effort_calculator,koji-to/effort_calculator,koji-to/effort_calculator | script/bind_change_logs.r | script/bind_change_logs.r | ##### binding git change log and extraction
file_list.df<-read.table("git_log_change/git_log_change_list.txt",header=F)
output_df_exist_checker<-0
for(i in 1:nrow(file_list.df)){
open_file_name<-paste("git_log_change_proc/proc_",file_list.df[i,1],sep="")
if(file.access(open_file_name)==0){
proc_change_log.df<-... | ##### binding git change log and extraction
file_list.df<-read.table("git_log_change/git_log_change_list.txt",header=F)
output_df_exist_checker<-0
for(i in 1:nrow(file_list.df)){
open_file_name<-paste("git_log_change_proc/proc_",file_list.df[i,1],sep="")
if(file.access(open_file_name)==0){
proc_change_log.df<-... | mit | R |
a2edf8cb868b1fa2085b4f7a0a5ee206bc808572 | Simplify graphs. | danluu/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,danluu/BitFunnel | src/Scripts/plot-qwords.r | src/Scripts/plot-qwords.r | library("ggplot2")
library("reshape")
setwd("~/dev/BitFunnel/src/Scripts")
# See
# https://www.r-bloggers.com/choosing-colour-palettes-part-ii-educated-choices/
# for color information.
queries <- read.csv(header=TRUE, file="/tmp/QueryPipelineStatistics.csv")
# Create column to graph vs. term position.
pos = seq(1, l... | library("ggplot2")
library("reshape")
setwd("~/dev/BitFunnel/src/Scripts")
# See
# https://www.r-bloggers.com/choosing-colour-palettes-part-ii-educated-choices/
# for color information.
queries <- read.csv(header=TRUE, file="/tmp/QueryPipelineStatistics.csv")
# Create column to graph vs. term position.
pos = seq(1, l... | mit | R |
a8ca3e0a7f3fc9f0c97c548b24aeb3c24e03fbdb | check doubletfinder result | shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl | lib/scRNA/seurat_doublet_check.r | lib/scRNA/seurat_doublet_check.r |
library(Seurat)
library(ggplot2)
library(ggpubr)
library(cowplot)
library(scales)
library(stringr)
library(htmltools)
library(patchwork)
options(future.globals.maxSize= 10779361280)
options_table<-read.table(parSampleFile1, sep="\t", header=F, stringsAsFactors = F)
myoptions<-split(options_table$V1, options_table$V2... |
library(Seurat)
library(DoubletFinder)
options(future.globals.maxSize= 10779361280)
random.seed=20200107
min.pct=0.5
logfc.threshold=0.6
options_table<-read.table(parSampleFile1, sep="\t", header=F, stringsAsFactors = F)
myoptions<-split(options_table$V1, options_table$V2)
by_sctransform<-ifelse(myoptions$by_sctran... | apache-2.0 | R |
0ff4d88ba7a31dd10668da181f001d84627a9c9d | Add newlines for spacing when writing main_file | 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",
public = list(
initialize = function(container, main_file, settings) {
private$settings <- settings
private$cat_main_f... | #' SlurmBashScript R6 object.
#'
#' Generates the necessary bash script to submit through
#' the `sbatch` command.
SlurmBashScript <- R6::R6Class("SlurmBashScript",
public = list(
initialize = function(container, main_file, settings) {
private$settings <- settings
private$cat_main_f... | mit | R |
d6c7d5a4b1f90a357173b5de56d7ad19606f5d2e | fix whitespace | mschubert/clustermq,mschubert/clustermq,mschubert/clustermq | R/qsys_sge.r | R/qsys_sge.r | #' SGE scheduler functions
#'
#' Derives from QSys to provide SGE-specific functions
#'
#' @keywords internal
SGE = R6::R6Class("SGE",
inherit = QSys,
public = list(
initialize = function(..., template=getOption("clustermq.template", "SGE")) {
super$initialize(..., template=template)
... | #' SGE scheduler functions
#'
#' Derives from QSys to provide SGE-specific functions
#'
#' @keywords internal
SGE = R6::R6Class("SGE",
inherit = QSys,
public = list(
initialize = function(..., template=getOption("clustermq.template", "SGE")) {
super$initialize(..., template=template)
... | apache-2.0 | R |
6823447f569a028ef8f70f3eab5f15cbd3278fd6 | Update common.r | EsotericSoftware/kryo,EsotericSoftware/kryo,EsotericSoftware/kryo,EsotericSoftware/kryo | benchmarks/charts/common.r | benchmarks/charts/common.r |
options(scipen=999)
rstudio = Sys.getenv("RSTUDIO_USER_IDENTITY") != ""
loadLibrary = function (name) {
if (!require(name, character.only=TRUE)) {
install.packages(name)
library(name, character.only=TRUE)
}
}
loadLibrary("ggplot2")
loadLibrary("gridExtra")
jmhCSV = function (path) {
data = read.csv(path, sep... |
options(scipen=999)
rstudio = Sys.getenv("RSTUDIO_USER_IDENTITY") != ""
loadLibrary = function (name) {
if (!require(name, character.only=TRUE)) {
install.packages(name)
library(name, character.only=TRUE)
}
}
loadLibrary("ggplot2")
loadLibrary("gridExtra")
jmhCSV = function (path) {
data = read.csv(path, se... | bsd-3-clause | R |
e27f8322a1b847567177dbfac93bd05e601972bf | Update geopath | metagraf/rVega | R/geopath.r | R/geopath.r | #' Vega geopath
#'
#' Create a geopath visualization
#'
#' @export
geopath <- function(
data,
labels = names(data),
width = 600,
height = 400,
font = "Helvetica Neue",
font.size = 14,
fill.color = "pink",
hover.color = "lightblue",
border.color = "black",
padding = c(0, 0... | #' Vega geopath
#'
#' Create a geopath visualization
#'
#' @export
geopath <- function(
data,
labels = names(data),
width = 1200,
height = 800,
font = "Helvetica Neue",
font.size = 14,
fill.color = "pink",
hover.color = "lightblue",
border.color = "black",
padding = c(0, ... | agpl-3.0 | R |
7d042f6fa5774136b460c6eb3ba5653ba36bb6dd | fix arg hint | mschubert/clustermq,mschubert/clustermq,mschubert/clustermq | R/workers.r | R/workers.r | #' Creates a pool of workers
#'
#' @param n_jobs Number of jobs to submit (0 implies local processing)
#' @param data Set common data (function, constant args, seed)
#' @param reuse Whether workers are reusable or get shut down after call
#' @param template A named list of values to fill in templat... | #' Creates a pool of workers
#'
#' @param n_jobs Number of jobs to submit (0 implies local processing)
#' @param data Set common data (function, constant args, seed)
#' @param reuse Whether workers are reusable or get shut down after call
#' @param template A named list of values to fill in templat... | apache-2.0 | R |
fdf78056610c7f8b36ab3f049c6063d839cf8591 | Update Corselect_Perch2.r | awhitten/corselect | Examples/Corselect_Perch2.r | Examples/Corselect_Perch2.r | ################################################################################################
#
# Corselect.r - Simultaneous estimation of selectivity parameters for Gillnets & Cormorants
# Application to European Perch Data from Curonian Lagoon, Lithuania
# NOTE: This application excludes the beach seine data fr... | ################################################################################################
#
# Corselect.r - Simultaneous estimation of selectivity parameters for Gillnets & Cormorants
# Application to European Perch Data from Curonian Lagoon, Lithuania
# NOTE: This application excludes the beach seine data fr... | bsd-2-clause | R |
95c5ec454f1948ca841a95de2f179047709f2cd7 | Add extensive tests for `is_S3_user_generic` | klmr/modules,klmr/modules | inst/tests/test-S3.r | inst/tests/test-S3.r | context('S3 dispatch test')
test_that('S3 generics are recognized', {
foo = function (x) UseMethod('foo')
bar = function (x) print('UseMethod')
baz = function (x) {
x = 42
UseMethod('baz')
}
qux = function (x) {
UseMethod('print')
a = 12
}
quz = function (x)
... | context('S3 dispatch test')
test_that('S3 methods are found', {
s3 = import('s3')
test = local(getS3method('test', 'character', s3))
expect_that(test, equals(s3$test.character))
# NOT executed locally!
print = getS3method('print', 'test')
expect_that(print, equals(s3$print.test))
})
test_tha... | apache-2.0 | R |
c8d4620370b360d3030bdb2c7599fc5270928841 | remove background and decrease the size of strips | drosofff/tools-artbio,ARTbio/tools-artbio,ARTbio/tools-artbio,drosofff/tools-artbio,ARTbio/tools-artbio,ARTbio/tools-artbio,chamaelj/tools-artbio,drosofff/tools-artbio,drosofff/tools-artbio,chamaelj/tools-artbio,chamaelj/tools-artbio | tools/small_rna_map/small_rna_map.r | tools/small_rna_map/small_rna_map.r | library(optparse)
library(ggplot2)
library(gridExtra)
library(RColorBrewer)
option_list <- list(
make_option(c("-r", "--output_tab"), type="character", help="path to tabular file"),
make_option("--output_pdf", type = "character", help="path to the pdf file with plot")
)
parser <- OptionParser(usage = "%pr... | library(optparse)
library(ggplot2)
library(gridExtra)
library(RColorBrewer)
option_list <- list(
make_option(c("-r", "--output_tab"), type="character", help="path to tabular file"),
make_option("--output_pdf", type = "character", help="path to the pdf file with plot")
)
parser <- OptionParser(usage = "%pr... | mit | R |
6d1c36aedcd89f6ce37d5ad347253a482730efbb | Update 2.r | glor/R,glor/R | aufgaben/blatt08/2.r | aufgaben/blatt08/2.r | #Blatt 8
#2
step = read.table(file="[013]stepping.txt", dec=".", sep="t", header = TRUE )
#Varianzhomogenitaet
model = lm(formula=HR ~ RestHR + Block + Height + Frequency + (Height:Frequecy), data = step)
fitted.value=fitted(model)
resid.value=resid(model)
plot(fitted.value, resid.value)
abline(h=0)
# keine Regelmaes... | cm = lm(formula=response~treatment.A+treatment.B+ treatment.A:treatment.B, data + cherry)
fitted.value=fitted(cm)
resid.value=resid(cm)
plot(fitted.value, resid.value)
abline(h=0)
boxplot(resid.value)
#lev = data.frame(res=resid.value, group=rep(c("low.light.c", "low.light.s","mod.light.c","mod.light.s") #falls daten
... | bsd-2-clause | R |
a1e05c8948ce02025d7e90150b4a5c12a4f26def | fix #8 by adding send timeout | mschubert/clustermq,mschubert/clustermq,mschubert/clustermq | R/worker.r | R/worker.r | #' R worker submitted as cluster job
#'
#' Do not call this manually, the master will do that
#'
#' @param worker_id The ID of the worker (usually just numbered)
#' @param master The master address (tcp://ip:port)
#' @param memlimit Maximum memory before throwing an error
worker = function(worker_id, master, mem... | #' R worker submitted as cluster job
#'
#' Do not call this manually, the master will do that
#'
#' @param worker_id The ID of the worker (usually just numbered)
#' @param master The master address (tcp://ip:port)
#' @param memlimit Maximum memory before throwing an error
worker = function(worker_id, master, mem... | apache-2.0 | R |
d3eaec522170862a12f567f95192b86d773d6838 | Update analiza.r | aleksandrov2/APPR-2015-16 | analiza/analiza.r | analiza/analiza.r | # 4. faza: Analiza podatkov
napoved <- lm(data = podatki3 %>% filter(Cas == 2006), Deficit ~ Dolg)
predict(napoved, data.frame(Dolg=seq(0, 250, 25)))
napoved2 <- lm(data = podatki3 %>% filter(Cas == 2014), Deficit ~ Dolg)
predict(napoved2, data.frame(Dolg=seq(0, 250, 25)))
#sedaj bi radi ločili države v skupine, g... | # 4. faza: Analiza podatkov
napoved <- lm(data = podatki3 %>% filter(Cas == 2006), Deficit ~ Dolg)
predict(napoved, data.frame(Dolg=seq(0, 250, 25)))
napoved2 <- lm(data = podatki3 %>% filter(Cas == 2014), Deficit ~ Dolg)
predict(napoved2, data.frame(Dolg=seq(0, 250, 25)))
#sedaj bi radi ločili države v skupine, g... | mit | R |
fde50fce0c33bba3e015bc30fc35ef99cea27e3d | Make glove easier to instrument | FTAsr/wordvet,FTAsr/wordvet,FTAsr/wordvet,FTAsr/wordvet | trainGloveModel.r | trainGloveModel.r | print("started running trainGloveModel.r")
library("text2vec")
args = commandArgs(trailingOnly=TRUE)
if (length(args) != 3) {
cat("trainGloveModel.R <size> <window> <iters>\n")
} else {
vectorSize <- as.numeric(args[1])
window <- as.numeric(args[2])
iters <- as.numeric(args[3])
text8_file = "/data/... |
##pre-requisites:
#library(devtools)
#load_all("text2vec")
#install("text2vec")
#build("text2vec")
print("started running trainGloveModel.r")
library("text2vec")
text8_file = "/data/wiki.shuffled-norm1-phrase1"
wiki = readLines(text8_file, n = 10000000, warn = FALSE)
# Create iterator over tokens
tokens <- space_... | apache-2.0 | R |
c81bace1bd958f20d0f2354c778d63239469d9e6 | configure for 2015 annual report | PSC-CoTC/PSC-FRAM-Admin,PSC-CoTC/PSC-FRAM-Admin | config/2015_report_config.r | config/2015_report_config.r |
run.year <- 2015
post.season.fram.db <- "./fram db/FramVS2-PSC-Coho-Backwards-for 2013 and 2014.mdb"
post.season.run.name <- "bc-bkCoho2015 Final"
post.season.tamm <- "./fram db/coho BK 2015 Final Feb 15th.xlsm"
pre.season.fram.db <- "./fram db/CohoFRAMVB2015Pre&PostNew.mdb"
pre.season.run.name <- "bc-Coho1523 Final... |
run.year <- 2015
post.season.fram.db <- "./fram db/FramVS2-PSC-Coho-Backwards-for 2015.mdb"
post.season.run.name <- "bc-bkCoho2015 fw catch queets"
post.season.tamm <- "./fram db/coho BK 2015 in process no tami step 3.xlsm"
pre.season.fram.db <- "./fram db/CohoFRAMVB2015Pre&PostNew.mdb"
pre.season.run.name <- "bc-Co... | mit | R |
ddd1da0cae9fc569d21028726d262cdafff2be09 | Add plotting the result | GreatEmerald/geoscripting,GreatEmerald/geoscripting,GreatEmerald/geoscripting,GreatEmerald/geoscripting | Lesson6/main.r | Lesson6/main.r | # Team Rython, Dainius Masiliunas and Tim Weerman
# Date: 11 January, 2016
# Apache License 2.0
# Needed packages
library(rgdal) # OGR functions
library(rgeos) # g functions
# Download the data
download.file("http://www.mapcruzin.com/download-shapefile/netherlands-places-shape.zip", method="wget", destfile="data/plac... | # Team Rython, Dainius Masiliunas and Tim Weerman
# Date: 11 January, 2016
# Apache License 2.0
# Needed packages
library(rgdal) # OGR functions
library(rgeos) # g functions
# Download the data
download.file("http://www.mapcruzin.com/download-shapefile/netherlands-places-shape.zip", method="wget", destfile="data/plac... | apache-2.0 | R |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.