id
stringlengths
40
40
repo_name
stringlengths
5
110
path
stringlengths
2
233
content
stringlengths
0
1.03M
size
int32
0
60M
license
stringclasses
15 values
2b8fd89b4749253525141e2bd149d1a3082f1af5
cran/siatclust
tests/ewkm01.R
library(siatclust) csv <- "ewkm01.csv" ds <- read.csv("ewkm01.csv") set.seed(42) km <- ewkm(ds, 10) print(km) cat(km$iterations, km$restarts, km$total.iterations, "\n") set.seed(42) km <- ewkm(ds, 10, maxrestart=50) print(km) cat(km$iterations, km$restarts, km$total.iterations, "\n") set.seed(42) km <- ewkm(ds, 10...
536
gpl-3.0
66daaa8e245e478ca922288c3afa522e72f65730
lujiec/shiny_group_simulator
run_shiny.R
library(shiny) library(ggplot2) library(gridExtra) setwd('..') runApp('shiny_app')
88
mit
ff7ab7d6a11ce5a607eb8ef31355ef7a2ccf628a
rho-devel/rho
src/extra/testr/filtered-test-suite/strsplit/tc_strsplit_10.R
expected <- eval(parse(text="list(c(\"A\", \"shell\", \"of\", \"class\", \"documentation\", \"has\", \"been\", \"written\", \"to\", \"the\", \"file\", \"'./myTst2/man/DocLink-class.Rd'.\"))")); test(id=0, code={ argv <- eval(parse(text="list(\"A shell of class documentation has been written to the file './myTst...
496
gpl-2.0
ff7ab7d6a11ce5a607eb8ef31355ef7a2ccf628a
kmillar/cxxr
src/extra/testr/filtered-test-suite/strsplit/tc_strsplit_10.R
expected <- eval(parse(text="list(c(\"A\", \"shell\", \"of\", \"class\", \"documentation\", \"has\", \"been\", \"written\", \"to\", \"the\", \"file\", \"'./myTst2/man/DocLink-class.Rd'.\"))")); test(id=0, code={ argv <- eval(parse(text="list(\"A shell of class documentation has been written to the file './myTst...
496
gpl-2.0
ff7ab7d6a11ce5a607eb8ef31355ef7a2ccf628a
ArunChauhan/cxxr
src/extra/testr/filtered-test-suite/strsplit/tc_strsplit_10.R
expected <- eval(parse(text="list(c(\"A\", \"shell\", \"of\", \"class\", \"documentation\", \"has\", \"been\", \"written\", \"to\", \"the\", \"file\", \"'./myTst2/man/DocLink-class.Rd'.\"))")); test(id=0, code={ argv <- eval(parse(text="list(\"A shell of class documentation has been written to the file './myTst...
496
gpl-2.0
ff7ab7d6a11ce5a607eb8ef31355ef7a2ccf628a
cxxr-devel/cxxr
src/extra/testr/filtered-test-suite/strsplit/tc_strsplit_10.R
expected <- eval(parse(text="list(c(\"A\", \"shell\", \"of\", \"class\", \"documentation\", \"has\", \"been\", \"written\", \"to\", \"the\", \"file\", \"'./myTst2/man/DocLink-class.Rd'.\"))")); test(id=0, code={ argv <- eval(parse(text="list(\"A shell of class documentation has been written to the file './myTst...
496
gpl-2.0
ff7ab7d6a11ce5a607eb8ef31355ef7a2ccf628a
kmillar/rho
src/extra/testr/filtered-test-suite/strsplit/tc_strsplit_10.R
expected <- eval(parse(text="list(c(\"A\", \"shell\", \"of\", \"class\", \"documentation\", \"has\", \"been\", \"written\", \"to\", \"the\", \"file\", \"'./myTst2/man/DocLink-class.Rd'.\"))")); test(id=0, code={ argv <- eval(parse(text="list(\"A shell of class documentation has been written to the file './myTst...
496
gpl-2.0
0c514ad64a488918937febea02b70f9b4f559e2b
StanfordPsych254/replication_project
subsidiary_analysis/compute_sofer_es.R
rm(list=ls()) library(readr) library(dplyr) library(tidyr) library(lsr) sofer <- read_csv("../subsidiary_analysis/Experiment_1_Rps.csv") d <- sofer %>% mutate(subid = 1:n()) %>% gather(datapoint, rating, starts_with("dft")) %>% separate(datapoint, into = c("foo","DFT","trial_num"), sep = "_") %>% mutate(condit...
2,052
mit
ff7ab7d6a11ce5a607eb8ef31355ef7a2ccf628a
krlmlr/cxxr
src/extra/testr/filtered-test-suite/strsplit/tc_strsplit_10.R
expected <- eval(parse(text="list(c(\"A\", \"shell\", \"of\", \"class\", \"documentation\", \"has\", \"been\", \"written\", \"to\", \"the\", \"file\", \"'./myTst2/man/DocLink-class.Rd'.\"))")); test(id=0, code={ argv <- eval(parse(text="list(\"A shell of class documentation has been written to the file './myTst...
496
gpl-2.0
5f04d4c75bdc6afb327e122769448325ab0f1f86
sorensje/R_helperfunctions
aggregate_into_DF.R
aggregate_into_DF <- function(dataDF, form, fun, newVarName, inNewDF = TRUE){ # if(!is.na(subsetExp) & ! is.na(subsetVar)){ # # } # print(c("\n",substitute(dataDF)," type: ", expression(substitute(dataDF)),"\n")) # convenience function that returns original df w/ new aggregated variable (maintain...
1,894
gpl-2.0
1a9d5776fb6b50e88b91021bdefd815a2b099e55
jannes-m/RQGIS
tests/testthat/test-qgis-prerun.R
context("prerun") library("raster") library("sf") test_that("qgis_session_info yields a list as output", { skip_on_cran() info <- qgis_session_info() # check if the output is a list of length 5 or 6 expect_gt(length(info), 4) }) test_that("find_algorithms finds QGIS geoalgorithms", { skip_on_cran() ...
1,586
lgpl-3.0
9eebeeca8816b2a51a202ec89e7254f3a1bd15ea
RCollins13/CNValue
plotting_code/AllExampleLoci/SMARCA2/SMARCA2_CNV_tracks.plot.R
#!/usr/bin/env R #rCNV Map Project #Spring 2017 #Talkowski Lab & Collaborators #Copyright (c) 2017 Ryan Collins #Distributed under terms of the MIT License #Code to plot various tracks for SMARCA2 figure #################################### #####Set parameters & load libraries #################################### W...
10,020
mit
9eebeeca8816b2a51a202ec89e7254f3a1bd15ea
RCollins13/rCNVmap
plotting_code/AllExampleLoci/SMARCA2/SMARCA2_CNV_tracks.plot.R
#!/usr/bin/env R #rCNV Map Project #Spring 2017 #Talkowski Lab & Collaborators #Copyright (c) 2017 Ryan Collins #Distributed under terms of the MIT License #Code to plot various tracks for SMARCA2 figure #################################### #####Set parameters & load libraries #################################### W...
10,020
mit
00d66c1bd89f15a3205d5ef2b028f22416c8819f
Forever-Peace/GroundControl
Chapters/ch6-surprisal/gamescore_calc_only.R
#THIS SCRIPT JUST CALCULATES GAME SCORE, WITHOUT ANY OF THE PLOTTING FUNCTIONS ETC FOUND IN THE CHAPTER. #Simply change the filepath here to load the csv (found in the Ground Control github page), the run the entire script. It will take a while. df = read.csv("rushing_data_stack.csv") #point this to the location of th...
5,412
gpl-2.0
aced0b8bbf6b6d882c308d230c495cb74cf104cd
YvesBas/Tadarida-C
tadaridaC_src/xenocanto/XCwav_mix.R
library(tuneR) DirW="C:/Users/yvesb/Documents/Tadarida/pollinisateurs/doc_voix_humaine/voix_humaine_database" ListWrecent=list.files(DirW,pattern=".wav$",full.names=T) WNrates=c(10,24,50,99) CoeffSR=1 for (i in 1:length(WNrates)) { DestMix=gsub("split202",paste0("wn",WNrates[i],"_202"),DirW) dir.create(DestMix) ...
966
gpl-3.0
76f1318f1226a8e6a61085d948cbafd165883b96
setempler/miscset
R/scale0.R
#' @name scale0 #' @keywords scale #' @aliases scaler #' @author Sven E. Templer #' @title Scale Numeric Values to Defined Ranges #' @description #' Scale numeric values to a range from 0 to 1 with the function #' \code{scale0} or to a chosen range with \code{scaler}. #' @param x Numeric vector to transform. #' @param...
1,201
gpl-3.0
7fc9be4ce25cd064720c8f7fa9b4a4c0ceb597aa
SANBI-SA/tools-iuc
tools/limma_voom/limma_voom.R
# This tool takes in a matrix of feature counts as well as gene annotations and # outputs a table of top expressions as well as various plots for differential # expression analysis # # ARGS: 1.countPath -Path to RData input containing counts # 2.annoPath -Path to input containing gene annotations # ...
23,219
mit
e80d8b85766c2a2bef500f8de3a1cc4987a3f9c5
sgagnon/runQuestionnaires
scripts/tools/analysis.R
working_dir = "~/Experiments/AssocMem/data/" setwd(working_dir) d0=read.csv("Source_HitRate_n=9.csv") summary(d0) with(d0, interaction.plot(ShockCond, TrialType, Source_HitRate)) fit <- aov(Source_HitRate~(ShockCond*TrialType)+Error(Subid/(ShockCond*TrialType)), data=d0) summary(fit) library(ggplot2) p...
6,618
bsd-3-clause
af75da5ecc7411ff80c4402698c6ac4d6d5d4963
gavinsimpson/analogue
R/crossval.wa.R
## crossval method for wa() `crossval.wa` <- function(obj, method = c("LOO","kfold","bootstrap"), nboot = 100, nfold = 10, folds = 5, verbose = getOption("verbose"), ...) { method <- match.arg(method) X <- obj$orig.x ENV <- obj$orig.env N <- NROW(X) ...
5,200
gpl-2.0
700f8bffc889de7467003d8554e1dd3c47c1de3e
mjharrigan/flux
src/etoh.R
#!/usr/bin/env Rscript ################################################################################ # etoh.R # # USAGE: Rscript etoh.R --args cfg = file.cfg # ################################################################################ # Estimation procedure for heavy alcohol user (ETOH) initiation, remittance,...
18,969
mit
2262140e6ed2cae58984943da628cb1cfab45906
kmillar/cxxr
src/extra/testr/filtered-test-suite/attr/tc_attr_35.R
expected <- eval(parse(text="NULL")); test(id=0, code={ argv <- eval(parse(text="list(structure(c(8.85169533448293e-238, 2.77884205079773e-237, 8.5330427463164e-242, 7.89244209468013e-215, 6.74732964729372e-231, 1.30818670504849e-217, 1.39113376416096e-208, 1.35683278955814e-215, 7...
635
gpl-2.0
2262140e6ed2cae58984943da628cb1cfab45906
kmillar/rho
src/extra/testr/filtered-test-suite/attr/tc_attr_35.R
expected <- eval(parse(text="NULL")); test(id=0, code={ argv <- eval(parse(text="list(structure(c(8.85169533448293e-238, 2.77884205079773e-237, 8.5330427463164e-242, 7.89244209468013e-215, 6.74732964729372e-231, 1.30818670504849e-217, 1.39113376416096e-208, 1.35683278955814e-215, 7...
635
gpl-2.0
2262140e6ed2cae58984943da628cb1cfab45906
rho-devel/rho
src/extra/testr/filtered-test-suite/attr/tc_attr_35.R
expected <- eval(parse(text="NULL")); test(id=0, code={ argv <- eval(parse(text="list(structure(c(8.85169533448293e-238, 2.77884205079773e-237, 8.5330427463164e-242, 7.89244209468013e-215, 6.74732964729372e-231, 1.30818670504849e-217, 1.39113376416096e-208, 1.35683278955814e-215, 7...
635
gpl-2.0
2262140e6ed2cae58984943da628cb1cfab45906
ArunChauhan/cxxr
src/extra/testr/filtered-test-suite/attr/tc_attr_35.R
expected <- eval(parse(text="NULL")); test(id=0, code={ argv <- eval(parse(text="list(structure(c(8.85169533448293e-238, 2.77884205079773e-237, 8.5330427463164e-242, 7.89244209468013e-215, 6.74732964729372e-231, 1.30818670504849e-217, 1.39113376416096e-208, 1.35683278955814e-215, 7...
635
gpl-2.0
2262140e6ed2cae58984943da628cb1cfab45906
cxxr-devel/cxxr
src/extra/testr/filtered-test-suite/attr/tc_attr_35.R
expected <- eval(parse(text="NULL")); test(id=0, code={ argv <- eval(parse(text="list(structure(c(8.85169533448293e-238, 2.77884205079773e-237, 8.5330427463164e-242, 7.89244209468013e-215, 6.74732964729372e-231, 1.30818670504849e-217, 1.39113376416096e-208, 1.35683278955814e-215, 7...
635
gpl-2.0
2262140e6ed2cae58984943da628cb1cfab45906
krlmlr/cxxr
src/extra/testr/filtered-test-suite/attr/tc_attr_35.R
expected <- eval(parse(text="NULL")); test(id=0, code={ argv <- eval(parse(text="list(structure(c(8.85169533448293e-238, 2.77884205079773e-237, 8.5330427463164e-242, 7.89244209468013e-215, 6.74732964729372e-231, 1.30818670504849e-217, 1.39113376416096e-208, 1.35683278955814e-215, 7...
635
gpl-2.0
092d23c63fb20c7f36370fc045f4669c017cb7a4
dvera/gyro
R/bedtoolsCoverage.R
#' Calculate coverage of a set of bed files over intervals in a single bed file. #' #' \code{bedtoolsCoverage} is a wrapper for \code{bedtools intersect -c}. #' #' @param bedFiles A character vector of paths to bed files. #' @param windowfile A string specifying the path to the bed file within which to calculate covera...
2,127
mit
e0474f41cf57d4032a9c3c989108c2a059351d79
mariodeng/FirebrowseR
R/Metadata.ClinicalNames.R
#' Retrieve names of all TCGA clinical data elements (CDEs). #' #' Retrieve names of all patient-level clinical data elements (CDES) available in TCGA, unioned across all disease cohorts. A CDE will be listed here only when it has a value other than NA for at least 1 patient case in any disease cohort. For more inform...
962
mit
1488db29eb764dc221de9057684e7cc8c47a0ff9
apache/arrow
r/R/feather.R
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
9,702
apache-2.0
1488db29eb764dc221de9057684e7cc8c47a0ff9
kou/arrow
r/R/feather.R
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
9,702
apache-2.0
572a7be744e216f1346e00a5c6addf8a435f79c0
jukiewiczm/renjin
packages/grid/src/main/R/renjinStubs.R
validUnits <- function(units) { answer <- NULL n <- length(units) integer(n) }
87
gpl-3.0
572a7be744e216f1346e00a5c6addf8a435f79c0
hlin09/renjin
packages/grid/src/main/R/renjinStubs.R
validUnits <- function(units) { answer <- NULL n <- length(units) integer(n) }
87
gpl-3.0
7223aea80129539b0e0a5784023a29875517fc71
nathanlazar/BaTFLED3D
R/im_2_mat.R
#' Plot heatmaps of two matrices in red and blue #' #' Displays two heatmaps of matrices using red and blue colors. Options to scale #' and sort as well as any other graphical parameters with ... Sorting attempts to match #' columns between the two matrices using their correlation over rows. If \code{sort==TRUE} #' th...
5,158
mit
696b261bcf6c6a2a78bfa8525f8bde85c69fa721
CodeGit/SequenceImp
dependencies-bin/macosx/bin/R/lib/R/library/ShortRead/unitTests/test_SRList.R
test_SRList_construction <- function() { srl <- SRList() checkTrue(validObject(srl)) checkEquals(0, length(srl)) srl <- SRList(list()) checkTrue(validObject(srl)) checkEquals(0, length(srl)) srl <- SRList(list(1)) checkTrue(validObject(srl)) checkEquals(1, length(srl)) srl <- ...
568
gpl-3.0
a0e6bac81cf7f18e0f0ba0c5dc8858371b6a15e9
cchacua/m2-migrations
scripts/rsql/queries.R
# To see secure folder: # SHOW VARIABLES LIKE "secure_file_priv"; # mysql -h "localhost" -u "root" -p # PATSTAT dbListTables(patstat) dbListFields(patstat, "TLS201_APPLN") dbListFields(patstat, "TLS211_PAT_PUBLN") dbListFields(patstat, "TLS211_SAMPLE") # rs<-dbGetQuery(patstat, "SELECT APPLN_ID FROM TLS201_APPLN L...
3,462
gpl-3.0
a7034d95277f8c7f29fc568a060c5edaf5538df9
aegorenkov/science_hackday_conservation
cvtest.R
library(boot) setwd("~/DCHackday") data.model <- read.csv("datafinal.csv") odds <- function(x) { exp(x)/(exp(x)+1) } form = formula(protected~ Percent_of_HUC_Rare + MeanPrecip) fold = 10 x <- na.omit(data.model) n <- nrow(x) prop <- n%/%fold newseq <- rank(runif(n)) k <- as.factor((newseq - 1) %/% prop + 1) y...
885
mit
696b261bcf6c6a2a78bfa8525f8bde85c69fa721
CodeGit/SequenceImp
dependencies-bin/linux/bin/R/lib64/R/library/ShortRead/unitTests/test_SRList.R
test_SRList_construction <- function() { srl <- SRList() checkTrue(validObject(srl)) checkEquals(0, length(srl)) srl <- SRList(list()) checkTrue(validObject(srl)) checkEquals(0, length(srl)) srl <- SRList(list(1)) checkTrue(validObject(srl)) checkEquals(1, length(srl)) srl <- ...
568
gpl-3.0
696b261bcf6c6a2a78bfa8525f8bde85c69fa721
CodeGit/SequenceImp
dependencies-bin/windows/bin/R/library/ShortRead/unitTests/test_SRList.R
test_SRList_construction <- function() { srl <- SRList() checkTrue(validObject(srl)) checkEquals(0, length(srl)) srl <- SRList(list()) checkTrue(validObject(srl)) checkEquals(0, length(srl)) srl <- SRList(list(1)) checkTrue(validObject(srl)) checkEquals(1, length(srl)) srl <- ...
568
gpl-3.0
c29b0a495d8eac83cc473b84df69cd985109f1c2
nsmader/acs-constructicon
pickacs/R/measure.R
measure <- function(obj) { UseMethod("measure") } measure.default <- function(obj) { warning("Unknown class: ", class(x)) }
132
agpl-3.0
f4048b383d0ec5fcb68e8cb697e726fcbfbe676f
SergeyMirvoda/da2016
classwork2/vectors.R
#Векторы числовой и строковый num_vector <- c(1, 10, 49) char_vector <- c("a", "b", "c") # Заполните булевый вектор bool_vector <- # Выберите из числового вектора значения при помощи булевого вектора num_vector[bool_vector] # Повторите то же самое для строкововго вектора #Составте булевый вектор из ч...
902
unlicense
f4048b383d0ec5fcb68e8cb697e726fcbfbe676f
SergeyMirvoda/MD-DA-2017
classwork2/vectors.R
#Векторы числовой и строковый num_vector <- c(1, 10, 49) char_vector <- c("a", "b", "c") # Заполните булевый вектор bool_vector <- # Выберите из числового вектора значения при помощи булевого вектора num_vector[bool_vector] # Повторите то же самое для строкововго вектора #Составте булевый вектор из ч...
902
mit
06601c1037b821479f2af97648a4f1d6849afc32
tudob/wfg
R/wfgTrafos.R
# Transformations # the function-names are those in the wfg-paper plus prefix wfg # in the spec the user uses only the part after the "_" (no b/s/r-kind) # conventions used: # a parameter-default of =NA shows that there is a default (which will be calculated on demand) as opposed to a required value # function naming ...
9,321
mit
f357c84594fc4f05c29b8384951fa2ac705e8947
mjsmith037/mjsmith037.github.io
talks/ESA_08.2019/Code/NO-histogram.R
library(magrittr) library(tidygraph) library(ggraph) library(tidyverse) library(broom) library(kableExtra) tidy_p_value <- function(pvals) { ifelse(pvals < 0.001, "< 0.001", format(pvals, digits=0, nsmall=3)) } tidy_t_test_long <- function(dat, grouping, variable) { factor_levels <- unique(dat[[grouping]]) t.te...
4,325
mit
6b2e0643f064c2e59773b18f22c273d86bc7a3c9
cfwstem/faculty-numbers
read-data.R
utkfacultydata<- read.csv('https://docs.google.com/spreadsheets/d/1--oEDQy-DIircR-xfdwLRQ0E_9MuFCF1We423l4YrYM/pub?output=csv')
128
gpl-3.0
619790f457cbb6e7bfa5731bd3b692bca4b37451
BenjiHu/CSCI2963-Labs
lab7/months.R
months remove("months") for(mon in month.name){ print(mon) }
62
mit
40b8521a1bca6eb2bed2863347666a02930e61da
mumtahena/bild_signatures
code/Archive/example_assign_corr.R
## running ASSIGN for raf sing trainingLabelr<-list(control=list(raf=1:12),raf=13:18) sub_dir<-paste(basedir,"raf_25_gene_list",sep='/') dir.create( sub_dir) assign_easy_multi(trainingData = cbind(c_gfp,c_raf),test=c_test,trainingLabel1 = trainingLabelr,g=25,out_dir_base = sub_dir,single = 1) sub_dir<-paste(basedir,"...
2,274
mit
7e6d4e7146f6a12e90065ecead5115b94d21122b
cran/RSAGA
R/RSAGA-core.R
#' Internal functions that determine OS-specific path in which modules might be located. #' #' @name rsaga.get.modules.path #' @rdname rsaga.get.modules.path #' @param sysname character: name of the operating system, determined by default by [base::Sys.info()]: e.g., `"Windows"`, `"Linux"`, `"Darwin"` (for Mac OSX)...
65,948
gpl-2.0
f381e4dcfd3cff5937cbe24efe7a3096ce7eaf4f
radfordneal/pqR
src/library/base/R/pmax.R
# File src/library/base/R/pmax.R # Part of the R package, http://www.R-project.org # Modifications for pqR Copyright (c) 2013, 2017, 2018 Radford M. Neal. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Soft...
4,825
gpl-2.0
a6c083ba7e1e85a3a93e9015fbcc23a97241de3a
wenjie2wang/splines2
inst/examples/ex-ibs.R
library(splines2) x <- seq.int(0, 1, 0.01) knots <- c(0.2, 0.4, 0.7, 0.9) ibsMat <- ibs(x, knots = knots, degree = 1, intercept = TRUE) ## get the corresponding B-splines by bSpline() bsMat0 <- bSpline(x, knots = knots, degree = 1, intercept = TRUE) ## or by the deriv() method bsMat <- deriv(ibsMat) stopifnot(all.equ...
704
gpl-3.0
152ee95bde40e963d4d5df01029384e7ef986b11
mkienzle/NSW-sea-garfish-stock-assessment
docs/docs/Script/CalculatePopulationTrendsWithUncertainties.R
# CREATED 13 Dec 2016 # MODIFIED 19 May 2019 # PURPOSE estimate abundance and recruitment point estimates and uncertainties # METHOD according to S. Brandt, Data Analysis, 1999 Springer-Verlag # The x% confidence region of the log-likelihood is contains with the minimum log-likelihood + chi-square (0.95, 4 df...
3,560
gpl-3.0
152ee95bde40e963d4d5df01029384e7ef986b11
mkienzle/NSW-sea-garfish-stock-assessment
Script/CalculatePopulationTrendsWithUncertainties.R
# CREATED 13 Dec 2016 # MODIFIED 19 May 2019 # PURPOSE estimate abundance and recruitment point estimates and uncertainties # METHOD according to S. Brandt, Data Analysis, 1999 Springer-Verlag # The x% confidence region of the log-likelihood is contains with the minimum log-likelihood + chi-square (0.95, 4 df...
3,560
gpl-3.0
8ec6c23c15e6f034693b7b067e4d6472fd70ab58
karmatarap/e107_Project_Test_Area
r/helper_functions/parse-binary_data.R
#' Parse binary data #' #' @description Parses the data with binary annotation¨ #' #' @author AlexandeR Noll #' #' @return data frame #' #' @examples parse_binary_data() #' @import dplyr, readr, stringr parse_binary_data <- function(type) { library(dplyr) library(purrr) library(readr) library(stringr...
987
mit
1f2815a8826cd0903c2abd9fa3963bd5af6dd9e1
hcommenges/mapfitR
GarminFIT_script.R
########################################### ######## Explore Garmin FIT tracks ######## Script ########################################### # load packages ---- library(lubridate) library(ISOweek) library(ggplot2) library(leaflet) library(sf) library(dplyr) # load functions ---- source(file = "GarminFIT_fct.R") # s...
710
agpl-3.0
a3e0e73a9ac966c61aba18d5a7a274cc48b95ad9
WLOGSolutions/RSuite
packages/RSuite/R/28_repo_manager_dir.R
#---------------------------------------------------------------------------- # RSuite # Copyright (c) 2017, WLOG Solutions # # Repo manager working on directory. Created by rsuite_repo_adapter_dir. #---------------------------------------------------------------------------- #' #' Create repo manager to manag...
4,733
apache-2.0
35fc9ff795ce73636b806120d134c8f3577eb56e
marchtaylor/fishdynr
R/growth_soVB2.R
#' @title seasonally oscillating von Bertalanffy growth function (using L0) #' @description \code{growth_soVB2} describes the growth as a function of age (t) #' using the seasonally oscillating von Bertalanffy growth function (Somers 1988). #' The function differs slightly from \code{\link[fishdynr]{growth_soVB}} #' b...
1,173
mit
aeb543bf12b27c3fc955aea28540b05c95c5f8f3
woobe/h2o
R/tests/testdir_jira/runit_v_11_datemanipulation.R
# # date parsing and field extraction tests # setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f"))) source('../findNSourceUtils.R') datetest <- function(conn){ Log.info('uploading date testing dataset') hdf <- h2o.importFile(conn, normalizePath(locate('smalldata/jira/v-11.csv'))) # df shoul...
2,436
apache-2.0
858fc2ecec7cd26a172fca60b4c5c40661a1fe26
sorensje/R_helperfunctions
zeropad.R
zeropad <- function(x){ if (x %/% 10 < 1){ padded_x <- paste('0',x,sep="") } else{ padded_x <- as.character(x) } return(padded_x) }
151
gpl-2.0
035618c2b2c6e91a9571eb833f30563a40dd9d30
h2oai/h2o-3
h2o-r/demos/rdemo.supervised.large.R
library(h2o) h2o.init() runAll = function(data_path,split_ratio,response,predictors,flag,test_file_path){ #remove all keys from h2o prior to running the function h2o.rm(as.character(grep(pattern = "", x = h2o.ls()$key,value=T))); print(paste("Parse : ",data_path,sep='')); time = system.time(data <- h2o.impor...
6,561
apache-2.0
9410009ce819a05cad8a6ff232c23186882d4472
FTSRG/mondo-sam
reporting/shiny/filters/DataFilter.R
library("R.oo", , quietly = TRUE) #' DataFilter class setConstructorS3(name = "DataFilter", abstract = TRUE, function(selections = NULL){ extend(Object(), "DataFilter", .selections = selections, .container = NULL, .selectedState = NULL, .allCurrentStates = NULL, .allState...
3,190
epl-1.0
adcded77e2798b3a199fb23e99075b1be188c015
pik-piam/magclass
R/read.magpie.R
#' Read MAgPIE-object from file #' #' Reads a MAgPIE-file and converts it to a 3D array of the structure #' (cells,years,datacolumn) #' #' This function reads from 13 different MAgPIE file\_types. "rds" is #' a R-default format for storing R objects."cs2" or "cs2b" is the new standard #' format for cellular data with o...
10,761
lgpl-3.0
73c10f480ead65a507ff46fb0ebecc6f359388cd
harmonlab/angio-pulse
R_scripts/polyploidy_analyses.R
require(geiger) require(phylo) ## USING MLE tree setwd("~/Documents/tank/angiosperms/angio-pulse") # change to match local directory dat=get(load("spermatophyta_AToL_639_PL_MEDUSA_BATCH.effectsize.rda"))$summary # only consider upshifts dat=dat[which(dat$r>0),] # get the tree phy=get(load("spermatophyta_AToL_639_PL...
9,554
gpl-2.0
fe632709746c52681c0186fc369b085ca33c8669
AlDanial/cloc
tests/inputs/utilities.R
# from https://github.com/lme4/lme4 if(getRversion() < "2.15") paste0 <- function(...) paste(..., sep = '') ### Utilities for parsing and manipulating mixed-model formulas ##' From the result of \code{\link{findbars}} applied to a model formula and ##' and the evaluation frame, create the model matrix, etc. associa...
33,475
gpl-2.0
fe632709746c52681c0186fc369b085ca33c8669
richarddavis/cloc
testcode/utilities.R
# from https://github.com/lme4/lme4 if(getRversion() < "2.15") paste0 <- function(...) paste(..., sep = '') ### Utilities for parsing and manipulating mixed-model formulas ##' From the result of \code{\link{findbars}} applied to a model formula and ##' and the evaluation frame, create the model matrix, etc. associa...
33,475
gpl-2.0
fe632709746c52681c0186fc369b085ca33c8669
garbear/cloc
testcode/utilities.R
# from https://github.com/lme4/lme4 if(getRversion() < "2.15") paste0 <- function(...) paste(..., sep = '') ### Utilities for parsing and manipulating mixed-model formulas ##' From the result of \code{\link{findbars}} applied to a model formula and ##' and the evaluation frame, create the model matrix, etc. associa...
33,475
gpl-2.0
fe632709746c52681c0186fc369b085ca33c8669
kindkaktus/cloc
testcode/utilities.R
# from https://github.com/lme4/lme4 if(getRversion() < "2.15") paste0 <- function(...) paste(..., sep = '') ### Utilities for parsing and manipulating mixed-model formulas ##' From the result of \code{\link{findbars}} applied to a model formula and ##' and the evaluation frame, create the model matrix, etc. associa...
33,475
gpl-2.0
a92686491c2980bb92b6421720b4152e64670197
dabrze/swirl_courses
Programowanie_w_R/vapply_i_tapply/initLesson.R
# Path to installed lesson .lessonpath <- file.path(path.package("swirl.pl"), "Courses", "Programowanie_w_R", "lapply_i_sapply") # Path to dataset .datapath <- file.path(.lessonpath, "flag.data.txt") # Load dataset flags <- read.csv(.datapath, header=FALSE) # Set column names colnames(f...
1,067
gpl-3.0
eba7fd47dce215000ec40ffc15aeb7bc692a18fe
nick-ulle/RCompilerExamples
tests/testthat/test_knn.R
# Description: # Tests for the knn example. test_that("compiled order function is correct", { module = compile_knn() .order = module[[".order"]] x = c(1.3, -1.2, 2.1, 3.5, 7.1, -20, 4) result = .llvm(.order, x, length(x)) target = order(x) expect_equal(result, target) x = c(-0.33, 2.02, -1.7, -1.01, ...
2,426
mit
fde8b72a8959b0b477abaf7018d436e493491701
benjjneb/dada2
R/paired.R
################################################################################ #' Merge denoised forward and reverse reads. #' #' This function attempts to merge each denoised pair of forward and reverse reads, #' rejecting any pairs which do not sufficiently overlap or which contain too many #' (>0 by default) mi...
12,097
lgpl-3.0
fe632709746c52681c0186fc369b085ca33c8669
cosmicexplorer/cloc-code
testcode/utilities.R
# from https://github.com/lme4/lme4 if(getRversion() < "2.15") paste0 <- function(...) paste(..., sep = '') ### Utilities for parsing and manipulating mixed-model formulas ##' From the result of \code{\link{findbars}} applied to a model formula and ##' and the evaluation frame, create the model matrix, etc. associa...
33,475
gpl-2.0
fe632709746c52681c0186fc369b085ca33c8669
nexB/cloc-mirror
testcode/utilities.R
# from https://github.com/lme4/lme4 if(getRversion() < "2.15") paste0 <- function(...) paste(..., sep = '') ### Utilities for parsing and manipulating mixed-model formulas ##' From the result of \code{\link{findbars}} applied to a model formula and ##' and the evaluation frame, create the model matrix, etc. associa...
33,475
gpl-2.0
ba8818e94cff901dd5fa651e2a9b6388c267492d
jackwasey/icd
R/who.R
# TODO: only download (and cache) WHO data as needed, rather than forcing user to wait minutes to download everything on first use. #' Functions to get the WHO ICD-10 English 2016 and French 2008 data #' @param resource Fragment of URL with specific ICD-10 resource requested #' @param year Four-digit year as integer o...
10,104
gpl-3.0
d0e8a92d7271387a234583b2ef181bc631558a53
kyoren/https-github.com-h2oai-h2o-3
h2o-r/tests/testdir_algos/glm/runit_NOPASS_GLM_forloop_attack_medium.R
setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f"))) source('../../h2o-runit.R') # Constants and setters bools <- c(TRUE, FALSE) set_x <- function(cols) { if(sample(bools,1)) { while (TRUE){ myX <- cols for(i in 1:length(cols)) if (sample(bools, 1)) myX <- myX[-i] ...
6,943
apache-2.0
300efa20cd1230fd1e6f534413021473a44021c9
caus-am/aci
R/utils/next_colex_comb.R
next_colex_comb<-function(x) { #For a 0-1 vectors gives a next #Can be used to quickly iterate over all subset of a given size. #Just start with (1,1,1,….,1,0,…,0). In the end returns 0. #The underlying mechanism to determine the successor is to determine the lowest block of ones #and move its highest bit one positio...
617
bsd-2-clause
329b1c1c8c86b8530af11a063810f68ee4841d66
heggy231/R_Bootcamp_DataWeek_2015
8_-_Data_Manipulation.R
# title: "8 - Data Manipulation" author: "Joseph Rickert" date: "September 28, 2015" # In this script we will show some basic data wrangling. ## Fetch some data from Yahoo Finance # Go to http://finance.yahoo.com/q/hp?s=IBM+Historical+Prices and copy the link to the table. # Then read the data directly from the ...
5,394
mit
329b1c1c8c86b8530af11a063810f68ee4841d66
joseph-rickert/R_Bootcamp_DataWeek_2015
8_-_Data_Manipulation.R
# title: "8 - Data Manipulation" author: "Joseph Rickert" date: "September 28, 2015" # In this script we will show some basic data wrangling. ## Fetch some data from Yahoo Finance # Go to http://finance.yahoo.com/q/hp?s=IBM+Historical+Prices and copy the link to the table. # Then read the data directly from the ...
5,394
mit
73ff14eebb0796f2b0551c5b691905cca074806c
illiHub/R
Misc/eventDetails.R
########################################### # SCRIPT START ########################################### # set working directory setwd(workdir1) # import table #j<-1 for (j in 1:length(subjects)){ file <- subjects[j] mainmat_events <- read.table(file, header = T, sep = "\t", dec = ",",fill = FALSE, na.strings="NA", bla...
2,425
mit
6180ac829ef92cf962600e5271eaff80d35b6562
personlin/GMPEhaz
R/Crustal_Common_Form.R
#' GMPE function for Crustal Common form 001 (2017) #' #' \code{Cru.Com.001} returns the ground-motion prediction with it sigma of Crustal Common form 001 GMPE. #' #'Crustal Common form 001 #' #' @param Mag Earthquake momnet magnitude, Numeric. #' @param Rrup Rupture distance(km), Numeric. #' @param Rjb Joyner and Boor...
32,534
gpl-3.0
4c313053b91967aa4b77b73a79afdac976b09a64
poissonconsulting/tulip
R/directory.R
#' Delete directory #' #' Deletes directory specified by dir after possibly checking with user. #' #' @param dir a character scalar of the directory to delete #' @param check a logical scalar indicating whether to check with user #' @return an invisible logical scalar indicating whether successful. #' @export delete_...
2,000
mit
8fd195072e11ab254775e00004b28e6e61639938
sje30/eglen2015
vignettes/w81s1_sims.R
## ---- get-rgc-data ##rgc.of = read.table('~/mosaics/data/w81s1of.txt') ##rgc.on = read.table('~/mosaics/data/w81s1on.txt') rgc.of.file = system.file("extdata/w81s1/w81s1of.txt", package="eglen2015") rgc.on.file = system.file("extdata/w81s1/w81s1on.txt", package="eglen2015") rgc.w.file = system.file("extdata/w81s1/w8...
717
mit
2f9094fe4a55b43a6d315c9a0f11feebacb072a7
bmatthie/diamonds
ui.R
# =========================================================================== # File: ui.R # # Copyright 2015 Brian Robert Matthiesen # # 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 # # h...
1,486
apache-2.0
f677e3288b3a86caf188aa02fa8c2f78e80d7339
petertbryant/MidCoastTMDL
05e_ParameterUncertaintyAnalysis.R
library(SSN) library(plyr) library(RODBC) library(ggplot2) library(reshape2) library(MASS) options(stringsAsFactors = FALSE) #Get fit object from 06_scenarios.R fit <- models[[7]] #Generate confidence intervals using assumptions of indepent normality df_ci <- confint.glmssn(fit, level = .9) df_ci <- cbind(df_ci, fit$...
1,739
gpl-3.0
71f2f9e5271cabf7a4b433bac531e35f89fd6cc9
wch/r-source
src/library/tools/R/userdir.R
# File src/library/tools/R/userdir.R # Part of the R package, https://www.R-project.org # # Copyright (C) 2020 The R Core Team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either vers...
2,861
gpl-2.0
83de570ca3872b4a79f72dbfd9d6ac96e4101dca
XiaoruiZhu/AdpQMLE
AdaptQMLE/R/gen.lin.R
#' Generating function for single linear model y = a + b*x. #' #' @title Single linear model y = a + b*x. #' #' @param intercept The intercept of single linear model. #' @param slope The parameter b, which is the slope of y = a + b*x. #' @param noise.variance The variance of error series. #' @param x The depedent varia...
998
mit
fc70d93d079bfa82849db3d7e073b90fced998f7
tomoakin/TCC
TCC/tests/DESDES1.R
library(TCC) set.seed(12734) tcc <- simulateReadCounts(Ngene = 100, PDEG = 0.2, DEG.assign = c(0.9, 0.1),replicate=c(1,1)) tcc <- calcNormFactors(tcc, norm.method = "deseq", test.method = "deseq", FDR = 0.1, floorPDEG = 0.05) cat("tcc$norm.factors: ") cat(tcc$norm.factors) cat("\n") cat("tcc$s...
382
gpl-2.0
c5ae5684555d54c3833ef3bb143e00aec757ed6a
52North/sensorweb4R
R/class-timeseries.R
#' @include generic-methods.R #' @include class-phenomenon.R #' @include class-service.R #' @include class-feature.R #' @include class-offering.R #' @include class-procedure.R #' @include class-category.R #' @include class-station.R #' @include class-tvp.R NULL #' Timeseries #' #' Represents a timeseries. #' #' @famil...
12,619
apache-2.0
e95ff8bfbf65ee55e1ac57b3c30e182f521a227b
cxxr-devel/cxxr
src/extra/testr/filtered-test-suite/max/tc_max_27.R
expected <- 3 test(id=23, code={ argv <- structure(list(2, 3, NA, na.rm = TRUE), .Names = c("", "", "", "na.rm")) do.call('max', argv); }, o = expected);
157
gpl-2.0
e95ff8bfbf65ee55e1ac57b3c30e182f521a227b
kmillar/cxxr
src/extra/testr/filtered-test-suite/max/tc_max_27.R
expected <- 3 test(id=23, code={ argv <- structure(list(2, 3, NA, na.rm = TRUE), .Names = c("", "", "", "na.rm")) do.call('max', argv); }, o = expected);
157
gpl-2.0
e95ff8bfbf65ee55e1ac57b3c30e182f521a227b
ArunChauhan/cxxr
src/extra/testr/filtered-test-suite/max/tc_max_27.R
expected <- 3 test(id=23, code={ argv <- structure(list(2, 3, NA, na.rm = TRUE), .Names = c("", "", "", "na.rm")) do.call('max', argv); }, o = expected);
157
gpl-2.0
bbcd7b37a4df12cd9a36b1905aec0c4cddb1e205
splaticvoid/datasciencecoursera
Assignment 1/complete.R
complete <- function(directory, id = 1:332) { ## 'directory' is a character vector of length 1 indicating ## the location of the CSV files ## 'id' is an integer vector indicating the monitor ID numbers ## to be used ## Return a data frame of the form: ## id nobs ## 1 117 ## 2 1041 ## ... ## ...
1,541
cc0-1.0
e95ff8bfbf65ee55e1ac57b3c30e182f521a227b
kmillar/rho
src/extra/testr/filtered-test-suite/max/tc_max_27.R
expected <- 3 test(id=23, code={ argv <- structure(list(2, 3, NA, na.rm = TRUE), .Names = c("", "", "", "na.rm")) do.call('max', argv); }, o = expected);
157
gpl-2.0
e95ff8bfbf65ee55e1ac57b3c30e182f521a227b
rho-devel/rho
src/extra/testr/filtered-test-suite/max/tc_max_27.R
expected <- 3 test(id=23, code={ argv <- structure(list(2, 3, NA, na.rm = TRUE), .Names = c("", "", "", "na.rm")) do.call('max', argv); }, o = expected);
157
gpl-2.0
e95ff8bfbf65ee55e1ac57b3c30e182f521a227b
krlmlr/cxxr
src/extra/testr/filtered-test-suite/max/tc_max_27.R
expected <- 3 test(id=23, code={ argv <- structure(list(2, 3, NA, na.rm = TRUE), .Names = c("", "", "", "na.rm")) do.call('max', argv); }, o = expected);
157
gpl-2.0
376eec2b46b7f8aca2756688676e56d0a1106212
mexindian/TileMaker
tests/testthat.R
library(testthat) library(TileMaker) test_check("TileMaker")
62
mit
73b2aae2e90d43d90bf04a6128c96bf80a11fa16
aappling-usgs/gsplot
R/lines.R
#' gsplot lines #' #' Creating a line by specifying specific plot points. See \code{\link[graphics]{lines}} for more details. #' #' @param object gsplot object #' @param \dots Further graphical parameters may also be supplied as arguments. See 'Details'. #' #' @details Additional graphical parameter inputs: #' \ite...
1,958
cc0-1.0
73b2aae2e90d43d90bf04a6128c96bf80a11fa16
jiwalker-usgs/gsplot
R/lines.R
#' gsplot lines #' #' Creating a line by specifying specific plot points. See \code{\link[graphics]{lines}} for more details. #' #' @param object gsplot object #' @param \dots Further graphical parameters may also be supplied as arguments. See 'Details'. #' #' @details Additional graphical parameter inputs: #' \ite...
1,958
cc0-1.0
73017f0a824a912163a9f897515f8df287f4918a
ivanhigueram/deforestacion
modeling/reg_dis_het_effects.R
############################################################################################## ############################################################################################## ### RUN REGRESSION DISCONTINUITY MODELS ### ### THIS CODE WILL READ THE DIS...
23,029
mit
dcbfcb072cee134e44e035cf1bb2435dc3d1ec09
B1aine/kaggle-allstate
doSubmission.R
library(cvTools) library(gbm) ######################################## ############## TRAINING ################ ######################################## load('data/train_2014.04.05.RData') nam = names(data) omitClass <- c(which(nam=="targetA"),which(nam=="targetB"),which(nam=="targetC"),which(nam=="targetD"), ...
4,343
mit
fa7b616742d8eddd1ece1f5a8e85373c81052129
happynotes/PIHM.AnalysisR
R/datafilter.R
#' Find the cells/segments that match your filters. #' Developed by Lele Shu( lele.shu at gmail.com lzs157 at psu.edu ) #' Created by Fri Apr 17 14:11:46 EDT 2015 #' #' @param data in TS #' @param filter. If filter<0, find the IDs where is smaller than filter. If filter>0, find the IDs where is larger than filter...
5,597
gpl-2.0
73017f0a824a912163a9f897515f8df287f4918a
banco-republica-research/deforestacion
modeling/reg_dis_het_effects.R
############################################################################################## ############################################################################################## ### RUN REGRESSION DISCONTINUITY MODELS ### ### THIS CODE WILL READ THE DIS...
23,029
mit
5fe0311ef0711532e4176209605ff6e1af56eb66
thehyve/Rmodules_oncoprint
web-app/Rscripts/Heatmap/HeatmapLoader.R
########################################################################### # Copyright 2008-2012 Janssen Research & Development, LLC. # # 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 # # ...
12,166
apache-2.0