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
2d8d173b39f796a67c336e9af395415413005269
Fix syntax errors
berkeley-dsep-infra/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub
deployments/publichealth/image/r-packages/ph-252.r
deployments/publichealth/image/r-packages/ph-252.r
#!/usr/bin/env Rscript # For https://github.com/berkeley-dsep-infra/datahub/issues/2556 # For https://github.com/berkeley-dsep-infra/datahub/issues/2524 # For https://github.com/berkeley-dsep-infra/datahub/issues/2748 # For https://github.com/berkeley-dsep-infra/datahub/issues/2788 # Fall 2021 print("Installing package...
#!/usr/bin/env Rscript # For https://github.com/berkeley-dsep-infra/datahub/issues/2556 # For https://github.com/berkeley-dsep-infra/datahub/issues/2524 # For https://github.com/berkeley-dsep-infra/datahub/issues/2748 # For https://github.com/berkeley-dsep-infra/datahub/issues/2788 # Fall 2021 print("Installing package...
bsd-3-clause
R
a1b0268eb1e189ae23e04ae5d9238b7066dc5ca1
Update source.r
svobodam/Deep-Learning-Text-Summariser,svobodam/Deep-Learning-Text-Summariser,svobodam/Deep-Learning-Text-Summariser
PreProcessingScript/source.r
PreProcessingScript/source.r
# Source control script for complete dataset processing setwd('~/deep-Learning-Text-Summariser') # LIBRARIES library(RSQLite) library(tm) library(reshape2) library(gsubfn) # FUNCTIONS # Connection to DB connDB = function(z) { # Initiate Connection to DB conn = dbConnect(dbDriver("SQLite"), z) return(conn) } ...
# Source control script for complete dataset processing setwd('~/summCode') # LIBRARIES library(RSQLite) library(tm) library(reshape2) library(gsubfn) # FUNCTIONS # Connection to DB connDB = function(z) { # Initiate Connection to DB conn = dbConnect(dbDriver("SQLite"), z) return(conn) } # Disconnect from DB ...
mit
R
6b917eeedc841d97c3231532eb1958f0f8ec9a6b
Document semantics of sys module better
klmr/codons,klmr/codons
scripts/sys.r
scripts/sys.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 #' #' @note If the script was invoked interactively, this is the empty strin...
# 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 =...
apache-2.0
R
059be9bd0bab6fc84d3f4425649050ce5239994d
return data
lukejharmon/traitathon
rAnalysis/RImportData.r
rAnalysis/RImportData.r
## dummy code to be filled in with methods to draw trees and data from online get_traits<-function(trait_file_path){ ## this is to be replaced with a way of calling traits ## given species names trait_mat<-read.csv(trait_file_path) return(trait_mat) } get_tree<-function(tree_file_path){ require(ape) ## this is...
get_traits<-function(trait_file_path){ ## this is to be replaced with a way of calling traits ## given species names trait_mat<-read.csv(trait_file_path) } get_tree<-function(tree_file_path){ require(ape) ## this is to be replaced with a way of calling trees ## from Open Tree given species names tree<-read.tree...
mit
R
c1ac2640e53eb32ea720b0e9025e918369444b85
Update mtcars.r
bgweber/RServer,bgweber/RServer,bgweber/RServer,bgweber/RServer
tasks/userDemo/mtcars.r
tasks/userDemo/mtcars.r
# Copyright (C) 2016 Electronic Arts Inc. All rights reserved. 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...
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
32595c2326c75f029bd1418b1f757dcab5e3f2fd
revert pskill warn supp, no effect
mschubert/clustermq,mschubert/clustermq,mschubert/clustermq
R/qsys_multicore.r
R/qsys_multicore.r
#' Process on multiple cores on one machine #' #' This makes use of rzmq messaging and sends requests via TCP/IP MULTICORE = R6::R6Class("MULTICORE", inherit = QSys, public = list( initialize = function(...) { super$initialize(..., node="localhost") }, submit_jobs = functio...
#' Process on multiple cores on one machine #' #' This makes use of rzmq messaging and sends requests via TCP/IP MULTICORE = R6::R6Class("MULTICORE", inherit = QSys, public = list( initialize = function(...) { super$initialize(..., node="localhost") }, submit_jobs = functio...
apache-2.0
R
fcd8d0a41cb3a1c1fd749dd02e65d2113fa0f745
Update utci_class.r
alfcrisci/rBiometeo,alfcrisci/rBiometeo
R/utci_class.r
R/utci_class.r
#' utci_class #' #' Calculate ten (10) thermal class 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 temperat...
#' utci_class #' #' Calculate ten (10) thermal class 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 temperat...
mit
R
4a056e731f2f6f9500dba98de8699f8e83356e6a
Update slavicreview.r
YaleDHLab/lab-workshops,YaleDHLab/lab-workshops,YaleDHLab/lab-workshops,YaleDHLab/lab-workshops,YaleDHLab/lab-workshops
rstudio_dfrtopics/slavicreview.r
rstudio_dfrtopics/slavicreview.r
#Create a new project in the folder that has the JSTOR data. install.packages("devtools") install_github("agoldst/dfrtopics") install.packages("dplyr") install.packages("ggplot2") install.packages("lubridate") install.packages("stringr") install.packages("rJava") install.packages("mallet") library(devtools) options...
Create a new project in the folder that has the JSTOR data. install.packages("devtools") install_github("agoldst/dfrtopics") install.packages("dplyr") install.packages("ggplot2") install.packages("lubridate") install.packages("stringr") install.packages("rJava") install.packages("mallet") library(devtools) options(...
mit
R
eb68d7f64d1944ab4974589143f405def1d99d2e
use base rep if vector
mschubert/narray,mschubert/narray
R/rep.r
R/rep.r
#' Repeats an array along an arbitrary axis #' #' @param x An array object #' @param n Integer, how often to repeat #' @param along Along which axis to repeat (default: 1) #' @return An array that is repeated `n` times on axis `along` #' @export rep = function(x, n, along=1) { if (is.null(dim(x))) ...
#' Repeats an array along an arbitrary axis #' #' @param x An array object #' @param n Integer, how often to repeat #' @param along Along which axis to repeat (default: 1) #' @return An array that is repeated `n` times on axis `along` #' @export rep = function(x, n, along=1) { xl = base::rep(list(x...
apache-2.0
R
69a9ef23dcd06f517e70054507c24381a3f9f810
Update R pipe operator to magrittr
klmr/.files,klmr/.files,klmr/.files
.R/pipe.r
.R/pipe.r
`%>%` <- magrittr::`%>%`
# Pipe operator modified after Robert Sugar, e.g. at # <http://markmail.org/thread/uygwsdulfvxlydlh> `%|%` <- function (x, y) { thecall <- match.call() if (is.name(thecall$y) || is.function(thecall$y)) y(x) else eval(thecall$y, list(value = eval(thecall$x))) }
apache-2.0
R
2f38a43ed5d39149dd90a05f986cfda7963c1ede
add shift and addChr option
shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl
lib/Annotation/getGeneLocus.r
lib/Annotation/getGeneLocus.r
require(biomaRt) require(stringr) if(!exists("host")){ host="grch37.ensembl.org" } if(!exists("dataset")){ dataset = "hsapiens_gene_ensembl" } if(!exists("symbolKey")){ symbolKey = "hgnc_symbol" } if(!exists('genesStr')){ genesStr<-"LDLR APOB PCSK9 LDLRAP1 STAP1 LIPA ABCG5 ABCGB APOE LPA PNPLA5 CH25H INSIG2...
require(biomaRt) require(stringr) if(!exists("host")){ host="grch37.ensembl.org" } if(!exists("dataset")){ dataset = "hsapiens_gene_ensembl" } if(!exists("symbolKey")){ symbolKey = "hgnc_symbol" } if(!exists('genesStr')){ genesStr<-"LDLR APOB PCSK9 LDLRAP1 STAP1 LIPA ABCG5 ABCGB APOE LPA PNPLA5 CH25H INSIG2...
apache-2.0
R
402e6595977fe555d0adc7d1d611b826c887e00e
Fix caching error
klmr/codons,klmr/codons
scripts/cache.r
scripts/cache.r
decorate = modules::import('decorate', attach = TRUE) modules::import('ebits/base', attach = c('closure', 'match_call_defaults')) cache = decorator %@% function (f) { cache = new.env() g = function (...) { call = match_call_defaults() args = call[-1] # Use a helper to evaluate all argum...
decorate = modules::import('decorate', attach = TRUE) modules::import('ebits/base', attach = c('closure', 'match_call_defaults')) # FIXME: Doesn’t work with recursive functions # Reproduce: fib = .cache %@% function (n) if (n < 2) 1 else fib(n - 1) + fib(n - 2) # Suspicion: somehow, the state of the function is shared...
apache-2.0
R
26f0dff99fc7188f770ace435cfe819713f6caea
update code to data.table
DrewWham/Genetic-Structure-Tools
plotSTR.r
plotSTR.r
library(stringr) library(ggplot2) library(data.table) #function for extracting the cluster Probs, requires STR infile because STRUCTURE likes to chop off the ends of your sample names so I have to use your original file to get your original names read.STR<-function(STR.in,STR.out){ #read in data str<-read.table(STR.in...
library(stringr) library(ggplot2) #function for extracting the cluster Probs, requires STR infile because STRUCTURE likes to chop off the ends of your sample names so I have to use your original file to get your original names read.STR<-function(STR.in,STR.out){ #read in data str<-read.table(STR.in,skip=1) str.out<-r...
apache-2.0
R
5c196b4f5ecaf1322b306702e55ca3ca38199417
use different line style
thomaskrause/graphANNIS,thomaskrause/graphANNIS,thomaskrause/graphANNIS,thomaskrause/graphANNIS,thomaskrause/graphANNIS,thomaskrause/graphANNIS,thomaskrause/graphANNIS
evaluation/evaluate-csv.r
evaluation/evaluate-csv.r
bench_getaql <- function(x, querydir) { aqlFile <- "" group <- x[1] problemSpace = as.numeric(x[2]) if(problemSpace == 0) { corpus <- sub("_[^_]+$", "", group) fn <- substr(group, nchar(corpus)+2, nchar(group)) aqlFile <- paste(querydir, "/", corpus,"/", fn, ".aql", sep='') } else { aqlFi...
bench_getaql <- function(x, querydir) { aqlFile <- "" group <- x[1] problemSpace = as.numeric(x[2]) if(problemSpace == 0) { corpus <- sub("_[^_]+$", "", group) fn <- substr(group, nchar(corpus)+2, nchar(group)) aqlFile <- paste(querydir, "/", corpus,"/", fn, ".aql", sep='') } else { aqlFi...
apache-2.0
R
f0c894353fe8b94a81e9c000f8c53ba1c44e10e0
Update ggplot2_formatter.r
fdryan/R,1R151-1/R,jezdata/R
ggplot2_formatter.r
ggplot2_formatter.r
require(scales) # --------------------------------------------------------------------------------------------- # Formatting functions for ggplot graph axis # --------------------------------------------------------------------------------------------- #' Human Numbers: Format numbers so they're legible for humans ...
require(scales) # --------------------------------------------------------------------------------------------- # Formatting functions for ggplot graph axis # --------------------------------------------------------------------------------------------- #' Human Numbers: Format numbers so they're legible for humans ...
unlicense
R
2d1e45ebf4e28526334bfce6cff8b151cabcab91
Move all data to one dataframe
elephantum/r-basis
basis.r
basis.r
library('rjson') library('RCurl') getBasisData <- function(report_date='2013-09-14') { user_id <- readLines('user_id.txt') # '&start_offset=-10800', # '&end_offset=10800', basis.url <- sprintf( paste0('https://app.mybasis.com/api/v1/chart/%s.json', '?summary=true', ...
library('rjson') library('RCurl') getBasisData <- function(report_date='2013-09-14') { user_id <- readLines('user_id.txt') # '&start_offset=-10800', # '&end_offset=10800', basis.url <- sprintf( paste0('https://app.mybasis.com/api/v1/chart/%s.json', '?summary=true', ...
mit
R
ce6d11cbad1f9ea64b6e029a209cfda2983edc81
Update 1.r
glor/R,glor/R
aufgaben/blatt04/1.r
aufgaben/blatt04/1.r
#Blatt 4 #1.1 Runterladen #1.2 hefe = read.table(file="[017]yeast.txt", sep="t", dec=".", header=TRUE) #1.3 boxplot(hefe$content ~ hefe$type, data = hefe, main = "hefe" ) #Keine Normalverteilung, da es in jedem Typ einen Ausreisser gibt #Varianzhomogenitaet, da die Unterschiede zwischen den beiden Boxen no...
#4.2 t.test(formula = hair$length_difference ~ hair$type, var.eqaul = TRUE, alternative = "two.sided", conf.level = 0.95, paired = TRUE)
bsd-2-clause
R
686d108aa977e31c74b8e74f6df73c2d98aab48a
Use relative path to find db
hadley/crantastic,tenforwardconsulting/crantastic,tenforwardconsulting/crantastic,tenforwardconsulting/crantastic,tenforwardconsulting/crantastic,hadley/crantastic,hadley/crantastic
lib/r/db.r
lib/r/db.r
suppressMessages(require(RSQLite, quiet=TRUE)) FILE <- (function() { attr(body(sys.function()), "srcfile") })()$filename PATH <- normalizePath(dirname(FILE)) dbpath <- normalizePath(file.path(PATH, "/../../db/development.sqlite3")) if (exists("db")) dbDisconnect(db) db <- dbConnect(dbDriver("SQLite"), dbname = dbp...
suppressMessages(require(RSQLite, quiet=TRUE)) if (exists("db")) dbDisconnect(db) db <- dbConnect(dbDriver("SQLite"), dbname = "/Users/hadley/Documents/crantastic/db/development.sqlite3") add_version_to_db <- function(pkg) { package.download(pkg) pkg <- package.data(pkg) insert_version(pkg) } insert_version <-...
mit
R
023b83e38a6af5313e5bad44c717380c16093952
Update simds.r
r-glennie/SimDs,r-glennie/SimDs,r-glennie/SimDs
src/simds.r
src/simds.r
# Author: Richard Glennie # 2016 # # Running a distance sampling simulation where animals move library(Rcpp) library(RcppArmadillo) sourceCpp("simds.cc") # set simulation parameters population.size <- 100 region.size <- c(1000, 1000) # simulation assumes all lines are randomly placed # and have same length/width ...
# Author: Richard Glennie # 2016 # # Running a distance sampling simulation where animals move library(Rcpp) library(RcppArmadillo) sourceCpp("simds.cc") # set simulation parameters population.size <- 100 region.size <- c(1000, 1000) # simulation assumes all lines are randomly placed # and have same length/width ...
mit
R
e50561d1fcd9ad6fc5cfbd601520aa155291a900
Bump version to prep for 3.1 alpha
rgchris/ren-c,codebybrett/ren-c,kealist/ren-c,draegtun/ren-c,codebybrett/ren-c,giuliolunati/ren-c,codebybrett/ren-c,mbk/ren-c,kealist/ren-c,hostilefork/rebol,rgchris/ren-c,giuliolunati/ren-c,codebybrett/ren-c,giuliolunati/ren-c,hostilefork/rebol,draegtun/ren-c,rgchris/ren-c,codebybrett/ren-c,mbk/ren-c,hostilefork/rebol...
src/boot/version.r
src/boot/version.r
3.0.90.3.1
3.0.0.3.1
apache-2.0
R
218977e6499a2a8d9df2fc66a94149c7583988fd
Add co-owner.
IndyActuaries/epic-fhir,IndyActuaries/epic-fhir
r/plots.r
r/plots.r
#' ## Code Owners: Kyle Baird, Shea Parkes #' ### OWNERS ATTEST TO THE FOLLOWING: #' * The `master` branch will meet Milliman QRM standards at all times. #' * Deliveries will only be made from code in the `master` branch. #' * Review/Collaboration notes will be captured in Pull Requests (prior to merging). #' #'...
#' ## Code Owners: Kyle Baird #' ### OWNERS ATTEST TO THE FOLLOWING: #' * The `master` branch will meet Milliman QRM standards at all times. #' * Deliveries will only be made from code in the `master` branch. #' * Review/Collaboration notes will be captured in Pull Requests (prior to merging). #' #' #' ### Obje...
mit
R
1833f64ab1a53bde390bd45dd5a276aaa83d8a05
adjust figure width
shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl
lib/scRNA/seurat_group_umap.r
lib/scRNA/seurat_group_umap.r
rm(list=ls()) outFile='AK6383' parSampleFile1='fileList1.txt' parSampleFile2='' parSampleFile3='' parFile1='C:/projects/nobackup/kirabo_lab/shengq2/20220506_6383_scRNA_human/seurat_merge_03_choose_res/result/AK6383.final.rds' parFile2='' parFile3='' setwd('C:/projects/nobackup/kirabo_lab/shengq2/20220506_6383_scRNA_...
rm(list=ls()) outFile='AK6383' parSampleFile1='fileList1.txt' parSampleFile2='' parSampleFile3='' parFile1='C:/projects/nobackup/kirabo_lab/shengq2/20220506_6383_scRNA_human/seurat_merge_03_choose_res/result/AK6383.final.rds' parFile2='' parFile3='' setwd('C:/projects/nobackup/kirabo_lab/shengq2/20220506_6383_scRNA_...
apache-2.0
R
a62faf609a1af3fd9bc0ee4c39f8109b3136e6e4
convert some more functions to arity 1s
syberia/syberia
R/construct_stage_runner.r
R/construct_stage_runner.r
#' Return a stageRunner object that parametrizes a list of stages. #' #' Each stage is first fed through a function that converts it to a stageRunner #' or a function. For example, list(import = X, ...) gets converted by, #' amongst other things, looking for a variable import_stage and passing #' in X. #' #' This kind...
#' Return a stageRunner object that parametrizes a list of stages. #' #' Each stage is first fed through a function that converts it to a stageRunner #' or a function. For example, list(import = X, ...) gets converted by, #' amongst other things, looking for a variable import_stage and passing #' in X. #' #' This kind...
mit
R
d4d355e564685f81a081f8d449e4fd2d213763c6
Update document.
snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3
q3/docs/FormatDateFunction.rd
q3/docs/FormatDateFunction.rd
=begin =@FormatDate String @FormatDate(Time date, String format, Number timezone?) == dateŎw肳ꂽԂformatŎw肳ꂽŃtH[}bg܂B ɂ͔Cӂ̕wł܂A%ɑ񂪎Ԃ̈ꕔɒu܂B :%Y2 񌅂̔Ni:06j :%Y4 l̔Ni:2006j :%M0 񌅂̌i:05j :%M1 3̖̌Oi:Marj :%M2 ̖Oi:Januaryj :%D 񌅂̓i:29j :%W 3̗ji:Monji̎w͌Â`łB%W1gpĂj :%W0 Zji:M, Tuj...
=begin =@FormatDate String @FormatDate(Time date, String format, Number timezone?) == dateŎw肳ꂽԂformatŎw肳ꂽŃtH[}bg܂B ɂ͔Cӂ̕wł܂A%ɑ񂪎Ԃ̈ꕔɒu܂B :%Y2 񌅂̔Ni:06j :%Y4 l̔Ni:2006j :%M0 񌅂̌i:05j :%M1 3̖̌Oi:Marj :%D 񌅂̓i:29j :%W 3̗ji:Monj :%h 24Ԑł̓񌅂̎i:19j :%m 񌅂̕i:34j :%s 񌅂̕bi:02j...
mit
R
cc5377d5609aa7243affeb026f4fdab80060ae47
Check other condition in this test.
davluangu/stagerunner,robertzk/stagerunner,kirillseva/stagerunner,robertzk/stagerunner,syberia/stagerunner,syberia/stagerunner,davluangu/stagerunner
tests/testthat/test-compare_stage_keys.r
tests/testthat/test-compare_stage_keys.r
context('compare_stage_keys') test_that("it gives FALSE when keys are incomparable", { expect_false(compare_stage_keys("1/1", FALSE)) expect_false(compare_stage_keys(FALSE, "1/1")) }) test_that("it gives TRUE when keys are identical", { expect_true(compare_stage_keys(c(FALSE, TRUE), c(FALSE, TRUE))) }) test_th...
context('compare_stage_keys') test_that("it gives FALSE when keys are incomparable", { expect_false(compare_stage_keys("1/1", FALSE)) expect_false(compare_stage_keys(FALSE, "1/1")) }) test_that("it gives TRUE when keys are identical", { expect_true(compare_stage_keys(c(FALSE, TRUE), c(FALSE, TRUE))) }) test_th...
mit
R
13966aa1efccad524c2934885f34eae52e2b5ba7
use is.null instead
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
19da5b4ac0e39412055dae24e68f7dfb1d9cef71
change call for catalog
david-beauchesne/Predict_interactions
Script/1-Similarity_matrix.r
Script/1-Similarity_matrix.r
# ----------------------------------------------------------------------------- # PROJECT: # Evaluating the structure of the communities of the estuary # and gulf of St.Lawrence # ----------------------------------------------------------------------------- # -----------------------------------------------------...
# ----------------------------------------------------------------------------- # PROJECT: # Evaluating the structure of the communities of the estuary # and gulf of St.Lawrence # ----------------------------------------------------------------------------- # -----------------------------------------------------...
mit
R
bfdb1de09607687998ca05393c5d4cf0c017a718
Add an option to embed script without compression
zsx/r3,Pointillistic/rebol-lang,Pointillistic/rebol-lang,Pointillistic/rebol-lang,zsx/r3,zsx/r3,zsx/r3,Pointillistic/rebol-lang
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 windows?: 3 = fourth system/version while [not tail? args] [ arg: first args case [ any [arg = "/rebol" arg = "/r"] [ exe: second args args: next args ] any [arg = "/payload" arg = "/p"] [ payload: seco...
apache-2.0
R
5a779789d5184b9230ced7131be3ea7b678242d8
Add link to all functions
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
29c6c150adfabb737b6d7e0d43257f683f1bf823
更新:第六章fig6-9
shuaimeng/r
thesis/chap6/fig6-9.r
thesis/chap6/fig6-9.r
dyn.load('/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/server/libjvm.dylib') setwd("/Users/mengmengjiang/all datas/voltage") ##raeding datas of flow rates eq<-read.xlsx("voltage.xls",sheetName="ethanol_q",header=TRUE) aq<-read.xlsx("voltage.xls",sheetName="acetone_q",header=TRUE) iq<-read...
dyn.load('/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/server/libjvm.dylib') setwd("/Users/mengmengjiang/all datas/voltage") ##raeding datas of flow rates eq<-read.xlsx("voltage.xls",sheetName="ethanol_q",header=TRUE) aq<-read.xlsx("voltage.xls",sheetName="acetone_q",header=TRUE) iq<-read...
mit
R
b69f8520c8bc8d09ddb003c74ae8e24570d832ad
refactor syberia_models tests to use testthatsomemore
robertzk/syberiaStructure
inst/tests/test-syberia_models.r
inst/tests/test-syberia_models.r
require(testthatsomemore) context('syberia_models') test_that('it can discriminate between directoried and non-directoried models', { within_file_structure(list('syberia.config', models = list(dev = list( model_one = list(model_one.r = 'foo', helper.r = 'bar'), model_two.r = 'blah'))), { models <- c(...
require(testthatsomemore) context('syberia_models') local({ syberia_objects <- force(syberia_objects) stub(syberia_objects, is.syberia_project) <- function(...) TRUE stub(syberia_objects, file.exists) <- function(...) TRUE stub(syberia_objects, syberia_root) <- function(...) '' stub(syberia_models, syberia_o...
mit
R
b8e9bd4aeb673881f5bbf02b4306960f8093b094
check duplidated name
shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl
lib/Annotation/findNearestGene.r
lib/Annotation/findNearestGene.r
options(bitmapType='cairo') library(testit) library(ChIPpeakAnno) genes <- read.table(parFile1, sep="\t", header=F) dup<-genes[duplicated(genes$V4),] dup$V4<-paste0(dup$V4,":",dup$V2) genes[rownames(dup), "V4"] = dup$V4 assert(length(duplicated(genes$V4)) == 0) colnames(genes)<-c("seqnames", "start", "...
options(bitmapType='cairo') library(ChIPpeakAnno) genes <- toGRanges(parFile1, format="BED", skip=1) files<-read.table(parSampleFile1, sep="\t", header=F) res=NULL for (i in c(1:nrow(files))){ file = files[i,1] name = files[i,2] macsOutput <- toGRanges(file, format="BED", skip=1) annotated <- ann...
apache-2.0
R
1f58f30ad28d7e85b8cd9ebbf01c60ae235d13c4
Update complexity.r
lpfgarcia/m2n
measures/complexity.r
measures/complexity.r
# R Code # DCoL Library # Ho and Basu 2002; Ho et al. 2006; and Orriols-Puig et al. 2010 # A set of measures designed to characterize the apparent complexity of data sets require(foreign); cx.name = function(data) { name = paste(".", paste(sample(letters, 20, replace=TRUE), collapse=""), sep=""); write.arff(data, ...
# R Code # DCoL Library # Ho and Basu 2002; Ho et al. 2006; and Orriols-Puig et al. 2010 # A set of measures designed to characterize the apparent complexity of data sets require(foreign); cx.name = function(data) { name = paste(".", paste(sample(letters, 20, replace=TRUE), collapse=""), sep=""); write.arff(data, ...
mit
R
b49c57050f3bf584c05b699da6e78e42e5f99cbd
fix export()
mschubert/clustermq,mschubert/clustermq,mschubert/clustermq
tests/testthat/test-worker.r
tests/testthat/test-worker.r
context("worker") context = rzmq::init.context() socket = rzmq::init.socket(context, "ZMQ_REP") rzmq::bind.socket(socket, "tcp://*:55443") Sys.sleep(0.5) start_worker = function(id="1", url="tcp://localhost:55443") { if (Sys.info()[['sysname']] == "Windows") skip("Forking not available on Windows") p...
context("worker") context = rzmq::init.context() socket = rzmq::init.socket(context, "ZMQ_REP") rzmq::bind.socket(socket, "tcp://*:55443") Sys.sleep(0.5) start_worker = function(id="1", url="tcp://localhost:55443") { if (Sys.info()[['sysname']] == "Windows") skip("Forking not available on Windows") p...
apache-2.0
R
d93ceaa99659f058cba495956ed04cb1b6514cb6
Add some explanation in comments to the script.
thehyve/heim-SmartR,agapow/smartr,thehyve/naa-SmartR,agapow/smartr,thehyve/naa-SmartR,thehyve/naa-SmartR,thehyve/heim-SmartR,thehyve/heim-SmartR,agapow/smartr,agapow/smartr,thehyve/heim-SmartR
web-app/HeimScripts/heatmap/run.r
web-app/HeimScripts/heatmap/run.r
library(jsonlite) library(reshape2) main <- function(){ df <- loaded_variables[[1]] # SmartR does not support multiple HDD nodes yet fields <- buildFields(df) geneSymbols <- unique(fields["GENESYMBOL"])[,1] #[,1] in order to get a vector, otherwise we get a dataframe patientIDs <-unique(fields["PATIENTID"]...
library(jsonlite) library(reshape2) main <- function(){ df <- loaded_variables[[1]] fields <- buildFields(df) geneSymbols <- unique(fields["GENESYMBOL"])[,1] patientIDs <-unique(fields["PATIENTID"])[,1] probes <- unique(fields["PROBE"])[,1] significanceValues <- unique(fields["SIGNIFICANCE"])[,1] ...
apache-2.0
R
c05e57ea79e1a14db5a5fc083f0bf296fa25538f
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
2e2235b1ea2a4dfe8e441296447199dc5f239fdd
Update explorationDF.r
svobodam/Deep-Learning-Text-Summariser,svobodam/Deep-Learning-Text-Summariser,svobodam/Deep-Learning-Text-Summariser
PreProcessingScript/explorationDF.r
PreProcessingScript/explorationDF.r
# Data Frame exploration # Dataset used as .db file to allow managing DF from Python and R. # This script provides only basic exploration of the DF, including nrow(), ncol(), number of topics, number of documents and number summaries. # FUNCTIONS # Dataset preprocessing FUNCTION dfExplore = function(data_frame) { Nu...
# Author: Matej Svoboda # Data Frame exploration # Dataset used as .db file to allow managing DF from Python and R. # This script provides only basic exploration of the DF, including nrow(), ncol(), number of topics, number of documents and number summaries. # FUNCTIONS # Dataset preprocessing FUNCTION dfExplore = fun...
mit
R
b470b5be1029f98b11f005e8acd9dfe6b4f01e2c
Fix main_file bash script path
jmousseau/Stain
R/slurm-bash-script.r
R/slurm-bash-script.r
#' SlurmBashScript R6 object. #' #' Generates the necessary bash script to submit through #' the `sbatch` command. SlurmBashScript <- R6::R6Class("SlurmBashScript", public = list( initialize = function(container, main_file, copy_back = c("*")) { private$write_slurm_script(container$dir) ...
#' 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$write_slurm_script(container$dir) ...
mit
R
0f3a9ef0b30f391a2910f900e00c7316bb9ba8b9
Update FeatureSelection.r
phnmnl/workflow-demo,phnmnl/workflow-demo,phnmnl/workflow-demo,phnmnl/workflow-demo
FeatureSelection/FeatureSelection.r
FeatureSelection/FeatureSelection.r
args <- commandArgs(trailingOnly = TRUE) input = args[1] input2 = args[2] output = args[3] samples<-read.table(input,sep='\t',header=T) cvs<-read.table(input2,sep='\t',header=F) cv = apply(cvs,1,median,na.rm=T) idx = which(cv < 0.3) samples = samples[idx,] write.table(samples,file=output,sep='\t',row.names=F)
args <- commandArgs(trailingOnly = TRUE) input = args[1] path = args[2] output = args[3] setwd(path) samples<-read.table(input,sep='\t',header=T) filenames = list.files(pattern = "*.xls") # remove mebendazole and controls filenames = filenames[-grep("Contr", filenames)] filenames = filenames[-grep("Meben", filenames...
apache-2.0
R
e9f67d79331c566deb585b9f202c87a92c062973
handle contextPath of NA when creating url
RGLab/LabKeyModules,RGLab/LabKeyModules,RGLab/LabKeyModules,RGLab/LabKeyModules,RGLab/LabKeyModules,RGLab/LabKeyModules
HIPCMatrix/pipeline/tasks/create-matrix.r
HIPCMatrix/pipeline/tasks/create-matrix.r
library(data.table) library(Rlabkey) library(affy) # NOTE: Affy will implicitly try to load bioc packages "hthgu133pluspmcdf" and "AnnotationDbi" # but that won't work in an RServe enviornment if they haven't been installed yet. # So we try to load the library early so they will fail if not installed. library(hthgu133...
library(data.table) library(Rlabkey) library(affy) # NOTE: also requires bioc packages: "hthgu133pluspmcdf" and "AnnotationDbi" # read the job info jobInfo <- read.table("${pipeline, taskInfo}", col.names=c("name", "value", "type"), header=FALSE, check.names=FALSE, ...
artistic-2.0
R
b1c6ffcdff975f141e15783e2bb4bf6f7ba7635d
Fix dataframe retrieval from loaded_variables
thehyve/naa-SmartR,thehyve/heim-SmartR,thehyve/heim-SmartR,agapow/smartr,thehyve/naa-SmartR,agapow/smartr,agapow/smartr,agapow/smartr,thehyve/heim-SmartR,thehyve/naa-SmartR,thehyve/heim-SmartR
web-app/HeimScripts/heatmap/run.r
web-app/HeimScripts/heatmap/run.r
library(gplots) dataset <- loaded_variables[[1]] #dataframe with columns: Row.Label, Bio.marker, ASSAY_0001 ASSAY_0002 ... measurements <- subset(dataset,select=-c(Row.Label,Bio.marker)) # this will select all columns other than Probe and Biomarker columns measurements <- data.matrix(measurements) measurements <- ...
#global_register <-list(rowNames = c("a","b"), # columnNames = c("1","2"), # origin = c(1,2), # data = matrix(c(35,700),nrow=2,ncol=2) # ) library(gplots) # This script expects global_register to be populated before execution # see...
apache-2.0
R
9df43421e8591f0240bd4f0ad3f510df0236a012
Update rel_acclimatized.r
alfcrisci/rBiometeo,alfcrisci/rBiometeo
R/rel_acclimatized.r
R/rel_acclimatized.r
#' rel_acclimatized #' #' Calculate treshshold of risk realated to wbgt index for acclimatized people #' #' @param met numeric Metabolic rate in Watt following level of ISO FDIS 7243.# #' @return REL #' #' @author Istituto per la Bioeconomia CNR Firenze Italy Alfonso Crisci \email{alfonso.crisci@@ibe.cnr.it} #' @refer...
#' rel_acclimatized #' #' Calculate treshshold of risk realated to wbgt index for acclimatized people #' #' @param met numeric Metabolic rate in w/mq following level of ISO FDIS 7243.# #' @return REL #' #' @author Istituto per la Bioeconomia CNR Firenze Italy Alfonso Crisci \email{alfonso.crisci@@ibe.cnr.it} #' @refer...
mit
R
9ae9e9a9d0f3f49a1c07279b85248d8269d2fd2c
Bump version for 3.1 beta
kealist/ren-c,hostilefork/rebol,hostilefork/rebol,giuliolunati/ren-c,mbk/ren-c,rgchris/ren-c,codebybrett/ren-c,rgchris/ren-c,hostilefork/rebol,giuliolunati/ren-c,giuliolunati/ren-c,mbk/ren-c,giuliolunati/ren-c,kealist/ren-c,codebybrett/ren-c,hostilefork/rebol,rgchris/ren-c,mbk/ren-c,kealist/ren-c,codebybrett/ren-c,drae...
src/boot/version.r
src/boot/version.r
3.0.91.3.1
3.0.90.3.1
apache-2.0
R
bb00c8156b6312f54fa75a8391ed4af609f6d8b7
Rename variable
mattm/active-user-cohort-analysis
active-users.r
active-users.r
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...
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
992727d0911d43f206e7a901b6e141e58d9467ad
Clean up sample patient code, add severity line.
pschulam-attic/sclero
demo/patient-sample.r
demo/patient-sample.r
require(sclero) require(ggplot2) require(plyr) data(pft) data(patient) set.seed(1) df <- add_date_since(pft, "date", "year", patient, "date.of.first.symptom") n.train.visits <- ddply(subset(df, year >= 0 & year < 2), ~ patient.id + test.type, summarize, visits = length(na.omit(test.result))) n.test.visits <- ddply(s...
require(sclero) require(ggplot2) require(plyr) data(pft) data(patient) set.seed(2) n.visits <- ddply(pft, ~ patient.id + test.type, summarize, visits = length(na.omit(test.result))) n.fvc.visits <- subset(n.visits, test.type == "fvc") patient.ids <- subset(n.fvc.visits, visits > 5)$patient.id some.patients <- samp...
mit
R
4849167cc21f4e7f59e209e7de3f225255aa7060
Fix redundant unload in old test
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 disa...
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 disa...
apache-2.0
R
c11a42f00bf48aaace737eebc30f682dfe9af2a4
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
6f87630171e840e44fd37509f5fb65089ad5ed98
Update ggplot2_formatter.r
jezdata/R,fdryan/R,1R151-1/R
ggplot2_formatter.r
ggplot2_formatter.r
require(scales) # --------------------------------------------------------------------------------------------- # Formatting functions for ggplot graph axis # --------------------------------------------------------------------------------------------- #' Human Numbers: Format numbers so they're legible for humans ...
require(scales) # --------------------------------------------------------------------------------------------- # Formatting functions for ggplot graph axis # --------------------------------------------------------------------------------------------- #' Human Numbers: Format numbers so they're legible for humans ...
unlicense
R
97197ec0b006b788e92ab4494c005346fa252af8
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),...
# This is the user-interface definition of a Shiny web application. # You can find out more about building applications with Shiny here: # # http://www.rstudio.com/shiny/ # library(shiny) shinyUI(fluidPage( plotOutput("prvi_graf"), tableOutput("napoved.tabela"), plotOutput("enajsti_graf")))
mit
R
fa70ca2923f3c1faf3e6e9166958e118f0e5dcf5
Add missing rdname
klmr/modules,klmr/modules
R/export_submodule.r
R/export_submodule.r
#' Export a given submodule from the current module #' #' @param submodule character string of length 1 with the name of the submodule #' @note Sometimes, a module may want to export all or some of its submodules in #' bulk. Simply doing \code{import('submodule', attach = TRUE)} won’t work, #' however, since \code{atta...
#' Export a given submodule from the current module #' #' @param submodule character string of length 1 with the name of the submodule #' @note Sometimes, a module may want to export all or some of its submodules in #' bulk. Simply doing \code{import('submodule', attach = TRUE)} won’t work, #' however, since \code{atta...
apache-2.0
R
9b730e7ed447e170ca3c8523b23945905476240c
Remove ,
raviqqe/tisp,raviqqe/tisp,tisp-lang/tisp,tisp-lang/tisp,raviqqe/tisp
examples/args.r
examples/args.r
; . after ..args is not necessary. But it can be forced for readability. (def (func x1 x2 (x3 123) (x4 456) ..args . y1 (y2 123) y3 (y4 456) ..kwargs) (+ x1 x2 x3 x4)) (func 1 2 3 ..[1 "foo" "bar"] . y1 123 y3 456 foo 2049 ..{"y4" 123 "y6" 456})
; . after ..args is not necessary. But, it can be forced for readability. (def (func x1 x2 (x3 123) (x4 456) ..args . y1 (y2 123) y3 (y4 456) ..kwargs) (+ x1 x2 x3 x4)) (func 1 2 3 ..[1 "foo" "bar"] . y1 123 y3 456 foo 2049 ..{"y4" 123 "y6" 456})
mit
R
7ae0d3fcad073998860602590ea678c4cfc9b245
Update test.r
snowch/biginsight-examples,snowch/biginsight-examples
examples/BigR/test.r
examples/BigR/test.r
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...
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
e28e36c6b818b653a711ca8a96aabef0585c0239
add hint to ignore error msg
mschubert/clustermq,mschubert/clustermq,mschubert/clustermq
tests/testthat/test-work_chunk.r
tests/testthat/test-work_chunk.r
context("work_chunk") df = as.data.frame(tibble::data_frame( a = 1:3, b = as.list(letters[1:3]), c = setNames(as.list(3:1), letters[1:3]) )) test_that("data types and arg names", { fx = function(c, a, b) a + c expect_equal(work_chunk(df, fx), as.list(rep(4,3))) }) test_that("check call classes", ...
context("work_chunk") df = as.data.frame(tibble::data_frame( a = 1:3, b = as.list(letters[1:3]), c = setNames(as.list(3:1), letters[1:3]) )) test_that("data types and arg names", { fx = function(c, a, b) a + c expect_equal(work_chunk(df, fx), as.list(rep(4,3))) }) test_that("check call classes", ...
apache-2.0
R
a8af0dbd6bce34fbefab649ae7587551b2cb7e50
use 1 thread in tests
wrathematics/sylcount,wrathematics/sylcount,wrathematics/sylcount
Rpkg/tests/degenerate_cases.r
Rpkg/tests/degenerate_cases.r
library(sylcount) test = readability("", nthreads=1) truth = data.frame( chars = 0L, wordchars = 0L, words = 0L, nonwords = 0L, sents = 0L, sylls = 0L, polys = 0L, re = NaN, gl = NaN, ari = NA_integer_, smog = NaN, cl = NaN ) stopifnot(identical(test, truth)) test = doc_counts("", nthreads...
library(sylcount) test = readability("") truth = data.frame( chars = 0L, wordchars = 0L, words = 0L, nonwords = 0L, sents = 0L, sylls = 0L, polys = 0L, re = NaN, gl = NaN, ari = NA_integer_, smog = NaN, cl = NaN ) stopifnot(identical(test, truth)) test = doc_counts("") truth = truth[, 1:7]...
bsd-2-clause
R
0882d0e6212597be4d3d4476cf86202ab38f4d5c
Use GET-WORD on TRY wrapper for handler
kealist/ren-c,rgchris/ren-c,rgchris/ren-c,rgchris/ren-c,hostilefork/rebol,hostilefork/rebol,draegtun/ren-c,hostilefork/rebol,giuliolunati/ren-c,giuliolunati/ren-c,codebybrett/ren-c,kealist/ren-c,draegtun/ren-c,giuliolunati/ren-c,codebybrett/ren-c,hostilefork/rebol,kealist/ren-c,rgchris/ren-c,hostilefork/rebol,codebybre...
src/mezz/mezz-legacy.r
src/mezz/mezz-legacy.r
REBOL [ System: "REBOL [R3] Language Interpreter and Run-time Environment" Title: "REBOL 3 Mezzanine: Legacy compatibility" Rights: { Copyright 1997-2015 REBOL Technologies Copyright 2012-2015 Rebol Open Source Contributors REBOL is a trademark of REBOL Technologies } License: { Licensed under the Apache ...
REBOL [ System: "REBOL [R3] Language Interpreter and Run-time Environment" Title: "REBOL 3 Mezzanine: Legacy compatibility" Rights: { Copyright 1997-2015 REBOL Technologies Copyright 2012-2015 Rebol Open Source Contributors REBOL is a trademark of REBOL Technologies } License: { Licensed under the Apache ...
apache-2.0
R
d62e7e3b479781182c1a756697bc734e4a690b04
Adjust test import paths
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('./modules/nested/relative_a') expect_that(ra$a_which(), equals('/a')) }) test_that('Relative import are always local', { ra = import('./modules/nested/relative_a') expect_that(ra$local_a_which(), equals('neste...
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')) })
apache-2.0
R
2eb7f47c7adf7552d511455733dd70491b37eb71
fix paste
mynameisvinn/rstae
R/util.r
R/util.r
#' @export test1 <- function(woof){ print(woof) } #' @export fetch_trips <-function(municipalId){ uri = paste("https://municipal.systems/v1/municipalities/", municipalId, "/trips", sep="") r <- GET(uri) e = content(r)$results f = as.data.frame(do.call(rbind, e)) f }
#' @export test <- function(woof){ print(woof) } #' @export fetch_trips <-function(municipalId){ uri = paste("https://municipal.systems/v1/municipalities/", municipalId, "/trips", sep="") r <- GET(uri) e = content(r)$results f = as.data.frame(do.call(rbind, e)) f }
mit
R
5cf510c1f6b46c28ac8a744266de999831eaea85
Update 1.r
glor/R,glor/R
aufgaben/blatt03/1.r
aufgaben/blatt03/1.r
#Blatt 3 #1.1 Datei lokal speichern #1.2 maeuse = read.table(file="mice.txt", sep="t", dec=".", header=TRUE) #1.3 boxplot(maeuse$speed ~ maeuse$health, date = maeuse, main = "kranke Maeuse" ) # Beide Gruppen sind normalverteilt, es gibt keine Aussreisser. (diese wuerden als Punkte ausserhalb der Boxen darge...
#Blatt 3 #1.1 Datei lokal speichern #1.2 maeuse = read.table(file="mice.txt", sep="t", dec=".", header=TRUE) #1.3 boxplot(maeuse$speed ~ maeuse$health, date = maeuse, main = "kranke Maeuse" ) # Beide Gruppen sind normalverteilt, es gibt keine Aussreisser. (diese wuerden als Punkte ausserhalb der Boxen darge...
bsd-2-clause
R
3e522d8e20094a1e08d4dd30554fffad32f858f9
Update extracterDB.r
svobodam/Deep-Learning-Text-Summariser,svobodam/Deep-Learning-Text-Summariser,svobodam/Deep-Learning-Text-Summariser
PreProcessingScript/extracterDB.r
PreProcessingScript/extracterDB.r
# Data Frame extraction. # Extract data from Documents and document summaries into new subset and prepare them for extarction to table in DB. # Extract Documents from df > dfData counter = 1 while(counter <= 25){ for (m in doc) { if ((exists("dfData"))==TRUE) { dfEdit=data.frame(with(df, paste0(df[[m]])), ...
# Data Frame exploration. # Extract data from Documents and document summaries into new subset and prepare them for extarction to table in DB. # Extract Documents from df > dfData counter = 1 while(counter <= 25){ for (m in doc) { if ((exists("dfData"))==TRUE) { dfEdit=data.frame(with(df, paste0(df[[m]])),...
mit
R
bb8fc1d4994cf01cafba1164c631f201c60fc1c9
check plotting routines transtion dates
khufkens/phenocamr
tests/testthat/test_ancillary_functions.r
tests/testthat/test_ancillary_functions.r
# Phenocamr unit tests # ancillary functions test_that("check ancillary routines",{ # download initial data df = try(download_phenocam(site = "harvard$", vegetation = "DB", roi_id = "1", frequency = 3, outlier_de...
# Phenocamr unit tests # ancillary functions test_that("check ancillary routines",{ # download initial data df = try(download_phenocam(site = "harvard$", vegetation = "DB", roi_id = "1", frequency = 3, outlier_de...
agpl-3.0
R
5945b00302271b9fec7e12db1d69fd8af16a8007
Fix bug in explore deciles
hadley/sfhousing,hadley/sfhousing,hadley/sfhousing
explore-deciles.r
explore-deciles.r
# Explore the difference between the cheapest and most expensive houses library(ggplot2) source("date.r") source("explore-data.r") # Calculate monthly deciles midmonth <- function(date) { mday(date) <- 15 date } deciles <- ddply(geo, .(date = midmonth(date)), summarise, decile = seq_len(9), value = quantile(...
# library(ggplot2) # source("date.r") # source("explore-data.r") # # Explore the difference between the cheapest and most expensive houses # Calculate monthly deciles midmonth <- function(date) { mday(date) <- 15 date } deciles <- ddply(geo, .(date = midmonth(date)), function(df) { data.frame( decile = seq...
mit
R
ead0230a9e704e4576f8069e49a31cc9639d0911
Make TO-REFINEMENT an alias for TO-PATH
hostilefork/rebol,hostilefork/rebol,giuliolunati/ren-c,draegtun/ren-c,rgchris/ren-c,rgchris/ren-c,hostilefork/rebol,hostilefork/rebol,giuliolunati/ren-c,hostilefork/rebol,giuliolunati/ren-c,draegtun/ren-c,giuliolunati/ren-c,rgchris/ren-c,draegtun/ren-c,giuliolunati/ren-c,rgchris/ren-c,draegtun/ren-c,rgchris/ren-c,draeg...
src/mezz/mezz-types.r
src/mezz/mezz-types.r
REBOL [ System: "REBOL [R3] Language Interpreter and Run-time Environment" Title: "REBOL 3 Mezzanine: To-Type Helpers" Rights: { Copyright 2012 REBOL Technologies REBOL is a trademark of REBOL Technologies } License: { Licensed under the Apache License, Version 2.0 Se...
REBOL [ System: "REBOL [R3] Language Interpreter and Run-time Environment" Title: "REBOL 3 Mezzanine: To-Type Helpers" Rights: { Copyright 2012 REBOL Technologies REBOL is a trademark of REBOL Technologies } License: { Licensed under the Apache License, Version 2.0 Se...
apache-2.0
R
3580b5ef7930ea6e36d92fa6ad7472f41ed4728c
Update heat_risk_level.r
alfcrisci/rBiometeo,alfcrisci/rBiometeo
R/heat_risk_level.r
R/heat_risk_level.r
#' heat_risk_level #' #' Calculate the heat risk level for worker as four classes level. #' #' @param wbgt numeric Wetbulb globe temperature index in degC #' @param cav numeric Clothing adjusted value due to worker clothing ensemble #' @param tresh numeric treshshold for heat risk in degC ( RAL or REL) #' #' @return nu...
#' heat_risk_level #' #' Calculate the heat risk level for worker as four classes level. #' #' @param wbgt numeric Wetbulb globe temperature index in degC #' @param cav numeric Clothing adjusted value due to worker clothing ensemble #' @param tresh numeric treshshold for heat risk in degC ( RAL or REL) #' #' @return nu...
mit
R
077117f0b4215eb1e779a93e3fd6d214aebecd12
Normalize angles from start angle
gadomski/rivlib-utils
scripts/chart-inclinations.r
scripts/chart-inclinations.r
library(ggplot2) library(reshape2) filenames <- c( "Zuma/140117_160540_inclinations.txt", "Zuma/140117_163141_inclinations.txt", "Zuma/140123_202748_inclinations.txt", "Zuma/140201_185848_inclinations.txt", "Zuma/140226_163837_inclinations.txt"...
library(ggplot2) library(reshape2) filenames <- c("Zuma/140123_202748_inclinations.txt", "Zuma/140201_185848_inclinations.txt", "Zuma/140226_163837_inclinations.txt", "EastWall/140123_180026_inclination.txt", "EastWall/140201_205741_inclination.txt") plotInc...
mit
R
8c946cba3b17c600d4f9b1972082ad6ab0d0f096
Update the document about ViewNextMessagePageAction.
snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3
q3/docs/ViewNextMessagePageAction.rd
q3/docs/ViewNextMessagePageAction.rd
=begin =ViewNextMessagePageANV ݕ\Ă郁bZ[W̃y[WɃXN[܂BłɍŌ܂ŃXN[Ăꍇɂ́A((<ViewNextMessageANV|URL:ViewNextMessageAction.html>))ƓlɐU܂BA((<[IvV][̑]pl|URL:OptionMisc.html>))[Ō܂ŃXN[玟̖ǂ\]Ƀ`FbNĂꍇɂ́A((<ViewNextUnseenMessageANV|URL:ViewNextUnseenMessageAction.html>))ƓlɐU܂B == Ȃ ==LȃEBhEEr[ *Xgr[ *vr[ *bZ[WEBhE =end ...
=begin =ViewNextMessagePageANV ݕ\Ă郁bZ[W̃y[WɃXN[܂BłɍŌ܂ŃXN[Ăꍇɂ́A((<ViewNextMessageANV|URL:ViewNextMessageAction.html>))ƓlɐU܂B == Ȃ ==LȃEBhEEr[ *Xgr[ *vr[ *bZ[WEBhE =end
mit
R
a47135a5ee0e7ba79f9975f35b35488f11fcfa51
Fix typos in print-test.r
NikolayShubenkovProgSchool/red,red-eco/red,rheber/red,rheber/red,vehar/red,vehar/red,NikolayShubenkovProgSchool/red,red-eco/red
tests/source/compiler/print-test.r
tests/source/compiler/print-test.r
REBOL [ Title: "Red print test script" Author: "Peter W A Wood" File: %print-test.r Tabs: 4 Rights: "Copyright (C) 2011-2012 Peter W A Wood. All rights reserved." License: "BSD-3 - https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt" ] ~~~start-file~~~ "Red print" --test-- "Red print 1" ...
REBOL [ Title: "Red print test script" Author: "Peter W A Wood" File: %print-test.r Tabs: 4 Rights: "Copyright (C) 2011-2012 Peter W A Wood. All rights reserved." License: "BSD-3 - https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt" ] ~~~start-file~~~ "Red print" --test-- "Red print 1" ...
bsd-3-clause
R
568d54ff5f08bccbefc475cdcdb962b1fe356688
remove argument name left in by mistake
markdunning/galaxy-fgsea
fgsea.r
fgsea.r
options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } ) # we need that to not crash galaxy with an UTF8 error on German LC settings. loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") suppressPackageStartupMessages({ library("fgsea") library("optparse") }) ...
options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } ) # we need that to not crash galaxy with an UTF8 error on German LC settings. loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8") suppressPackageStartupMessages({ library("fgsea") library("optparse") }) ...
mit
R
0358fd6f0def2dcaa7e9bbb94df1c85e349a1819
Remove errant comma
jkarl/LandscapeToolbox,jkarl/LandscapeToolbox,jkarl/LandscapeToolbox
package_installation.r
package_installation.r
############################################### ### COMMONLY USED PACKAGES IN AIM R SCRIPTS ### ############################################### #### DATA WRANGLING #### install.packages( c( "dplyr", ## Notably useful for data frame manipulation with group_by(), summarize(), and mutate() and the piping operator %...
############################################### ### COMMONLY USED PACKAGES IN AIM R SCRIPTS ### ############################################### #### DATA WRANGLING #### install.packages( c( "dplyr", ## Notably useful for data frame manipulation with group_by(), summarize(), and mutate() and the piping operator %...
cc0-1.0
R
0610e9ce90da5d49327aebc2a2b77acadf760e9d
set repo earlier
rdatsci/travis-r-tools
update-packages.r
update-packages.r
# updates all outdated packages # in contrast to 'update.packages()' this will also update # packages in the system lib by 'overloading' these packages # with an installation to the user lib options(repos = "http://cran.rstudio.com") tryCatch({ cat("Searching for outdated packages ...\n", file = stdout()) getPkgs ...
# updates all outdated packages # in contrast to 'update.packages()' this will also update # packages in the system lib by 'overloading' these packages # with an installation to the user lib tryCatch({ cat("Searching for outdated packages ...\n", file = stdout()) getPkgs = function(x) if (is.null(x)) character(0L) ...
bsd-2-clause
R
48c2d71d911937975e7d62514b694c8aae6f78d6
add useDynLib:
snoweye/pbdDEMO,wrathematics/pbdDEMO,wrathematics/pbdDEMO,RBigData/pbdDEMO,RBigData/pbdDEMO,snoweye/pbdDEMO,snoweye/pbdDEMO,RBigData/pbdDEMO,wrathematics/pbdDEMO
R/pbdDEMO-package.r
R/pbdDEMO-package.r
#' Demonstrations and Examples for the pbd Project #' #' Demos #' #' \tabular{ll}{ Package: \tab pbdDMAC\cr Type: \tab Package\cr License: \tab #' GPL\cr LazyLoad: \tab yes\cr } This package requires an MPI library #' (OpenMPI, MPICH2, or LAM/MPI). #' #' @import methods, pbdMPI, pbdBASE, pbdDMAT #' @useDynLib pbdDEM...
#' Demonstrations and Examples for the pbd Project #' #' Demos #' #' \tabular{ll}{ Package: \tab pbdDMAC\cr Type: \tab Package\cr License: \tab #' GPL\cr LazyLoad: \tab yes\cr } This package requires an MPI library #' (OpenMPI, MPICH2, or LAM/MPI). #' #' @name pbdDEMO-package #' @docType package #' @author Drew Schm...
mpl-2.0
R
7146d57b72ae542b2ac69e3a39a249438fea89a3
Add codacy badge
Exsul/endpoint,Exsul/endpoint,Exsul/endpoint,Exsul/endpoint
README.rd
README.rd
[![Codacy Badge](https://api.codacy.com/project/badge/grade/cd133d34a2784af4851be58ccc50bcca)](https://www.codacy.com/app/enelar/bootstrap) Self-documented preconfigured enviroment, created to achieve best possible framework first experiense. You could see live example at https://phoxy-bootstrap.appspot.com/
Self-documented preconfigured enviroment, created to achieve best possible framework first experiense. You could see live example at https://phoxy-bootstrap.appspot.com/
apache-2.0
R
f7f4dd83b5ecfe300c4725533d60c446b5c8de3f
Add notes
Upward-Spiral-Science/the-fat-boys,Upward-Spiral-Science/the-fat-boys
code/covarianceMatrix.r
code/covarianceMatrix.r
#Displays the covariance matrix covarianceMatrix <- function(data){ require(reshape) require(ggplot2) require(naturalsort) temp <- cov(data,data) temp <- melt(temp) levels(temp[,1]) <- naturalsort(levels(temp[,1])) levels(temp[,2]) <- naturalsort(levels(temp[,2])) temp = temp[naturalorder(temp[,1]),] for...
#Displays the covariance matrix covarianceMatrix <- function(data){ require(reshape) require(ggplot2) require(naturalsort) temp <- cov(data,data) temp <- melt(temp) levels(temp[,1]) <- naturalsort(levels(temp[,1])) levels(temp[,2]) <- naturalsort(levels(temp[,2])) temp = temp[naturalorder(temp[,1]),] for...
apache-2.0
R
71fe06dc44774d83f8a5746c4d9142232a2d4fc2
check file existance
shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl
lib/eQTL/MatrixEQTL.r
lib/eQTL/MatrixEQTL.r
library("MatrixEQTL") args = commandArgs(trailingOnly=TRUE) snp_genotype_file=args[1] snp_location_file=args[2] gene_expression_file=args[3] gene_location_file=args[4] output_cis_file=args[5] output_trans_file=args[6] cat("snp_genotype_file=", snp_genotype_file, "\n") cat("snp_location_file=", snp_location_file, "\n...
library("MatrixEQTL") args = commandArgs(trailingOnly=TRUE) snp_genotype_file=args[1] snp_location_file=args[2] gene_expression_file=args[3] gene_location_file=args[4] output_cis_file=args[5] output_trans_file=args[6] cat("snp_genotype_file=", snp_genotype_file, "\n") cat("snp_location_file=", snp_location_file, "\n...
apache-2.0
R
c5b498b005e6fc3964942f19f07a46372272c011
Add cachlines accessed to qwords plot.
danluu/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel
src/Scripts/plot-qwords.r
src/Scripts/plot-qwords.r
library("ggplot2") library("reshape") setwd("~/dev/BitFunnel/src/Scripts") queries <- read.csv(header=TRUE, file="/tmp/QueryPipelineStatistics.csv") pos = seq(1, length(queries$quadwords)) df_temp <- data.frame(pos, queries$quadwords, queries$cachelines) df <- melt(df_temp, id=c("pos")) png(filename="qwords.png",wid...
library("ggplot2") setwd("~/dev/BitFunnel/src/Scripts") png(filename="qwords.png",width=1600,height=1200) queries <- read.csv(header=TRUE, file="/tmp/QueryPipelineStatistics.csv") pos = seq(1, length(queries$quadwords)) df <- data.frame(pos, queries$quadwords) ggplot(df, aes(x=pos,y=queries.quadwords)) + theme_bw() +...
mit
R
b6ad031b8b16ab7ffeb897bbfbb25aa9bc83422b
use a global fetch here to allow other packages to intercept loading from source
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 <- suppressWarnings(base::normalizePath( paste(current_directory(), "/", dep, sep ...
#' 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 <- suppressWarnings(base::normalizePath( paste(current_directory(), "/", dep, sep ...
mit
R
5949f53956f66ba861d4fa929be594893e8d2643
Add some plot parameters
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", main = "Google Analytics", ylim = c(0, 200)) ...
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") })
unlicense
R
4611c2c1aef28936718d34712557d1ad645f85a8
Use application/json over text/json.
robertzk/microserver,robertzk/microserver
R/response.r
R/response.r
#' Simple S3 class to denote JSON responses for httupv. #' #' @param response ANY. The R object to send as a response parameter. #' If the header is set to application/json it will be converted into a JSON string. #' #' @param status integer. HTTP status (default is \code{200}). #' @param headers list. A list of HTTP h...
#' Simple S3 class to denote JSON responses for httupv. #' #' @param response ANY. The R object to send as a response parameter. #' If the header is set to text/json it will be converted into a JSON string. #' #' @param status integer. HTTP status (default is \code{200}). #' @param headers list. A list of HTTP headers ...
mit
R
f4957db1d456dfdc64b91e07b227586b227828a1
Update onLoad.r
alfcrisci/rBiometeo,alfcrisci/rBiometeo
R/onLoad.r
R/onLoad.r
#' .onLoad #' #' @importFrom V8 new_context ct <- NULL .onLoad <- function(libname, pkgname){ ct <<- V8::new_context() ct$source(system.file("js/biometeo.js", package = pkgname)) }
#' .onLoad #' #' @importFrom V8 new_context ct <- NULL .onLoad <- function(libname, pkgname){ ct <<- V8::v8() ct$source(system.file("inst/js/biometeo.js", package = pkgname)) }
mit
R
bb69a13f5f7c7aeae8958f2ec0e49df2ac7733d7
Update test file name to account for new test data path
mattm/active-user-cohort-analysis
analysis.r
analysis.r
PlotActiveUserCohorts <- function(data) { #cohortData <- read.csv("2010-cohorts.csv") # Convert the sign up month cohorts ("2015-01", etc) to # dates so they can be used in in the ggplot below data$signed.up <- as.Date(paste(data$signed.up, "-01", sep = "")) graph <- ggplot(data, aes(x = signed.up, y = active.u...
PlotActiveUserCohorts <- function(data) { #cohortData <- read.csv("2010-cohorts.csv") # Convert the sign up month cohorts ("2015-01", etc) to # dates so they can be used in in the ggplot below data$signed.up <- as.Date(paste(data$signed.up, "-01", sep = "")) graph <- ggplot(data, aes(x = signed.up, y = active.u...
mit
R
33f497d488df9917ee8d992f6ee0ed93badd917c
Implement calculation of Ws
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), ecoli = c(0, 0, 0, 0, 0.41, 0.28, 0.9999, 0.68, 0.89)) get_s = function (species) if (species %in% names(s)) s[[species]] else s$naive # Reverse complement of the anticodons, in the order of antico...
# 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), ecoli = c(0, 0, 0, 0, 0.41, 0.28, 0.9999, 0.68, 0.89)) get_s = function (species) if (species %in% names(s)) s[[species]] else s$naive # Reverse complement of the anticodons, in the order of antico...
apache-2.0
R
3a9b2b4027f7310959f94a6b607ad5c24457159f
Update analiza.r
Anchiqua/APPR-2015-16
analiza/analiza.r
analiza/analiza.r
# 4. faza: Analiza podatkov #naredimo skupine za države glede na število igralcev in točk tabela5 <- inner_join(tabela3, tabela2) rownames(tabela5) <- tabela5$drzava tabela5.norm <- tabela5 %>% select(-drzava) %>% scale() k1 <- kmeans(tabela5.norm, 3) #head(k$cluster, n = 15, nstart=1000) table(k$cluster) k1 <- km...
# 4. faza: Analiza podatkov #naredimo skupine za države glede na število igralcev in točk tabela4 <- inner_join(tabela3, tabela2) rownames(tabela4) <- tabela4$drzava tabela4.norm <- tabela4 %>% select(-drzava) %>% scale() k1 <- kmeans(tabela4.norm, 5) #head(k$cluster, n = 15, nstart=1000) table(k$cluster) k1 <- km...
mit
R
389ffa875709f49836da59f73b1879bafe802e1f
Add square root to calculation
GreatEmerald/geoscripting,GreatEmerald/geoscripting,GreatEmerald/geoscripting,GreatEmerald/geoscripting
Lesson8/src/RMSE.r
Lesson8/src/RMSE.r
# Team Rython, Dainius Masiliunas and Tim Weerman # Date: 11 January, 2016 # Apache License 2.0 # Calculate the Root Mean Squared Error RMSE = function(truth, prediction) { return(sqrt(mean((truth-prediction)^2, na.rm=TRUE))) } # Calculate partial RMSE for different zones by generating squared difference rasters....
# Team Rython, Dainius Masiliunas and Tim Weerman # Date: 11 January, 2016 # Apache License 2.0 # Calculate the Root Mean Squared Error RMSE = function(truth, prediction) { return(sqrt(mean((truth-prediction)^2, na.rm=TRUE))) } # Calculate partial RMSE for different zones by generating squared difference rasters....
apache-2.0
R
c8cf3c12758d45a31a23a7ae4cbe91b3939a6504
Add missing mouse contrasts
klmr/codons,klmr/codons
config_mouse.r
config_mouse.r
species = 'mouse' trna_counts = './data/trna-counts-mm10.tsv' mrna_counts = './data/rnaseq-counts-mm10.tsv' trna_annotation = './data/tRNA_Scan_Mus_musculus.GRCm38.69_301014.filtered.out' mrna_annotation = './data/Mus_musculus.GRCm38.75.gene_annot.tsv' cds = './data/Mus_musculus.GRCm38.cds.all.fa.gz' trna_design = './d...
species = 'mouse' trna_counts = './data/trna-counts-mm10.tsv' mrna_counts = './data/rnaseq-counts-mm10.tsv' trna_annotation = './data/tRNA_Scan_Mus_musculus.GRCm38.69_301014.filtered.out' mrna_annotation = './data/Mus_musculus.GRCm38.75.gene_annot.tsv' cds = './data/Mus_musculus.GRCm38.cds.all.fa.gz' trna_design = './d...
apache-2.0
R
d412b2418c89f41c5fc1d3fae4f925bc8160c179
Update es.r
alfcrisci/rBiometeo,alfcrisci/rBiometeo
R/es.r
R/es.r
#' es #' #'Given a temperature Celsius value give Vapor Pressure in hPa. Hardy, R.; ITS-90 Formulations for Vapor Pressure, Frostpoint #' Temperature, Dewpoint Temperature and Enhancement Factors in the Range -100 to 100 degC; #' #' #' @param numeric t Air temperature in Celsius degrees. #' @return Saturation Vapor P...
#' es #' #'Given a temperature Celsius value give Vapor Pressure in hPa. Hardy, R.; ITS-90 Formulations for Vapor Pressure, Frostpoint #' Temperature, Dewpoint Temperature and Enhancement Factors in the Range -100 to 100 degC; #' #' #' @param numeric t Air temperature in Celsius degrees. #' @return Saturation Vapor P...
mit
R
11d1385f4dd5a5053eeda9b58bbdbdfc9367ed52
Comment der
smehan/App-data-reqs,smehan/App-data-reqs
plot.r
plot.r
########################################################### Plot.r is a class that reads in a cleaned csv from source data and performs some pre-processing. It then creates some plots mainly slicing on Assignee, Calendar duration, created year and month (which are calculated values) ###################...
*********************************************************** Plot.r is a class that reads in a cleaned csv from source data and performs some pre-processing. It then creates some plots mainly slicing on Assignee, Calendar duration, created year and month (which are calculated values) *******************...
apache-2.0
R
e40eca95ca7894bc66c4b2e4cfadd2944f785697
check clinical data for mafreport
shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl
lib/Annotation/mafReport.r
lib/Annotation/mafReport.r
rm(list=ls()) outFile='' parSampleFile1='fileList1.txt' parSampleFile2='' parSampleFile3='' parFile1='/home/shengq2/program/projects/breast_cancer_spore/20220713_wgs/BRE15136_Summary_21Oct2021_correctedv5.csv' parFile2='' parFile3='' clinicalFeatures='ARM,CBR_6,TNBCtype_4,TIL_call,PDL1_IHC_Agg,BMI_CLASS,diabetes';geno...
rm(list=ls()) outFile='' parSampleFile1='fileList1.txt' parSampleFile2='' parSampleFile3='' parFile1='' parFile2='' parFile3='' genome='hg38' setwd('/scratch/cqs/breast_cancer_spore/analysis/all/gatk4_13_report/result') ### Parameter setting end ### library(mafreport) #https://github.com/PoisonAlien/maftools/issue...
apache-2.0
R
a3bbe5668894a13d6ec8b076f3876f09cd41b901
add a newline
syberia/syberia
inst/tests/test-data_stage.r
inst/tests/test-data_stage.r
context("data stage") test_that("it turns a munge_procedure into a stagerunner", { tmp <- new.env(); tmp$data <- iris munge_procedure <- rep(list(list(column_transformation(function(x) 2 * x), 1)), 2) data_stage(tmp, munge_procedure)$run() expect_equal(tmp$data[[1]], 4 * iris[[1]]) }) # TODO: Test triggers! ...
context("data stage") test_that("it turns a munge_procedure into a stagerunner", { tmp <- new.env(); tmp$data <- iris munge_procedure <- rep(list(list(column_transformation(function(x) 2 * x), 1)), 2) data_stage(tmp, munge_procedure)$run() expect_equal(tmp$data[[1]], 4 * iris[[1]]) }) # TODO: Test triggers!
mit
R
b1ff0b7b36a8bfba23c78cd0f6757aa9c85bebd4
adjust pdf width and bugfix
shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl
lib/scRNA/scRNAMarkerGenes.r
lib/scRNA/scRNAMarkerGenes.r
library(Seurat) library(ggplot2) finalList<-readRDS(parFile1) geneFile<-parFile2 obj<-finalList$obj celltypes<-read.table(geneFile, sep="\t", header=T, stringsAsFactors = F) celltypes$Gene<-gsub("\\s.+", "", celltypes$Gene) celltypes$Gene<-toupper(celltypes$Gene) missGenes<-celltypes[!(celltypes$Gene %in% rownames...
library(Seurat) library(ggplot2) finalList<-readRDS(parFile1) geneFile<-parFile2 obj<-finalList$obj celltypes<-read.table(geneFile, sep="\t", header=T, stringsAsFactors = F) celltypes$Gene<-gsub("\\s.+", "", celltypes$Gene) celltypes$Gene<-toupper(celltypes$Gene) missGenes<-celltypes[!(celltypes$Gene %in% rownames...
apache-2.0
R
0c0eb601fd41b91a8c6b64b8d63282c7efc20e07
add 3th OR example
mhermans/tabulr
examples.r
examples.r
source('table_export_openxlsx.r') # BASIC EXAMPLES # # ============== # d <- as.data.frame(Titanic) tab1 <- table(d$Class, d$Sex) tab2 <- table(d$Class, d$Survived) tab3 <- table(d$Sex, d$Survived) # write single table # ------------------ wb <- createWorkbook() addWorksheet(wb = wb, sheetName = 'OR_tables') wb ...
source('table_export_openxlsx.r') # BASIC EXAMPLES # # ============== # d <- as.data.frame(Titanic) tab1 <- table(d$Class, d$Sex) tab2 <- table(d$Class, d$Survived) tab3 <- table(d$Sex, d$Survived) # write single table # ------------------ wb <- createWorkbook() addWorksheet(wb = wb, sheetName = 'OR_tables') wb ...
agpl-3.0
R
c32b8bfea6f3130950f3650824fb07bcd8940f47
Fix boundaries for dtm
HIIT/digivaalit-2015,HIIT/digivaalit-2015,HIIT/digivaalit-2015
topics/topics.r
topics/topics.r
create_dtm <- function( path ) { library(tm) library(Matrix) a <- Corpus( DirSource( path ) ) ndocs <- length(a) minDocFreq <- ndocs * 0.1 ## not common words enough maxDocFreq <- ndocs * 0.8 ## too commong words a <- tm_map(a, removeNumbers) a <- tm_map(a , stripWhitespace) a <- tm_map(a, removeP...
create_dtm <- function( path ) { library(tm) library(Matrix) a <- Corpus( DirSource( path ) ) a <- tm_map(a, removeNumbers) a <- tm_map(a , stripWhitespace) a <- tm_map(a, removePunctuation) a <- tm_map(a, content_transformer(tolower) ) a <- tm_map(a, removeWords, stopwords("finnish") ) dtm <-Docum...
mit
R
465618d4649221bb29339b233915639e48ec0dd2
fix doc #2
mschubert/narray,mschubert/narray
R/lambda.r
R/lambda.r
#' Lambda syntax for array iteration #' #' @param fml A call prefixed with a tilde #' @param along A named vector which objects to subset (eg: c(x=1)) #' @param group Not implemented #' @param simplify Return array instead of index+result if scalar #' @param expand_grid Use all combinations of indices (...
#' Lambda syntax for array iteration #' #' @param fml A call prefixed with a tilde #' @param along A named vector which objects to subset (eg: c(x=1)) #' @param group Not implemented #' @param simplify Return array instead of index+result if scalar #' @param envir Environment where variables can be f...
apache-2.0
R
53c801df4f076e434c8e14657942749789e80e63
speed up execution of test_basic.r
cscheid/rgithub,s-u/rgithub,akhmed1/rgithub,aronlindberg/rgithub
inst/tests/test_basic.r
inst/tests/test_basic.r
context("Basic Tests") test_that("A basic rgithub context can be acquired", { create.github.context("https://api.github.com") repos <- get.user.repositories("cscheid") repos_overview <- do.call("rbind", lapply(repos$content[1:5], function(x) { data.frame(name = x$name, ...
context("Basic Tests") test_that("A basic rgithub context can be acquired", { create.github.context("https://api.github.com") repos <- get.user.repositories("cscheid") print(repos) })
mit
R
1c460e4b384771bb82708607ff2e2c9a8b49408e
Improve calling sequence, namespaces, returned object
mconlon17/vivo-r,mconlon17/vivo-r
sparql/vivo.query.r
sparql/vivo.query.r
vivo.query <- function(query, endpoint= 'http://localhost:8080/vivo/api/sparqlQuery', email= 'vivo_root@mydomain.edu', password= 'v;bisons', ns = c( "rdf","<http://www.w3.org/1999/02/22-rdf-syntax-ns#>", "rdfs","<http://www.w3.org/2000/01/rdf-schema#>", "xsd","<http://www.w3.org/2001/XMLSchema#>", "...
vivo.query <- function(query, endpoint= 'http://localhost:8080/vivo/api/sparqlQuery', email= 'vivo_root@school.edu', password= '*******', format="tsv", ns = c( "rdf","<http://www.w3.org/1999/02/22-rdf-syntax-ns#>", "rdfs","<http://www.w3.org/2000/01/rdf-schema#>", "xsd","<http://www.w3.org/2001/XMLSchem...
bsd-2-clause
R
95edf9c277b7a50805c71bd93b6b7b77324f546d
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_UI...
mit
R
6fe47b77a56aba476ddd162772996b365be9b5b6
remove a stray browser
syberia/syberia
R/construct_stage_runner.r
R/construct_stage_runner.r
#' Return a stageRunner object that parametrizes a list of stages. #' #' Each stage is first fed through a function that converts it to a stageRunner #' or a function. For example, list(import = X, ...) gets converted by, #' amongst other things, looking for a variable import_stage and passing #' in X. #' #' This kind...
#' Return a stageRunner object that parametrizes a list of stages. #' #' Each stage is first fed through a function that converts it to a stageRunner #' or a function. For example, list(import = X, ...) gets converted by, #' amongst other things, looking for a variable import_stage and passing #' in X. #' #' This kind...
mit
R
2869e9d4ec565b3c1fba48e1056d77b586f6d1eb
remove ; and " from log file
koji-to/effort_calculator,koji-to/effort_calculator,koji-to/effort_calculator
format_main_log_to_csv.r
format_main_log_to_csv.r
####### preprocessing main logs and change to .csv file_list.df<-read.table("git_log_main/git_log_main_list.txt",header=F) dir.create("git_log_main_proc") for(i in 1:nrow(file_list.df)){ open_file_name<-paste("git_log_main/",file_list.df[i,1],sep="") if(file.access(open_file_name)==0){ proc_main_log.df<-data.f...
####### preprocessing main logs and change to .csv file_list.df<-read.table("git_log_main/git_log_main_list.txt",header=F) dir.create("git_log_main_proc") for(i in 1:nrow(file_list.df)){ open_file_name<-paste("git_log_main/",file_list.df[i,1],sep="") if(file.access(open_file_name)==0){ proc_main_log.df<-data.f...
mit
R
519cce60b627981c879b7741839f92f61bd7edf6
Update 1.r
glor/R,glor/R
aufgaben/blatt03/1.r
aufgaben/blatt03/1.r
#Blatt 3 #1.1 Datei lokal speichern #1.2 maeuse = read.table(file="mice.txt", sep="t", dec=".", header=TRUE) #1.3 boxplot(maeuse$speed ~ maeuse$health, date = maeuse, main = "kranke Maeuse" ) # Beide Gruppen sind normalverteilt, es gibt keine Aussreisser. (diese wuerden als Punkte ausserhalb der Boxen darge...
#Blatt 3 #1.1 Datei lokal speichern #1.2 maeuse = read.table(file="mice.txt", sep="t", dec=".", header=TRUE) #1.3 boxplot(maeuse$speed ~ maeuse$health, date = maeuse, main = "kranke Maeuse" ) # Beide Gruppen sind normalverteilt, es gibt keine Aussreisser. (diese wuerden als Punkte ausserhalb der Boxen darge...
bsd-2-clause
R
51b78700877a1c315aad7dff0008462459995ed6
Use random number seed
eggplantbren/STATS331,eggplantbren/STATS331,eggplantbren/STATS331
Code/use_jags.r
Code/use_jags.r
model = "model { theta ~ dunif(0, 1) x ~ dbin(theta, N) } " # The data (use NA for no data) data = list(x=2, N=5) # Variables to monitor variable_names = c('theta') # How many burn-in steps? burn_in = 1000 # How many proper steps? steps = 10000 # Thinning? thin = 1 # Random number seed seed = 42 # NO NEED T...
model = "model { theta ~ dunif(0, 1) x ~ dbin(theta, N) } " # The data (use NA for no data) data = list(x=2, N=5) # Variables to monitor variable_names = c('theta') # How many burn-in steps? burn_in = 1000 # How many proper steps? steps = 10000 # Thinning? thin = 1 # NO NEED TO EDIT PAST HERE!!! # Just run...
mit
R
148e8136f84f23d79538f58ead4d5ebef9b140e9
Update libraries.r
GalDrnovsek/APPR-2015-16
lib/libraries.r
lib/libraries.r
library(knitr) require(dplyr) require(rvest) require(gsubfn) require(ggplot2) # Uvozimo funkcije za delo z datotekami XML. source("lib/xml.r", encoding = "UTF-8") # Uvozimo funkcije za pobiranje in uvoz zemljevida. source("lib/uvozi.zemljevid.r", encoding = "UTF-8")
library(knitr) require(dplyr) require(rvest) require(gsubfn) # Uvozimo funkcije za delo z datotekami XML. source("lib/xml.r", encoding = "UTF-8") # Uvozimo funkcije za pobiranje in uvoz zemljevida. source("lib/uvozi.zemljevid.r", encoding = "UTF-8")
mit
R
1422e1266bb915dd27aa13af81dbec95e88b5631
Update PMV_ISO7730.r
alfcrisci/rBiometeo,alfcrisci/rBiometeo
R/PMV_ISO7730.r
R/PMV_ISO7730.r
#' PMV_ISO7730 #' #' Calculate Predicted Mean Vote (PMV) following ISO 7730. #' #' @param t numeric Air temperature in degC. #' @param rh numeric Relative humidity in percentage. #' @param wind numeric Windspeed in meter per second. #' @param tr numeric Mean radiant temperature in degC. #' @param M numeric Meta...
#' PMV_ISO7730 #' #' Calculate Predicted Mean Vote (PMV) following ISO 7730. #' #' @param t numeric Air temperature in degC. #' @param rh numeric Relative humidity in percentage. #' @param wind numeric Windspeed in meter per second. #' @param tr numeric Mean radiant temperature in degC. #' @param M numeric Meta...
mit
R