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
5ee3dbd3179e7af0a0b2ffc7c18b1eb7deb5b16c
personality-project/psych
R/p.rep.R
"p.rep" <- function(p=.05,n=NULL,twotailed=FALSE) { df <- n - 2 if(twotailed) p <- 2*p p.rep <- pnorm(qnorm((1-p))/sqrt(2)) if (!is.null(n)) { t <- -qt(p/2,df) r.equiv <- sqrt(t^2/(t^2 + df)) dprime = 2*t*sqrt(1/df) return(list(p.rep=p.rep,d.prime=dprime,r.equiv=r.equiv)) } else { return(p.rep)} ...
1,643
gpl-2.0
9befb79f6d18fb021f662da52f405872caab9ff2
swang8/Perl_scripts_misc
manhattan_plot.R
opts = commandArgs(trailingOnly=T) input = opts[1] data = read.table(input, sep=",", header=T) data = data[order(data[,2], data[,3]),] #chrs = paste(rep(1:7, each=2), "D", sep="") data$chrName = data$Chromosome nchrs = length(unique(data$Chromosome)) newPos = integer(nchrs) tb = table(data$chrName) tb_cumsum = c...
836
mit
8d75732f414e9755356040d3fbf6650be963e28d
bedatadriven/renjin
tests/src/test/R/test.eval.R
# # Renjin : JVM-based interpreter for the R language for the statistical analysis # Copyright © 2010-2019 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...
1,181
gpl-2.0
49ede6a037ef2494f031cc43d14f49026425af1d
PawarPawan/h2o-v3
h2o-r/tests/testdir_munging/slice/runit_NOPASS_match.R
## ## setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f"))) source('../../h2o-runit.R') test.match <- function(conn) { hex <- as.h2o(conn, iris) #Log.info("Printing the head of the iris data frame.") print(hex) #Log.info("doing the match: hex$Species %in% c(\"setosa\", \"versicolor\")") ...
2,089
apache-2.0
49ede6a037ef2494f031cc43d14f49026425af1d
ChristosChristofidis/h2o-3
h2o-r/tests/testdir_munging/slice/runit_NOPASS_match.R
## ## setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f"))) source('../../h2o-runit.R') test.match <- function(conn) { hex <- as.h2o(conn, iris) #Log.info("Printing the head of the iris data frame.") print(hex) #Log.info("doing the match: hex$Species %in% c(\"setosa\", \"versicolor\")") ...
2,089
apache-2.0
49ede6a037ef2494f031cc43d14f49026425af1d
tarasane/h2o-3
h2o-r/tests/testdir_munging/slice/runit_NOPASS_match.R
## ## setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f"))) source('../../h2o-runit.R') test.match <- function(conn) { hex <- as.h2o(conn, iris) #Log.info("Printing the head of the iris data frame.") print(hex) #Log.info("doing the match: hex$Species %in% c(\"setosa\", \"versicolor\")") ...
2,089
apache-2.0
49ede6a037ef2494f031cc43d14f49026425af1d
weaver-viii/h2o-3
h2o-r/tests/testdir_munging/slice/runit_NOPASS_match.R
## ## setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f"))) source('../../h2o-runit.R') test.match <- function(conn) { hex <- as.h2o(conn, iris) #Log.info("Printing the head of the iris data frame.") print(hex) #Log.info("doing the match: hex$Species %in% c(\"setosa\", \"versicolor\")") ...
2,089
apache-2.0
9b6f978bc95ea2844e28d915ed92794e82f1cb95
nplatonov/rmap
R/panel_plot.R
## ?formals 'panel_plot' <- function(obj,...) { if (.skipPlot(TRUE)) return(NULL) geoType <- "" isSP <- FALSE isSF <- FALSE arglist <- as.list(match.call()) isLang <- is.language(arglist[["obj"]]) if (isLang) oname <- as.character(arglist["obj"]) else oname <- "*undetermed*" ...
15,254
gpl-2.0
49ede6a037ef2494f031cc43d14f49026425af1d
bospetersen/h2o-3
h2o-r/tests/testdir_munging/slice/runit_NOPASS_match.R
## ## setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f"))) source('../../h2o-runit.R') test.match <- function(conn) { hex <- as.h2o(conn, iris) #Log.info("Printing the head of the iris data frame.") print(hex) #Log.info("doing the match: hex$Species %in% c(\"setosa\", \"versicolor\")") ...
2,089
apache-2.0
49ede6a037ef2494f031cc43d14f49026425af1d
mrgloom/h2o-3
h2o-r/tests/testdir_munging/slice/runit_NOPASS_match.R
## ## setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f"))) source('../../h2o-runit.R') test.match <- function(conn) { hex <- as.h2o(conn, iris) #Log.info("Printing the head of the iris data frame.") print(hex) #Log.info("doing the match: hex$Species %in% c(\"setosa\", \"versicolor\")") ...
2,089
apache-2.0
ed34d823b598a87563e885e6e7806d0bcd0f57e7
jnguyen92/nhuyhoa
_data/Recipes.R
#---------------------------------------------------------------------------------------------------------- # lobster roll ingredients = list( Other = c("japanese mayo", "salt", "pepper", "margarine", "hotdog buns"), Meat = c("lobster tail"), Veggies = c("green onions", "lettuce"), Fruit = "" ) instructions = d...
34,479
mit
ed34d823b598a87563e885e6e7806d0bcd0f57e7
jennguyen1/nhuyhoa
_data/Recipes.R
#---------------------------------------------------------------------------------------------------------- # lobster roll ingredients = list( Other = c("japanese mayo", "salt", "pepper", "margarine", "hotdog buns"), Meat = c("lobster tail"), Veggies = c("green onions", "lettuce"), Fruit = "" ) instructions = d...
34,479
mit
fedb29ab530511b9c118c60c35221f58a81d8346
gdietz/OpenMEE
R/openmeer/tests/testthat/test_histogram.R
library(openmeer) context("Histogram") data <- c(94, 98, 98, 94, 98, 96) params <- list(GRADIENT=FALSE, xlab="tx A mean", color="#000000", fill="#FFFFFF") plot.type = "HISTOGRAM" if (!dir.exists("r_tmp")) { dir.create("r_tmp") } test_that("Histogram is generated", { results <- exploratory.plotter(data, params, ...
464
gpl-3.0
8878b9511e8cd369959979e8374b4134e3460651
inventionate/TimeSpaceAnalysis
R/gda-describe-axis.R
#' Calculate axis contributions. #' #' @param res_gda MCA result. #' @param axis which axis to calculate. #' @param contrib "auto" calculates the optimal modalities to show (based on the basic criterion). Otherwise define an amount of modalities to plot. #' #' @return list containing axis contribution results. #' @expo...
1,961
gpl-3.0
dda8588dc44b2fd5cd07d8de2fae8f3c761f7ddb
pcarbo/varbvs
varbvs-R/R/varbvsmixupdate.R
# Part of the varbvs package, https://github.com/pcarbo/varbvs # # Copyright (C) 2012-2018, Peter Carbonetto # # This program is free software: you can redistribute it under the # terms of the GNU General Public License; either version 3 of the # License, or (at your option) any later version. # # This program is distr...
2,885
gpl-3.0
f2d10dbbb1d09879563e96df01c45dc1753416cb
jcolomb/HCS_analysis
archives_notpeerreviewed/testscode/svm_vs_logregr/svm_vs_log_rosenmunddata.R
#this script will compare the resluts of the SVM and the L1-logistic regresssion, using the 2out strategy of the Steele 2007 paper, on rosenmund data (wt tested twice) tune.svm3 <- function(trainset,groupingvar){ #objS <- tune.svm(groupingvar~., data = trainset, gamma = 4^(-5:5), cost = 4^(-5:5), # ...
9,632
mit
3b79adfebbfcb7371d3162699d5a7f540d2b0651
burrm/lolcat
R/unitconversion.square.meter.to.hectare.R
#' Unit Conversion - Area - Square Meter to Hectare #' #' Performs a conversion of areas from square meters to hectares. #' #' @param x Vector - Values in units of square meters #' #' @return x, but converted to hectares #' #' @references #' NIST. Handbook 133 - Checking the Net Contents of Packaged Goods - Append...
662
mit
1f89c991fb0ccedf59ce6420826a8e7a3b6da8f3
datascience-uwmadison/R_for_data_sciences
visualize/shiny/server.R
function(input, output) { output$main_plot <- renderPlot({ hist(faithful$eruptions, probability = TRUE, breaks = as.numeric(input$n_breaks), xlab = "Duration (minutes)", main = "Geyser eruption duration") if (input$individual_obs) { rug(faithful$eruptions...
499
gpl-3.0
43b69ac9f4c968c385095ca27ea8a888826ec527
LaboratoireMaranger/LaboScript
RDA/RDA.R
#################################################################### # Author: # Nicolas Fortin St-Gelais, nicolas.fstgelais@gmail.com # Description: # RDA with variable selection (AIC), # Lakes are colored by group # #modif for test #################################################################### # clean the m...
2,241
mit
ae00208821353f81e3b578badaed394702bd7288
Ibasam/IBASAM
IBASAM/R/summarize.summer.population.R
summarize.summer.population <- function (population, variables) { grilses <- (population$Returns == 1 & population$AgeSea < 2) MSW <- (population$Returns >= 1 & population$AgeSea >= 2) Parrs0 <- (population$AgeSea == 0 & population$AgeRiver < 1) Parrs1 <- (population$AgeSea ==...
764
gpl-3.0
6a60686abaaf0051fe9267469f8da2b661c2181d
7c00/SparkR-pkg
pkg/inst/tests/test_binary_function.R
context("binary functions") # JavaSparkContext handle sc <- sparkR.init() # Data nums <- 1:10 rdd <- parallelize(sc, nums, 2L) # File content mockFile <- c("Spark is pretty.", "Spark is awesome.") test_that("union on two RDDs", { actual <- collect(unionRDD(rdd, rdd)) expect_equal(actual, as.list(rep(nums, 2))) ...
1,386
apache-2.0
6a60686abaaf0051fe9267469f8da2b661c2181d
EDMunplugged/SparkR-pkg
pkg/inst/tests/test_binary_function.R
context("binary functions") # JavaSparkContext handle sc <- sparkR.init() # Data nums <- 1:10 rdd <- parallelize(sc, nums, 2L) # File content mockFile <- c("Spark is pretty.", "Spark is awesome.") test_that("union on two RDDs", { actual <- collect(unionRDD(rdd, rdd)) expect_equal(actual, as.list(rep(nums, 2))) ...
1,386
apache-2.0
03080c3b3ec43634384aaa3289d977a4c56e9998
bedatadriven/renjin
packages/stats/tests/test.stats.fft.a62fdf06b9392bbea588294d28750446.R
library(hamcrest) expected <- c(-0x1.53f5c451fe60ap-1 + 0x1.95783880b4578p-1i, -0x1.49b84d1fa249p-1 + 0x1.9d8e13049d7a4p-1i, -0x1.3eebb9383f4c2p-1 + 0x1.a51a1a600bad4p-1i, -0x1.33972a79dae7ep-1 + 0x1.ac145fe314b96p-1i, -0x1.27c22e06839dcp-1 + 0x1.b27555a7a47fp-1i, -0x1.1b74b719b648p-1 + 0x1.b835d41afadep-1i, -0x1....
27,554
gpl-2.0
361d0142d5bf203a451cbafeba3e9dc5e1c80179
ranghetti/fidolasen
R/s2_thumbnails.R
#' @title Produce an RGB image from a multiband raster file. #' @description Internal function to create JPEG images from a multiband raster #' file. This function is used by [s2_thumbnails], and it will be exported #' when it would be more generalised. #' @param in_rast Path of the input multiband raster. #' @param ...
20,845
gpl-3.0
afa5d4d113a082bf439e73e732a0f0cd42507e5a
bedatadriven/renjin
packages/stats/tests/test.stats.spline.ce0eb85be6c0265fd86a194f4caa60a6.R
library(hamcrest) expected <- structure(list(x = c(-2.21112724108533, -2.17092492761105, -2.13072261413677, -2.09052030066249, -2.05031798718822, -2.01011567371394, -1.96991336023966, -1.92971104676538, -1.8895087332911, -1.84930641981682, -1.80910410634254, -1.76890179286826, -1.72869947939399, -1.68849716591971,...
6,087
gpl-2.0
03080c3b3ec43634384aaa3289d977a4c56e9998
jukiewiczm/renjin
packages/stats/src/test/R/test.stats.fft.a62fdf06b9392bbea588294d28750446.R
library(hamcrest) expected <- c(-0x1.53f5c451fe60ap-1 + 0x1.95783880b4578p-1i, -0x1.49b84d1fa249p-1 + 0x1.9d8e13049d7a4p-1i, -0x1.3eebb9383f4c2p-1 + 0x1.a51a1a600bad4p-1i, -0x1.33972a79dae7ep-1 + 0x1.ac145fe314b96p-1i, -0x1.27c22e06839dcp-1 + 0x1.b27555a7a47fp-1i, -0x1.1b74b719b648p-1 + 0x1.b835d41afadep-1i, -0x1....
27,554
gpl-3.0
afa5d4d113a082bf439e73e732a0f0cd42507e5a
jukiewiczm/renjin
packages/stats/src/test/R/test.stats.spline.ce0eb85be6c0265fd86a194f4caa60a6.R
library(hamcrest) expected <- structure(list(x = c(-2.21112724108533, -2.17092492761105, -2.13072261413677, -2.09052030066249, -2.05031798718822, -2.01011567371394, -1.96991336023966, -1.92971104676538, -1.8895087332911, -1.84930641981682, -1.80910410634254, -1.76890179286826, -1.72869947939399, -1.68849716591971,...
6,087
gpl-3.0
946dfaa2f3217803df3817536d2e12d2a7cd45f1
joh024/WeBIPP
Release/RawData/language-speakers.R
# Source: The Cambridge Factfinder, Cambridge University Press, 1993 mother.tongue = structure( c(1000, 350, 250, 200, 150, 150, 150, 135, 120, 100, 70, 70, 65, 65, 60, 60, 55, 55, 50, 50), names = c("Chinese", "English", "Spanish", "Hindi", "Arabic", "Bengali", "Russia", "Portuguese", "Japanese", "Ge...
448
gpl-3.0
f8c550dfb24ba9f829c71cef21024f1de6e642f8
LiveOak/LylesCoalbedMethane2
Manipulate/GroomLong.R
# knitr::stitch_rmd(script="./Manipulate/GroomLong.R", output="./Manipulate/StitchedOutput/GroomLong.md") rm(list=ls(all=TRUE)) #Clear the variables from previous runs. ############################ #+ LoadSources ############################ #+ LoadPackages library(knitr) library(plyr) # library(dplyr) # library(resh...
2,044
gpl-2.0
5334d021414157bc5a12a5f04225ea22700b0acc
SchlossLab/Sze_FollowUps_Microbiome_2017
code/srn/srn_run_35_RF.R
### Build the best lesion model possible ### Try XG-Boost, RF, Logit (GLM), C5.0, SVM ### Find the best based on Jenna Wiens suggestions on test and training ## Marc Sze #Load needed libraries source('code/functions.R') loadLibs(c("dplyr", "caret","scales", "doMC")) load("exploratory/srn_RF_model_setup.RDa...
1,758
mit
be36cbbf2cf7c90a1da574306357ae3a7ec070fc
KarasiewiczStephane/WitOMI
R/plot_dym_sp.R
#' @title Species subniches dynamic #' @aliases plot_dym_sp #' @description The function represents the species' subniches SR within its realized niche NR. #' @param subnic an object of class \code{subniche}. #' @param sp a character string of the species name. #' @param main a main title for the plot, see \link[graph...
7,307
mit
5fb82a2e557569738c7cfdb15934eb2ac1b4000d
frichote/replop
CL_code/code/test/sNMF/test_error_nmf/generator.R
# generate print_error_nmf
28
gpl-3.0
dce7a4e82dbf4913efe4f226b3c953d8a1ff6596
lorenzwalthert/strcode
placeholder_code/example3.R
### .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ### this is supposed to only have level 3 separators print("hi") ### .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
229
mit
a9dbc8e4da1c54936dbf4f11004ae04f479b2576
mattwatts/ParameterTestingTas
global.R
# Author: Matt Watts # Date: 10 Dec 2014 # Purpose: ParameterTestingTas web app global.R library(shiny) library(PBSmapping) library(maptools) library(sp) sMarxanDir <- getwd() # find how many runs from input.dat inputdat <- readLines(paste(sMarxanDir,"/input.dat",sep="")) iParam <- which(regexpr("NUMREPS",inputdat)=...
453
agpl-3.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
Mouseomics/R
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
minux/R
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
kmillar/rho
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
aviralg/R-dyntrace
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
mathematicalcoffee/r-source
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
allr/timeR
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
andy-thomason/r-source
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
RevolutionAnalytics/RRO
R-src/src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
SurajGupta/r-source
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
cxxr-devel/cxxr
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
ArunChauhan/cxxr
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
nathan-russell/r-source
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
246c3c9ea2b4b788303cac16e296989c2e253afb
zmon/food-inspections-evaluation
CODE/15_sanitation_download.R
if(interactive()){ ##========================================================================== ## INITIALIZE ##========================================================================== ## Remove all objects; perform garbage collection rm(list=ls()) gc(reset=TRUE) ## Detach any non-standard...
1,376
mit
90f2f83305c25879f0396b4fa0636792d1bf81bf
krlmlr/cxxr
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
3457f02d8ceb7afe7c145bc15b0a253685875474
jeremyrcoyle/sl3
R/Lrnr_gbm.R
#' GBM: Generalized Boosted Regression Models #' #' This learner provides fitting procedures for generalized boosted regression #' trees, using the routines from \pkg{gbm}, through a call to the function #' \code{\link[gbm]{gbm.fit}}. Though a variety of gradient boosting strategies #' have seen popularity in machine l...
4,108
gpl-3.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
rho-devel/rho
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
246c3c9ea2b4b788303cac16e296989c2e253afb
MountMcKinney/food-inspections-evaluation
CODE/15_sanitation_download.R
if(interactive()){ ##========================================================================== ## INITIALIZE ##========================================================================== ## Remove all objects; perform garbage collection rm(list=ls()) gc(reset=TRUE) ## Detach any non-standard...
1,376
mit
90f2f83305c25879f0396b4fa0636792d1bf81bf
WelkinGuan/r-source
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
3457f02d8ceb7afe7c145bc15b0a253685875474
tlverse/sl3
R/Lrnr_gbm.R
#' GBM: Generalized Boosted Regression Models #' #' This learner provides fitting procedures for generalized boosted regression #' trees, using the routines from \pkg{gbm}, through a call to the function #' \code{\link[gbm]{gbm.fit}}. Though a variety of gradient boosting strategies #' have seen popularity in machine l...
4,108
gpl-3.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
MouseGenomics/R
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
kmillar/cxxr
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
4533f8da7570c73e2c997d3a536e272a821943f4
letiR/letiRmisc
tests/testthat/test-stopwatch.R
context("Stopwatch & Timer") test_that("messages", { expect_message(stopwatch(.1)) expect_message(timer(.1)) })
116
gpl-3.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
SensePlatform/R
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
bedatadriven/renjin
packages/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
jimhester/r-source
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
krlmlr/r-source
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
LeifAndersen/R
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
90f2f83305c25879f0396b4fa0636792d1bf81bf
abiyug/r-source
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
246c3c9ea2b4b788303cac16e296989c2e253afb
mleeds95/food-inspections-evaluation
CODE/15_sanitation_download.R
if(interactive()){ ##========================================================================== ## INITIALIZE ##========================================================================== ## Remove all objects; perform garbage collection rm(list=ls()) gc(reset=TRUE) ## Detach any non-standard...
1,376
mit
90f2f83305c25879f0396b4fa0636792d1bf81bf
allr/r-instrumented
src/library/grDevices/R/utils.R
# File src/library/grDevices/R/utils.R # Part of the R package, https://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; eith...
1,397
gpl-2.0
246c3c9ea2b4b788303cac16e296989c2e253afb
ayacha/food-inspections-evaluation
CODE/15_sanitation_download.R
if(interactive()){ ##========================================================================== ## INITIALIZE ##========================================================================== ## Remove all objects; perform garbage collection rm(list=ls()) gc(reset=TRUE) ## Detach any non-standard...
1,376
mit
129e6d9d02c6cc12b8bad242ebc6dac7a4143347
hanhanwu/Hanhan_Data_Science_Practice
deal_with_continuos_variables.R
# Deal with continuous variables data <- data.frame(state.x77) str(data) library(ggplot2) #plot Frost variable and check the data points are all over qplot(y = Frost, data = data, colour = 'red') # method 1 - create bins and add labels bins <- cut(data$Frost, 3, include.lowest = TRUE) bins bins <- cut(data$Frost, 3,...
2,849
mit
26ccf2ab45f0d72a6e41fdb31b401268b7ed8cc3
oliverychen/oliverychen.github.io
files/doc/server.R
library(shiny) shinyServer(function(input, output) { # Reactive expression to generate the requested distribution. This is # called whenever the inputs change. The renderers defined # below then all use the value computed from this expression # data <- reactive({ # f <- switch(input$...
7,181
mit
10577aa083d4dbccde03e628a380638d3d8302d0
alokrk/csc510groupk
R/extraction.R
#Extracting data for Stack Overflow setwd("/media/alok/New Volume/sodata") require("XML") #TAGS tags = xmlParse("Tags.xml") tags = xmlToList(tags) lenTags = length(tags) #df = data.frame(matrix(unlist(tags)), nrow = len) tags = data.frame(Reduce(rbind, tags)) #POST LINKS postLinks = xmlParse("PostLinks.xml") postLin...
1,114
gpl-2.0
26ccf2ab45f0d72a6e41fdb31b401268b7ed8cc3
oliverychen/oliverychen.github.io
_site/files/doc/server.R
library(shiny) shinyServer(function(input, output) { # Reactive expression to generate the requested distribution. This is # called whenever the inputs change. The renderers defined # below then all use the value computed from this expression # data <- reactive({ # f <- switch(input$...
7,181
mit
d89d273afaefed40822c445711f75d237cc3956b
andrewdefries/andrewdefries.github.io
FDA_Pesticide_Glossary/halfenprox.R
library("knitr") library("rgl") #knit("halfenprox.Rmd") #markdownToHTML('halfenprox.md', 'halfenprox.html', options=c("use_xhml")) #system("pandoc -s halfenprox.html -o halfenprox.pdf") knit2html('halfenprox.Rmd')
216
mit
7fb02706fd530c77af24a9dbb1ed121f5f4edb97
rforge/mirt
R/01-itemtypes.R
#Classes setClass("GroupPars", representation(par='numeric', SEpar='numeric', est='logical', parnum='numeric', nfact='integer', gradient='numeric', hessian='matrix', ...
4,342
gpl-2.0
09320f21469cf9996a493c9ea5af7eb2b29766f5
ernestguevarra/shiny-server
myanmarMCCTchecks/server.R
################################################################################ # # Server logic for web application # ################################################################################ # # Define server logic for application # server <- function(input, output, session) { ## Keep alive output$keepAli...
15,863
mit
4b243d7a34be2eca8f258476757f42e6c5f42468
wclark3/machine-learning
final-project/code/plots.R
rm(list=ls()) source("../../utils/source_me.R", chdir = T) CreateDefaultPlotOpts(WriteToFile = T) Global.PlotOpts$Prefix <- "../writeup/" require(doSNOW) require(snowfall) require(parallel) if (!sfIsRunning()) { sfInit(cpus=detectCores(), parallel = T) registerDoSNOW(sfGetCluster()) } # We seem to use this colo...
6,988
mit
8e0207ce2ec0a06cdf228602b2d697d83fbb5c29
dankelley/oce-issues
05xx/563/06ctd.R
require(oce) make_ctd <- function(start, end) { start <- 20 end <- 30 p <- seq(0, 100, 1) S <- 35 + p / 100 T <- 20 - p / 100 d <- as.ctd(S, T, p) d <- subset(d, start <= pressure & pressure <= end) } focus <- c(1, 100) d <- make_ctd(focus[1], focus[2]) stopifnot(all.equal.numeric(d[["pressu...
336
gpl-2.0
4320cb1477856eea3d4da334ed81d4f3d66ab872
wStockhausen/rTCSAM2015
R/plotFitsGG.MeanSizeComps.R
#' #' @title Plot mean size comps fits #' #' @description Function to plot mean size comps fits using ggplot2. #' #' @param fits - list of fits #' @param mc - model configuration list #' @param sxs - character vector of sexes to plot #' @param mss - character vector of maturity states to plot #' @param scs - characte...
3,931
mit
953c79e73ddaa764741dd16e681cdeddb2ee887b
richelbilderbeek/R
old_notes/FileIo/save_text_test.R
# Test the save_text function source("~/GitHubs/R/FileIo/save_text.R") save_text_test <- function() { filename <- "tmp.txt" text <- c("Hello","world") save_text( filename = filename, text = text ) assert(file.exists(filename)) file.show(filename) # Remove temporary file has_removed <- file.r...
388
gpl-3.0
82d4dcbfc596d9655fff916434ee62aca18dddb4
vinaywv/mlr
R/downsample.R
#' @title Downsample (subsample) a task or a data.frame. #' #' @description #' Decrease the observations in a \code{task} or a \code{ResampleInstance} #' to a given percentage of observations. #' #' @param obj [\code{\link{Task}} | \code{\link{ResampleInstance}}]\cr #' Input data or a \code{ResampleInstance}. #' @par...
1,416
bsd-2-clause
82d4dcbfc596d9655fff916434ee62aca18dddb4
tijoseymathew/mlr
R/downsample.R
#' @title Downsample (subsample) a task or a data.frame. #' #' @description #' Decrease the observations in a \code{task} or a \code{ResampleInstance} #' to a given percentage of observations. #' #' @param obj [\code{\link{Task}} | \code{\link{ResampleInstance}}]\cr #' Input data or a \code{ResampleInstance}. #' @par...
1,416
bsd-2-clause
00d6a71680167fd59354291e2a8b0c215fd5d4bf
oganm/brainCellTypeSpecificGenes
analysis/06.Blood validation/bloodFig3.R
library(ogbox) source('R/puristOut.R') source('R/estimate.R') source('R/superImpose.R') library(ggplot2) library(gtable) library(grid) library(dplyr) library(grDevices) library(magrittr) realCounts = read.table('data//bloodCellType//PBMCcounts.tsv',sep='\t',header=T,row.names=1) theirPred = read.table('data/bloodCellT...
6,178
gpl-2.0
6d58f3ab29e603d1f92f89d3e3a5770420743e4d
zero323/r-snippets
R/read_and_reencode.R
#' Read file in a binary mode and re-encode #' Adapted from Marek Gagolewski, Advanced Data Analysis Software Development with R #' #' @param fname path to the input file #' @param from input encoding #' @param to output encoding #' @param newlines character, regular expression #' @return character #' read_and_reencode...
591
mit
402781d4ead17aedf8afeacc2041f7e26f3f8710
algoquant/rutils
demo/demo_r_utils.R
################################################ ### ### Demos for using package 'rutils' ### ################################################ # Set the time-zone to New_York Sys.setenv(TZ="America/New_York") # setwd("C:/Develop/data") # search() # get search path options(digits.secs=6) options(digits=7) ...
4,387
mpl-2.0
9216a2f82f99a6a80ce661c9129cb9f93c1f0a74
Razonar/DDP_ShinyApplication
app.R
# # Shiny APP server and ui # Alvaro. library(shiny); library(ggplot2); library(grid); # Define UI for application that draws a histogram ui <- fluidPage( titlePanel("Examining some few distributions"), # Sidebar with controls sidebarLayout( sidebarPanel( radioButtons("dist", "Distr...
2,409
gpl-2.0
9a7899bacd54d1a2c54b127fcf090bc6a32f128f
osofr/sl3
R/Lrnr_expSmooth.R
#' Exponential Smoothing #' #' This learner supports exponential smoothing models using the \code{forecast} package. #' Fitting is done with the \code{\link[forecast]{ets}} function. #' @docType class #' @importFrom R6 R6Class #' @export #' @keywords data #' @return Learner object with methods for training and predict...
5,755
gpl-3.0
a997ea405e314233a24d2393e1f83e66a24dd7c0
gtesei/fast-furious
competitions/caterpillar-tube-pricing/Predict_2_Cluster.R
library(binhf) library(fBasics) library(lattice) require(xgboost) require(methods) library(data.table) library(plyr) getBasePath = function (type = "data") { ret = "" base.path1 = "" base.path2 = "" if(type == "data") { base.path1 = "C:/docs/ff/gitHub/fast-furious/dataset/caterpillar-tube-pricing/compet...
10,378
mit
033bd93f8df3f26ef6fc7c0c4f1bbc52e8eabf5b
wacax/Driver-Telematics-Analysis
lofAnomalyDetection.R
lofAnomalyDetection <- function(fullDataMatrix, cleanDataMatrix, kUser = 8, exclude_bad_data = TRUE){ require("DMwR") if (exclude_bad_data == TRUE){ goodDataIdx <- which(fullDataMatrix[, ncol(fullDataMatrix)] == 0) resultsLOF <- signif(-(lofactor(cleanDataMatrix[, -ncol(cleanDataMatrix)], k=kUser)) + 12,...
923
gpl-2.0
155152d1e3716053796dc4f5c495669c3673403d
vinaywv/mlr
tests/testthat/test_regr_bgp.R
context("regr_bgp") test_that("regr_bgp", { requirePackagesOrSkip("tgp", default.method = "load") parset.list = list( list(), list(meanfn = "linear", bprior = "bflat", corr = "expsep") ) inds = 1:50 y = regr.num.df[inds, regr.num.target] old.predicts.list = list() for (i in seq_along(parset.list...
764
bsd-2-clause
155152d1e3716053796dc4f5c495669c3673403d
tijoseymathew/mlr
tests/testthat/test_regr_bgp.R
context("regr_bgp") test_that("regr_bgp", { requirePackagesOrSkip("tgp", default.method = "load") parset.list = list( list(), list(meanfn = "linear", bprior = "bflat", corr = "expsep") ) inds = 1:50 y = regr.num.df[inds, regr.num.target] old.predicts.list = list() for (i in seq_along(parset.list...
764
bsd-2-clause
c8739f43c6570a85c26458453a281eb713aa196d
paul-lukacs/KIMU
helpers/archive/manip.yoy.S.deer.R
# Manipulate separate survival capture and mortality files to create a # single row for each animal. manip.yoy.S.deer <- function(cap, mort){ # miss.fun takes a vector of "any" class and fills in missing values # with NA. The second argument rand, when true, will sample ...
7,322
gpl-2.0
c8739f43c6570a85c26458453a281eb713aa196d
paul-lukacs/SageGrouse
helpers/archive/manip.yoy.S.deer.R
# Manipulate separate survival capture and mortality files to create a # single row for each animal. manip.yoy.S.deer <- function(cap, mort){ # miss.fun takes a vector of "any" class and fills in missing values # with NA. The second argument rand, when true, will sample ...
7,322
gpl-2.0
b39e26050f126f9911d536e55f8cdcab338bbf79
ywchan2005/rprog-002
quiz1/q14.R
data <- read.csv( 'hw1_data.csv', header=TRUE ); r <- nrow( data ) data <- read.csv( 'hw1_data.csv', header=TRUE, skip=r-2 ); print( data )
140
gpl-2.0
dda36468b5bf068535fafe3d84489c310098f2d0
rsachse/luess
R/resample_value.R
#' Resampling by calculating the means of covered cell centers #' #' The function reads a spatialPointsDataFrame of high resolution #' and a regular coarser grid. It than resamples by calculating the #' means of all covered cell centers within the grid cell of the #' coarser grid. The function will read only the firs...
1,586
gpl-2.0
4f6be911d3f7fdb5171344bcb85f409ba6b1c714
hilldr/Munera2017
src/expression_analysis.R
# R package dependencies ------------------------------------------------------- # Comment this line out if your machine already has these packages installed #install.packages(c("matrixStats","ggplot2","MASS","scales"),repos='https://watson.nci.nih.gov/cran_mirror/') ## FPKM matrix input -----------------------------...
6,865
gpl-3.0
d9a2cace4f68efac9722108fe8021ffe75db612a
alecristia/dalohumacosp
compAna/2_compareCoding_R_2.0_.R
################################### #This code was made by Alex Cristia (main algorithmes) and Ben Touati (somes algorithmes and cleaning), Laboratoire des sciences cognitives et psycholinguistiques #Département de sceicnes cognitives, ENS, CNRS # It compares vad made by two different coders on a list of record #It ...
7,156
gpl-3.0
d75908663bc3223a35ab1e6f4df089e92e51e027
tmeeha/setset
R/noiseval.R
####################################################### #################### noiseval() ####################### ####################################################### #' Add white noise with random spikes to a time series #' #' This function allows you to inject windows of white noise into a time series. This is mean...
3,162
bsd-3-clause
018aa5f6810d9e74beecce8dbed4160615526085
WHOequity/HEAT-1.0
HEAT/utils/inequal_functions/bgv.R
# © Copyright World Health Organization (WHO) 2016. # This file is part of the Health Equity Assessment Toolkit (HEAT). # HEAT is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as published by # the Free Software Foundation. # # HEAT is distributed...
3,968
gpl-2.0
a1db85e7f95134fe29e6e2ceaaedc2e5944b53b9
shailesh1729/r-snippets
code/shailesh/R/qr.R
mgs <- function(X){ # Ensure that X is a matrix X <- as.matrix(X) # Number of rows m <- nrow(X) # Number of columns n <- ncol(X) if (m < n) { stop('Wide matrices are not supported.') } # Construct the empty Q and R matrices Q <- matrix(0, m, n) R <- matrix(0, n, n) for (j in 1:n){ # Pic...
1,462
apache-2.0
edd5540e0d5c1ab7efa801fdf395f0f61c821ae8
thegricean/partitivesome
corpus/rscripts/processAll2.R
theme_set(theme_bw(18)) setwd("/Users/titlis/cogsci/projects/partitivesome/corpus/") source("rscripts/helpers.r") d = read.table("data/all/swbdext_correctedprobs.txt",sep="\t",header=T,quote="") # delete all the Head prob columns that are outdated d$JFQ_Head = NULL d$CndP_Head = NULL d$Information_Head_3gram = NULL d$...
4,018
gpl-2.0
db06f40bf97904debca6ce9a9b451834828e437d
pyrdr/charlas
periodicos-dominicanos/codigos extraccion datos/nacional_web_parsel.R
library(xml2) library(dplyr) library(rvest) # reading the data na_fb_url <- "https://raw.githubusercontent.com/Pedromoisescamacho/periodicos-dominicanos/master/datasets_noticias/fb_nacional.csv" na_df <- read.csv(na_fb_url, stringsAsFactors = F) na_url <- na_df$url noticia <- read_html("http://ow.ly/oaKb30fLgDJ") conte...
2,251
mit
e78fab2707696d7712e696d454a0616274f855d1
USGS-R/mda.streams
R/download_metab_run.R
#' Download metabolism run data data to local file destination #' #' Download files stored in a metabolism run SB item to a user-specified (or #' temp file) location. A new folder will be created within that location to #' store the downloaded files. The default is to download all available files, #' but specific fi...
2,160
cc0-1.0
24efd1031416b85c169a80191f700984a9d05f76
snurk/meta-strains
scripts/calculate_BIC.R
library('matrixStats', lib.loc="~/R/libs") library('Clomial', lib.loc="~/R/libs") args <- commandArgs(trailingOnly=TRUE) R <- read.table(args[1]) X <- read.table(args[2]) meta.log.likelihood <- function(Dc, Dt, Mu, P) { log.likelihood <- 0 for (i in 1:nrow(Mu)) { p <- (Mu[i, ]) %*% P p[p > 1] <- 1 l...
1,581
mit