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
49c18fae0121facbe06d5ffa97f01c513d6b9537
Bump version
Pointillistic/rebol-lang,Pointillistic/rebol-lang,Pointillistic/rebol-lang,zsx/r3,zsx/r3,zsx/r3,Pointillistic/rebol-lang,zsx/r3
src/boot/version.r
src/boot/version.r
3.0.0.3.1
2.101.0.3.1
apache-2.0
R
875687a048710bd353b4b19fe973e8b62eb2742a
Improve `printenv` output
klmr/modules,klmr/modules
printenv.r
printenv.r
printenv = function (env = parent.frame()) { frame = 1 while (! identical(env, baseenv())) { name = environmentName(env) name_display = sprintf('<environment: %s>', name) default_display = capture.output(env)[1] cat(default_display) if (name_display != default_display) {...
printenv = function (env = parent.frame()) { while (! identical(env, baseenv())) { name = environmentName(env) name_display = sprintf('<environment: %s>', name) default_display = capture.output(env)[1] cat(default_display) if (name_display != default_display) cat...
apache-2.0
R
bf9311ba647cb5613dc0d5ba35c11ce7c23294e1
remove unecessary print
realityenhanced/AudioEventDetector
AudioEventDetector.r
AudioEventDetector.r
require(audio); # Logistic Regression for binary classification of Audio data # Positive Inputs are under the positive folder and Negative Inputs under the negative folder # Audio files need to be uncompressed wav files. # Sample rate of the training wav files could be anything and will be re-sampled to 16Khz, here. #...
require(audio); # Logistic Regression for binary classification of Audio data # Positive Inputs are under the positive folder and Negative Inputs under the negative folder # Audio files need to be uncompressed wav files. # Sample rate of the training wav files could be anything and will be re-sampled to 16Khz, here. #...
agpl-3.0
R
9e7fb6f95ccb329ff97a61cc49639a4491536161
Simplify the database name for inclusion in 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/Final pre and post databases/FramVS2-PSC-Coho-PostSeason.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/Final pre and post databases/FramVS2-PSC-Coho-PreSeason.mdb"...
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...
mit
R
b96138dcfac0a28a1a55d008da7adad7b2e7133f
add tigris try 2
berkeley-dsep-infra/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,ryanlovett/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") print("Installing fGarch...") devtools::install_github('cran/fGarch', ref='3042.83.1', upgrade_dependencies=FALSE, quiet=TRUE) print("Installing SASxport...") devtools::install_github('cran/S...
#!/usr/bin/env Rscript # From https://github.com/berkeley-dsep-infra/datahub/issues/881 print("Installing packages for PH142") print("Installing fGarch...") devtools::install_github('cran/fGarch', ref='3042.83.1', upgrade_dependencies=FALSE, quiet=TRUE) print("Installing SASxport...") devtools::install_github('cran/S...
bsd-3-clause
R
13ce69b538fcc551c4c66134bab163e777a9f4f6
Add SlurmContainer add_source & add_input methods
jmousseau/Stain
R/slurm-container.r
R/slurm-container.r
#' SlurmContainer R6 object. #' #' A slurm container is simply a directory with a specific #' structure, particulary it has a submit.slurm script at the #' top level. SlurmContainer <- R6::R6Class("SlurmContainer", public = list( dir = NULL, initialize = function(dir = ".") { name <- pas...
#' SlurmContainer R6 object. #' #' A slurm container is simply a directory with a specific #' structure, particulary it has a submit.slurm script at the #' top level. SlurmContainer <- R6::R6Class("SlurmContainer", public = list( dir = NULL, initialize = function(dir = ".") { name <- pas...
mit
R
53a4237d132645d5a32e1c899fb1c6b46adeca71
Update ggplot2_formatter.r
fdryan/R,1R151-1/R
ggplot2_formatter.r
ggplot2_formatter.r
require(plyr) require(scales) # --------------------------------------------------------------------------------------------- # Formatting functions for ggplot graph axis # --------------------------------------------------------------------------------------------- #' Human Numbers: Format numbers so they're legibl...
require(scales) # --------------------------------------------------------------------------------------------- # Formatting functions for ggplot graph axis # --------------------------------------------------------------------------------------------- #' Human Numbers: Format numbers so they're legible for humans ...
unlicense
R
3f27a58877aea4f693a05db5a4b96820c87c3e19
fix up package dependencies
syberia/syberia
R/syberia-package.r
R/syberia-package.r
#' Syberia provides an opinionated unified framework for #' fast iteration on classifier development and deployment. It is #' founded on convention over configuration and aims to solve the #' problems of classifier-specific data preparation and #' classifier-specific modeling parameters. #' #' @name syberia #' @docType...
#' Syberia provides an opinionated unified framework for #' fast iteration on classifier development and deployment. It is #' founded on convention over configuration and aims to solve the #' problems of classifier-specific data preparation and #' classifier-specific modeling parameters. #' #' @name syberia #' @docType...
mit
R
ffc7454d02c5639df9ba688fde1ac3da4f0cb565
Make it possible to specify in and out filenames
erlio/vmq_mqttbench
plot.r
plot.r
#!/usr/bin/env Rscript args = commandArgs(trailingOnly=TRUE) packages.to.install <- c("grid", "ggplot2") for (p in packages.to.install) { print(p) if (suppressWarnings(!require(p, character.only = TRUE))) { install.packages(p, repos = "http://lib.stat.cmu.edu/R/CRAN") library(p, character.only...
#!/usr/bin/env Rscript packages.to.install <- c("grid", "ggplot2") for (p in packages.to.install) { print(p) if (suppressWarnings(!require(p, character.only = TRUE))) { install.packages(p, repos = "http://lib.stat.cmu.edu/R/CRAN") library(p, character.only=TRUE) } } png(file = "plot.png",...
apache-2.0
R
3e1938ca728826873f2edf509537f5fec9c12bc6
Select industrial ralways and import places shapefile
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) # Download the data download.file("http://www.mapcruzin.com/download-shapefile/netherlands-places-shape.zip", method="wget", destfile="data/places.zip") download.file("http://www.mapcruzin....
# Team Rython, Dainius Masiliunas and Tim Weerman # Date: 11 January, 2016 # Apache License 2.0 # Needed packages library(rgdal) # Download the data download.file("http://www.mapcruzin.com/download-shapefile/netherlands-places-shape.zip", method="wget", destfile="data/places.zip") download.file("http://www.mapcruzin....
apache-2.0
R
1fa4c689bad624e00f6792249da8ae98655ddccc
Update tglob_sphere.r
alfcrisci/rBiometeo,alfcrisci/rBiometeo
R/tglob_sphere.r
R/tglob_sphere.r
#' Tglob_sphere #' #' Calculate the globe temperature having sphere diameter. The author of procedure is James C. Liljegren Decision and Information Sciences Division Argonne National Laboratory. #' #' #' @param numeric t Air temperature in Celsius degrees. #' @param numeric rh Air Relative humidity in percentage. #' ...
#' Tglob_sphere #' #' Calculate the globe temperature having sphere diameter. The author of procedure is James C. Liljegren Decision and Information Sciences Division Argonne National Laboratory. #' #' #' @param numeric t Air temperature in Celsius degrees. #' @param numeric rh Air Relative humidity in percentage. #' ...
mit
R
89ba458ac267a39d167313af8ed76cf78dab4990
fix msg
tttor/csipb-jamu-prj,tttor/csipb-jamu-prj,tttor/csipb-jamu-prj,tttor/csipb-jamu-prj,tttor/csipb-jamu-prj,tttor/csipb-jamu-prj,tttor/csipb-jamu-prj,tttor/csipb-jamu-prj,tttor/csipb-jamu-prj
feature/extract_fp.r
feature/extract_fp.r
# extract_fp.r main <- function() { args = commandArgs(trailingOnly=TRUE) if (length(args)!=3) { message('USAGE:') message('Rscript extract_fp.r [yamType] [from] [to]') return() } library('Rcpi') yamType <- args[1] from <- as.numeric(args[2]) to <- as.numeric(args[3]) ydir <-...
# extract_fp.r # mol = readMolFromSmi(smi, type = 'mol')[[1]] # fp = extractDrugKRComplete(mol) main <- function() { args = commandArgs(trailingOnly=TRUE) if (length(args)!=3) { message('USAGE:') message('Rscript extract_fp.r [yamType] [from] [to]') return() } library('Rcpi') yamType ...
mit
R
14f28ac0d9d4a9bbcc0aaeb7c4355b82d30ed331
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
24769e51f2fcd832d61266e1dd346b7bbf8375b9
Add documentation to module "sys"
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) #' Quit the program #' #' @param code numeric exit code (default: \code{0}) exit = function (code = 0)...
# 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
c438918533799c2f9b5228a9da97080c9d963701
update calcor.sh
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") calcor <- function(files = stop("'file' must be specified")) { pm <- read_pm10() dir_out <- "data/cor" dir.create(dir_out, showWarnings = F) nof <- length(files) i <- 1 for (f in files) { f...
# Saharan Dust Transport Research # 2016-05-04 Ismail SEZEN # sezenismail@gmail.com source("code/correlation.r") calcor <- function(files = stop("'file' must be specified")) { pm <- read_pm10() dir_out <- "data/cor" dir.create(dir_out, showWarnings = F) nof <- length(files) i <- 1 for (f in files) { f...
mit
R
ad33ceea4b050744b8e79de05ea53512b61e6e09
comment out un-needed observer
AndySouth/coverage
inst/shiny/coverage1/server.r
inst/shiny/coverage1/server.r
#coverage/inst/shiny/coverage1/server.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 <- rende...
#coverage/inst/shiny/coverage1/server.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 <- rende...
mit
R
83c7dba62ef659790436cdc5bbf48ba44d22b940
Update Main.r
bgweber/RServer,bgweber/RServer,bgweber/RServer,bgweber/RServer
tasks/HelloWorld/Main.r
tasks/HelloWorld/Main.r
print("Hello World!")
cat("Hello World!")
bsd-3-clause
R
40d75d1541fba868b94c8c378d7c27afc272a1ee
Use older version of kableExtra
berkeley-dsep-infra/datahub,ryanlovett/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub
deployments/r/image/extras.d/ph-290.r
deployments/r/image/extras.d/ph-290.r
#!/usr/bin/env Rscript # For https://github.com/berkeley-dsep-infra/datahub/issues/1921 print("Installing packages for PH 290W") source("/tmp/class-libs.R") class_name = "PH 290W" class_libs = c( "kableExtra", "1.1.0", "plotly", "4.9.2.1", "ggthemes", "4.2.0", "formattable", "0.2.0.1" ) class_libs_install_v...
#!/usr/bin/env Rscript # For https://github.com/berkeley-dsep-infra/datahub/issues/1921 print("Installing packages for PH 290W") source("/tmp/class-libs.R") class_name = "PH 290W" class_libs = c( "plotly", "4.9.2.1", "kableExtra", "1.3.1", "ggthemes", "4.2.0", "formattable", "0.2.0.1" ) class_libs_install_v...
bsd-3-clause
R
589d01141e3c36c61e7a1d6db84a09ee2eb1ebb8
Update uvoz_tabele5.r
ZavbiA/APPR-2017
uvoz/uvoz_tabele5.r
uvoz/uvoz_tabele5.r
library(rvest) library(gsubfn) library(readr) library(dplyr) library(tibble) library(reshape2) library(gsubfn) library(tidyr) tabela5.tidy <- read_csv("podatki/stroski.csv", locale = locale(encoding = "UTF-8")) names(tabela5.tidy) <- c("mesto","leto","drzava","tip","st_dogodkov","st...
library(rvest) library(gsubfn) library(readr) library(dplyr) library(tibble) library(reshape2) library(gsubfn) library(tidyr) tabela5.tidy <- read_csv("podatki/stroski.csv", locale = locale(encoding = "UTF-8")) names(tabela5.tidy) <- c("mesto","leto","drzava","tip","st_dogodkov","st...
mit
R
5cb0ee1a00739be276c6e331c68cc4b20024c95f
Make CLOSURE a FUNCT for closures (#2002)
zsx/r3,zsx/r3,Pointillistic/rebol-lang,Pointillistic/rebol-lang,zsx/r3,Pointillistic/rebol-lang,zsx/r3,Pointillistic/rebol-lang
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
7c1a0790ef3b7911e5c739989bab2fb208588d4f
Fix the dates again
IndyActuaries/epic-fhir,IndyActuaries/epic-fhir
r/load_data.r
r/load_data.r
#' ## Code Owners: Kyle Baird, Shea Parkes #' #' ### Objective: #' * Load the data for analytics into native R data structures so it is easy to work with #' #' ### Developer Notes: #' * <none> require(ifultools) path.dir.source <- '../data/' #' ## LIBRARIES, LOCATIONS, LITERALS, ETC. GO ABOVE HERE df.labs <- r...
#' ## Code Owners: Kyle Baird, Shea Parkes #' #' ### Objective: #' * Load the data for analytics into native R data structures so it is easy to work with #' #' ### Developer Notes: #' * <none> require(ifultools) path.dir.source <- '../data/' #' ## LIBRARIES, LOCATIONS, LITERALS, ETC. GO ABOVE HERE df.labs <- r...
mit
R
a9e324a4578d6fc5da4473f8e4ceb12dabde6d0c
Update uvoz.r
rozmanU14/APPR-2015-16,rozmanU14/APPR-2015-16
uvoz/uvoz.r
uvoz/uvoz.r
#Vektor, ki predstavlja imena stolpcev: nova.kolona<-c("kraj", "leto","živorojeni moški","živorojene ženske","umrli moški","umrle ženske","naravni prirast moški","naravni prirast ženske") ^#Funkcija, ki uvozi podatke iz datoteke podatki.csv uvozi<-function(){ return(read.csv2(file="podatki/prirastek.csv", ...
# 2. faza: Uvoz podatkov # Funkcija, ki uvozi podatke iz datoteke druzine.csv uvozi.druzine <- function() { return(read.table("podatki/druzine.csv", sep = ";", as.is = TRUE, row.names = 1, col.names = c("obcina", "en", "dva", "tri", "stiri"), fileEnco...
mit
R
26bb547d76de8267c8be3b2a5ee26b3240b3192f
Remove unnecessary function
klmr/codons,klmr/codons
scripts/translation-efficiency-test-sets.r
scripts/translation-efficiency-test-sets.r
define_relations = function (config) { all_celltypes = unique(data$mrna_design(config)$Celltype) healthy_celltypes = intersect(all_celltypes, c('Liver-Adult', 'E15.5')) cancer_celltypes = setdiff(all_celltypes, healthy_celltypes) all_relations = expand.grid(Codon = unique(all_celltypes), ...
define_relations = function (config) { all_celltypes = unique(data$mrna_design(config)$Celltype) healthy_celltypes = intersect(all_celltypes, c('Liver-Adult', 'E15.5')) cancer_celltypes = setdiff(all_celltypes, healthy_celltypes) all_relations = expand.grid(Codon = unique(all_celltypes), ...
apache-2.0
R
5d69482a412b5cd1a35543f9a2d56dd7f487aace
rename local variable
robertzk/microserver,robertzk/microserver,kirillseva/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. If none is provided, just a 404 status will be returned. #' @examples #' \dontrun{ #' http_server(list('/ping' =...
#' 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. If none is provided, just a 404 status will be returned. #' @examples #' \dontrun{ #' http_server(list('/ping' =...
mit
R
eaec1f1a94190d27d10af936025c9603bcc034e7
Update h2o.glmgrid.r
h2oai/h2o-2,100star/h2o,calvingit21/h2o-2,h2oai/h2o,eg-zhang/h2o-2,h2oai/h2o-2,100star/h2o,h2oai/h2o-2,rowhit/h2o-2,elkingtonmcb/h2o-2,elkingtonmcb/h2o-2,vbelakov/h2o,100star/h2o,rowhit/h2o-2,vbelakov/h2o,rowhit/h2o-2,vbelakov/h2o,elkingtonmcb/h2o-2,rowhit/h2o-2,rowhit/h2o-2,elkingtonmcb/h2o-2,111t8e/h2o-2,eg-zhang/h2o...
R/h2o-package/demo/h2o.glmgrid.r
R/h2o-package/demo/h2o.glmgrid.r
library(h2o) localH2O = new("H2OClient", ip = "localhost", port = 54321) h2o.checkClient(localH2O) prostate.hex = h2o.importFile(localH2O, path = system.file("extdata", "prostate.csv", package="h2o"), key = "prostate.hex") alpha = c(0.25,0.5,0.75) lambda = c(1,10) for(i in 1:length(lambda)){ for(j in 1:length(al...
source("H2O_Load.R") localH2O = new("H2OClient", ip = "localhost", port = 54321) h2o.checkClient(localH2O) prostate.hex = h2o.importURL(localH2O, path = "https://raw.github.com/0xdata/h2o/master/smalldata/logreg/prostate.csv", key = "prostate.hex") alpha = c(0.25,0.5,0.75) lambda = c(1,10) for(i in 1:length(lambda))...
apache-2.0
R
fcd23aa8ef53a18974a4fedb984b5836dae7cc72
Update rlibrary_dependency.r
oltkkol/vmod
rlibrary_dependency.r
rlibrary_dependency.r
rlibrary <- function(libraryName, fInstall = NULL){ prequire <- function() return(require(libraryName, character.only=T)) if (prequire() == F){ if (is.function(fInstall)){ fInstall() }else{ install.packages(libraryName) } library(libraryName, character.only=T) } } stop_quietly <- function() { opt <...
rlibrary <- function(libraryName, fInstall = NULL){ prequire <- function() return(require(libraryName, character.only=T)) if (prequire() == F){ if (is.function(fInstall)){ fInstall() }else{ install.packages(libraryName) } library(libraryName, character.only=T) } } stop_quietly <- function() { opt <...
mit
R
5689a32c8a056f8a92c9d2a33752982207060b18
use the right is.null
robertzk/s3mpi
R/s3read.r
R/s3read.r
#' Read an R object in S3 by key #' #' Any type of object that can be serialized as an RDS file #' is capable of being stored using this interface. #' #' @param name character. The key to grab from S3. #' @param .path. The location of your S3 bucket. #' @param cache logical. If true, use the local s3cache if available...
#' Read an R object in S3 by key #' #' Any type of object that can be serialized as an RDS file #' is capable of being stored using this interface. #' #' @param name character. The key to grab from S3. #' @param .path. The location of your S3 bucket. #' @param cache logical. If true, use the local s3cache if available...
mit
R
a7f40b75c42f925d983e44c5073ea256e64e7335
Update zzz.r
syberia/syberia
R/zzz.r
R/zzz.r
.onAttach <- function(...) { load_github_packages(.github_packages) if (exists('run', envir = .GlobalEnv, inherits = FALSE)) rm('run', envir = .GlobalEnv) makeActiveBinding('run', function() build_model, .GlobalEnv) }
.onAttach <- function(...) { #load_github_packages(.github_packages) if (exists('run', envir = .GlobalEnv, inherits = FALSE)) rm('run', envir = .GlobalEnv) makeActiveBinding('run', function() build_model, .GlobalEnv) }
mit
R
d521050d086825ecc20303c0c6a1c93f6e2a4c7d
make mungebitsTransformations required
syberia/tundra,robertzk/tundra
R/zzz.r
R/zzz.r
.onAttach <- function(...) { require(mungebits) require(mungebitsTransformations) require(stagerunner) }
.onAttach <- function(...) { require(mungebits) require(stagerunner) }
mit
R
ffc45b4a5f91378636b634a74ec1bdbcb14fae20
remove this dpue
syberia/syberia
R/syberia-package.r
R/syberia-package.r
#' Syberia provides an opinionated unified framework for #' fast iteration on classifier development and deployment. It is #' founded on convention over configuration and aims to solve the #' problems of classifier-specific data preparation and #' classifier-specific modeling parameters. #' #' @name syberia #' @docType...
#' Syberia provides an opinionated unified framework for #' fast iteration on classifier development and deployment. It is #' founded on convention over configuration and aims to solve the #' problems of classifier-specific data preparation and #' classifier-specific modeling parameters. #' #' @name syberia #' @docType...
mit
R
c26deacba807e0a137df15c5e60b8ceb62310072
Update analiza.r
Anchiqua/APPR-2015-16
analiza/analiza.r
analiza/analiza.r
# 4. faza: Analiza podatkov tabela4 <- inner_join(tabela3, tabela2) tabela4 <- tabela4[c( "stevilo" ,"tocke")] tabela4.norm <- scale(tabela4) k <- kmeans(tabela4.norm, 5) #head(k$cluster, n = 15, nstart=1000) table(k$cluster) k <- kmeans(tabela4.norm, 5, nstart = 10000) tabela4.skupine <- data.frame(Drzava = name...
# 4. faza: Analiza podatkov barve <- rainbow(length(levels(obcine[[7]]))) names(barve) <- levels(obcine[[7]])
mit
R
13c58ae9f2b0c8917a4b4b5a39b7ad9c354bf78b
Split script up into multiple functions
mattm/active-user-cohort-analysis
active-users.r
active-users.r
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...
CSV_PATH = "data/test-data.csv" CSV_SEPARATOR = "\t" # TODO: Figure out how to prevent ggplot from rendering a thin line for # cohorts that have zero active users in a month PlotActiveUserCohorts <- function(data) { # Convert the sign up month cohorts ("2015-01", etc) to # dates so they can be used in in the ggplot...
mit
R
590a988ba1a89fe30067221ef782c45a46920c03
Add pthread dependency to TCC extension
giuliolunati/ren-c,giuliolunati/ren-c,hostilefork/rebol,hostilefork/rebol,giuliolunati/ren-c,hostilefork/rebol,hostilefork/rebol,hostilefork/rebol,hostilefork/rebol,giuliolunati/ren-c,giuliolunati/ren-c
extensions/tcc/make-spec.r
extensions/tcc/make-spec.r
REBOL [ Title: {TCC Extension Rebmake Compiling/Linking Information} ] name: 'TCC source: %tcc/mod-tcc.c includes: [ %prep/extensions/tcc ] ; If they installed libtcc with `sudo apt-get libtcc-dev`, then the switches ; for `-ltcc` and `#include "libtcc.h" should just work. Otherwise, they ; have to do `ex...
REBOL [ Title: {TCC Extension Rebmake Compiling/Linking Information} ] name: 'TCC source: %tcc/mod-tcc.c includes: [ %prep/extensions/tcc ] ; If they installed libtcc with `sudo apt-get libtcc-dev`, then the switches ; for `-ltcc` and `#include "libtcc.h" should just work. Otherwise, they ; have to do `ex...
apache-2.0
R
7ea7602ea6f3b17aa0dbe75f8d1052d7b3c0c4f1
Update uvoz.r
aleksandrov2/APPR-2015-16
uvoz/uvoz.r
uvoz/uvoz.r
# 2. faza: Uvoz require(dplyr) require(rvest) require(xml2) #require(ggplot) #link do uradne strani OECD kjer sem dobil podatke link <- "https://data.oecd.org/gga/general-government-debt.htm" podstran <- html_session(link) %>% read_html() podstran #ustvarim tabeli podatki1 <- read.csv("podatki/government_debt.csv"...
# 2. faza: Uvoz require(dplyr) require(rvest) require(xml2) #require(ggplot) #link do uradne strani OECD kjer sem dobil podatke link <- "https://data.oecd.org/gga/general-government-debt.htm" podstran <- html_session(link) %>% read_html() podstran #ustvarim tabeli podatki1 <- read.csv("podatki/government_debt.csv"...
mit
R
03da69b8772289d7f759094102b8df23827d72d0
Update implementation of topicmodel scripts
HIIT/digivaalit-2015,HIIT/digivaalit-2015,HIIT/digivaalit-2015
topics/topics.r
topics/topics.r
create_dtm <- function( path ) { library(topicmodels) library(tm) a <- Corpus( DirSource( path ) ) a <- tm_map(a, removeNumbers) a <- tm_map(a , stripWhitespace) a <- tm_map(a, removePunctuation) a <- tm_map(a, content_transformer(tolower) ) stopwords("finnish") a <- tm_map(a, removeWords, stopword...
create_dtm <- function( path ) { library(topicmodels) library(tm) a <- Corpus( DirSource( path ) ) a <- tm_map(a, removeNumbers) a <- tm_map(a , stripWhitespace) a <- tm_map(a, removePunctuation) a <- tm_map(a, content_transformer(tolower) ) stopwords("finnish") a <- tm_map(a, removeWords, stopword...
mit
R
05c5d9fce2b51d609b7103b2407343c4a247a96c
Add infrastructure for module file path retrival
klmr/modules,klmr/modules
R/module_cache.r
R/module_cache.r
#' Environment of loaded modules #' #' Each module is stored as an environment inside \code{.loaded_modules} with #' the module’s code location path as its identifier. The path rather than the #' module name is used because module names are not unique: two modules called #' \code{a} can exist nested inside modules \cod...
#' Environment of loaded modules #' #' Each module is stored as an environment inside \code{.loaded_modules} with #' the module’s code location path as its identifier. The path rather than the #' module name is used because module names are not unique: two modules called #' \code{a} can exist nested inside modules \cod...
apache-2.0
R
1736a8c2fe61d71e41410abbe1a0d60f852ba2e8
Add doc comments to test module for debugging
klmr/modules,klmr/modules
inst/tests/modules/a.r
inst/tests/modules/a.r
#' Double a number #' #' Add a number to itself by the cunning use of arithmetic. #' #' @param x a number #' @return \code{x * 2} double = function (x) x * 2 .modname = module_name() #' Counter for testing counter = 1 #' The module’s name get_modname = function () .modname #' The module’s name, via a function get_m...
double = function (x) x * 2 .modname = module_name() counter = 1 get_modname = function () .modname get_modname2 = function () module_name() get_counter = function () counter inc = function () counter <<- counter + 1 `%or%` = function (a, b) if (length(a) > 0) a else b `+.string` = function (a, b) p...
apache-2.0
R
45dc39b1e79cd44c82fa33fe6192ea8e4ac8bb29
comment out the new packages for now
astroidex/OSGeoLive,guygriffiths/OSGeoLive,kalxas/OSGeoLive,OSGeo/OSGeoLive,astroidex/OSGeoLive,astroidex/OSGeoLive,astroidex/OSGeoLive,PascalLike/OSGeoLive,PascalLike/OSGeoLive,kalxas/OSGeoLive,OSGeo/OSGeoLive,astroidex/OSGeoLive,guygriffiths/OSGeoLive,OSGeo/OSGeoLive,guygriffiths/OSGeoLive,OSGeo/OSGeoLive,kalxas/OSGe...
bin/installRpackages.r
bin/installRpackages.r
packagelist <- c("boot","class","classInt","DCluster","digest","epitools","gpclib","graph","gstat","maptools","Matrix","pgirmess","pkgDepTools","R2WinBUGS","RandomFields","RBGL","RColorBrewer","rgdal","Rgraphviz","sp","spam","spatialkernel","spatstat","spdep","spgrass6","spgwr","splancs","tripack","xtable") #packagelis...
packagelist <- c("ade4","adehabitat","ads","akima","ash","aspace","automap","clustTool","diseasemapping","ecespa","fields","GEOmap","geomapdata","geonames","geoR","geoRglm","GeoXp","glmmBUGS","gmaps","gmt","grasp","hdeco","mapdata","mapproj","MBA","ModelMap","ncdf","ncf","pastecs","PBSmapping","PBSmodelling","ramps","R...
lgpl-2.1
R
f2e7afa31e9d570f8057c22940fe1e446e0f4d8f
Remove unused SlurmOptions method
jmousseau/Stain
R/slurm-settings.r
R/slurm-settings.r
#' SlurmOptions R6 object. #' #' An interface to SBATCH settings. SlurmOptions <- R6::R6Class("SlurmOptions", public = list( options = c(sbatch_opts$nodes(1), sbatch_opts$memory("8g"), sbatch_opts$cpus_per_task(1), sbatch_opts$time("00:30:00")), ...
#' SlurmOptions R6 object. #' #' An interface to SBATCH settings. SlurmOptions <- R6::R6Class("SlurmOptions", public = list( options = c(sbatch_opts$nodes(1), sbatch_opts$memory("8g"), sbatch_opts$cpus_per_task(1), sbatch_opts$time("00:30:00")), ...
mit
R
e88f8b3593b05e1272b011cd775e3d3663a4b7d9
Update a document about ToolSubAccountAction.
snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3
q3/docs/ToolSubAccountAction.rd
q3/docs/ToolSubAccountAction.rd
=begin =ToolSubAccountANV Ŏw肳ꂽO((<TuAJEg|URL:SubAccount.html>))‘SẴAJEǧ݂̃TuAJEgAw肳ꂽTuAJEgɐ؂ւ܂Bw肳ꂽÕTuAJEgȂAJEgɂ͉e^܂B󕶎񂪎w肳ƃftHg̃TuAJEgɐ؂ւ܂B == :1 TuAJEgB ==LȃEBhEEr[ *CEBhE *bZ[WEBhE =end
=begin =ToolSubAccountANV Ŏw肳ꂽO((<TuAJEg|URL:SubAccount.html>))‘SẴAJEǧ݂̃TuAJEgAw肳ꂽTuAJEgɐ؂ւ܂Bw肳ꂽÕTuAJEgȂAJEgɂ͉e^܂B󕶎񂪎w肳ƃftHg̃TuAJEgɐ؂ւ܂B == :1 TuAJEgB ==LȃEBhEEr[ *CEBhE =end
mit
R
216e63e5c45f50a668d3ac82714d5681c180253d
combine tests for proxy
mschubert/clustermq,mschubert/clustermq,mschubert/clustermq
tests/testthat/test-ssh_proxy.r
tests/testthat/test-ssh_proxy.r
context("ssh_proxy") context = rzmq::init.context() socket = rzmq::init.socket(context, "ZMQ_REP") port = bind_avail(socket, 50000:55000) Sys.sleep(0.5) if (Sys.info()[['sysname']] == "Windows") skip("Forking not available on Windows") p = parallel::mcparallel(ssh_proxy(port)) common_data = list(fun = function(x)...
context("ssh_proxy") context = rzmq::init.context() socket = rzmq::init.socket(context, "ZMQ_REP") port = bind_avail(socket, 50000:55000) Sys.sleep(0.5) if (Sys.info()[['sysname']] == "Windows") skip("Forking not available on Windows") p = parallel::mcparallel(ssh_proxy(port)) test_that("startup", { msg = rzm...
apache-2.0
R
1ced72cab8c4b83cf606788badccae5061c62f74
Simplify expression
klmr/codons,klmr/codons
scripts/translation-efficiency-test-sets.r
scripts/translation-efficiency-test-sets.r
define_contrasts = function (config) { all_celltypes = unique(data$mrna_design(config)$Celltype) healthy_celltypes = intersect(all_celltypes, c('Liver-Adult', 'E15.5')) cancer_celltypes = setdiff(all_celltypes, healthy_celltypes) all_contrasts = expand.grid(Codon = unique(all_celltypes), ...
define_contrasts = function (config) { all_celltypes = unique(data$mrna_design(config)$Celltype) healthy_celltypes = intersect(all_celltypes, c('Liver-Adult', 'E15.5')) cancer_celltypes = setdiff(all_celltypes, healthy_celltypes) all_contrasts = expand.grid(Codon = unique(all_celltypes), ...
apache-2.0
R
188393b6734ec71c99774475bd41c76387ede81a
change test.r
kazutan/git_test
R/test.r
R/test.r
library(ggplot2) ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) + geom_point() + theme_bw() ggplot(iris, aes(x = Petal.Width, y = Petal.Length)) + geom_point() + theme_bw()
library(ggplot2) ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) + geom_point() + theme_bw()
mit
R
061be5fa57ce3da15618183adaf9b341e8548740
Update UTCI.r
alfcrisci/rBiometeo,alfcrisci/rBiometeo
R/UTCI.r
R/UTCI.r
#' UTCI #' #' Calculate Universal Thermal Climate Index ( UTCI) index. #' #' @param numeric t Air temperature in Celsius degrees. #' @param numeric rh Air Relative humidity in percentage. #' @param numeric wind Wind speed in meter per second. #' @param numeric tr Mean radiant temperature in Celsius degrees #' @return U...
#' UTCI #' #' Calculate Universal Thermal Climate Index ( UTCI) index. #' #' @param numeric t Air temperature in Celsius degrees. #' @param numeric rh Air Relative humidity in percentage. #' @param numeric wind Wind speed in meter per second. #' @param numeric tr Mean radiant temperature in Celsius degrees #' @return U...
mit
R
e5a44ca648bd936da3e76cf30be665e06df872ab
access objs in correct env
mschubert/narray,mschubert/narray
R/melt.r
R/melt.r
#' Function to melt data.frame from one or multiple arrays #' #' @param ... Array[s] or data.frame[s] to be melted #' @param dimnames List of names along the dimensions #' @param na_rm Remove rows with NAs #' @return data.frame with 'value' (or object names if multiple) indexed by axes #' @export melt = fu...
#' Function to melt data.frame from one or multiple arrays #' #' @param ... Array[s] or data.frame[s] to be melted #' @param dimnames List of names along the dimensions #' @param na_rm Remove rows with NAs #' @return data.frame with 'value' (or object names if multiple) indexed by axes #' @export melt = fu...
apache-2.0
R
b3c8a2b4c1da7ed8d3df2d75139da7de6f3f6304
Add default to limit.window
amcat/amcat,amcat/amcat,amcat/amcat,amcat/amcat,amcat/amcat,amcat/amcat
amcat/scripts/query/r_plugins/wordcloud.r
amcat/scripts/query/r_plugins/wordcloud.r
.STOP = c("english", "SMART", "danish", "french", "greek", "hungarian", "norwegian", "russian", "swedish", "catalan", "dutch", "finnish", "german", "italian", "portuguese", "spanish", "arabic") formfields = djangoFormFields(max.words = IntegerField(initial=50, required=T), remove.stopword...
.STOP = c("english", "SMART", "danish", "french", "greek", "hungarian", "norwegian", "russian", "swedish", "catalan", "dutch", "finnish", "german", "italian", "portuguese", "spanish", "arabic") formfields = djangoFormFields(max.words = IntegerField(initial=50, required=T), remove.stopword...
agpl-3.0
R
dfe17f69014680a4bfd337b487bd9c7ec0a851d9
add shinydashboard package
felipenoris/AWSFinance,felipenoris/math-server-docker,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", "dplyr", "dyn", "dynlm", "extrafont", "feather", "fAsianOptions", "fAssets", "fBasics", "fBonds", "fCopulae", "fExoticOptions", "fExtremes", "fGarch", "fImport", "fMultivar", "f...
pkgs <- c( "alabama", "base64enc", "caret", "cubature", "data.table", "DEoptim", "devtools", "doParallel", "doSNOW", "dplyr", "dyn", "dynlm", "extrafont", "feather", "fAsianOptions", "fAssets", "fBasics", "fBonds", "fCopulae", "fExoticOptions", "fExtremes", "fGarch", "fImport", "fMultivar", "f...
mit
R
9439d8abbd6343dd7fcf63159e7849224e010fee
revert zmq class util
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
83302ccf10ffa43ebdf7d562f32f9b1a23194cb4
Add linear regression family of models
ixaxaar/handyR
models.r
models.r
# Naive Bayes library(e1071) model = m.nb = naiveBayes(form, ds[train, vars]) cl.nb = predict(model, ds[test, vars], type="class") pr.nb = predict(model, ds[test, vars], type="raw")[,2] # Decision tree library(rpart) model = m.rp = rpart(form, ds[train, vars]) cl.rp = predict(model, ds[test, vars], type="class") pr.r...
# Naive Bayes library(e1071) model <- m.nb <- naiveBayes(form, ds[train, vars]) cl.nb <- predict(model, ds[test, vars], type="class") pr.nb <- predict(model, ds[test, vars], type="raw")[,2] # Decision tree library(rpart) model <- m.rp <- rpart(form, ds[train, vars]) cl.rp <- predict(model, ds[test, vars], type="class...
mit
R
c4f65a4fd931f2aa9059da05e27508c478997bb4
comment out test in byte-test.r until version 2
rheber/red,rheber/red,vehar/red,iArnold/red,vehar/red,NikolayShubenkovProgSchool/red,red-eco/red,NikolayShubenkovProgSchool/red,iArnold/red,red-eco/red
red-system/tests/source/compiler/byte-test.r
red-system/tests/source/compiler/byte-test.r
REBOL [ Title: "Red/System cast test script" Author: "Nenad Rakocevic & Peter W A Wood" File: %byte-test.r Tabs: 4 Rights: "Copyright (C) 2011-2012 Nenad Rakocevic & Peter W A Wood. All rights reserved." License: "BSD-3 - https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt" ] change-dir %../ ~...
REBOL [ Title: "Red/System cast test script" Author: "Nenad Rakocevic & Peter W A Wood" File: %byte-test.r Tabs: 4 Rights: "Copyright (C) 2011-2012 Nenad Rakocevic & Peter W A Wood. All rights reserved." License: "BSD-3 - https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt" ] change-dir %../ ~...
bsd-3-clause
R
0398ff8badd797fd9048ab9bc75fc63d4bdf18ff
use test_check()
khufkens/daymetr
tests/run_tests.r
tests/run_tests.r
# Run all unit tests # This is a wrapper around all the tests specified # in the tests/testthat directory. These tests are visible # to users and serve as small examples as well. testthat::test_check("daymetr")
# Run all unit tests # This is a wrapper around all the tests specified # in the inst/tests directory. These tests are visible # to users and serve as small examples as well. testthat::test_package("daymetr")
agpl-3.0
R
f3073d29c9793fb4def1da102bbcc12fb3bb5b23
fix literacy
exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib,exmo-dev/exmo_api_lib
r/exmo.r
r/exmo.r
library(httr) library(jsonlite) library(nanotime) library(digest) api_url <- "https://api.exmo.com/v1/" api_key <- "K-..." api_secret <- "S-..." api_query <- function(method, key, secret, params = list()){ nonce <- (as.numeric(as.POSIXct(Sys.time()))*10000000)%/%1 params <- c(params, nonce = nonce) data <- p...
library(httr) library(jsonlite) library(nanotime) library(digest) api_url <- "https://api.exmo.com/v1/" api_key <- "K-..." api_secret <- "S-..." api_query <- function(method, key, secret, params = list()){ nonce <- (as.numeric(as.POSIXct(Sys.time()))*10000000)%/%1 params <- c(params, nonce = nonce) data <- p...
mit
R
63015d00f4da38e688ee562b5b02050388339572
Make UI more dynamic.
IndyActuaries/epic-fhir,IndyActuaries/epic-fhir
server.r
server.r
#' ### CODE OWNERS: Shea Parkes #' #' ### OBJECTIVE: #' * Server side code of Epic FHIR Shiny App. #' #' ### DEVELOPER NOTES: #' * None require(shiny) require(dplyr) require(magrittr) source('r/load_data.r', chdir=TRUE) #' ### LIBRARIES, LOCATIONS, LITERALS, ETC. GO ABOVE HERE freq.name <- df.results %>% grou...
#' ### CODE OWNERS: Shea Parkes #' #' ### OBJECTIVE: #' * Server side code of Epic FHIR Shiny App. #' #' ### DEVELOPER NOTES: #' * None require(shiny) source('r/load_data.r', chdir=TRUE) #' ### LIBRARIES, LOCATIONS, LITERALS, ETC. GO ABOVE HERE shinyServer(function(input, output) { output$ui_name <- rende...
mit
R
adc64a647f117b343ce3716abf0d7b5f6fa05a3c
Update global.r
FrissAnalytics/FrissShinyDashboardTemplate,FrissAnalytics/FrissShinyDashboardTemplate
global.r
global.r
rm(list = ls()) library(shiny) library(shinydashboard) # see also https://almsaeedstudio.com/preview # http://stackoverflow.com/questions/31711307/how-to-change-color-in-shiny-dashboard # Friss dashboard header FrissHeader <- function(){tags$head( tags$link(rel = "stylesheet", type = "text/css", href = "app.css"),...
rm(list = ls()) library(shiny) library(shinydashboard) # see also https://almsaeedstudio.com/preview # http://stackoverflow.com/questions/31711307/how-to-change-color-in-shiny-dashboard # Friss dashboard header FrissHeader <- function(){tags$head( tags$link(rel = "stylesheet", type = "text/css", href = "app.css"),...
mit
R
259fd834f28904fc9aaa4d6a8aef5b045283a9ad
Add transparent 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", pch = 21, bg = "navy", col = "navy", main = "Google Ana...
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
bc53daad4191cea49be2ef4fed161babcb37f2b1
Rename “contrast” to “relation”
klmr/codons,klmr/codons
scripts/translation-efficiency-test-sets.r
scripts/translation-efficiency-test-sets.r
define_relations = function (config) { all_celltypes = unique(data$mrna_design(config)$Celltype) healthy_celltypes = intersect(all_celltypes, c('Liver-Adult', 'E15.5')) cancer_celltypes = setdiff(all_celltypes, healthy_celltypes) all_relations = expand.grid(Codon = unique(all_celltypes), ...
define_contrasts = function (config) { all_celltypes = unique(data$mrna_design(config)$Celltype) healthy_celltypes = intersect(all_celltypes, c('Liver-Adult', 'E15.5')) cancer_celltypes = setdiff(all_celltypes, healthy_celltypes) all_contrasts = expand.grid(Codon = unique(all_celltypes), ...
apache-2.0
R
6b19d1428937545ed6798dd64450437dd53f282b
complete extract protein aac
tttor/csipb-jamu-prj,tttor/csipb-jamu-prj,tttor/csipb-jamu-prj,tttor/csipb-jamu-prj,tttor/csipb-jamu-prj,tttor/csipb-jamu-prj,tttor/csipb-jamu-prj,tttor/csipb-jamu-prj,tttor/csipb-jamu-prj
feature/extract_protein.r
feature/extract_protein.r
# extract_protein.r main <- function(x) { args = commandArgs(trailingOnly=TRUE) if (length(args)!=3) { message('USAGE:') message('Rscript extract_protein.r [yamType] [from] [to]') return() } library('Rcpi') yamType <- args[1] from <- as.numeric(args[2]) to <- as.numeric(args[3])...
# extract_protein.r # id = c('hsa:10161', 'hsa:10162') # getSeqFromKEGG(id) # getFASTAFromKEGG(id) # x = readFASTA(system.file('protseq/P00750.fasta', package = 'Rcpi'))[[1]] # extractProtAAC(x) # extractProtCTDC(x)
mit
R
8e4b02bc0715f8140943b1b62ebaf2de8396568c
Update wetbulb.r
alfcrisci/rBiometeo,alfcrisci/rBiometeo
R/wetbulb.r
R/wetbulb.r
#' wetbulb #' #' DESCRIPTION #' #' @param numeric t Air temperature in Celsius degrees. #' @param numeric rh Air Relative humidity in percentage. #' @param numeric press Air pressure in hPa or millibar. #' @return Wet bulb temperature in Celsius degrees. #' #' #' @author Istituto di Biometeorologia Firenze Italy Alf...
#' wetbulb #' #' DESCRIPTION #' #' @param numeric t Air temperature in Celsius degrees. #' @param numeric rh Air Relative humidity in percentage. #' @param numeric press Air pressure in hPa or millibar. #' @return Wet bulb temperature in Celsius degrees. #' #' #' @author Istituto di Biometeorologia Firenze Italy Alf...
mit
R
7d56ea97873d4dbfa64925f32d5996c24316d5b1
Complete rewrite of thin(n, k) to be much, MUCH faster and memory efficient when n is large (>1e10)
sushilashenoy/zoom.plot
R/qq_plot.r
R/qq_plot.r
# This function samples k indices from 1:n starting with very dense sampling # (every value) and then getting more and more sparse #' Sampling for qq plots #' #' Returns k indices between 1:n such that sampling is very dense at the start and much less dense at the end. #' #' @export thin <- function(n, k=2000) { i...
# This function samples k indices from 1:n starting with very dense sampling # (every value) and then getting more and more sparse #' Sampling for qq plots #' #' Returns k indices between 1:n such that sampling is very dense at the start and much less dense at the end. #' #' @export thin <- function(n, k=2000) { i...
mit
R
fc199548a75e68e934f99eb1fbe943b56f6b788b
Fix all bugs to make running
HIIT/digivaalit-2015,HIIT/digivaalit-2015,HIIT/digivaalit-2015
topics/stm.r
topics/stm.r
create_model <- function( dtm, k ) { library(stm) out <- readCorpus( dtm, type = "slam" ) documents <- out$documents vocab <- out$vocab topic <- stm(documents, vocab, K = k, init.type = "Spectral", max.em.its = 50) return( topic ) }
create_model <- function( dtm, k ) { library(stm) out <- readCorpus( dtm, type = "dtm" ) documents <- out$documents vocab <- out$vocab topic <- stm(documents, vocab, init.type = "Spectral", max.em.its = 50) return topic; }
mit
R
513d067a9699dcdd38795a86fa07bcf92c81670e
add tests for is.llist()
TobCap/lazystreamr
tests/testthat/test-is.list.r
tests/testthat/test-is.list.r
context("test for is.list()") test_that("test", { expect_false(is.lcons(lempty)) expect_false(is.lpair(lempty)) expect_true(is.llist(lempty)) expect_true(is.lcons(1 %:% 2)) expect_true(is.lpair(1 %:% 2)) expect_false(is.llist(1 %:% 2)) expect_true(is.lcons(1 %..% 2)) expect_false(is.lpair...
context("test for is.list()") test_that("test", { expect_true(is.llist(lempty)) expect_true(is.llist(1 %:% (2 %:% lempty))) expect_true(is.llist(llist(1, 2, 3))) expect_true(is.llist(1 %..% 3)) ones <- 1 %:% ones lseq_maker. <- function(..., f) ..1 %:% do.call(lseq_maker., c(list(...)[-1], do.cal...
mit
R
4e52d4add99ae909081612dfb09bd353be5bd64d
Update CalcAlleleDiffs.r
wbooker/PloidyPal
R/CalcAlleleDiffs.r
R/CalcAlleleDiffs.r
#' @export CalcAlleleDiffs <- function(f){ infoTable <- as.matrix(read.csv(f, header=TRUE)) BEG1 <- as.numeric(infoTable[1,2]) END1 <- as.numeric(infoTable[2,2]) str1 <- toString(infoTable[4,2]) for(j in BEG1:END1){ if (file.exists(filePath) == TRUE){ filePath <- paste(c(str1,"/I",j,...
#' @export CalcAlleleDiffs <- function(f){ infoTable <- as.matrix(read.csv(f, header=TRUE)) BEG1 <- as.numeric(infoTable[1,2]) END1 <- as.numeric(infoTable[2,2]) str1 <- toString(infoTable[4,2]) for(j in BEG1:END1){ filePath <- paste(c(str1,"/I",j,"/I",j,"_allelesFromPost_4.txt"), collapse = ""...
mit
R
c866589adbc7c5a73b1bc84273a779ae9120f83a
Remove setwidth package
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.desc.author = 'Konrad ...
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.desc.author = 'Konrad ...
apache-2.0
R
5558880efe8abf2a3eebfd66c9e665e692bd5d1f
copy in the hmc function
MikeXL/bayes
R/mcmc.r
R/mcmc.r
metrop.proposal.fun <- function(theta){ # finding the right scaling factor is more of an art than science # or try and error to look for the best fit on acceptance % return(rnorm(length(theta), mean=theta, sd=rep(sqrt(.5), length(theta)))) } simple.proposal.fun <- function(theta){ return(theta+rnorm(1)) } ...
metrop.proposal.fun <- function(theta){ # finding the right scaling factor is more of an art than science # or try and error to look for the best fit on acceptance % return(rnorm(length(theta), mean=theta, sd=rep(sqrt(.5), length(theta)))) } simple.proposal.fun <- function(theta){ return(theta+rnorm(1)) } ...
mit
R
1e45d89c2e8602a104eb6e9efb3c73173a39a35d
Add basename for fonts where name differs
klmr/ggplots
fonts.r
fonts.r
extrafontdb_path = try(system.file('metrics', package = 'extrafontdb', mustWork = TRUE), silent = TRUE) # FIXME: Make this work with un-gzipped font metrics as well. # FIXME: Make this work with incomplete fonts. complete_font_set = paste0(c('-Regular', '-Bold', '-Italic', '-BoldItalic'), '.afm.gz') rebuild_cache = fu...
extrafontdb_path = try(system.file('metrics', package = 'extrafontdb', mustWork = TRUE), silent = TRUE) # FIXME: Make this work with un-gzipped font metrics as well. # FIXME: Make this work with incomplete fonts. complete_font_set = paste0(c('-Regular', '-Bold', '-Italic', '-BoldItalic'), '.afm.gz') rebuild_cache = fu...
apache-2.0
R
5afb21d6af76298b652073a56cfc4f093faa8213
fix return type if not vecs
mschubert/narray,mschubert/narray
R/vectors_to_row_or_col.r
R/vectors_to_row_or_col.r
#' Converts vectors in a list to row- or column vectors #' #' @param xlist List of array-like elements and vectors #' @param along Along which dimension vectors should be aligned #' @return List where vectors are replaced by row- or col vectors (2d) vectors_to_row_or_col = function(xlist, along) { # for vector...
#' Converts vectors in a list to row- or column vectors #' #' @param xlist List of array-like elements and vectors #' @param along Along which dimension vectors should be aligned #' @return List where vectors are replaced by row- or col vectors (2d) vectors_to_row_or_col = function(xlist, along) { # for vector...
apache-2.0
R
02cf3854eead97ebd524ddbc9f473df552192eef
rename cluster based on manual validataion
shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl
lib/scRNA/renameCluster.r
lib/scRNA/renameCluster.r
library(Seurat) library(ggplot2) finalList<-readRDS(parFile1) obj<-finalList$obj newnames<-read.table(parSampleFile2, stringsAsFactors = F, sep="\t", header=F) clusters<-data.frame("cell" = c(1:length(obj$seurat_clusters)), "seurat_cluters"=as.numeric(as.character(obj$seurat_clusters)), "cellactivity_clusters"=obj$c...
library(Seurat) library(ggplot2) finalList<-readRDS(parFile1) obj<-finalList$obj
apache-2.0
R
066d8467656d4124bedc676aa5af14738bb0eb70
fix error message
robertzk/s3mpi
R/s3store.r
R/s3store.r
#' Store an R object in S3 by key #' #' Any type of object that can be serialized as an RDS file #' is capable of being retrieved using this interface. #' #' @export #' @examples #' \dontrun{ #' s3store(c(1,2,3), 'test123') #' print(s3read('test123')) #' # [1] 1 2 3 #' }#' s3store <- function(obj, name = NULL, .path = ...
#' Store an R object in S3 by key #' #' Any type of object that can be serialized as an RDS file #' is capable of being retrieved using this interface. #' #' @export #' @examples #' \dontrun{ #' s3store(c(1,2,3), 'test123') #' print(s3read('test123')) #' # [1] 1 2 3 #' }#' s3store <- function(obj, name = NULL, .path = ...
mit
R
a8f7701bdfd4317025700427bbbb2d494ab97ebd
Update ui.r
mmjazzar/TimeSeries_Forecasting,mmjazzar/Load_dashboard
ui.r
ui.r
library(shiny) library(datasets) ui <- shinyUI(fluidPage( titlePanel("Load Forecasting Dashboard"), tabsetPanel( tabPanel("Upload File", titlePanel("Uploading Files"), sidebarLayout( sidebarPanel( fileInput('file1', 'Choose CSV File', ...
library(shiny) sidebar <- dashboardSidebar( fileInput('file1', 'Choose CSV File', accept=c('text/csv', 'text/comma-separated-values,text/plain', '.csv')), tags$hr(), checkboxInput('header', 'Header', TRUE), ra...
apache-2.0
R
2244c82057fdafaee294d1df49c768ae5e6c26e2
fix number of workers
mschubert/clustermq,mschubert/clustermq,mschubert/clustermq
R/foreach.r
R/foreach.r
#' Register clustermq as `foreach` parallel handler #' #' @param ... List of arguments passed to the `Q` function, e.g. n_jobs #' @export register_dopar_cmq = function(...) { info = function(data, item) { switch(item, name = "clustermq", version = utils::packageVersion("cluste...
#' Register clustermq as `foreach` parallel handler #' #' @param ... List of arguments passed to the `Q` function, e.g. n_jobs #' @export register_dopar_cmq = function(...) { info = function(data, item) { switch(item, name = "clustermq", version = utils::packageVersion("cluste...
apache-2.0
R
8d3c0d415f68fafa41fc46e1cbc7d89e8c5776aa
correct unused R-code before deleting it
ChadFulton/statsmodels,bashtage/statsmodels,bashtage/statsmodels,statsmodels/statsmodels,jseabold/statsmodels,josef-pkt/statsmodels,bashtage/statsmodels,bashtage/statsmodels,statsmodels/statsmodels,jseabold/statsmodels,ChadFulton/statsmodels,statsmodels/statsmodels,statsmodels/statsmodels,ChadFulton/statsmodels,jseabol...
statsmodels/tsa/vecm/tests/results_R_tsDyn/tsDyn_output_generator.r
statsmodels/tsa/vecm/tests/results_R_tsDyn/tsDyn_output_generator.r
# install.packages("tsDyn") # comment in, if package is not installed yet library(tsDyn) dta = read.table("E6_jmulti.csv", header = FALSE, sep = " ") det.terms <- c("co", "cc", "colt", "cclt", "colc", "cclc") for(dt in det.terms){ det.outside.coint <- "none" det.inside.coint <- "none" if(grepl("co", dt)) # ...
# install.packages("tsDyn") # comment in, if package is not installed yet library(tsDyn) dta = read.table("E6_jmulti.csv", header = FALSE, sep = " ") det.terms <- c("co", "cc", "colt", "cclt", "colc", "cclc") det.outside.coint <- "none" det.inside.coint <- "none" for(dt in det.terms){ if(grepl("co", dt)) # pytho...
bsd-3-clause
R
491122ea9f6e001c79764600676368cc557b38ef
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'...
# 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.or...
apache-2.0
R
63ee73be401b5ae8c2159910bab590f61f33f62c
Remove newline at top of static bash script
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
83ef054d126fedf5b2faa22182b0badc8dd18a32
test naming overlays
robertzk/stagerunner,syberia/stagerunner,kirillseva/stagerunner,davluangu/stagerunner,robertzk/stagerunner,davluangu/stagerunner,syberia/stagerunner
inst/tests/test-overlay.r
inst/tests/test-overlay.r
context('stageRunner overlaying') test_that('it can overlay a simple example correctly', { sr1 <- stageRunner$new(cx <- new.env(), list(a = function(x) x$x <- 1, b = function(y) x$x <- 3)) sr2 <- stageRunner$new(cx, list(a = function(y) y$x <- 2)) sr1$overlay(sr2) sr1$run(1) expect_identical(cx$x, 2) # Ch...
context('stageRunner overlaying') test_that('it can overlay a simple example correctly', { sr1 <- stageRunner$new(cx <- new.env(), list(a = function(x) x$x <- 1, b = function(y) x$x <- 3)) sr2 <- stageRunner$new(cx, list(a = function(y) y$x <- 2)) sr1$overlay(sr2) sr1$run(1) expect_identical(cx$x, 2) # Ch...
mit
R
17ffef9ce57005f19f1ee16294e5c8082c58301b
Update quantile_example.r
vbelakov/h2o,100star/h2o,eg-zhang/h2o-2,h2oai/h2o-2,eg-zhang/h2o-2,100star/h2o,rowhit/h2o-2,rowhit/h2o-2,h2oai/h2o,rowhit/h2o-2,elkingtonmcb/h2o-2,eg-zhang/h2o-2,elkingtonmcb/h2o-2,100star/h2o,111t8e/h2o-2,vbelakov/h2o,rowhit/h2o-2,111t8e/h2o-2,vbelakov/h2o,rowhit/h2o-2,elkingtonmcb/h2o-2,h2oai/h2o,rowhit/h2o-2,calving...
R/examples/quantile_example.r
R/examples/quantile_example.r
# This is an example code to run Quantile function on a Hadoop Cluster # Prior to running the R Script, launch the H2O hadoop jar on the cluster # Detach and remove old H2O package if it exists detach("package:h2o", unload=TRUE) remove.packages("h2o",.libPaths()) # Install the same version of H2O from online reposito...
# This is an example code to run Quantile function on a Hadoop Cluster # Prior to running the R Script, launch the H2O hadoop jar on the cluster # Detach and remove old H2O package if it exists detach("package:h2o", unload=TRUE) remove.packages("h2o",.libPaths()) # Install the same version of H2O from online reposito...
apache-2.0
R
ffb4d34a9abf5922b5d064a576c4d8383be16370
Update UTCI.r
alfcrisci/rBiometeo,alfcrisci/rBiometeo
R/UTCI.r
R/UTCI.r
#' UTCI #' #' Calculate Universal Thermal Climate Index ( UTCI) index. #' #' @param numeric t Air temperature in Celsius degrees. #' @param numeric rh Air Relative humidity in percentage. #' @param numeric wind Wind speed in meter per second. #' @param numeric tr Mean radiant temperature in Celsius degrees #' @return U...
#' UTCI #' #' Calculate Universal Thermal Climate Index ( UTCI) index. #' #' @param numeric t Air temperature in Celsius degrees. #' @param numeric rh Air Relative humidity in percentage. #' @param numeric wind Wind speed in meter per second. #' @param numeric tr Mean radiant temperature in Celsius degrees #' @return U...
mit
R
2ee782ad0b604ac8fb4820be435d04942d8ff623
Update 2.r
glor/R,glor/R
aufgaben/blatt02/2.r
aufgaben/blatt02/2.r
#Blatt 2 #2.1 sorte = c(rep(1,15), rep(2,12), rep(3, 20)) gewicht = c(6.22,5.75,6.4,4.6,3.25,4.5,4.8,5.88,5.8,6.1,5.58,6.01,5.62,6.72,8.55,4.28,7.7,6.4,7.77,7.37,4.2,7.05,6.45,8.93,5.9,5.94,6.39, 7.13,8.78,6.06,7.93,9.1,8,7.55,8.32,8.8,12.63,8.19,6.5,6.84,7.02,9.39,7.38,7.39,6.99,8.27,6.7) tabelle = data.frame(So...
#Blatt 2 #2.1 sorte = c(rep(1,15), rep(2,12), rep(3, 20)) gewicht = c(6.22,5.75,6.4,4.6,3.25,4.5,4.8,5.88,5.8,6.1,5.58,6.01,5.62,6.72,8.55,4.28,7.7,6.4,7.77,7.37,4.2,7.05,6.45,8.93,5.9,5.94,6.39, 7.13,8.78,6.06,7.93,9.1,8,7.55,8.32,8.8,12.63,8.19,6.5,6.84,7.02,9.39,7.38,7.39,6.99,8.27,6.7) tabelle = data.frame(So...
bsd-2-clause
R
7cd57d2f43fd9665a8309acb963b21ab22121cee
Update sun_data.r
alfcrisci/rBiometeo,alfcrisci/rBiometeo
R/sun_data.r
R/sun_data.r
#' sun_data #' #' Calculate solar parameter for a location and a time. #' #' @param datetime Datetime as in "%Y-%m-%d %H:%M:%S" format #' @param numeric lat Latitude in decimal degrees. #' @param numeric lon Longitude in decimal degrees. #' @param character parameter Six solar parameter are available by name "azimuth"...
#' sun_data #' #' Calculate solar parameter for a location and a time. #' #' @param datetime Datetime as in "%Y-%m-%d %H:%M:%S" format #' @param numeric lat Latitude in decimal degrees. #' @param numeric lon Longitude in decimal degrees. #' @param character parameter Six solar parameter are available by name "azimuth"...
mit
R
d7ac6c036ed3f66692231c24360b4956985106a1
Make CLOSURE a FUNCT for closures (#2002)
rebol/rebol,codebybrett/ren-c,rgchris/ren-c,earl/r3,hostilefork/rebol,mbk/ren-c,hostilefork/rebol,hostilefork/rebol,earl/r3,draegtun/ren-c,rebol/rebol,draegtun/ren-c,draegtun/ren-c,rebolsource/r3,rebol/rebol,hostilefork/rebol,giuliolunati/ren-c,giuliolunati/ren-c,hostilefork/rebol,kealist/ren-c,rgchris/ren-c,earl/r3,rg...
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
d372e34679663a81cb3c7b6b38a9ad6d333c4f82
Fix typo in test case
klmr/modules,klmr/modules
inst/tests/test-operators.r
inst/tests/test-operators.r
context('Operator export test') test_that('operators are attached by default', { expect_false(exists('%or%')) a = import(a) on.exit(unload(a)) expect_true(exists('%or%')) expect_that(1 %or% 2, equals(1)) expect_that(numeric(0) %or% 2, equals(2)) }) test_that('operator attachment can be disabl...
context('Operator export test') test_that('operators are attached by default', { expect_false(exists('%or%')) a = import(a) on.exit(unload(a)) expect_true(exists('%or%')) expect_that(1 %or% 2, equals(1)) expect_that(numeric(0) %or% 2, equals(2)) }) test_that('operator attachment can be disabl...
apache-2.0
R
2a2dcaf25daa54d2945c6d489d79d3c130d55b74
Modify plotting script to handle drop stats.
draios/falco,draios/falco,draios/falco,draios/falco,draios/falco,draios/falco,draios/falco,draios/falco
test/plot-live.r
test/plot-live.r
require(jsonlite) library(ggplot2) library(GetoptLong) initial.options <- commandArgs(trailingOnly = FALSE) file.arg.name <- "--file=" script.name <- sub(file.arg.name, "", initial.options[grep(file.arg.name, initial.options)]) script.basename <- dirname(script.name) if (substr(script.basename, 1, 1) != '/') { sc...
require(jsonlite) library(ggplot2) library(GetoptLong) initial.options <- commandArgs(trailingOnly = FALSE) file.arg.name <- "--file=" script.name <- sub(file.arg.name, "", initial.options[grep(file.arg.name, initial.options)]) script.basename <- dirname(script.name) if (substr(script.basename, 1, 1) != '/') { sc...
apache-2.0
R
c77c8a6369846464a6eb5c569dbe595f6e8fe108
Update templates
hkaju/LennardJones,hkaju/LennardJones,hkaju/LennardJones
templates/energies.template.r
templates/energies.template.r
pdf("reports/results-dn{density}.pdf") data <- read.csv("data/data-dn{density}.csv", header=T) plot(data$t, data$T, ylim=c(-10, 10), xlab="Steps", ylab="Energy per particle", type="n", main=expression(paste("Step size ", delta, "t = {density}"))) lines(data$t, data$V, col="blue") lines(data$t, data$T, col="black") li...
pdf("reports/energies-dt{timestep}.pdf") data <- read.csv("output.csv", header=T) plot(data$t, data$T, ylim=c(-6, 6), xlab="Steps", ylab="Energy per particle", type="n", main=expression(paste("Step size ", delta, "t = {timestep}"))) lines(data$t, data$V, col="blue") lines(data$t, data$T, col="black") lines(data$t, da...
mit
R
961455fd31ea60d25ae8dce2efaaab48427c5f9f
Update analiza.r
GalDrnovsek/APPR-2015-16
analiza/analiza.r
analiza/analiza.r
# 4. faza: Analiza podatkov library(ggplot2) library(MASS) library(mgcv) library(maptools) #prvi del a <- ggplot(vse_skupaj1, aes(x=`GDP pc`, y=`GMs per million`)) + geom_point() print(a) a + geom_smooth(method = "lm") lin1 <- lm(data = vse_skupaj1, vse_skupaj1$`GDP pc` ~ vse_skupaj1$`GMs per million`) lin1 predict...
# 4. faza: Analiza podatkov barve <- rainbow(length(levels(obcine[[7]]))) names(barve) <- levels(obcine[[7]])
mit
R
69c76c0985ff7aa35e17bb11e9f6c2277c4d3444
fix readLong
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
54a342b9dc195da19d91ff4dd9531cd185d34013
add test for worker number
mschubert/clustermq,mschubert/clustermq,mschubert/clustermq
tests/testthat/test-qsys.r
tests/testthat/test-qsys.r
context("qsys") skip_on_os("windows") test_that("control flow", { fx = function(x) x*2 result = Q(fx, x=1:3, n_jobs=1, qsys_id="multicore") expect_equal(result, as.list(1:3*2)) }) test_that("common data", { fx = function(x, y) x*2 + y result = Q(fx, x=1:3, const=list(y=10), n_jobs=1, qsys_id="mult...
context("qsys") skip_on_os("windows") test_that("control flow", { fx = function(x) x*2 result = Q(fx, x=1:3, n_jobs=1, qsys_id="multicore") expect_equal(result, as.list(1:3*2)) }) test_that("common data", { fx = function(x, y) x*2 + y result = Q(fx, x=1:3, const=list(y=10), n_jobs=1, qsys_id="mult...
apache-2.0
R
e3248f506964c2b83918eaf43a939c8509aca196
allow var swapping
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
22421474a068d32ee22676ff99e37c720a94dbaa
Bump ottr version
ryanlovett/datahub,berkeley-dsep-infra/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub
deployments/datahub/images/default/r-packages/econ-140.r
deployments/datahub/images/default/r-packages/econ-140.r
#!/usr/bin/env Rscript print("Installing packages for Econ 140") source("/tmp/class-libs.R") class_name = "Econ 140" print("Installing ottr...") devtools::install_github('ucbds-infra/ottr', ref='1.0.0', upgrade_dependencies=FALSE, quiet=FALSE) print("Done installing packages for Econ 140")
#!/usr/bin/env Rscript print("Installing packages for Econ 140") source("/tmp/class-libs.R") class_name = "Econ 140" print("Installing ottr...") devtools::install_github('ucbds-infra/ottr', ref='0.0.1.b1', upgrade_dependencies=FALSE, quiet=FALSE) print("Done installing packages for Econ 140")
bsd-3-clause
R
7698677f9c0735a5c83b17c4e0aa98138985cd1b
Remove unnecessary setup in unit tests
klmr/modules,klmr/modules
inst/tests/test-relative-import.r
inst/tests/test-relative-import.r
context('Relative imports test') test_that('Imports are absolute by default', { ra = import('relative_a') expect_that(ra$a_which(), equals('/a')) }) test_that('Relative import are always local', { ra = import('relative_a') expect_that(ra$local_a_which(), equals('nested/a')) })
context('Relative imports test') setup = function () { thispath = file.path(getwd(), 'modules/nested') prev = getOption('import.path') if (! identical(prev, thispath)) previous_import_path <<- prev options(import.path = thispath) } teardown = function () { options(import.path = previous_im...
apache-2.0
R
881bc344619017da98d1b4222e5ab363b000d90a
Add IBP.
jtobin/bnp
indian-buffet-process/src/ibp.r
indian-buffet-process/src/ibp.r
ibp = function(n, a) { dishes = max(1, rpois(1, a)) diners = data.frame(dish = seq(dishes), diners = rep(1, dishes)) buffet = list(buffet = diners, choices = list(seq(dishes))) for (j in seq(n - 1)) { buffet = arrival(buffet, a) } buffet } arrival = function(b, a) { config = b$buffet existi...
# FIXME handle sampled zero values ibp = function(n, a) { dishes = rpois(1, a) diners = data.frame(dish = seq(dishes), diners = rep(1, dishes)) buffet = list(buffet = diners, choices = list(seq(dishes))) for (j in seq(n - 1)) { buffet = arrival(buffet, a) } buffet } arrival = function(b, a) { ...
mit
R
c7648e3028e12f48c05fd9bb77412f07e1763db3
update calcor.r
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"), log = T) { pm <- read_pm10() file_prefix <- "pm_" if (log) { pm <- log(pm) file_prefix <- paste0("log_...
# Saharan Dust Transport Research # 2016-05-04 Ismail SEZEN # sezenismail@gmail.com source("code/correlation.r") calcor <- function(files = stop("'file' must be specified"), log = T) { pm <- read_pm10() file_prefix <- "pm_" if (log) { pm <- log(pm) file_prefix <- paste0("log_", file_prefix) } dir_ou...
mit
R
46523e8ca86d21aa0df1b168e59075017cfc5e13
Copy local filename series before modifying
metaeducation/ren-c-test,metaeducation/ren-c-test
run-recover.r
run-recover.r
Rebol [ Title: "Core tests run with crash recovery" File: %run-recover.r Copyright: [2012 "Saphirion AG"] 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 Licen...
Rebol [ Title: "Core tests run with crash recovery" File: %run-recover.r Copyright: [2012 "Saphirion AG"] 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 Licen...
apache-2.0
R
ee811543fdbb60680b22fa6478f0ac719a2aef43
Revise author info
chuan-wang/NGI-ChIPseq,ewels/NGI-ChIPseq,ewels/NGI-ChIPseq,ewels/NGI-ChIPseq,ewels/NGI-ChIPseq,chuan-wang/NGI-ChIPseq,chuan-wang/NGI-ChIPseq,chuan-wang/NGI-ChIPseq,ewels/NGI-ChIPseq
bin/calculateNSCRSC.r
bin/calculateNSCRSC.r
#!/usr/bin/env Rscript # R scripts for calculating NSC and RSC based on output files from phantompeakqualtools # Version 1.0 # Author @chuan-wang https://github.com/chuan-wang # Command line argument processing args <- commandArgs(trailingOnly=TRUE) # Check input args if (length(args) != 1) { stop("Usage: calculat...
#!/usr/bin/env Rscript # R scripts for calculating NSC and RSC based on output files from phantompeakqualtools # Version 1.0 # Author chuan-wang@github # Command line argument processing args <- commandArgs(trailingOnly=TRUE) # Check input args if (length(args) != 1) { stop("Usage: calculateNSCRSC.r [ cross-correl...
mit
R
515f711d6cda5f210b9ce6428899fdc1b77facfd
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) { ca...
#' 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) { ca...
mit
R
5883273b8262c937a61c2fffec8396de5ca097f7
Add more complex sbatch_dependency_list tests
jmousseau/Stain
tests/testthat/test-sbatch.r
tests/testthat/test-sbatch.r
context("sbatch") test_that("All options are formated correctly", { expect_equal(sbatch_opts$begin("00:00:01"), "--begin=00:00:01") expect_equal(sbatch_opts$cpus_per_task(12), "--cpus-per-task=12") expect_equal(sbatch_opts$mail_user("user@address"), "--mail-user=user@address") expect_...
context("sbatch") test_that("All options are formated correctly", { expect_equal(sbatch_opts$begin("00:00:01"), "--begin=00:00:01") expect_equal(sbatch_opts$cpus_per_task(12), "--cpus-per-task=12") expect_equal(sbatch_opts$mail_user("user@address"), "--mail-user=user@address") expect_...
mit
R
cba9c8e3719b7f613014ad20f24d59ee7e72d4e5
update ref
ryanlovett/datahub,ryanlovett/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,berkeley-dsep-infra/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
01714d7a801d338e5d71aa4bdfa6c4ac56939039
Add parallel eval. and progress bar capabilities
efcaguab/paco
R/paco_links.r
R/paco_links.r
#' Contribution of individual links #' @param D A list returned by proc_analysis #' @param .parallel if \code{TRUE}, calculate the jacknife contribution in parallel using the backend provided by foreach #' @param .progress name of the progress bar to use see \code{\link[plyr]{create_progress_bar}}. Options inlcude "tex...
#' Contribution of individual links #' @param D A list returned by proc_analysis #' @param ... Additional arguments to be passed to PACo #' @return A list with added object jacknife, containing the mean and upper CI values for each link #' @export paco_links <- function(D, ...) { HP.ones <- which(D$HP > 0, arr.ind=T...
mpl-2.0
R
97046c8e2f1d8bdbddc731cddba5a3a35198025e
allow additional args for map
mschubert/narray,mschubert/narray
R/map.r
R/map.r
#' Apply function that preserves order of dimensions #' #' @param X An n-dimensional array #' @param along Along which axis to apply the function #' @param FUN A function that maps a vector to the same length or a scalar #' @param drop Remove unused dimensions after mapping; default: TRUE #' @param ....
#' Apply function that preserves order of dimensions #' #' @param X An n-dimensional array #' @param along Along which axis to apply the function #' @param FUN A function that maps a vector to the same length or a scalar #' @param drop Remove unused dimensions after mapping; default: TRUE #' @return ...
apache-2.0
R
4133856001c267ec2d467c9e2353481afa0692ba
Update utci_class7.r
alfcrisci/rBiometeo,alfcrisci/rBiometeo
R/utci_class7.r
R/utci_class7.r
#' utci_class7 #' #' Calculate seven thermal classes of Universal Thermal Climate Index UTCI index. #' #' @param numeric t Air temperature in Celsius degrees. #' @param numeric rh Air Relative humidity in percentage. #' @param numeric wind Wind speed in meter per second. #' @param numeric tmrt Mean radiant temperatur...
#' utci_class7 #' #' Calculate seven thermal classes of Universal Thermal Climate Index UTCI index. #' #' @param numeric t Air temperature in Celsius degrees. #' @param numeric rh Air Relative humidity in percentage. #' @param numeric wind Wind speed in meter per second. #' @param numeric tmrt Mean radiant temperatur...
mit
R
9ba2d78b8b87d1e65e11c3b66f671f4ef07aa9b8
Comment out example code to not generate plot files
sushilashenoy/zoom.plot
R/extend_color_range.r
R/extend_color_range.r
#' @export extend.color.range <- function(colors, n, weight=rep(1, length(colors)-1)) { if ( n < length(colors) ) return ( colors ) if ( length(weight) != length(colors)-1 ) stop('Must be one fewer weights than colors.') red.part <- strtoi(paste('0X', substring(colors, 2, 3), sep=''))/2^8 grn.part <- strtoi(...
#' @export extend.color.range <- function(colors, n, weight=rep(1, length(colors)-1)) { if ( n < length(colors) ) return ( colors ) if ( length(weight) != length(colors)-1 ) stop('Must be one fewer weights than colors.') red.part <- strtoi(paste('0X', substring(colors, 2, 3), sep=''))/2^8 grn.part <- strtoi(...
mit
R
d5acac72ca06f2ab8f9c379efeea598e405476f6
Update server.r
aleksandrov2/APPR-2015-16
shiny/server.r
shiny/server.r
library(shiny) shinyServer( server <- function(input, output) { output$dolg <- renderPlot({ ggplot(podatki1 %>% filter(Cas == input$leto_1), aes(x = Drzava, y = Dolg, fill=Dolg)) + scale_fill_continuous(low = "#69b8f6", high = "#142d45") + geom_bar(stat ="identity") + theme(axis.text.x = element_text(a...
library(shiny) shinyServer( server <- function(input, output) { output$dolg <- renderPlot({ ggplot(podatki1 %>% filter(Cas == input$leto_1), aes(x = Drzava, y = Dolg, fill=Dolg)) + scale_fill_continuous(low = "#69b8f6", high = "#142d45") + geom_bar(stat ="identity") + theme(axis.text.x = element_text(a...
mit
R