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 |
|---|---|---|---|---|---|
233f3e1bbf84fba920c6bbaf638d42a13771c7e6 | fingerhuth/NG-resistance-spread | sensitivity/fitness_costs/pn_8/s_g-init-res.R | cost_b <- vec_cost_b[l]
cost_v <- vec_cost_v[m]
parms <- c(c=c, noG=noG, alpha=alpha, v=v, gamma=gamma, rho=rho,
ta=ta,
e0_a=e0_a,
ea_a=ea_a,
mu_0a=mu_0a,
mu_a0=mu_a0,
cost_b=cost_b,
cost_v=cost_v
)
init <- unlist(free.out[1]) | 318 | mit |
48a213f6b3f77fccdb5a1ad84324167237e54a6b | RcppCore/Rcpp | inst/tinytest/test_client_package.R |
## Copyright (C) 2010 - 2019 Dirk Eddelbuettel and Romain Francois
##
## This file is part of Rcpp.
##
## Rcpp 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
## (... | 2,115 | gpl-2.0 |
233f3e1bbf84fba920c6bbaf638d42a13771c7e6 | fingerhuth/NG-resistance-spread | sensitivity/fitness_costs/pn_7/s_g-init-res.R | cost_b <- vec_cost_b[l]
cost_v <- vec_cost_v[m]
parms <- c(c=c, noG=noG, alpha=alpha, v=v, gamma=gamma, rho=rho,
ta=ta,
e0_a=e0_a,
ea_a=ea_a,
mu_0a=mu_0a,
mu_a0=mu_a0,
cost_b=cost_b,
cost_v=cost_v
)
init <- unlist(free.out[1]) | 318 | mit |
48a213f6b3f77fccdb5a1ad84324167237e54a6b | ellert/Rcpp | inst/tinytest/test_client_package.R |
## Copyright (C) 2010 - 2019 Dirk Eddelbuettel and Romain Francois
##
## This file is part of Rcpp.
##
## Rcpp 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
## (... | 2,115 | gpl-2.0 |
c6612ccd2a346181452bbe38c3ba222bd55c171c | IALSA/IALSA-2015-Portland | sandbox/shiny-basic/server.R | library(shiny)
if(basename(getwd())=="basic"){
dsb <- readRDS('../../data/shared/ds1a.rds')
}else{
dsb <- readRDS('./data/shared/ds1a.rds')
}
dsb <- dsb %>% dplyr::filter(model_number %in% c("u1","b1"))
ds <- dsb[ , c("study_name", "model_type","physical_construct","cognitive_construct","physical_measure","cognitive... | 1,513 | gpl-2.0 |
9327fecda1528ba333c2c4ee8d07741af4af8124 | gmonette/spida2 | R/pch.R | #' Easy pch characters
#'
#' Fifteen pch symbols and six line types can be generated
#' mnemonic names.
#'
#' @param shape 'square', 'circle', 'triangle', 'diamond', 'ltriangle' (or 1, 2, 3, 4, 5 respectively). Default: 1
#' @param fill 'empty', 'solid', 'fill' (with different color) (or 1, 2, 3 respectively). Default:... | 1,286 | gpl-2.0 |
9327fecda1528ba333c2c4ee8d07741af4af8124 | gmonette/yscs | R/pch.R | #' Easy pch characters
#'
#' Fifteen pch symbols and six line types can be generated
#' mnemonic names.
#'
#' @param shape 'square', 'circle', 'triangle', 'diamond', 'ltriangle' (or 1, 2, 3, 4, 5 respectively). Default: 1
#' @param fill 'empty', 'solid', 'fill' (with different color) (or 1, 2, 3 respectively). Default:... | 1,286 | gpl-2.0 |
fa6e38459c8786fce2be14b040c45427b02d14fd | pssguy/rstudio | src/cpp/r/R/Api.R |
.rs.addApiFunction("versionInfo", function() {
info <- list()
info$citation <- .Call(getNativeSymbolInfo("rs_rstudioCitation",
PACKAGE=""))
info$mode <- .Call(getNativeSymbolInfo("rs_rstudioProgramMode",
PACKAGE=""))
... | 4,554 | agpl-3.0 |
a8af4e1529bf45c65c4a272505d8a67b15b4a6e0 | radfordneal/pqR | tests/subsetting.R | # Test possible bugs involving subset and subassign.
#
# Added for pqR, 2014, 2017, Radford M. Neal.
# General tests of subset extraction with scalar indexes, not array.
vi <- 11:15
vr <- (11:15) + 0.1
L <- list(11.1,12L,13.1,14L,TRUE)
Ln <- list(e1=11.1,e2=12L,e3=13.1,e4=14L,e5=TRUE)
vin <- vi
names(vin) <- paste0(... | 7,206 | gpl-2.0 |
fa6e38459c8786fce2be14b040c45427b02d14fd | sfloresm/rstudio | src/cpp/r/R/Api.R |
.rs.addApiFunction("versionInfo", function() {
info <- list()
info$citation <- .Call(getNativeSymbolInfo("rs_rstudioCitation",
PACKAGE=""))
info$mode <- .Call(getNativeSymbolInfo("rs_rstudioProgramMode",
PACKAGE=""))
... | 4,554 | agpl-3.0 |
05af94e985d7b8d247fa275d6d1e26b1070bd0a0 | dalehurtt/smartphones | run_analysis.R | ####
# This script does the following, not necessarily in the listed order.
#
# 1. Merges the training and the test data sets to create one data set.
# 2. Extracts only the measurements on the mean and standard deviation for each measurement.
# 3. Uses descriptive activity names to name the activities in the data set.... | 6,210 | gpl-2.0 |
7b11ccb8c87c072cb8f2a3c943a2c2b9e99cfc0c | USGS-R/WQ-Review | inst/shiny/WQReviewGUI/ui_dataImport.R | ###This contains all the ui elements for the data import tab.
###It is sourced from the ui-body tab, which is eventually sourced from the ui tab.
###These are contained in individual scripts just for organization sake.
fluidPage(
pageWithSidebar(
headerPanel("User-specified import"),
sidebarPanel(
sel... | 3,320 | unlicense |
faf45990c006969f610d559038b9df3738bfb05e | AndreyAkinshin/DynamicalSystemsPortraits | SprottChaoticFlow/Input/L/Params.R | kx.y <- 1
kx.z <- 3.9
ky.xx <- 0.9
ky.y <- -1
kz <- 1
kz.x <- -1 | 75 | mit |
9eaebf883176dd0a279bc73d661c134decc7688f | michaelrstatfsu/spherical_data_analysis | R_Spherical_Regression_Code/sd_von_Mises_Fisher.R | UNIFORMdirections<-function(m,n){
# generate n uniformly distributed m dim'l random directions
# Using the logic: "directions of Normal distribution are uniform on sphere"
V = matrix(0,m,n);
nr = matrix(rnorm(m*n),m,n); #Normal random
for (i in 1:n){
repeat {
ni=t(nr[,i])%*%nr[,i] # leng... | 5,136 | mit |
faf45990c006969f610d559038b9df3738bfb05e | CyclicDynamicalSystems/DynamicalSystemsPortraits | SprottChaoticFlow/Input/L/Params.R | kx.y <- 1
kx.z <- 3.9
ky.xx <- 0.9
ky.y <- -1
kz <- 1
kz.x <- -1 | 75 | mit |
7f0780488ca3ebb243fa1e153080ed527e1a649c | youngstreetinitiative/lsp | Scripts/example of working with each file.R | #' @export
bundle_sheets <- function() {
files <- list.files("data-raw") %>%
map( ~ list(
name = str_replace(.x, ".xls", ""),
file_path = glue("data-raw/{.x}")
)) %>%
set_names(map_chr(., "name"))
master_ls <- files %>%
map( ~ process_sheet(.x))
nms <- master_ls %>% map_chr("full_... | 425 | mit |
1dd6e8d540e8297a310eb078144a8326d4effeb0 | michalkurka/h2o-3 | h2o-r/tests/testdir_algos/gam/runit_PUBDEV_7366_gam_cv_gaussian.R | setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f")))
source("../../../scripts/h2o-r-test-setup.R")
# make sure cross-validation runs properly in R
test.model.gam.cross.validation <- function() {
data <- h2o.importFile(path = locate("smalldata/glm_test/gaussian_20cols_10000Rows.csv"))
data$C1 ... | 1,488 | apache-2.0 |
14bbee1acd7d81ae66c3081016247518557f6a91 | cboettig/pdg_control | R/value_iteration.R |
#' Identify the dynamic optimum using backward iteration (dynamic programming)
#' @param SDP_Mat the stochastic transition matrix at each h value
#' @param x_grid the discrete values allowed for the population size, x
#' @param h_grid the discrete values of harvest levels to optimize over
#' @param OptTime the stoppin... | 2,634 | cc0-1.0 |
1dd6e8d540e8297a310eb078144a8326d4effeb0 | h2oai/h2o-3 | h2o-r/tests/testdir_algos/gam/runit_PUBDEV_7366_gam_cv_gaussian.R | setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f")))
source("../../../scripts/h2o-r-test-setup.R")
# make sure cross-validation runs properly in R
test.model.gam.cross.validation <- function() {
data <- h2o.importFile(path = locate("smalldata/glm_test/gaussian_20cols_10000Rows.csv"))
data$C1 ... | 1,488 | apache-2.0 |
bd8941b60860b6b9fb9b33301cb16ad6434508f3 | pchmieli/h2o-3 | h2o-test-integ/tests/hdfs-bigdata/runit_RF_7MRows_4.4KCols_xlarge.R |
#----------------------------------------------------------------------
# Purpose: This test exercises building 15MRows2KCols
#
#----------------------------------------------------------------------
test <-
function() {
hdfs_name_node <- Sys.getenv(c("NAME_NODE"))
print(hdfs_name_node)
hdfs_data_file =... | 1,014 | apache-2.0 |
9c3210c9d939290c3fb3c42589b142ca50fc9d89 | danielturek/automated-blocking-examples | code/run_litters.R | source("autoBlock.R")
load(file.path("data", "model_litters.RData"))
dflitters <- autoBlock(code, constants, data, inits, 2e+05, runList)$summary
save(dflitters, file = file.path("results", "results_litters.RData"))
| 217 | mit |
bd8941b60860b6b9fb9b33301cb16ad6434508f3 | madmax983/h2o-3 | h2o-test-integ/tests/hdfs-bigdata/runit_RF_7MRows_4.4KCols_xlarge.R |
#----------------------------------------------------------------------
# Purpose: This test exercises building 15MRows2KCols
#
#----------------------------------------------------------------------
test <-
function() {
hdfs_name_node <- Sys.getenv(c("NAME_NODE"))
print(hdfs_name_node)
hdfs_data_file =... | 1,014 | apache-2.0 |
b14c86fc50285314d86a561db9a9e9740acb5222 | RebeccaSalles/TSPred | R/data.frame.na.R |
#' data.frames with filled NA's
#' @keywords internal
data.frame.na <- function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE,
stringsAsFactors = FALSE)
{
data.row.names <- if (check.rows && is.null(row.names))
function(current, new, i) {
if (is.character(current))
... | 6,176 | gpl-3.0 |
cf87d58d1d55129253ef8455b4c89c6cea5d9f64 | wStockhausen/rTCSAM2015 | R/writeModelResultsToCSV.PopProcesses.R | #'
#'@title Write population processes from model results from TCSAM2015 and rsimTCSAM model runs to a csv file
#'
#'@description Function to write population processes from model results from TCSAM2015 and rsimTCSAM model runs to a csv file.
#'
#'@param tcsams - single TCSAM2015 model report object, or named list of s... | 2,201 | mit |
c0b20738b59aa61d84a438b81bc113d4f6aaba28 | wch/r-source | src/library/datasets/data/PlantGrowth.R | PlantGrowth <-
data.frame(weight = c(4.17, 5.58, 5.18, 6.11, 4.5, 4.61, 5.17, 4.53,
5.33, 5.14, 4.81, 4.17, 4.41, 3.59, 5.87, 3.83, 6.03, 4.89, 4.32, 4.69,
6.31, 5.12, 5.54, 5.5, 5.37, 5.29, 4.92, 6.15, 5.8, 5.26),
group = factor(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3... | 372 | gpl-2.0 |
052d5ab5e401de06571b2f2b2aa4689e3bc56126 | vbarrera/thesis | Genomic_Evaluation_of_individual_CpG_Methylation/R/figure23_ADS_ADSC.R | ################
### Figure 23 ###
################
ADSCgiFolder<-paste(baseDIR,"results/20120802/",sep="")
ADS_AdiposeCgiFolder<-paste(baseDIR,"results/20120802/",sep="")
datos_ADS<-read.table(paste(ADSCgiFolder,"hg18_reads_ads_CGi_status_sd.txt",sep=""))
datos_ADS_Adipose<-read.table(paste(ADS_AdiposeCgiF... | 11,332 | gpl-2.0 |
c03ee59ae41431e2ffa3be41e8bc64c1ce15e97a | SantanderMetGroup/transformeR | R/intersectMembers.R | ## matchMembers.R Subset two or more grids to the common members
##
## Copyright (C) 2017 Santander Meteorology Group (http://www.meteo.unican.es)
##
## 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... | 1,898 | gpl-3.0 |
ec5cdeb9d1aacddad5e2adf98870f4b0bc20f37e | burrm/lolcat | R/mean.t.test.onesample.simple.R | #' One Sample t Test for Mean
#'
#' Calculate one sample t test for mean.
#'
#' @param x Vector - sample values to be used for mean calculation.
#' @param sample.mean Scalar - sample mean to be tested.
#' @param sample.variance Scalar - sample variance.
#' @param sample.size Scalar - sample size.
#' @param null.hypo... | 3,925 | mit |
5c88f1917a194d102c784f708bb689950def7e38 | cran/metasens | R/print.summary.copas.R | #' Print detailed results of Copas selection model
#'
#' @description
#' Print method for objects of class \code{summary.copas}.
#'
#'
#' This function prints the following information:
#'
#' Range of gamma0 values used (see \code{help(copas)});
#'
#' Range of gamma1 values used (see \code{help(copas)});
#'
#' La... | 4,974 | gpl-2.0 |
5c88f1917a194d102c784f708bb689950def7e38 | guido-s/metasens | R/print.summary.copas.R | #' Print detailed results of Copas selection model
#'
#' @description
#' Print method for objects of class \code{summary.copas}.
#'
#'
#' This function prints the following information:
#'
#' Range of gamma0 values used (see \code{help(copas)});
#'
#' Range of gamma1 values used (see \code{help(copas)});
#'
#' La... | 4,974 | gpl-2.0 |
9dc1af1cb4f518cc0bb8a8d932a20a9ca8e759ee | horver/InstallR | tests/testthat/test_install_from_list.R | test_that("install_from_script::Install libs", {
libs <- c("car", "ggplot2")
install_from_list(libs, load = FALSE)
for (lib in libs)
expect_true(lib %in% utils::installed.packages()[, 1])
})
test_that("install_from_script::Install libs and don't load", {
libs <- c("mgcv", "lme4")
install_from_list(libs, ... | 757 | mit |
61ce45a3e0a9316eb9f2e801ac92f25999b34506 | kingtuna/Hybrid-Darknet-Concept | datas/Attackers.R | # Writen by Terrence Gareau and Zane Witherspoon
# Analyzes feed data in R after attacks were inserted into csv by Python
# python script is feedme.py
library('rworldmap')
library('plyr')
library('ggplot2')
# Date
month <- "September 2015"
# Import Files Start -------------------
base <- read.csv("attack.csv", heade... | 11,226 | bsd-2-clause |
1c7daa954f224dcbed354c34b2591dad0bb52ce3 | bheesink/ENCODER | ENCODER/R/private.R |
.is.wholenumber <- function(x, tol = .Machine$double.eps^0.5) abs(x - round(x)) < tol
.loadCovData <- function(files, gc=NULL, mapa=NULL, black=NULL, excludechr=NULL, datacol=5) {
d <- lapply(files, read.delim, header=F)
cnames <- .removeCommonFix(files)
names(d) <- cnames
#checks
if(length(unique(sapply(d,nro... | 4,621 | gpl-2.0 |
61ce45a3e0a9316eb9f2e801ac92f25999b34506 | kingtuna/honeynet | datas/Attackers.R | # Writen by Terrence Gareau and Zane Witherspoon
# Analyzes feed data in R after attacks were inserted into csv by Python
# python script is feedme.py
library('rworldmap')
library('plyr')
library('ggplot2')
# Date
month <- "September 2015"
# Import Files Start -------------------
base <- read.csv("attack.csv", heade... | 11,226 | bsd-2-clause |
c2a906bfa6d24e9f664757d7e1cde0f6ed351519 | KDE/rkward | tests/distributions/logistic_probabilities.rkcommands.R | local({
## Compute
q <- seq (-5, 5, length.out=20)
p <- plogis (q, location=0.0, scale=1.0)
## Print result
rk.header ("Logistic distribution", parameters=list("Location"="0.0",
"Scale"="1.0",
"Tail"="Lower tail: P[X ≤ x]"))
rk.results (data.frame ("Quantile"=q, "Probability"=p, check.names=FALSE))
})
| 307 | gpl-2.0 |
4292857b904859232e0c2552e6836b242bdf1872 | gdevailly/HeatStarSeq_gh | dataset_fromating/21_modEncode_dm_TF_chipseq.R | # 2016/03/21
# download all file from: ftp://data.modencode.org/D.melanogaster/Transcriptional-Factor/ChIP-seq/computed-peaks_gff3/
# we merged gff3 files
# gunzip *.gz
# grep -v '^#' --no-filename *.gff3 > ../mergedPeaks.gff3
# negative start values and 0 start values. :(
# removing them manually, then:
# sortBed -... | 3,810 | gpl-3.0 |
936ddb6abc70f3ad69c7100a22b71c01770f03ef | donlelef/som-fault-pattern-recognition | ShinyViewer/Packages/STMDataMining/R/getUniqueColumns.R | #' This function selects a subset of a data.frame's rows and and returns unique values.
#'
#' @title Subset of a data.frame's rows and and return unique values.
#' @export
#' @param columns a vector containing the names of the columns that are to be used as ids.
#' @param dataFrame a data.frame with the supposed format... | 540 | gpl-3.0 |
936ddb6abc70f3ad69c7100a22b71c01770f03ef | donlelef/Faut-detection-Thesis | ShinyViewer/Packages/STMDataMining/R/getUniqueColumns.R | #' This function selects a subset of a data.frame's rows and and returns unique values.
#'
#' @title Subset of a data.frame's rows and and return unique values.
#' @export
#' @param columns a vector containing the names of the columns that are to be used as ids.
#' @param dataFrame a data.frame with the supposed format... | 540 | gpl-3.0 |
72b145378c6a54bc12576b427d89e6ab929306a9 | MazamaScience/MazamaSpatialUtils | tests/testthat/test-getStateCode.R | # -----------------------------------------------------------------------------
testthat::context("getStateCode()")
setup_spatial_data <- function() {
skip_on_cran()
skip_on_travis()
# try to set up spatial data. Skip if fails.
spatialDataDir <- try(getSpatialDataDir(), silent = TRUE)
if (!exists('Natural... | 3,183 | gpl-2.0 |
40ec24d2e3b96ac3ce1ab6be6eb9401b446aba3a | sjewo/tmap | pkg/R/legend_hist.R | legend_hist <- function(x, legend.hist.size, lineHeight, scale, m, attr.color, legend.hist.bg.color) {
with(x, {
if (is.factor(values)) {
numbers <- table(values)
xticks <- seq(0, 1, length.out=length(numbers)*2+1)[seq(2,length(numbers)*2,by=2)]
ptx <- levels(values)
#if (any(nchar(ptx)>5)) ptx <- su... | 4,996 | gpl-3.0 |
a953582bd7a000e57d2b0d9fe79825e0b61c7b5c | virtualstaticvoid/heroku-buildpack-r | test/ruby/init.R | # used for R buildpack detection
| 33 | mit |
4cd2319b842455362dc2ceeb1af0ba2eeca9b366 | ganna10/Meteorology_and_Ozone | T_Dep_Indep_Comparisons/Old_stuff/Contours_and_m.R | # Plot O3 contours with m_O3-T as tile. facet run ~ mechanism
# Version 0: Jane Coates 09/11/2015
setwd("~/Documents//Analysis//2015_Meteorology_and_Ozone//T_Dep_Indep_Comparisons")
get.labels = function (break.points, orig.data, digits) {
labels = lapply(break.points,
function (i) round ((i * (max(orig.data) - m... | 4,207 | gpl-2.0 |
6fddda59f705933c16751b16ee78e4bd53204cab | MoBiodiv/MoBspatial | examples/Application3_EAR_aggregation.R | # R code to reproduce Fig. S2 in the article
# mobsim: An R package for the simulation and measurement of
# biodiversity across spatial scales
# Felix May
# October 17 2017
library(mobsim)
# set reference parameters
S0 <- 200
N0 <- 10000
cv0 <- 1
# parameters for scenarios with higher aggregation
sigma_high <- 0.05... | 4,150 | gpl-3.0 |
71c4978aaa94135074227729a1d4da375593bdd9 | krlmlr/r-source | src/library/methods/R/MethodsList.R | # File src/library/methods/R/MethodsList.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2016 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; ... | 36,574 | gpl-2.0 |
71c4978aaa94135074227729a1d4da375593bdd9 | rho-devel/rho | src/library/methods/R/MethodsList.R | # File src/library/methods/R/MethodsList.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2016 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; ... | 36,574 | gpl-2.0 |
71c4978aaa94135074227729a1d4da375593bdd9 | minux/R | src/library/methods/R/MethodsList.R | # File src/library/methods/R/MethodsList.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2016 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; ... | 36,574 | gpl-2.0 |
2610ec21896dc44d63a9b7c3b1e6b541426da9e3 | BEAST2-Dev/codonmodels | perftest/pipeline/EvolerUtils.R | # evolver
### evolver.out
# Note: evolver tree uses the same format as APE tree
#evo.out <- readLines(paste0("t",n.taxa,".out.txt"))
# return a list of true sequences at internal nodes simulated by evolver.
# list names are the internal node index.
getSeqsEvoOut <- function(out.file="ancestral.txt", n.taxa=NULL,
... | 1,492 | lgpl-2.1 |
ffe69b4399e92ba696b8f08c652300325bc0b014 | mtennekes/tmap | examples/tmap_format.R | # available formats
tmap_format()
# create option list to be used as a new format
World_small <- tmap_format("World")
World_small$scale <- 2
# add format
tmap_format_add(World_small, name = "World_small")
# observe that World_small is successfully added:
tmap_format()
data(World)
qtm(World, fill="HPI", format="Wor... | 331 | gpl-3.0 |
71c4978aaa94135074227729a1d4da375593bdd9 | kmillar/cxxr | src/library/methods/R/MethodsList.R | # File src/library/methods/R/MethodsList.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2016 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; ... | 36,574 | gpl-2.0 |
71c4978aaa94135074227729a1d4da375593bdd9 | aviralg/R-dyntrace | src/library/methods/R/MethodsList.R | # File src/library/methods/R/MethodsList.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2016 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; ... | 36,574 | gpl-2.0 |
71c4978aaa94135074227729a1d4da375593bdd9 | krlmlr/cxxr | src/library/methods/R/MethodsList.R | # File src/library/methods/R/MethodsList.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2016 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; ... | 36,574 | gpl-2.0 |
71c4978aaa94135074227729a1d4da375593bdd9 | allr/r-instrumented | src/library/methods/R/MethodsList.R | # File src/library/methods/R/MethodsList.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2016 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; ... | 36,574 | gpl-2.0 |
71c4978aaa94135074227729a1d4da375593bdd9 | allr/timeR | src/library/methods/R/MethodsList.R | # File src/library/methods/R/MethodsList.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2016 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; ... | 36,574 | gpl-2.0 |
71c4978aaa94135074227729a1d4da375593bdd9 | kmillar/rho | src/library/methods/R/MethodsList.R | # File src/library/methods/R/MethodsList.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2016 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; ... | 36,574 | gpl-2.0 |
787cb690ce0b0ecd96ae8bf6d4f0605b806116fb | jukiewiczm/renjin | test-packages/dataTest/R/generateData.R |
generateData <- function() {
(1:8)^2
} | 40 | gpl-3.0 |
71c4978aaa94135074227729a1d4da375593bdd9 | MouseGenomics/R | src/library/methods/R/MethodsList.R | # File src/library/methods/R/MethodsList.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2016 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; ... | 36,574 | gpl-2.0 |
75b9bda139852e4d82422cb316601769e1b83266 | pchmieli/h2o-3 | h2o-r/tests/testdir_munging/exec/runit_eq2_slotAssign_basic.R | ##
# Test: [<- & $<-
# Description: Select a dataset, select columns, change values in the column, re-assign col
##
#setupRandomSeed(1689636624)
test.basic.slot.assignment <- function() {
Log.info("Uploading iris data...")
hex <- h2o.importFile(locate("smalldata/iris/iris_wheader.csv"), "iris.hex")
oldVal <-... | 619 | apache-2.0 |
75b9bda139852e4d82422cb316601769e1b83266 | madmax983/h2o-3 | h2o-r/tests/testdir_munging/exec/runit_eq2_slotAssign_basic.R | ##
# Test: [<- & $<-
# Description: Select a dataset, select columns, change values in the column, re-assign col
##
#setupRandomSeed(1689636624)
test.basic.slot.assignment <- function() {
Log.info("Uploading iris data...")
hex <- h2o.importFile(locate("smalldata/iris/iris_wheader.csv"), "iris.hex")
oldVal <-... | 619 | apache-2.0 |
71c4978aaa94135074227729a1d4da375593bdd9 | ArunChauhan/cxxr | src/library/methods/R/MethodsList.R | # File src/library/methods/R/MethodsList.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2016 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; ... | 36,574 | gpl-2.0 |
71c4978aaa94135074227729a1d4da375593bdd9 | SurajGupta/r-source | src/library/methods/R/MethodsList.R | # File src/library/methods/R/MethodsList.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2016 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; ... | 36,574 | gpl-2.0 |
71c4978aaa94135074227729a1d4da375593bdd9 | Mouseomics/R | src/library/methods/R/MethodsList.R | # File src/library/methods/R/MethodsList.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2016 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; ... | 36,574 | gpl-2.0 |
71c4978aaa94135074227729a1d4da375593bdd9 | cxxr-devel/cxxr | src/library/methods/R/MethodsList.R | # File src/library/methods/R/MethodsList.R
# Part of the R package, https://www.R-project.org
#
# Copyright (C) 1995-2016 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; ... | 36,574 | gpl-2.0 |
8298e1ad0077132f653ef643f8a30877fe2cb5fe | DavidNovo/ExplorationsWithR | directoryManipulationAndReadingCSV.R | getwd()
setwd("C:/Users/ahall/Documents/GitHub/ExplorationsWithR")
reddit <- read.csv('reddit.csv')
table(reddit$employment.status)
'''
Employed full time Freelance
14814 1948
Not employed and not looking f... | 1,142 | apache-2.0 |
ba2b5389d065f40ced7fe778a7c2469363030c62 | sebastianueckert/mirt | R/mirt.model.R | #' Specify model information
#'
#' The \code{mirt.model} function scans/reads user input to specify the
#' confirmatory model. Item locations must be used in the specifications if no
#' \code{itemnames} argument is supplied. This is called implicitly by estimation functions
#' when a string is passed to the \code{model... | 16,350 | gpl-2.0 |
1219c5b3244a8546d7af5890cbfc19e8cd1969e9 | cran/Zelig | tests/testthat/test-zelig.R | #### Integration tests for the Zelig estimate, set, sim, plot workflow ####
# FAIL TEST sim workflow -------------------------------------------------------
test_that('FAIL TEST sim method warning if insufficient inputs', {
z5 <- zls$new()
expect_output(z5$zelig(Fertility ~ Education, model="ls", data = swis... | 11,702 | gpl-2.0 |
ab36322908d899d1a33aedd0178faf0fd2c14e52 | llattes/datasciencecoursera | Exploratory/Week3/plot1.R | plot1 <- function() {
require("RColorBrewer")
NEI <- readRDS("summarySCC_PM25.rds")
s1 <- subset(x = NEI, subset = NEI$year == 1999)
s2 <- subset(x = NEI, subset = NEI$year == 2002)
s3 <- subset(x = NEI, subset = NEI$year == 2005)
s4 <- subset(x = NEI, subset = NEI$year == 2008)
emissions_by_year = data.f... | 875 | mit |
31868c67c6eb1f1b19ef54ba61c3af389d1e0358 | diegofernandes/servicemanager | plugins/feedbackDemo:1.0/feedbackDemo:1.0.R | #!/usr/bin/env Rscript
#
# Meccano IOT ServiceManager
#
#
# 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 3 of the License, or
# (at your option) any later version.
#
# This prog... | 2,042 | gpl-3.0 |
9e25f12ce82a9d8bcdd048f5614b2796e31ed7eb | cheerzzh/R_for_Quantitative_Finance | rate-analysis/INR266/INR266_index.R | library(xts)
library(xtsExtra)
index <- read.csv('NSERO_index.csv',stringsAsFactors = FALSE)
# for currency first
data <- index
dates <- data$Date
rates <- data[,-1]
dates <- as.POSIXct(dates,format ="%m/%d/%Y")
t <- as.xts(rates, order.by = dates)
rate_name <- names(t)
span <- 0.08
tsoutliers <- function(x,plot=TRU... | 3,151 | mit |
9e25f12ce82a9d8bcdd048f5614b2796e31ed7eb | WealthCity/R_for_Quantitative_Finance | rate-analysis/INR266/INR266_index.R | library(xts)
library(xtsExtra)
index <- read.csv('NSERO_index.csv',stringsAsFactors = FALSE)
# for currency first
data <- index
dates <- data$Date
rates <- data[,-1]
dates <- as.POSIXct(dates,format ="%m/%d/%Y")
t <- as.xts(rates, order.by = dates)
rate_name <- names(t)
span <- 0.08
tsoutliers <- function(x,plot=TRU... | 3,151 | mit |
9e25f12ce82a9d8bcdd048f5614b2796e31ed7eb | jond3k/R_for_Quantitative_Finance | rate-analysis/INR266/INR266_index.R | library(xts)
library(xtsExtra)
index <- read.csv('NSERO_index.csv',stringsAsFactors = FALSE)
# for currency first
data <- index
dates <- data$Date
rates <- data[,-1]
dates <- as.POSIXct(dates,format ="%m/%d/%Y")
t <- as.xts(rates, order.by = dates)
rate_name <- names(t)
span <- 0.08
tsoutliers <- function(x,plot=TRU... | 3,151 | mit |
7e278e86677d18ee4d35325e6309d3be7ee7b4fa | bcgov/rcaaqs | tests/testthat/test-7_pm_caaqs.R | context("pm caaqs wrappers")
d1 <- readRDS("pm_raw1.rds")
d2 <- readRDS("pm_raw2.rds")
pm2.5_24h_caaqs_one <- NULL
pm2.5_24h_caaqs_mult <- NULL
pm2.5_annual_caaqs_one <- NULL
pm2.5_annual_caaqs_mult <- NULL
test_that("classes and extractors for pm2.5_24h", {
expect_message(pm2.5_24h_caaqs_one <<- pm_24h_caaqs(d1), ... | 7,261 | apache-2.0 |
d487b1a6274d7949911e12d6011fd6ab3215d5ff | R-Lum/Luminescence | R/plot_AbanicoPlot.R | #' Function to create an Abanico Plot.
#'
#' A plot is produced which allows comprehensive presentation of data precision
#' and its dispersion around a central value as well as illustration of a
#' kernel density estimate, histogram and/or dot plot of the dose values.
#'
#' The Abanico Plot is a combination of the cla... | 133,270 | gpl-3.0 |
99012a25ea6e6fa64c18b8b9fbec753c7a5186e9 | paul4forest/forestproductsdemand | docs/all_products/draft with brew/knit_reports with brew.R | #
# Generate Reports for the different forest products using brew
#
# Inspired by
# http://botthoughts.wordpress.com/2012/05/17/generating-reports-for-different-data-sets-using-brew-and-knitr/
# I first used brew, but then used knitr only
library(knitr)
opts_knit$set(base.dir = './docs/all_products/') # Change the b... | 1,106 | gpl-2.0 |
0d51cfbd8ec08ad2220a91b12fc8bc52d4d6fd99 | jonathandfitzgerald/Viral-Texts-R | Wright Data.R | #Working with Wright Data
#make a list of all files
WRIGHT = list.files("data/wright-txt",full.names = TRUE)
#function to read them in
readWRIGHT = function(file) {
message(file)
text = paste(scan(file, sep="\n",what="raw",strip.white = TRUE),collapse = "/n")
WRIGHT = data.frame(filename=file,text=text,stringsA... | 4,888 | gpl-2.0 |
ccad15eb5a562b0d98e7d7d0a5a2eed595fc9f78 | coolbutuseless/AuCensus2011 | R/abs_files.R |
#=============================================================================
# Code for general file pathnames, manipulation etc
#=============================================================================
#' Path to ABS DataPack CSV file
#'
#' \code{create_abs_filename} creates the path to a given ABS datapack f... | 4,101 | mit |
d58e7178a3b49ed65740a293c993e4e0fc8ad488 | sbfnk/flusurvey | analysis/analysis_201112.R | library(data.table)
library(ggplot2)
library(reshape)
symptoms <- c("fever","chills","blocked.runny.nose","sneezing","sore.throat","cough","shortness.breath","headache","muscle.and.or.joint.pain","chest.pain","tired","loss.appetite","phlegm","watery.eyes","nausea","vomiting","diarrhoea","stomach.ache","other")
# comp... | 85,926 | gpl-2.0 |
b269d07226017fb21ef663ef82d19f0b6a74c0fb | arank/mxnet | R-package/R/rnn_model.R | is.param.name <- function(name) {
return (grepl('weight$', name) || grepl('bias$', name) ||
grepl('gamma$', name) || grepl('beta$', name) )
}
# Initialize parameters
mx.model.init.params.rnn <- function(symbol, input.shape, initializer, ctx) {
if (!is.mx.symbol(symbol)) stop("symbol need to be MXSymbo... | 9,826 | apache-2.0 |
b269d07226017fb21ef663ef82d19f0b6a74c0fb | EvanzzzZ/mxnet | R-package/R/rnn_model.R | is.param.name <- function(name) {
return (grepl('weight$', name) || grepl('bias$', name) ||
grepl('gamma$', name) || grepl('beta$', name) )
}
# Initialize parameters
mx.model.init.params.rnn <- function(symbol, input.shape, initializer, ctx) {
if (!is.mx.symbol(symbol)) stop("symbol need to be MXSymbo... | 9,826 | apache-2.0 |
2e37573308cf9e18ec830699b4cd866cbb53debe | NickSalkowski/HALICON_2015_Reporting_Presentation | run_rmarkdown_html.R | iris_split <- split(
x = iris[-5],
f = iris$Species)
system.time({
for (i in names(iris_split)) {
rmarkdown::render(
"iris_markdown.Rmd",
output_file = paste0(i, ".html"),
output_dir = "rmarkdown_html",
params = list(species = i),
quiet = TRUE)
}
})
list.files("rmarkdown_html"... | 322 | mit |
b269d07226017fb21ef663ef82d19f0b6a74c0fb | lxn2/mxnet | R-package/R/rnn_model.R | is.param.name <- function(name) {
return (grepl('weight$', name) || grepl('bias$', name) ||
grepl('gamma$', name) || grepl('beta$', name) )
}
# Initialize parameters
mx.model.init.params.rnn <- function(symbol, input.shape, initializer, ctx) {
if (!is.mx.symbol(symbol)) stop("symbol need to be MXSymbo... | 9,826 | apache-2.0 |
b269d07226017fb21ef663ef82d19f0b6a74c0fb | Ldpe2G/mxnet | R-package/R/rnn_model.R | is.param.name <- function(name) {
return (grepl('weight$', name) || grepl('bias$', name) ||
grepl('gamma$', name) || grepl('beta$', name) )
}
# Initialize parameters
mx.model.init.params.rnn <- function(symbol, input.shape, initializer, ctx) {
if (!is.mx.symbol(symbol)) stop("symbol need to be MXSymbo... | 9,826 | apache-2.0 |
b269d07226017fb21ef663ef82d19f0b6a74c0fb | coder-james/mxnet | R-package/R/rnn_model.R | is.param.name <- function(name) {
return (grepl('weight$', name) || grepl('bias$', name) ||
grepl('gamma$', name) || grepl('beta$', name) )
}
# Initialize parameters
mx.model.init.params.rnn <- function(symbol, input.shape, initializer, ctx) {
if (!is.mx.symbol(symbol)) stop("symbol need to be MXSymbo... | 9,826 | apache-2.0 |
b269d07226017fb21ef663ef82d19f0b6a74c0fb | apaleyes/mxnet | R-package/R/rnn_model.R | is.param.name <- function(name) {
return (grepl('weight$', name) || grepl('bias$', name) ||
grepl('gamma$', name) || grepl('beta$', name) )
}
# Initialize parameters
mx.model.init.params.rnn <- function(symbol, input.shape, initializer, ctx) {
if (!is.mx.symbol(symbol)) stop("symbol need to be MXSymbo... | 9,826 | apache-2.0 |
ae1f8e9efef828088fee8eee45ea07a4d32b1902 | ccwang002/2014-China-RConf-Interactive-Vis | R_proj/play_grid.R | library(grid)
grid.newpage()
pushViewport(plotViewport(c(5, 4, 2, 2)))
pushViewport(dataViewport(
pressure$temperature,
pressure$pressure,
name="plotRegion"
))
grid.points(pressure$temperature,
pressure$pressure,
name="dataSymbols")
grid.rect(gp=gpar(fill=0))
grid.xaxis()
grid.yaxis()
gr... | 633 | mit |
16b957f66af5a09820a39dcf89e49bbc0008cbff | kingaa/pomp | tests/R_v_C.R | options(digits=3)
png(filename="R_v_C-%02d.png",res=100)
## ----packages------------------------------------------------------------
library(pomp)
library(ggplot2)
## ----seed,echo=FALSE-----------------------------------------------------
set.seed(56300069)
## ----R1-------------------------------------------------... | 2,788 | gpl-3.0 |
6a7a22d0fcbd272672d047acea67ac1955d7e81f | ReproducibleQM/sapsuckRz | prism_weather_data_pull.R | ##Download weather data from PRISM and pull weather data for individual sites
#created on:5/17/2017
#created by: Chad Zirbel
#pull in coordinates for all sites
location<-read.csv("counties+coordinates2.csv")
#install and load packages
#install.packages("prism")
library(prism)
#pull max and min temp and precipitatio... | 1,230 | mpl-2.0 |
702aa7237898dd8dd41030edb2676f609f8e0332 | mem48/glider | Gavin/forGavin.R | # Simple File to get Gavin Started
# Step 1: Get R set up correctly
library(igraph) # Load in the igraph library if it is not available use install.packages("igraph")
# Step 2: Read in the data
graph = readRDS("twitterNetwork.Rds") #Read the file called twitterNetwork and make it a variaible called graph
# Step 3:... | 4,758 | gpl-3.0 |
c83e9d2bc29c7eda47c2a4c5301493fb74c9bac2 | leomaranhao/dataScience9week4 | ui.R | library(shiny)
library(leaflet)
shinyUI(pageWithSidebar(
headerPanel("Insurance Direct Premium in Brazil"),
sidebarPanel(
selectInput("Segment", "Choose the Segment:",
choices = c("Auto" = "Auto",
"Multiple Peril" = "Compreensivos",
"DP... | 2,456 | apache-2.0 |
b573359b4ff774c67a6621af5c5d11e9efd5b8b2 | oursu/Gem_code | data_processing/RNAseq/scripts/DEgenes_fromCufflinks.R |
#====
args=commandArgs(trailingOnly=TRUE)
DE_FILE=args[1]
SIG=as.numeric(args[2])
FPKMmin=as.numeric(args[3])
out=args[4]
EXPRESSED=args[5]
#Produce a set of upregulated genes, and a set of downregulated genes
#Get data
de_data=read.table(DE_FILE,header=TRUE)
#Function for picking DE genes
pick_DE_genes=functio... | 1,896 | bsd-3-clause |
c7b44baf51c184796a12eb6a1b668f4510f006e2 | advnturecaptlst/kaggle_archive | avito/avito.R | # coding: utf-8
#__author__ = 'IPM'
# Required Libraries
library(data.table)
library(readr)
library(caret)
library(stringdist)
# Read in data
location <- fread("~/Documents/kaggle/avito/input/Location.csv")
itemPairsTest <- fread("~/Documents/kaggle/avito/input/ItemPairs_test.csv")
itemPairsTrain <- fread("~/Documen... | 6,768 | apache-2.0 |
01064a6146e8eb6672cb3c97eacc5bcc4efbe052 | javierluraschi/sparkworker | R/worker_apply.R | spark_worker_apply <- function(sc) {
hostContextId <- invoke_method(sc, FALSE, "Handler", "getHostContext")
log("retrieved worker context id ", hostContextId)
context <- structure(
class = c("spark_jobj", "worker_jobj"),
list(
id = hostContextId,
connection = sc
)
)
log("retrieved wo... | 1,366 | apache-2.0 |
e6b4137c27603998b86d43e3751a211436cdf420 | nstauffer/aim.analysis | R/benchmarking.R | #' Apply benchmarks to data
#' @description Using data that has unique identifier and indicator value variables, apply benchmarks. The benchmarks are applied to the data based on the benchmark group(s) that the data belong to, which may already be assigned in the data or may be added with a benchmark group lookup table... | 14,838 | mit |
704c733d011782b8795068569284f0400ecc1e5b | aknight1-uva/jasp-desktop | JASP-Engine/JASP/R/ttestpairedsamples.R | #
# Copyright (C) 2013-2015 University of Amsterdam
#
# 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 your option) any later version.
#
# This program i... | 23,983 | agpl-3.0 |
14b18753e84ef8cd9c34e7260ca947fed24fcb54 | gxa/gxa | atlas-loader/src/main/resources/R/htsProcessPipeline.R | esetToTextFile = function(infname, outfname) {
require(Biobase)
objnames = load(infname);
expressions = exprs(get(objnames[1]));
dimensionnames = dimnames(expressions);
write(c("scanref", dimensionnames$sample), file = outfname,
ncolumns = length(dimensionnames$sample) + 1, sep = "\t");
... | 456 | apache-2.0 |
e0041886b136b25aa50aa3b65c921f6b1f188d06 | cran/TIMP | R/calcD.R | "calcD" <- function (kincoeffs, times, cstart, rsmatrix, smatrix) {
## contributed by David Nicolaides <dnicolaides@accelrys.com>
## in modified form, along with other options for 2nd order modeling
ns <- length(cstart)
np <- length(kincoeffs)
## we need to pass our kinetic model the stoichiometry matric... | 1,159 | gpl-2.0 |
4bd8d8dcd35daf0c16b9ce1329f6dddf4897c75e | princelab/metriculator | r_install.R | #!/usr/bin/env Rscript
install.packages('Rserve')
install.packages('beanplot')
| 79 | mit |
0e2fdf2b6c3198ad5c9e73d1ee388bb1af073aa4 | lmweber/cytometry-clustering-comparison | run_methods/run_SWIFT.R | # How to run SWIFT
# Not available in R, so follow steps below instead:
# Requires: Matlab, Statistics Toolbox, Parallel Computing Toolbox
# 1. Copy FCS file into a temporary directory; results files will be saved in the same
# directory.
# 2. Run SWIFT graphical interface from Matlab by typing "swift_main" in comma... | 3,932 | mit |
9fcb746f0e3e27fef594eb7ac1fee2254d8d5f0e | nxdao2000/pis2 | tests/ou2-is2.R | library(pis2)
library(coda)
library(lattice)
pompExample(ou2)
Nmcmc<-100
NP<-1000
dprior.ou2 <- function (params, log, ...) {
f <- sum(dunif(params,min=coef(ou2)-1,max=coef(ou2)+1,log=TRUE))
if (log) f else exp(f)
}
p.truth <- coef(ou2)
guess2 <- guess1 <- p.truth
guess1[c('x1.0','x2.0','alpha.2','alpha.3')] <- 0... | 2,890 | gpl-2.0 |
008c415357f23b8897440b22f687b7b9f4a92d57 | michathoma/flywalkr | R/response_per_pulse.R | #' Calculate mean net displacement per odor pulse.
#'
#' Calculate mean response per odor pulse in a given experiment. Can be used to check data for adaptation/habituation effects.
#' Response is defined as the net displacement within 4s after odor encounter.
#'
#' @param object a \code{data.frame} as produced by \code... | 1,199 | mit |
77665e3c0fabf04e9bf97bb0925b498a6272ed26 | aWhereAPI/aWhere-R-Library | R/grid-functions.R | #' Get aWhere GridX from longitude coordinate(s)
#'
#'
#' @param longitude one more more longitude coordinates
#'
#' @return A vector of GridX values
#'
#' @examples getGridX(-90)
#'
getGridX <- function(longitude) {
MaxLon <- 180
MinLon <- -180
MaxGridX <- 2160
MinGridX <- -2160
gridX <- (longitude / ((Ma... | 1,807 | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.