content
large_stringlengths
0
6.46M
path
large_stringlengths
3
331
license_type
large_stringclasses
2 values
repo_name
large_stringlengths
5
125
language
large_stringclasses
1 value
is_vendor
bool
2 classes
is_generated
bool
2 classes
length_bytes
int64
4
6.46M
extension
large_stringclasses
75 values
text
stringlengths
0
6.46M
#////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////# # Rdistance: an R package for distance-sampling analysis # This script tests the line-transect workflow, with covariates # Jason D. Carlisle # WEST, Inc. # jcarlisle@west-inc.com # Last ...
/tests/testthat/test_lines_covars.R
no_license
wmcdonald1/Rdistance
R
false
false
14,761
r
#////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////# # Rdistance: an R package for distance-sampling analysis # This script tests the line-transect workflow, with covariates # Jason D. Carlisle # WEST, Inc. # jcarlisle@west-inc.com # Last ...
#' UpSetR Plot #' #' @description Visualization of set intersections using novel UpSet matrix design. #' @param data Data set #' @param nsets Number of sets to look at #' @param nintersects Number of intersections to plot. If set to NA, all intersections will be plotted. #' @param sets Specific sets to look at (Include...
/R/upset.R
no_license
G-Thomson/UpSetR
R
false
false
16,424
r
#' UpSetR Plot #' #' @description Visualization of set intersections using novel UpSet matrix design. #' @param data Data set #' @param nsets Number of sets to look at #' @param nintersects Number of intersections to plot. If set to NA, all intersections will be plotted. #' @param sets Specific sets to look at (Include...
### Big data tile plot bigvis_compute_tiles <- function(data, x_field, y_field, resolution = 500){ data_prep <- data %>% select_(x = x_field, y = y_field) %>% filter(!is.na(x), !is.na(y)) s <- data_prep %>% summarise(max_x = max(x), max_y = max(y), min_x = min(x), ...
/dev/cloudera/bigvis_tile.R
no_license
nachti/sparkDemos
R
false
false
1,030
r
### Big data tile plot bigvis_compute_tiles <- function(data, x_field, y_field, resolution = 500){ data_prep <- data %>% select_(x = x_field, y = y_field) %>% filter(!is.na(x), !is.na(y)) s <- data_prep %>% summarise(max_x = max(x), max_y = max(y), min_x = min(x), ...
## File Name: mice_ml_lmer_include_cluster_means.R ## File Version: 0.16 mice_ml_lmer_include_cluster_means <- function(y, ry, type, x, levels_id, aggregate_automatically, clus, groupcenter.slope, variables_levels ) { types_sel <- names(type)[ type==1 ] x_sel <- x[, types_sel ] NL <- length(levels...
/R/mice_ml_lmer_include_cluster_means.R
no_license
stefvanbuuren/miceadds
R
false
false
1,731
r
## File Name: mice_ml_lmer_include_cluster_means.R ## File Version: 0.16 mice_ml_lmer_include_cluster_means <- function(y, ry, type, x, levels_id, aggregate_automatically, clus, groupcenter.slope, variables_levels ) { types_sel <- names(type)[ type==1 ] x_sel <- x[, types_sel ] NL <- length(levels...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/multiple_signatures_plot.R \name{plot_fgseaRes} \alias{plot_fgseaRes} \title{Plot one-tailed GSEA on one signature for multiple gene sets} \usage{ plot_fgseaRes( ges, geneSets, fgseaRes, ledge_only = FALSE, signatureNames = NULL, ...
/man/plot_fgseaRes.Rd
no_license
fossbert/binilib
R
false
true
1,299
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/multiple_signatures_plot.R \name{plot_fgseaRes} \alias{plot_fgseaRes} \title{Plot one-tailed GSEA on one signature for multiple gene sets} \usage{ plot_fgseaRes( ges, geneSets, fgseaRes, ledge_only = FALSE, signatureNames = NULL, ...
## Functional programming of the two-step clustering-based Bayesian network structrue learning strategy. # (Standard Version) cluster_BNL = function(data, stand = TRUE, method = "average", N = floor(sqrt(2)*ncol(data)/2), algo = gs, ...){ # The function takes a data frame as an input. # "stand" is a logic...
/TSCB_function.R
no_license
zhangyk8/TSCB-strategy
R
false
false
3,892
r
## Functional programming of the two-step clustering-based Bayesian network structrue learning strategy. # (Standard Version) cluster_BNL = function(data, stand = TRUE, method = "average", N = floor(sqrt(2)*ncol(data)/2), algo = gs, ...){ # The function takes a data frame as an input. # "stand" is a logic...
# @file dataSplitting.R # Copyright 2017 Observational Health Data Sciences and Informatics # # This file is part of PatientLevelPrediction # # 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 # ...
/R/DataSplitting.R
permissive
julianflowers/PatientLevelPrediction
R
false
false
7,678
r
# @file dataSplitting.R # Copyright 2017 Observational Health Data Sciences and Informatics # # This file is part of PatientLevelPrediction # # 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 # ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot_cutoff.R \name{get.cutoff.df} \alias{get.cutoff.df} \title{Create ggplot object for number of differntially expressed genes with different FDR and fold change cutoff.} \usage{ get.cutoff.df(datin, pvalues, FCs, FCflag = "logFC", F...
/man/get.cutoff.df.Rd
no_license
THERMOSTATS/RVA
R
false
true
938
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot_cutoff.R \name{get.cutoff.df} \alias{get.cutoff.df} \title{Create ggplot object for number of differntially expressed genes with different FDR and fold change cutoff.} \usage{ get.cutoff.df(datin, pvalues, FCs, FCflag = "logFC", F...
## I have made 2 functions to saitsify the requirements of the second programming assignment. ## These functions are designed to cache the inverse of a matrix, becuase matrix is usually a costly ## computation and there is a time benefit from caching this calculation. ## The first function, 'makeCacheMatrix', creates...
/cachematrix.R
no_license
CharlotteWoolley/ProgrammingAssignment2
R
false
false
1,438
r
## I have made 2 functions to saitsify the requirements of the second programming assignment. ## These functions are designed to cache the inverse of a matrix, becuase matrix is usually a costly ## computation and there is a time benefit from caching this calculation. ## The first function, 'makeCacheMatrix', creates...
#' @title Calculate Error #' #' @description Calculate regression error for various statistical models. #' #' @param x Predictor vector. #' @param theta Parameter vector. #' #' @export sigma <- function(x, ...) UseMethod("sigma") #' @export sigma.plm <- function(x, theta, ...){ if (missing(theta)) stop("'theta' mu...
/R/sigma.R
no_license
TobieSurette/gulf.stats
R
false
false
1,209
r
#' @title Calculate Error #' #' @description Calculate regression error for various statistical models. #' #' @param x Predictor vector. #' @param theta Parameter vector. #' #' @export sigma <- function(x, ...) UseMethod("sigma") #' @export sigma.plm <- function(x, theta, ...){ if (missing(theta)) stop("'theta' mu...
scoreMeltedDF = scoreDF %>% melt(id = NULL) %>% mutate(task = str_extract(variable, regEx_taskName), tuneFlag = str_extract(variable, regEx_tungFlag), question = str_extract(variable, regEx_taskquestion)) %>% select(-variable) %>% mutate(data = case_when(task == "AC" ~ "Advice-seeking", ...
/supMaterial/scripts/helper-performanceAnalysis.R
no_license
dpzhang/NetHOPs
R
false
false
16,979
r
scoreMeltedDF = scoreDF %>% melt(id = NULL) %>% mutate(task = str_extract(variable, regEx_taskName), tuneFlag = str_extract(variable, regEx_tungFlag), question = str_extract(variable, regEx_taskquestion)) %>% select(-variable) %>% mutate(data = case_when(task == "AC" ~ "Advice-seeking", ...
# load the required packages library(shiny) library(shinydashboard) library(ggplot2) library(dplyr) library(RColorBrewer) library(highcharter) library(rjson) library(httr) library(plotly) library(quantmod) library(tidyr) library(leaflet) library(xts) library(data.table) library(rgdal) library(shinyalert...
/File/Ui.R
no_license
MarCortese/ShinyApp-Covid
R
false
false
10,616
r
# load the required packages library(shiny) library(shinydashboard) library(ggplot2) library(dplyr) library(RColorBrewer) library(highcharter) library(rjson) library(httr) library(plotly) library(quantmod) library(tidyr) library(leaflet) library(xts) library(data.table) library(rgdal) library(shinyalert...
############################################# # Calculate the length of observations, tau # ############################################# get.tau <- function(inputData){ if (length(dim(inputData)) != 2) { tau <- as.integer(length(inputData)) } if (length(dim(inputData)) == 2) { tau <...
/hsmm/R/get.tau.r
no_license
ingted/R-Examples
R
false
false
378
r
############################################# # Calculate the length of observations, tau # ############################################# get.tau <- function(inputData){ if (length(dim(inputData)) != 2) { tau <- as.integer(length(inputData)) } if (length(dim(inputData)) == 2) { tau <...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/packages.R \name{makeArchiveRDS} \alias{makeArchiveRDS} \title{Make the archive.rds file of a repo} \usage{ makeArchiveRDS(repopath, type = "source") } \arguments{ \item{repopath}{path to the repo} \item{type}{type of the packages to archive...
/man/makeArchiveRDS.Rd
no_license
stla/SLutils
R
false
true
520
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/packages.R \name{makeArchiveRDS} \alias{makeArchiveRDS} \title{Make the archive.rds file of a repo} \usage{ makeArchiveRDS(repopath, type = "source") } \arguments{ \item{repopath}{path to the repo} \item{type}{type of the packages to archive...
library(rpart) library(partykit) library(readxl) library(caret) rm(list=ls()) proj_data = read_excel("project-data.xlsx") # removing the 'id' column proj_data <- proj_data[,-1] # used to display the names of the columns names(proj_data) # used to attach the data_set to R's search path so that columns can be accessed ...
/ca1/r-project.R
no_license
mukeshmk/r-project
R
false
false
7,236
r
library(rpart) library(partykit) library(readxl) library(caret) rm(list=ls()) proj_data = read_excel("project-data.xlsx") # removing the 'id' column proj_data <- proj_data[,-1] # used to display the names of the columns names(proj_data) # used to attach the data_set to R's search path so that columns can be accessed ...
## DEPENDENCY: source("common_MCMC_functions.R"); library("mvtnorm"); library("purrr"); ## source("common_MCMC_functions.R"); library("mvtnorm"); library("purrr"); ## Adding additional function to compute locFDR in straightforward way for correlated case. ##============= choose the shape parameters of the Beta dist...
/R/locFDR_BF_theoretic.R
no_license
ArunabhaCodes/CPBayes
R
false
false
12,535
r
## DEPENDENCY: source("common_MCMC_functions.R"); library("mvtnorm"); library("purrr"); ## source("common_MCMC_functions.R"); library("mvtnorm"); library("purrr"); ## Adding additional function to compute locFDR in straightforward way for correlated case. ##============= choose the shape parameters of the Beta dist...
\name{trans_parameter} \alias{trans_parameter} \title{Transformation of the Response Variable} \description{ Transform the response variable using the one-paremter, symmetric transformation of Geraci and Jones (2015). } \usage{ trans_parameter(x, parameter, inverse=FALSE) } \arguments{ \item{x}{a vector o...
/man/trans_parameter.Rd
no_license
cran/plaqr
R
false
false
1,467
rd
\name{trans_parameter} \alias{trans_parameter} \title{Transformation of the Response Variable} \description{ Transform the response variable using the one-paremter, symmetric transformation of Geraci and Jones (2015). } \usage{ trans_parameter(x, parameter, inverse=FALSE) } \arguments{ \item{x}{a vector o...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RC_estimators.R \name{FitRCModel} \alias{FitRCModel} \alias{CalcExpX} \alias{CalcExpw} \title{Calculates regression calibration estimates} \usage{ FitRCModel(valid_dat, full_dat, sampling_type, return_coef) CalcExpX(valid_dat, full_dat, samp...
/man/RC_estimators.Rd
no_license
MeasurementErrorMethods/RRCME
R
false
true
1,060
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RC_estimators.R \name{FitRCModel} \alias{FitRCModel} \alias{CalcExpX} \alias{CalcExpw} \title{Calculates regression calibration estimates} \usage{ FitRCModel(valid_dat, full_dat, sampling_type, return_coef) CalcExpX(valid_dat, full_dat, samp...
\name{id} \alias{id} \title{Functions for special formula} \usage{ id(x,...) } \arguments{ \item{x}{covariate name} \item{...}{ignored} } \description{ This function pass the first argument and does nothing else. }
/man/id.Rd
no_license
zt2730/Publish
R
false
false
221
rd
\name{id} \alias{id} \title{Functions for special formula} \usage{ id(x,...) } \arguments{ \item{x}{covariate name} \item{...}{ignored} } \description{ This function pass the first argument and does nothing else. }
test_that("Calculation 2 works", { expect_equal(calculation_2(8,5), 169) expect_equal(calculation_2(10,5), 225) expect_equal(calculation_2(5,15), 400) })
/tests/testthat/test-Test-for-Calculation-2.R
permissive
faryalusman/DATA-598-WI20-week-7
R
false
false
160
r
test_that("Calculation 2 works", { expect_equal(calculation_2(8,5), 169) expect_equal(calculation_2(10,5), 225) expect_equal(calculation_2(5,15), 400) })
#---------------------------------------------------------------------- # Purpose: This test exercises the DeepLearning model downloaded as java code # for the iris data set. # # Notes: Assumes unix environment. # curl, javac, java must be installed. # java must be at least 1.6. #-----...
/h2o-r/tests/testdir_javapredict/runit_NOPASS_DL_javapredict_iris_large.R
permissive
StephRoark/h2o-3
R
false
false
3,213
r
#---------------------------------------------------------------------- # Purpose: This test exercises the DeepLearning model downloaded as java code # for the iris data set. # # Notes: Assumes unix environment. # curl, javac, java must be installed. # java must be at least 1.6. #-----...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/combine-dimensions.R \name{combine_dimensions} \alias{combine_dimensions} \title{Combine samples by dimensions} \usage{ combine_dimensions(x, fun = mean, along = NULL, ...) } \arguments{ \item{x}{An MCMC object} \item{fun}{The function to us...
/man/combine_dimensions.Rd
permissive
poissonconsulting/mcmcr
R
false
true
782
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/combine-dimensions.R \name{combine_dimensions} \alias{combine_dimensions} \title{Combine samples by dimensions} \usage{ combine_dimensions(x, fun = mean, along = NULL, ...) } \arguments{ \item{x}{An MCMC object} \item{fun}{The function to us...
# doing Naive Bayes on tetranucleotide probabilities with multinomial distributions. # NEW CODE 2014-07-01 setwd("~/GitHub/tango") #read phage names and clusters, tetranucleotides for all phageData <- as.data.frame(read.table('kmer_analysis/examples/PhagesDB_Data.txt',skip=1)) allK4 <- as.matrix(read.table('data/kmer_...
/tango/src/naive_bayes_multinom.R
no_license
meredithhitchcock/wabio
R
false
false
6,591
r
# doing Naive Bayes on tetranucleotide probabilities with multinomial distributions. # NEW CODE 2014-07-01 setwd("~/GitHub/tango") #read phage names and clusters, tetranucleotides for all phageData <- as.data.frame(read.table('kmer_analysis/examples/PhagesDB_Data.txt',skip=1)) allK4 <- as.matrix(read.table('data/kmer_...
#' Make .rnk file #' Input: txt file #' Output: writes out .rnk file #' #' make .rnk file (ie. for GSEA preranked) #' @param file filename of some txt file #' @param column column number of orig file you want to rank (>1) #' @export #' make_rnk_file = function(file, column){ data = read.delim(file) data = dat...
/R/make_rnk_file.R
no_license
KSheu/ksheu.library1
R
false
false
488
r
#' Make .rnk file #' Input: txt file #' Output: writes out .rnk file #' #' make .rnk file (ie. for GSEA preranked) #' @param file filename of some txt file #' @param column column number of orig file you want to rank (>1) #' @export #' make_rnk_file = function(file, column){ data = read.delim(file) data = dat...
### ### --- hs-RandomForest ### library(rpart) library(randomForest) library(caret) library(dplyr) library(doMC) registerDoMC(cores = 6) source("t-functions.R", echo = FALSE) source("hs-loadnclean.R") fit.rf <- randomForest(formula = as.factor(QuoteConversion_Flag)~., dtrain_final, nodesize = 10 ) ...
/hs-randomForest.R
no_license
NikhilsCodeHub/HomeSite
R
false
false
898
r
### ### --- hs-RandomForest ### library(rpart) library(randomForest) library(caret) library(dplyr) library(doMC) registerDoMC(cores = 6) source("t-functions.R", echo = FALSE) source("hs-loadnclean.R") fit.rf <- randomForest(formula = as.factor(QuoteConversion_Flag)~., dtrain_final, nodesize = 10 ) ...
#BigData Application Performance Pridiction and Cluster Recommendation #Date : 28.05.18 library(ggplot2) library(dplyr) library(gridExtra) library(caret) library(grid) library(ggpubr) # dev.off() options(scipen=999) setwd("/home/sc306/Dropbox/SA/ClusterBenchMarking/hadoop/ClusterBenchmarking") #setwd("/cs/home/sc306/Dr...
/newAnalysis.R
no_license
sneceesay77/mr-modelling
R
false
false
3,805
r
#BigData Application Performance Pridiction and Cluster Recommendation #Date : 28.05.18 library(ggplot2) library(dplyr) library(gridExtra) library(caret) library(grid) library(ggpubr) # dev.off() options(scipen=999) setwd("/home/sc306/Dropbox/SA/ClusterBenchMarking/hadoop/ClusterBenchmarking") #setwd("/cs/home/sc306/Dr...
###################################################################################################### # Malin FLSAM Assessment #################################################################################################### rm(list=ls()); gc(); graphics.off(); start.time <- proc.time()[3] options(stringsAsFactors...
/VIa/IBP2018/05_IBP_MSH_bindQ.r
no_license
ices-eg/wg_HAWG
R
false
false
6,802
r
###################################################################################################### # Malin FLSAM Assessment #################################################################################################### rm(list=ls()); gc(); graphics.off(); start.time <- proc.time()[3] options(stringsAsFactors...
# =========== # Description # =========== # This script is intended to circumvent the column format issue of exporting # CSV files from ArcGIS. A DBF file is converted to CSV for upload to the # database. # ============== # Load libraries # ============== rm(list = ls()) library(foreign) # ============== # S...
/scripts/workspace/spatialGridFormat.R
no_license
Conte-Ecology/nasaProjections
R
false
false
724
r
# =========== # Description # =========== # This script is intended to circumvent the column format issue of exporting # CSV files from ArcGIS. A DBF file is converted to CSV for upload to the # database. # ============== # Load libraries # ============== rm(list = ls()) library(foreign) # ============== # S...
# 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...
/r/tests/testthat/test-dplyr-distinct.R
permissive
pitrou/arrow
R
false
false
2,609
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...
library(quantmod) library(stringr) library(randomForest) library(nnet) library(scales) library(Quandl) source("indicators.R") args = commandArgs(trailingOnly = TRUE) #' Create data frame of the needed data #' #' @param stock_data stock data #' @param start_date start date for analysis #' @param end_date end date for...
/main.R
no_license
devtur/RandomForestForecasting
R
false
false
11,836
r
library(quantmod) library(stringr) library(randomForest) library(nnet) library(scales) library(Quandl) source("indicators.R") args = commandArgs(trailingOnly = TRUE) #' Create data frame of the needed data #' #' @param stock_data stock data #' @param start_date start date for analysis #' @param end_date end date for...
library(ggplot2) load.image("Z:/CT-Mum/Visualization/product.jpg") ## if not already installed install.packages("jpeg") library(jpeg) ?readJPEG() img <- readJPEG("Z:/CT-Mum/Visualization/product.jpg", native = TRUE) #this will display your image to test you read it correctly if(exists("rasterImage")...
/heatmap.R
no_license
ruhulali/R_Codes
R
false
false
2,072
r
library(ggplot2) load.image("Z:/CT-Mum/Visualization/product.jpg") ## if not already installed install.packages("jpeg") library(jpeg) ?readJPEG() img <- readJPEG("Z:/CT-Mum/Visualization/product.jpg", native = TRUE) #this will display your image to test you read it correctly if(exists("rasterImage")...
library(ruta) ### Name: autoencoder_variational ### Title: Build a variational autoencoder ### Aliases: autoencoder_variational ### ** Examples network <- input() + dense(256, "elu") + variational_block(3) + dense(256, "elu") + output("sigmoid") learner <- autoencoder_variational(network, loss = "binary_...
/data/genthat_extracted_code/ruta/examples/autoencoder_variational.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
338
r
library(ruta) ### Name: autoencoder_variational ### Title: Build a variational autoencoder ### Aliases: autoencoder_variational ### ** Examples network <- input() + dense(256, "elu") + variational_block(3) + dense(256, "elu") + output("sigmoid") learner <- autoencoder_variational(network, loss = "binary_...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gems.r \docType{class} \name{PosteriorProbabilities} \alias{PosteriorProbabilities} \alias{PosteriorProbabilities-class} \alias{[,PosteriorProbabilities,ANY,ANY,ANY-method} \alias{[,PosteriorProbabilities-method} \alias{[.PosteriorProbabiliti...
/man/PosteriorProbabilities.Rd
no_license
blasern/gems
R
false
true
2,604
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gems.r \docType{class} \name{PosteriorProbabilities} \alias{PosteriorProbabilities} \alias{PosteriorProbabilities-class} \alias{[,PosteriorProbabilities,ANY,ANY,ANY-method} \alias{[,PosteriorProbabilities-method} \alias{[.PosteriorProbabiliti...
#' Extract NLCD Areas #' #' Extracts and calculates the area of NLCD classes for a specified feature. Returns a long tibble with percent and area for each class and feature. #' #' @param feature feature to extract and calculate NLCD class areas. Can be class sp or sf with one or multiple features. #' @param id_variab...
/R/extract_NLCD.R
permissive
mps9506/mpsrf
R
false
false
5,377
r
#' Extract NLCD Areas #' #' Extracts and calculates the area of NLCD classes for a specified feature. Returns a long tibble with percent and area for each class and feature. #' #' @param feature feature to extract and calculate NLCD class areas. Can be class sp or sf with one or multiple features. #' @param id_variab...
#' niceHist #' #' A function to plot a nice histogram - one that uses ggplot2 #' but has sensible break behaviour in R. Produces a single #' histogram but is mostly called internally for things like #' plotPosts. #' @name niceHist #' @param parameter The a vecotr of values that you want a histogram of. #' @param fill ...
/R/niceHist.R
no_license
hferg/hfgr
R
false
false
1,810
r
#' niceHist #' #' A function to plot a nice histogram - one that uses ggplot2 #' but has sensible break behaviour in R. Produces a single #' histogram but is mostly called internally for things like #' plotPosts. #' @name niceHist #' @param parameter The a vecotr of values that you want a histogram of. #' @param fill ...
packages.used <- c("dplyr", "tidyr", "plyr", "syuzhet", "shinyBS", "text2vec", "RANN", "stringr", "ggplot2", "plotly" ) # check packages that need to be installed. packages.needed=setdiff(packages.used, intersect(installed.packages()[,1], ...
/app/global.R
no_license
TZstatsADS/Spr2017-proj5-grp11
R
false
false
637
r
packages.used <- c("dplyr", "tidyr", "plyr", "syuzhet", "shinyBS", "text2vec", "RANN", "stringr", "ggplot2", "plotly" ) # check packages that need to be installed. packages.needed=setdiff(packages.used, intersect(installed.packages()[,1], ...
\name{NBAStandings2011} \alias{NBAStandings2011} \docType{data} \title{ NBA 2010-11 Regular Season Standings } \description{ Won-Loss record and statistics for NBA Teams in 2010-2011 } %\usage{data(NBAStandings2011)} \format{ A dataset with 30 observations on the following 6 variables. \tabular{rl}{ ...
/man/NBAStandings2011.Rd
no_license
cran/Lock5Data
R
false
false
991
rd
\name{NBAStandings2011} \alias{NBAStandings2011} \docType{data} \title{ NBA 2010-11 Regular Season Standings } \description{ Won-Loss record and statistics for NBA Teams in 2010-2011 } %\usage{data(NBAStandings2011)} \format{ A dataset with 30 observations on the following 6 variables. \tabular{rl}{ ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data_slicing.R \name{slice_one_wav_sequencially} \alias{slice_one_wav_sequencially} \title{Slice one Wave File Sequentially} \usage{ slice_one_wav_sequencially( audio_file, audio_dir, audio_dir_dest, interval = 1, overlap = 0, inv...
/man/slice_one_wav_sequencially.Rd
permissive
Athospd/mestrado
R
false
true
698
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data_slicing.R \name{slice_one_wav_sequencially} \alias{slice_one_wav_sequencially} \title{Slice one Wave File Sequentially} \usage{ slice_one_wav_sequencially( audio_file, audio_dir, audio_dir_dest, interval = 1, overlap = 0, inv...
# Download and explore data library(here) library(haven) library(magrittr) library(tidyverse) #http://ceo.gencat.cat/ca/barometre/detall/index.html?id=6408 #http://ceo.gencat.cat/ca/barometre/matrius-fusionada-BOP/ # Import data ---- ## Dowlnoad and unzip raw files ---- if(!file.exists(here("data", "from_CEO", "s...
/scripts/01_download_and_explore_data.R
permissive
JosepER/CEO
R
false
false
1,713
r
# Download and explore data library(here) library(haven) library(magrittr) library(tidyverse) #http://ceo.gencat.cat/ca/barometre/detall/index.html?id=6408 #http://ceo.gencat.cat/ca/barometre/matrius-fusionada-BOP/ # Import data ---- ## Dowlnoad and unzip raw files ---- if(!file.exists(here("data", "from_CEO", "s...
#' Calculate density of tracks #' #' Calculate for each track, using its starting frame, what is the relative density of tracks. #' We use a search radius to find how many tracks in the starting frame are neighbours of the track. #' The number of neighbours is normalised to the search circle, so that a track in the cor...
/R/calculateTrackDensity.R
permissive
quantixed/TrackMateR
R
false
false
4,865
r
#' Calculate density of tracks #' #' Calculate for each track, using its starting frame, what is the relative density of tracks. #' We use a search radius to find how many tracks in the starting frame are neighbours of the track. #' The number of neighbours is normalised to the search circle, so that a track in the cor...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hier_basis.R \name{GetDoF.HierBasis} \alias{GetDoF.HierBasis} \title{Extract Degrees of Freedom} \usage{ GetDoF.HierBasis(object) } \arguments{ \item{object}{An object of class \code{HierBasis}} } \value{ \item{dof}{A vector of degrees of fre...
/man/GetDoF.HierBasis.Rd
no_license
peterpark77/HierBasis
R
false
true
1,195
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hier_basis.R \name{GetDoF.HierBasis} \alias{GetDoF.HierBasis} \title{Extract Degrees of Freedom} \usage{ GetDoF.HierBasis(object) } \arguments{ \item{object}{An object of class \code{HierBasis}} } \value{ \item{dof}{A vector of degrees of fre...
# CWR pre-breeding characterising testing environments: calculating similarity index for general indices # Authors: B. Mora & H. Achicanoy # CIAT, 2018 # Load packages suppressMessages(if(!require(raster)){install.packages('raster'); library(raster)} else {library(raster)}) suppressMessages(if(!require(ncdf4)){install...
/01_calculating_similarity_for_general_indices.R
no_license
CIAT-DAPA/cwr_pre_breeding
R
false
false
5,524
r
# CWR pre-breeding characterising testing environments: calculating similarity index for general indices # Authors: B. Mora & H. Achicanoy # CIAT, 2018 # Load packages suppressMessages(if(!require(raster)){install.packages('raster'); library(raster)} else {library(raster)}) suppressMessages(if(!require(ncdf4)){install...
" @author: Zsofia Koma, UvA Aim: Pre-process presence-only data " library(rgdal) library(raster) library(sp) library(dplyr) library(stringr) library(tidyr) library(ggplot2) library(gridExtra) library(spThin) library(spatialEco) source("D:/GitHub/eEcoLiDAR/PhDPaper2_wetlandniche/src/bird_data_process/Func_ProcessOc...
/Paper3_wetlandniche/bird_data_process/PresOnly.R
no_license
komazsofi/myPhD_escience_analysis
R
false
false
2,885
r
" @author: Zsofia Koma, UvA Aim: Pre-process presence-only data " library(rgdal) library(raster) library(sp) library(dplyr) library(stringr) library(tidyr) library(ggplot2) library(gridExtra) library(spThin) library(spatialEco) source("D:/GitHub/eEcoLiDAR/PhDPaper2_wetlandniche/src/bird_data_process/Func_ProcessOc...
ROC = function(score, actual, add=FALSE, col="black", col.area="", type="l", pch=16) { o = order(score, decreasing=TRUE) fp = tp = fp_prev = tp_prev = 0 nF = sum(actual == FALSE) nT = sum(actual == TRUE) score_prev = -Inf ber_min = Inf area = 0 rx = ry = numeric(length(o)) n = 0 for (...
/code/ROC.R
no_license
okumuralab/RforFun
R
false
false
1,746
r
ROC = function(score, actual, add=FALSE, col="black", col.area="", type="l", pch=16) { o = order(score, decreasing=TRUE) fp = tp = fp_prev = tp_prev = 0 nF = sum(actual == FALSE) nT = sum(actual == TRUE) score_prev = -Inf ber_min = Inf area = 0 rx = ry = numeric(length(o)) n = 0 for (...
#'get hdf5 files from working directory #'@param filepath path to the directory having the hdf5 files getfiles <- function(filepath){ setwd(filepath) myfiles = dir() myfiles }
/R/getfiles.R
no_license
vjcitn/useret
R
false
false
181
r
#'get hdf5 files from working directory #'@param filepath path to the directory having the hdf5 files getfiles <- function(filepath){ setwd(filepath) myfiles = dir() myfiles }
### library and settings source("C01.02.simulation.setup.R") source("F02.01.simulation-analysis.R") ##install.packages("gamlss") library(gamlss) library(dplyr); library(magrittr); library(ggplot2); library(gridExtra) # model = "zinb" # model = "zig" model = "ziln" sig = 0.05 pert = 0.25 perturb = 0.25 #n = 80; regul...
/C02.02.simulation-Basic-statistics-pert.R
no_license
Boyango/Microbiome_9_13
R
false
false
14,839
r
### library and settings source("C01.02.simulation.setup.R") source("F02.01.simulation-analysis.R") ##install.packages("gamlss") library(gamlss) library(dplyr); library(magrittr); library(ggplot2); library(gridExtra) # model = "zinb" # model = "zig" model = "ziln" sig = 0.05 pert = 0.25 perturb = 0.25 #n = 80; regul...
library(landest) ### Name: example_rct ### Title: Hypothetical data from a randomized trial ### Aliases: example_rct ### Keywords: datasets ### ** Examples data(example_rct) names(example_rct)
/data/genthat_extracted_code/landest/examples/example_rct.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
200
r
library(landest) ### Name: example_rct ### Title: Hypothetical data from a randomized trial ### Aliases: example_rct ### Keywords: datasets ### ** Examples data(example_rct) names(example_rct)
#!usr/bin/env Rscript library(methods) library(Matrix) library(MASS) #library(Rcpp) library(lme4) # Read in your data as an R dataframe basedir <- c("/seastor/helenhelen/ISR_2015") resultdir <- paste(basedir,"/me/tmap/results/ln",sep="/") setwd(resultdir) r.itemInfo <- matrix(data=NA, nr=2, nc=4) ## read data #get data...
/ROI_based/me/ln/itemInfo_RVVC_ERC.R
no_license
QQXiao/ISR_2015
R
false
false
1,619
r
#!usr/bin/env Rscript library(methods) library(Matrix) library(MASS) #library(Rcpp) library(lme4) # Read in your data as an R dataframe basedir <- c("/seastor/helenhelen/ISR_2015") resultdir <- paste(basedir,"/me/tmap/results/ln",sep="/") setwd(resultdir) r.itemInfo <- matrix(data=NA, nr=2, nc=4) ## read data #get data...
% Generated by roxygen2 (4.1.0.9000): do not edit by hand % Please edit documentation in R/create_file_structure.R \name{create_file_structure} \alias{create_file_structure} \alias{within_file_structure} \title{Create a file structure for tests.} \usage{ create_file_structure(files, expr, dir) within_file_structure(fi...
/man/create_file_structure.Rd
no_license
richierocks/testthatsomemore
R
false
false
3,254
rd
% Generated by roxygen2 (4.1.0.9000): do not edit by hand % Please edit documentation in R/create_file_structure.R \name{create_file_structure} \alias{create_file_structure} \alias{within_file_structure} \title{Create a file structure for tests.} \usage{ create_file_structure(files, expr, dir) within_file_structure(fi...
#' Fast Additive Switching of Seasonality, Trend and Exogenous Regressors #' #' Implementation of the FASSTER model for forecasting time series #' with multiple seasonalities using switching states. #' #' \tabular{ll}{ Package: \tab fasster\cr Type: \tab Package\cr License: \tab #' GPL3\cr LazyLoad: \tab yes\cr } #' #'...
/R/fasster.r
no_license
osiris08/fasster
R
false
false
633
r
#' Fast Additive Switching of Seasonality, Trend and Exogenous Regressors #' #' Implementation of the FASSTER model for forecasting time series #' with multiple seasonalities using switching states. #' #' \tabular{ll}{ Package: \tab fasster\cr Type: \tab Package\cr License: \tab #' GPL3\cr LazyLoad: \tab yes\cr } #' #'...
#' @useDynLib proDD, .registration = TRUE #' @import rstantools #' @import Rcpp #' @import methods #' @importFrom Rcpp sourceCpp loadModule #' @importFrom rstan sampling NULL #' @import stats NULL #' apply function that always returns a numeric matrix #' #' The function is modelled after `vapply`, but always retur...
/R/util.R
no_license
const-ae/proDD
R
false
false
2,733
r
#' @useDynLib proDD, .registration = TRUE #' @import rstantools #' @import Rcpp #' @import methods #' @importFrom Rcpp sourceCpp loadModule #' @importFrom rstan sampling NULL #' @import stats NULL #' apply function that always returns a numeric matrix #' #' The function is modelled after `vapply`, but always retur...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/MDataUpdater.InvestFunds.FundHistory.RUB.R \docType{data} \name{MDataUpdater.InvestFunds.FundHistory.RUB} \alias{MDataUpdater.InvestFunds.FundHistory.RUB} \title{MDataUpdater.InvestFunds.FundHistory} \format{An object of class \code{R6ClassGe...
/MUpdaters/man/MDataUpdater.InvestFunds.FundHistory.RUB.Rd
no_license
pashkovds/mdlibs
R
false
true
468
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/MDataUpdater.InvestFunds.FundHistory.RUB.R \docType{data} \name{MDataUpdater.InvestFunds.FundHistory.RUB} \alias{MDataUpdater.InvestFunds.FundHistory.RUB} \title{MDataUpdater.InvestFunds.FundHistory} \format{An object of class \code{R6ClassGe...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/datasets.R \docType{data} \name{mrdata2} \alias{mrdata2} \title{Toy dataset for multiple regression analysis} \format{A matrix with eight columns: \code{w1}-\code{w6}, \code{x}, \code{y}} \usage{ data(mrdata2) } \description{ System wherein y...
/man/mrdata2.Rd
no_license
tkonopka/famr
R
false
true
392
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/datasets.R \docType{data} \name{mrdata2} \alias{mrdata2} \title{Toy dataset for multiple regression analysis} \format{A matrix with eight columns: \code{w1}-\code{w6}, \code{x}, \code{y}} \usage{ data(mrdata2) } \description{ System wherein y...
#' Get Electronic Filing Form Types #' #' HTTP Request: GET https://api.propublica.org/campaign-finance/v1/{cycle}/filings/types #' #' @param cycle The election cycle #' @param myAPI_Key use the Campaign Finance API, you must sign up for an API key. The API key must be included in all API requests to the server, set ...
/R/get_electronic_filing_form_types.R
no_license
DavytJ/ProPublicaR
R
false
false
894
r
#' Get Electronic Filing Form Types #' #' HTTP Request: GET https://api.propublica.org/campaign-finance/v1/{cycle}/filings/types #' #' @param cycle The election cycle #' @param myAPI_Key use the Campaign Finance API, you must sign up for an API key. The API key must be included in all API requests to the server, set ...
# Data Preprocessing Template setwd('/Users/rajatpa/Documents/DS/ML_A-Z/Part2_Regression/Section6_Polynomial_Regression/Polynomial_Regression') # Importing the dataset dataset = read.csv('Data.csv') # Splitting the dataset into the Training set and Test set # install.packages('caTools') library(caTools) set.seed(123...
/28_ML_A-Z/Part2_Regression/Section5_Multiple_Linear_Regression/data_preprocessing_template.R
no_license
rajatkalyani/DS
R
false
false
561
r
# Data Preprocessing Template setwd('/Users/rajatpa/Documents/DS/ML_A-Z/Part2_Regression/Section6_Polynomial_Regression/Polynomial_Regression') # Importing the dataset dataset = read.csv('Data.csv') # Splitting the dataset into the Training set and Test set # install.packages('caTools') library(caTools) set.seed(123...
# # Ingmar Visser, 11-6-2008 # # Changes # - added lin.upper and lin.lower slots to these objects # # MIX.FITTED CLASS # setClass("mix.fitted", representation(message="character", # convergence information conMat="matrix", # constraint matrix on the parameters for general linear constraints lin.upper="nume...
/thermal_profiles/packages/depmixS4/R/depmixfit-class.R
no_license
adrianalbert/EnergyAnalytics
R
false
false
2,381
r
# # Ingmar Visser, 11-6-2008 # # Changes # - added lin.upper and lin.lower slots to these objects # # MIX.FITTED CLASS # setClass("mix.fitted", representation(message="character", # convergence information conMat="matrix", # constraint matrix on the parameters for general linear constraints lin.upper="nume...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/join_tsc_sites.R \name{join_tsc_sites} \alias{join_tsc_sites} \title{Join a dataframe with lat/lon to sf objects of sites and areas.} \usage{ join_tsc_sites(data, sites, prefix = "observed_at_") } \arguments{ \item{data}{A dataframe with an o...
/man/join_tsc_sites.Rd
no_license
dbca-wa/wastdr
R
false
true
2,143
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/join_tsc_sites.R \name{join_tsc_sites} \alias{join_tsc_sites} \title{Join a dataframe with lat/lon to sf objects of sites and areas.} \usage{ join_tsc_sites(data, sites, prefix = "observed_at_") } \arguments{ \item{data}{A dataframe with an o...
PIDS = c("E7010585") PARA_list <- c('AVG_MAX_TEMP', 'BIPS_PERCENT_INITIAL', 'BIPS_PROTECTION_MAX', 'BIPS_PROTECTION_PERCENT_MAX', 'COIL_TEMP_AVG', 'COIL_TEMP_MAX', 'CUM_CTO_9S_500HRS', 'FREE_RETRY_10_CUM',...
/global.R
no_license
jiayi9/tool
R
false
false
4,774
r
PIDS = c("E7010585") PARA_list <- c('AVG_MAX_TEMP', 'BIPS_PERCENT_INITIAL', 'BIPS_PROTECTION_MAX', 'BIPS_PROTECTION_PERCENT_MAX', 'COIL_TEMP_AVG', 'COIL_TEMP_MAX', 'CUM_CTO_9S_500HRS', 'FREE_RETRY_10_CUM',...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/class_equals_linter.R \name{class_equals_linter} \alias{class_equals_linter} \title{Block comparison of class with ==} \usage{ class_equals_linter() } \description{ Usage like \code{class(x) == "character"} is prone to error since class in R ...
/man/class_equals_linter.Rd
permissive
russHyde/lintr
R
false
true
920
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/class_equals_linter.R \name{class_equals_linter} \alias{class_equals_linter} \title{Block comparison of class with ==} \usage{ class_equals_linter() } \description{ Usage like \code{class(x) == "character"} is prone to error since class in R ...
#' Plot a suite of time series plots from a HYPE basin output file #' #' Plot a standard suite of time series plots from a basin output file, typically used for model performance inspection and/or #' during manual calibration #' #' @param x Data frame, with column-wise equally-spaced time series of HYPE variables. Dat...
/R/function_PlotBasinOutput.R
no_license
pslota/HYPEtools
R
false
false
42,291
r
#' Plot a suite of time series plots from a HYPE basin output file #' #' Plot a standard suite of time series plots from a basin output file, typically used for model performance inspection and/or #' during manual calibration #' #' @param x Data frame, with column-wise equally-spaced time series of HYPE variables. Dat...
#' @useDynLib hdf5tenx, .registration = TRUE #' @importFrom Rcpp evalCpp .iterator <- function(fname, group, ncol, bufsize) { offset <- floor(seq(0, ncol, length.out = bpnworkers(bpparam()) + 1L)) n <- min(ncol, length(offset) - 1L) i <- 0L function() { if (i == n) return(NULL) ...
/R/margins.R
no_license
mtmorgan/hdf5tenx
R
false
false
3,523
r
#' @useDynLib hdf5tenx, .registration = TRUE #' @importFrom Rcpp evalCpp .iterator <- function(fname, group, ncol, bufsize) { offset <- floor(seq(0, ncol, length.out = bpnworkers(bpparam()) + 1L)) n <- min(ncol, length(offset) - 1L) i <- 0L function() { if (i == n) return(NULL) ...
error.bar <- function(x, y, upper, lower=upper, length=0.025, ...) { if(length(x) != length(y) | length(y) !=length(lower) | length(lower) != length(upper)) stop("vectors must be same length") arrows(x,y+upper, x, y-lower, angle=90, code=3, length=length, ...) } draw.bar <- function(xx, yy, file, ylabel, xlabel) { ...
/plots/R/quant.star.R
permissive
Kingsford-Group/scalloptest
R
false
false
1,591
r
error.bar <- function(x, y, upper, lower=upper, length=0.025, ...) { if(length(x) != length(y) | length(y) !=length(lower) | length(lower) != length(upper)) stop("vectors must be same length") arrows(x,y+upper, x, y-lower, angle=90, code=3, length=length, ...) } draw.bar <- function(xx, yy, file, ylabel, xlabel) { ...
devtools::install_github("topepo/caret/pkg/caret") library(caret) library(xgboost) library(Ckmeans.1d.dp) library(dplyr) library(tidyr) library(ggplot2) library(doMC) registerDoMC(cores = 2) source('helper.r') ######################################################## # Load #############################################...
/Higgs Boson - Kaggle competition/ada_modeling.r
no_license
SwarnenduSengupta/Projects
R
false
false
1,582
r
devtools::install_github("topepo/caret/pkg/caret") library(caret) library(xgboost) library(Ckmeans.1d.dp) library(dplyr) library(tidyr) library(ggplot2) library(doMC) registerDoMC(cores = 2) source('helper.r') ######################################################## # Load #############################################...
library("testthat") library("pdfcount") test_check("pdfcount")
/tests/testthat-pdfcount.R
permissive
revelunt/pdfcount
R
false
false
63
r
library("testthat") library("pdfcount") test_check("pdfcount")
#Dr. Susanne Weller #24/07/2014 # #This converts p-values into * signs for later use in heatmaps significancelevels <- function(pvalue){ if(is.na(pvalue)){ sign <- "" } else{ if(pvalue<=0.001){ sign <- "***" } if(pvalue<=0.01 & pvalue>0.001){ sign <- "**" } if(pvalue<=0.05 & pvalue > 0.01){ ...
/HICF1_v6/significancelevels.R
no_license
Suska/HICF1
R
false
false
457
r
#Dr. Susanne Weller #24/07/2014 # #This converts p-values into * signs for later use in heatmaps significancelevels <- function(pvalue){ if(is.na(pvalue)){ sign <- "" } else{ if(pvalue<=0.001){ sign <- "***" } if(pvalue<=0.01 & pvalue>0.001){ sign <- "**" } if(pvalue<=0.05 & pvalue > 0.01){ ...
### withincor_tab ---- withincor_tab <- tabItem( tabName = "withincor_tab", tags$span("This app lets you try out the code from Daniël Lakens' blog post: "), tags$a(href = "https://daniellakens.blogspot.com/2016/11/why-within-subject-designs-require-less.html", "Why Within-Subject Designs Require Fewer Pa...
/withincor/withincor_tab.R
permissive
debruine/proveit
R
false
false
1,945
r
### withincor_tab ---- withincor_tab <- tabItem( tabName = "withincor_tab", tags$span("This app lets you try out the code from Daniël Lakens' blog post: "), tags$a(href = "https://daniellakens.blogspot.com/2016/11/why-within-subject-designs-require-less.html", "Why Within-Subject Designs Require Fewer Pa...
rm(list = ls()) library(ggplot2) library(dplyr) # Look at a single seed of data # Returns a trimmed data frame. One row corresponds to a bin of genotypes that WERE present # Returns a string as an error code on failure analyze_data = function(in_dir, out_dir){ # Load the data, return with error code if file / data n...
/analysis/distribution_analysis.R
no_license
FergusonAJ/ibio896_indiv_stochastic_plastic_model
R
false
false
6,749
r
rm(list = ls()) library(ggplot2) library(dplyr) # Look at a single seed of data # Returns a trimmed data frame. One row corresponds to a bin of genotypes that WERE present # Returns a string as an error code on failure analyze_data = function(in_dir, out_dir){ # Load the data, return with error code if file / data n...
# Simple Linear Regression library(MASS) attach(Boston) names(Boston) lm.fit=lm(medv~lstat) summary(lm.fit) plot(lm.fit) plot(lstat,medv,main = "Scatterplot",xlab = "Lstat",ylab = "Median value") abline(lm.fit,col = 'red', lwd = 6) # Multiple Linear Regression pairs(Boston) pairs(Boston[,c(1,3,7)]) lm.fit2 = lm(medv~...
/An Introduction to Statistical Learning /R/Linear Regression.R
no_license
lzxyzq/Data-Analysis
R
false
false
1,055
r
# Simple Linear Regression library(MASS) attach(Boston) names(Boston) lm.fit=lm(medv~lstat) summary(lm.fit) plot(lm.fit) plot(lstat,medv,main = "Scatterplot",xlab = "Lstat",ylab = "Median value") abline(lm.fit,col = 'red', lwd = 6) # Multiple Linear Regression pairs(Boston) pairs(Boston[,c(1,3,7)]) lm.fit2 = lm(medv~...
#context("No torus") set.seed(20092019) # Example from the RANN:nn2 documentation x1 <- runif(100, 0, 2 * pi) x2 <- runif(100, 0,3) DATA <- data.frame(x1, x2) # Check that RANN is available got_RANN <- requireNamespace("RANN", quietly = TRUE) # No wrapping if (got_RANN) { # Use RANN::nn2 directly (this is the defau...
/tests/testthat/test-no_torus.R
no_license
paulnorthrop/donut
R
false
false
1,094
r
#context("No torus") set.seed(20092019) # Example from the RANN:nn2 documentation x1 <- runif(100, 0, 2 * pi) x2 <- runif(100, 0,3) DATA <- data.frame(x1, x2) # Check that RANN is available got_RANN <- requireNamespace("RANN", quietly = TRUE) # No wrapping if (got_RANN) { # Use RANN::nn2 directly (this is the defau...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/foreign-keys.R \name{cdm_rm_fk} \alias{cdm_rm_fk} \title{Remove reference(s) from one table of a \code{\link{dm}} to another} \usage{ cdm_rm_fk(dm, table, column, ref_table) } \arguments{ \item{dm}{A \code{dm} object.} \item{table}{A table i...
/man/cdm_rm_fk.Rd
permissive
balthasars/dm
R
false
true
919
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/foreign-keys.R \name{cdm_rm_fk} \alias{cdm_rm_fk} \title{Remove reference(s) from one table of a \code{\link{dm}} to another} \usage{ cdm_rm_fk(dm, table, column, ref_table) } \arguments{ \item{dm}{A \code{dm} object.} \item{table}{A table i...
\name{DPP-package} \alias{DPP-package} \alias{DPP} \alias{DPPmcmc} \alias{Model} \alias{Rcpp_DPPmcmc} \alias{Rcpp_Model} \docType{package} \title{ \packageTitle{DPP} } \description{ \packageDescription{DPP} } \details{ DPP implements a Bayesian method to get a posterior probability for k normal distributions form a v...
/man/DPP-package.Rd
no_license
cran/DPP
R
false
false
2,827
rd
\name{DPP-package} \alias{DPP-package} \alias{DPP} \alias{DPPmcmc} \alias{Model} \alias{Rcpp_DPPmcmc} \alias{Rcpp_Model} \docType{package} \title{ \packageTitle{DPP} } \description{ \packageDescription{DPP} } \details{ DPP implements a Bayesian method to get a posterior probability for k normal distributions form a v...
library(tmod) ### Name: simplePie ### Title: Simple Pie Chart ### Aliases: simplePie simpleRug simpleBoxpie ### ** Examples # demonstration of the three widgets plot.new() par(usr=c(0,3,0,3)) x <- c(7, 5, 11) col <- tmodPal() b <- "black" simpleRug(0.5, 1.5, 0.8, 0.8, v=x, col=col, border=b) simplePie(1.5, 1.5, 0.8...
/data/genthat_extracted_code/tmod/examples/simplePie.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
806
r
library(tmod) ### Name: simplePie ### Title: Simple Pie Chart ### Aliases: simplePie simpleRug simpleBoxpie ### ** Examples # demonstration of the three widgets plot.new() par(usr=c(0,3,0,3)) x <- c(7, 5, 11) col <- tmodPal() b <- "black" simpleRug(0.5, 1.5, 0.8, 0.8, v=x, col=col, border=b) simplePie(1.5, 1.5, 0.8...
test_that("ncaa_team_stats works", { df <- ncaa_team_stats(2019) expect_is(df, "data.frame") }) test_that("get_bracket_data works", { df <- get_bracket_data(2019) expect_is(df, "data.frame") })
/tests/testthat/test-high_level.R
no_license
nickpaul7/npcnaa
R
false
false
210
r
test_that("ncaa_team_stats works", { df <- ncaa_team_stats(2019) expect_is(df, "data.frame") }) test_that("get_bracket_data works", { df <- get_bracket_data(2019) expect_is(df, "data.frame") })
## função para construir sequencias seq(from=0, to =100, by=10) ## para construir um gráfico! plot(x=seq(from=0, to=100, by=10), y= seq(to=100, from =0, by=10)) ## note que podemos usar funções dentro de funções para construir os argumentos! pares <- c(2,4,6,8) impares <- c(1,3,5,7,9) todos.os.numeros <- c(pares,imp...
/labs/r/0-basic/basics-r.R
no_license
nicolas0liveira/binderhub-r
R
false
false
4,798
r
## função para construir sequencias seq(from=0, to =100, by=10) ## para construir um gráfico! plot(x=seq(from=0, to=100, by=10), y= seq(to=100, from =0, by=10)) ## note que podemos usar funções dentro de funções para construir os argumentos! pares <- c(2,4,6,8) impares <- c(1,3,5,7,9) todos.os.numeros <- c(pares,imp...
## In order to demonstrate caching in R that saves computational time, I will be creating two functions makeCacheMatrix and cachesolve that will ## take matrix as an input and calculate its inverse, if the inverse has already been calculated then the inverse will be ##retrieved from the cache. ## makeCacheMatrix wil...
/cachematrix.R
no_license
Ananya2327/ProgrammingAssignment2
R
false
false
1,218
r
## In order to demonstrate caching in R that saves computational time, I will be creating two functions makeCacheMatrix and cachesolve that will ## take matrix as an input and calculate its inverse, if the inverse has already been calculated then the inverse will be ##retrieved from the cache. ## makeCacheMatrix wil...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/diffregr.R \name{screen_cvtrunc.lasso} \alias{screen_cvtrunc.lasso} \title{Cross-validated Lasso screening and additional truncation.} \usage{ screen_cvtrunc.lasso(x, y, k.trunc = 5) } \arguments{ \item{x}{Predictor matrix.} \item{y}...
/man/screen_cvtrunc.lasso.Rd
no_license
FrankD/NetHet_old
R
false
false
798
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/diffregr.R \name{screen_cvtrunc.lasso} \alias{screen_cvtrunc.lasso} \title{Cross-validated Lasso screening and additional truncation.} \usage{ screen_cvtrunc.lasso(x, y, k.trunc = 5) } \arguments{ \item{x}{Predictor matrix.} \item{y}...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{getPgtrajWithInfo} \alias{getPgtrajWithInfo} \title{Get pgtraj with infolocs as a data frame (used in pgtraj2ltraj)} \usage{ getPgtrajWithInfo(conn, pgtraj, schema) } \arguments{ \item{conn}{A PostgreSQL connection object.} \it...
/man/getPgtrajWithInfo.Rd
no_license
mablab/rpostgisLT
R
false
true
572
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{getPgtrajWithInfo} \alias{getPgtrajWithInfo} \title{Get pgtraj with infolocs as a data frame (used in pgtraj2ltraj)} \usage{ getPgtrajWithInfo(conn, pgtraj, schema) } \arguments{ \item{conn}{A PostgreSQL connection object.} \it...
library(dplyr) library(ggplot2) #read data NEI <- readRDS(".\\Data\\summarySCC_PM25.rds") SCC <- readRDS(".\\Data\\Source_Classification_Code.rds") #creating dataset with data to be plotted motorVehSources <- SCC[apply(SCC, 1, function(i){any(grepl("[Vv][Ee][Hh]" ...
/Scripts/plot6.R
no_license
TheMrCSC/EDA-FinalProject
R
false
false
1,089
r
library(dplyr) library(ggplot2) #read data NEI <- readRDS(".\\Data\\summarySCC_PM25.rds") SCC <- readRDS(".\\Data\\Source_Classification_Code.rds") #creating dataset with data to be plotted motorVehSources <- SCC[apply(SCC, 1, function(i){any(grepl("[Vv][Ee][Hh]" ...
library(shiny) library(rsconnect) library(tidyverse) library(ggtext) library(paletteer) library(lubridate) library(forcats) data <- read.csv("LAExcess.csv") excess <- read.csv("LAExcessSummary.csv") daydata <- read.csv("LACases.csv") maxweek.ew <- max(subset(data, country!="Scotland" & !is.na(COVID.20))$week) enddate...
/server.R
no_license
fcorowe/COVID_LA_Plots
R
false
false
7,919
r
library(shiny) library(rsconnect) library(tidyverse) library(ggtext) library(paletteer) library(lubridate) library(forcats) data <- read.csv("LAExcess.csv") excess <- read.csv("LAExcessSummary.csv") daydata <- read.csv("LACases.csv") maxweek.ew <- max(subset(data, country!="Scotland" & !is.na(COVID.20))$week) enddate...
### Phylogenetic Specialization ~ Quantitative Specialization #### m1=glm(DSI~H2, family="quasibinomial", data=com_data) plot(com_data$DSI~com_data$H2, pch=16, ylab="Phylogenetic Specialization (DSI)", xlab="Quantitative Specialization (H2')") curve((exp(m1$coefficients[1]+m1$coefficients[2]*x))/(1+(exp(m1$coefficients...
/script5_plots.R
permissive
pinheirorbp/LSG_malaria-parasites-birds_SA
R
false
false
5,975
r
### Phylogenetic Specialization ~ Quantitative Specialization #### m1=glm(DSI~H2, family="quasibinomial", data=com_data) plot(com_data$DSI~com_data$H2, pch=16, ylab="Phylogenetic Specialization (DSI)", xlab="Quantitative Specialization (H2')") curve((exp(m1$coefficients[1]+m1$coefficients[2]*x))/(1+(exp(m1$coefficients...
#' Convert to SRVF space #' #' This function converts curves to SRVF #' #' @param beta array describing curve (n,T) #' @return q array describing srvf #' @keywords srvf alignment #' @references Srivastava, A., Klassen, E., Joshi, S., Jermyn, I., (2011). Shape analysis of elastic curves in euclidean spaces. Pattern Anal...
/R/curve_to_q.R
no_license
SrishtiSehgal/fdasrvf_R
R
false
false
836
r
#' Convert to SRVF space #' #' This function converts curves to SRVF #' #' @param beta array describing curve (n,T) #' @return q array describing srvf #' @keywords srvf alignment #' @references Srivastava, A., Klassen, E., Joshi, S., Jermyn, I., (2011). Shape analysis of elastic curves in euclidean spaces. Pattern Anal...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/umx_build_polychoricMatrix3.R \name{umx_polytriowise} \alias{umx_polytriowise} \title{FIML-based trio-based polychoric, polyserial, and Pearson correlations} \usage{ umx_polytriowise( data, useDeviations = TRUE, printFit = FALSE, use ...
/man/umx_polytriowise.Rd
no_license
MATA62N/umx
R
false
true
1,852
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/umx_build_polychoricMatrix3.R \name{umx_polytriowise} \alias{umx_polytriowise} \title{FIML-based trio-based polychoric, polyserial, and Pearson correlations} \usage{ umx_polytriowise( data, useDeviations = TRUE, printFit = FALSE, use ...
# Copyright 2017 Observational Health Data Sciences and Informatics # # This file is part of PatientLevelPrediction # # 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.o...
/tests/testthat/test-formatting.R
permissive
julianflowers/PatientLevelPrediction
R
false
false
19,587
r
# Copyright 2017 Observational Health Data Sciences and Informatics # # This file is part of PatientLevelPrediction # # 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.o...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data_handling.R \name{collate_run} \alias{collate_run} \title{Collate Vortex .run output files} \usage{ collate_run( project, scenario, npops = 1, dir_in = NULL, save2disk = TRUE, dir_out = "ProcessedData", verbose ...
/man/collate_run.Rd
no_license
cran/vortexR
R
false
true
1,920
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data_handling.R \name{collate_run} \alias{collate_run} \title{Collate Vortex .run output files} \usage{ collate_run( project, scenario, npops = 1, dir_in = NULL, save2disk = TRUE, dir_out = "ProcessedData", verbose ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/env.R \name{env_is_user_facing} \alias{env_is_user_facing} \title{Is frame environment user facing?} \usage{ env_is_user_facing(env) } \arguments{ \item{env}{An environment.} } \description{ Detects if \code{env} is user-facing, that is, whet...
/man/env_is_user_facing.Rd
permissive
r-lib/rlang
R
false
true
1,543
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/env.R \name{env_is_user_facing} \alias{env_is_user_facing} \title{Is frame environment user facing?} \usage{ env_is_user_facing(env) } \arguments{ \item{env}{An environment.} } \description{ Detects if \code{env} is user-facing, that is, whet...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/s3_operations.R \name{s3_upload_part} \alias{s3_upload_part} \title{Uploads a part in a multipart upload} \usage{ s3_upload_part(Body, Bucket, ContentLength, ContentMD5, Key, PartNumber, UploadId, SSECustomerAlgorithm, SSECustomerKey, SSECu...
/cran/paws.storage/man/s3_upload_part.Rd
permissive
ryanb8/paws
R
false
true
6,782
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/s3_operations.R \name{s3_upload_part} \alias{s3_upload_part} \title{Uploads a part in a multipart upload} \usage{ s3_upload_part(Body, Bucket, ContentLength, ContentMD5, Key, PartNumber, UploadId, SSECustomerAlgorithm, SSECustomerKey, SSECu...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Functions.R \name{spp261} \alias{spp261} \title{species function} \usage{ spp261(a, b, c, d, e) } \arguments{ \item{a}{environmental parameter} \item{b}{environmental parameter} \item{c}{environmental parameter} \item{d}{environmental para...
/man/spp261.Rd
permissive
Djeppschmidt/Model.Microbiome
R
false
true
456
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Functions.R \name{spp261} \alias{spp261} \title{species function} \usage{ spp261(a, b, c, d, e) } \arguments{ \item{a}{environmental parameter} \item{b}{environmental parameter} \item{c}{environmental parameter} \item{d}{environmental para...
% Generated by roxygen2 (4.0.0): do not edit by hand \name{detachHTML} \alias{detachHTML} \title{Detach Common, Non-Masking HTML Functions} \usage{ detachHTML() } \description{ DEPRECATED: Please use the \code{\link{html}} function to generate HTML. }
/man/detachHTML.Rd
no_license
dpastoor/Kmisc
R
false
false
253
rd
% Generated by roxygen2 (4.0.0): do not edit by hand \name{detachHTML} \alias{detachHTML} \title{Detach Common, Non-Masking HTML Functions} \usage{ detachHTML() } \description{ DEPRECATED: Please use the \code{\link{html}} function to generate HTML. }
# Exercise 4: functions and conditionals # Define a function `is_twice_as_long` that takes in two character strings, and # returns whether or not (e.g., a boolean) the length of one argument is greater # than or equal to twice the length of the other. # Hint: compare the length difference to the length of the smaller ...
/exercise-4/exercise.R
permissive
Leo3418/ch6-functions
R
false
false
1,960
r
# Exercise 4: functions and conditionals # Define a function `is_twice_as_long` that takes in two character strings, and # returns whether or not (e.g., a boolean) the length of one argument is greater # than or equal to twice the length of the other. # Hint: compare the length difference to the length of the smaller ...
library(tidyverse) library(rpart) library(rpart.plot) # Data data <- structure( list( edad = c(18L, 20L, 25L, 40L, 45L, 30L, 24L, 22L, 50L, 21L, 33L, 22L, 45L), salario = c("15000", "18000", "17000", "18000", "50000", "40000", "16000", "30000", "15000", "25000", "10000", "5000", "15000"), ...
/content/post/data/nota_random_forest/ejemplo_acr.R
no_license
Johan-rosa/blog-johan
R
false
false
2,364
r
library(tidyverse) library(rpart) library(rpart.plot) # Data data <- structure( list( edad = c(18L, 20L, 25L, 40L, 45L, 30L, 24L, 22L, 50L, 21L, 33L, 22L, 45L), salario = c("15000", "18000", "17000", "18000", "50000", "40000", "16000", "30000", "15000", "25000", "10000", "5000", "15000"), ...
testlist <- list(vec = NULL, prob_vec = c(8.62326039553513e-308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) result <- do.call(eive:::cga_generate_chromosome,testlist) str(result)
/eive/inst/testfiles/cga_generate_chromosome/AFL_cga_generate_chromosome/cga_generate_chromosome_valgrind_files/1609871620-test.R
no_license
akhikolla/updated-only-Issues
R
false
false
197
r
testlist <- list(vec = NULL, prob_vec = c(8.62326039553513e-308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) result <- do.call(eive:::cga_generate_chromosome,testlist) str(result)
#' Convert degrees Fahrenheit to degrees Celsius #' #' @param df Temperature in degrees Fahrenheit #' #' @return Temperature in degrees Celsius #' @export #' #' @examples #' fahrenheit_to_celsius(32) #' fahrenheit_to_celsius(212) fahrenheit_to_celsius = function(df) { (df - 32) * 5 / 9 }
/R/fahrenheit_to_celsius.R
permissive
A10theHero/myunits
R
false
false
291
r
#' Convert degrees Fahrenheit to degrees Celsius #' #' @param df Temperature in degrees Fahrenheit #' #' @return Temperature in degrees Celsius #' @export #' #' @examples #' fahrenheit_to_celsius(32) #' fahrenheit_to_celsius(212) fahrenheit_to_celsius = function(df) { (df - 32) * 5 / 9 }
library(ggplot2) library(tidyverse) Litterfall <- read_csv("Data/Litterfall.csv") dataset <- Litterfall ui <- fluidPage( title = "Litterfall Plot Explorer", plotOutput('plot'), hr(), fluidRow(column(2, h4("Litterfall Plot Explorer"), sliderInput("Year", "Year Range:", ...
/Tests_Emily/Emily Bivariate.R
no_license
jpgannon/EI-Capstone-21-Litter
R
false
false
1,441
r
library(ggplot2) library(tidyverse) Litterfall <- read_csv("Data/Litterfall.csv") dataset <- Litterfall ui <- fluidPage( title = "Litterfall Plot Explorer", plotOutput('plot'), hr(), fluidRow(column(2, h4("Litterfall Plot Explorer"), sliderInput("Year", "Year Range:", ...
# modified from the python library faker: # https://github.com/joke2k/faker/blob/master/faker/providers/job/__init__.py job_formats_en_us = c( "Academic librarian", "Accommodation manager", "Accountant, chartered", "Accountant, chartered certified", "Accountant, chartered management", "Accountant, chartere...
/R/jobs-provider-en_US.R
permissive
ropensci/charlatan
R
false
false
17,275
r
# modified from the python library faker: # https://github.com/joke2k/faker/blob/master/faker/providers/job/__init__.py job_formats_en_us = c( "Academic librarian", "Accommodation manager", "Accountant, chartered", "Accountant, chartered certified", "Accountant, chartered management", "Accountant, chartere...
#' Obtain the intervals formed by the best candidates every day to be considered as time and sleeping in bed #' #' For each day of accelerometry recorded choose an interval as best candidate to be considered as interval in bed, and inside of it, mark another interval as time from first sleep to awake before going out o...
/R/intervalReposo.R
no_license
muschellij2/rbouts
R
false
false
1,448
r
#' Obtain the intervals formed by the best candidates every day to be considered as time and sleeping in bed #' #' For each day of accelerometry recorded choose an interval as best candidate to be considered as interval in bed, and inside of it, mark another interval as time from first sleep to awake before going out o...
require("phytools") require("phangorn") #STOLEN FROM http://blog.phytools.org/2012/02/mrca-for-set-of-taxa.html oldest.mrca<-function(tree,tips){ H<-nodeHeights(tree) X<-mrca(tree) n<-length(tips) nodes<-height<-vector(); k<-1 for(i in 1:(n-1)) for(j in (i+1):n){ nodes[k]<-X[tips[i],tips[j]] ...
/pigs.r
no_license
Schraiber/pigs
R
false
false
2,445
r
require("phytools") require("phangorn") #STOLEN FROM http://blog.phytools.org/2012/02/mrca-for-set-of-taxa.html oldest.mrca<-function(tree,tips){ H<-nodeHeights(tree) X<-mrca(tree) n<-length(tips) nodes<-height<-vector(); k<-1 for(i in 1:(n-1)) for(j in (i+1):n){ nodes[k]<-X[tips[i],tips[j]] ...
#-------------------------------------------------- # Master DSF - Fundamentos Algebra # Autovalores y autovectores # Descomposici?n Espectral #-------------------------------------------------- A <- matrix(c(8, -2, -3, -2, 11, 4, -3, 4, 5),3,3) A #-------------------------------------------------- # Descomposici?n E...
/Fundamentos_de_DS/Practica Semana 1/Algebra_Practica_9.R
no_license
octadelsueldo/Master_DS_CUNEF
R
false
false
2,613
r
#-------------------------------------------------- # Master DSF - Fundamentos Algebra # Autovalores y autovectores # Descomposici?n Espectral #-------------------------------------------------- A <- matrix(c(8, -2, -3, -2, 11, 4, -3, 4, 5),3,3) A #-------------------------------------------------- # Descomposici?n E...
ggplot(full[1:891,], aes(x = Pclass, y=(sum(Survived==1)/sum(Survived)))) + geom_point() # geom_bar(stat='count', position='dodge') + # scale_x_continuous(breaks=c(1:11)) + # ggtitle("Family size Vs Survived") + # labs(x = 'Family Size') + # geom_label(stat='count',aes(label=..count..)) + scale_fill_discrete(name ...
/r_project_drago/draft.R
no_license
drago1234/2020Spring_STAT3302_Final_Project
R
false
false
1,648
r
ggplot(full[1:891,], aes(x = Pclass, y=(sum(Survived==1)/sum(Survived)))) + geom_point() # geom_bar(stat='count', position='dodge') + # scale_x_continuous(breaks=c(1:11)) + # ggtitle("Family size Vs Survived") + # labs(x = 'Family Size') + # geom_label(stat='count',aes(label=..count..)) + scale_fill_discrete(name ...
#atomic vectors Vector() vector("character", length=5) character(5) vector("numeric", length=5) numeric(5) vector("logical", length=5) logical(5) # same out put but different ways^| #create vectors by directly specifying their content a= c(2,4,6,8,10,12) a typeof(a) x = c(1,2,3) typeof(x) x x1= c(2L,3L,4L) x1 t...
/class_D5_work.R
no_license
vishnusagar2021/D5_notes
R
false
false
3,050
r
#atomic vectors Vector() vector("character", length=5) character(5) vector("numeric", length=5) numeric(5) vector("logical", length=5) logical(5) # same out put but different ways^| #create vectors by directly specifying their content a= c(2,4,6,8,10,12) a typeof(a) x = c(1,2,3) typeof(x) x x1= c(2L,3L,4L) x1 t...
#scratch space #rerun with increasing df size, see how run time scales #to see parallelization needed time_df <- tibble() for(i in c(100, 500, 1000, 5000, 10000)) { start_time <- Sys.time() gf_subset <- gf_reaches[1:i,] reaches_bounded <- gf_subset %>% mutate( end_points = lapply(seg_id, function(segid) { ...
/6_network/src/scaling.R
no_license
USGS-R/2wp-temp-observations
R
false
false
3,498
r
#scratch space #rerun with increasing df size, see how run time scales #to see parallelization needed time_df <- tibble() for(i in c(100, 500, 1000, 5000, 10000)) { start_time <- Sys.time() gf_subset <- gf_reaches[1:i,] reaches_bounded <- gf_subset %>% mutate( end_points = lapply(seg_id, function(segid) { ...