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 |
|---|---|---|---|---|---|
c92052342eb849c473fea81b3a977d29ad275a61 | kevinykuo/sparklyr | R/tbl_spark.R | #' @export
dim.tbl_spark <- function(x) {
c(NA_real_, sdf_ncol(x))
}
#' @export
type_sum.spark_jobj <- function(x) {
paste0(jobj_info(x)$repr)
}
| 150 | apache-2.0 |
f2df98e0cf85147da96b90cc194d761cf8657ebd | ellisp/forecastHybrid | pkg/tests/testthat/test-cvts.R | # Unit tests on the cvts function
if (require(forecast) & require(testthat)) {
naiveForecast <- function(train) {
result <- list()
result$series <- train
result$forecast <- train[length(train)]
class(result) <- "naive_model"
return(result)
}
forecastFunction <- function(model, h = 12) {
r... | 7,724 | gpl-3.0 |
a05d4e1efea7affcebcd4e3560c0d530bd08306e | SampleSizeShop/GlimmpseWeb | war/images/orthoPolyImageBuilder.R | #
# Create icons for orthogonal polynomials
#
library(Cairo)
# draw brace
CurlyBraces <- function(x, y, range, pos = 1, direction = 1 ) {
a=c(1,2,3,48,50) # set flexion point for spline
b=c(0,.2,.28,.7,.8) # set depth for spline flexion point
curve = spline(a, b, n = 50, method = "natural... | 1,797 | gpl-2.0 |
08d48f1663fafa7ab5fe988616f4535ed7df7b0b | cran/rv | R/rvunif.R | #' Generate Random Vectors from a Uniform Sampling Model
#'
#' Generates random variables from a Uniform sampling model.
#'
#'
#' @param n integer: number of scalars to generate
#' @param min lower limit of the distribution, (may be random)
#' @param max upper limit of the distribution, (may be random)
#' @author Jo... | 815 | gpl-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | apache/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | wangmiao1981/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | wangyum/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | vinodkc/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | HyukjinKwon/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | mahak/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | zero323/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | WeichenXu123/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | zzcclp/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | xuanyuanking/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | cloud-fan/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | BryanCutler/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | dongjoon-hyun/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | milliman/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
1e9b2a6ad327065546bd51f787fb519d3112609b | SMRUCC/R-sharp | test/syntax/Rscript/logicalArgument.R | # cli input
let is_false as boolean = ?"--missing";
let is_true as boolean = ?"--is_true";
print(is_true);
print(is_false); | 126 | gpl-3.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | srowen/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | gengliangwang/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | JoshRosen/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
59a0f2097e527ac20834df07abb05c646ad81aea | JanMarvin/rstudio | src/cpp/tests/testthat/test-environment.R | #
# test-environment.R
#
# Copyright (C) 2020 by RStudio, PBC
#
# 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 progr... | 2,417 | agpl-3.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | ueshin/apache-spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
a846259385a28dc408f3ef70da420ba40885dad5 | ggirelli/tepp | anRes-scripts/plotCooccurrency.R | #!/usr/bin/env Rscript
#
# ./plotCooccurrency.R total_graph n.sample suffix output_dir
library('igraph')
args <- commandArgs(trailingOnly=TRUE)
if(length(args) != 4) stop('./plotCooccurrency.R total_graph n.sample suffix output_dir')
# Mkdir
if(!file.exists(args[4])) dir.create(args[4])
# Read
g <- read.graph(args[... | 4,098 | mit |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | taroplus/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
fccac15658809a6474d74808a0a16d50013057d1 | oswaldosantos/EpiDynamics | R/SIRInducedMortality.R | #' SIR model with disease induced mortality: Density-dependent transmission (P 2.3).
#' @description Solves a SIR model with a probability of mortality, and unequal births and deaths.
#' @param pars \code{\link{vector}} with 5 values: the probability that an infected individual dies from the disease before recovering, ... | 3,447 | gpl-3.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | nchammas/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | jiangxb1987/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | maropu/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | shaneknapp/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
fccac15658809a6474d74808a0a16d50013057d1 | Komondi/EpiDynamics | R/SIRInducedMortality.R | #' SIR model with disease induced mortality: Density-dependent transmission (P 2.3).
#' @description Solves a SIR model with a probability of mortality, and unequal births and deaths.
#' @param pars \code{\link{vector}} with 5 values: the probability that an infected individual dies from the disease before recovering, ... | 3,447 | gpl-3.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | rednaxelafx/apache-spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | holdenk/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | witgo/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | chuckchen/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
0aabceef226e39d18ec3cd6dc5181b0c291d849c | hvanhovell/spark | R/pkg/R/stats.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 9,633 | apache-2.0 |
8475f34566c5f6254fc6be14706ac7858baf83aa | albhasan/rwtss | tests/run-all.R | library(testthat)
library(rwtss)
test_check("rwtss") | 53 | mit |
61a4e11ea4e0d5b4ced16849553ef9cb62970d43 | JuKa87/OpenMx | R/MxAlgebraObjective.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 ... | 1,324 | apache-2.0 |
222daa0a2aa7671d2584e21f99096d95d30eba82 | pased/katabasia-twitter-sna | funs/lemmatize.R | # takes character vector and returns lemmatized text
# requires python3 and pymystem3 module (https://github.com/Digsolab/pymystem3)
lemmatize <- function (texts) {
path2script='"./funs/lemmatize.py"'
lemm_loop <- NULL
for (i in 1:length(texts)) {
print(paste("Progress: ", i, "/", length(texts), sep=""))
... | 498 | gpl-2.0 |
b7d6c1fcefc0c942f89324486249c9e9b7b29fc3 | shosaco/vistime | R/gg_vistime.R | #' Create a Timeline rendered by ggplot2
#'
#' Provide a data frame with event data to create a static timeline plot created by ggplot2.
#' Simplest drawable dataframe can have columns `event` and `start`.
#'
#' @param data \code{data.frame} that contains the data to be visualized
#' @param col.event (optional, charact... | 4,602 | gpl-3.0 |
78b6265600401a55480baf5fffe6002e06eaacec | ColumbusCollaboratory/electron-quick-start | R-Portable-Win/library/yaml/tests/test_write_yaml.R | test_output_is_written_to_a_file_when_a_filename_is_specified <- function() {
filename <- tempfile()
write_yaml(1:3, filename)
output <- readLines(filename)
unlink(filename)
checkEquals(c("- 1", "- 2", "- 3"), output)
}
| 230 | cc0-1.0 |
70e75fe0dc70420cd5108dd476bc26a1ad73e96d | ohgane/ShotgunLipidomicsR | R/plotIsotope.R | #' Plot isotope patterns
#'
#' A wrapper function for Rdisop::getMolecule, getIsotopes etc., that allows easier plotting of the isotope patterns.
#'
#' @param chemsc Chemical sum composition (elemental formula) as a character (e.g. "H2O").
#' @param z Charge
#' @param add Logical (default FALSE). If TRUE, overlay iso... | 1,176 | mit |
21530b04de6f3e3807528fca84a7574462e2d6bd | wStockhausen/rsimTCSAM | R/getMDFR.Pop.Abundance.R | #'
#'@title Get population abundance time series from model results from rsimTCSAM model runs as a dataframe
#'
#'@description Function to get population abundance time series from model results from rsimTCSAM model runs as a dataframe.
#'
#'@param rsims - single rsimTCSAM.rep object, rsimTCSAM.resLst object, or named ... | 1,389 | mit |
e02c23303a4ce72bce743d99bd7a119aa6f4d387 | mertnuhoglu/study | r/shiny/ex/shiny_database/persistent-data-storage/e02.R |
# Source code from: [Shiny - Persistent data storage in Shiny apps](https://shiny.rstudio.com/articles/persistent-data-storage.html#file)
library(shiny)
# 1. Local file system (local)
# saveData
# loadData
# Define the fields we want to save from the form
fields <- c("name", "used_shiny", "r_num_years")
outputDir ... | 1,818 | apache-2.0 |
5cdeecb2205585ff4fa4dcaae66ba34fc7176cf3 | carvalhomb/sgmodels_study | R/quantitative_analysis.R |
cleanquantdata <- function(mydata) {
#Apply levels
mydata[c('gamefam')] <-lapply(mydata[c('gamefam')], factor, levels = c('1','2','3','4','5'), labels = c('Non-Gamer','Non-Gamer','Non-Gamer','Gamer', 'Gamer'))
mydata[c('sgsfam')] <- lapply(mydata[c('sgsfam')], factor, levels = c('1','2','3','4','5'), labels = c... | 6,870 | cc0-1.0 |
5e4a7e475ae405ea9548b9be4542e18f3811d08a | eastmallingresearch/crosslink | test_scripts/boxplot_hk.R | #!/usr/bin/Rscript
#Crosslink Copyright (C) 2016 NIAB EMR see included NOTICE file for details
library(ggplot2)
system("cat */score > all_scores")
##21,22,25
dat = read.table("all_scores",col.names=c(
"GA_GIBBS_CYCLES",
"GA_ITERS",
"GA_USE_MST",
"GA_MIN... | 2,765 | gpl-2.0 |
afdc3062a76818ca366afd9e338892052b611062 | gaoyuanjun/SHINYstan | inst/SHINYstan/helper_functions/SHINYstan_helpers.R | # misc. functions --------------------------------------------------------
.in_range <- function(x, a, b) {
x >= a & x <= b
}
# ggplot theme elements --------------------------------------------
fat_axis <- theme(axis.line = element_line(size = 1.75))
h_lines <- theme(panel.grid.major = element_line(size = 0.25, lin... | 26,905 | mit |
4754363046aa957f01d4ee538f4491c6d295e086 | michalkurka/h2o-3 | h2o-r/tests/testdir_algos/gam/runit_PUBDEV_7860_randomdiscrete_gridsearch_gaussian_dual_model.R | setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f")))
source("../../../scripts/h2o-r-test-setup.R")
# make sure gam will build the same model regardless of how gam columns are specified
test.model.gam.random.gridsearch.dual.modes <- function() {
trainGaussian <- h2o.importFile(locate("smalldata/ga... | 3,227 | apache-2.0 |
fea683387066db7773d3dd32dff45b17dbed5664 | kaeng/ST-599-Big-Data-3 | App-1/server.R | # Identify clusters in congressional voting records
# Load PR3q First!!
head(PR3q)
# Dems = 1, Reps =2
# ? = 1, no = 2, yes =3
# Transform data to numeric
table(PR3q[,1])
for(i in 1:17){
PR3q[,i]=as.numeric(PR3q[,i])
}
# K modes
# Scree plot:
cl1 <- kmodes(PR3q, 1)
cl2 <- kmodes(PR3q, 2)
cl3 <- kmodes(PR3q, 3) # Use... | 1,586 | mit |
a069eba3afea24abf4644833298bc4a7fe199236 | petertbryant/MidCoastTMDL | 02a_random_forest_step1_plots.R | library(randomForest)
library(reshape)
library(plyr)
source('funCorrelationPlots.R')
#png('varImpALL.png', width = 960, height = 960)
bymedian <- with(fss2.s1.vi.l, reorder(var_index, value, median))
boxplot(value ~ bymedian, data = fss2.s1.vi.l,
ylab = "Variable index", xlab = "% Increase MSE",
varw... | 519 | gpl-3.0 |
12ea7edd643c1e5fb141bedc43ebcf9bbc69c55e | mdbrown/survCompetingRisk | R/comprisk.PPV.R | comprisk.PPV <-
function( times, status1, status2, x, Z=NULL, predict.time, type, smooth = FALSE, sigma=FALSE){
if(length(Z)==0){ Z = rep(0, length(times))}
if(smooth & length(Z) !=0){
warning( "Defining Z while using smoothing is not functional at this time, ignoring Z...")
Z = rep(0, lengt... | 2,424 | gpl-2.0 |
ddfad739bb1a757485d41687f66a01cf28692f45 | errantlinguist/tangrams-restricted | analysis/scripts/coreference_chain_overlap_significance.R | #!/usr/bin/env Rscript
# This file is part of Tangrams-restricted.
#
# Tangrams-restricted 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 vers... | 4,331 | gpl-3.0 |
9cca15adc047595febd93d1c7a8138697f21de32 | cenpat-gilia/CENPAT-GILIA-LOD | r-scripts/conservation-status.R | library(SPARQL) # SPARQL querying package
library(stargazer)
# Step 1 - Set up preliminaries and define query
# Define the CENPAT-GILIA endpoint
endpoint <- "http://crowd.fi.uncoma.edu.ar:3333/repositories/BIO_CNP_GILIA"
# create query statement
query <- "PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX owl: <http:/... | 927 | gpl-3.0 |
4834dcb58b6be205fe972096351d16f207f83852 | wibeasley/shiny-class-2015 | Thomas/lesson_1/ui.R | library(shiny)
# Define UI for application that draws a histogram
shinyUI(fluidPage(
# Application title
titlePanel("Hello Shiny!"),
# Sidebar with a slider input for the number of bins
sidebarLayout(
sidebarPanel(
sliderInput("bins", "Number of bins:", min = 1, max = 50, value = 30)
),
# ... | 507 | mit |
d47e6cf703340e61caeb173b3b11f9a6e0bc0da1 | fabiomorais/ASaaS | multiple_types/google/scaling_perf_max.R | library(ggplot2)
library(dplyr)
library(tidyr)
library(scales)
library(foreach)
library(doMC)
flavors = c("c4.large", "m4.large", "r3.large", "c3.large", "m3.medium")
filename = "data/prices.csv"
df_inst = read.csv(file = filename, header = T)
df_inst = select(df_inst, NAME, VCPU, ECU, MEM, ... | 3,561 | apache-2.0 |
e3a75cdb87fbc80d0c8fa5d466d910e1e3d9edf8 | langcog/alignment | models/R/www2016_simulation_variance.R | library(ggplot2)
library(data.table)
library(dplyr)
library(langcog)
library(readr)
library(tidyr)
library(stringr)
library(magrittr)
library(directlabels)
library(lubridate)
library(lme4)
library(rstan)
rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())
#options(mc.cores = 1)
invlogit <- fu... | 24,232 | gpl-2.0 |
250d3a287f1508a073fff3e7bee7dbfe33ae05db | spennihana/h2o-3 | h2o-r/tests/testdir_algos/glm/runit_PUBDEV_5008_5386_ordinal_glm_nidhi_R.R | setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f")))
source("../../../scripts/h2o-r-test-setup.R")
library(MASS)
glmOrdinal <- function() {
D <- h2o.uploadFile(locate("smalldata/glm_ordinal_logit/ordinal_nidhi_small.csv"))
D$apply <- h2o.ifelse(D$apply == "unlikely", 0, h2o.ifelse(D$apply == "s... | 3,112 | apache-2.0 |
250d3a287f1508a073fff3e7bee7dbfe33ae05db | h2oai/h2o-dev | h2o-r/tests/testdir_algos/glm/runit_PUBDEV_5008_5386_ordinal_glm_nidhi_R.R | setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f")))
source("../../../scripts/h2o-r-test-setup.R")
library(MASS)
glmOrdinal <- function() {
D <- h2o.uploadFile(locate("smalldata/glm_ordinal_logit/ordinal_nidhi_small.csv"))
D$apply <- h2o.ifelse(D$apply == "unlikely", 0, h2o.ifelse(D$apply == "s... | 3,112 | apache-2.0 |
22bc2971245026feaf6aa506122bee706062909e | jgruselius/misc | R/sum_data_per_lane.R | sum_data_per_lane <- function(data) {
runs <- unique(data$Description)
for(r in runs) {
print(r)
run_data <- data[data$Description==r,]
lanes <- unique(run_data$Lane)
for(l in lanes) {
print(sum(run_data[run_data$Lane==l,]$Read.pairs..Mbases.))
}
}
} | 266 | apache-2.0 |
d5e449b6038a94ef49624d6a4977292f8d90b4a7 | nfahlgren/conference_twitter_stats | conf_twitter_stats.R | library(twitteR)
library(ggplot2)
library(gridExtra)
library(plyr)
library(tm)
library(tm.plugin.webmining)
library(wordcloud)
# Your constants
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN = ''
ACCESS_SECRET = ''
HASHTAG = ''
# Authenticate with your Twitter API app
setup_twitter_oauth(consumer_key = CONSUMER_... | 3,603 | mit |
c4f7d264b8b0930b652c3a9dac83e1650cc54b84 | yangyao12/map | inst/examples/geojsonv2.R | #' ---
#' title: "Plotting GeoJSON Data using leaflet.extras"
#' author: "Bhasar V. Karambelkar"
#' output:
#' html_document:
#' toc: true
#' toc_float: true
#' code_folding: show
#' ---
library(leaflet.extras)
library(magrittr)
leaf <- leaflet() %>%
addProviderTiles(providers$CartoDB.Positron)
#' ##... | 11,253 | gpl-3.0 |
a12c4230b8451e26581b094abeec3f68c31a0946 | antonio-mora/iRefR | R/select_database.R | ####
# Select the subset of records in iRefIndex belonging to a certain primary Interaction Database:
####
select_database = function(database, MITAB_table, flag="this_database") {
# 1. Dataset for these databases:
dataset = NULL
for (i in database) {
dataset = rbind(dataset, MITAB_table[grep(i, MITAB_table$source... | 649 | mit |
17050b99fc0f96204c2d02f87b9ba77048478ea3 | JoeyBernhardt/OA-meta | R/00_data_prep_calcification_main.R |
### calcification exact data prep
library(dplyr)
library(tidyr)
library(readr)
library(janitor)
calcification <- read_csv("data-raw/calcification_main.csv")
## now onto interactive effects
cal1 <- calcification %>%
clean_names()
high <- cal1 %>%
filter(food_supply == "High") %>%
rename(mean_ambienthigh... | 3,274 | mit |
fe8417b5effc5f2b68618577c5a0bda31ce5d50b | LearningToTalk/L2TDatabase | inst/migrations/gfta/gtfa_mass_import.R | library("L2TDatabase")
library("dplyr")
library("tidyr")
library("readr")
library("stringr")
# Load external dependencies
source("inst/paths.R")
source(paths$GetSiteInfo, chdir = TRUE)
# Download/backup db beforehand
cnf_file <- file.path(getwd(), "inst/l2t_db.cnf")
l2t <- l2t_connect(cnf_file, "backend")
l2t_dl <- l... | 5,487 | gpl-2.0 |
e3c59bdf6b2988efd7b6c60d3bdf7d88f5ac2550 | prafols/rMSI | R/ImportBrukerXMASSImage.R | #########################################################################
# rMSI - R package for MSI data handling and visualization
# Copyright (C) 2014 Pere Rafols Soler
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | 11,664 | gpl-3.0 |
ef2502d0e627be288f9817ffd19523f7b8ee468b | bikash/h2o-dev | h2o-r/tests/testdir_docexamples/runit_Rdoc_sum.R | setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f")))
source('../h2o-runit.R')
test.rdocsum.golden <- function(H2Oserver) {
ausPath <- system.file("extdata", "australia.csv", package="h2o")
australia.hex <- h2o.importFile(H2Oserver, path = ausPath, key = "australia.hex")
sum(australia.hex)
sum(austra... | 425 | apache-2.0 |
d366421e8edbab09e5e592dd85d4c23f8235053b | robertzk/cachemeifyoucan | tests/testthat/test-migrations.R | context('cache migrations')
describe("update_cache_salt", {
batch_data_locale <- function(..., locale = "US") {
df <- batch_data(...)
df$locale <- locale
Sys.sleep(0.8)
df
}
db_test_that('updating_cache_salt creates new shards', {
ids <- 1:5
model_version <- "test_data"
locale <- "U... | 1,513 | mit |
a86e0fd5a55689d904bca3bbf14be87d9fcb4da8 | thomasblanchet/gpinter | inst/shiny_app/ui/tab-settings.R | tabPanel("Settings",
fixedPage(
fixedRow(
column(12, tags$div(icon("info-circle"), HTML(" "),
"Here you can change the format of the input tabulated data.",
class="alert alert-info", role="alert"
)),
column(6,
tags$div(... | 5,487 | mit |
aedc05bbad1cf0534e2b78aac876608a58ead58a | fraukewiese/renpass | code_R_renpass/code_R_prepare_storage_plants.R | # This code file is part of renpass published under the GNU GPL 3 license.
# See also: code_R_start_renpass.R and http://opensource.org/licenses/GPL-3.0
#-----
# required package: RMySQL
# applied renpass functions: connectMysql, convertRegionVectorToDpr
#-----
# Description
# Input scenario_parameter, region_... | 6,818 | gpl-3.0 |
68ef0320920c0eb607860c82bfef57e50a5401f4 | thegricean/diskurspartikeln | experiments/3_dp_production/results/rscripts/dp_production.R | theme_set(theme_bw(18))
setwd("/Users/titlis/cogsci/projects/stanford/projects/diskurspartikeln/experiments/3_dp_production/results/")
source("rscripts/helpers.r")
load("data/r.RData")
r = read.table("data/results.csv",quote="", sep="\t", header=T)
head(r)
nrow(r)
names(r)
r$trial = r$slide_number_in_experiment - 2
r... | 1,628 | mit |
3765c1e63040ac7d9bd573b5598a476a534634f6 | USGS-R/powstreams | R/locate_metab_run.R | #' Find a metab_run item on ScienceBase
#'
#' @usage locate_metab_run(title, format = c("id", "url"), by = c("tag", "dir",
#' "either"), limit = 5000, browser = (format == "url"))
#' @param title the title of the metabolism modeling run you want. this is the
#' date, tag, and run strategy separated by spaces.
#' ... | 982 | cc0-1.0 |
3765c1e63040ac7d9bd573b5598a476a534634f6 | aappling-usgs/powstreams | R/locate_metab_run.R | #' Find a metab_run item on ScienceBase
#'
#' @usage locate_metab_run(title, format = c("id", "url"), by = c("tag", "dir",
#' "either"), limit = 5000, browser = (format == "url"))
#' @param title the title of the metabolism modeling run you want. this is the
#' date, tag, and run strategy separated by spaces.
#' ... | 982 | cc0-1.0 |
f0768c7e1d83ce581b3d918ef9195fa72996e11d | chuckchen/spark | R/pkg/R/functions.R | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 176,233 | apache-2.0 |
26b690f983f4692521f6215e6aee1e3f4dd6f023 | ElenorFrisbee/MSC | regmodR/R/ghcnV3_parser/dataAdresses.R | #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-
# Adresses for the validation data
V3.MEAN.RAW.URL <- "ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/v3/ghcnm.tavg.latest.qcu.tar.gz"
V3.MEAN.ADJ.URL <- "ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/v3/ghcnm.tavg.latest.qca.tar.gz"
V3.... | 1,551 | mit |
ab1122350c6013ac983c9275a0f6acc927a28394 | mervynakash/Titanic.Survivors | titanicLogit.R | library("dplyr")
library("plyr")
library("stringr")
library("bindrcpp")
library("ROCR")
library(rmarkdown)
library(knitr)
library(RCurl)
setwd("E:/Kaggle/Titanic.Survivors/")
rmarkdown::render("titanicClean.R")
#################################
######### Dividing Data #########
###################... | 3,003 | mit |
53b81a489393f5a2b1b6ebb719e2520f6cdda23a | zskidmor/GGgenome | R/VEP_v88-class.R | ################################################################################
##################### Public/Private Class Definitions #########################
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public Class !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
#' Class VEP_v88
#'
#' An S4 class to represent data in variant effect pre... | 3,599 | cc0-1.0 |
53b81a489393f5a2b1b6ebb719e2520f6cdda23a | jkunisak/GenVisR | R/VEP_v88-class.R | ################################################################################
##################### Public/Private Class Definitions #########################
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public Class !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
#' Class VEP_v88
#'
#' An S4 class to represent data in variant effect pre... | 3,599 | cc0-1.0 |
53b81a489393f5a2b1b6ebb719e2520f6cdda23a | zskidmor/GenVisR | R/VEP_v88-class.R | ################################################################################
##################### Public/Private Class Definitions #########################
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public Class !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
#' Class VEP_v88
#'
#' An S4 class to represent data in variant effect pre... | 3,599 | cc0-1.0 |
53b81a489393f5a2b1b6ebb719e2520f6cdda23a | zlskidmore/GenVisR | R/VEP_v88-class.R | ################################################################################
##################### Public/Private Class Definitions #########################
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public Class !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
#' Class VEP_v88
#'
#' An S4 class to represent data in variant effect pre... | 3,599 | cc0-1.0 |
77d0c71410033d5a5fc90114cb046de0023d0002 | AudreyL/mdig-casestudy | L.Dispar/Data/Generating_Neutral_Landscape.R | ###############################################################################
# R functions for Qrule analysis and plotting
###############################################################################
###############################################################################
# Dr. Audrey Lustig
# Bio-Protect... | 7,685 | cc0-1.0 |
4e3d7e5d788d4684ecdfcdc831d54452a4af0249 | bjsmith/reversallearning | de_mcmc/functions.R |
library(compiler)
logit=function(x){
log(x/(1-x))
}
invlogit=function(x){
1/(1+exp(-x))
}
#this is using a wald probability density function to calculate results
#and multiplies the result by alpha
#we take the classical formulation of a wald PDF.
#The entire thing is multiplied by alpha;
#(x-1) is replaced by ... | 11,302 | apache-2.0 |
e7595d8432d2add3d3b8f428c795e898bb479544 | ElenorFrisbee/MSC | regmodR/R/regmod/columns2maps.R | columns2maps <- function(incolumns, anzlon, tip = F){
# anzlon: count lon
# incolumns: jede zeile eine karte
if (floor(ncol(incolumns)/anzlon) == ncol(incolumns)/anzlon){
anzlat <- ncol(incolumns)/anzlon
corelmap <- array(0,c(nrow(incolumns), ncol(incolumns)/anzlon, anzlon))
for(i in 1:anzlat){
... | 745 | mit |
c5120a8a6df17577f524e6877b544b2bc4cb621a | PirateGrunt/represtools | R/Objects.R | #' @title LoadObjects
#' @export
#'
#' @name LoadObjects
#'
#' @param params A list of parameters. Should include the named items inputDir and inputFiles.
#' @param env An environment in which to load objects. Defaults to the global environment.
#' @param loadFiles A character vector of files containing saved data.
#'
... | 5,299 | mit |
448c058fdd330366ce6f62e854b45ae5b5e3305b | otoomet/mergeELFS | etuUtils.R |
convertSav <- function(savName,
newName=paste("ETU", substr(savName, 4, 7), "_", substr(savName, 8, 8), ".Rdat", sep=""),
overwrite=FALSE) {
## Convert the .sav files from Statistical Office (?) to a
## We will try to guess the name of the ETU from the name of
... | 16,385 | gpl-3.0 |
e2af035956f515a476d54a87370c19bf2bfec7eb | sheffield-bioinformatics-core/sheffield-bioinformatics-core.github.io | workshops/2018-12-17-rna-seq/get_tcga_counts.R | source("http://www.bioconductor.org/biocLite.R")
biocLite("TCGAbiolinks")
library(TCGAbiolinks)
listSamples <- c("TCGA-E9-A1NG-11A-52R-A14M-07","TCGA-BH-A1FC-11A-32R-A13Q-07",
"TCGA-A7-A13G-11A-51R-A13Q-07","TCGA-BH-A0DK-11A-13R-A089-07",
"TCGA-E9-A1RH-11A-34R-A169-07","TCGA-BH-A0AU-... | 1,843 | mit |
ab0be38f08e0ab89587b04b98faf88ad078a914f | quebraquebra/blog | _source/08-mais-remunerados/func.R | geraJsonQC <- function(coluna, tipo){
data_chart_cols <- c(coluna, "ano", "remuneracao_total_liquida")
data_chart_cols <- match(data_chart_cols,names(qc))
#selecionando colunas a se trabalhar
data_chart <- qc %>%
select(data_chart_cols)
#renomeando pra fazer o group_by
colnames(data_chart) <- c("name"... | 3,513 | gpl-3.0 |
b10d6534f807a7e4d990eaea385547e275f1c699 | karawoo/icetest | R/check_phytomass.R | ##' Check phytoplankton biomass
##'
##' We originally asked for phytoplankton biomass in units of ug dry weight /
##' liter, however after talking with researchers we determined that biovolume
##' is a better unit. This function throws a warning if biomass data is present
##' for phytoplankton, ciliates, or heterotroph... | 930 | mit |
f643eb1db38f8e060292d5cda99c6a4a431b2deb | datashield/dsStatsClient | R/getOpals.R | #'
#' @title Gets the opal objects
#' @description This is an internal function.
#' @details The function searches for a list containing object of type 'opal'
#' in the global environment; if more than one list is found it return the lastest.
#' This way no matter what the user calls his opal login object it will be c... | 1,821 | gpl-3.0 |
3db20496f979e17bdd5f64da619a9b58228fa7a4 | bedatadriven/renjin | test-packages/s3test/R/makeContext.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... | 884 | gpl-2.0 |
9d2ab16a6abf1da4484d18e26f6a3dfa35b85470 | jimrc/IntroStatShinyApps | server.R |
includeScript("www/helper.js")
source("helpers.R")
quant1_contents <- load("data/quant1.RData")
quant2_contents <- load("data/quant2.RData")
c1q1_contents <- load("data/cat1quant1.RData")
load("data/quant1.RData")
load("data/quant2.RData")
load("data/cat1quant1.RData")
## These were created to hold sample data wi... | 150,581 | bsd-3-clause |
f643eb1db38f8e060292d5cda99c6a4a431b2deb | datashield/dsGraphicsClient | R/getOpals.R | #'
#' @title Gets the opal objects
#' @description This is an internal function.
#' @details The function searches for a list containing object of type 'opal'
#' in the global environment; if more than one list is found it return the lastest.
#' This way no matter what the user calls his opal login object it will be c... | 1,821 | gpl-3.0 |
8ba4adc86906eeb963fff3ee145a04c712fc106e | graemeleehickey/joineRML | R/print.dynLong.R | #' @keywords internal
#' @export
print.dynLong <- function(x, digits = max(4, getOption("digits") - 4), ...) {
if (!inherits(x, "dynLong")) {
stop("Use only with 'dynLong' objects.\n")
}
out <- lapply(x$pred, round, digits = digits)
print(out)
if (x$type == "simulated") {
cat(paste0("\nM-H acceptan... | 399 | gpl-3.0 |
71043a53cfaa5bf0e4897e2e47b780d354f89707 | mllg/batchtools | R/saveRegistry.R | #' @title Store the Registy to the File System
#'
#' @description
#' Stores the registry on the file system in its \dQuote{file.dir} (specified
#' for construction in \code{\link{makeRegistry}}, can be accessed via
#' \code{reg$file.dir}).
#' This function is usually called internally whenever needed.
#'
#' @template r... | 1,143 | lgpl-3.0 |
2c634a8392da8f20b718066f1c88b6e44052e4ea | lmweber/CyTOF-workshop-2017-07-10 | scripts/Exercise_w_solutions.R |
## Exercise:
# 1. Read in the "example.fcs" file
list.files()
library(flowCore)
fcs <- read.FCS("example.fcs")
fcs
# 2. Extract the 'exprs' (ion counts) into a matrix
e <- exprs(fcs)
dim(e)
head(e,2)
cbind(1:ncol(e), colnames(e))
# 3. Remove the columns that are not of interest (i.e.,
# (Tim... | 1,897 | mit |
4e5d0b77277e84d986631363582ab8977af4a41f | EvanzzzZ/mxnet | example/image-classification/train_model.R | require(mxnet)
train_model.fit <- function(args, network, data_loader) {
# log
if(!is.null(args$log_file)){
sink(file.path(args$log_dir, args$log_file), append = FALSE,
type=c("output", "message"))
cat(paste0("Starting computation of ", args$network, " at ", Sys.time(), "\n"))
... | 2,911 | apache-2.0 |
4e5d0b77277e84d986631363582ab8977af4a41f | formath/mxnet | example/image-classification/train_model.R | require(mxnet)
train_model.fit <- function(args, network, data_loader) {
# log
if(!is.null(args$log_file)){
sink(file.path(args$log_dir, args$log_file), append = FALSE,
type=c("output", "message"))
cat(paste0("Starting computation of ", args$network, " at ", Sys.time(), "\n"))
... | 2,911 | apache-2.0 |
4e5d0b77277e84d986631363582ab8977af4a41f | crazy-cat/incubator-mxnet | example/image-classification/train_model.R | require(mxnet)
train_model.fit <- function(args, network, data_loader) {
# log
if(!is.null(args$log_file)){
sink(file.path(args$log_dir, args$log_file), append = FALSE,
type=c("output", "message"))
cat(paste0("Starting computation of ", args$network, " at ", Sys.time(), "\n"))
... | 2,911 | apache-2.0 |
4e5d0b77277e84d986631363582ab8977af4a41f | smolix/incubator-mxnet | example/image-classification/train_model.R | require(mxnet)
train_model.fit <- function(args, network, data_loader) {
# log
if(!is.null(args$log_file)){
sink(file.path(args$log_dir, args$log_file), append = FALSE,
type=c("output", "message"))
cat(paste0("Starting computation of ", args$network, " at ", Sys.time(), "\n"))
... | 2,911 | apache-2.0 |
4e5d0b77277e84d986631363582ab8977af4a41f | piiswrong/mxnet | example/image-classification/train_model.R | require(mxnet)
train_model.fit <- function(args, network, data_loader) {
# log
if(!is.null(args$log_file)){
sink(file.path(args$log_dir, args$log_file), append = FALSE,
type=c("output", "message"))
cat(paste0("Starting computation of ", args$network, " at ", Sys.time(), "\n"))
... | 2,911 | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.