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
4e350fe7700d43fa68fcbcdd405247b5332a882a
noelnamai/RNeo4j
R/getSinglePath.R
getSinglePath = function(graph, query, ...) UseMethod("getSinglePath") getSinglePath.default = function(x, ...) { stop("Invalid object. Must supply graph object.") } getSinglePath.graph = function(graph, query, ...) { stopifnot(is.character(query), length(query) == 1) params = list(...) resul...
830
mit
7b49be15a367a60bd3b3bd444e138f409940077b
scottshepard/datasciencecoursera
ExploratoryDataAnalysis_CourseProject2/plot5.R
# This is a script to produce a plot showing the tons of emissions of PM2.5 # from vehicles in the United States between 1999 and 2008. # Load the plyr package for the daply function library(plyr) # Clear the environment and set the working directory rm(list=ls()) DataFolder <- "~/code/datasciencecoursera/data/exdata...
1,039
mit
413e87544fd5591f7a0a34d847fb3c9cb177c68f
derekbeaton/outlieRs
Package/R/varHeatmaps.R
varHeatmaps <- function( dat # output from multiOut$hidden_detail (or any list with contrib, and CorrMat elements) ){ contrib <- dat$Contribs corrmat <- dat$corrMat # heatmap of outliers by variable contribution -- hoping to see which variables contribute the most to each outlier contribOut <- contrib[whic...
1,569
gpl-3.0
0dd16437fa8857d037b3b305cd92e2d00827b25a
tzerk/EGU2017-PICO
snippets/table_rlumshiny.R
info_table_rlumshiny <- function() { tags$div(class = "table-responsive", tags$table(class = "table table-hover table-condensed", tags$thead(tags$th("QR Code"), tags$th("Link"), tags$th("Description") ...
1,549
mit
52953df6a584fc287bc02e050c580286cd4bdae8
anobel/icd
tests/testthat/test-refactor.R
context("refactor") test_that("simple cases", { expect_identical( refactor(factor("a", levels = "a"), "a"), factor("a", levels = "a") ) expect_identical( refactor(factor(NA, levels = "a"), "a"), factor(NA, levels = "a") ) expect_identical( refactor(factor(NA, levels = "a"), "b"), fact...
18,276
gpl-3.0
2532b8b9b8b6397d34f6c676c07ed93a0d06b63a
fingerhuth/NG-POC-resistance
scripts/s_run-model_12dd.R
# for timepoint tp, calculate prevalence, incidence and proportion resistance and their summary statistics (median, mean, lower 50%, upper 50%, lower 95%, upper 95%) # output: only summary statistics! # - sus.prev: summary statistics for prevalence # - sus.inc: summary statistics for incidence # - sus...
6,915
mit
4c39fa56fe544dcdb4f32c693b11ccdf97aa9b25
Contosta/vernal-windows
baseflow_peak.R
# # code by M Green # gages = c("01052500", "01064801", "01064500", "01073500", "01092000", "01137500", "01152500", "01161000", "01072800", "01076500", "01082000", "01086000", "01089500", "01094000", "01091000") doys = matrix(0, length(gages), 4) for(j in 1:length(gages)){ gage=gages[j] url=paste("http://waterdata....
2,588
mit
b198cdd19b8c99f78d9439fbe3650af87c048d25
mensxmachina/MXM-R-Package
R/testIndZIP.R
testIndZIP = function(target, dataset, xIndex, csIndex, wei = NULL, univariateModels=NULL, hash = FALSE, stat_hash=NULL, pvalue_hash=NULL) { #initialization #if the test cannot performed succesfully these are the returned values pvalue = log(1); stat = 0; csIndex[ which( is.na(c...
4,381
gpl-2.0
fd596d22019e255587e246ee17f659dfe5f4772d
EDRN/labcas-pges
biomarker_discovery/bin/SplitCV.R
# Author: Joe Perez-Rogers # Date: 2014-05-11 # Script to create k-fold cross-validation splits of an expression set object # Usage: splitCV() # Input: x=an expression set object, pct=the percentage of samples you want in your test set # Output: SplitCV <- function(x,pct=0.20){ data <- c(1:nrow(pData(x))) refs <- s...
385
apache-2.0
36b58e63831c58c8b36e029398121aa768e6e555
nhingo/culture-emotion-attention
GRF1314_Rproj/GRF1314MOODEYE.R
###SET UP#### #general dir for GRF1314, as other data files are not stored in the R project folder #for administrative purposes #because the working dir for an R project, when loaded into Rstudio, is always the folder #with the R project file, we go up one level to get to the general dir gendir <- dirname(getwd()) mood...
8,666
mit
73f089bbea5f7de51cd4899f6bdcfec89ada2faa
frichote/replop
CL_code/release/LEA/meta/LEA/R/readEnv.R
read.env <- function(input.file) { # test arguments if(missing(input.file)) stop("'input.file' argument is missing.") else if (!is.character(input.file)) stop("'input.file' argument has to be of type character.") # check extension test_extension(input.file, ...
377
gpl-3.0
84822b429cd1425d2c0287154fb6aa75ee3df7fb
jtrecenti/jurimetria
R/crawler_metadata_ja.R
#' Retorna data.frames com metadados do Justica Aberta. #' #' Essa funcao retorna metadados uteis para a pesquisa jurimetrica atraves do sistema #' Justica Aberta. Dependendo do tipo ("muni", "vara", "prod"), retorna um nivel diferente de #' metadados. Os parametros ufs, cod_muni e cod_vara ajudam a determinar quai...
7,281
mit
168ef663aa0d0b9b0d1508b0a4d8b3c92dc47782
jtrecenti/tjspApp
data-raw/load.R
library(dplyr) library(tidyr) library(stringr) library(ggplot2) # join comarcas e fortified map ----------------------------------------------- data(d_map_sp, package = 'shapefiles') muda_nomes <- function(d, v, valor1, valor2) { v <- deparse(substitute(v)) for(i in seq_along(valor1)) d[[v]][d[[v]] == valor1[i]] ...
8,445
gpl-2.0
66337516dfb6764517e67eeb4242732e74eecb03
neumannd/WorkingExamples
db/R_TOOLS/emepDB/R/completeFSubstance.RODBC.R
#' private: set a row in the f_substance table as 'complete' #' #' Sets the 'complete' boolean of one entry in table 'f_substances' #' to TRUE. Returns whether it was successful or not. Does not test #' whether an entry exists, in advance. The database #' access is provided by 'channel'. #' #' @param channel RODBC: h...
1,321
gpl-3.0
cb7f4e276fb4c2d85900c30924516e3faf3bdba1
jstagge/paleo_flow_shiny
code/paleo_flow/functions/unit_conv.R
### This function is applied to columns to modify the units ### New units can be added here as long as they are applied to the original m3/s data unit_conv <- function(x, new_unit, date, temp_resolution, begin_month=1, end_month=12){ if (new_unit == "cfs"){ x * 35.31467 ### convert m3s to cfs } else if(new_unit ==...
2,171
mit
4adadf6f466acda1025b006cdaea348871f4043b
jar1karp/rstudio
src/cpp/session/modules/SessionRCompletions.R
# # SessionRCompletions.R # # Copyright (C) 2014 by RStudio, Inc. # # Unless you have received this program directly from RStudio pursuant # to the terms of a commercial license agreement with RStudio, then # this program is licensed to you under the terms of version 3 of the # GNU Affero General Public License. This p...
101,660
agpl-3.0
3b9258e1864fa798b12d433a515a77563a628acd
andrewdefries/andrewdefries.github.io
FDA_Pesticide_Glossary/1,1'-(2,2-dichloroet.R
library("knitr") library("rgl") #knit("1,1'-(2,2-dichloroet.Rmd") #markdownToHTML('1,1'-(2,2-dichloroet.md', '1,1'-(2,2-dichloroet.html', options=c("use_xhml")) #system("pandoc -s 1,1'-(2,2-dichloroet.html -o 1,1'-(2,2-dichloroet.pdf") knit2html('1,1'-(2,2-dichloroet.Rmd')
276
mit
9ec4b0281789ab6700bf3b3d0e152b5923d5abf6
radfordneal/pqR
src/library/utils/R/utils-deprecated.R
# File src/library/utils/R/utils-deprecated.R # Part of the R package, http://www.R-project.org # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at ...
973
gpl-2.0
51443c87a9783c113c46ded1991108d6f10f0a86
glycerine/bigbird
r-3.0.2/src/library/graphics/R/stripchart.R
# File src/library/graphics/R/stripchart.R # Part of the R package, http://www.R-project.org # # Copyright (C) 1995-2012 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; e...
4,260
bsd-2-clause
9ec4b0281789ab6700bf3b3d0e152b5923d5abf6
hlin09/renjin
packages/utils/src/main/R/utils-deprecated.R
# File src/library/utils/R/utils-deprecated.R # Part of the R package, http://www.R-project.org # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at ...
973
gpl-3.0
294486dd91ba9a287505fb1bfce82aa9351481db
irceline/sensorweby
inst/examples/combinedAnalysis/server.R
# Copyright 2014 52°North Initiative for Geospatial Open Source Software GmbH # # 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 req...
6,488
apache-2.0
6809027dc91af66f21bec4d278222596c411128d
mrwizard82d1/DBDA2Eprograms
Jags-Ydich-XnomSsubj-MbernBetaOmegaKappa-Example.R
# Example for Jags-Ydich-XnomSsubj-MbernBetaOmegaKappa.R #------------------------------------------------------------------------------- # Optional generic preliminaries: graphics.off() # This closes all of R's graphics windows. rm(list=ls()) # Careful! This clears all of R's memory! #-------------------------...
3,140
mit
6809027dc91af66f21bec4d278222596c411128d
bdetweiler/stat-8416-final-project
DBDA2Eprograms/Jags-Ydich-XnomSsubj-MbernBetaOmegaKappa-Example.R
# Example for Jags-Ydich-XnomSsubj-MbernBetaOmegaKappa.R #------------------------------------------------------------------------------- # Optional generic preliminaries: graphics.off() # This closes all of R's graphics windows. rm(list=ls()) # Careful! This clears all of R's memory! #-------------------------...
3,140
mit
51443c87a9783c113c46ded1991108d6f10f0a86
cxxr-devel/cxxr-svn-mirror
src/library/graphics/R/stripchart.R
# File src/library/graphics/R/stripchart.R # Part of the R package, http://www.R-project.org # # Copyright (C) 1995-2012 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; e...
4,260
gpl-2.0
6670c5847e3ab893902dd7d707557bea9e29ddf6
mensxmachina/MXM-R-Package
R/testIndLMM.R
testIndLMM <- function(target, reps = NULL, group, dataset, xIndex, csIndex, wei = NULL, univariateModels = NULL, hash = FALSE, stat_hash = NULL, pvalue_hash = NULL, slopes = FALSE) { # TESTINDGLMM Conditional Independence Test based on generalised linear mixed models for normal, binary r...
5,486
gpl-2.0
3b97037784f69b8820db9b82b3dbb5b0d5d3571d
uzh/ezRun
R/app-SCCountQC.R
################################################################### # Functional Genomics Center Zurich # This code is distributed under the terms of the GNU General # Public License Version 3, June 2007. # The terms are available here: http://www.gnu.org/licenses/gpl.html # www.fgcz.ch EzAppSCCountQC <- setRefClass...
8,972
gpl-3.0
1861ecf865f8a2e347b35f28bcd70bc1566b7622
debarros/RScantron
MasterScript.R
# R/Scantron Interface # by Paul de Barros (pj.deBarros@gmail.com) # Repository located at https://github.com/debarros/RScantron #------------------# #### Initialize #### #------------------# gc() #garbage collection clears data no longer being used from memory source("functions.R") #load the functions source("credent...
6,601
gpl-2.0
789e2f002578aad5adb42b13f7618e2edbf13ce0
WelkinGuan/r-source
src/library/base/R/datetime.R
# File src/library/base/R/datetime.R # Part of the R package, https://www.R-project.org # # Copyright (C) 1995-2015 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...
34,816
gpl-2.0
789e2f002578aad5adb42b13f7618e2edbf13ce0
nathan-russell/r-source
src/library/base/R/datetime.R
# File src/library/base/R/datetime.R # Part of the R package, https://www.R-project.org # # Copyright (C) 1995-2015 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...
34,816
gpl-2.0
789e2f002578aad5adb42b13f7618e2edbf13ce0
abiyug/r-source
src/library/base/R/datetime.R
# File src/library/base/R/datetime.R # Part of the R package, https://www.R-project.org # # Copyright (C) 1995-2015 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...
34,816
gpl-2.0
789e2f002578aad5adb42b13f7618e2edbf13ce0
LeifAndersen/R
src/library/base/R/datetime.R
# File src/library/base/R/datetime.R # Part of the R package, https://www.R-project.org # # Copyright (C) 1995-2015 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...
34,816
gpl-2.0
789e2f002578aad5adb42b13f7618e2edbf13ce0
andy-thomason/r-source
src/library/base/R/datetime.R
# File src/library/base/R/datetime.R # Part of the R package, https://www.R-project.org # # Copyright (C) 1995-2015 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...
34,816
gpl-2.0
789e2f002578aad5adb42b13f7618e2edbf13ce0
mathematicalcoffee/r-source
src/library/base/R/datetime.R
# File src/library/base/R/datetime.R # Part of the R package, https://www.R-project.org # # Copyright (C) 1995-2015 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...
34,816
gpl-2.0
70e8b05b494199efa813d091efb1f786639f6753
shenlab-sinai/pipelines_for_ChIP-seq_analysis
bin/GO_homer_ggplot2.R
#! /usr/bin/env Rscript args <- commandArgs(TRUE) file.path <- args[1] p.val.cutoff <- as.numeric(args[2]) readGO <- function(file.name, result.path){ x <- read.table(paste(result.path, "/", file.name, sep=""), stringsAsFactors=FALSE, sep="\t", comment.char="", header=TRUE, quote="", fill=TRUE) if("P.value" %i...
2,046
lgpl-2.1
f6c86bce13dc801176f9e56f76cb726a986bd916
ecor/geotoppoints
inst/examples/postprocessGeotop1dSimulation_latest.R
# file postprocessGeotop1dSimulation.R # # # This file contains a script which plots point value of pressure head or other variables calculated by a GEOtop simulation versus time # # # author: Emanuele Cordano on 19-12-2013 # #This program is free software: you can redistribute it and/or modify #it under the terms of...
5,796
gpl-2.0
d764fcba4dbc670e89d8c632348b1d2a52ba26e1
spoonbill/nectr
R/clsMRes.R
clsMRes <- function(data, keep = TRUE, r.start = NA, r.max = Inf, ...) { mc <- match.call() dataset.name <- toString(as.list(mc)$data) #*********************************** # INITIALISATION #*********************************** r <- 1 #Initialise resolution i <- 1 ...
8,593
gpl-2.0
31e305505d972d54d6b2ecb6c4630c037bf7850b
coreyabshire/ivmooc-gtap
motionchart.R
# # read raw data, cleanup values less than 1mUSD, save as trade.clean # library(dplyr) library(ggplot2) library(googleVis) load("trade.clean") trade <- read.csv("C:/tstrade.csv", header=TRUE, col.names=c("comm","exp","imp","year","value"), colClasses=c("factor","factor","fac...
1,915
mit
2dd5e3877167e6a614dce92dfd919eef2badaeec
florianerhard/gedi
GediRiboSeq/src/scripts/start_eval.R
args=commandArgs(T) t=read.delim(args[1]) pdf(args[2]) plot(ecdf(t$Posterior)) barplot(table(((t$Posterior>=0.9)+t$Before.in.posterior.bin+t$After.in.posterior.bin)>0,cut(t$Sinh.mean,breaks=c(0,0.1,0.5,1,5,Inf))),beside=T,main="Any >=0.9 per activity bin") plot(ecdf(t$Before.in.posterior.bin[t$Posterior>=0.9]),main="...
566
apache-2.0
f327a90e4744be7454b1e20d96895228cf6fbf08
quadrama/DramaAnalysis
R/report.R
#' @title Report #' @description generates a report for a specific dramatic text #' @param id The id of the text or a list of ids #' @param of The output file #' @param type The type of the report. "Single" gives a report about a single play, #' while "Compare" can be used to compare multiple editions of a play. Pleas...
1,134
gpl-3.0
8f104fc24b7b6968c796bf67de94ed0834c4aa6e
jeremyzechar/csep-italy
simulateCatalogConsistentWithForecast.R
SimConsistentCatalog <- function(n, lambda){ # Simulate a vector of integer quantiles x given the vector of non-negative # means lambda, normalized such that their sum is unity. the integer # quantiles should be simulated in a way that is consistent with lambda. # n is the total number of events to...
962
gpl-3.0
6f5e2cc80acbc52ecb5b70842fe703b53842c0f6
b-k/tea-tutorial
edit.R
library(tea) readSpec("edit.spec") # Because the data are already clean, let's insert some errors to edit. dbGetQuery(teaenv$con, "update viewdc \ set pincp=1000 where agep = 12") dbGetQuery(teaenv$con, "update viewdc \ set schl=22 where agep between 10 and 14 and id%2 == 0") d...
340
unlicense
abaf7522be00e93b1dfa90366ef12af5b71745c7
wStockhausen/wtsDisMELSConn
R/extractIndivIDs.R
#' #'@title Extract unique IDs for individuals from a DisMELS model run #' #'@description Function to extract unique IDs for individuals from a DisMELS model run. #' #'@param indivConn - individual connectivity file (or dataframe) #'@param lhsTypeInfo - life stage info list for IBM (req'd if onlySuccessful=...
4,706
mit
4f5a38265e2fd1ba17320fe96f710d112b3a8314
compops/phd-thesis
example-philips/ex-philips-qpmh2.R
############################################################################## ############################################################################## # Example 4.1 # Particle Metropolis-Hastings for Swedish inflation/unemployment # Reproduces Figure 4.5 # # Copyright (c) 2016 Johan Dahlin [ johan.dahlin (at) li...
4,714
gpl-3.0
960e60a91a8653bdf39cd4b464973f416dcd0580
sammorris81/rare-binary
markdown/dec2015/first-run-sim/dec-sim-5.R
# load packages and source files rm(list=ls()) options(warn=2) library(fields) library(evd) library(spBayes) library(fields) library(SpatialTools) # library(microbenchmark) # comment out for beowulf library(mvtnorm) library(Rcpp) library(numDeriv) library(pROC) Sys.setenv("PKG_CXXFLAGS"="-fopenmp") Sys.setenv("PKG_LIB...
7,757
gpl-2.0
a8e8f56f1c9802d3ec38fb1a13edf78cfa42c303
enbrown/iol-calculations
R/Haigis.R
#' Haigis Formula for Effective Lens Position #' #' Calculate IOL effective lens position for emmetropia given axial length (L), #' anterior chamber depth (ACD), and a lens constant (a0, pACD, or A must be #' supplied.) If pACD is given, it is converted to an approximate a0 constant. #' If A is given, it is first c...
4,124
agpl-3.0
010472a2cea874dd3716f01f0343a254b00d0e94
rsachse/renetools
R/myfile.R
myfile <- function(path,file){ out <- paste(path,file,sep="") out }
72
gpl-2.0
e399386c95aba5f12e1420cc6f5eacdba3568b63
elahi/cupCorals
bael_recruitSize.R
################################################# # Author: Robin Elahi # Date: 150828 # Coral recruit size # Figure 4 ################################################# library(lme4) library(ggplot2) library(AICcmodavg) #rm(list=ls(all=TRUE)) # removes all previous material from R's memory source("./R/graphicalPara...
3,219
mit
78ac3f62624d5c108fd0d5d070cd5698c08ffd76
wStockhausen/rTCSAM2013
R/plotData.R
#' #'@title Function to plot TCSAM2013 input data from a .R file #' #'@description This function plots input data to TCSAM2013 from a .R output file #' #'@details Creates a set of plots (in a pdf file, if desired) from a TCSAM2013 .R #'output file. #' #'@param lst - the data list object #'@param fn - the file #'@param...
1,877
mit
ef6af080fab9a0545fa7ebad1eda3cd5df1f806f
cran/magclass
tests/testthat/test-collapseDim.R
context("CollapseDim Test") test_that("arguments (dim and keepdim) work", { x <- maxample("animal") expect_identical(x, collapseDim(x, keepdim = c(2.3, 3.1))) expect_identical(collapseDim(x), collapseDim(x, dim = c(3.1, 2.3))) expect_identical(getItems(collapseDim(x[, , "rabbit"]), dim = 3), c("black", "white"...
1,602
lgpl-3.0
31216299de854b6a02cb0f8203c2d3bec0c62f2f
mghandi/gkmSVM
R/gkmsvm_trainCV.R
# repeated CV # nCV: number of CV folds # nrepeat: number of repeated CVs # cv: CV group label. An array of length (npos+nneg), containing CV group number (between 1 an nCV) for each sequence. (optional) # C: a vector of all values of C (SVM parameter) to be tested. (optinal) # showPlots: generate plots (default==TRU...
9,552
gpl-3.0
7a32f8b6879e37ac97dfd0084f3fc0bfb5907286
kosukeimai/FindIt
R/FindIt-package.R
#' FindIt: Finding Heterogeneous Treatment Effects #' #' \tabular{ll}{ Package: \tab factorEx\cr Type: \tab Package\cr Version: \tab 1.1.5\cr #' Date: \tab 2019-11-19\cr} #' #' @name FindIt-package #' @aliases FindIt-package CreateWeights CreatelevelIndex lengthSlack Lcombinefunction #' PsyConstraintCombine CreateWeigh...
5,583
gpl-2.0
ef6af080fab9a0545fa7ebad1eda3cd5df1f806f
pik-piam/magclass
tests/testthat/test-collapseDim.R
context("CollapseDim Test") test_that("arguments (dim and keepdim) work", { x <- maxample("animal") expect_identical(x, collapseDim(x, keepdim = c(2.3, 3.1))) expect_identical(collapseDim(x), collapseDim(x, dim = c(3.1, 2.3))) expect_identical(getItems(collapseDim(x[, , "rabbit"]), dim = 3), c("black", "white"...
1,602
lgpl-3.0
6fe1a028d1bb1479a92b7957bbd4fad65a937d80
jminnier/STARTapp
server-analysisres.R
## ==================================================================================== ## # START Shiny App for analysis and visualization of transcriptome data. # Copyright (C) 2016 Jessica Minnier # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Publi...
4,988
gpl-3.0
e6813ba116283a06594f4820566f426964f78f2a
flaneuse/llamar
R/check_font.R
#' @title Checks font is installed in the system #' #' #' @description #' Checks if a given font is installed in the system. #' #' @param font_name string containing the font name #' #' # @import extrafont #' @examples #' check_font('Arial') #' check_font('ARIAL') #' replace_font('ARIAL') # Returns 'sans' #' @d...
916
mit
a97b9017dcc1562a47cc4edd648459a0445622cf
kogreger/AAU2015
Scripts/script07.R
#' Workshop on analysing spatial point patterns with spatstat #' Aalborg, April 2015 #' #' Lecturer's R script #' Session 7: Envelopes and Monte Carlo tests #' #' Copyright (c) Adrian Baddeley and Ege Rubak 2015 #' library(spatstat) set.seed(42) ind...
978
gpl-2.0
032718f4d638f846642f230f78032fa1bea3290e
Chr96er/shinyUtils
R/shinyUtilities.R
#'@import shiny library(shiny) #'@export manual <- function(text) { h4(text, style = "font-style: italic; font-weight: 20; line-height: 1; color: #888888;") } #'@export htmlStyle <- function() { tags$head(tags$style("html * {font-family: palanquin;}")) } #'@export styledDiv <- function(text, style) { ...
4,387
gpl-3.0
a97b9017dcc1562a47cc4edd648459a0445622cf
spatstat/AAU2015
Scripts/script07.R
#' Workshop on analysing spatial point patterns with spatstat #' Aalborg, April 2015 #' #' Lecturer's R script #' Session 7: Envelopes and Monte Carlo tests #' #' Copyright (c) Adrian Baddeley and Ege Rubak 2015 #' library(spatstat) set.seed(42) ind...
978
gpl-2.0
3e980d0b5e8fefbd81a7ec2d37f6be9de6b7b66a
ktoddbrown/soilDataR
R/convertKeyedData.R
#' Convert data tables #' #' This function converts a set of data tables from a specified format to a keyed format #' including renaming variables. #' #' @param data.ls list containing the data tables specified in the key #' @param key.df the key or look-up table that converts one formate to another #' @param return...
7,721
bsd-2-clause
9c0dff46a11d35f5e5926874936632a46734a6eb
JasperHG90/qualtRics
vignettes/qualtRics.R
## ----setup, include = FALSE---------------------------------------------- knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ## ---- echo=FALSE, out.width="80%"---------------------------------------- knitr::include_graphics("https://raw.githubusercontent.com/ropensci/qualtRics/master/img/config_step1.png"...
692
gpl-3.0
5a0bd27d58e49b35148d2883828fa3006d3aea0a
JuKa87/OpenMx
inst/models/passing/Acemix.R
# # Copyright 2007-2015 The OpenMx Project # # 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 ...
4,444
apache-2.0
b88feeeea8825202e7615065ea1420b82211fd2c
DataDrivenInc/R4DSXML
R4DSXML/tests/testthat.R
library(testthat) library(R4DSXML) test_check("R4DSXML")
58
lgpl-3.0
058f3e70c428b0b6896459eb654856a162fcd5af
ktoddbrown/FTICR_Processing
R/countCompoundTypes.R
#' Convert FT-ICR data to counts of compound classes #' #' To convert FT-ICR intensity to compound classes, this function 1) discards masses that are of 0 intensity #' 2) counts the number of masses for each sample which fall between specified C:H:O ratios which define the following #' compound classes: (lipids, u...
9,355
mit
3aebb74c3fc8d87b39ed491d3485e28bf7d5e051
Martin-Jung/marfunky
R/dms_dd.R
#' Convert degrees minutes seconds to decimal degrees: #'@author Andy Teucher #'@param x: a vector containing the lat or long with elements separated by single character #'@param sep: the character separating the degrees, minutes, seconds (default ":") #'@param hem: the hemisphere ("N","S","E","W"). Assumes all coords ...
762
gpl-2.0
5bd7bb529da931cc320f913ab94b087ef1922806
tdda/tdda
tdda/gentest/examples/r-examples/0-set-variables.R
# Set up R files for running scripts # working directory. # Load data into R site.species <- read.delim("site.species.txt") site.species.or <- read.delim("site.species.or.txt") env.data <- read.delim("env.data.txt") env.data.or <- read.delim("env.data.or.txt") # refids <- read.delim("refids.or.txt") # Merge biologic...
541
mit
bfcc3322b25039ea5355dda2ab96bef1d4bdcc42
ColumbusCollaboratory/electron-quick-start
R-Portable-Win/library/gridExtra/doc/tableGrob.R
## ----setup, echo=FALSE, results='hide'----------------------------------- library(knitr) opts_chunk$set(message=FALSE, fig.width=4, fig.height=2) ## ----basic--------------------------------------------------------------- library(gridExtra) library(grid) d <- head(iris[,1:3]) grid.table(d) ## ----annotations, fig.h...
6,905
cc0-1.0
bfcc3322b25039ea5355dda2ab96bef1d4bdcc42
ColumbusCollaboratory/electron-quick-start
R-Portable-Mac/library/gridExtra/doc/tableGrob.R
## ----setup, echo=FALSE, results='hide'----------------------------------- library(knitr) opts_chunk$set(message=FALSE, fig.width=4, fig.height=2) ## ----basic--------------------------------------------------------------- library(gridExtra) library(grid) d <- head(iris[,1:3]) grid.table(d) ## ----annotations, fig.h...
6,905
cc0-1.0
dc5f303626475a2a24679c7e4611658de53ada29
manuelreif/PP
R/lz.R
# LZ-Statistik lz <- function( data, thetas, betas, lowerAs=NULL, slopes=NULL, higherAs=NULL,...){ if(is.null(slopes)) slopes <- rep(1,length(betas)) if(is.null(lowerAs))lowerAs <- rep(0,length(betas)) if(is.null(higherAs))higher...
1,290
gpl-3.0
8e053505d7acfc1a3b6f0edba561fbfc3ff1707e
Frogee/SorghumReconstructionAndPhenotyping
McCormickTruongMullet2016_manuscriptSupplemental/multipleQTLMapping/seg_independent/X08.03_total_surface_area_Average_Normalized_multiple-QTL.R
# Estimate QTL using multiple mapping with R/qtl package # (Much of this code originates from rqtl.org tutorials.) working_directory = getwd() if (!is.null(working_directory)) setwd(input_file_directory) # load in cross (cross_inputcross) load("/home/skt/Documents/Image-based_phenotyping_RFM/2016-06/01_cross_object...
3,841
gpl-3.0
8be5c7f08a834b62f2f8be9c32e445864033f6a7
uzh/ezRun
script/archived-scripts/app-DADA2Step2Dataset.R
################################################################### # Functional Genomics Center Zurich # This code is distributed under the terms of the GNU General # Public License Version 3, June 2007. # The terms are available here: http://www.gnu.org/licenses/gpl.html # www.fgcz.ch ezMethodDADA2Step2Dataset = fu...
3,121
gpl-3.0
541bdff2b2af33b07031d0eba8d7f3715d7c9fc8
VUEG/priocomp
tests/test_gurobi_full_data.R
#!/usr/bin/env r library(magrittr) library(prioritizr) library(raster) #library(rasterVis) #library(viridis) # Set raster options rasterOptions(tmpdir = "/data/tmp/raster", progress = "text", chunksize = 100000000, maxmemory = 200000000) # Start load timer load_start <- Sys....
2,125
mit
2064b859f28a4571e9c7d52d6bc5edd37837ed49
Beirnaert/MetaboMeeseeks
R/batchPeakFilling.R
#' Function to do peak filling (xcms) with restored RT values #' #' #' #' @param xcmsObject XCMS object to be peak filled #' @param unStructureBatchesObject XCMS object after retrieved after the unStructureBatches function #' #' #' @return xcmsObject A peak filled xcms object #' #' @author Charlie Beirnaert, \emai...
640
apache-2.0
2ad8d667f381410a1befed4047b97c58a06c4716
cran/GWAtoolbox
R/PLOT.R
# # Copyright © 2011 Daniel Taliun, Christian Fuchsberger and Cristian Pattaro. All rights reserved. # # This file is part of GWAtoolbox. # # GWAtoolbox 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 v...
6,433
gpl-3.0
707eef711574b2ce72f805965b5f97ed962c2b11
CuppenResearch/MutationalPatterns
R/merge_signatures.R
#' Merge signatures based on cosine similarity #' #' This function merges signatures based on their cosine similarity. #' It iteratively merges the two signatures with the highest cosine similarity. #' Merging is stopped when the maximum cosine similarity is lower than the limit. #' #' @param signatures Signature matri...
3,300
mit
2207d2abe105f222091764c6aebbca172c955371
Ryman/Comparison-Programming-Languages-Economics
RBC_Rcpp.R
## 0. Housekeeping rm(list=ls()) ptm <- proc.time() ## 1. Calibration aalpha = 1/3; # Elasticity of output w.r.t. capital bbeta = 0.95; # Discount factor # Productivity values vProductivity <- c(0.9792, 0.9896, 1.0000, 1.0106, 1.0212); # Transition matrix mTransition <- c(0.9727, 0.0273, 0.0000, 0.0000, 0...
2,528
mit
001df78f97d0b34ce01c9d43a5fed363573e0af9
andrewejaffe/winterR_2017
Data_Cleaning/lecture/scratch.R
NA x = c(0, NA, 2, 3, 4) x = c(5,5,0,NA,0, 0, 1,2,2,2,2,4) unique(x) table(x) ## white space y = c("Male", "Male ", " Male") y table(y) library(stringr) str_trim(y) table(x,useNA="ifany") table(x[!is.na(x)],useNA="always") tab <- table(c(0, 1, 2, 3, 2, 3, 3, 2,2, 3), c(0, 1, 2, 3, 2, 3, 3, 4, 4, 3)...
458
mit
2207d2abe105f222091764c6aebbca172c955371
jesusfv/Comparison-Programming-Languages-Economics
RBC_Rcpp.R
## 0. Housekeeping rm(list=ls()) ptm <- proc.time() ## 1. Calibration aalpha = 1/3; # Elasticity of output w.r.t. capital bbeta = 0.95; # Discount factor # Productivity values vProductivity <- c(0.9792, 0.9896, 1.0000, 1.0106, 1.0212); # Transition matrix mTransition <- c(0.9727, 0.0273, 0.0000, 0.0000, 0...
2,528
mit
2207d2abe105f222091764c6aebbca172c955371
tomooinoue/Comparison-Programming-Languages-Economics
RBC_Rcpp.R
## 0. Housekeeping rm(list=ls()) ptm <- proc.time() ## 1. Calibration aalpha = 1/3; # Elasticity of output w.r.t. capital bbeta = 0.95; # Discount factor # Productivity values vProductivity <- c(0.9792, 0.9896, 1.0000, 1.0106, 1.0212); # Transition matrix mTransition <- c(0.9727, 0.0273, 0.0000, 0.0000, 0...
2,528
mit
2207d2abe105f222091764c6aebbca172c955371
lexu1upenn/Comparison-Programming-Languages-Economics
RBC_Rcpp.R
## 0. Housekeeping rm(list=ls()) ptm <- proc.time() ## 1. Calibration aalpha = 1/3; # Elasticity of output w.r.t. capital bbeta = 0.95; # Discount factor # Productivity values vProductivity <- c(0.9792, 0.9896, 1.0000, 1.0106, 1.0212); # Transition matrix mTransition <- c(0.9727, 0.0273, 0.0000, 0.0000, 0...
2,528
mit
2207d2abe105f222091764c6aebbca172c955371
agutieda/Comparison-Programming-Languages-Economics
RBC_Rcpp.R
## 0. Housekeeping rm(list=ls()) ptm <- proc.time() ## 1. Calibration aalpha = 1/3; # Elasticity of output w.r.t. capital bbeta = 0.95; # Discount factor # Productivity values vProductivity <- c(0.9792, 0.9896, 1.0000, 1.0106, 1.0212); # Transition matrix mTransition <- c(0.9727, 0.0273, 0.0000, 0.0000, 0...
2,528
mit
2207d2abe105f222091764c6aebbca172c955371
mseri/Comparison-Programming-Languages-Economics
RBC_Rcpp.R
## 0. Housekeeping rm(list=ls()) ptm <- proc.time() ## 1. Calibration aalpha = 1/3; # Elasticity of output w.r.t. capital bbeta = 0.95; # Discount factor # Productivity values vProductivity <- c(0.9792, 0.9896, 1.0000, 1.0106, 1.0212); # Transition matrix mTransition <- c(0.9727, 0.0273, 0.0000, 0.0000, 0...
2,528
mit
2207d2abe105f222091764c6aebbca172c955371
sangonz/Comparison-Programming-Languages-Economics
RBC_Rcpp.R
## 0. Housekeeping rm(list=ls()) ptm <- proc.time() ## 1. Calibration aalpha = 1/3; # Elasticity of output w.r.t. capital bbeta = 0.95; # Discount factor # Productivity values vProductivity <- c(0.9792, 0.9896, 1.0000, 1.0106, 1.0212); # Transition matrix mTransition <- c(0.9727, 0.0273, 0.0000, 0.0000, 0...
2,528
mit
d572db261312419730362a6745db7b766ce54505
david-salgado/StQ
R/sub.rawStQ.R
C#' @title Extract parts of an object of class \linkS4class{rawStQ} #' #' @description \code{[} extracts parts of an object of class \linkS4class{rawStQ}. #' #' It is indeed the method \code{[} for the class \linkS4class{rawStQ}. This method returns subsets #' of the slot \code{Data} from an object of class \linkS4cla...
1,733
lgpl-3.0
be11c25ca0b345c92ca3af392681e5a14b5b6fa4
jedrake/wtc4_heatwave
R/loadLibraries.R
#-------------------------------------------------------------- #- This script loads required R libraries and creates some # custom functions for downloading and plotting data. #-------------------------------------------------------------- #- create data and output directories, if they do not exist if(!dir.exists("...
5,333
gpl-3.0
c54319a7b678c1fb262fd1999a6f45c4ece8d9ad
SchlossLab/Sze_FollowUps_Microbiome_2017
code/Run_crc_reduced_best_model.R
### Reduced model finalized model generation ### get the best mtry and build final model with all data on reduced data set ## Marc Sze #Load needed libraries source('code/functions.R') loadLibs(c("dplyr", "caret","scales", "wesanderson", "randomForest", "pROC")) # Read in necessary data frames test_data ...
5,150
mit
8449ae1d18f7f852eb24983058a322e2f387eade
burjandedes/randomForestDrawer
R/getColorForClass.R
#' Get color for a class #' #' Get color for a factor's class based on the parameter values. #' #' This is basically a LUT, which finds the proper color for a factor's class. #' We can add the \code{classes}, the \code{colors} or a \code{defaultColor}. #' @param classValue The caller wants a color for this class. #' @p...
1,440
gpl-3.0
d0fdd7dfff71f2d92b11e910f3c52826a044c350
andpet0101/deepseq-snakepipes
R/summarise_miRNA_analysis.R
#!/usr/bin/env Rscript # reorders the library paths so that user paths will be the last place to look for libraries lib_paths = .libPaths() home_last_order = order(grepl('^/home',.libPaths())) .libPaths(lib_paths[home_last_order]) library(ggplot2) library(plyr) library(dplyr) library(magrittr) library(tidyr) library...
27,119
mit
370eb29f7c74d6a132d377c1ec6f42c571321516
thomasevans/lbbg_gps
trip_departure_decision.R
# Primarily developed by Tom Evans at Lund University: tom.evans@biol.lu.se # You are welcome to use parts of this code, but please give credit when using it extensively. # This script is to compile and collate various variables # related to foraging trip type descisions, whether to forage # at sea or on Gotland. It w...
7,343
gpl-2.0
bcb9e4579d9610cbac763c3f0f94654a9b35f36d
hxfeng/R-3.1.2
src/library/graphics/R/stars.R
# File src/library/graphics/R/stars.R # Part of the R package, http://www.R-project.org # # Copyright (C) 1995-2012 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...
7,829
gpl-2.0
6742032a9c992d5643e243c8ce8a25fc877cb4d6
chipster/chipster-tools
tools/microarray/R/plot-boxplot.R
# TOOL plot-boxplot.R: Boxplot (Creates a boxplot of normalized data. One box per chip is plotted.) # INPUT normalized.tsv: normalized.tsv TYPE GENE_EXPRS # INPUT META phenodata.tsv: phenodata.tsv TYPE GENERIC # OUTPUT boxplot.png: boxplot.png # PARAMETER column: Column TYPE METACOLUMN_SEL DEFAULT group (Phenodata c...
2,367
mit
bcb9e4579d9610cbac763c3f0f94654a9b35f36d
jagdeesh109/RRO
R-src/src/library/graphics/R/stars.R
# File src/library/graphics/R/stars.R # Part of the R package, http://www.R-project.org # # Copyright (C) 1995-2012 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...
7,829
gpl-2.0
bcb9e4579d9610cbac763c3f0f94654a9b35f36d
glycerine/bigbird
r-3.0.2/src/library/graphics/R/stars.R
# File src/library/graphics/R/stars.R # Part of the R package, http://www.R-project.org # # Copyright (C) 1995-2012 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...
7,829
bsd-2-clause
bcb9e4579d9610cbac763c3f0f94654a9b35f36d
hadley/r-source
src/library/graphics/R/stars.R
# File src/library/graphics/R/stars.R # Part of the R package, http://www.R-project.org # # Copyright (C) 1995-2012 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...
7,829
gpl-2.0
4a77c8c726231206bbc0f0971d7f63b0544976f9
JimDuggan/SDMR
workshops/08 Uni Koc Workshop/models/01 deSolve/02b SIR.R
# Example 2(b) using the readsdr package to develop the deSolve code in R library(readsdr) library(deSolve) library(dplyr) filepath <- "workshops/08 Uni Koc Workshop/models/01 deSolve/SIR.stmx" mdl <- read_xmile(filepath) simtime <- seq(mdl$deSolve_components$sim_params$start, mdl$deSolve_compon...
790
mit
2b54578411ec63f75c43c9bde5945894b83e01ad
bedatadriven/renjin
tests/src/test/R/test.as.double.R
# # Renjin : JVM-based interpreter for the R language for the statistical analysis # Copyright © 2010-2018 BeDataDriven Groep B.V. and contributors # # 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 Foundati...
7,367
gpl-2.0
bcb9e4579d9610cbac763c3f0f94654a9b35f36d
mirror/r
src/library/graphics/R/stars.R
# File src/library/graphics/R/stars.R # Part of the R package, http://www.R-project.org # # Copyright (C) 1995-2012 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...
7,829
gpl-2.0
bcb9e4579d9610cbac763c3f0f94654a9b35f36d
jeffreyhorner/R-Judy-Arrays
src/library/graphics/R/stars.R
# File src/library/graphics/R/stars.R # Part of the R package, http://www.R-project.org # # Copyright (C) 1995-2012 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...
7,829
gpl-2.0
bcb9e4579d9610cbac763c3f0f94654a9b35f36d
skyguy94/R
src/library/graphics/R/stars.R
# File src/library/graphics/R/stars.R # Part of the R package, http://www.R-project.org # # Copyright (C) 1995-2012 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...
7,829
gpl-2.0
bcb9e4579d9610cbac763c3f0f94654a9b35f36d
o-/Rexperiments
src/library/graphics/R/stars.R
# File src/library/graphics/R/stars.R # Part of the R package, http://www.R-project.org # # Copyright (C) 1995-2012 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...
7,829
gpl-2.0
bcb9e4579d9610cbac763c3f0f94654a9b35f36d
patperry/r-source
src/library/graphics/R/stars.R
# File src/library/graphics/R/stars.R # Part of the R package, http://www.R-project.org # # Copyright (C) 1995-2012 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...
7,829
gpl-2.0
bcb9e4579d9610cbac763c3f0f94654a9b35f36d
cmosetick/RRO
R-src/src/library/graphics/R/stars.R
# File src/library/graphics/R/stars.R # Part of the R package, http://www.R-project.org # # Copyright (C) 1995-2012 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...
7,829
gpl-2.0