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 |
|---|---|---|---|---|---|---|---|---|
b6a3b22483e115364a23d830c9d09359f763f0a7 | add syberia_root helper | syberia/syberia | R/syberia_config.r | R/syberia_config.r | #' Fetch the configuration for a Syberia file.
#'
#' @param root character. The root of the Syberia project. The
#' default is \code{syberia_root()}.
#' @param exists_check logical. If \code{TRUE}, it will only return
#' whether or not the directory contains a syberia configuration
#' file (either \code{syberia.... | #' Fetch the configuration for a Syberia file.
#'
#' @param root character. The root of the Syberia project. The
#' default is \code{syberia_root()}.
#' @param exists_check logical. If \code{TRUE}, it will only return
#' whether or not the directory contains a syberia configuration
#' file (either \code{syberia.... | mit | R |
363610b02cff1808b069db7591d39fd39f259395 | Update data_stage.r | syberia/syberia | R/data_stage.r | R/data_stage.r | #' Data stage for syberia models
#'
#' TODO: Document this more
#'
#' @param modelenv an environment. The persistent modeling environment.
#' @param munge_procedure a list. A list of mungepiece arguments,
#' first preprocessed then passed to munge.
#' @export
data_stage <- function(modelenv, munge_procedure) {
re... | #' Data stage for syberia models
#'
#' TODO: Document this more
#'
#' @param modelenv an environment. The persistent modeling environment.
#' @param munge_procedure a list. A list of mungepiece arguments,
#' first preprocessed then passed to munge.
#' @export
data_stage <- function(modelenv, munge_procedure) {
re... | mit | R |
2cc9618bc270639d95ab685dc9960b2543deadf8 | add warning that NAs are being recoded | boydorr/RDiversity | R/gen2dist.r | R/gen2dist.r | #' Genetic distance matrix
#'
#' Converts a vcfR object to a matrix of pairwise genetic distances.
#'
#' @param vcf object of class \code{data.frame}.
#' @param biallelic logical describing whether the data is biallelic or not (default).
#'
#' @return \code{gen2dist(x)} returns an object of class \code{distance}
#' con... | #' Genetic distance matrix
#'
#' Converts a vcfR object to a matrix of pairwise genetic distances.
#'
#' @param vcf object of class \code{data.frame}.
#' @param biallelic logical describing whether the data is biallelic or not (default).
#'
#' @return \code{gen2dist(x)} returns an object of class \code{distance}
#' con... | bsd-2-clause | R |
fd2f664918f1cf366d006282fbe1b81be386ff04 | Update answer.r | neetsdkasu/Paiza-POH-MyAnswers,neetsdkasu/Paiza-POH-MyAnswers,neetsdkasu/Paiza-POH-MyAnswers,neetsdkasu/Paiza-POH-MyAnswers,neetsdkasu/Paiza-POH-MyAnswers,neetsdkasu/Paiza-POH-MyAnswers,neetsdkasu/Paiza-POH-MyAnswers,neetsdkasu/Paiza-POH-MyAnswers,neetsdkasu/Paiza-POH-MyAnswers,neetsdkasu/Paiza-POH-MyAnswers,neetsdkasu... | POH6plus/answer.r | POH6plus/answer.r | strConcat <- function(x, sep="") {
paste(x, collapse=sep)
}
strReverse <- function(x) {
paste(rev(strsplit(x, NULL)[[1]]), collapse='')
}
zz <- file("stdin")
ww <- readLines(zz)
n <- as.integer(ww[1])
ww <- sort(ww[2:(n+1)])
f <- ""
e <- ""
cc <- array("", dim=c(n))
ci <- 1
for (i in 1:n) {
if (ide... | strConcat <- function(x,y) {
paste(c(x,y), collapse="")
}
strReverse <- function(x) {
paste(rev(strsplit(x, NULL)[[1]]), collapse='')
}
zz <- file("stdin")
ww <- readLines(zz)
n <- as.integer(ww[1])
ww <- sort(ww[2:(n+1)])
f <- ""
e <- ""
cc <- array("", dim=c(n))
ci <- 1
for (i in 1:n) {
if (ident... | mit | R |
ed0e5c997b9e2d037c6576003f46dacd7ee21f43 | 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,step=1),
sliderInput(inputId="leto_2",label="Leto",min=2006,max=2014,value=2007,step=1),... | 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 |
b0404207b1c7ebe9021b3fb899d9f2007da7b42e | Remove the redundant "/payload" parsing | zsx/r3,Pointillistic/rebol-lang,zsx/r3,Pointillistic/rebol-lang,zsx/r3,Pointillistic/rebol-lang,Pointillistic/rebol-lang,zsx/r3 | make/encap.r | make/encap.r | REBOL[]
args: parse system/script/args ""
exe: none
payload: none
output: none
as-is: false ;don't compress, in case people try to avoid decompression to speed up bootup
windows?: 3 = fourth system/version
while [not tail? args] [
arg: first args
case [
any [arg = "/rebol"
arg = "/r"] [
exe: second ar... | REBOL[]
args: parse system/script/args ""
exe: none
payload: none
output: none
as-is: false ;don't compress, in case people try to avoid decompression to speed up bootup
windows?: 3 = fourth system/version
while [not tail? args] [
arg: first args
case [
any [arg = "/rebol"
arg = "/r"] [
exe: second ar... | apache-2.0 | R |
3455f52e0c8f968cf5c8f9543ff06b0b2f19ea32 | Update server.r | ariesti/shinycamping-octo-shame | App-1/server.r | App-1/server.r | library(shiny)
## Defining the server logic required to put the text up
shinyServer(function(input, output) {
})
| library(shiny)
## Defining the server logoc required to put the text up
shinyServer(function(input, output) {
}) | mit | R |
ccdc02a7f24ea3b379c58d58bcfe78f4cc9d28d3 | fix test resource name, related to fix for #2423 | janiheikkinen/irods,PaulVanSchayck/irods,PaulVanSchayck/irods,janiheikkinen/irods,janiheikkinen/irods,janiheikkinen/irods,PaulVanSchayck/irods,PaulVanSchayck/irods,janiheikkinen/irods,janiheikkinen/irods,janiheikkinen/irods,PaulVanSchayck/irods,PaulVanSchayck/irods,PaulVanSchayck/irods,PaulVanSchayck/irods,janiheikkine... | iRODS/clients/icommands/test/rules3.0/rulemsiDataObjPhymv.r | iRODS/clients/icommands/test/rules3.0/rulemsiDataObjPhymv.r | myTestRule {
# Input parameters are:
# Data object path
# Optional destination resource name
# Optional source resource name
# Optional replica number
# Optional keyword for IRODS_ADMIN
# Output parameters are:
# Status
# Output from running the example is:
# Replica number 0 of file /tempZone/home/rods/fo... | myTestRule {
# Input parameters are:
# Data object path
# Optional destination resource name
# Optional source resource name
# Optional replica number
# Optional keyword for IRODS_ADMIN
# Output parameters are:
# Status
# Output from running the example is:
# Replica number 0 of file /tempZone/home/rods/fo... | bsd-3-clause | R |
aaa09f8b6d0b3d9b27fa5bc1dc33a3e91eefbeb5 | Use proper directories, and wrapper functions are needed instead of parameters | GreatEmerald/geoscripting,GreatEmerald/geoscripting,GreatEmerald/geoscripting,GreatEmerald/geoscripting | Project/main.r | Project/main.r | # Team Rython: Dainius Masiliunas and Tim Weerman
# Date: January 2016
# License: Apache License 2.0
library(bfastSpatial)
filelist = read.csv("data/data_url_script_2016-01-15_032836.txt")
filename = "data/MCD15A2H.A2015201.h19v03.006.2015304024904.hdf"
# Magic numbers!
filtermask = 0x8C # Filter out dead detectors, ... | # Team Rython: Dainius Masiliunas and Tim Weerman
# Date: January 2016
# License: Apache License 2.0
library(bfastSpatial)
filelist = read.csv("data/data_url_script_2016-01-15_032836.txt")
filename = "data/MCD15A2H.A2015201.h19v03.006.2015304024904.hdf"
# Magic numbers!
filtermask = 0x8C # Filter out dead detectors, ... | apache-2.0 | R |
6abe5585b56e15731ff6508483a78647e7dd1d35 | remove include dependency | rebolsource/rebol-test,rebolsource/rebol-test | run-tests.r | run-tests.r | Rebol [
Title: "Run-tests"
File: %run-tests.r
Copyright: [2014 "Saphirion AG"]
Author: "Ladislav Mecir"
License: {
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/... | Rebol [
Title: "Run-tests"
File: %run-tests.r
Copyright: [2014 "Saphirion AG"]
Author: "Ladislav Mecir"
License: {
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/... | apache-2.0 | R |
2981e7f53711206245f2b89d02ad1978bf41d324 | Add column names | hadley/sfhousing,hadley/sfhousing,hadley/sfhousing | geocode.r | geocode.r | source("key.r")
geocode_url <- function(address) {
geo <- "http://maps.google.com/maps/geo?"
params <- c(
key = key,
q = address,
output = "csv"
)
p <- paste(names(params), "=", laply(params,URLencode), sep="", collapse ="&")
paste(geo, p, sep="")
}
geocode <- function(addresses) {
paths... | source("key.r")
geocode_url <- function(address) {
geo <- "http://maps.google.com/maps/geo?"
params <- c(
key = key,
q = address,
output = "csv"
)
p <- paste(names(params), "=", laply(params,URLencode), sep="", collapse ="&")
paste(geo, p, sep="")
}
geocode <- function(addresses) {
paths... | mit | R |
61cdd40a278a08faffbb064e0a6187d44af6d4c7 | Add missing imports | klmr/ggplots | fonts.r | fonts.r | box::use(
extrafont,
grDevices[embedFonts, pdfFonts, postscriptFonts, Type1Font],
stats[setNames]
)
ensure_font_exists = function (font, path) {
if (! all(file.exists(file.path(path, paste0(font, complete_font_set))))) {
# Build font metrics
extrafont$ttf_import(pattern = rx_escape(font... | box::use(
grDevices[pdfFonts, postscriptFonts, Type1Font]
)
ensure_font_exists = function (font, path) {
if (! all(file.exists(file.path(path, paste0(font, complete_font_set))))) {
# Build font metrics
extrafont::ttf_import(pattern = rx_escape(font))
}
}
rx_escape = function (regex) {
... | apache-2.0 | R |
534a015570e9b13d87bf3579c766993d455183fa | Remove equilibriation graphs to speed up report generation | hkaju/Ising2D,hkaju/Ising2D,hkaju/Ising2D | templates/report.template.r | templates/report.template.r | pdf("reports/{run}.pdf")
data <- read.csv("data/{run}/results.csv", header=T)
par(mfrow=c(2,2))
plot(data$T, data$M, xlab="Temperature", ylab="Magnetization")
plot(data$T, data$E, xlab="Temperature", ylab="Energy")
plot(data$T, data$Xb, xlab="Temperature", ylab="Magnetic susceptibility")
plot(data$T, data$Xt,... | pdf("reports/{run}.pdf")
data <- read.csv("data/{run}/results.csv", header=T)
par(mfrow=c(2,2))
plot(data$T, data$M, xlab="Temperature", ylab="Magnetization")
plot(data$T, data$E, xlab="Temperature", ylab="Energy")
plot(data$T, data$Xb, xlab="Temperature", ylab="Magnetic susceptibility")
plot(data$T, data$Xt,... | mit | R |
b681a75f88ebb1f6f7de3931763ed19ac137e558 | use array module for splitting arrays | mschubert/clustermq,mschubert/clustermq,mschubert/clustermq | process_args.r | process_args.r | .split = import('../array/split')
.ll = import('../base/list')
#' @param fun the function to call
#' @param ... arguments to vectorise over
#' @param const arguments not to vectorise over
#' @param export objects to export to computing nodes
#' @param get returns ... | .split = import('../array/split')
.ll = import('../base/list')
#' @param fun the function to call
#' @param ... arguments to vectorise over
#' @param const arguments not to vectorise over
#' @param export objects to export to computing nodes
#' @param get returns ... | apache-2.0 | R |
f053d8be5dc0d27e98a314e274f59231910594f8 | 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 ungefaehr normalverteilt, es gibt keine Aussreisser. (diese wuerden als Punkte ausserhalb ... | #Blatt 3
2
3 #1.1 Datei lokal speichern
4
5 #1.2
6 maeuse = read.table(file="mice.txt", sep="\t", dec=".", header=TRUE)
7
8 #1.3
9 boxplot(maeuse$speed ~ maeuse$health, date = maeuse, main = "kranke Maeuse" )
10 # Beide Gruppen sind ungefaehr normalverteilt, es gibt keine Aussreisser. *... | bsd-2-clause | R |
89a75c71eb0c9d3a4a25e6924ac0c13761602e91 | Switch version number to 2.102.0, for the time being | rgchris/ren-c,codebybrett/ren-c,rgchris/ren-c,codebybrett/ren-c,kealist/ren-c,hostilefork/rebol,kealist/ren-c,draegtun/ren-c,kealist/ren-c,draegtun/ren-c,giuliolunati/ren-c,giuliolunati/ren-c,draegtun/ren-c,hostilefork/rebol,draegtun/ren-c,mbk/ren-c,hostilefork/rebol,kealist/ren-c,hostilefork/rebol,giuliolunati/ren-c,g... | src/boot/version.r | src/boot/version.r | 2.102.0.0.0
| 3.0.99.3.1
| apache-2.0 | R |
fffbddf1e348c79e0f0c705936be7a64cd97dbc3 | Combine interpreter and compiler results for cachelines vs. time graph | danluu/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel | src/Scripts/match-vs-cachelines.r | src/Scripts/match-vs-cachelines.r | library("ggplot2")
library("reshape2")
setwd("~/dev/BitFunnel/src/Scripts")
interpreter <- read.csv(header=TRUE, file="/tmp/int/QueryPipelineStatistics.csv")
compiler <- read.csv(header=TRUE, file="/tmp/comp/QueryPipelineStatistics.csv")
df <- data.frame(interpreter$cachelines, compiler$match)
names(df)[names(df) == '... | library("ggplot2")
library("reshape2")
setwd("~/dev/BitFunnel/src/Scripts")
# See
# https://www.r-bloggers.com/choosing-colour-palettes-part-ii-educated-choices/
# for color information.
df <- read.csv(header=TRUE, file="/tmp/QueryPipelineStatistics.csv")
# queries <- read.csv(header=TRUE, file="/tmp/QueryPipelineSt... | mit | R |
33b2567eab279469cb0386f5817b53585bdff553 | Install cowplot & rlang from CRAN | ryanlovett/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub,berkeley-dsep-infra/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 |
329dc5912059167d420c16fb1005a8eac02a638e | update dat_id='genetic' in gen2dist | boydorr/RDiversity | R/gen2dist.r | R/gen2dist.r | #' Genetic distance matrix
#'
#' Converts a vcfR object to a matrix of pairwise genetic distances.
#'
#' @param vcf object of class \code{vcfR}.
#'
#' @return \code{gen2dist(x)} returns a matrix of pairwise distances.
#' @export
#'
gen2dist <- function(vcf) {
if("vcfR" %in% rownames(installed.packages()) ... | #' Genetic distance matrix
#'
#' Converts a vcfR object to a matrix of pairwise genetic distances.
#'
#' @param vcf object of class \code{vcfR}.
#'
#' @return \code{gen2dist(x)} returns a matrix of pairwise distances.
#' @export
#'
gen2dist <- function(vcf) {
if("vcfR" %in% rownames(installed.packages()) ... | bsd-2-clause | R |
6cbf88f161cd810d70423ef4f5b92a4a8ddd3d93 | Add missing function reference to doc index | klmr/modules,klmr/modules | R/modules-package.r | R/modules-package.r | #' An alternative module system for R
#'
#' Use \code{module = import('module')} to import a module for usage.
#' Fully qualified names are supported for nested modules, reminiscent of
#' Python’s module mechanism.
#' @section Package options:
#'
#' \itemize{
#' \item \code{import.path}:
#' A vector of paths whic... | #' An alternative module system for R
#'
#' Use \code{module = import('module')} to import a module for usage.
#' Fully qualified names are supported for nested modules, reminiscent of
#' Python’s module mechanism.
#' @section Package options:
#'
#' \itemize{
#' \item \code{import.path}:
#' A vector of paths whic... | apache-2.0 | R |
b9f8b642e12148dc2b31df958a3ab4203fa81a26 | Update error.r | bgweber/RServer,bgweber/RServer,bgweber/RServer,bgweber/RServer | tasks/userDemo/error.r | tasks/userDemo/error.r | 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!")
stop("This is an error!")
| bsd-3-clause | R |
f1ae53532cc41e3cc1148691c7b4eb9ff6525394 | remove underscores | khufkens/phenor | R/merge_pep725.r | R/merge_pep725.r | #' Preprocessing of PEP725 data, merges separate files into tidy
#' data, with each observation a line, each column a different
#' parameter value.
#'
#' @param path: a path to the PEP725 data (species files only)
#' @return concatted data of all data in the path as a tidy data frame
#' listing PEP_ID, BBCH, YEAR, DAY,... | #' Preprocessing of PEP725 data, merges separate files into tidy
#' data, with each observation a line, each column a different
#' parameter value.
#'
#' @param path: a path to the PEP725 data (species files only)
#' @return concatted data of all data in the path as a tidy data frame
#' listing PEP_ID, BBCH, YEAR, DAY,... | agpl-3.0 | R |
5323a0989e3e42b182037c43fafa33d243abe1a6 | Update connect.r | snowch/biginsight-examples,snowch/biginsight-examples | examples/BigR/connect.r | examples/BigR/connect.r | ################################################################################
# environment variables
################################################################################
libdir <- Sys.getenv("libdir")
hostname <- Sys.getenv("hostname")
username <- Sys.getenv("username")
password <- Sys.getenv("passwor... | ################################################################################
# Replace these settings with the output from ../../gradlew GenerateConfig
################################################################################
libdir <- Sys.getenv("libdir")
hostname <- Sys.getenv("hostname")
username <- Sys... | apache-2.0 | R |
1c7f634659f672017b75e9d697f31cb6a9e5a894 | 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 |
f0774c22d5289ac08dfd5b234a13a3ecd84d5458 | Modify gsr-plot's y range to 0..ceil(max(values)) | returnString/node-gsr,returnString/node-gsr | bin/gsr-plot.r | bin/gsr-plot.r | #!/usr/bin/env RScript
library(ggplot2)
args <- commandArgs(trailingOnly = T)
main <- function()
{
inputPath <- args[1]
outputPath <- args[2]
if (is.na(inputPath))
{
stop('Please specify a csv file')
}
if (is.na(outputPath))
{
stop('Please specify an output file')
}
data <- read.csv(inputPath)
plot <-... | #!/usr/bin/env RScript
library(ggplot2)
args <- commandArgs(trailingOnly = T)
main <- function()
{
inputPath <- args[1]
outputPath <- args[2]
if (is.na(inputPath))
{
stop('Please specify a csv file')
}
if (is.na(outputPath))
{
stop('Please specify an output file')
}
data <- read.csv(inputPath)
plot <-... | mit | R |
7572b711a1e4db4304cbdc06e353f5b48c2822d6 | fix mailto: property | hansthompson/shiny-server,hansthompson/shiny-server,hansthompson/shiny-server | CannabisZoning/App.r | CannabisZoning/App.r | library(shinythemes)
library(rgeos)
library(rgdal)
library(leaflet)
library(geojsonio)
load("map.rda")
ui <- bootstrapPage(theme = shinytheme("spacelab"),
title = "Cannabis Business Zoning",
tags$head(includeScript("google-analytics.js")),
tags$style(type = ... | library(shinythemes)
library(rgeos)
library(rgdal)
library(leaflet)
library(geojsonio)
load("map.rda")
ui <- bootstrapPage(theme = shinytheme("spacelab"),
title = "Cannabis Business Zoning",
tags$head(includeScript("google-analytics.js")),
tags$style(type = ... | mit | R |
08fc2955a1f04fd5fc5ba7a8a5a5b1fe50b471ce | Update clomin_7730.r | alfcrisci/rBiometeo,alfcrisci/rBiometeo | R/clomin_7730.r | R/clomin_7730.r | #' clomin_7730
#'
#' Calculate minimal clothing insulation value needed for thermal comfort in moderate thermal environments based on PMV ISO 7730.
#'
#' @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.
... | #' clomin_7730
#'
#' Calculate minimal clothing insulation value needed for thermal comfort in moderate thermal environments based on PMV ISO 7730.
#'
#' @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.
... | mit | R |
e3552665596378a932e69212fe41510be99add93 | Update test.r | snowch/biginsight-examples,snowch/biginsight-examples | examples/BigR/test.r | examples/BigR/test.r |
# check if lib dir exists
if("./lib" %in% dir() == FALSE) {
# create directory to hold libraries
dir.create('./lib')
# install libraries
install.packages('rJava', repos='http://cran.us.r-project.org', lib='./lib', quiet=FALSE)
install.packages('base64enc', repos='http://cran.us.r-project.org', li... |
if (!dir.exists('./lib')) {
# create directory to hold libraries
dir.create('./lib')
# install libraries
install.packages('rJava', repos='http://cran.us.r-project.org', lib='./lib', quiet=FALSE)
install.packages('base64enc', repos='http://cran.us.r-project.org', lib='./lib', quiet=FALSE)
inst... | apache-2.0 | R |
b2044a2f36c0e5b41ebd635cbe985f9112e00f6a | Update test.r | snowch/biginsight-examples,snowch/biginsight-examples | examples/BigR/test.r | examples/BigR/test.r | dir.create('./lib')
install.packages('rJava', repos='http://cran.us.r-project.org', lib='./lib', quiet=FALSE)
install.packages('base64enc', repos='http://cran.us.r-project.org', lib='./lib', quiet=FALSE)
install.packages('data.table', repos='http://cran.us.r-project.org', lib='./lib', quiet=FALSE)
# The BigR package ... | dir.create('./lib')
install.packages('rJava', repos='http://cran.us.r-project.org', lib='./lib', quiet=FALSE)
install.packages('base64enc', repos='http://cran.us.r-project.org', lib='./lib', quiet=FALSE)
install.packages('data.table', repos='http://cran.us.r-project.org', lib='./lib', quiet=FALSE)
install.packages('bi... | apache-2.0 | R |
fb42bf3c01bbdc10908d8d209a716cb3401ecf2b | Add 3d sim/plot. | jtobin/bnp | finite-gaussian-mixture/src/simulation_multivariate.r | finite-gaussian-mixture/src/simulation_multivariate.r | require(ggplot2)
require(reshape2)
require(scatterplot3d)
source('fmm_multivariate_generative.r')
# 2d
config = list(
m = 2
, v = 2
, k = 4
, n = 10000
)
set.seed(42)
d = model(config$m, config$k, config$v, config$n)
framed = lapply(d, function(mat) { data.frame(x = mat[,1], y = mat[,2]) })
melted... | set.seed(42)
require(ggplot2)
require(reshape2)
source('fmm_multivariate_generative.r')
config = list(
m = 2
, v = 2
, k = 4
, n = 10000
)
d = model(config$m, config$k, config$v, config$n)
framed = lapply(d, function(mat) { data.frame(x = mat[,1], y = mat[,2]) })
melted = melt(framed, id.vars = c(... | mit | R |
b962a5de60f8c912244fd2415348ee2f50bdfb73 | add PythonInR package for R | felipenoris/math-server-docker,felipenoris/AWSFinance,felipenoris/AWSFinance,felipenoris/math-server-docker | libs/r-packages.r | libs/r-packages.r |
pkgs <- c(
"alabama",
"base64enc",
"caret",
"cubature",
"data.table",
"DEoptim",
"devtools",
"doParallel",
"doSNOW",
"dyn",
"dynlm",
"extrafont",
"fAsianOptions",
"fAssets",
"fBasics",
"fBonds",
"fCopulae",
"fExoticOptions",
"fExtremes",
"fGarch",
"fImport",
"fMultivar",
"fNonlinear",
"fOptions... |
pkgs <- c(
"alabama",
"base64enc",
"caret",
"cubature",
"data.table",
"DEoptim",
"devtools",
"doParallel",
"doSNOW",
"dyn",
"dynlm",
"extrafont",
"fAsianOptions",
"fAssets",
"fBasics",
"fBonds",
"fCopulae",
"fExoticOptions",
"fExtremes",
"fGarch",
"fImport",
"fMultivar",
"fNonlinear",
"fOptions... | mit | R |
03135eb0f997c41b3b5949ec6bc650d08104dabd | Rename train -> training | srijanshetty/linear-discriminants | classwise_data.r | classwise_data.r | setwd(".")
# Always generate the same data
set.seed(111)
# Number of samples
sample_size = 1500
training_size = 0.8
validation_size = 0.1
test_size = 0.1
###################################################################
# To generate the waveform data we use mlbench
# mlbench uses Breiman's original waveform sourc... | setwd(".")
# Always generate the same data
set.seed(111)
# Number of samples
sample_size = 1500
train_size = 0.8
validation_size = 0.1
test_size = 0.1
###################################################################
# To generate the waveform data we use mlbench
# mlbench uses Breiman's original waveform source m... | mit | R |
5e674a584410e5c8f9321db51da3d775645f7227 | Update power.pairedT.r | aomidpanah/power | power.pairedT.r | power.pairedT.r | power.pairedT <- function(npair, rho, effectSize, sd, alpha, nsims=1000) {
Sigma <- matrix(c(1, rho, rho, 1), 2, 2)
cSig <- chol(Sigma) * sd
out <- replicate(nsims, {
Y <- matrix(rnorm(npair*2), npair, 2)
Y <- Y %*% cSig
Y[, 2] <- Y[, 2] + effectSize
t.test(x=Y[, 1], y=Y[, 2], paired=TRUE)$p.value... | power.pairedT <- function(npair, rho, effectSize, sd, alpha, nsims=1000) {
out <- replicate(nsims, {
Sigma <- matrix(c(1, rho, rho, 1), 2, 2)
Y <- matrix(rnorm(npair*2), npair, 2)
Y <- Y %*% chol(Sigma) * sd
Y[, 2] <- Y[, 2] + effectSize
t.test(x=Y[, 1], y=Y[, 2], paired=TRUE)$p.value
})
mean(... | lgpl-2.1 | R |
1948058bfe7e7cbc1bce63a9ee441de99c6e99d9 | fix wrong envir when checking vars | mschubert/narray,mschubert/narray | checks.r | checks.r | subsets = function(X, along, subsets) {
if (length(subsets) != dim(as.array(X))[along])
stop("subset length must match X dimension on along axis")
if (any(is.na(subsets)))
stop("found NA in subsets, exiting")
}
along = function(X, along) {
if (any(duplicated(dimnames(X)[[along]])))
... | subsets = function(X, along, subsets) {
if (length(subsets) != dim(X)[along])
stop("subset length must match X dimension on along axis")
if (any(is.na(subsets)))
stop("found NA in subsets, exiting")
}
along = function(X, along) {
if (any(duplicated(dimnames(X)[[along]])))
stop("dup... | apache-2.0 | R |
8169553fcc7b8b28bf6c4e0113104cff208a691a | fix ar/mask & fail_on_error for b/lnapply | mschubert/narray,mschubert/narray | filter.r | filter.r | .b = import_('../base')
.m = import_('./map')
#' Function to discard subsets of an array (NA or drop)
#'
#' @param X An n-dimensional array
#' @param along Along which axis to apply \code{FUN}
#' @param FUN Function to apply, needs to return \code{TRUE} (keep) or \code{FALSE}
#' @param subsets Subsets ... | .b = import_('../base')
.m = import_('./map')
#' Function to discard subsets of an array (NA or drop)
#'
#' @param X An n-dimensional array
#' @param along Along which axis to apply \code{FUN}
#' @param FUN Function to apply, needs to return \code{TRUE} (keep) or \code{FALSE}
#' @param subsets Subsets ... | apache-2.0 | R |
a3ce39c5736844e9a0380995197a1e6a7b05d4ee | remove "Gene" from gene list | shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl | lib/Annotation/WebGestaltR.r | lib/Annotation/WebGestaltR.r | options(bitmapType='cairo')
library(WebGestaltR)
args = commandArgs(trailingOnly=TRUE)
organism = args[1] #hsapiens
sampleName=args[2]
geneFile = args[3]
outputDirectory = args[4]
interestGeneType = args[5]
referenceSet = args[6]
cat("organism=", organism, "\n")
cat("sampleName=", sampleName, "\n")
cat... | options(bitmapType='cairo')
library(WebGestaltR)
args = commandArgs(trailingOnly=TRUE)
organism = args[1] #hsapiens
sampleName=args[2]
geneFile = args[3]
outputDirectory = args[4]
interestGeneType = args[5]
referenceSet = args[6]
cat("organism=", organism, "\n")
cat("sampleName=", sampleName, "\n")
cat... | apache-2.0 | R |
b2a6d57a5bfd142b9222d18ce3fa7200daca3c6c | Update PiPL | baku89/glslCanvas4AE,baku89/glslCanvas4AE,baku89/glslCanvas4AE,baku89/glslCanvas4AE | GLSLCanvasPiPL.r | GLSLCanvasPiPL.r | #include "AEConfig.h"
#include "AE_EffectVers.h"
#ifndef AE_OS_WIN
#include <AE_General.r>
#endif
resource 'PiPL' (16000) {
{ /* array properties: 12 elements */
/* [1] */
Kind {
AEEffect
},
/* [2] */
Name {
"GLSLCanvas"
},
/* [3] */
Category {
"Shader"
},
#ifdef AE_OS_WIN
#ifdef AE_PRO... | #include "AEConfig.h"
#include "AE_EffectVers.h"
#ifndef AE_OS_WIN
#include <AE_General.r>
#endif
resource 'PiPL' (16000) {
{ /* array properties: 12 elements */
/* [1] */
Kind {
AEEffect
},
/* [2] */
Name {
"GLSLCanvas"
},
/* [3] */
Category {
"Shader"
},
#ifdef AE_OS_WIN
#ifdef AE_PRO... | mit | R |
42a5a74e4caa2a046b6ef564f3409321cd0a26c7 | simplify code | khufkens/phenor | R/check_npn_species.r | R/check_npn_species.r | #' Checks if USA-NPN species exists
#'
#' @param species An USA-NPN species (character or number).
#' Will search in both Genus species and common name fields and will match
#' any term within those fields. The search relies on regular expressions so
#' this can be used to be more specific.
#' @param list List all spec... | #' Checks if USA-NPN species exists
#'
#' @param species An USA-NPN species (character or number).
#' Will search in both Genus species and common name fields and will match
#' any term within those fields. The search relies on regular expressions so
#' this can be used to be more specific.
#' @param list List all spec... | agpl-3.0 | R |
cf17f3bed791e562dacdf79f7f003fde4121b432 | Fix z-score calculation. | thehyve/heim-SmartR,thehyve/naa-SmartR,thehyve/heim-SmartR,agapow/smartr,agapow/smartr,thehyve/naa-SmartR,thehyve/heim-SmartR,agapow/smartr,thehyve/heim-SmartR,agapow/smartr,thehyve/naa-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["SIGNIFICANCE"] <- variances
df["MEAN"] <- apply(df[,3:ncol(df... | 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["SIGNIFICANCE"] <- variances
df <- df[with(df, order(-SIGNIFIC... | apache-2.0 | R |
56779c767209b6b10e6ca3aa015f317891170495 | Update BuildReports.r | bgweber/RServer,bgweber/RServer,bgweber/RServer,bgweber/RServer | tasks/RServerTasks/BuildReports.r | tasks/RServerTasks/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("TaskRepo... |
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("TaskReport.rmd", output_format = "html_document", output_file = "RServe... | bsd-3-clause | R |
054e161ca9f832cb024918f581698d3f3e1c0b2a | Add race to graph and image logos | thorshand/electionBuster,thorshand/electionBuster,thorshand/electionBuster,thorshand/electionBuster,thorshand/electionBuster | graph/network_graph.r | graph/network_graph.r | #!/usr/bin/env Rscript
suppressMessages(library( "igraph" ));
library( "getopt" );
library( "png" ) ;
#get options, using the spec as defined by the enclosed list.
#we read the options from the default: commandArgs(TRUE).
spec = matrix(c( 'file', 'f', 2, "character",
'output', 'o', 1, "character",
'title', ... | #!/usr/bin/env Rscript
suppressMessages(library( "igraph" ));
library( "getopt" );
#get options, using the spec as defined by the enclosed list.
#we read the options from the default: commandArgs(TRUE).
spec = matrix(c( 'file', 'f', 2, "character",
'output', 'o', 1, "character",
'title', 't', 1, "character"... | mit | R |
1b4fbf84c3c52b80a8f0b3fc216eb754f9efdd4f | add linprog and lpSolveAPI R packages | felipenoris/math-server-docker,felipenoris/AWSFinance,felipenoris/AWSFinance,felipenoris/math-server-docker | libs/r-packages.r | libs/r-packages.r |
pkgs <- c(
"alabama",
"base64enc",
"caret",
"cubature",
"data.table",
"DEoptim",
"devtools",
"doParallel",
"doSNOW",
"dyn",
"dynlm",
"extrafont",
"fAsianOptions",
"fAssets",
"fBasics",
"fBonds",
"fCopulae",
"fExoticOptions",
"fExtremes",
"fGarch",
"fImport",
"fMultivar",
"fNonlinear",
"fOptions... |
pkgs <- c(
"alabama",
"base64enc",
"caret",
"cubature",
"data.table",
"DEoptim",
"devtools",
"doParallel",
"doSNOW",
"dyn",
"dynlm",
"extrafont",
"fAsianOptions",
"fAssets",
"fBasics",
"fBonds",
"fCopulae",
"fExoticOptions",
"fExtremes",
"fGarch",
"fImport",
"fMultivar",
"fNonlinear",
"fOptions... | mit | R |
6822f4f4d23f508a740704a2da4b387ac4fc7251 | use which() to avoid errors on NA values | khufkens/phenor | R/triangular_temperature_response.r | R/triangular_temperature_response.r | #' Triangular temperature response function as defined in
#' Basler et al. 2016 (Agr. For. Meteorlogy)
#'
#' @param T a vector or matrix of temperatures
#' @param T_opt optimal temperature
#' @param T_min minimum viable temperature
#' @param T_max maximum viable temperature
#' @keywords phenology, model, temperature re... | #' Triangular temperature response function as defined in
#' Basler et al. 2016 (Agr. For. Meteorlogy)
#'
#' @param T a vector or matrix of temperatures
#' @param T_opt optimal temperature
#' @param T_min minimum viable temperature
#' @param T_max maximum viable temperature
#' @keywords phenology, model, temperature re... | agpl-3.0 | R |
fcc1dcf782df5d5a1b94a867904e3dc1eff00819 | create stop word list from tables | petercarrjones/icc-data,petercarrjones/icc-data,petercarrjones/icc-data | table.r | table.r | #load and parse html tables
#load libraries
library(stringr)
library(stringi)
library(XML)
library(dplyr)
library(magrittr)
#function to clean up character vectors- removes punctuation.
get_real_words <- function(word) {
word[!stringr::str_detect(word, "[^a-z ]")]
}
#Loads all the html tables into one list
table_d... | #load and parse html tables
#load libraries
library(stringr)
library(stringi)
library(XML)
library(dplyr)
library(magrittr)
#Loads all the html tables into one list
table_dir <- "table"
files <- dir(table_dir, "*.html")
tbls <- file.path(table_dir, files) %>%
lapply(., htmlParse) %>%
lapply(., readHTMLTable, head... | mit | R |
9bb0a2dc81fc0cb01af328ca27acba293f1bee76 | Update sunnyside.r | sequenceiq/r_datagen | clustering/sunnyside.r | clustering/sunnyside.r | #Sunnyside, 6h, 12h and 18h clusters, #250000
#location
n1<-250
multiplier<-1
dev<-0.02
x<-c(rnorm(n1,mean=37.72891,sd=dev))
y<-c(rnorm(n1,mean=-122.44503,sd=dev))
#datetime
start<-as.POSIXct(strptime("2014/01/01", "%Y/%m/%d"))
end<-as.POSIXct(strptime("2014/02/28", "%Y/%m/%d"))
dt<-end-start
dd<-dt/2
h<-dd/24
t<-c(s... | #Sunnyside, 6h, 12h and 18h clusters, #250000
#location
n1<-250
multiplier<-1
dev<-0.02
x<-c(rnorm(n1,mean=37.72891,sd=dev))
y<-c(rnorm(n1,mean=-122.44503,sd=dev))
#datetime
start<-as.POSIXct(strptime("2014/01/01", "%Y/%m/%d"))
end<-as.POSIXct(strptime("2014/02/28", "%Y/%m/%d"))
dt=end-start
dd<-dt/2
t<-c(start+rnorm... | apache-2.0 | R |
e90c5423ccdf8a90f8c49aa3c6843b6b8563728a | Update uvoz_tabele3.r | ZavbiA/APPR-2017 | uvoz/uvoz_tabele3.r | uvoz/uvoz_tabele3.r | library(rvest)
library(gsubfn)
library(readr)
library(dplyr)
# Funkcija, ki uvozi tabele slovenskih medalistov
link1 <- "http://www.olympic.si/olimpijski-wiki/olimpijske-igre"
stran1 <- html_session(link1) %>% read_html(encoding = "UTF-8")
tabele <- stran1 %>% html_nodes(xpath="//div[@id='vsebina259']/... | library(rvest)
library(gsubfn)
library(readr)
library(dplyr)
# Funkcija, ki uvozi tabele slovenskih medalistov
link1 <- "http://www.olympic.si/olimpijski-wiki/olimpijske-igre"
stran1 <- html_session(link1) %>% read_html(encoding = "UTF-8")
tabele <- stran1 %>% html_nodes(xpath="//div[@id='vsebina259']/... | mit | R |
ec59a11532ca19651cf6a065a6f1e08bd99555c7 | Update lost_productivity.r | alfcrisci/rBiometeo,alfcrisci/rBiometeo | R/lost_productivity.r | R/lost_productivity.r | #' lost_productivity
#'
#' Calculate the percentage in worker's lost productivity due to heat conditions.
#'
#' @param wbgt numeric Wetbulb globe temperature index in degC
#' @param tresh numeric treshshold for loss in degC
#'
#' @return percentage of productivity lost
#'
#' @author Istituto per la Bioeconomia C... | #' lost_productivity
#'
#' Calculate the percentage in worker's lost productivity due to heat conditions.
#'
#' @param wbgt numeric Wetbulb globe temperature index in degC
#' @param tresh numeric treshshold for loss in degC
#'
#' @return percentage of productivity lost
#'
#' @author Istituto per la Bioeconomia C... | mit | R |
c9be2ceb9dbb817fc3cf6a680b34a84d6c45f1ff | remove unnecessary comment | robertzk/Ramd | R/load_dependency.r | R/load_dependency.r | #' Load a bunch of dependencies by filename
#'
#' @param dep Name of dependency, e.g., relative filename (without .r)
#' \dontrun{
#' helper <- load_dependency('path/to/helper')
#' }
load_dependency <- function(dep) {
path <- base::normalizePath(paste(current_directory(), "/", dep, '.r', sep = ''))
fileinfo <- fi... | #' Load a bunch of dependencies by filename
#'
#' @param dep Name of dependency, e.g., relative filename (without .r)
#' \dontrun{
#' helper <- load_dependency('path/to/helper')
#' }
load_dependency <- function(dep) {
path <- base::normalizePath(paste(current_directory(), "/", dep, '.r', sep = ''))
fileinfo <- fi... | mit | R |
5a68315ff4a56aaf78c368d6b4f3bef5ba80728a | Update steadman_class.r | alfcrisci/rBiometeo,alfcrisci/rBiometeo | R/steadman_class.r | R/steadman_class.r | #' steadman_class
#'
#' Computes the correspondent Steadman's apparent temperature class.
#'
#' @param numeric steadman_index Steadman index value.
#' @return class of apparent temperature.
#'
#'
#' @author Istituto di Biometeorologia Firenze Italy Alfonso Crisci \email{a.crisci@@ibimet.cnr.it}
#' @keywords class, ... | #' steadman_class
#'
#' Computes the correspondent Steadman's apparent temperature class.
#'
#' @param numeric steadman_index Steadman index value.
#' @return class of apparent temperature.
#'
#'
#' @author Istituto di Biometeorologia Firenze Italy Alfonso Crisci \email{a.crisci@@ibimet.cnr.it}
#' @keywords class, ... | mit | R |
01281488fd9a0461585f2ef7b5e75c84e59eb49b | add na_rm arg | mschubert/narray,mschubert/narray | R/translate.r | R/translate.r | #' Translate an axis between two sets of identifiers
#'
#' @param x A matrix
#' @param from Names that match the dimension `along`
#' @param to Names that this dimension should be summarized to
#' @param along Along which axis to summarize
#' @param ... Parameters passed to `match`
#' @param FUN Which... | #' Translate an axis between two sets of identifiers
#'
#' @param x A matrix
#' @param from Names that match the dimension `along`
#' @param to Names that this dimension should be summarized to
#' @param along Along which axis to summarize
#' @param ... Parameters passed to `match`
#' @param FUN Which... | apache-2.0 | R |
081f313448b29d816e6c2f48b02af10d5ee7e6ea | remove browser comment | robertzk/mungebits | inst/tests/test-mungebit.r | inst/tests/test-mungebit.r | context("mungebit reference class")
require(mungebitsTransformations)
test_that("it correctly sets trained flag after one run", {
mb <- mungebit(column_transformation(function(x) x))
expect_false(mb$trained)
mb$run(mungeplane(iris))
expect_true(mb$trained)
})
test_that("it correctly executes training and pred... | context("mungebit reference class")
require(mungebitsTransformations)
test_that("it correctly sets trained flag after one run", {
mb <- mungebit(column_transformation(function(x) x))
expect_false(mb$trained)
mb$run(mungeplane(iris))
expect_true(mb$trained)
})
test_that("it correctly executes training and pred... | mit | R |
4b4326c91b894f425b4911b4d3f94abb94c5cf92 | update reference to github | leeper/leeper.github.io | code/r/expResults.r | code/r/expResults.r | # FUNCTION TO PRODUCE A SIMPLE EXPERIMENTAL RESULTS TABLE
# FOUR-COLUMN TABLE WITH TREATMENT GROUP MEAN, SD, N, AND SE
# Copyright (C) 2011 Thomas J. Leeper
# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Fou... | # FUNCTION TO PRODUCE A SIMPLE EXPERIMENTAL RESULTS TABLE
# FOUR-COLUMN TABLE WITH TREATMENT GROUP MEAN, SD, N, AND SE
# Copyright (C) 2011 Thomas J. Leeper
# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Fou... | mit | R |
06cc4f7be959f721ec5d4397e59e377238868c74 | Change git ripository list's URL | koji-to/effort_calculator,koji-to/effort_calculator,koji-to/effort_calculator | generate_git_clone_sh.r | generate_git_clone_sh.r | ####### generate .sh script for "git clone"
##### Set git directory structure file path
gitweb<-"http://git.chromium.org/gitweb/?a=project_index"
#####
shell.df<-read.csv(gitweb,header=F)
### save git repository tree in local
write.table(shell.df,"chromium_git_repo_tree.txt",col.names=F,row.names=F,quote=F,append=F)
... | ####### generate .sh script for "git clone"
##### Set git directory structure file path
gitweb<-"https://git.chromium.org/gitweb/?a=project_index"
#####
shell.df<-read.csv(gitweb,header=F)
### save git repository tree in local
write.table(shell.df,"chromium_git_repo_tree.txt",col.names=F,row.names=F,quote=F,append=F)
... | mit | R |
b71bb71f703dbb8b5792b62bff4bb381da3f2f14 | Add snow and vegan | 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 |
8a33c52dc9c3707fe09a3ff4f2216d0bf83b119a | Fix case for single sample dataset. | agapow/smartr,thehyve/heim-SmartR,thehyve/heim-SmartR,agapow/smartr,thehyve/naa-SmartR,thehyve/heim-SmartR,thehyve/heim-SmartR,agapow/smartr,agapow/smartr,thehyve/naa-SmartR,thehyve/naa-SmartR | web-app/HeimScripts/heatmap/run.r | web-app/HeimScripts/heatmap/run.r | 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)), ]
... | library(jsonlite)
library(reshape2)
main <- function(max_rows){
df <- loaded_variables[[1]] # SmartR does not support multiple HDD nodes yet
variances <- apply(df[,3:ncol(df)],1,var) # Calculating variance per probe
df["variance"] <- variances
df <- df[with(df, order(-variance)), ]
df <- df[1:max_rows,]
d... | apache-2.0 | R |
37606ad6f3fde92d14bf5acbf2aefe37ac7101d5 | fix the y axis to start at zero | rhansen/rpstir,rhansen/rpstir,rhansen/rpstir,rhansen/rpstir,rhansen/rpstir | bin/rpki-statistics/plots/run-times-over-time.r | bin/rpki-statistics/plots/run-times-over-time.r | data <- read.table('run-times-over-time.dat', sep="\t", header=TRUE)
data$Start <- as.POSIXlt(read.table('times.dat', sep="\t", header=TRUE)$Start)
png('run-times-over-time.png', width=1600, height=1200, pointsize=24)
plot(data$Start, data$Duration/60, type="o",
main="Combined Fetch and Validation Times",
xlab... | data <- read.table('run-times-over-time.dat', sep="\t", header=TRUE)
data$Start <- as.POSIXlt(read.table('times.dat', sep="\t", header=TRUE)$Start)
png('run-times-over-time.png', width=1600, height=1200, pointsize=24)
plot(data$Start, data$Duration/60, type="o",
main="Combined Fetch and Validation Times",
xlab... | bsd-3-clause | R |
33e7852af7b7a1cc29cf081d590cebbd21415500 | Fix LAUNCH to properly work with argv-based CALL | zsx/r3,zsx/r3,zsx/r3,zsx/r3 | src/mezz/mezz-control.r | src/mezz/mezz-control.r | REBOL [
System: "REBOL [R3] Language Interpreter and Run-time Environment"
Title: "REBOL 3 Mezzanine: Control"
Rights: {
Copyright 2012 REBOL Technologies
REBOL is a trademark of REBOL Technologies
}
License: {
Licensed under the Apache License, Version 2.0
See: http://www.apache.org/licenses/LICENSE-2.0
... | REBOL [
System: "REBOL [R3] Language Interpreter and Run-time Environment"
Title: "REBOL 3 Mezzanine: Control"
Rights: {
Copyright 2012 REBOL Technologies
REBOL is a trademark of REBOL Technologies
}
License: {
Licensed under the Apache License, Version 2.0
See: http://www.apache.org/licenses/LICENSE-2.0
... | apache-2.0 | R |
cebbf5414274bb0e8e86e498359679ecb4850c2f | Update dialplot.r | nairvinayv/random_scripts,nairvinayv/random_scripts | dialplot.r | dialplot.r | #R-Code for generating Polar plots using the plotrix library
library(plotrix)
data<-read.csv('15T-epsilon.dat')
setEPS()
png("15T-epsilon.png")
polar.plot(data[1:14999,1],data[1:14999,2],rp.type="p",start=90,clockwise=TRUE,main=expression(paste("Torsion Angles: 1,5T-",epsilon)))
dev.off()
| library(plotrix)
data<-read.csv('15T-epsilon.dat')
setEPS()
png("15T-epsilon.png")
polar.plot(data[1:14999,1],data[1:14999,2],rp.type="p",start=90,clockwise=TRUE,main=expression(paste("Torsion Angles: 1,5T-",epsilon)))
dev.off()
| mit | R |
3372c4bb61f0f87a8e87728281a2c8af22cfdd6b | fix var name lookup | jae0/bio.snowcrab,jae0/bio.snowcrab | R/lookup.datatransformation.r | R/lookup.datatransformation.r |
lookup.datatransformation = function( ) {
# determine data transformations based upon category of data and data source
log.transform = bio.snowcrab::variable.list.expand("log.transform")
scaled.centered = bio.snowcrab::variable.list.expand("scaled.centered")
sn = bio.snowcrab::variable.list.expand("... |
lookup.datatransformation = function( ) {
# determine data transformations based upon category of data and data source
log.transform = bio.snowcrab::variable.list.expand("log.transform")
scaled.centered = bio.snowcrab::variable.list.expand("scaled.centered")
sn = bio.snowcrab::variable.list.expand("... | mit | R |
fc70a0dd5cb6ed7b352c0828afb99ea483717ba5 | Make CLOSURE a FUNCT for closures (#2002) | codebybrett/ren-c,codebybrett/ren-c,hostilefork/rebol,earl/r3,draegtun/ren-c,rebolsource/r3,kealist/ren-c,codebybrett/ren-c,draegtun/ren-c,hostilefork/rebol,mbk/ren-c,kealist/ren-c,draegtun/ren-c,draegtun/ren-c,giuliolunati/ren-c,earl/r3,codebybrett/ren-c,mbk/ren-c,codebybrett/ren-c,mbk/ren-c,rgchris/ren-c,hostilefork/... | src/mezz/mezz-func.r | src/mezz/mezz-func.r | REBOL [
System: "REBOL [R3] Language Interpreter and Run-time Environment"
Title: "REBOL 3 Mezzanine: Function Helpers"
Rights: {
Copyright 2012 REBOL Technologies
REBOL is a trademark of REBOL Technologies
}
License: {
Licensed under the Apache License, Version 2.0
See: http://www.apache.org/licenses/LICE... | REBOL [
System: "REBOL [R3] Language Interpreter and Run-time Environment"
Title: "REBOL 3 Mezzanine: Function Helpers"
Rights: {
Copyright 2012 REBOL Technologies
REBOL is a trademark of REBOL Technologies
}
License: {
Licensed under the Apache License, Version 2.0
See: http://www.apache.org/licenses/LICE... | apache-2.0 | R |
21864490f7add14dfb147e307f3ed768ddb8bad0 | fix minor bug in overall run-all.r to build auto-tests if needed | rheber/red,vehar/red,rheber/red,red-eco/red,vehar/red,NikolayShubenkovProgSchool/red,red-eco/red,iArnold/red,iArnold/red,NikolayShubenkovProgSchool/red | run-all.r | run-all.r | REBOL [
Title: "Builds and Runs All Red and Red/System Tests"
File: %run-all.r
Author: "Peter W A Wood"
Version: 0.2.1
License: "BSD-3 - https://github.com/dockimbel/Red/blob/master/BSD-3-License.txt"
]
;; function to find and run-tests and to build auto tests if needed
run-all-script: func [
dir [file!]
... | REBOL [
Title: "Builds and Runs All Red and Red/System Tests"
File: %run-all.r
Author: "Peter W A Wood"
Version: 0.2.1
License: "BSD-3 - https://github.com/dockimbel/Red/blob/master/BSD-3-License.txt"
]
;; function to find and run-tests
run-all-script: func [dir [file!]][
qt/tests-dir: system/script/path/:... | bsd-3-clause | R |
7e5847dd0d27d28fb0dd4524dd3c8e4757099bf1 | Add script name to sys module | klmr/codons,klmr/codons | scripts/sys/__init__.r | scripts/sys/__init__.r | # Command line tools don’t want to clutter their output with unnecessary noise.
library = function (...)
suppressMessages(base::library(...))
#' The command line arguments
args = commandArgs(trailingOnly = TRUE)
#' The name of the script
script_name = local({
file = grep('^--file=', commandArgs(trailingOnly =... | # Command line tools don’t want to clutter their output with unnecessary noise.
library = function (...)
suppressMessages(base::library(...))
#' The command line arguments
args = commandArgs(trailingOnly = TRUE)
#' Quit the program
#'
#' @param code numeric exit code (default: \code{0})
exit = function (code = 0)... | apache-2.0 | R |
0f259d4e896d28ebb0dfa3105f152a1f61c23b6d | use FeaturePlot for localization map | shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl | lib/scRNA/gene_localization_map.r | lib/scRNA/gene_localization_map.r | rm(list=ls())
outFile='mouse_8870'
parSampleFile1='fileList1.txt'
parSampleFile2='fileList2.txt'
parSampleFile3=''
parFile1='/scratch/jbrown_lab/shengq2/projects/20221117_scRNA_8870_mouse/seurat_sct_merge/result/mouse_8870.final.rds'
parFile2=''
parFile3=''
setwd('/scratch/jbrown_lab/shengq2/projects/20221117_scRNA_... |
source("scRNA_func.r")
library(Seurat)
library(ggplot2)
library(ggpubr)
obj<-read_object(parFile1)
if(file.exists(parSampleFile2)){
groups_tbl<-read.table(parSampleFile2, sep="\t", stringsAsFactors = F)
groups=split(groups_tbl$V2, groups_tbl$V1)
obj$group = unlist(groups[obj$orig.ident])
ngroup=length(uniq... | apache-2.0 | R |
d575387feeb0d5f7801899be3c90c676085ad36b | comment out name | kf8a/tdr-cleaner,kf8a/tdr-cleaner | fft-filter.r | fft-filter.r | library(signal)
library(plyr)
daily <- function(x) { if (length(x) > 5) {median(x, na.rm=T) } else { NA} }
filter <- function(x) runmed(x, 13)
data <- read.csv('data.csv', header=F)
names(data) <- c('plot','depth','datetime','vwc')
data$datetime <- as.POSIXct(data$datetime)
data$date <- as.Date(format(data$datetime... | library(signal)
library(plyr)
daily <- function(x) { if (length(x) > 5) {median(x, na.rm=T) } else { NA} }
filter <- function(x) runmed(x, 13)
data <- read.csv('data.csv', header=F)
names(data) <- c('plot','depth','datetime','vwc')
data$datetime <- as.POSIXct(data$datetime)
data$date <- as.Date(format(data$datetime... | mit | R |
4addddc14f0f615bc436f478b140dd3dca0dfe8b | Update server.r | jbpost2/IntermediateR,jbpost2/IntermediateR | files/DynamicUI/server.r | files/DynamicUI/server.r | library(shiny)
library(dplyr)
library(ggplot2)
shinyServer(function(input, output, session) {
#get data for only order specified
getData <- reactive({
vores <- input$vore
newData <- msleep %>% filter(vore == vores)
newData
})
#create plot
output$sleepPlot <- renderPlot({
#g... | library(shiny)
library(dplyr)
library(ggplot2)
shinyServer(function(input, output, session) {
#get data for only order specified
getData <- reactive({
vores <- input$vore
newData <- msleep %>% filter(vore == vores)
newData
})
#create plot
output$sleepPlot <- renderPlot({
#g... | apache-2.0 | R |
ba1a9c8621150ba6fdda5be62c8b7f99d9e0684c | Update steadman_class.r | alfcrisci/rBiometeo,alfcrisci/rBiometeo | R/steadman_class.r | R/steadman_class.r | #' steadman_class
#'
#' Computes the correspondent Steadman's apparent temperature class.
#'
#' @param numeric steadman_index Steadman index value.
#' @return class of apparent temperature.
#'
#'
#' @author Istituto di Biometeorologia Firenze Italy Alfonso Crisci \email{a.crisci@@ibimet.cnr.it}
#' @keywords class, ... | #' steadman_class
#'
#' Computes the correspondent Steadman's apparent temperature class.
#'
#' @param numeric steadman_index Steadman index value.
#' @return class of apparent temperature.
#'
#'
#' @author Istituto di Biometeorologia Firenze Italy Alfonso Crisci \email{a.crisci@@ibimet.cnr.it}
#' @keywords class, ... | mit | R |
e487f9b72eaa5ea52bcdfbc004a66c4f7ef4bd56 | Clean up code comments | johnrfleck/water-tools | annual_gauge.r | annual_gauge.r | # download and summarize annual flow at any gauge
# tutorial here: https://owi.usgs.gov/R/dataRetrieval.html#1
library(dataRetrieval)
library(tidyverse)
library(lubridate)
#get gauge number
siteNo <- readline(prompt="Enter a gauge number: ")
#siteNo <- "08330000"
# get station metadata
gauge_meta <- readNWISsite(s... | # download and summarize annual flow at any gauge
# tutorial here: https://owi.usgs.gov/R/dataRetrieval.html#1
library(dataRetrieval)
library(tidyverse)
library(lubridate)
#get gauge number
siteNo <- readline(prompt="Enter a gauge number: ")
#siteNo <- "08330000"
# get station metadata
gauge_meta <- readNWISsite(s... | mit | R |
178386c468db1863dd027ca50117c9a1506f11c7 | Fix error in documentation of "import.path" | klmr/modules,klmr/modules | R/modules-package.r | R/modules-package.r | #' An alternative module system for R
#'
#' Use \code{module = import('module')} to import a module for usage, or
#' \code{module = import_package('package')} to import a package. Fully
#' qualified names are supported for nested modules, reminiscent of Python’s
#' module mechanism.
#'
#' @section S3 class support:
#'
... | #' An alternative module system for R
#'
#' Use \code{module = import('module')} to import a module for usage, or
#' \code{module = import_package('package')} to import a package. Fully
#' qualified names are supported for nested modules, reminiscent of Python’s
#' module mechanism.
#'
#' @section S3 class support:
#'
... | apache-2.0 | R |
ae246262443ce3a6fb59855ed31148770f374d39 | fix #60 and add test | mschubert/narray,mschubert/narray | construct.r | construct.r | # Array programming utility functions
# Some tools to handle R^n matrices and perform operations on them
import('../base/operators')
#' A wrapper around reshape2::acast using a more intuitive formula syntax
#'
#' @param formula A formula: value [+ value2 ..] ~ axis1 [+ axis2 + axis n ..]
#' @param data ... | # Array programming utility functions
# Some tools to handle R^n matrices and perform operations on them
import('../base/operators')
#' A wrapper around reshape2::acast using a more intuitive formula syntax
#'
#' @param formula A formula: value [+ value2 ..] ~ axis1 [+ axis2 + axis n ..]
#' @param data ... | apache-2.0 | R |
3968518782ec769ec81dfac5d5ca49fa475b503f | update github dependencies | 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('mungebitsTransformations', 'robertzk'),
list('mungebits', 'robertzk'),
list('tundra', 'robertzk'),
list('stagerunner', 'robertzk')
)
| mit | R |
1b31f718a6f72b23490888da2d5776a8871c29b7 | make test slightly more comprehensive for variable args | robertzk/mungebits | inst/tests/test-munge.r | inst/tests/test-munge.r | context("munge function")
test_that("it correctly does nothing if no mungepieces are passed", {
expect_equal(munge(iris), iris)
})
test_that("it correctly adds to the mungepieces list", {
args <- lapply(seq_len(2),
function(.) list(column_transformation(function(x) x), 1))
iris2 <- munge(iris, args)
expec... | context("munge function")
test_that("it correctly does nothing if no mungepieces are passed", {
expect_equal(munge(iris), iris)
})
test_that("it correctly adds to the mungepieces list", {
args <- lapply(seq_len(2),
function(.) list(column_transformation(function(x) x), 1))
iris2 <- munge(iris, args)
expec... | mit | R |
bfefaaf3725ab558aff7992089b7ad4d1cfd7e8f | fix mcpha/filters/fir_0.r | fbalakirev/red-pitaya-notes,fbalakirev/red-pitaya-notes,pavel-demin/red-pitaya-notes,pavel-demin/red-pitaya-notes,fbalakirev/red-pitaya-notes,pavel-demin/red-pitaya-notes,fbalakirev/red-pitaya-notes,pavel-demin/red-pitaya-notes,fbalakirev/red-pitaya-notes,pavel-demin/red-pitaya-notes,pavel-demin/red-pitaya-notes,fbalak... | projects/mcpha/filters/fir_0.r | projects/mcpha/filters/fir_0.r | library(signal)
a0 <- 0.35875
a1 <- 0.48829
a2 <- 0.14128
a3 <- 0.01168
x <- seq(0.0, 1.0, by = 1 / 40)
h <- a0 - a1 * cos(2 * pi * x) + a2 * cos(4 * pi * x) - a3 * cos(6 * pi * x)
h <- h / sum(h)
# Print filter coefficients
paste(sprintf("%.10e", h), collapse = ", ")
fh <- freqz(h)
op <- par(mfrow = c(1, 2))
plot... | library(signal)
a0 <- 0.35875
a1 <- 0.48829
a2 <- 0.14128
a3 <- 0.01168
x <- seq(0.0, 1.0, by=1/40)
h <- a0 - a1 * cos(2 * pi * x) + a2 * cos(4 * pi * x) - a3 * cos(6 * pi * x)
h <- B/sum(B)
# Print filter coefficients
paste(sprintf("%.10e", h), collapse=", ")
fh <- freqz(h)
op <- par(mfrow = c(1, 2))
plot(fh$f / ... | mit | R |
ef3aad3b30c71cc5b68e2e9263fce26d6aad5f23 | Update report template | hkaju/Ising2D,hkaju/Ising2D,hkaju/Ising2D | templates/report.template.r | templates/report.template.r | require(lattice)
pdf("report.pdf")
equi <- read.csv("data/equilibriation.csv", header=T)
plot(equi$x, equi$y, xlab="Spin flips", ylab="Energy", type="n")
lines(equi$x, equi$y)
%s
dev.off()
| require(lattice)
pdf("report.pdf")
equi <- read.csv("plots/equilibriation.csv", header=T)
plot(equi$x, equi$y, xlab="Spin flips", ylab="Energy", type="n")
lines(equi$x, equi$y)
%s
dev.off()
| mit | R |
68626cb9a83f775ba25b37d32308baf7276abefc | Modify Multiple linear regression R file | a-holm/MachinelearningAlgorithms,a-holm/MachinelearningAlgorithms | Regression/MultipleLinearRegression/regularMultipleRegression.r | Regression/MultipleLinearRegression/regularMultipleRegression.r | # Multiple linear regression for machine learning.
#
# A linear regression model that contains more than one predictor variable is
# called a multiple linear regression model. It is basically the same as Simple
# Linear regression, but with more predictor variables (features). The idea is
# that linearly related predi... | # Multiple linear regression for machine learning.
#
# A linear regression model that contains more than one predictor variable is
# called a multiple linear regression model. It is basically the same as Simple
# Linear regression, but with more predictor variables (features). The idea is
# that linearly related predi... | mit | R |
460598e91c5659174f9d55cc0f71eb4e8c74e5ee | Update mtcars.r | bgweber/RServer,bgweber/RServer,bgweber/RServer,bgweber/RServer | tasks/userDemo/mtcars.r | tasks/userDemo/mtcars.r | str(mtcars)
print("Sleeping for 15 seconds")
Sys.sleep(15)
print("Saving RData file")
dir.create("/var/www/html/RServer/reports/mtcars")
save(mtcars, file = "/var/www/html/RServer/reports/mtcars/mtcars.RData")
fit <- lm(mpg~am + wt + hp, data = mtcars)
summary(fit)
print("Saving Model")
Sys.sleep(10)
save(fit, ... | str(mtcars)
print("Sleeping for 15 seconds")
Sys.sleep(15)
print("Saving RData file")
dir.create("/var/www/html/RServer/reports/mtcars")
save(mtcars, file = "/var/www/html/RServer/reports/mtcars/mtcars.RData")
fit <- lm(mpg~am + wt + hp, data = mtcars)
summary(fit)
print("Saving Model")
Sys.sleep(10)
save(fit, ... | bsd-3-clause | R |
90f4eedf8db0c9008163f410ca13319803acc595 | adjust error in function parameters | david-beauchesne/Predict_network | Script/iEat_to_foodWeb.r | Script/iEat_to_foodWeb.r | iEat_to_foodWeb <- function(iEatResult) {
library(stringr)
foodWeb <- matrix(nrow = nrow(iEatResult), ncol = nrow(iEatResult), data = 0, dimnames = list(rownames(iEatResult), rownames(iEatResult)))
for(i in 1:nrow(iEatResult)) {
resources <- unique(c(unlist(str_split(iEatResult[i, 'target_catalogue... | iEat_to_foodWeb <- function(iEatResult) {
library(stringr)
foodWeb <- matrix(nrow = nrow(iEatResult), ncol = nrow(iEatResult), data = 0, dimnames = list(rownames(iEatResult), rownames(iEatResult)))
for(i in 1:nrow(iEatResult)) {
resources <- unique(c(unlist(str_split(x[i, 'target_catalogue'], ' \\|... | mit | R |
4379aa4ce58ff0a75129015d3e37140be2ec3d10 | Fix sourcing code | 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 |
1057a8c11ef5f80e33c930e9da0cf0b9d99a4a59 | add showtext and gapminder | berkeley-dsep-infra/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,berkeley-dsep-infra/datahub,ryanlovett/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 |
2fd68c2e648fa847720b86dea50395ba954a73cb | Remove ./.data & ./.stain after slurm job finishes | 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_dir, settings) {
private$settings <- settings
private$cat_main_file_mag... | #' SlurmBashScript R6 object.
#'
#' Generates the necessary bash script to submit through
#' the `sbatch` command.
SlurmBashScript <- R6::R6Class("SlurmBashScript",
public = list(
initialize = function(container_dir, settings) {
private$settings <- settings
private$cat_main_file_mag... | mit | R |
b7eb5ca20f19079416a13a1041d93f737824b2d4 | Update triggers.r | syberia/syberia | R/triggers.r | R/triggers.r | ## This file compiles all preprocessing triggers
# Wrap S3 class for type detection
trigger <- function(fn) {
class(fn) <- c('syberiaTrigger', 'trigger', class(fn))
fn
}
#' Record dataframe in a global variable for debugging
#' @export
record <- function(varname, envir = globalenv()) {
trigger(function(datafram... | ## This file compiles all preprocessing triggers
# Wrap S3 class for type detection
trigger <- function(fn) {
class(fn) <- c('syberiaTrigger', 'trigger', class(fn))
fn
}
#' Record dataframe in a global variable for debugging
#' @export
record <- function(varname, envir = globalenv()) {
trigger(function(datafram... | mit | R |
26ce5a64dc6070d866f09537c573c125ba2330b9 | Arrange pft data by patient, date, and test type. | pschulam-attic/sclero | inst/R/create-pft-data.r | inst/R/create-pft-data.r | options(stringsAsFactors = FALSE)
library(plyr)
library(reshape2)
source("inst/R/sclerodata-path.r")
pft.csv <- file.path(sclerodata.path, "tPFT.csv")
pft.rdata <- file.path("data", "pft.rdata")
pft.raw <- read.csv(pft.csv)
keep.columns <- c(
"PtID", "Date",
"Height", "Weight", "age",
"FVC.Pre", "perc.FV... | options(stringsAsFactors = FALSE)
library(plyr)
library(reshape2)
source("inst/R/sclerodata-path.r")
pft.csv <- file.path(sclerodata.path, "tPFT.csv")
pft.rdata <- file.path("data", "pft.rdata")
pft.raw <- read.csv(pft.csv)
keep.columns <- c(
"PtID", "Date",
"Height", "Weight", "age",
"FVC.Pre", "perc.FV... | mit | R |
037827735c610b24e500b22f4771b372e0673425 | allow copy parameter in export stage | syberia/syberia | R/export_stage.r | R/export_stage.r | #' Export stage for Syberia.
#'
#' Precise behavior depends on adapter.
#'
#' @param modelenv an environment. The current modeling environment.
#' @param export_options a list. The available export options. Will differ
#' depending on the adapter. (default is file adapter)
#' @export
export_stage <- function(modele... | #' Export stage for Syberia.
#'
#' Precise behavior depends on adapter.
#'
#' @param modelenv an environment. The current modeling environment.
#' @param export_options a list. The available export options. Will differ
#' depending on the adapter. (default is file adapter)
#' @export
export_stage <- function(modele... | mit | R |
b226effd52321ce6b41f3f3de75cda5d296d94b6 | Refactor delle tabelle di medie,var e dev | Arguggi/Relazione-Stat | R/relazione.r | R/relazione.r | # Leggo i dati del file .csv
dati_letti <- read.csv("../dati.csv", header=TRUE, sep=" ")
# Creo il data.frame
dati <- as.data.frame(dati_letti)
maturita <- function(colonne) {
return(round((colonne[,2]-0.4*colonne[,1])/0.6))
}
estraiColonne <- function(lista,colonne) {
return(lista[,colonne])
}
colVar <- functio... | # Leggo i dati del file .csv
dati_letti <- read.csv("../dati.csv", header=TRUE, sep=" ")
# Creo il data.frame
dati <- as.data.frame(dati_letti)
# Aggiungo la colonna del voto di maturita
maturita <- function(colonne) {
return(round((colonne[,2]-0.4*colonne[,1])/0.6))
}
dati$Voto <- maturita(dati[,6:7])
dati <- da... | mit | R |
3ea8cd251abdf691ace962d02ba6ce6da70db84d | add shared helpers | robertzk/syberiaStructure | R/traversal.r | R/traversal.r | # All functions related to traversal of file system for grabbing Syberia related files
#
# By convention, the structure from a syberia root project will look like this:
#
# - data # Data preparation for data sources coming from an external API
# - sources
# - data_source1
# - data_source1.r
# - h... | # All functions related to traversal of file system for grabbing Syberia related files
#
# By convention, the structure from a syberia root project will look like this:
# - data # Data preparation for data sources coming from an external API
# - sources
# - data_source1
# - data_source1.r
# - helpe... | mit | R |
a82844a1efeee78b9893fd263cc25435235ccd63 | fix read-binary-fixes.r heading check | amsa-code/risky,amsa-code/risky,amsa-code/risky,amsa-code/risky,amsa-code/risky | formats/src/test/resources/read-binary-fixes.r | formats/src/test/resources/read-binary-fixes.r | file = file("target/123456790.track","rb")
readSingle = function() readBin(file, single(), size=4, endian="big")
readInteger = function() readBin(file, integer(), size=4, endian="big")
readLong = function() {
a = readBin(file, integer(), size=4, endian="big")
b = readBin(file, integer(), size=4, endian="big")
if... | file = file("target/123456790.track","rb")
readSingle = function() readBin(file, single(), size=4, endian="big")
readInteger = function() readBin(file, integer(), size=4, endian="big")
readLong = function() {
a = readBin(file, integer(), size=4, endian="big")
b = readBin(file, integer(), size=4, endian="big")
if... | apache-2.0 | R |
293d3616cd8aee1eee32f411280e1de6d1d153db | update for machine learning site | tschmorleiz/amcat,tschmorleiz/amcat,tschmorleiz/amcat,amcat/amcat,amcat/amcat,amcat/amcat,amcat/amcat,amcat/amcat,tschmorleiz/amcat,amcat/amcat,tschmorleiz/amcat | ml/r/ml.r | ml/r/ml.r | source("/home/wva/libpy/ml/r/report.r")
nfromtest <- function() {
testdata = read.table("/tmp/table.txt")
nfoldreport(testdata, dowrite=F)
}
predictreport <- function(testdata, dowrite=T) {
report <- createReport()
testdata$confbin <- confbins(testdata$conf0)
report$byconf <- data.frame(n=tapply(testdata$co... | source("/home/wva/libpy/ml/r/report.r")
nfromtest <- function() {
testdata = read.table("/tmp/table.txt")
nfoldreport(testdata, dowrite=F)
}
nfoldreport <- function(testdata, dowrite=T) {
if (!is.numeric(testdata$conf0)) {read.table("/tmp/bla")}
report <- createReport()
d <- prepare(testdata)
print(head(d... | agpl-3.0 | R |
aafcda34aff7eb9c16fe85440f6bfdf472bbed38 | Add anticodon table from dos Reis | klmr/codons,klmr/codons | scripts/tai.r | scripts/tai.r | # Based on the paper by Dos Reis & al, 2004
s = list(naive = c(0, 0, 0, 0, 0.5, 0.5, 0.75, 0.5, 0.5, 0.5),
human = c(0, 0, 0, 0, 0.41, 0.28, 0.9999, 0.68, 0.89))
# Reverse complement of the anticodons, in the order of anticodons as given in
# Figure 1 of dos Reis & al.
rc_anticodons = c('TTT', 'TTC', 'TTA', ... | # Based on the paper by Dos Reis & al., 2004
ws = function () {
}
tai = function () {
}
| apache-2.0 | R |
57d6df4081089a6c9e3fd136b8711904058ee702 | load irlba | kaneplusplus/cnidaria | test-dmatrix.r | test-dmatrix.r | source("disk-part.r")
source("dmatrix.r")
# We'll use doSEQ as a parallel execution engine.
library(foreach)
registerDoSEQ()
# and disk parts for the data manager.
init_ddr_disk_part()
# Chunks for an irregular matrix.
l = list(matrix(rnorm(25), nrow=5, ncol=5),
matrix(rnorm(36), nrow=6, ncol=6),
m... | source("disk-part.r")
source("dmatrix.r")
# We'll use doSEQ as a parallel execution engine.
library(foreach)
registerDoSEQ()
# and disk parts for the data manager.
init_ddr_disk_part()
# Chunks for an irregular matrix.
l = list(matrix(rnorm(25), nrow=5, ncol=5),
matrix(rnorm(36), nrow=6, ncol=6),
m... | apache-2.0 | R |
32c4b351b9c16e3667aa00f5ae716b4f08b9295e | install options for building on armhf | OwnYourData/app-allergy,OwnYourData/app-allergy | init.r | 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:
my_packages = c('shiny',
'shinyBS',
'devtoo... | #
# 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('shiny',
'shinyBS',
'devtoo... | mit | R |
0254f4c346d4b83d41495b1ef463e6acf0fe4077 | Fix typo in README.rd . | aru132/google-drive-on-fuse | README.rd | README.rd | = Requirements
* FUSE (>= 2.6)
* libfuse
* json-c
* glib-2.0
* libmagic
* libcurl
= Installation
1. Clone from github.
$ git clone https://github.com/aru132/google-drive-on-fuse.git
2. Register this program with google developers console ( https://code.google.com/apis/console#access ) .
3. Download client_secret.json... | = Requirements
* FUSE (>= 2.6)
* libfuse
* json-c
* glib-2.0
* libmagic
* libcurl
= Installation
1. Clone from github.
$ git clone https://github.com/aru132/google-drive-on-fuse.git
2. Register this program with google developers console ( https://code.google.com/apis/console#access ) .
3. Download client_secret.json... | bsd-3-clause | R |
50528b70ce6d3a7443ad6dcba90c45c9b92dcaa0 | update reference to github | leeper/leeper.github.io | code/r/mergeNA.r | code/r/mergeNA.r | # FUNCTION TO MERGE TWO VARIABLES (e.g., TWO VERSIONS OF A SURVEY QUESTION)
# Copyright (C) 2011 Thomas J. Leeper
# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, o... | # FUNCTION TO MERGE TWO VARIABLES (e.g., TWO VERSIONS OF A SURVEY QUESTION)
# Copyright (C) 2011 Thomas J. Leeper
# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, o... | mit | R |
01c1d5da45b7b6c758c4698e1fa9bc018f8f6ca8 | Add area | 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",
col = "blue",
pch = 21,
bg = "navy",
main = "Googl... |
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",
col = "blue",
pch = 21,
bg = "navy",
main = "Googl... | unlicense | R |
fc53b4482ddfa7bbce2d580533a83f587c1cd18e | normalize count | shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl | lib/Visualization/plotCNV.r | lib/Visualization/plotCNV.r | library(ggplot2)
library(data.table)
args <- commandArgs(TRUE)
if(length(args) == 0){
setwd("/scratch/cqs/shengq2/macrae_linton/20190517_linton_exomeseq_3321_human/GATK4_CNV_Germline_11_AnnotationGenesPlot/result")
inputFile<-"linton_exomeseq_3321.position.txt"
outputPrefix<-'linton_exomeseq_3321.position'
siz... | library(ggplot2)
library(data.table)
args <- commandArgs(TRUE)
if(length(args) == 0){
setwd("/scratch/cqs/shengq2/macrae_linton/20190517_linton_exomeseq_3321_human/GATK4_CNV_Germline_9_CNVGenesPlot/result")
inputFile<-"linton_exomeseq_3321.position.CCL3L3.txt"
outputPrefix<-'linton_exomeseq_3321.position'
size... | apache-2.0 | R |
c9168718b3cb23438709d5d740f2bed6ad981e41 | Update 2016_report_config.r | PSC-CoTC/PSC-FRAM-Admin,PSC-CoTC/PSC-FRAM-Admin | config/2016_report_config.r | config/2016_report_config.r |
run.year <- 2016
post.season.fram.db <- "./fram db/Final pre and post databases/2018PFMC_NOF_ForPSC-Coho-Backwards-thru2016_compact.mdb"
post.season.run.name <- "bc-Coho1637 Final + BP27"
post.season.tamm <- "./fram db/TAMM_Files_Postseason/coho BK 2015 Final Feb 15th.xlsm"
pre.season.fram.db <- "./fram db/Fi... |
run.year <- 2016
post.season.fram.db <- "./fram db/Final pre and post databases/2018PFMC_NOF_ForPSC-Coho-Backwards-thru2016_compact.mdb"
post.season.run.name <- "bc-Coho1637 Final + BP27"
post.season.tamm <- "./fram db/TAMM_Files_Postseason/coho BK 2015 Final Feb 15th.xlsm"
pre.season.fram.db <- "./fram db/Fi... | mit | R |
53887ab5900d61752ab0e0857b1a8087636a674b | Update document. | snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3 | q3/docs/MessageViewMode.rd | q3/docs/MessageViewMode.rd | =begin
=bZ[W\[h
bZ[W[h̓bZ[W\Ƃɂǂ̂悤ɕ\邩\[hłBȉ̂悤ȃbZ[W[h܂BbZ[W[h̓tH_Ƃɕێ悤ɂł܂AׂẴtH_œbZ[W[hɐݒ肷邱Ƃł܂Bǂɂ邩́A((<̑̐ݒ|URL:OptionMisc.html>))[bZ[W\[htH_Ƃɕۑ]Ŏw肵܂B
:bZ[W[h
̃bZ[Wwb_܂߂ĕ\܂BAeLXgp[gɊւĂ̓fR[hŃeLXgƂĕ\܂B܂AׂẴwb_\wb_Ƃăp[X܂B\[X[hHTML\[hƔrłB((<[\]-[[h]-[ׂĕ\]|URL:ViewRawModeAction.html>))ŕύX܂B
:\[X[h
bZ[W̃\[X\܂BeLX... | =begin
=bZ[W\[h
bZ[W[h̓bZ[W\Ƃɂǂ̂悤ɕ\邩\[hłBȉ̂悤ȃbZ[W[h܂BbZ[W[h̓tH_Ƃɕێ悤ɂł܂AׂẴtH_œbZ[W[hɐݒ肷邱Ƃł܂Bǂɂ邩́A((<̑̐ݒ|URL:OptionMisc.html>))[bZ[W\[htH_Ƃɕۑ]Ŏw肵܂B
:bZ[W[h
̃bZ[Wwb_܂߂ĕ\܂BAeLXgp[gɊւĂ̓fR[hŃeLXgƂĕ\܂B\[X[hHTML\[hƔrłB((<[\]-[[h]-[ׂĕ\]|URL:ViewRawModeAction.html>))ŕύX܂B
:\[X[h
bZ[W̃\[X\܂BeLXgp[gȂǂfR[hɕ\܂BbZ[W[... | mit | R |
58b4e698d4c832228e4307a590db389a2394d8bf | add timeout and report parallel errors | mschubert/clustermq,mschubert/clustermq,mschubert/clustermq | tests/testthat/test-proxy.r | tests/testthat/test-proxy.r | context("proxy")
test_that("control flow between proxy and master", {
skip_on_os("windows")
recv = function(sock, timeout=3L) {
event = rzmq::poll.socket(list(sock), list("read"), timeout=timeout)
if (event[[1]]$read)
rzmq::receive.socket(sock)
else
warning(para... | context("proxy")
test_that("control flow between proxy and master", {
skip_on_os("windows")
# prerequesites
context = rzmq::init.context()
socket = rzmq::init.socket(context, "ZMQ_REP")
port = bind_avail(socket, 50000:55000)
Sys.sleep(0.5)
common_data = list(fun = function(x) x*2, const=li... | apache-2.0 | R |
b1cdced50f1debd9e432c57afa13ab850359fd40 | rename hooks to routes | robertzk/microserver,kirillseva/microserver,robertzk/microserver | R/microserver.r | R/microserver.r | #' Default http server configuration for libuv hook.
#'
#' @param routes list. A named list of routes, with a handler
#' function for each route. The first unnamed route will be used
#' as the root. In none is provided, just a 404 status will be returned.
#' @seealso \link{\code{parse_routes}}
#' @examples
#' \d... | #' Default http server configuration for libuv hook.
#'
#' @param routes list. A named list of routes, with a handler
#' function for each route. The first unnamed route will be used
#' as the root. In none is provided, just a 404 status will be returned.
#' @seealso \link{\code{parse_routes}}
#' @examples
#' \d... | mit | R |
cbf24fcd9c99330c6c96699fc2c29d2a958c32f0 | Correct package for hmm | ixaxaar/handyR | hmm.r | hmm.r |
require(depmixS4)
require(TTR)
sample.dat = dat[1:2000,]
sample.dat$value = EMA(sample.dat$value, n=5)
states = c("Blower", "Drier", "Unknown")
trans = matrix(c(
c(0.5, 0.49, 0.01),
c(0.49, 0.5, 0.01),
c(0.4, 0.4, 0.2)
), c(length(states), length(states)), byrow=TRUE)
model = depmix(value ~ 1, data=s... |
require(HMM)
require(TTR)
sample.dat = dat[1:2000,]
# sample.dat$value = EMA(sample.dat$value, n=5)
states = c("Blower", "Drier", "Unknown")
trans = matrix(c(
c(0.5, 0.49, 0.01),
c(0.49, 0.5, 0.01),
c(0.4, 0.4, 0.2)
), c(length(states), length(states)), byrow=TRUE)
model = depmix(value ~ 1, data=samp... | mit | R |
fd591e936105b53fb8a5e118998a5ae7b4fe88f4 | Test that import works in globalenv | klmr/modules,klmr/modules | tests/testthat/test-basic.r | tests/testthat/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')
on.exit(unload(a)) # To get rid of attached opera... | 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.
... | apache-2.0 | R |
e1551a4e0331acc65c1816001a9c45581059a829 | Mark missing test | klmr/modules,klmr/modules | tests/testthat/test-basic.r | tests/testthat/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('import works in global namespace', {
local({
a = import('a')
unload(a) # To get rid of attached operators.
... | apache-2.0 | R |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.