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 |
|---|---|---|---|---|---|
5144cb1ce9fae63424d25f6d5639da3f97691f1f | varodayan/cashflowr | R/interestRateToDiscRate.R | interestRateToDiscRate <- function(i) {
d <- i/(1+i/100)
return(d)
} | 72 | mit |
698bf6ccd95eaf0e0f9b7c849f5faeaa0ab4357c | cxxr-devel/cxxr | src/extra/testr/filtered-test-suite/cosh/tc_cosh_3.R | expected <- eval(parse(text="structure(numeric(0), .Dim = c(0L, 0L))"));
test(id=0, code={
argv <- eval(parse(text="list(structure(numeric(0), .Dim = c(0L, 0L)))"));
do.call(`cosh`, argv);
}, o=expected);
| 216 | gpl-2.0 |
95127a7721dd573a178fabb04ed2d8a4df14b82d | Jean-Romain/lidR | tests/testthat/test-utils_colors.R | context("utils_colors")
test_that("set.colors attribute the proper color", {
x = 1:10
c = lidR:::set.colors(x, height.colors(50))
expect_equal(length(unique(c)), length(x))
x = rep(1,10)
c = lidR:::set.colors(x, height.colors(50))
expect_equal(c, "#0000FF")
})
test_that("colors palette works", {
expe... | 469 | gpl-3.0 |
698bf6ccd95eaf0e0f9b7c849f5faeaa0ab4357c | kmillar/rho | src/extra/testr/filtered-test-suite/cosh/tc_cosh_3.R | expected <- eval(parse(text="structure(numeric(0), .Dim = c(0L, 0L))"));
test(id=0, code={
argv <- eval(parse(text="list(structure(numeric(0), .Dim = c(0L, 0L)))"));
do.call(`cosh`, argv);
}, o=expected);
| 216 | gpl-2.0 |
698bf6ccd95eaf0e0f9b7c849f5faeaa0ab4357c | kmillar/cxxr | src/extra/testr/filtered-test-suite/cosh/tc_cosh_3.R | expected <- eval(parse(text="structure(numeric(0), .Dim = c(0L, 0L))"));
test(id=0, code={
argv <- eval(parse(text="list(structure(numeric(0), .Dim = c(0L, 0L)))"));
do.call(`cosh`, argv);
}, o=expected);
| 216 | gpl-2.0 |
46be01b37cd22a2c2453b5bfa3c20bc57574b52c | jkunisak/GenVisR | R/lohSpec-class.R | ################################################################################
##################### Public/Private Class Definitions #########################
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Public Class !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
#' Class lohSpec
#'
#' An S4 class for the lohSpec plot object
#' @name loh... | 49,487 | cc0-1.0 |
698bf6ccd95eaf0e0f9b7c849f5faeaa0ab4357c | krlmlr/cxxr | src/extra/testr/filtered-test-suite/cosh/tc_cosh_3.R | expected <- eval(parse(text="structure(numeric(0), .Dim = c(0L, 0L))"));
test(id=0, code={
argv <- eval(parse(text="list(structure(numeric(0), .Dim = c(0L, 0L)))"));
do.call(`cosh`, argv);
}, o=expected);
| 216 | gpl-2.0 |
87b138c82adec4e4d563b478bae85b48ea198525 | BILS/GAAS | bin/gaas_rs_PlotDensityOneRowPerFile.R | #!/opt/local/bin/Rscript
# To prepare data do:
#awk '{print $18}' maker_a1_p0_c0.gtf | sed s/[\",\;]//g >> AED_a1p0c0.csv
#Use this programm
# Just type the file containing row of aed value as argument
args <- commandArgs(TRUE)
cat("You gave",length(args),"arguments:",paste(args,collapse=" - "),"\n");
if (length(ar... | 1,035 | gpl-3.0 |
698bf6ccd95eaf0e0f9b7c849f5faeaa0ab4357c | ArunChauhan/cxxr | src/extra/testr/filtered-test-suite/cosh/tc_cosh_3.R | expected <- eval(parse(text="structure(numeric(0), .Dim = c(0L, 0L))"));
test(id=0, code={
argv <- eval(parse(text="list(structure(numeric(0), .Dim = c(0L, 0L)))"));
do.call(`cosh`, argv);
}, o=expected);
| 216 | gpl-2.0 |
698bf6ccd95eaf0e0f9b7c849f5faeaa0ab4357c | rho-devel/rho | src/extra/testr/filtered-test-suite/cosh/tc_cosh_3.R | expected <- eval(parse(text="structure(numeric(0), .Dim = c(0L, 0L))"));
test(id=0, code={
argv <- eval(parse(text="list(structure(numeric(0), .Dim = c(0L, 0L)))"));
do.call(`cosh`, argv);
}, o=expected);
| 216 | gpl-2.0 |
d9b9246a59a66d7dbb4879b2602aeb68b715164b | KCIV/LotkasLaw | R/Results.R | results <- function(KSTable)
{
percent <- function(x, digits = 2, format = "f", ...) {
paste0(formatC(100 * x, format = format, digits = digits, ...), "%")
}
value1 <- KSTable[1:1,3:3]
cat(KSTable[1:1,2:2], " Authors made ", percent(value1))
cat("\n")
value1 <- KSTable[2:2,3:3]
cat(KSTable[2:2,2:2]... | 461 | gpl-2.0 |
2f043fd177a3499be0b92e30f2f960abf822253a | yvesago/Jres2015 | Rsrc/Pretty-tree.R | #http://gastonsanchez.com/blog/resources/2014/07/05/Pretty-tree-graph.html
print_pretty_tree <- function(dataset, num_clusters = 2,
dist_method = "euclidean", clus_method = "ward.D")
{
# distance matrix
dist(dataset, method = dist_method)
}
pretty_tree <- function(dataset, num_clusters = 2,
dist_method ... | 2,143 | artistic-2.0 |
87b138c82adec4e4d563b478bae85b48ea198525 | BILS/GAAS | annotation/tools/maker/gaas_rs_PlotDensityOneRowPerFile.R | #!/opt/local/bin/Rscript
# To prepare data do:
#awk '{print $18}' maker_a1_p0_c0.gtf | sed s/[\",\;]//g >> AED_a1p0c0.csv
#Use this programm
# Just type the file containing row of aed value as argument
args <- commandArgs(TRUE)
cat("You gave",length(args),"arguments:",paste(args,collapse=" - "),"\n");
if (length(ar... | 1,035 | gpl-3.0 |
70db056cf644c0c75df989c63cfae6e299bc4c2b | chrislill/next-word | model-functions.R | require(dplyr, warn.conflicts = FALSE)
require(data.table, warn.conflicts = FALSE)
require(hashr)
CreateBigrams <- function(tokens) {
# Creates a simple matrix with a row for each bigram and a column
# for each word.
#
# Args:
# tokens: A vector of words
#
# Returns:
# A matrix with a row for ea... | 10,543 | mit |
35b7b9be6939953a48b3021e7440fcabebb43346 | fahd09/neurosynth_semantic_map | script/3_textmine_postprocess.R | # This script does all the post text-mining work on abstracts
# like generating words lists and exploring frequences etc
# Fahd Alhazmi, 12/17/15
script_dir <- './script/'
data_dir <- './data/'
# This will take a while to excute (+1 minute on my Macbook)
source(paste0(script_dir, '2_textmine_preprocess.R') )
# dim(dt... | 3,510 | mit |
60e6fd6365c17dbd4d12b1d2b479f305704c68ce | KopfLab/isorunCSIA | R/gui.R |
#' Start the user interface
#'
#' To run this function stand-alone as a script from any folder on your system, copy the
#' run (Unix systems) or run.bat (Windows) systems from the GitHub repository
#' (\link{http://www.github.com/KopfLab/isorunCSIA/inst/gui/}
#' and modify depending on your R executable.
#'
#' @param ... | 1,530 | gpl-3.0 |
e6e689face3e758e355ade8dd99eb1f41dbdd3f6 | WMBEdmands/CompMS2miner | R/smiles2Form.R | #' Convert SMILES code to atomic formula
#' @param SMILES character vector of SMILES codes to convert
#' @return a character vector the formula(e).
smiles2Form <- function(SMILES=NULL){
if(is.null(SMILES)){
stop('SMILES argument is missing with no default')
}
if(!require(ChemmineR)){
stop('ChemmineR packa... | 1,396 | gpl-2.0 |
36f67de92041ad393cccc6abc3c95baa2c5a869b | gregorbj/VisionEval | sources/modules/VETransportSupply/tests/scripts/SimulateD4cValues.R | #===================
#SimulateD4cValues.R
#===================
#
#### Distance to Transit (D4C) Model
#
#Distance to transit is the last of the 5D measures that need to be attributed to the SimBzones. The measure chosen for use in VisionEval is the *D4c* measure included in the SLD. Following is the description of the ... | 19,067 | apache-2.0 |
738124302a821a89ac885e0c74ab4e35e4bb1dc3 | caramirezal/SQUAD | SQUAD/R/heatmap.sq.R | #' heatmap.sq draws a heatmap from the ODE simulations. In general, this function can plot any result
#' derived from ode() function of the deSolve R Package
#' @description draw a heatmap of the simulation of a trajectory of the regulatory network using a
#' a continuous formalism.
#' @name heatmap.sq
#' @export heat... | 2,241 | gpl-3.0 |
787c8ea2c018ca1dda913cfce18e88cf3d86ed53 | kou/arrow | r/tests/testthat/test-install-arrow.R | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 1,462 | apache-2.0 |
787c8ea2c018ca1dda913cfce18e88cf3d86ed53 | apache/arrow | r/tests/testthat/test-install-arrow.R | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 1,462 | apache-2.0 |
787c8ea2c018ca1dda913cfce18e88cf3d86ed53 | icexelloss/arrow | r/tests/testthat/test-install-arrow.R | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 1,462 | apache-2.0 |
787c8ea2c018ca1dda913cfce18e88cf3d86ed53 | wesm/arrow | r/tests/testthat/test-install-arrow.R | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 1,462 | apache-2.0 |
c499ba7e481c9070d38fbb845d8bdf2496fa7dbe | aaronbenz/rhbase | tests/testthat/test.R | str_csv <- function(x){
paste(x[[1]],x[[2]], sep = ",") %>%
paste(" \n",sep = "") %>%
toString
}
library(data.table)
library(magrittr)
library(rhbase)
data(baggage_trucks)
test <- baggage_trucks[[1]]
dt <- fread(str_csv(test))
write.csv(test, file = "data.csv",row.names = F)
fread(readLines("test.csv"))
... | 690 | apache-2.0 |
4085646334429b584e5bcb30988a7757ad2a99cc | tractor/tractor | share/tractor/experiments/graph2csv.R | #@args graph file
#@desc Convert a Graph object, stored in an ".Rdata" file, into a comma-separated list of numbers representing the corresponding association or adjacency matrix. The diagonal runs top-left to bottom-right in this case. Vertex attributes are included as comments at the top of the file.
library(tractor... | 601 | gpl-2.0 |
840159c9e2b069719bb8ca5298601df589ec8b35 | dgrapov/networkly | inst/ui.R | library(shiny)
library(shinydashboard)
library(plotly)
library(jsonlite)
library(networkly)
library(dplyr)
shinyUI(dashboardPage(
dashboardHeader(title="Plotly Network"),
dashboardSidebar(uiOutput("controls")),
dashboardBody(
uiOutput("network_UI"),
uiOutput("obj_UI")
)
))
| 291 | mit |
aecab1b6921a63fe502af88328f5e5212e98599a | YvesBas/Tadarida-C | tadaridaC_src/benchmark_BN/SampleTDoutput.R | library(data.table)
OutBN=fread("./Tadarida/Dbas_deepL/point du 28-10-2021/documents joints/predictions crepurb/predictions_7680_41_7250_jeutest2200.csv")
Sample=200
Tag="TD_crepurb25"
FilterSpecies=c( "Carcar"
,"Pasdom","Pasmon", "Delurb","Colmon"
, "Phopho"... | 1,528 | gpl-3.0 |
f87d52f8f043bab14fb1c535e01651b481ed80a2 | timelyportfolio/tmap | pkg/R/grid_shp.R | ## current version: all polygons in one group
grid.shape_old <- function(shp, gp=gpar(), bg.col=NA) {
# TODO substract holes
bb <- bbox(shp)
co1 <- do.call("rbind", mapply(function(p, id1) {
co2 <- mapply(function(pp, id2) {
coords <- pp@coords
coords[,1] <- (coords[,1]-bb[1,1]) / (bb[1,2]-bb[1,1])
coords... | 4,221 | gpl-3.0 |
8451fe72c206f8b889e1f139afed711111b91676 | hoxo-m/dplyrr | R/mutate_first_value.R | #' translater for first_value() added to mutate()
#'
#' @param d a lazy before the translation
#' @return a lazy after the translation
#'
mutate_first_value <- function(d) {
args <- as.character(d$expr)
if(length(args) <= 1) stop(sprintf("first_value() must have 1 argments at least."))
random_str <- paste(sample... | 981 | mit |
df581527078cf653a42503780e5e23a67bb02c49 | klevan/antweb | ant-web/server.R | library(shiny)
library(leaflet)
library(RColorBrewer)
library(scales)
library(lattice)
library(dplyr)
# Leaflet bindings are a bit slow; for now we'll just sample to compensate
set.seed(100)
#antData <- antData[sample.int(nrow(antData), 10000),]
shinyServer(function(input, output, session) {
## Interactive Map ###... | 1,878 | mit |
5a6454a1fce836694520dae6627f224d822df397 | hxfeng/R-3.1.2 | src/library/utils/R/read.fortran.R | # File src/library/utils/R/read.fortran.R
# Part of the R package, http://www.R-project.org
#
# Copyright (C) 1995-2013 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; ei... | 2,623 | gpl-2.0 |
5a6454a1fce836694520dae6627f224d822df397 | skyguy94/R | src/library/utils/R/read.fortran.R | # File src/library/utils/R/read.fortran.R
# Part of the R package, http://www.R-project.org
#
# Copyright (C) 1995-2013 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; ei... | 2,623 | gpl-2.0 |
5a6454a1fce836694520dae6627f224d822df397 | limeng12/r-source | src/library/utils/R/read.fortran.R | # File src/library/utils/R/read.fortran.R
# Part of the R package, http://www.R-project.org
#
# Copyright (C) 1995-2013 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; ei... | 2,623 | gpl-2.0 |
5a6454a1fce836694520dae6627f224d822df397 | kalibera/rexp | src/library/utils/R/read.fortran.R | # File src/library/utils/R/read.fortran.R
# Part of the R package, http://www.R-project.org
#
# Copyright (C) 1995-2013 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; ei... | 2,623 | gpl-2.0 |
5a6454a1fce836694520dae6627f224d822df397 | jagdeesh109/RRO | R-src/src/library/utils/R/read.fortran.R | # File src/library/utils/R/read.fortran.R
# Part of the R package, http://www.R-project.org
#
# Copyright (C) 1995-2013 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; ei... | 2,623 | gpl-2.0 |
5a6454a1fce836694520dae6627f224d822df397 | ChiWang/r-source | src/library/utils/R/read.fortran.R | # File src/library/utils/R/read.fortran.R
# Part of the R package, http://www.R-project.org
#
# Copyright (C) 1995-2013 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; ei... | 2,623 | gpl-2.0 |
5a6454a1fce836694520dae6627f224d822df397 | jukiewiczm/renjin | packages/utils/src/main/R/read.fortran.R | # File src/library/utils/R/read.fortran.R
# Part of the R package, http://www.R-project.org
#
# Copyright (C) 1995-2013 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; ei... | 2,623 | gpl-3.0 |
5a6454a1fce836694520dae6627f224d822df397 | jeffreyhorner/R-Array-Hash | src/library/utils/R/read.fortran.R | # File src/library/utils/R/read.fortran.R
# Part of the R package, http://www.R-project.org
#
# Copyright (C) 1995-2013 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; ei... | 2,623 | gpl-2.0 |
5a6454a1fce836694520dae6627f224d822df397 | mirror/r | src/library/utils/R/read.fortran.R | # File src/library/utils/R/read.fortran.R
# Part of the R package, http://www.R-project.org
#
# Copyright (C) 1995-2013 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; ei... | 2,623 | gpl-2.0 |
5a6454a1fce836694520dae6627f224d822df397 | jeffreyhorner/R-Judy-Arrays | src/library/utils/R/read.fortran.R | # File src/library/utils/R/read.fortran.R
# Part of the R package, http://www.R-project.org
#
# Copyright (C) 1995-2013 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; ei... | 2,623 | gpl-2.0 |
5a6454a1fce836694520dae6627f224d822df397 | cmosetick/RRO | R-src/src/library/utils/R/read.fortran.R | # File src/library/utils/R/read.fortran.R
# Part of the R package, http://www.R-project.org
#
# Copyright (C) 1995-2013 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; ei... | 2,623 | gpl-2.0 |
5a6454a1fce836694520dae6627f224d822df397 | o-/Rexperiments | src/library/utils/R/read.fortran.R | # File src/library/utils/R/read.fortran.R
# Part of the R package, http://www.R-project.org
#
# Copyright (C) 1995-2013 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; ei... | 2,623 | gpl-2.0 |
5a6454a1fce836694520dae6627f224d822df397 | hadley/r-source | src/library/utils/R/read.fortran.R | # File src/library/utils/R/read.fortran.R
# Part of the R package, http://www.R-project.org
#
# Copyright (C) 1995-2013 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; ei... | 2,623 | gpl-2.0 |
8f3d38c65cb7e2bc8c7ba0bee3150d62894f35d7 | sambrilleman/rstanarm | R/posterior_survfit.R | # Part of the rstanarm package for estimating model parameters
# Copyright (C) 2015, 2016, 2017 Trustees of Columbia University
# Copyright (C) 2016, 2017 Sam Brilleman
#
# 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 ... | 45,327 | gpl-3.0 |
5a6454a1fce836694520dae6627f224d822df397 | patperry/r-source | src/library/utils/R/read.fortran.R | # File src/library/utils/R/read.fortran.R
# Part of the R package, http://www.R-project.org
#
# Copyright (C) 1995-2013 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; ei... | 2,623 | gpl-2.0 |
7143dbe9b4bba8279a2850dd3d93ab22c127930a | debarros/dbTools | R/betterGrepl.R | #betterGrepl.R
#### betterGrepl ####
#
#' @title Better grepl
#' @description This function behaves similarly to grepl, except that an NA pattern or NA element of \code{x} returns FALSE, but
#' NA matched to NA returns TRUE
#' @param pattern character string containing a regular expression (or character string for... | 5,020 | gpl-3.0 |
7bab879e432c5ceefb653a48f307ae992a144e8d | richardbeare/SimpleITK | Examples/SimpleIO/SimpleIO.R | #=========================================================================
#
# Copyright NumFOCUS
#
# 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/license... | 1,900 | apache-2.0 |
7bab879e432c5ceefb653a48f307ae992a144e8d | SimpleITK/SimpleITK | Examples/SimpleIO/SimpleIO.R | #=========================================================================
#
# Copyright NumFOCUS
#
# 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/license... | 1,900 | apache-2.0 |
a2a651f3e039137d19e245216baabedcb4f7cf39 | marcpaterno/artsupport | tests/testthat/test-utils.R |
test_that("load_table loads EventInfo from MemoryTracker", {
filename <- "memoryTracker.db"
checkmate::assert_file_exists(filename)
x <- load_table(filename, "EventInfo")
expect_is(x, "tbl_df")
expect_named(x, expected = c("Step", "Run", "SubRun", "Event", "Vsize", "RSS"))
expect_equal(nrow(x), 20L)
})
t... | 1,076 | bsd-3-clause |
7bab879e432c5ceefb653a48f307ae992a144e8d | blowekamp/SimpleITK | Examples/SimpleIO/SimpleIO.R | #=========================================================================
#
# Copyright NumFOCUS
#
# 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/license... | 1,900 | apache-2.0 |
7bab879e432c5ceefb653a48f307ae992a144e8d | InsightSoftwareConsortium/SimpleITK | Examples/SimpleIO/SimpleIO.R | #=========================================================================
#
# Copyright NumFOCUS
#
# 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/license... | 1,900 | apache-2.0 |
fc54d777d2b5c21fe830fdabc78c6a7546a35640 | dmlc/xgboost | R-package/R/xgb.plot.multi.trees.R | #' Project all trees on one tree and plot it
#'
#' Visualization of the ensemble of trees as a single collective unit.
#'
#' @param model produced by the \code{xgb.train} function.
#' @param feature_names names of each feature as a \code{character} vector.
#' @param features_keep number of features to keep in each posi... | 6,354 | apache-2.0 |
af3ee09865e0d3f2daeda98aeb2acca6b18d3c3e | aknutas/nails-package | tests/testthat/test_topic_model.R | library(nails)
context("Building topic models")
# Loads test data frame "sublit" into memory
load(file.path("test_data/topicmodeltest_df.RData"))
test_that("Topicmodels input data gets cleaned properly", {
data <- nails::preprocess_literature_for_topicmodeling(sublit)
expect_is(data, "list")
# Character v... | 1,647 | gpl-3.0 |
d975de75a3dfce30f3957c13975f4a096203f292 | google/amss | tests/testthat/test_random_number_generator.R | # Copyright 2017 Google Inc. All Rights Reserved.
#
# 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 law or a... | 3,727 | apache-2.0 |
7b14cfb97c6837c34e6390d7047acabc77e1e316 | bergsmat/define | R/definecharacter.R |
#' Define objects per FDA guidance.
#'
#' Defines (documents) a set of files in a manner intended to comply with
#' FDA guidance on submission of study data and related documentation.
#' In particular, files in csv format are converted to SAS Transport (xpt),
#' extensions for other files (presumably ASCII) are ... | 9,283 | gpl-2.0 |
024b2cd0eba448324e4d1f80f2b93f3956502300 | isglobal-brge/rexposome | R/ExposomeSet-show.R | setMethod(
f = "show",
signature="ExposomeSet",
definition = function(object) {
cat("Object of class 'ExposomeSet' (storageMode: ", storageMode(object), ")\n", sep="")
cat(" . exposures description:\n")
cat(" . categorical: ", sum(fData(object)$`.type` == "factor"), "\n")
cat(" . cont... | 1,953 | mit |
3b6034f39df03783b03ceec58e29de621e600475 | yguitton/MeHaloCoA | R/cldetect.R | #new version 14/07/2014 with check in FUN2 for multiple m/z hits
#change in M1 M2 calculation it was ppm this is confusing pepole ask for 50ppm error and in fact the soft used 60 ppmerr
cldetect<-
function(outdir="",xsAnnotate,plotps=TRUE, deprof=FALSE, Thresh=30, m1=1.0030, m2=1.997, mdiff=0.05, ppmerr=50, val="into",... | 12,573 | gpl-2.0 |
403a2897dcfb7716576589d165c566314f473d16 | James-SR/Titanic | multipleImputation/examples/college_example.R |
library(rockchalk)
dat <- read.table("/home/pauljohn/ps/SVN-guides/stat/DataSets/USNewsCollege/USNewsCollege.csv", sep = ",")
mynames <- c("FICE", "NAME", "STATE", "PRIVATE", "AVEMATH","AVEVERB",
"AVECOMB", "AVEACT", "FSTMATH", "TRDMATH", "FSTVERB", "TRDVERB",
"FSTACT", "TRDACT", "NUMAPPS", "NUMACC", "NUMENR", "PCT... | 5,012 | mit |
e7e470da27fc18ccdae57a1d929f5d0f0a3e3480 | omarbenites/traittools | R/data.R | #' @name sweetpt
#' @title Sample data of sweet potato
#' @docType data
#' @aliases spg
#' @description This dataset contains sweet potato data
#' @references This data is related to HiDAP crop template
#' @usage spg
#' @format data frame
#' @source International Potato Center, sweet potato experimental data.
NULL
#sa... | 2,071 | mit |
e42b9475d698495d53bf48545689ccbc4a883935 | ldolberg/the_port_ors_hdx | src/nepal_3w_analysis.R | data.3w = read.csv("/home/danito/proj/hhton/the_port_ors_hdx/data/Nepal/humanitarian/nepal-3w-14july2015-consolidated.csv")
data.ww = read.csv("/home/danito/proj/hhton/the_port_ors_hdx/data/Nepal/humanitarian/who_what.csv")
data.fts = read.csv("/home/danito/proj/hhton/the_port_ors_hdx/data/Nepal/humanitarian/fts_nepal... | 2,408 | apache-2.0 |
8455e4cc6dbcc422396747767113c751c5019bc6 | bjsmith/reversallearning | stanlba/singlelevelmodel/rl_joint_v6.R | library(rstan)
source("stanlba/lba_rl_joint_setup.R")
require(R.utils)
options(mc.cores = 6)
source("stanlba/singlelevelmodel/lba_rl_joint_v1_functions.R")
#we have problems running all subjects in a single run.
#so let's have this save as we go, and then reload and avoid re-saving if there's already a saved file.
lba... | 5,732 | apache-2.0 |
12c4dc0033bed847db8e12b8e2419eeca5b365c8 | fditraglia/ec2-for-econometricians | sleep_csv.R | out <- data.frame(1:10, 10:1)
Sys.sleep(30)
setwd("~/")
write.csv(out, file = 'results.csv')
| 93 | gpl-2.0 |
2e8b6cf089189bfdaca5b88f2b87bd0d2f5db175 | timriffe/LexisUtils | LexisUtils/R/PC2AP.R | #' @title \code{PC2AP} convert a period-cohort matrix to an age-period matrix.
#'
#' @description
#' \code{PC2AP()} is an auxiliary function. Default lexis value is 1, so watch out- if you choose wrong, then column labels in the AP matrix output will be off by 1. If you're not sure, draw a diagram. If using this to res... | 2,973 | gpl-2.0 |
388da3f844fe5805e333deccc472eeeff7e6fc30 | zhejosephliu/blossomTree | R/kde.R | # bandwidth selectors
bandwidth.nrd2d <- function (x, is1D = TRUE) {
if (!is1D) {
1.06 * min(sqrt(var(x)), (quantile(x, c(0.25, 0.75))[2L] - quantile(x, c(0.25, 0.75))[1L]) / 1.34) * length(x) ^ (-1/6)
} else {
1.06 * min(sqrt(var(x)), (quantile(x, c(0.25, 0.75))[2L] - quantile(x, c(0.25, 0.75))[1L]) / 1.34... | 1,530 | gpl-3.0 |
c790c88c3759caa70aa3b324f2b029b621d3017d | limeng12/r-source | src/gnuwin32/installer/JRins.R | # File src/gnuwin32/installer/JRins.R
#
# Part of the R package, http://www.R-project.org
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your o... | 5,790 | gpl-2.0 |
e35b2cce8663bf57c44d313f7ccdcb95c63df710 | MarkEdmondson1234/googleAnalyticsR_public | tests/testthat/test_ga4.R | source("setup.R")
test_that("Vanilla test data fetch", {
skip_on_cran()
skip_on_travis()
options(googleAuthR.verbose = 2)
t11 <- google_analytics(ga_id,
date_range = c("2015-07-30","2015-10-01"),
dimensions=c('medium'),
m... | 10,682 | mit |
c790c88c3759caa70aa3b324f2b029b621d3017d | ChiWang/r-source | src/gnuwin32/installer/JRins.R | # File src/gnuwin32/installer/JRins.R
#
# Part of the R package, http://www.R-project.org
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your o... | 5,790 | gpl-2.0 |
c790c88c3759caa70aa3b324f2b029b621d3017d | hadley/r-source | src/gnuwin32/installer/JRins.R | # File src/gnuwin32/installer/JRins.R
#
# Part of the R package, http://www.R-project.org
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your o... | 5,790 | gpl-2.0 |
a12f3d1edcffbbb50a4af5347dd15038f220f923 | andrewdefries/ToxCast | Figure1/CleanSDF.R | ##################
library(ChemmineR)
library(parallel)
##################
files<-list.files(pattern=".sdf", recursive=F)
outnames<-gsub(".sdf", "_clean.sdf", files)
LoadCleanSpit<-function(a){
############################
sdfset<-read.SDFset(files[a])
#
valid <- validSDF(sdfset)
sdfset <- sdfset[valid]
#
apset<-sdf2... | 586 | mit |
2b346c7bae1ba66fc9262cb4c0afa8565c624ce2 | adrianmui/wikixray | WikiXRay/tools/social-structure/social-structure-main.R | #!/usr/bin/Rscript
#
# WikiXRay: A tool for quantitative analysis of Wikipedia
#
# <http://projects.libresoft.es/projects/show/wikixray/>
# <http://gitorious.org/wikixray>
#
# Copyright (c) 2006-2010 Felipe Ortega
#
# This program is free software: you can redistribute it and/or modify it
#... | 8,376 | gpl-3.0 |
5c699dc17bedefc88470289031d6ef78e5359281 | ISRICWorldSoil/SoilGrids250m | grids/MDEM/DEM_parameters_parallel.R | ## Generation of global DEM parameters at 250m resolution
## tom.hengl@isric.org
setwd("/data/MDEM")
load(".RData")
library(R.utils)
library(rgdal)
library(snowfall)
library(pkgmaker)
library(raster)
if(.Platform$OS.type == "windows"){
gdal.dir <- shortPathName("C:/Program files/GDAL")
gdal_translate <- paste0(gda... | 3,573 | gpl-2.0 |
57a92c4d41b3556e34b6aa7a0b5843f98d447cd7 | jfisher-usgs/wrv | R/zzz.R | .onAttach <- function(lib, pkg) {
if (interactive()) {
ver <- read.dcf(file.path(lib, pkg, "DESCRIPTION"), "Version")
msg <- "USGS Research Package: https://owi.usgs.gov/R/packages.html#research"
packageStartupMessage(paste(strwrap(msg), collapse="\n"))
}
raster::rasterOptions(standardnames=FALSE)
i... | 333 | cc0-1.0 |
4c32dd7e9cba6da6ac43534007a115ac448f055f | RaynorJim/grammarviz2_src | RCode/polygons2.R | require(ggplot2)
require(gridExtra)
require(plyr)
require(reshape)
require(Cairo)
# ECG 0606
#
dat = read.table("../ecg0606_res.txt",sep=",",header=T,as.is=T)
range(dat$winSize)
range(dat$paaSize)
range(dat$aSize)
cfun=function(x){
if(1==x[1] && 0==x[2]){
"hit"
}else if(1==x[1] && 1==x[2]){
"ambiguous"
}... | 3,684 | gpl-2.0 |
4c32dd7e9cba6da6ac43534007a115ac448f055f | GrammarViz2/grammarviz2_src | RCode/polygons2.R | require(ggplot2)
require(gridExtra)
require(plyr)
require(reshape)
require(Cairo)
# ECG 0606
#
dat = read.table("../ecg0606_res.txt",sep=",",header=T,as.is=T)
range(dat$winSize)
range(dat$paaSize)
range(dat$aSize)
cfun=function(x){
if(1==x[1] && 0==x[2]){
"hit"
}else if(1==x[1] && 1==x[2]){
"ambiguous"
}... | 3,684 | gpl-2.0 |
4c023b846f14aee1e8179d68a4ac004ecc89fd27 | graalvm/fastr | com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/channels/R/channels13.R | # Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3 only, as
# published by the Free Software Founda... | 1,892 | gpl-2.0 |
1e7856750b5c9d230feee7b4744ff551637840e6 | hskim08/RConfMatrixPlots | examples/example_timeseries.R | #
# In this example we will prepare time series data and plot it to show a sequence.
#
# First, load the functions we need.
source("distance//getDistances.R")
source("process//calculateMDS.R")
source("process//calculateHclust.R")
source("plot//plotMDSTimeseries.R")
source("plot//plotDendrogramTimeseries.R")
#
# Let's... | 3,174 | bsd-3-clause |
a3603fa869fa051fc9f75471883349101894c620 | rgiordan/MicrocreditLRVB | R/RcppExports.R | # Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
GetEmptyVariationalParameters <- function(k, n_g) {
.Call('MicrocreditLRVB_GetEmptyVariationalParameters', PACKAGE = 'MicrocreditLRVB', k, n_g)
}
GetEmptyPriors <- function(k) {
.Call(... | 5,283 | apache-2.0 |
10744a7882a5d6bd1a8e8c47220ac182d27235df | anasrana/spector | R/n-reads-bam.R | #' @importFrom Rsamtools indexBam
#'
nReadsBam <- function(bam_file) {
if (file.exists(paste0(bam_file, ".bai"))) {
bam_stat <- readIdxstats(bam_file)
} else {
warning(
".bam file is not indexed. Indexing is time consuming for large files.")
indexBam(bam_file)
message("Indexing c... | 800 | gpl-3.0 |
9d7db2696406f7a2e992f6a5143017636453ddc6 | AcademyR/Revolution-R-Enterprise-for-Academic-Users | Demoscripts/RevoScaleR_Users_Guide.R | ##############################################################################
# RevoScaleR User's Guide Examples
##############################################################################
#############################################################################
# IMPORTANT: The 'big' example data must be down... | 61,103 | mit |
fb44dd81ada030b3ed07b805a9327bec4fd97a80 | ezagheni/IUSSP-Social-Media-Workshop-at-ALAP-ABEP | Collect_Tweets/02_Collect_Twitter_data.R | ### Brazilian and Latin American Population Conference
### Workshop on Web and Social Media for Demographic Research
### October 17, 2016
### Emilio Zagheni
### Collect and Analyze Tweets
### Part 2 Collect Tweets using the streaming API and get descriptive statistics
### This part relies on packages and some functio... | 2,160 | gpl-3.0 |
9c9e43967fbdf4be73be1a7bfdce3face39cf554 | BryceMatthes/chatplots | makefreqtable.R | makefreqtable <- function(foo){
#Make freq table for who you talk to
foo$string <- as.character(foo$string)
docs <- foo[1,2]
for(i in 2:nrow(foo)){
docs <- c(docs, foo[i,2])
}
mycorpus <- Corpus(VectorSource(docs))
ae.corpus <- tm_map(myco... | 912 | apache-2.0 |
5efad19e11c1552efe9beb5736773d95c0cd8bc0 | sneumann/xcms-presvnbridge | R/c.R | profMaxIdx <- function(x, y, num, xstart = min(x), xend = max(x),
param = list()) {
if (!is.double(x)) x <- as.double(x)
if (!is.double(y)) y <- as.double(y)
.C("ProfMaxIdx",
x,
y,
as.integer(length(x)),
as.double(xstart),
as.double(xend),
as... | 13,228 | gpl-2.0 |
c59650446b40822f13717d18ef565734775dd5da | sernle/cleanData- | run_analysis.R |
getMeasurementsColumns <- function(columnNames, partern) {
sapply(columnNames, function(element_name) grepl(partern, element_name))
}
getData <- function(typeData, activityCode, featureNames) {
#get main file
filePath <- paste(typeData,"/subject_",typeData,".txt",sep="")
subject <- read.table(file = filePath,... | 2,117 | gpl-3.0 |
5efad19e11c1552efe9beb5736773d95c0cd8bc0 | benjiec/xcms | R/c.R | profMaxIdx <- function(x, y, num, xstart = min(x), xend = max(x),
param = list()) {
if (!is.double(x)) x <- as.double(x)
if (!is.double(y)) y <- as.double(y)
.C("ProfMaxIdx",
x,
y,
as.integer(length(x)),
as.double(xstart),
as.double(xend),
as... | 13,228 | gpl-2.0 |
09b61e16f53472776b3893bb28fa59193e32e473 | davebraze/FDB1 | R/factors.R | ##' @title Coerce a vector of class "factor" to numeric.
##'
##' @description Coerce a vector of class "factor" to numeric.
##'
##' @details
##' Coerces a vector of class factor to numeric. This function preserves underlying integer
##' associated with each element of f.
##'
##' cf. > unclass(f)
##'
##' @param f A vect... | 1,928 | mit |
547cad2d7d370aac09a3e7f2e34df98167d01f5c | conjugateprior/Resha | R/stemming.R | reshaEnv <- new.env()
get_resha <- function(){
resha <- get0("resha", envir=reshaEnv)
if (is.null(resha)){
message("Constructing the stemmer")
# resha_data is from sysdata.rda
resha <- hashmap::hashmap(resha_data$token, resha_data$stem)
assign("resha", resha, reshaEnv)
}
resha
}
#' Stem Turkis... | 2,928 | mit |
29352cbae8cbe66042d05e56bf29ac046173f7ce | matthuska/tRap | R/gevparams-data.R | #' parameters for the fitted extreme value distributions for
#' affinities of each transfac matrix
#'
#' parameters for the fitted extreme value distributions for
#' affinities of each transfac matrix fitted from human promoter sequences
#' @title parameters for the fitted extreme value distributions for
#' affinities ... | 439 | lgpl-2.1 |
e90ae8614534089e2d7ed9fdce485bc6e1fc4d07 | igraph/xdata-igraph | interfaces/R/igraph/R/interface.R |
# IGraph R package
# Copyright (C) 2005-2012 Gabor Csardi <csardi.gabor@gmail.com>
# 334 Harvard street, Cambridge, MA 02139 USA
#
# 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... | 5,527 | gpl-2.0 |
1722f7276d0b78ecbd4e822f83d23393995635ce | aydindemircioglu/LLSVMGPU | helpers/updateTable.R |
# update table X by entries of table Y
# if point exists in X, it will be updated from Y
# if it does not exist, it will be added.
# this must and does so blockwise,
# i.e. a block is a (C,g,solver,dataset) tuple
# and all the seconds. All of these will be removed
# when being updated.
updateTable = function (X, Y) {... | 1,330 | lgpl-3.0 |
e90ae8614534089e2d7ed9fdce485bc6e1fc4d07 | janschulz/igraph | interfaces/R/igraph/R/interface.R |
# IGraph R package
# Copyright (C) 2005-2012 Gabor Csardi <csardi.gabor@gmail.com>
# 334 Harvard street, Cambridge, MA 02139 USA
#
# 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... | 5,527 | gpl-2.0 |
b188ecab97ff294fb5ba6f11e9645975133528f6 | philippmuench/lectures | randomForest/ui.R | library(shiny)
library(ggplot2)
library(rpart)
library(gplots)
library(RColorBrewer)
library(plotmo)
library(randomForest)
library(stats)
set.seed(121)
source("tree.R")
source("forest.R")
traindata <- read.csv("titanic.csv", stringsAsFactors=FALSE)
shinyUI(
fluidPage(h3("Random forest lecture"),
fluidRow(colu... | 4,060 | mit |
1a4b9c30457cc21cd45854f8f47ff532a431d55f | piguy314159265/AlteryxSim | R/sample-best-fits.R | #' Process a fit element created by 'fit_dists' on a data.frame
#'
#' @param fit_element element from highest list resulting from 'fit_dists' on a data.frame
#' @param type "MC" or "LH" for Monte Carlo or Latin Hypercube sampling
#' @return function accepting argument for number of samples to draw which would draw ... | 2,204 | gpl-3.0 |
1a4b9c30457cc21cd45854f8f47ff532a431d55f | alteryx/AlteryxSim | R/sample-best-fits.R | #' Process a fit element created by 'fit_dists' on a data.frame
#'
#' @param fit_element element from highest list resulting from 'fit_dists' on a data.frame
#' @param type "MC" or "LH" for Monte Carlo or Latin Hypercube sampling
#' @return function accepting argument for number of samples to draw which would draw ... | 2,204 | gpl-3.0 |
7316534cf55a537b86ce1a2009b303e455b37d51 | Tenenhaus/RGCCA | R/plot_ind.R | #' Plot the two components of a RGCCA
#'
#' Plot the two components of a RGCCA
#'
#' @inheritParams plot2D
#' @param rgcca_res A list giving the results of a R/SGCCA
#' @param resp A vector of characters corresponding either to a qualitative
#' variable with levels or a continuous variable
#' @param compx An integer gi... | 3,590 | gpl-2.0 |
60d01bc59df24f71399330ed2bae29d776101443 | rlowrance/th | DEEDC.R | DEEDC <- function(code, kind) {
# determine if a DEEDC code is a specified level, treating NA is not at level
# ARGS
# code : integer vector
# kind : optional chr scalar
# definitions:
# promissory note := obligation to the bank to pay back the money with interest
# mortgage := col... | 4,085 | gpl-3.0 |
60d01bc59df24f71399330ed2bae29d776101443 | rlowrance/re-local-linear | DEEDC.R | DEEDC <- function(code, kind) {
# determine if a DEEDC code is a specified level, treating NA is not at level
# ARGS
# code : integer vector
# kind : optional chr scalar
# definitions:
# promissory note := obligation to the bank to pay back the money with interest
# mortgage := col... | 4,085 | mit |
4d3c1c893542c4be6efc502e86d638c0a2ffb5ff | cran/BAYSTAR | R/TAR.thres.R | TAR.thres<-function(ay,p1,p2,ph.1,ph.2,sig.1,sig.2,lagd,thres,step.r=0.02,bound,lagp1,lagp2,constant=1,thresVar){ ## step.r is the step size of the MH sampling.
## bound is the hyper-parameter of a Gamma prior
new.r<- thres+step.r*... | 1,279 | gpl-2.0 |
777c71cd1d340b08f90eaac876baa54a1593c85c | metno/BMD | verification/daily_obs_to_sqlite.R | library(readxl)
library(tidyr)
library(readr)
library(dplyr)
my_read_obs <- function(file, sheet, year, parameter, cell_columns, set_trace_amount = F){
# READ EXCEL FILE, BUT ONLY COLUMNS A TO AF. THESE CONTAIN MAXIMUM TEMPERATURE
obs <- read_excel(file, sheet = sheet, range = cell_cols(cell_columns))
# STATI... | 2,533 | apache-2.0 |
2ccd883fcc207c6aab8998ca0b8a648c3a480c0f | fingerhuth/NG-POC-resistance | scripts/pn_187.R | years <- 500
yearsR <- 5
pyearsR <- 1/12
timesR <- seq(0, yearsR, pyearsR)
eff.e_1b <- 0.99
eff.delta <- 7/365
eff.xi_r <- 0.99
eff.lambda_sigma <- 0.9
e_0a <- 0.99
omega <- 10.4285714285714
lambda_zeta <- 0.9
xi_ng <- 0.99
n.sim <- 10
n.tp <- 50
max.outros <- 1000
psi.msm <- 0.6
psi.het <- 0.6
x <- 5
| 309 | mit |
70cb232019b273fa68308496c7e3f876717b699e | ivyleavedtoadflax/knn | R/knn.R | # knn: Simple implementation of k-nearest-neighbours
# A package for the R statistical environment
# Copyright (C) 2015 Matthew Upson <ivyleavedtoadflax@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published... | 2,372 | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.