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 |
|---|---|---|---|---|---|---|---|---|
fbe381d31a907d9700aec0347571ac98788ba0e3 | add conn to function arguments | amcat/amcat-r | query_lib.r | query_lib.r | query.aggregate <- function(conn, queries, labels=queries, sets, ...) {
result = NULL
for (i in 1:length(queries)) {
r = amcat.getobjects(conn,"aggregate", filters=list(q=URLencode(queries[i]), ...))
if (nrow(r) > 0) {
r$query = labels[i]
result = rbind(result, r)
}
}
return(result)
}
... | query.aggregate <- function(queries, labels=queries, sets, ...) {
result = NULL
for (i in 1:length(queries)) {
r = amcat.getobjects(conn,"aggregate", filters=list(q=URLencode(queries[i]), ...))
if (nrow(r) > 0) {
r$query = labels[i]
result = rbind(result, r)
}
}
return(result)
}
query... | mit | R |
36281bc1b2845bdc27517077f165475abe129b91 | add figure | shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl | lib/Samtools/BamStat.r | lib/Samtools/BamStat.r | library(dplyr)
library(reshape2)
library(ggplot2)
options(bitmapType='cairo')
filelist<-read.table(parSampleFile1, sep="\t", header=F, stringsAsFactor=F)
if(nrow(filelist) != length(unique(filelist$V2))){
stop(paste0("Cannot have replicated sample names in ", parSampleFile1, " ."))
}
filecounts<-apply(f... | options(bitmapType='cairo')
filelist<-read.table(parSampleFile1, sep="\t", header=F, stringsAsFactor=F)
filecounts<-apply(filelist, 1, function(x){
dat<-read.table(x[1], sep="\t")
#dat<-read.table(filelist[1,1], sep="\t")
counts<-sapply(strsplit(as.vector(dat$V1), ' \\+ '), "[", 1)
names<-sapply(strspli... | apache-2.0 | R |
80ea7b163abbf333d4dfecada0feef4f739eb826 | Update 2010_PR_config.r | PSC-CoTC/PSC-FRAM-Admin,PSC-CoTC/PSC-FRAM-Admin | config/2010_PR_config.r | config/2010_PR_config.r | #note: here "pre.season" means "original BK post-season" for the Periodic Report comparison tables
run.year <- 2010
post.season.fram.db <- "./fram db/PeriodicReportdb/FramVS2-PSC-Coho-Backwards-redo 2010-2016 January 2019 products.mdb"
post.season.run.name <- "bc-bkCoho2010 step 3"
post.season.tamm <- "./fram db/Perio... |
run.year <- 2010
post.season.fram.db <- "./fram db/PeriodicReportdb/FramVS2-PSC-Coho-Backwards-redo 2010-2016 January 2019 products.mdb"
post.season.run.name <- "bc-bkCoho2010 step 3"
post.season.tamm <- "./fram db/PeriodicReportdb/updated2010-2016TAMMfiles/BK 2010 January 2019 redo step 3.xlsm"
post.season.tamm.fish... | mit | R |
e681e83d68c5eb16100e121722e9081152aed10c | Fix in QDA | srijanshetty/linear-discriminants | lda.r | lda.r | # Always generate the same data
set.seed(111)
# Number of samples
sample_size = 3000
training_size = 0.9 * sample_size
test_size = 0.1 * sample_size
###################################################################
# To generate the waveform data we use mlbench
# mlbench uses Breiman's original waveform source modi... | # Always generate the same data
set.seed(111)
# Number of samples
sample_size = 3000
training_size = 0.9 * sample_size
test_size = 0.1 * sample_size
###################################################################
# To generate the waveform data we use mlbench
# mlbench uses Breiman's original waveform source modi... | mit | R |
df16fccfa8a5e8dbb1f0813837c2b61fc29bd00b | Use transparency so the graphs are more readable | fpavageau/poor-man-pidstat,fpavageau/poor-man-pidstat | pmfaults.r | pmfaults.r | #!/usr/bin/env r
# Copyright 2014 Frank Pavageau
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | #!/usr/bin/env r
# Copyright 2014 Frank Pavageau
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 | R |
9822ad1eb1de33ea8ce90402bddc2bb500148a0c | Make R package/module search paths uniform | klmr/.files,klmr/.files,klmr/.files | .R/config.r | .R/config.r | options(pager = file.path(Sys.getenv('HOME'), '.R/pager.sh'),
# Imperial College London
repos = c(CRAN = 'http://cran.ma.imperial.ac.uk/'),
menu.graphics = FALSE, # Seriously, WHAT THE FUCK, R!?
import.path = '~/R/modules',
devtools.name = 'Konrad Rudolph',
devtools.desc.... | options(pager = file.path(Sys.getenv('HOME'), '.R/pager.sh'),
# Imperial College London
repos = c(CRAN = 'http://cran.ma.imperial.ac.uk/'),
menu.graphics = FALSE, # Seriously, WHAT THE FUCK, R!?
import.path = '~/Projects/R',
devtools.name = 'Konrad Rudolph',
devtools.desc... | apache-2.0 | R |
319086b0f166d91e17385b4e2f6674380b24ce21 | Update cfsv2_ts_ncdc_sqlite.r | dpbroman/hydroforecast | cfsv2_ts_ncdc_sqlite.r | cfsv2_ts_ncdc_sqlite.r | ###########################################
# cfsv2_ts_ncdc_sqlite.r
# processes grib2 files from ncdc cfsv2 archive
# saves data to sqlite database
# saves data in rdata format
###########################################
library(data.table)
library(dplyr)
library(ggplot2)
library(lubridate)
library(stringr)
library(t... | ###########################################
# cfsv2_ts_ncdc_sqlite.r
# processes grib2 files from ncdc cfsv2 archive
# saves data to sqlite database
# saves data in rdata format
###########################################
library(data.table)
library(dplyr)
library(ggplot2)
library(lubridate)
library(stringr)
library(t... | mit | R |
df86acff6c733e2f2285038aa814b3ffac9ac01f | verify predict response | snowch/biginsight-examples,snowch/biginsight-examples | examples/BigR/kmeans.r | examples/BigR/kmeans.r | projdir <- Sys.getenv("projdir")
# connect.r will open the connection to the cluster
source( paste( projdir, "/connect.r", sep="" ) )
##################################################################
# 1. Machine Learning example: building a k-means clustering model
##################################################... | projdir <- Sys.getenv("projdir")
# connect.r will open the connection to the cluster
source( paste( projdir, "/connect.r", sep="" ) )
##################################################################
# 1. Machine Learning example: building a k-means clustering model
##################################################... | apache-2.0 | R |
f89be97809152b0dd184be0659486c2b08354aaa | Remove reference to dplyr rdname | jimhester/dplyrJDBC | R/tbl-sql.r | R/tbl-sql.r | #' @export
tbl_sql <- function(subclass, src, from, ..., vars = NULL) {
assert_that(is.character(from), length(from) == 1)
from <- db_table_source(src$con, src$path, from)
tbl <- make_tbl(c(subclass, "sql"),
src = src, # src object
from = from, # table, join, or raw sql
selec... | #' @rdname dplyr::tbl_sql
#' @export
tbl_sql <- function(subclass, src, from, ..., vars = NULL) {
assert_that(is.character(from), length(from) == 1)
from <- db_table_source(src$con, src$path, from)
tbl <- make_tbl(c(subclass, "sql"),
src = src, # src object
from = from, # table, ... | mit | R |
96edc708cb1bf756b0fbba0c2dd396ccc923de60 | 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",
... |
#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",
... | mit | R |
db14ad3bc87d20fbc5228b1ce6a3f5ad32893f3a | Update a document. | snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3 | q3/docs/AccountAdvanced.rd | q3/docs/AccountAdvanced.rd | =begin
=x̐ݒ
x̐ݒs܂B
// TODO 摜XV
((<[x]^u|"IMG:images/AccountAdvancedPage.png">))
+[tB^]
gp铯tB^w肵܂BtB^ɂẮA((<tB^|URL:SyncFilter.html>))QƂĂB
+[ҏW]
tB^ҏW܂B
+[MOɎMT[oɐڑ]
MOɎMT[oɐڑ邩ǂw肵܂BPOP3 before SMTPgꍇɂ́AɃ`FbN܂BftHgł͐ڑ܂B
+[Message-Idt]
Message-Idŕt邩ǂw肵܂BftHgł́AmailNX̃AJEgł͎ŕtAnewsNX̃AJEgł͕... | =begin
=x̐ݒ
x̐ݒs܂B
((<[x]^u|"IMG:images/AccountAdvancedPage.png">))
+[tB^]
gp铯tB^w肵܂BtB^ɂẮA((<tB^|URL:SyncFilter.html>))QƂĂB
+[ҏW]
tB^ҏW܂B
+[MOɎMT[oɐڑ]
MOɎMT[oɐڑ邩ǂw肵܂BPOP3 before SMTPgꍇɂ́AɃ`FbN܂BftHgł͐ڑ܂B
+[Message-Idt]
Message-Idŕt邩ǂw肵܂BftHgł́AmailNX̃AJEgł͎ŕtAnewsNX̃AJEgł͕t܂B
+[Co... | mit | R |
9c0f430f2c026dc8366ba7feddca2d3e689c41a4 | tweak static docs index | rstudio/sparklyr,kevinykuo/sparklyr,kevinykuo/sparklyr,rstudio/sparklyr,kevinykuo/sparklyr,kevinykuo/sparklyr,rstudio/sparklyr,rstudio/sparklyr | inst/staticdocs/index.r | inst/staticdocs/index.r | sd_section("Connecting to Spark",
"Functions for installing Spark components and connecting to Spark clusters.",
c("spark_connect",
"spark_disconnect",
"spark_log",
"spark_web")
)
sd_section("MLlib Interface",
"Functions for invoking MLlib algorithms",
c("ml_kmeans",
"ml_linear_... | sd_section("Connecting to Spark",
"Functions for installing Spark components and connecting to Spark clusters.",
c("install_spark",
"spark_connect")
)
sd_section("Reading and Writing Data",
"Functions for reading and writing Spark data frames",
c("load_csv",
"load_json")
)
| apache-2.0 | R |
8144812d34bea6e74ba09ec7d77444450da47a1b | remove these newliens | syberia/stagerunner,davluangu/stagerunner,kirillseva/stagerunner,davluangu/stagerunner,robertzk/stagerunner,robertzk/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) y$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) y$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 |
e43ea68bc07d455dc1788365455bec6758d5f3da | add xaringanthemer and emo | berkeley-dsep-infra/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub | deployments/datahub/images/default/r-packages/stat-20.r | deployments/datahub/images/default/r-packages/stat-20.r | #!/usr/bin/env Rscript
print("Installing packages for stat-20")
source("/tmp/class-libs.R")
class_name = "stat-20"
class_libs = c(
"tidycensus", "1.0",
"openintro", "2.0.0",
"infer", "1.0.0",
"patchwork", "1.1.1",
"tigris", "1.0",
"googlesheets4", "0.2.0",
"xaringanthemer", "0.4.0"
)
cla... | #!/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.0.0",
"infer", "1.0.0",
"patchwork", "1.1.1",
"tigris", "1.0",
"googlesheets4", "0.2.0"
)
class_libs_install_version(class_n... | bsd-3-clause | R |
56b038a655c01314fd84ea257c467a92dd69832a | Use R_LIBS_USER | yutannihilation/ansible-playbook-r | scripts/install.r | scripts/install.r | #!/usr/bin/env r
library(docopt)
doc <- "Usage: install.r [-h] [--force] [PACKAGES ...]
--force force to install package whether it is installed or not
-h --help show this help text
"
opt <- docopt(doc)
targets <- opt$PACKAGES
if (!opt$force) {
targets <- targets[! targets %in% installed.pa... | #!/usr/bin/env r
library(docopt)
doc <- "Usage: install.r [-h] [--force] [PACKAGES ...]
--force force to install package whether it is installed or not
-h --help show this help text
"
opt <- docopt(doc)
targets <- opt$PACKAGES
if (!opt$force) {
targets <- targets[! targets %in% installed.pa... | mit | R |
d0e2a5223d5e187a2edb183daf6fa20820ec6135 | Work with new data in exploration script | hadley/data-counties | explore-mn.r | explore-mn.r | library(ggplot2)
source("thin-better.r")
if (!file.exists("mn.rdata")) {
raw <- read.csv("county-boundaries-raw.csv")
raw$long <- round_any(raw$long, 0.001)
raw$lat <- round_any(raw$lat, 0.001)
raw$order <- NULL
raw <- unique(raw)
raw$order <- seq_len(nrow(raw))
raw$hash <- paste(raw$long, raw$lat)
m... | library(ggplot2)
source("thin-better.r")
raw <- read.csv("county-boundaries-raw.csv")
raw$long <- round_any(raw$long, 0.001)
raw$lat <- round_any(raw$lat, 0.001)
raw <- unique(raw)
raw$order <- seq_len(nrow(raw))
raw$hash <- paste(raw$long, raw$lat)
mn <- subset(raw, substr(id, 0, 2) == "27")
# Find out which points ... | mit | R |
6164105b1a52d4ad85fd4dd5ad0c6ed76087101c | Correct typo. | owainkenwayucl/stats-plus-plus,owainkenwayucl/stats-plus-plus,owainkenwayucl/stats-plus-plus,owainkenwayucl/stats-plus-plus | r/time-by-cost-by-inst-user.r | r/time-by-cost-by-inst-user.r | #!/usr/bin/env Rscript
args <- commandArgs(trailingOnly=TRUE)
if (length(args)!=2) {
cat("time-by-cost-by-inst institution YYYY-MM\n")
return(NA)
}
inst <- args[1]
period <- args[2]
source("r/simpletemplate.r")
source("r/dbtools.r")
db <- "thomas"
dba <- "thomas_sgelogs"
keys <- genkeys(c("%INSTITUTE%"), c(in... | #!/usr/bin/env Rscript
args <- commandArgs(trailingOnly=TRUE)
if (length(args)!=2) {
cat("time-by-cost-by-inst institutionYYYY-MM\n")
return(NA)
}
inst <- args[1]
period <- args[2]
source("r/simpletemplate.r")
source("r/dbtools.r")
db <- "thomas"
dba <- "thomas_sgelogs"
keys <- genkeys(c("%INSTITUTE%"), c(ins... | mit | R |
370af9a69bbe7bf7abcce68df6bc549c37f0ad28 | fix a comment | hostilefork/rebol,hostilefork/rebol,giuliolunati/ren-c,hostilefork/rebol,hostilefork/rebol,giuliolunati/ren-c,hostilefork/rebol,giuliolunati/ren-c,giuliolunati/ren-c,hostilefork/rebol,giuliolunati/ren-c | configs/default-config.r | configs/default-config.r | REBOL []
os-id: _
; possible values (words):
; Execution: Build the target directly without generating a Makefile
; makefile: Generate a makefile for GNU make
; nmake: Generate an NMake file for CL
target: 'execution
extensions: make map! [
; NAME VALUE
; VALUE: one of
; + builtin
; - disabled
; *... | REBOL []
os-id: _
; possible values (words):
; Execution: Build the target directly without generating a Makefile
; makefile: Generate a makefile for GNU make
; nmake: Generate an NMake file for CL
target: 'execution
extensions: make map! [
; NAME VALUE
; VALUE: one of
; + builtin
; - disabled
; *... | apache-2.0 | R |
8276e86d33bb978247b1cc0ef60703dc02443d25 | delete debug | 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/user_info/"
api_key <- "K-..."
api_secret <- "S-..."
api_query <- function(url, key, secret){
nonce <- (as.numeric(as.POSIXct(Sys.time()))*10000000)%/%1
body <-
list(
nonce = nonce
)
data <- paste(name... | library(httr)
library(jsonlite)
library(nanotime)
library(digest)
api_url <- "https://api.exmo.com/v1/user_info/"
api_key <- "K-..."
api_secret <- "S-..."
api_query <- function(url, key, secret){
nonce <- (as.numeric(as.POSIXct(Sys.time()))*10000000)%/%1
body <-
list(
nonce = nonce
)
data <- paste(names(... | mit | R |
8d925afc52ea3117455c2a39271341b16ac1e1f7 | update r | 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 |
70b1a94395ea6dd441c05f2ffd508b558d6ed3de | Install pagedown. | ryanlovett/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,berkeley-dsep-infra/datahub | deployments/stat20/image/r-packages/2022-spring-stat-20.r | deployments/stat20/image/r-packages/2022-spring-stat-20.r | #!/usr/bin/env Rscript
source("/tmp/class-libs.R")
class_name = "2022 Spring Stat 20"
class_libs = c(
"fivethirtyeight", "0.6.2",
"gapminder", "0.3.0",
"googlesheets4", "1.0.0",
"infer", "1.0.0",
"janitor", "2.1.0",
"openintro", "2.2.0",
"pagedown", "0.16",
"palmerpenguins", "0.1.0",
... | #!/usr/bin/env Rscript
source("/tmp/class-libs.R")
class_name = "2022 Spring Stat 20"
class_libs = c(
"fivethirtyeight", "0.6.2",
"gapminder", "0.3.0",
"googlesheets4", "1.0.0",
"infer", "1.0.0",
"janitor", "2.1.0",
"openintro", "2.2.0",
"palmerpenguins", "0.1.0",
"patchwork", "1.1.1"... | bsd-3-clause | R |
3e860e675d1be293ae5207d632474bcf5e1fd36e | add Support for Shortest Path Problem | felixlindemann/HNUORTools,felixlindemann/HNUORTools | R/01.class.e.HNU.GeoSituation.r | R/01.class.e.HNU.GeoSituation.r | setClass(
Class = "HNUGeoSituation",
representation=representation(
id = "character",
label = "character",
nodes = "list",
links = "list",
warehouses = "list",
customers = "list",
travelcosts = "numeric",
transportcosts = "matrix",
... | setClass(
Class = "HNUGeoSituation",
representation=representation(
id = "character",
label = "character",
nodes = "list",
links = "list",
warehouses = "list",
customers = "list",
travelcosts = "numeric",
transportcosts = "matrix",
... | mit | R |
8438603fdfeeaf1283711bccf4d52243d50360d7 | Update vivo.query.r | 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= '******',
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#>",
"ow... | 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#>",
"... | bsd-2-clause | R |
5ea984d0f4cae555f6354f5e9004dd5d7b107621 | Update RSI_index.r | alfcrisci/rBiometeo,alfcrisci/rBiometeo | R/RSI_index.r | R/RSI_index.r | #' RSI_index
#'
#' Calculates Relative Strain Index.
#'
#' @param numeric t Air temperature in Celsius degrees.
#' @param numeric rh Air Relative humidity in percentage.
#' @return
#'
#'
#' @author Istituto di Biometeorologia Firenze Italy Alfonso Crisci \email{a.crisci@@ibimet.cnr.it}
#' @keywords RSI_index
#' @r... | #' RSI_index
#'
#' Calculates Relative strain index.
#'
#' @param numeric t Air temperature in Celsius Degrees.
#' @param numeric rh Air Relative humidity in percentage.
#' @return
#'
#'
#' @author Istituto di Biometeorologia Firenze Italy Alfonso Crisci \email{a.crisci@@ibimet.cnr.it}
#' @keywords RSI_index
#' @r... | mit | R |
02e783c1ebec8e64236ec655fa4bb228c74d22b3 | Update shiny.r | aleksandrov2/APPR-2015-16 | shiny/shiny.r | shiny/shiny.r | library(shiny)
source("lib/libraries.r", encoding = "UTF-8")
source("uvoz/uvoz.r", encoding = "UTF-8")
source("lib/uvozi.zemljevid.r", encoding = "UTF-8")
source("podatki/podatki.r", encoding = "UTF-8")
source("analiza/analiza.r", encoding = "UTF-8")
runApp("shiny")
| library(shiny)
source("lib/libraries.r", encoding = "UTF-8")
source("uvoz/uvoz.r", encoding = "UTF-8")
runApp("shiny")
| mit | R |
56034f265ac106cdb57d1214a29ad251dff7eb45 | 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... | bsd-2-clause | R | |
158ae442ce4f1a92649c6300d6f4e79efadfdb14 | Add a linear model | GreatEmerald/geoscripting,GreatEmerald/geoscripting,GreatEmerald/geoscripting,GreatEmerald/geoscripting | Lesson8/Main.r | Lesson8/Main.r | # Team Rython, Dainius Masiliunas and Tim Weerman
# Date: 11 January, 2016
# Apache License 2.0
# Needed packages
library(raster)
# Source
# Download/load information
download.file("https://github.com/GeoScripting-WUR/AdvancedRasterAnalysis/raw/gh-pages/data/GewataB1.rda", "data/GewataB1.rda", "wget")
download.file... | # Team Rython, Dainius Masiliunas and Tim Weerman
# Date: 11 January, 2016
# Apache License 2.0
# Needed packages
library(raster)
# Source
# Download/load information
download.file("https://github.com/GeoScripting-WUR/AdvancedRasterAnalysis/raw/gh-pages/data/GewataB1.rda", "data/GewataB1.rda", "wget")
download.file... | apache-2.0 | R |
15bb433dae3a7710fa6a9ee1074f0f0280b9cb2f | Add grid to path geometry | klmr/ggplots | __init__.r | __init__.r | #' Pretty plotting module
export = import('./export', attach = 'export_from')
gg = import_package('ggplot2')
export_from(gg)
#
# Set a very minimal theme. Avoid chartjunk.
#
fonts = import('./fonts')
fonts$register_font('Roboto')
fonts$register_font('Roboto Condensed', 'RobotoCondensed')
.theme_basic = theme_minim... | #' Pretty plotting module
export = import('./export', attach = 'export_from')
gg = import_package('ggplot2')
export_from(gg)
#
# Set a very minimal theme. Avoid chartjunk.
#
fonts = import('./fonts')
fonts$register_font('Roboto')
fonts$register_font('Roboto Condensed', 'RobotoCondensed')
.theme_basic = theme_minim... | apache-2.0 | R |
f8f48313a4077a4eb029150d6ae4b3d6256e0b19 | Update PMV_custom.r | alfcrisci/rBiometeo,alfcrisci/rBiometeo | R/PMV_custom.r | R/PMV_custom.r | #' PMV_custom
#'
#' Calculate Predicted Mean Vote (PMV) following ISO 7730 customizing some individual features.
#'
#' @param numeric t Air temperature in Celsius degrees.
#' @param numeric rh Air Relative humidity in percentage.
#' @param numeric wind Windspeed in meter per second.
#' @param numeric tr Air temperatur... | #' PMV_custom
#'
#' Calculate Predicted Mean Vote (PMV) following ISO 7730 customizing some individual features.
#'
#' @param numeric t Air temperature in Celsius degrees.
#' @param numeric rh Air Relative humidity in percentage.
#' @param numeric wind Windspeed in meter per second.
#' @param numeric tr Air temperatur... | mit | R |
eb43c0f1c31ced03f40fc1e1844a2e02a984f09c | Fix DE relevelling | klmr/codons,klmr/codons | scripts/de.r | scripts/de.r | # Differential gene expression analysis
.deseq = modules::import_package('DESeq2')
.base = modules::import('ebits/base')
modules::import_package('dplyr', attach = TRUE)
untidy = function (tidy_data, rownames = 1)
`rownames<-`(as.data.frame(tidy_data[-rownames]), tidy_data[[rownames]])
.deseq_test = function (dat... | # Differential gene expression analysis
.deseq = modules::import_package('DESeq2')
.base = modules::import('ebits/base')
modules::import_package('dplyr', attach = TRUE)
untidy = function (tidy_data, rownames = 1)
`rownames<-`(as.data.frame(tidy_data[-rownames]), tidy_data[[rownames]])
.deseq_test = function (dat... | apache-2.0 | R |
b67e012c925f9dd0c95fcb1b56a07510fbf0105b | Add data plot. | jtobin/bnp | finite-gaussian-mixture/src/simulation_conditional.r | finite-gaussian-mixture/src/simulation_conditional.r | set.seed(42)
require(ggplot2)
require(reshape2)
source('fmm_conditional.r')
config = list(
k = 3
, a = 1
, l = 0
, r = 0.1
, b = 1
, w = 1
, n = 500
)
origin = list(
p = mixing_model(config$k, config$a)
, m = location_model(config$k, config$l, config$r)
, s = precision_model(config$k, conf... | set.seed(42)
require(ggplot2)
require(reshape2)
source('fmm_conditional.r')
config = list(
k = 3
, a = 1
, l = 0
, r = 0.1
, b = 1
, w = 1
, n = 500
)
origin = list(
p = mixing_model(config$k, config$a)
, m = location_model(config$k, config$l, config$r)
, s = precision_model(config$k, conf... | mit | R |
2aad2e345bcf51c1eb1de428d402abfe406cbeeb | 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 |
74e096f8ea6042e2e10fbcbc0c79307cbb46451b | Move comments for clarity | mattm/active-user-cohort-analysis | active-users.r | active-users.r | DATA_PATH = "data/test-data.csv"
DATA_FILE_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... | DATA_PATH = "data/test-data.csv"
DATA_FILE_SEPARATOR = "\t"
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
# TODO: Figure out how to prevent ggplot from rendering a th... | mit | R |
bb92b26afc2d398d1e4488319617a9f68b4e0d24 | handle errors properly | syberia/syberia | R/run_model.r | R/run_model.r | #' Build a model using a data source from scratch.
#'
#' @param key a string or list. If the former, there must be a
#' file with name \code{model_stages} followed by \code{.r} so that syberia
#' can read the model configurations.
#' @export
run_model <- function(key = get_cache('last_model') %||%
... | #' Build a model using a data source from scratch.
#'
#' @param key a string or list. If the former, there must be a
#' file with name \code{model_stages} followed by \code{.r} so that syberia
#' can read the model configurations.
#' @export
run_model <- function(key = get_cache('last_model') %||% getOption('syber... | mit | R |
3c567cd6ff2baaf440a92b7733fdeb44a48ed547 | Add color info. | BitFunnel/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,BitFunnel/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")
# See
# https://www.r-bloggers.com/choosing-colour-palettes-part-ii-educated-choices/
# for color information.
queries <- read.csv(header=TRUE, file="/tmp/QueryPipelineStatistics.csv")
# Create column to graph vs. term position.
pos = seq(1, l... | library("ggplot2")
library("reshape")
setwd("~/dev/BitFunnel/src/Scripts")
queries <- read.csv(header=TRUE, file="/tmp/QueryPipelineStatistics.csv")
# Create column to graph vs. term position.
pos = seq(1, length(queries$quadwords))
df_temp <- data.frame(pos, queries$quadwords, queries$cachelines)
# Rename columns t... | mit | R |
94f6b2e356a86edb282ba6ade3170213f443b7c9 | add janitor, patchwork, stat20data | berkeley-dsep-infra/datahub,berkeley-dsep-infra/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub,ryanlovett/datahub,ryanlovett/datahub | deployments/datahub/images/default/r-packages/stat-20.r | deployments/datahub/images/default/r-packages/stat-20.r | #!/usr/bin/env Rscript
print("Installing packages for stat-20")
source("/tmp/class-libs.R")
class_name = "stat-20"
class_libs = c(
"tidycensus", "1.0",
"openintro", "2.2.0",
"infer", "1.0.0",
"patchwork", "1.1.1",
"tigris", "1.0",
"googlesheets4", "0.2.0",
"xaringanthemer", "0.4.0",
"... | #!/usr/bin/env Rscript
print("Installing packages for stat-20")
source("/tmp/class-libs.R")
class_name = "stat-20"
class_libs = c(
"tidycensus", "1.0",
"openintro", "2.2.0",
"infer", "1.0.0",
"patchwork", "1.1.1",
"tigris", "1.0",
"googlesheets4", "0.2.0",
"xaringanthemer", "0.4.0",
"... | bsd-3-clause | R |
37d821f5037c8da0a24030ff88d22a7844475ed1 | 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 |
9f972da9f6b0d8064fa46e4fb2900db19f871cb5 | Add shapes/linetypes reference for ggplot #chunks | jpalardy/dotfiles,jpalardy/dotfiles,jpalardy/dotfiles,jpalardy/dotfiles,jpalardy/dotfiles | chunks/chunks.r | chunks/chunks.r |
#-------------------------------------------------
# manual colors
#-------------------------------------------------
colors = c("val1"="red", "val2"="darkgreen")
scale_color_manual(values=colors)
#-------------------------------------------------
# color brewer
#-------------------------------------------------
# ... |
#-------------------------------------------------
# manual colors
#-------------------------------------------------
colors = c("val1"="red", "val2"="darkgreen")
scale_color_manual(values=colors)
#-------------------------------------------------
# color brewer
#-------------------------------------------------
# ... | mit | R |
ef721d23ec1bfca05515717b947b969e19667cf5 | remove debugging | syberia/syberia | R/model_stage.r | R/model_stage.r | #' Model stage for syberia models
#'
#' TODO: Document this more
#'
#' @param modelenv an environment. The persistent modeling environment.
#' @param model_parameters a list. Model-specific parameters, with the first
#' parameter always being the model keyword for the tundra container
#' (e.g., glm, gbm, etc.)
#... | #' Model stage for syberia models
#'
#' TODO: Document this more
#'
#' @param modelenv an environment. The persistent modeling environment.
#' @param model_parameters a list. Model-specific parameters, with the first
#' parameter always being the model keyword for the tundra container
#' (e.g., glm, gbm, etc.)
#... | mit | R |
aed5bf4c0e777fd753d1dedd4b2d24b908c6af4a | Add closure to data example | tisp-lang/tisp,raviqqe/tisp,raviqqe/tisp,tisp-lang/tisp,raviqqe/tisp | examples/data.r | examples/data.r | ; Dictionary
(def d {"foo" 1 "bar" 2})
; Set
(def s '{1 2 3})
; List
(def l [1 2 3])
; Array?
(def l '[1 2 3])
; Closure
(def l '(+ #1 #2))
| ; Dictionary
(def d {"foo" 1 "bar" 2})
; Set
(def s '{1 2 3})
; List
(def l [1 2 3])
; Array?
(def l '[1 2 3])
| mit | R |
1b2f4a42196fa48ac201d78a1b01e5431af35c33 | Make plot somewhat less ugly. | BitFunnel/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,BitFunnel/BitFunnel | src/Scripts/plot-sim.r | src/Scripts/plot-sim.r | library("ggplot2")
library("reshape2")
setwd("~/dev/BitFunnel/src/Scripts")
# png(filename="wat.png",width=800,height=600)
png(filename="talk.png",width=1600,height=1200)
# df <- read.csv(header=FALSE, file="wat.csv")
df <- read.csv(header=FALSE, file="talk.csv")
## df <- read.csv(file="wat.csv")
## munged <- melt(df)... | library("ggplot2")
library("reshape2")
setwd("~/dev/BitFunnel/src/Scripts")
# png(filename="wat.png",width=800,height=600)
png(filename="talk.png",width=1600,height=1200)
# df <- read.csv(header=FALSE, file="wat.csv")
df <- read.csv(header=FALSE, file="talk.csv")
## df <- read.csv(file="wat.csv")
## munged <- melt(df)... | mit | R |
48f38039aecd52143d24149416d55e002ce632e8 | fix improper maps | jae0/bio.snowcrab,jae0/bio.snowcrab | R/map.survey.locations.r | R/map.survey.locations.r | map.survey.locations2 = function(p, basedir, newyear=T, map.method="lattice" ) {
set = snowcrab.db( DS="set.clean")
years = sort( unique( set$yr ) )
if (newyear) years = p$year.assessment
if (map.method=="lattice" ) {
set = set[, c("yr", "plon", "plat")]
set = set[ is.finite( rowSums(set... | map.survey.locations = function(p, basedir, newyear=T, map.method="lattice" ) {
set = snowcrab.db( DS="set.clean")
years = sort( unique( set$yr ) )
if (newyear) years = p$year.assessment
if (map.method=="lattice" ) {
set = set[, c("yr", "plon", "plat")]
set = set[ is.finite( rowSums(set... | mit | R |
0296bfbabd6277191f0dee0df57120f3b556dc8b | Add colScale object | chamaelj/tools-artbio,ARTbio/tools-artbio,ARTbio/tools-artbio,ARTbio/tools-artbio,chamaelj/tools-artbio,drosofff/tools-artbio,drosofff/tools-artbio,drosofff/tools-artbio,chamaelj/tools-artbio,drosofff/tools-artbio,ARTbio/tools-artbio | tools/small_rna_map/test.r | tools/small_rna_map/test.r | # Table is the data frame
library("ggplot2")
library("gridExtra")
library("RColorBrewer")
library("gtable")
library("grid")
theme_set(theme_bw())
#Table=read.delim(your_input, header=T, row.names=NULL)
Table <- within(Table[1:27,], Nbr_reads[Polarity=="R"] <- (Nbr_reads[Polarity=="R"]*-1))
myColors <- brewer.pal(3,... | # Table is the data frame
library("ggplot2")
library("gridExtra")
library("RColorBrewer")
library("gtable")
library("grid")
theme_set(theme_bw())
#Table=read.delim(your_input, header=T, row.names=NULL)
Table <- within(Table[1:27,], Nbr_reads[Polarity=="R"] <- (Nbr_reads[Polarity=="R"]*-1))
p1 <- ggplot(Table, aes(x=... | mit | R |
3edb9072f005af6c6ea0f07277e2dff34d0df98a | Copy FIRST | syberia/syberia | R/export_stage.r | R/export_stage.r | #' Export stage for Syberia.
#'
#' Precise behavior depends on adapter.
#'
#' @param modelenv an environment. The current modeling environment.
#' @param export_options a list. The available export options. Will differ
#' depending on the adapter. (default is file adapter)
#' @export
export_stage <- function(modele... | #' Export stage for Syberia.
#'
#' Precise behavior depends on adapter.
#'
#' @param modelenv an environment. The current modeling environment.
#' @param export_options a list. The available export options. Will differ
#' depending on the adapter. (default is file adapter)
#' @export
export_stage <- function(modele... | mit | R |
d5349db1d7d38d7d561d9c75e50ffc14b36c1b3b | Update report template | hkaju/Ising2D,hkaju/Ising2D,hkaju/Ising2D | templates/report.template.r | templates/report.template.r | require(lattice)
lattice.options(default.theme = standard.theme(color = FALSE))
pdf("report.pdf")
equi <- read.csv("data/equilibriation.csv", header=T)
plot(equi$x, equi$y, xlab="Monte Carlo moves", ylab="Magnetization", type="n")
lines(equi$x, equi$y)
%s
dev.off()
| require(lattice)
pdf("report.pdf")
equi <- read.csv("data/equilibriation.csv", header=T)
plot(equi$x, equi$y, xlab="Spin flips", ylab="Energy", type="n")
lines(equi$x, equi$y)
%s
dev.off()
| mit | R |
8eda92aa3cc8244aff463cc84042ead53968724d | Update vizualizacija.r | ZavbiA/APPR-2017 | vizualizacija/vizualizacija.r | vizualizacija/vizualizacija.r | # 3. faza: Vizualizacija podatkov
library(sp)
library(maptools)
library(digest)
gpclibPermit()
library(rvest)
library(gsubfn)
library(readr)
library(dplyr)
library(ggplot2)
library(tibble)
# Uvozim zemljevid.
zemljevid <- uvozi.zemljevid("http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cul... | # 3. faza: Vizualizacija podatkov
library(sp)
library(maptools)
library(digest)
gpclibPermit()
library(rvest)
library(gsubfn)
library(readr)
library(dplyr)
# Uvozim zemljevid.
zemljevid <- uvozi.zemljevid("http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_0_countries.z... | mit | R |
c03c4b74987145f4a79f0e72d96663c6aa76ae74 | Update to include tidyverse | jkarl/LandscapeToolbox,jkarl/LandscapeToolbox,jkarl/LandscapeToolbox | package_installation.r | package_installation.r | ###############################################
### COMMONLY USED PACKAGES IN AIM R SCRIPTS ###
###############################################
#### THE CORE ####
install.packages("tidyverse")
## The tidyverse package includes a number of packages also listed below. It's a quick way to bootstrap up a new install of R.... | ###############################################
### COMMONLY USED PACKAGES IN AIM R SCRIPTS ###
###############################################
#### 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 |
a79912a5bdf434d0e6dea086a53d86b7b71c99f9 | fix conditional | 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 |
b6c64f95d648441dac4b75111f55c69d0c0672b8 | use the historical date about Zero Wing | yutannihilation/allYourFigureAreBelongToUs,yutannihilation/allYourFigureAreBelongToUs,yutannihilation/allYourFigureAreBelongToUs,yutannihilation/allYourFigureAreBelongToUs | generateRmd.r | generateRmd.r | #! /usr/bin/env Rscript
"
Usage: generateRmd.r PACKAGE
" -> doc
opts <- docopt::docopt(doc)
pkgname <- opts[["PACKAGE"]]
#----------------------------
header_tmpl <- '---
title: |
%s
rdname: %s
date: %s
output: html_document
layout: article
category: %s
images:
FRONTFOMATTER_IMAGES
---
```{r, echo = FALSE, messa... | #! /usr/bin/env Rscript
"
Usage: generateRmd.r PACKAGE
" -> doc
opts <- docopt::docopt(doc)
pkgname <- opts[["PACKAGE"]]
#----------------------------
header_tmpl <- '---
title: |
%s
rdname: %s
date: %s
output: html_document
layout: article
category: %s
images:
FRONTFOMATTER_IMAGES
---
```{r, echo = FALSE, messa... | mit | R |
38908f4c600501005346d31acd458a64bd6beb64 | Fix error in constant. | BitFunnel/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,danluu/BitFunnel,BitFunnel/BitFunnel,danluu/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")
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... | mit | R |
96c8f67887eb11ad935bd5be71461e048d12b556 | Update analiza.r | Anchiqua/APPR-2015-16 | analiza/analiza.r | analiza/analiza.r | # 4. faza: Analiza podatkov
#naredimo skupine za države glede na število igralcev in točk
tabela4 <- inner_join(tabela3, tabela2)
rownames(tabela4) <- tabela4$drzava
tabela4.norm <- tabela4 %>% select(-drzava) %>% scale()
k1 <- kmeans(tabela4.norm, 5)
#head(k$cluster, n = 15, nstart=1000)
table(k$cluster)
k1 <- km... | # 4. faza: Analiza podatkov
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... | mit | R |
7667dfc9711f5a8b87a6e03e81f48027d6a272d0 | Use a temporary file | klmr/modules,klmr/modules | tests/testthat/helper-callr.r | tests/testthat/helper-callr.r | rcmd = function (script_path) {
cmd = 'R CMD BATCH --slave --vanilla --no-restore --no-save --no-timing'
output_file = 'output.rout'
on.exit(unlink(output_file))
system(paste(cmd, script_path, output_file))
readLines(output_file)
}
rscript = function (script_path) {
cmd = 'Rscript --slave --van... | rcmd = function (script_path) {
cmd = 'R CMD BATCH --slave --vanilla --no-restore --no-save --no-timing'
output_file = 'output.rout'
on.exit(unlink(output_file))
system(paste(cmd, script_path, output_file))
readLines(output_file)
}
rscript = function (script_path) {
cmd = 'Rscript --slave --van... | apache-2.0 | R |
6ffca8f591a5e40bdf13a1781b3fa245fdc0626b | Add SlurmContainer add_object method | 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 |
9eeb9e7322db147ae5d54057e2ec192ef567100c | remove debugging | syberia/tundra,robertzk/tundra | R/tundra_ensemble.r | R/tundra_ensemble.r | #' Tundra ensemble wrapper
fetch_submodel <- function(model_parameters) {
stopifnot(length(model_parameters) > 0 && is.character(model_parameters[[1]]))
if (!exists(model_fn <- paste0('tundra_', model_parameters[[1]])))
stop("Missing tundra container for keyword '", model_parameters[[1]], "'")
get(model_fn)(m... | #' Tundra ensemble wrapper
fetch_submodel <- function(model_parameters) {
stopifnot(length(model_parameters) > 0 && is.character(model_parameters[[1]]))
if (!exists(model_fn <- paste0('tundra_', model_parameters[[1]])))
stop("Missing tundra container for keyword '", model_parameters[[1]], "'")
get(model_fn)(m... | mit | R |
3b1ec7182db57cf97d0bf29f68e319804017efd8 | 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 |
1e03689c06768b5aec4101f15f26df6b1b738eb1 | Update a document. | snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3,snakamura/q3 | q3/docs/InstallWithZip.rd | q3/docs/InstallWithZip.rd | =begin
=Zipt@CɂCXg[
Zipt@CɂCXg[́Aȉ̎菇ōs܂B
(1)Zipt@CCӂ̃fBNgɓWJ܂
(2)UI{ꉻꍇɂ͓{UIZipt@CfBNgɓWJ܂
(3)Windows CEł̏ꍇɂ́AׂẴt@CfoCXɃRs[܂
((<CXg[fBNg|"IMG:images/InstallDirectory.png">))
܂܂t@C̓R|[lgʂDLLɕĂ܂BKv̂ȂDLL͍폜Ă\܂BȉeR|[lg̋@\łBvbgtH[ɂĈȏDLL܂܂ĂȂ\܂BƂAWindows CEłłPGP, GnuPG̓T|[gĂȂ̂ŁAqmpgpu.dll͊܂܂܂B
:q3u.exe... | =begin
=Zipt@CɂCXg[
Zipt@CɂCXg[́Aȉ̎菇ōs܂B
(1)Zipt@CCӂ̃fBNgɓWJ܂
(2)UI{ꉻꍇɂ͓{UIZipt@CfBNgɓWJ܂
(3)Windows CEł̏ꍇɂ́AׂẴt@CfoCXɃRs[܂
((<CXg[fBNg|"IMG:images/InstallDirectory.png">))
܂܂t@C̓R|[lgʂDLLɕĂ܂BKv̂ȂDLL͍폜Ă\܂BȉeR|[lg̋@\łBvbgtH[ɂĈȏDLL܂܂ĂȂ\܂BƂAWindows CEłłPGP, GnuPG̓T|[gĂȂ̂ŁAqmpgpu.dll͊܂܂܂B
:q3u.exe... | mit | R |
b1445537129604ef6bf5e985b9edf181fbe1328e | Add missing internal keyword | klmr/modules,klmr/modules | R/default.r | R/default.r | #' Retrieve a value or a default
#'
#' \code{a \%||\% b} returns \code{a} unless it is empty, in which case
#' \code{b} is returned.
#' @param a the value to return if non-empty
#' @param b default value
#' @return \code{a \%||\% b} returns \code{a}, unless it is \code{NA},
#' \code{NULL}, \code{FALSE} or \code{""}; in... | #' Retrieve a value or a default
#'
#' \code{a \%||\% b} returns \code{a} unless it is empty, in which case
#' \code{b} is returned.
#' @param a the value to return if non-empty
#' @param b default value
#' @return \code{a \%||\% b} returns \code{a}, unless it is \code{NA},
#' \code{NULL}, \code{FALSE} or \code{""}; in... | apache-2.0 | R |
a418d49f118f31048115c022bd8a4257265eef80 | Install rChart by default | daigotanaka/kawaraban,daigotanaka/kawaraban,daigotanaka/kawaraban,daigotanaka/kawaraban | init.r | init.r | install.packages("datasets", dependencies = TRUE)
install.packages("methods", dependencies = TRUE)
install.packages("ggplot2", dependencies = TRUE)
install.packages("knitr", dependencies = TRUE)
install.packages("devtools", dependencies = TRUE)
install.packages("base64enc", dependencies = TRUE)
library(devtools)
option... | install.packages("datasets", dependencies = TRUE)
install.packages("methods", dependencies = TRUE)
install.packages("ggplot2", dependencies = TRUE)
install.packages("knitr", dependencies = TRUE)
| mit | R |
6abaf9b06fc96f8fae1ed463c365167442dbaa18 | Remove main_file test | jmousseau/Stain | tests/testthat/test-slurm-job.r | tests/testthat/test-slurm-job.r | context("SlurmJob")
test_that("SlurmJob initializer sets main_file property.", {
expect_error(SlurmJob$new())
})
| context("SlurmJob")
test_that("SlurmJob initializer sets main_file property.", {
sj <- SlurmJob$new("main.R")
expect_equal(sj$main_file, "main.R")
expect_error(SlurmJob$new())
})
| mit | R |
db73b0f230a8e2fef3588fe075ba482b7c1cce32 | remove verbose | syberia/tundra,robertzk/tundra | R/tundra_ensemble.r | R/tundra_ensemble.r | #' Tundra ensemble wrapper
fetch_submodel <- function(model_parameters) {
stopifnot(length(model_parameters) > 0 && is.character(model_parameters[[1]]))
if (!exists(model_fn <- paste0('tundra_', model_parameters[[1]])))
stop("Missing tundra container for keyword '", model_parameters[[1]], "'")
get(model_fn)(m... | #' Tundra ensemble wrapper
fetch_submodel <- function(model_parameters) {
stopifnot(length(model_parameters) > 0 && is.character(model_parameters[[1]]))
if (!exists(model_fn <- paste0('tundra_', model_parameters[[1]])))
stop("Missing tundra container for keyword '", model_parameters[[1]], "'")
get(model_fn)(m... | mit | R |
2fd0a36ae42eaa6ef8a51bc5f1ad40922395b809 | 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 |
989b747990d1a84fdd82f82da1787bb83cdc7937 | create missing file | shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl | lib/Alignment/AlignmentUtils.r | lib/Alignment/AlignmentUtils.r | require("ggplot2")
require("data.table")
require("stringr")
draw_chromosome_count<-function(listFile, outFilePrefix) {
filelist = read.table(listFile, sep="\t", header=F, stringsAsFactors = F)
missing = c()
missing_file=paste0(outFilePrefix, ".chromosome.missing")
if(file.exists(missing_file)){
file.remov... | require("ggplot2")
require("data.table")
require("stringr")
draw_chromosome_count<-function(listFile, outFilePrefix) {
filelist = read.table(listFile, sep="\t", header=F, stringsAsFactors = F)
final=NULL
i=1
for(i in c(1:nrow(filelist))){
filename = filelist$V2[i]
filelocation =filelist$V1[i]
subd... | apache-2.0 | R |
f48125f4fe049e75989e4c174aaa6ae7e7039e71 | remove -q from output filename | davidmoten/rtree-3d,davidmoten/rtree-3d | src/test/r/source.r | src/test/r/source.r | #!/usr/bin/Rscript
#X11(type="Xlib")
#install.packages("plot3D")
library("plot3D")
for (i in 0:9) {
filename = paste("../../../target/out",i,".txt", sep="")
print(paste("reading", filename))
mat <- read.csv(file = filename, header = FALSE)
png(paste("../../../target/plot",i,".png",sep=""), height = 700,... | #!/usr/bin/Rscript
#X11(type="Xlib")
#install.packages("plot3D")
library("plot3D")
for (i in 0:9) {
filename = paste("../../../target/out",i,".txt", sep="")
print(paste("reading", filename))
mat <- read.csv(file = filename, header = FALSE)
png(paste("../../../target/plot",i,"-q.png",sep=""), height = 70... | apache-2.0 | R |
0e9b7d8e46a830b9a1cbc92206d6303aeb7708c9 | Update 1.r | glor/R,glor/R | aufgaben/blatt08/1.r | aufgaben/blatt08/1.r | #Blatt 8
cm = lm(formula = response ~ treatment, data = cherry)
fitted.value=fitted(cm)
resid.value=resid(cm)
plot(fitted.value, resid.value)
abline(h=0)
#Daten sind geordnet, als waeren sie entlang der h-Line sortiert => nicht varianzhomogen
#Levene:
leveneTest(cherry$response, cherry$treatment)
# p-Wert:... | bsd-2-clause | R | |
5e9fee85d1f568285ceb39cdcc4fe6f6d78e8938 | Print what we're installing | berkeley-dsep-infra/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub | deployments/r/image/extras.d/ias-c188.r | deployments/r/image/extras.d/ias-c188.r | #!/usr/bin/env Rscript
# From https://github.com/berkeley-dsep-infra/datahub/issues/814
print("Installing packages for IA C188")
print("Installing stargazer...")
devtools::install_github('cran/stargazer', ref='5.2.2', upgrade_dependencies=FALSE, quiet=TRUE)
print("Installing lm.beta...")
devtools::install_github('cra... | #!/usr/bin/env Rscript
# From https://github.com/berkeley-dsep-infra/datahub/issues/814
devtools::install_github('cran/stargazer', ref='5.2.2', upgrade_dependencies=FALSE, quiet=TRUE)
devtools::install_github('cran/lm.beta', ref='1.5-1', upgrade_dependencies=FALSE, quiet=TRUE)
devtools::install_github('cran/multcomp',... | bsd-3-clause | R |
44fe8ecbdcdc98903ce344e48536ed6eefda9aaa | Fix typo & NA check bug | jmousseau/Stain | R/slurm-settings.r | R/slurm-settings.r | #' SlurmSettings R6 object.
#'
#' An interface to SBATCH settings.
#'
#' @export
SlurmSettings <- R6::R6Class("SlurmSettings",
public = list(
nodes = NA,
cpus_per_task = NA,
time = NA,
memory = NA,
mail_to = NA,
mail_type = NA,
initialize = function(nodes = 1,... | #' SlurmSettings R6 object.
#'
#' An interface to SBATCH settings.
#'
#' @export
SlurmSettings <- R6::R6Class("SlurmSettings",
public = list(
nodes = NA,
cpus_per_task = NA,
time = NA,
memory = NA,
mail_to = NA,
mail_type = NA,
initialize = function(nodes = 1,... | mit | R |
1d29c72fcad6fd38aebccf3f2025c3766390b07f | remove redudent tiles | hansthompson/shiny-server,hansthompson/shiny-server,hansthompson/shiny-server | muniexplorer/app.r | muniexplorer/app.r | library(shiny)
library(leaflet)
library(dplyr)
load("data/all_the_data.rda")
precincts <- levels(factor(all_the_data$NAME))
#input <- list(select = "Spenard")
ui <- bootstrapPage(
tags$style(type = "text/css", "html, body {width:100%;height:100%}"),
leafletOutput("map", width = "100%", height = "100%"),
... | library(shiny)
library(leaflet)
library(dplyr)
load("data/all_the_data.rda")
precincts <- levels(factor(all_the_data$NAME))
#input <- list(select = "Spenard")
ui <- bootstrapPage(
tags$style(type = "text/css", "html, body {width:100%;height:100%}"),
leafletOutput("map", width = "100%", height = "100%"),
... | mit | R |
78d33e373c995a24ef1b88ee0b2fce719bbb80a5 | Set MCMC draws to 50000+50000. Now outputs means and Geweke stats separately | lbrandt/ez-shocks,lbrandt/ez-shocks | R/svydraws.r | R/svydraws.r | # -------------------------------------------------------------------------
# Estimate a first-order autoregressive stochastic volatility model on the
# forecast errors from the macroeconomic data (no conditional mean)
# -------------------------------------------------------------------------
#rm(list=ls())
# Initi... | # -------------------------------------------------------------------------
# Estimate a first-order autoregressive stochastic volatility model on the
# forecast errors from the macroeconomic data (no conditional mean)
# -------------------------------------------------------------------------
#rm(list=ls())
# Initi... | mit | R |
c98d334f9ac581f4f1f56180341797e669cc3d32 | add a space here | davluangu/stagerunner,davluangu/stagerunner,robertzk/stagerunner,syberia/stagerunner,robertzk/stagerunner,kirillseva/stagerunner,syberia/stagerunner | inst/tests/test-tree_skeleton.r | inst/tests/test-tree_skeleton.r | context('treeSkeleton')
test_that('it errors when not given methods of a reference class object for the callers', {
sr <- stageRunner$new(new.env(), list())
expect_error(treeSkeleton$new(sr, '', ''), 'methods\\(\\)) is not TRUE')
})
test_that('it does not error when given methods of a reference class object for t... | context('treeSkeleton')
test_that('it errors when not given methods of a reference class object for the callers', {
sr <- stageRunner$new(new.env(), list())
expect_error(treeSkeleton$new(sr, '', ''), 'methods\\(\\)) is not TRUE')
})
test_that('it does not error when given methods of a reference class object for t... | mit | R |
597d3203a2769c8a16ee8be440f2a46df31bf4a6 | Update uvoz_tabela1.r | ZavbiA/APPR-2017 | uvoz/uvoz_tabela1.r | uvoz/uvoz_tabela1.r | #tukaj opravim uvoz tabele iz wikipedije
library(rvest)
library(gsubfn)
library(readr)
library(dplyr)
# Funkcija, ki uvozi število medalj po državah iz Wikipedije
link <- "https://en.wikipedia.org/wiki/All-time_Olympic_Games_medal_table"
stran <- html_session(link) %>% read_html()
tabela <- stran %>% html_nodes(xpat... | # 2. faza: Uvoz podatkov
library(rvest)
library(gsubfn)
library(readr)
library(dplyr)
# Funkcija, ki uvozi število medalj po državah iz Wikipedije
link <- "https://en.wikipedia.org/wiki/All-time_Olympic_Games_medal_table"
stran <- html_session(link) %>% read_html()
tabela <- stran %>% html_nodes(xpath="//table[@class... | mit | R |
6f2849de37686d9b56c653b80aa922846db9a17d | add a space here | syberia/stagerunner,davluangu/stagerunner,kirillseva/stagerunner,syberia/stagerunner,robertzk/stagerunner,robertzk/stagerunner,davluangu/stagerunner | inst/tests/test-tree_skeleton.r | inst/tests/test-tree_skeleton.r | context('treeSkeleton')
test_that('it errors when not given methods of a reference class object for the callers', {
sr <- stageRunner$new(new.env(), list())
expect_error(treeSkeleton$new(sr, '', ''), 'methods\\(\\)) is not TRUE')
})
test_that('it does not error when given methods of a reference class object for t... | context('treeSkeleton')
test_that('it errors when not given methods of a reference class object for the callers', {
sr <- stageRunner$new(new.env(),list())
expect_error(treeSkeleton$new(sr, '', ''), 'methods\\(\\)) is not TRUE')
})
test_that('it does not error when given methods of a reference class object for th... | mit | R |
63f24c9504895e01ade56b04fc87398c8d8d6a43 | rearrange inputs to single row | AndySouth/coverage | inst/shiny/coverage1/ui.r | inst/shiny/coverage1/ui.r | #coverage/inst/shiny/coverage1/ui.r
#andy south 12/5/16
library(shiny)
shinyUI(fluidPage(
title = "coverage of vector control interventions",
h4("Vector control demonstrator prototype. Gerry Killeen & Andy South - southandy[at]gmail.com"),
h4("Vectors feed indoors and outdoors, on humans and cattle. Interven... | #coverage/inst/shiny/coverage1/ui.r
#andy south 12/5/16
library(shiny)
shinyUI(fluidPage(
title = "coverage of vector control interventions",
h4("Vector control demonstrator prototype. Gerry Killeen & Andy South - southandy[at]gmail.com"),
h4("Vectors feed indoors and outdoors, on humans and cattle. Interven... | mit | R |
e430e251a2f55f50aa1519debdf93ba159902f56 | add hgt to file list for correlation | isezen/sahra,isezen/sahra | code/calcor.r | code/calcor.r | # Saharan Dust Transport Research
# 2016-05-04 Ismail SEZEN
# sezenismail@gmail.com
source("code/correlation.r")
source("code/filehelper.r")
calcor <- function(files = stop("'file' must be specified")) {
pm <- read_pm10()
dir_out <- "data/cor"
dir.create(dir_out, showWarnings = F)
nof <- length(files)
i <- ... | # Saharan Dust Transport Research
# 2016-05-04 Ismail SEZEN
# sezenismail@gmail.com
source("code/correlation.r")
source("code/filehelper.r")
calcor <- function(files = stop("'file' must be specified")) {
pm <- read_pm10()
dir_out <- "data/cor"
dir.create(dir_out, showWarnings = F)
nof <- length(files)
i <- ... | mit | R |
1af6d3576064c4d7fca74c6441f5d2fe23a37b7d | 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 |
c258bebd76737c261e1770190d625065adacf319 | Update windchill.r | alfcrisci/rBiometeo,alfcrisci/rBiometeo | R/windchill.r | R/windchill.r | #' windchill
#'
#' Calculates the NWS Windchill Temperature (WCT) to estimate the perceived temperature with wind in cold environemnt.
#'
#' @param t numeric Air temperature in degC.
#' @param wind numeric Windspeed in meters per second.
#' @return windchill index
#'
#' @references Windchill NOAA calculator \url{https... | #' windchill
#'
#' Calculates the NWS Windchill Temperature (WCT) to estimate the perceived temperature with wind in cold environemnt.
#'
#' @param t numeric Air temperature in degC.
#' @param wind numeric Windspeed in meters per second.
#' @return windchill index
#'
#' @references Windchill NOAA calculator \url{https... | mit | R |
87a05fadd1a7b6c71cfb0c9c3440d5e505a057c5 | Add a few more plots, TODOs, and formatting | supertetelman/frc-data-analysis,supertetelman/frc-data-analysis,supertetelman/frc-data-analysis | quick-analysis.r | quick-analysis.r | #Install dependencies
install.packages("reshape2")
install.package("ggplot2")
#Requires
require("reshape2")
require("ggplot2")
#Import the data
teams <- read.csv("./the-blue-alliance-data-master/the-blue-alliance-data-master/teams/teams.csv", header=FALSE)
names(teams) <- c("number", "name", "sponsors", "location", "... | #Install dependencies
install.packages("reshape2")
install.package("ggplot2")
#Requires
require("reshape2")
require("ggplot2")
#Import the data
teams <- read.csv("./the-blue-alliance-data-master/the-blue-alliance-data-master/teams/teams.csv", header=FALSE)
names(teams) <- c("number", "name", "sponsors", "location", "... | apache-2.0 | R |
f55d853d1072aa45d58e32c24ef7e2365f3c09ca | Update viewport arguments | metagraf/rVega | R/Vega-class.r | R/Vega-class.r | #' @title Vega class
#'
#' @description ...
#'
#' @section \code{html()}: A method to convert the chart object to HTML code. The code does not include necessary JavaScript files (e.g. Vega and jQuery); however, when used interactively (\code{show()}) or with Shiny, those are automatically included.
#'
#' @examples \... | #' @title Vega class
#'
#' @description ...
#'
#' @section \code{html()}: A method to convert the chart object to HTML code. The code does not include necessary JavaScript files (e.g. Vega and jQuery); however, when used interactively (\code{show()}) or with Shiny, those are automatically included.
#'
#' @examples \... | agpl-3.0 | R |
4c4fa75f492d14ea822f2918b259cf10b035a9be | Make dir of container full path | 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 |
3c665c352a8c5b8ba74e3aa594379d153d54f1db | Add CHECK-SET routine per suggestion from @earl | draegtun/ren-c,codebybrett/ren-c,giuliolunati/ren-c,kealist/ren-c,draegtun/ren-c,codebybrett/ren-c,rgchris/ren-c,draegtun/ren-c,rgchris/ren-c,hostilefork/rebol,hostilefork/rebol,rgchris/ren-c,codebybrett/ren-c,draegtun/ren-c,draegtun/ren-c,kealist/ren-c,draegtun/ren-c,hostilefork/rebol,codebybrett/ren-c,giuliolunati/re... | src/mezz/mezz-control.r | src/mezz/mezz-control.r | REBOL [
System: "REBOL [R3] Language Interpreter and Run-time Environment"
Title: "REBOL 3 Mezzanine: Control"
Rights: {
Copyright 2012 REBOL Technologies
REBOL is a trademark of REBOL Technologies
}
License: {
Licensed under the Apache License, Version 2.0
See: http:... | REBOL [
System: "REBOL [R3] Language Interpreter and Run-time Environment"
Title: "REBOL 3 Mezzanine: Control"
Rights: {
Copyright 2012 REBOL Technologies
REBOL is a trademark of REBOL Technologies
}
License: {
Licensed under the Apache License, Version 2.0
See: http:... | apache-2.0 | R |
80f084608df655d5fa405cd1a551f1f831d44c22 | Set log level to ERROR in sparkR_init.r | TresAmigosSD/SMV,TresAmigosSD/SMV,TresAmigosSD/SMV,TresAmigosSD/SMV | tools/conf/sparkR_init.r | tools/conf/sparkR_init.r |
# This is a simplified copy of the "shell.R" profile from Spark.
# We had to duplicate here to avoid having to create another SparkContext just to pass the smv app jar to the init function.
.First <- function() {
spark_home <- Sys.getenv("SPARK_HOME")
smv_home <- Sys.getenv("SMV_HOME")
.libPaths(c(file.path(sp... |
# This is a simplified copy of the "shell.R" profile from Spark.
# We had to duplicate here to avoid having to create another SparkContext just to pass the smv app jar to the init function.
.First <- function() {
spark_home <- Sys.getenv("SPARK_HOME")
smv_home <- Sys.getenv("SMV_HOME")
.libPaths(c(file.path(sp... | apache-2.0 | R |
56f373278d4f3a243b2c135ab61db075cb57d71c | Update server.r | suraj-deshmukh/myCodes,suraj-deshmukh/myCodes,suraj-deshmukh/myCodes | ml-ui/server.r | ml-ui/server.r | server <- function(input,output){
e <- new.env()
output$ui_class<-renderUI({
switch(input$class_algo,
"c_svm" = box(width=15,background = "blue",title="Algorithm Parameters",numericInput("cost","Cost",value=1,step=0.5),
selectizeInput("kernel","Kernel",choices=c("radial","linear","polynomial",... | server <- function(input,output){
e <- new.env()
output$ui_class<-renderUI({
switch(input$class_algo,
"c_svm" = box(width=15,background = "blue",title="Algorithm Parameters",numericInput("cost","Cost",value=1,step=0.5),
selectizeInput("kernel","Kernel",choices=c("radial","linear","polynomial",... | mit | R |
c4fc294e6883471a410cb938ea47c2470cacd745 | include a filler column to make downstream scripts continue to work | corcra/feabhsa-here,corcra/feabhsa-here,corcra/feabhsa-here | pipeline/get_FP_affected_region.r | pipeline/get_FP_affected_region.r | args<-commandArgs(TRUE)
genes<-read.table(args[1])
from<-read.table(args[2],header=T)
to<-read.table(args[3],header=T)
# merge the timepoints... need info from both
both<-merge(from,to,by=2)
# add the strand information
strand_info<-genes[,c(4,6)]
names(strand_info)<-c("name","strand")
both<-merge(both,strand_info,b... | args<-commandArgs(TRUE)
genes<-read.table(args[1])
from<-read.table(args[2],header=T)
to<-read.table(args[3],header=T)
# merge the timepoints... need info from both
both<-merge(from,to,by=2)
# add the strand information
strand_info<-genes[,c(4,6)]
names(strand_info)<-c("name","strand")
both<-merge(both,strand_info,b... | mit | R |
f15e52afef9601207f0a75d3841b70ec5294a14e | Update config.r | syberia/syberia | R/config.r | R/config.r | .github_packages <- list(
list('productivus', 'robertzk'),
list('Ramd', 'robertzk'),
list('frost', 'robertzk'),
list('stagerunner', 'robertzk')
list('mungebitsTransformations', 'robertzk'),
list('mungebits', 'robertzk'),
list('tundra', 'robertzk')
)
| .github_packages <- list(
list('productivus', 'robertzk'),
list('Ramd', 'robertzk'),
list('frost', 'robertzk'),
list('stagerunner', 'robertzk')
list('mungebitsTransformations', 'robertzk'),
list('mungebits', 'robertzk'),
list('tundra', 'robertzk'),
)
| mit | R |
b6137303a0cf50d9c79899b0e0bc71693341164c | allow environment access | robertzk/microserver,kirillseva/microserver,robertzk/microserver | R/microserver.r | R/microserver.r | #' Default http server configuration for libuv hook.
#'
#' @param routes list. A named list of routes, with a handler
#' function for each route. The first unnamed route will be used
#' as the root. 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 |
673c14276beb4262c3039c87a9fa37645708e698 | remove warning | khufkens/phenor | R/check_npn_species.r | R/check_npn_species.r | #' Checks if USA-NPN species exists
#'
#' @param species An USA-NPN species (character or number).
#' Will search in both Genus species and common name fields and will match
#' any term within those fields. The search relies on regular expressions so
#' this can be used to be more specific.
#' @param list List all spec... | #' Checks if USA-NPN species exists
#'
#' @param species An USA-NPN species (character or number).
#' Will search in both Genus species and common name fields and will match
#' any term within those fields. The search relies on regular expressions so
#' this can be used to be more specific.
#' @param list List all spec... | agpl-3.0 | R |
e7484958d323efc3f6ad38a8be8cc1f5664d3f08 | remove background grid | shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl | lib/scRNA/gene_localization_map.r | lib/scRNA/gene_localization_map.r | source("scRNA_func.r")
library(Seurat)
library(ggplot2)
library(ggpubr)
finalList<-readRDS(parFile1)
obj<-finalList$obj
groups_tbl<-read.table(parSampleFile2, sep="\t", stringsAsFactors = F)
groups=split(groups_tbl$V2, groups_tbl$V1)
obj$group = unlist(groups[obj$orig.ident])
ngroup=length(unique(groups_tbl$V2))
... | source("scRNA_func.r")
library(Seurat)
library(ggplot2)
library(ggpubr)
finalList<-readRDS(parFile1)
obj<-finalList$obj
groups_tbl<-read.table(parSampleFile2, sep="\t", stringsAsFactors = F)
groups=split(groups_tbl$V2, groups_tbl$V1)
obj$group = unlist(groups[obj$orig.ident])
ngroup=length(unique(groups_tbl$V2))
... | apache-2.0 | R |
befa663fd9965366a880b9e43ca27d15f43a60b2 | Update fRH.r | alfcrisci/rBiometeo,alfcrisci/rBiometeo | R/fRH.r | R/fRH.r | #' fRH
#'
#' Return relative humidity from air temperature (Celsius) and Dew point (Celsius);
#'
#' @param t numeric Vector or value of air temperature in Celsius degree.
#' @param td numeric Vector or value of dew point temperature in Celsius degree.
#' @return res numeric relative humidity value
#'
#'
#' @author Is... | #' fRH
#'
#' Return relative humidity from air temperature (Celsius) and Dew point (Celsius);
#'
#' @param t numeric Vector or value of air temperature in Celsius degree.
#' @param td numeric Vector or value of dew point temperature in Celsius degree.
#' @return res numeric relative humidity value
#'
#'
#' @author Is... | mit | R |
1b3a0bd03009058e8d811a8fde562f96c501caa6 | add some commands useful for debugging | 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 |
f81b6cf93460b43477de194ecae9926c5f8c2a7e | update init.r | OwnYourData/app-bank,OwnYourData/app-bank | init.r | init.r | #
# Example R code to install packages
# See http://cran.r-project.org/doc/manuals/R-admin.html#Installing-packages for details
#
###########################################################
# Update this line with the R packages to install:
my_packages = c('shiny',
'shinyBS',
'shinyS... | #
# Example R code to install packages
# See http://cran.r-project.org/doc/manuals/R-admin.html#Installing-packages for details
#
###########################################################
# Update this line with the R packages to install:
my_packages = c('shiny', 'shinyBS', 'DT', 'tidyr', 'digest', 'RCurl', 'jsonli... | mit | R |
40232a1a48383cafb9cf47d3a5d0511e4e842671 | update main.r | wikimedia-research/Blockr | main.r | main.r | #Blockr - a project to accurately triage data on blocked Wikipedia users, identify
#the underlying rationales and test various hypotheses as to any outcome
#
# @Year = 2013
# @Copyright: Oliver Keyes
# @License = MIT (http://opensource.org/licenses/MIT)
#Load
source(file = file.path(getwd(),"config.r")) #Config variab... | #Blockr - a project to accurately triage data on blocked Wikipedia users, identify
#the underlying rationales and test various hypotheses as to any outcome
#
# @Year = 2013
# @Copyright: Oliver Keyes
# @License = MIT (http://opensource.org/licenses/MIT)
#Load in query-dependent config variables
source(file = file.pat... | mit | R |
5501cd19da41d1ad8b07ad823428da795465431d | add celltype_markers | shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl | lib/scRNA/scRNA_func.r | lib/scRNA/scRNA_func.r |
read_cell_cluster_file<-function(fileName, sort_cluster_name="seurat_clusters"){
result<-read.csv(fileName, stringsAsFactors = F, row.names = 1)
display_sort_cluster_name = paste0("display_", sort_cluster_name)
result[,display_sort_cluster_name] = paste0("Cluster ", result[,sort_cluster_name])
cluster_na... |
read_cell_cluster_file<-function(fileName, sort_cluster_name="seurat_clusters"){
result<-read.csv(fileName, stringsAsFactors = F, row.names = 1)
display_sort_cluster_name = paste0("display_", sort_cluster_name)
result[,display_sort_cluster_name] = paste0("Cluster ", result[,sort_cluster_name])
cluster_na... | apache-2.0 | R |
0e1e7b67c13f2285c09a0bfa32e204d59f24ae71 | Update linear mixed effects regression in AnalyzeFitness.r | AnneSWarlaumont/NNVocEvo,AnneSWarlaumont/NNVocEvo | AnalyzeFitness.r | AnalyzeFitness.r | # Anne S. Warlaumont
# Test to see if there are statistically significant differences between Realistic and Abstract simulations at generation 100
# If you run with the following command, a file containing the output will be saved to the directory containing this script:
# R CMD BATCH AnalyzeFitness.r
rm(list=ls())
... | # Anne S. Warlaumont
# Test to see if there are statistically significant differences between Realistic and Abstract simulations at generation 100
# If you run with the following command, a file containing the output will be saved to the directory containing this script:
# R CMD BATCH AnalyzeFitness.r
rm(list=ls())
... | mit | R |
10733eaab06fdb8964d5c7cd620a45a314eee47c | Fix tabs/spaces in example file | returnString/mongoplyr,returnString/mongoplyr | manual_tests/ny_restaurants.r | manual_tests/ny_restaurants.r | library(mongoplyr)
conn <- mongo(db = "mongoplyr_tests", collection = "restaurants")
MongoPipeline() %>%
match(.borough == "Manhattan" & .cuisine == "Pizza") %>%
execute(conn) -> pizzaPlacesInManhattan
MongoPipeline() %>%
group(by = .list(cuisine = .cuisine, borough = .borough), count = .sum(1)) %>%
execute(conn... | library(mongoplyr)
conn <- mongo(db = "mongoplyr_tests", collection = "restaurants")
MongoPipeline() %>%
match(.borough == "Manhattan" & .cuisine == "Pizza") %>%
execute(conn) -> pizzaPlacesInManhattan
MongoPipeline() %>%
group(by = .list(cuisine = .cuisine, borough = .borough), count = .sum(1)) %>%
execute(... | mit | R |
ed438086dd1df7a967bff4ceb4c2e98f4e3624fc | Add comments to 2-packages | hadley/r-on-github | 2-packages.r | 2-packages.r | library(ggplot2)
library(plyr)
library(reshape2)
"%||%" <- function(a, b) if (length(a) == 0) b else a
# Load repo data
repos <- llply(dir("cache-repo", full.names = TRUE), readRDS)
names(repos) <- vapply(repos, function(x) x$info$full_name, character(1))
# Focus on repos with valid DESCRIPTION - i.e. packages
has_de... | library(ggplot2)
library(plyr)
library(reshape2)
repos <- llply(dir("cache-repo", full.names = TRUE), readRDS)
names(repos) <- vapply(repos, function(x) x$info$full_name, character(1))
has_desc <- vapply(repos, function(x) !is.null(x$desc) && is.list(x$desc), logical(1))
pkgs <- repos[has_desc]
"%||%" <- function(a,... | mit | R |
415cdcdf69bbf10dee3adfb95cfbb9ba7d3a4ae9 | add a todo | FeiYeYe/syberiaStages,robertzk/syberiaStages | R/utils.r | R/utils.r | `%||%` <- function(x, y) if (is.null(x)) y else x
#' Merge two lists and overwrite latter entries with former entries
#' if names are the same.
#'
#' For example, \code{list_merge(list(a = 1, b = 2), list(b = 3, c = 4))}
#' will be \code{list(a = 1, b = 3, c = 4)}.
#' @param list1 list
#' @param list2 list
#' @return ... | `%||%` <- function(x, y) if (is.null(x)) y else x
#' Merge two lists and overwrite latter entries with former entries
#' if names are the same.
#'
#' For example, \code{list_merge(list(a = 1, b = 2), list(b = 3, c = 4))}
#' will be \code{list(a = 1, b = 3, c = 4)}.
#' @param list1 list
#' @param list2 list
#' @return ... | mit | R |
8d786549787d23589bf8531582038c19ef0ff839 | fix typo | kirillseva/stagerunner,davluangu/stagerunner,robertzk/stagerunner,syberia/stagerunner,robertzk/stagerunner,davluangu/stagerunner,syberia/stagerunner | R/utils.r | R/utils.r | `%||%` <- function(x, y) if (is.null(x)) y else x
contains_true <- function(x) {
if (is.list(x)) any(vapply(x, contains_true, logical(1)))
else any(x)
}
# Whether obj is of any of the given types.
is_any <- function(obj, klasses) {
any(vapply(klasses, inherits, logical(1), x = obj))
}
package_function <- funct... | `%||%` <- function(x, y) if (is.null(x)) y else x
contains_true <- function(x) {
if (is.list(x)) any(vapply(x, contains_true, logical(1)))
else any(x)
}
# Whether obj is of any of the given types.
is_any <- function(obj, klasses) {
any(vapply(klasses, inherits, logical(1), x = obj))
}
package_function(pkg, fn)... | mit | R |
b01aaff5d3ba6125d0889bd73892fbe8dc70b6b8 | allow neg indexing for split (#6) | mschubert/narray,mschubert/narray | R/split.r | R/split.r | #' Splits and array along a given axis, either totally or only subsets
#'
#' @param X An array that should be split
#' @param along Along which axis to split; use -1 for highest dimension
#' @param subsets Whether to split each element or keep some together
#' @param drop Remove unused dimensions after m... | #' Splits and array along a given axis, either totally or only subsets
#'
#' @param X An array that should be split
#' @param along Along which axis to split; use -1 for highest dimension
#' @param subsets Whether to split each element or keep some together
#' @param drop Remove unused dimensions after m... | apache-2.0 | R |
5e43d16279962d17dbeedb93fd0386ec58281755 | Fix static directory typo | jmousseau/Stain | R/slurm-bash-script.r | R/slurm-bash-script.r | #' SlurmBashScript R6 object.
#'
#' Generates the necessary bash script to submit through
#' the `sbatch` command.
SlurmBashScript <- R6::R6Class("SlurmBashScript",
public = list(
initialize = function(container_dir, settings) {
private$settings <- settings
private$cat_main_file_mag... | #' SlurmBashScript R6 object.
#'
#' Generates the necessary bash script to submit through
#' the `sbatch` command.
SlurmBashScript <- R6::R6Class("SlurmBashScript",
public = list(
initialize = function(container_dir, settings) {
private$settings <- settings
private$cat_main_file_mag... | mit | R |
e2c431663b4bd1237a63f13ccfa80a905acaae06 | kill the dead code | robertzk/stagerunner,kirillseva/stagerunner,syberia/stagerunner,robertzk/stagerunner,davluangu/stagerunner,davluangu/stagerunner,syberia/stagerunner | R/utils.r | R/utils.r | `%||%` <- function(x, y) if (is.null(x)) y else x
contains_true <- function(x) {
if (is.list(x)) any(vapply(x, contains_true, logical(1)))
else any(x)
}
# Whether obj is of any of the given types.
is_any <- function(obj, klasses) {
any(vapply(klasses, inherits, logical(1), x = obj))
}
package_function <- funct... | `%||%` <- function(x, y) if (is.null(x)) y else x
contains_true <- function(x) {
if (is.list(x)) any(vapply(x, contains_true, logical(1)))
else any(x)
}
# Whether obj is of any of the given types.
is_any <- function(obj, klasses) {
any(vapply(klasses, inherits, logical(1), x = obj))
}
package_function <- funct... | mit | R |
7d00d8c36480a7aab7c6025072b24dd7e72d57fd | fix typo | robertzk/stagerunner,syberia/stagerunner,syberia/stagerunner,robertzk/stagerunner,kirillseva/stagerunner,davluangu/stagerunner,davluangu/stagerunner | R/compare_stage_keys.r | R/compare_stage_keys.r | ## A stagerunner is simply a linear sequence (of usually functions)
## that is packaged as a tree structure to make it easier to reference
## related groups of operations.
##
## Since stagerunners are intended to be run sequentially, that is,
## only backward to forwards rather than the other way around, it is
## impor... | ## A stagerunner is simply a linear sequence (of usually functions)
## that is packaged as a tree structure to make it easier to reference
## related groups of operations.
##
## Since stagerunners are intended to be run sequentially, that is,
## only backward to forwards rather than the other way around, it is
## impor... | mit | R |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.