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
#' Round date-times down. #' #' floor_date takes a date-time object and rounds it down to the nearest integer #' value of the specified time unit. Users can specify whether to round down to #' the nearest second, minute, hour, day, week, month, or year. #' #' @export floor_date #' @param x a vector of date-time objec...
/R/round.r
no_license
Vald/lubridate
R
false
false
4,985
r
#' Round date-times down. #' #' floor_date takes a date-time object and rounds it down to the nearest integer #' value of the specified time unit. Users can specify whether to round down to #' the nearest second, minute, hour, day, week, month, or year. #' #' @export floor_date #' @param x a vector of date-time objec...
# # RUnit tests TTR moving averages # # test reclass works and throws error # test xtsAttributes, both CLASS and USER # test all.equal(CLASS) and !all.equal(CLASS) cases # Create input data data(ttrc) rownames(ttrc) <- ttrc$Date ttrc$Date <- NULL iAll <- as.matrix(ttrc[1:250,]) iTop <- iAll; iTop[1:10,] <- NA iMid <...
/lib/stockquote/downloads/TTR/tests/unitTests/runit.TTR.Trend.R
no_license
neophytos-sk/phigita-star
R
false
false
3,574
r
# # RUnit tests TTR moving averages # # test reclass works and throws error # test xtsAttributes, both CLASS and USER # test all.equal(CLASS) and !all.equal(CLASS) cases # Create input data data(ttrc) rownames(ttrc) <- ttrc$Date ttrc$Date <- NULL iAll <- as.matrix(ttrc[1:250,]) iTop <- iAll; iTop[1:10,] <- NA iMid <...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{ppiTZA2016} \alias{ppiTZA2016} \title{ppiTZA2016} \format{A data frame with 19 columns and 101 rows: \describe{ \item{\code{score}}{PPI score} \item{\code{nlFood}}{Food poverty line} \item{\code{nl100}}{National po...
/man/ppiTZA2016.Rd
permissive
BanuPriyaNaidu91/ppitables
R
false
true
2,201
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{ppiTZA2016} \alias{ppiTZA2016} \title{ppiTZA2016} \format{A data frame with 19 columns and 101 rows: \describe{ \item{\code{score}}{PPI score} \item{\code{nlFood}}{Food poverty line} \item{\code{nl100}}{National po...
#' Get a named vector of vader results for a single text document #' #' Use get_vader() to calculate the valence of a single text document. #' #' @param text to be analyzed; for get_vader(), the text should be a character string #' @param incl_nt defaults to T, indicates whether you wish to incl n't contractions (e.g.,...
/R/vader_main_call.R
no_license
krgitcode/vader
R
false
false
2,447
r
#' Get a named vector of vader results for a single text document #' #' Use get_vader() to calculate the valence of a single text document. #' #' @param text to be analyzed; for get_vader(), the text should be a character string #' @param incl_nt defaults to T, indicates whether you wish to incl n't contractions (e.g.,...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/init.R \name{initFFFMean} \alias{initFFFMean} \title{Initialisation of FFF} \usage{ initFFFMean(lambda = 1) } \arguments{ \item{lambda}{The value of the fixed forgetting factor. Default is lambda=1.} } \description{ This function makes it si...
/ffstream/man/initFFFMean.Rd
no_license
akhikolla/InformationHouse
R
false
true
499
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/init.R \name{initFFFMean} \alias{initFFFMean} \title{Initialisation of FFF} \usage{ initFFFMean(lambda = 1) } \arguments{ \item{lambda}{The value of the fixed forgetting factor. Default is lambda=1.} } \description{ This function makes it si...
library(methods) library(docopt) library(latticeExtra) 'Usage: fertility_performance_single.R [options] Options: --variant (level | distn) [default: level] ' -> doc opts <- docopt(doc) variant <- opts$variant perform <- readRDS("out/perform.rds") perform <- subset(perform, subset = !(measure...
/src/fertility_performance_single.R
permissive
bayesiandemography/fertsim
R
false
false
2,143
r
library(methods) library(docopt) library(latticeExtra) 'Usage: fertility_performance_single.R [options] Options: --variant (level | distn) [default: level] ' -> doc opts <- docopt(doc) variant <- opts$variant perform <- readRDS("out/perform.rds") perform <- subset(perform, subset = !(measure...
library(shiny) library(simpleaffy) library(affy) library(ggplot2) options(shiny.maxRequestSize = 100*1024^2) server <- function(input, output, session) { #variables medians <- NULL id.ref <- NULL # REACTIVE VALUES —------------------------------------------------— rvalues <- reactiveValues() r...
/Affy_analisia/server.R
no_license
Urkidi/BioR
R
false
false
5,595
r
library(shiny) library(simpleaffy) library(affy) library(ggplot2) options(shiny.maxRequestSize = 100*1024^2) server <- function(input, output, session) { #variables medians <- NULL id.ref <- NULL # REACTIVE VALUES —------------------------------------------------— rvalues <- reactiveValues() r...
# Matrix inversion is usually a costly computation and there may be some benefit # to caching the inverse of a matrix rather than compute it repeatedly. The # following two functions are used to cache the inverse of a matrix. # makeCacheMatrix creates a list containing a function to makeCacheMatrix <- function(x = ma...
/cachematrix.R
no_license
prasanth850/ProgrammingAssignment2
R
false
false
1,648
r
# Matrix inversion is usually a costly computation and there may be some benefit # to caching the inverse of a matrix rather than compute it repeatedly. The # following two functions are used to cache the inverse of a matrix. # makeCacheMatrix creates a list containing a function to makeCacheMatrix <- function(x = ma...
# Copyright 2021 Environment and Climate Change Canada # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
/R/fit-burrlioz.R
permissive
beckyfisher/ssdtools
R
false
false
2,926
r
# Copyright 2021 Environment and Climate Change Canada # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # ~~~~ TWITTER CONFERENCES ~~~~ # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # #### initial set-up #### # clear the environment and set working directory rm(list=ls()) # load libraries library(CoordinateCleaner) library(sp) #### parameters #### # source: http://www.tweetfarts.com/ tweet_CO2 ...
/emissions/emissions_analysis_final.R
permissive
arcaravaggi/2021_twitter_conferences_ibis
R
false
false
6,583
r
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # ~~~~ TWITTER CONFERENCES ~~~~ # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # #### initial set-up #### # clear the environment and set working directory rm(list=ls()) # load libraries library(CoordinateCleaner) library(sp) #### parameters #### # source: http://www.tweetfarts.com/ tweet_CO2 ...
testlist <- list(doy = -1.72131968218895e+83, latitude = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), temp = c(8.5728629954997e-312, 1.56898424065867e+82, 8.96970809549085e-158, -1.3258495253834e-113, 2.79620616433656e-119, -6.80033518839696e+41, 2.6...
/meteor/inst/testfiles/ET0_ThornthwaiteWilmott/AFL_ET0_ThornthwaiteWilmott/ET0_ThornthwaiteWilmott_valgrind_files/1615828574-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
734
r
testlist <- list(doy = -1.72131968218895e+83, latitude = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), temp = c(8.5728629954997e-312, 1.56898424065867e+82, 8.96970809549085e-158, -1.3258495253834e-113, 2.79620616433656e-119, -6.80033518839696e+41, 2.6...
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function makeCacheMatrix <- function(x = matrix()) { m <- NULL set <- function(y) { x <<- y m <<- NULL ##store a matrix in cache } get <- function() x ##get matrix setInverse <- ...
/cachematrix.R
no_license
ddarl4/datasciencecoursera
R
false
false
1,112
r
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function makeCacheMatrix <- function(x = matrix()) { m <- NULL set <- function(y) { x <<- y m <<- NULL ##store a matrix in cache } get <- function() x ##get matrix setInverse <- ...
################################################################################# # calculating treatment effects, regression effects and p-values; #' @export #' @import stats #' @import plotrix #' @import graphics meechua_eff.CI<-function(x,n,se.after){ #library(plotrix) e.mu<- x[,1]/100 treatment<- x[,...
/R/meechua_eff.CI.R
no_license
cran/regtomean
R
false
false
964
r
################################################################################# # calculating treatment effects, regression effects and p-values; #' @export #' @import stats #' @import plotrix #' @import graphics meechua_eff.CI<-function(x,n,se.after){ #library(plotrix) e.mu<- x[,1]/100 treatment<- x[,...
library(biomaRt) library(GenomicRanges) library(IRanges) library(Repitools) library(tidyverse) #loading the data, turning it into a dataframe data<- read.csv("DMRsPathologyTg4510.csv") #taking the chr:position column, and splitting it into Chr and position seqnames<-data$seqnames temp <- strsplit(seqnames, "...
/DMRannotation.R
no_license
Harry-Woolnough/PTYcode
R
false
false
3,190
r
library(biomaRt) library(GenomicRanges) library(IRanges) library(Repitools) library(tidyverse) #loading the data, turning it into a dataframe data<- read.csv("DMRsPathologyTg4510.csv") #taking the chr:position column, and splitting it into Chr and position seqnames<-data$seqnames temp <- strsplit(seqnames, "...
################################################ # Ranking hospitals in all states ################################################ # "rankall" takes two arguments: an outcome name (outcome) and a hospital ranking (num). # The function reads the "outcome-of-care-measures.csv" file and returns a 2-column data frame # ...
/rankall.R
no_license
Milen-Ivanov/rankhospital
R
false
false
1,734
r
################################################ # Ranking hospitals in all states ################################################ # "rankall" takes two arguments: an outcome name (outcome) and a hospital ranking (num). # The function reads the "outcome-of-care-measures.csv" file and returns a 2-column data frame # ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/predictSurvProb.cforest.R \name{pecCforest} \alias{pecCforest} \title{S3-wrapper function for cforest from the party package} \usage{ pecCforest(formula, data, ...) } \arguments{ \item{formula}{Passed on as is. See \code{cforest} of the \code...
/man/pecCforest.Rd
no_license
jinshuai886/pec
R
false
true
940
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/predictSurvProb.cforest.R \name{pecCforest} \alias{pecCforest} \title{S3-wrapper function for cforest from the party package} \usage{ pecCforest(formula, data, ...) } \arguments{ \item{formula}{Passed on as is. See \code{cforest} of the \code...
#' Simulation function used to estimate power #' @param design_result Output from the ANOVA_design function #' @param alpha_level Alpha level used to determine statistical significance #' @param correction Set a correction of violations of sphericity. This can be set to "none", "GG" Greenhouse-Geisser, and "HF" Huynh-F...
/R/ANOVA_power.R
permissive
crsh/Superpower
R
false
false
24,632
r
#' Simulation function used to estimate power #' @param design_result Output from the ANOVA_design function #' @param alpha_level Alpha level used to determine statistical significance #' @param correction Set a correction of violations of sphericity. This can be set to "none", "GG" Greenhouse-Geisser, and "HF" Huynh-F...
rot_mat_hyperplane <- function(alpha, i, j, n) { mat <- diag(n) mat[i,i] <- cos(alpha) mat[j,j] <- cos(alpha) mat[i,j] <- -sin(alpha) mat[j,i] <- sin(alpha) mat } rotate <- function(alpha, x) { n <- ncol(x) z <- 0 for (i in 1:(n-1)) for (j in (i+1):n) { z <- z + 1 x <- x %*% rot_mat_hyperplan...
/R/rotate.R
permissive
chroetz/poisrrr
R
false
false
1,576
r
rot_mat_hyperplane <- function(alpha, i, j, n) { mat <- diag(n) mat[i,i] <- cos(alpha) mat[j,j] <- cos(alpha) mat[i,j] <- -sin(alpha) mat[j,i] <- sin(alpha) mat } rotate <- function(alpha, x) { n <- ncol(x) z <- 0 for (i in 1:(n-1)) for (j in (i+1):n) { z <- z + 1 x <- x %*% rot_mat_hyperplan...
# R version 3.6.3 (2020-02-29) library(ggplot2) # ggplot2_3.3.3 library(reshape2) # reshape2_1.4.3 library(scales) # scales_1.1.1 #library(pracma) library(doParallel) # doParallel_1.0.16 iterators_1.0.8 foreach_1.4.3 library(deSolve) # deSolve_1.28 library(cowplot) # cowplot_0.9.4 library(magick) # magick_2.7.1 libra...
/model_figures_density_dependent.R
no_license
PierreQuevreux/model_synthesis_metacommunity
R
false
false
34,680
r
# R version 3.6.3 (2020-02-29) library(ggplot2) # ggplot2_3.3.3 library(reshape2) # reshape2_1.4.3 library(scales) # scales_1.1.1 #library(pracma) library(doParallel) # doParallel_1.0.16 iterators_1.0.8 foreach_1.4.3 library(deSolve) # deSolve_1.28 library(cowplot) # cowplot_0.9.4 library(magick) # magick_2.7.1 libra...
#Use a support vector machine to predict iris species library(caret) library(caTools) #Choose x and y x <- iris[,c("Sepal.Length","Sepal.Width","Petal.Length","Petal.Width")] y <- iris$Species #Pre-Compute CV folds so we can use the same ones for all models CV_Folds <- createMultiFolds(y, k = 10, times = 5) #Fit a L...
/caret.r
no_license
sskumar06/second_genome
R
false
false
1,147
r
#Use a support vector machine to predict iris species library(caret) library(caTools) #Choose x and y x <- iris[,c("Sepal.Length","Sepal.Width","Petal.Length","Petal.Width")] y <- iris$Species #Pre-Compute CV folds so we can use the same ones for all models CV_Folds <- createMultiFolds(y, k = 10, times = 5) #Fit a L...
library(utils) library(graphics) ##Download the data and unzip the file if (!file.exists("household_power_consumption.txt")){ URL<-"http://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" dataFile<-download.file(URL, destfile= "./ElectricData.zip" , method="curl") unzip(zipfile= "....
/plot2.R
no_license
soniasharma/ExData_Plotting1
R
false
false
1,422
r
library(utils) library(graphics) ##Download the data and unzip the file if (!file.exists("household_power_consumption.txt")){ URL<-"http://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" dataFile<-download.file(URL, destfile= "./ElectricData.zip" , method="curl") unzip(zipfile= "....
# Dependencies library(shiny) library(quantmod) library(tidyverse) library(lubridate) library(googlesheets4) library(DT) # Suspend any previous Google authorization gs4_deauth() # Import from Google Sheets raw <- read_sheet('https://docs.google.com/spreadsheets/d/1pMQ1PUSKw4Fd7f21yGokdLx1EuQtn2KAGvaGyrjNU...
/src/r/finance/investment/app.R
no_license
orri93/analysis
R
false
false
7,362
r
# Dependencies library(shiny) library(quantmod) library(tidyverse) library(lubridate) library(googlesheets4) library(DT) # Suspend any previous Google authorization gs4_deauth() # Import from Google Sheets raw <- read_sheet('https://docs.google.com/spreadsheets/d/1pMQ1PUSKw4Fd7f21yGokdLx1EuQtn2KAGvaGyrjNU...
\name{LMDC.select} \Rdversion{1.1} \alias{LMDC.select} \alias{LMDC.regre} \title{ Impact points selection of functional predictor and regression using local maxima distance correlation (LMDC)} \description{ LMDC.select function selects impact points of functional predictior using local maxima distance correlatio...
/man/LMDC.select.Rd
no_license
RomiMC/fda.usc
R
false
false
6,739
rd
\name{LMDC.select} \Rdversion{1.1} \alias{LMDC.select} \alias{LMDC.regre} \title{ Impact points selection of functional predictor and regression using local maxima distance correlation (LMDC)} \description{ LMDC.select function selects impact points of functional predictior using local maxima distance correlatio...
my_db <- src_sqlite('pratheeban_features.db')
/work_in_progress/compare_features/sql.R
no_license
ver228/work-in-progress
R
false
false
45
r
my_db <- src_sqlite('pratheeban_features.db')
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/foo.R \name{dens.plot} \alias{dens.plot} \title{Density plot for posterior samples} \usage{ dens.plot( object, param, component.beta = NULL, component.S = NULL, hist = TRUE, ... ) } \arguments{ \item{object}{an object of class 'Ba...
/man/dens.plot.Rd
no_license
cran/PrevMap
R
false
true
1,455
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/foo.R \name{dens.plot} \alias{dens.plot} \title{Density plot for posterior samples} \usage{ dens.plot( object, param, component.beta = NULL, component.S = NULL, hist = TRUE, ... ) } \arguments{ \item{object}{an object of class 'Ba...
#' --- #' title: "CAPM" #' author: "Juan Malaver" #' date: "6/3/2021" #' output: github_document #' --- #' #' This is an example data science analysis using the capital asset price model #' on S&P 500 stocks # Setup ------------------------------------------------------------------- library(tidyverse) library(lubrid...
/R/stocks.R
permissive
jmalaver-ecapital/Seminars-2021
R
false
false
1,936
r
#' --- #' title: "CAPM" #' author: "Juan Malaver" #' date: "6/3/2021" #' output: github_document #' --- #' #' This is an example data science analysis using the capital asset price model #' on S&P 500 stocks # Setup ------------------------------------------------------------------- library(tidyverse) library(lubrid...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/EPFR.r \name{fop.correl} \alias{fop.correl} \title{fop.correl} \usage{ fop.correl(x, y, n) } \arguments{ \item{x}{= a matrix/df with rows indexed by time and columns indexed by bins} \item{y}{= a matrix/data frame of returns of the same dime...
/man/fop.correl.Rd
no_license
Turnado-dx/EPFR
R
false
true
666
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/EPFR.r \name{fop.correl} \alias{fop.correl} \title{fop.correl} \usage{ fop.correl(x, y, n) } \arguments{ \item{x}{= a matrix/df with rows indexed by time and columns indexed by bins} \item{y}{= a matrix/data frame of returns of the same dime...
# Author: # Matt Sheerin / bobthegiraffemonkey # Write out 'bobthegiraffemonkey' # Have the outline as a graph # Make colour change spread through the graph # Animate the whole thing # Randomise and find a nice seed # Possibly, decide this wasn't the best use of my spare time # This will likely not adhere to the bes...
/main.R
permissive
bobthegiraffemonkey/btg_intro
R
false
false
2,156
r
# Author: # Matt Sheerin / bobthegiraffemonkey # Write out 'bobthegiraffemonkey' # Have the outline as a graph # Make colour change spread through the graph # Animate the whole thing # Randomise and find a nice seed # Possibly, decide this wasn't the best use of my spare time # This will likely not adhere to the bes...
# ================================================== # some shortcuts for computing similarities directly # ================================================== # similarities between nominal attributes, i.e nominal variables # this code could use some clean-up and harmonization :-) sim.att <- function(D, method = "chu...
/qlcMatrix/R/sim.R
no_license
ingted/R-Examples
R
false
false
8,525
r
# ================================================== # some shortcuts for computing similarities directly # ================================================== # similarities between nominal attributes, i.e nominal variables # this code could use some clean-up and harmonization :-) sim.att <- function(D, method = "chu...
mergeTCRtoSeurat <- function(seurat_object, tcr_df){ ## Merge with TCRab data with seurat-object metadata metadata_temp <- merge(seurat_object@meta.data, tcr_df, all.x = T, by.x = "barcode", by.y = "barcode_uniq") metadata_temp <- metadata_temp[match(colnames(seurat_object), metadata_temp$barcode), ] ## Add...
/R/helper/fun_helper.R
permissive
janihuuh/cd8_tlgll_manu
R
false
false
50,614
r
mergeTCRtoSeurat <- function(seurat_object, tcr_df){ ## Merge with TCRab data with seurat-object metadata metadata_temp <- merge(seurat_object@meta.data, tcr_df, all.x = T, by.x = "barcode", by.y = "barcode_uniq") metadata_temp <- metadata_temp[match(colnames(seurat_object), metadata_temp$barcode), ] ## Add...
tooth <- datasets::ToothGrowth str(tooth) library(ggplot2) #see summary of dataset by(tooth$len, INDICES = list(tooth$dose, tooth$supp), summary) #what is average tooth length grouped by supp, and dose avg <- with(tooth, tapply(len, supp, mean)) avgSupp <- data.frame(supp = names(avg), val = avg) avg <- with(tooth, ...
/week4-course-project/part2-toothGrowth.R
no_license
rachitkinger/stats
R
false
false
2,358
r
tooth <- datasets::ToothGrowth str(tooth) library(ggplot2) #see summary of dataset by(tooth$len, INDICES = list(tooth$dose, tooth$supp), summary) #what is average tooth length grouped by supp, and dose avg <- with(tooth, tapply(len, supp, mean)) avgSupp <- data.frame(supp = names(avg), val = avg) avg <- with(tooth, ...
centers <- read.csv("~/workspace-saga/bigjob/kmeans/centers.csv", header=F)
/examples/tests/kmenas.R
no_license
drelu/Pilot-Memory
R
false
false
76
r
centers <- read.csv("~/workspace-saga/bigjob/kmeans/centers.csv", header=F)
#' Power Law #' #' Plots power law fit #' #' @param graph iGraph object #' #' @examples #' \dontrun{ #' netDir <- make.netDir(OD_Sample) #' fit_power(netDir$gDir) #' } #' @export #' fit_power <- function(graph) { # calculate degree d <- degree(graph, mode = "all") dd <- degree.distribution(graph, mode = "all", c...
/R/PowerLaw.R
no_license
ropensci/skynet
R
false
false
1,415
r
#' Power Law #' #' Plots power law fit #' #' @param graph iGraph object #' #' @examples #' \dontrun{ #' netDir <- make.netDir(OD_Sample) #' fit_power(netDir$gDir) #' } #' @export #' fit_power <- function(graph) { # calculate degree d <- degree(graph, mode = "all") dd <- degree.distribution(graph, mode = "all", c...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/test_models.R \name{test_models} \alias{test_models} \title{Test model fit on models prepared with qpcrpal::model_qpcr(), based on qpcR::mselect().} \usage{ test_models(models, targetID = 4, published = TRUE) } \arguments{ \item{models}{a lis...
/man/test_models.Rd
no_license
dhammarstrom/qpcrpal
R
false
true
783
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/test_models.R \name{test_models} \alias{test_models} \title{Test model fit on models prepared with qpcrpal::model_qpcr(), based on qpcR::mselect().} \usage{ test_models(models, targetID = 4, published = TRUE) } \arguments{ \item{models}{a lis...
## ## Function for creating 'NNOC' objects nnoc <- function(G, h){ return(list(conType = "NNOC", G = as.matrix(G), h = as.matrix(h), dims = nrow(G))) }
/R/nnoc.R
no_license
bpfaff/cccp
R
false
false
157
r
## ## Function for creating 'NNOC' objects nnoc <- function(G, h){ return(list(conType = "NNOC", G = as.matrix(G), h = as.matrix(h), dims = nrow(G))) }
library(data.table) data = fread("CaliforniaModule3NN_AssignedSchoolCounty.csv") Ages = 5:24 results = matrix(data = NA, nrow = 21, ncol = 10) colnames(results) = c("publicCount", "privateCount", "total_LowerSchool", "fourYearCount", "twoYearCount", "nonDegCount", "totalPostSecondary", "totalStudents", "totalNonStudent...
/model/module3/Script_SchoolByAge.R
no_license
kyletm/trip_generator
R
false
false
1,622
r
library(data.table) data = fread("CaliforniaModule3NN_AssignedSchoolCounty.csv") Ages = 5:24 results = matrix(data = NA, nrow = 21, ncol = 10) colnames(results) = c("publicCount", "privateCount", "total_LowerSchool", "fourYearCount", "twoYearCount", "nonDegCount", "totalPostSecondary", "totalStudents", "totalNonStudent...
#' metropolis #' #' Implementation of metropolis function, p. 359. #' #' @usage metropolis(theta.matrix,reps,I.mat) #' #' @param theta.matrix theta.matrix #' @param reps reps #' @param I.mat I.mat #' #' @author Jeff Gill #' @importFrom stats runif rchisq #' @importFrom MASS mvrnorm #' @export metropolis <- function...
/R/metropolis.R
no_license
cran/BaM
R
false
false
740
r
#' metropolis #' #' Implementation of metropolis function, p. 359. #' #' @usage metropolis(theta.matrix,reps,I.mat) #' #' @param theta.matrix theta.matrix #' @param reps reps #' @param I.mat I.mat #' #' @author Jeff Gill #' @importFrom stats runif rchisq #' @importFrom MASS mvrnorm #' @export metropolis <- function...
## this code trains all full models used in experiments source("drifter.R") source("init.R") output_dir <- "models" datapath <- "../data" ## ----------------------------------------------------------------------------- ## Get command-line arguments ## --------------------------------------------------------------...
/TiittanenOHP2019-code/experiments/train_models.R
permissive
edahelsinki/drifter
R
false
false
1,261
r
## this code trains all full models used in experiments source("drifter.R") source("init.R") output_dir <- "models" datapath <- "../data" ## ----------------------------------------------------------------------------- ## Get command-line arguments ## --------------------------------------------------------------...
library(Boom) ### Name: replist ### Title: Repeated Lists of Objects ### Aliases: RepList ### ** Examples alist <- list(x = "foo", y = 12, z = c(1:3)) three.copies <- RepList(alist, 3)
/data/genthat_extracted_code/Boom/examples/replist.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
196
r
library(Boom) ### Name: replist ### Title: Repeated Lists of Objects ### Aliases: RepList ### ** Examples alist <- list(x = "foo", y = 12, z = c(1:3)) three.copies <- RepList(alist, 3)
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/logging.R \name{log_message} \alias{log_message} \title{Add a message in the pupil preprocessing log} \usage{ log_message(log, message) } \arguments{ \item{log}{A variable containing the pupil preprocessing log, created with \code{create_log}...
/man/log_message.Rd
no_license
WillemSleegers/eyepatch
R
false
true
536
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/logging.R \name{log_message} \alias{log_message} \title{Add a message in the pupil preprocessing log} \usage{ log_message(log, message) } \arguments{ \item{log}{A variable containing the pupil preprocessing log, created with \code{create_log}...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/cindex.R \name{cindex} \alias{cindex} \title{Concordance index for right censored survival time data} \usage{ cindex(object, formula, data, eval.times, pred.times, cause, lyl = FALSE, cens.model = "marginal", ipcw.refit = FALSE, ipcw.args =...
/man/cindex.Rd
no_license
dzhang198707/pec-1
R
false
true
12,039
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/cindex.R \name{cindex} \alias{cindex} \title{Concordance index for right censored survival time data} \usage{ cindex(object, formula, data, eval.times, pred.times, cause, lyl = FALSE, cens.model = "marginal", ipcw.refit = FALSE, ipcw.args =...
library(dplyr) library(ggplot2) library(plotly) #################################################### # # # EXPORTED FUNCTIONS (A-Z # # # #################################################### #' ques...
/R/question-1a-003-charts-latitude-longitude.R
no_license
s1888637/weathr
R
false
false
2,618
r
library(dplyr) library(ggplot2) library(plotly) #################################################### # # # EXPORTED FUNCTIONS (A-Z # # # #################################################### #' ques...
# import wide form data health <- read.csv("health_spending_per_capita_02-17.csv", stringsAsFactors = FALSE) # reshape to long form health_long_temp <- gather(data = health, key = year, value = healthexp, X2002:X2017, factor_key = FALSE) # clean up year column health_long <- health_long_temp %>% mutate(year = as....
/Lectures/Lecture4/reshape_healthexp.r
no_license
andreaslichtenberger/U6614
R
false
false
547
r
# import wide form data health <- read.csv("health_spending_per_capita_02-17.csv", stringsAsFactors = FALSE) # reshape to long form health_long_temp <- gather(data = health, key = year, value = healthexp, X2002:X2017, factor_key = FALSE) # clean up year column health_long <- health_long_temp %>% mutate(year = as....
"plot.restscore.class" <- function(x, item.pairs = all.pairs, plot.ci = TRUE, color.ci = c("orange","yellow"), alpha.ci = .05, ask = TRUE, ...){ cn2n <- function(y) c(rev(diff(rev(y))),y[length(y)]) up.lo.bound.ISRF <- function(n,alpha=.05){ n[n < 1e-10] <- 1e-10 n <- matrix(n) p <- length(n) A1 ...
/mokken/R/plot.restscore.class.R
no_license
ingted/R-Examples
R
false
false
3,539
r
"plot.restscore.class" <- function(x, item.pairs = all.pairs, plot.ci = TRUE, color.ci = c("orange","yellow"), alpha.ci = .05, ask = TRUE, ...){ cn2n <- function(y) c(rev(diff(rev(y))),y[length(y)]) up.lo.bound.ISRF <- function(n,alpha=.05){ n[n < 1e-10] <- 1e-10 n <- matrix(n) p <- length(n) A1 ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/vision_core.R \name{ToTensor} \alias{ToTensor} \title{ToTensor} \usage{ ToTensor(enc = NULL, dec = NULL, split_idx = NULL, order = NULL) } \arguments{ \item{enc}{encoder} \item{dec}{decoder} \item{split_idx}{int, split by index} \item{orde...
/man/ToTensor.Rd
permissive
Cdk29/fastai
R
false
true
404
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/vision_core.R \name{ToTensor} \alias{ToTensor} \title{ToTensor} \usage{ ToTensor(enc = NULL, dec = NULL, split_idx = NULL, order = NULL) } \arguments{ \item{enc}{encoder} \item{dec}{decoder} \item{split_idx}{int, split by index} \item{orde...
## Matrix inversion is usually a costly computation and there may be some benefit ## to caching the inverse of a matrix rather than computing it repeatedly. The ## functions written below help to cache the inverse of a matrix. ## The function makeCacheMatrix contains a list of functions that:- ## 1.Set the value of t...
/cachematrix.R
no_license
pantanurag555/ProgrammingAssignment2
R
false
false
1,233
r
## Matrix inversion is usually a costly computation and there may be some benefit ## to caching the inverse of a matrix rather than computing it repeatedly. The ## functions written below help to cache the inverse of a matrix. ## The function makeCacheMatrix contains a list of functions that:- ## 1.Set the value of t...
# extract and post the data (dropping the site info attribute), creating an # .ind file that we will want to share because it represents the shared cache combine_nwis_data <- function(ind_file, ...){ rds_files <- c(...) df_list <- list() message('reading in partition files...') for (i in seq_len(length(rds_f...
/10_nwis_pull/src/nwis_combine_functions.R
no_license
wdwatkins/national-flow-observations
R
false
false
2,565
r
# extract and post the data (dropping the site info attribute), creating an # .ind file that we will want to share because it represents the shared cache combine_nwis_data <- function(ind_file, ...){ rds_files <- c(...) df_list <- list() message('reading in partition files...') for (i in seq_len(length(rds_f...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/lakes.R \docType{data} \name{exampleElev} \alias{exampleElev} \title{Elevation Data for \code{lakemorpho} examples} \format{ RasterLayer of 1094 x 1419 and 30 meter resolution } \description{ This example data is a RasterLayer of a small subs...
/man/exampleElev.Rd
no_license
jhollist/lakemorpho
R
false
true
398
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/lakes.R \docType{data} \name{exampleElev} \alias{exampleElev} \title{Elevation Data for \code{lakemorpho} examples} \format{ RasterLayer of 1094 x 1419 and 30 meter resolution } \description{ This example data is a RasterLayer of a small subs...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/render.R \name{report_html} \alias{report_html} \title{Render NIBSC HTML report} \usage{ report_html(...) } \arguments{ \item{...}{Arguments to be passed to the function `[bookdown::html_document2]`} } \value{ A modified `html_document2` with...
/man/report_html.Rd
permissive
nibscbioinformatics/nibscdoc
R
false
true
584
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/render.R \name{report_html} \alias{report_html} \title{Render NIBSC HTML report} \usage{ report_html(...) } \arguments{ \item{...}{Arguments to be passed to the function `[bookdown::html_document2]`} } \value{ A modified `html_document2` with...
#' Multiple Metrics #' #' Provides a way to create a list of metrics/scoring functions/performance measures from a parametrized function like the Tweedie deviance or the elementary scoring functions for expectiles. #' #' @importFrom stats setNames #' @param fun A metric/scoring function/performance measure with additio...
/release/MetricsWeighted/R/multi_metric.R
no_license
JosepER/MetricsWeighted
R
false
false
2,105
r
#' Multiple Metrics #' #' Provides a way to create a list of metrics/scoring functions/performance measures from a parametrized function like the Tweedie deviance or the elementary scoring functions for expectiles. #' #' @importFrom stats setNames #' @param fun A metric/scoring function/performance measure with additio...
library(SuperLearner) ### Name: create.SL.xgboost ### Title: Factory for XGBoost SL wrappers ### Aliases: create.SL.xgboost ### ** Examples # Create a new environment to store the learner functions. # This keeps the global environment organized. sl_env = new.env() # Create 2 * 2 * 1 * 3 = 12 combinations of hyperp...
/data/genthat_extracted_code/SuperLearner/examples/create.SL.xgboost.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
812
r
library(SuperLearner) ### Name: create.SL.xgboost ### Title: Factory for XGBoost SL wrappers ### Aliases: create.SL.xgboost ### ** Examples # Create a new environment to store the learner functions. # This keeps the global environment organized. sl_env = new.env() # Create 2 * 2 * 1 * 3 = 12 combinations of hyperp...
library(dplyr) library(DT) library(esacounties) library(geojsonio) library(highcharter) library(leaflet) library(maptools) library(plotly) library(rgdal) library(treemap) library(shinydashboard) library(shinyjs) library(viridis) num_es <- nrow(filter(TECP_domestic, Federal_Listing_Status == "Endangered")) num_th <- nr...
/inst/listings-summary/global.R
no_license
jacob-ogre/esasummary
R
false
false
1,657
r
library(dplyr) library(DT) library(esacounties) library(geojsonio) library(highcharter) library(leaflet) library(maptools) library(plotly) library(rgdal) library(treemap) library(shinydashboard) library(shinyjs) library(viridis) num_es <- nrow(filter(TECP_domestic, Federal_Listing_Status == "Endangered")) num_th <- nr...
\docType{class} \name{booli-class} \alias{booli} \alias{booli-class} \alias{rbooli} \title{Query Booli API} \arguments{ \item{id}{caller id} \item{key}{private api key} \item{path}{object type; "listings" (default) or "sold"} \item{limit}{max observations to be returned from api (default: 500)} \item{.....
/man/booli-class.Rd
no_license
reinholdsson/rbooli
R
false
false
772
rd
\docType{class} \name{booli-class} \alias{booli} \alias{booli-class} \alias{rbooli} \title{Query Booli API} \arguments{ \item{id}{caller id} \item{key}{private api key} \item{path}{object type; "listings" (default) or "sold"} \item{limit}{max observations to be returned from api (default: 500)} \item{.....
#' Spreads all scalar values of a JSON object into new columns #' #' Like the \code{\link[tidyr]{spread}} function in \code{tidyr} but for JSON, #' this function spreads out any JSON objects that are scalars into new columns. #' If objects are nested, then the recursive flag will expand scalar values of #' nested objec...
/R/spread_all.R
permissive
talaricd/tidyjson
R
false
false
5,742
r
#' Spreads all scalar values of a JSON object into new columns #' #' Like the \code{\link[tidyr]{spread}} function in \code{tidyr} but for JSON, #' this function spreads out any JSON objects that are scalars into new columns. #' If objects are nested, then the recursive flag will expand scalar values of #' nested objec...
#data( 'KleinI' , package = 'AER') csv_doc = ",Year,C,P,Wp,I,K.lag,X,Wg,G,T 1,1920,39.8,12.7,28.8,2.7,180.1,44.9,2.2,2.4,3.4 2,1921,41.9,12.4,25.5,-0.2,182.8,45.6,2.7,3.9,7.7 3,1922,45,16.9,29.3,1.9,182.6,50.1,2.9,3.2,3.9 4,1923,49.2,18.4,34.1,5.2,184.5,57.2,2.9,2.8,4.7 5,1924,50.6,19.4,33.9,3,189.7,57.1,3.1,3.5,3.8 6...
/klein.r
no_license
epogrebnyak/systemfit
R
false
false
2,782
r
#data( 'KleinI' , package = 'AER') csv_doc = ",Year,C,P,Wp,I,K.lag,X,Wg,G,T 1,1920,39.8,12.7,28.8,2.7,180.1,44.9,2.2,2.4,3.4 2,1921,41.9,12.4,25.5,-0.2,182.8,45.6,2.7,3.9,7.7 3,1922,45,16.9,29.3,1.9,182.6,50.1,2.9,3.2,3.9 4,1923,49.2,18.4,34.1,5.2,184.5,57.2,2.9,2.8,4.7 5,1924,50.6,19.4,33.9,3,189.7,57.1,3.1,3.5,3.8 6...
## In this example, the data is in a matrix called ## data.matrix ## columns are individual samples (i.e. cells) ## rows are measurements taken for all the samples (i.e. genes) ## Just for the sake of the example, here's some made up data... # install packages---- library(ggplot2) # define dataset---- # data.ma...
/chapter_5/pca_demo_v4.R
no_license
athang/source_code
R
false
false
9,666
r
## In this example, the data is in a matrix called ## data.matrix ## columns are individual samples (i.e. cells) ## rows are measurements taken for all the samples (i.e. genes) ## Just for the sake of the example, here's some made up data... # install packages---- library(ggplot2) # define dataset---- # data.ma...
# Dashboard básico library(shiny) shinyUI( pageWithSidebar( headerPanel("Aplicación simple de Shiny"), sidebarPanel(p("Vamos a crear plots con el dataset de 'iris'"), selectInput("x", "Selecciona el eje de las X", cho...
/R/Sesión 08/Reto1/ui.R
no_license
fatimamt/Bedu_Fase2
R
false
false
1,152
r
# Dashboard básico library(shiny) shinyUI( pageWithSidebar( headerPanel("Aplicación simple de Shiny"), sidebarPanel(p("Vamos a crear plots con el dataset de 'iris'"), selectInput("x", "Selecciona el eje de las X", cho...
\name{Timestamp} \alias{Timestamp} \title{Timestamps with suitable default formatting and timezone handling} \usage{ Timestamp(x, tz, origin = "1970-01-01 00:00:00", ...) } \arguments{ \item{x}{epoch time, character, or anything else convertable via \link{as.POSIXct}} \item{tz}{character string (see link{timez...
/man/Timestamp.Rd
no_license
newpcraft/opentsdbr
R
false
false
619
rd
\name{Timestamp} \alias{Timestamp} \title{Timestamps with suitable default formatting and timezone handling} \usage{ Timestamp(x, tz, origin = "1970-01-01 00:00:00", ...) } \arguments{ \item{x}{epoch time, character, or anything else convertable via \link{as.POSIXct}} \item{tz}{character string (see link{timez...
#' partial F test for Wasserstein regression #' @export #' @description #' @details two methods used to compute p value using asymptotic distribution of F statistic. #' \itemize{ #' \item{truncated:}{ asymptotic inference, p-value is obtained by truncating the infinite summation of eigenvalues into the first K terms.}...
/Others/WRI-master/R/partialFtest.R
no_license
pratimguhaniyogi/Density-Review
R
false
false
4,795
r
#' partial F test for Wasserstein regression #' @export #' @description #' @details two methods used to compute p value using asymptotic distribution of F statistic. #' \itemize{ #' \item{truncated:}{ asymptotic inference, p-value is obtained by truncating the infinite summation of eigenvalues into the first K terms.}...
#Make Vector Function #Set the value of the vector makeVector <- function(x = numeric()) { m <- NULL set <- function(y) { x <<- y m <<- NULL } #Get the value of the vector get <- function() x #Set the value of the mean #Get the value of the mean setmean <- function(mean) m <<- mean getmean <- functi...
/cachemean.R
no_license
patgerolaga/datasciencecoursera
R
false
false
627
r
#Make Vector Function #Set the value of the vector makeVector <- function(x = numeric()) { m <- NULL set <- function(y) { x <<- y m <<- NULL } #Get the value of the vector get <- function() x #Set the value of the mean #Get the value of the mean setmean <- function(mean) m <<- mean getmean <- functi...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{mortTable} \alias{mortTable} \title{Mortality rate for male and female from ages 5 to 115} \format{A data frame with 110 rows and 3 columns: \describe{ \item{age}{individual's age} \item{male}{mortality of a ma...
/man/mortTable.Rd
no_license
h343li/vamc-r
R
false
true
679
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{mortTable} \alias{mortTable} \title{Mortality rate for male and female from ages 5 to 115} \format{A data frame with 110 rows and 3 columns: \describe{ \item{age}{individual's age} \item{male}{mortality of a ma...
options(contrasts = rep("contr.treatment", 2)) # suppressWarnings({ # library("methods") library("shconfig2") set_wd() load_packages("2017-10-15") db_restore_check(category_id = 1082) set_auction_bounds(1750, 250000) set_retail_bounds(2500, 300000) source("custom_functions.R") today <- lubrida...
/RTraining/1082 - Scrapers - Pull/master.R
no_license
JordanBrownie/datascience
R
false
false
15,172
r
options(contrasts = rep("contr.treatment", 2)) # suppressWarnings({ # library("methods") library("shconfig2") set_wd() load_packages("2017-10-15") db_restore_check(category_id = 1082) set_auction_bounds(1750, 250000) set_retail_bounds(2500, 300000) source("custom_functions.R") today <- lubrida...
#Coursera Data Science - Exploratory Data Analysis Assignment #Plot2 - all source emission levels over time in Baltimore city # https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_data.zip data source #Check that this download works with download.file("https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_d...
/Exp_Data_wk4/Wk4_Plot2.R
no_license
Tim2009/datasciencecoursera
R
false
false
827
r
#Coursera Data Science - Exploratory Data Analysis Assignment #Plot2 - all source emission levels over time in Baltimore city # https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_data.zip data source #Check that this download works with download.file("https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_d...
source("scripts/checkplot_initials.R") source("scripts/obscp_inf.R") reps<-5e2 Bnum<-2e3 nc<-36 #scaling this back to work on amarel... suspect memory issues plan(strategy=multisession, workers=nc) map(round(10^seq(2, 3.5, 0.25)), function(size){ map(c(-1,0,1), function(ell){ map(1:100, function(tryme){ start<...
/scripts/checkplots_for_parallel_amarel/obs_lomemSAD3.R
no_license
dushoff/diversity_metrics
R
false
false
554
r
source("scripts/checkplot_initials.R") source("scripts/obscp_inf.R") reps<-5e2 Bnum<-2e3 nc<-36 #scaling this back to work on amarel... suspect memory issues plan(strategy=multisession, workers=nc) map(round(10^seq(2, 3.5, 0.25)), function(size){ map(c(-1,0,1), function(ell){ map(1:100, function(tryme){ start<...
#### Logistic-Regression #load dataset data=read.csv('red-wine-quality-prediction-dataset_1.csv') View(data) # count 0 and 1 table(data$Quality_Category) #Convert yes no to 1,0 #ifelse(dataset$column=='yes',1,0) short method of ifelse # Fit model model=glm(Quality_Category ~ .,data,family = binomial(link = 'logi...
/Classification/Logistic-Regression.R
no_license
kevaldekivadiya2415/Machine_Learning_R
R
false
false
732
r
#### Logistic-Regression #load dataset data=read.csv('red-wine-quality-prediction-dataset_1.csv') View(data) # count 0 and 1 table(data$Quality_Category) #Convert yes no to 1,0 #ifelse(dataset$column=='yes',1,0) short method of ifelse # Fit model model=glm(Quality_Category ~ .,data,family = binomial(link = 'logi...
#!/usr/bin/env Rscript ## R library dependencies suppressPackageStartupMessages(library("optparse")) suppressPackageStartupMessages(library("data.table")) ## Read in the model source("R/classifier-base.R") source("R/uams-5.R") option_list <- list( make_option(c("--test-dir"), action="store", defa...
/uams-5/run-mm-sc1.R
no_license
bswhite/Multiple-Myeloma-Challenge-Examples
R
false
false
2,600
r
#!/usr/bin/env Rscript ## R library dependencies suppressPackageStartupMessages(library("optparse")) suppressPackageStartupMessages(library("data.table")) ## Read in the model source("R/classifier-base.R") source("R/uams-5.R") option_list <- list( make_option(c("--test-dir"), action="store", defa...
#' Home-range area #' #' Obtain the area of a home-range estimate, possible at different isopleth levels. #' @param x An object of class `hr` #' @param units `[logic(1)]` \cr Should areas be returned as units? If `FALSE` areas are returned as numeric values. #' @param level The level at which the area will be calculate...
/R/hr_area.R
no_license
jmsigner/amt
R
false
false
1,180
r
#' Home-range area #' #' Obtain the area of a home-range estimate, possible at different isopleth levels. #' @param x An object of class `hr` #' @param units `[logic(1)]` \cr Should areas be returned as units? If `FALSE` areas are returned as numeric values. #' @param level The level at which the area will be calculate...
# ------------------------------------ # Project: OSHA Training Analyzer # # Script: unit.R # # Author: Ezra Rudel # # Date Created: 2021-09-10 # # Copyright (c) Ezra Rudel 2021 # Email: ezra@rudel.net # # ------------------------------------ # program to analyze unit test data # create graph comparing unit test...
/src/unit.R
no_license
ezrudel/MRNY-OSHA-trainings
R
false
false
3,701
r
# ------------------------------------ # Project: OSHA Training Analyzer # # Script: unit.R # # Author: Ezra Rudel # # Date Created: 2021-09-10 # # Copyright (c) Ezra Rudel 2021 # Email: ezra@rudel.net # # ------------------------------------ # program to analyze unit test data # create graph comparing unit test...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bspSampling.R \name{samplesAt} \alias{samplesAt} \title{Extract distribution at select point} \usage{ samplesAt(samples, time) } \arguments{ \item{samples}{The samples produced by bspSampling()} \item{time}{The spot on the support at which y...
/man/samplesAt.Rd
no_license
jntrcs/BnpSysRel
R
false
true
586
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bspSampling.R \name{samplesAt} \alias{samplesAt} \title{Extract distribution at select point} \usage{ samplesAt(samples, time) } \arguments{ \item{samples}{The samples produced by bspSampling()} \item{time}{The spot on the support at which y...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/cloudsearch_operations.R \name{cloudsearch_list_domain_names} \alias{cloudsearch_list_domain_names} \title{Lists all search domains owned by an account} \usage{ cloudsearch_list_domain_names() } \description{ Lists all search domains owned by...
/cran/paws.analytics/man/cloudsearch_list_domain_names.Rd
permissive
johnnytommy/paws
R
false
true
354
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/cloudsearch_operations.R \name{cloudsearch_list_domain_names} \alias{cloudsearch_list_domain_names} \title{Lists all search domains owned by an account} \usage{ cloudsearch_list_domain_names() } \description{ Lists all search domains owned by...
#Given that this is the same data as yesterday, we could open it up in its directory #however, you would have to open it in GIT and make sure all the directories are aligned properly #easiest for class to download the file again download.file("https://raw.githubusercontent.com/swcarpentry/r-novice-gapminder/gh-pages...
/gapminder-plots.R
no_license
mirandastratton8/gapminder-plots
R
false
false
866
r
#Given that this is the same data as yesterday, we could open it up in its directory #however, you would have to open it in GIT and make sure all the directories are aligned properly #easiest for class to download the file again download.file("https://raw.githubusercontent.com/swcarpentry/r-novice-gapminder/gh-pages...
library(localsolver) ### Name: ls.solve ### Title: Solves a LocalSolver problem on data passed. ### Aliases: ls.solve ### ** Examples model.text.lsp <- lsp.model.example('extdata/knapsack.txt') lsp <- ls.problem(model.text.lsp) lsp <- set.params(lsp, lsTimeLimit=60) lsp <- add.output.expr(lsp, "x", 4) data <- list(...
/data/genthat_extracted_code/localsolver/examples/ls.solve.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
435
r
library(localsolver) ### Name: ls.solve ### Title: Solves a LocalSolver problem on data passed. ### Aliases: ls.solve ### ** Examples model.text.lsp <- lsp.model.example('extdata/knapsack.txt') lsp <- ls.problem(model.text.lsp) lsp <- set.params(lsp, lsTimeLimit=60) lsp <- add.output.expr(lsp, "x", 4) data <- list(...
library("tidyverse") library("povcalnetR") library("here") source(here("R", "povcalnet_iterate.R")) rcv_dist <- function(country, year, coverage, step = .05, pl = 0.01, maxiter = 5, ...
/R/utils.R
no_license
randrescastaneda/SDG_2020
R
false
false
7,396
r
library("tidyverse") library("povcalnetR") library("here") source(here("R", "povcalnet_iterate.R")) rcv_dist <- function(country, year, coverage, step = .05, pl = 0.01, maxiter = 5, ...
# Returns the number of possible parent sets of given node # consistent with given order. # # node: node index # vOrder: ordering of node indexes # size: vector defining allowed parent set sizes (e.g. 0:3) getNumParentSets <- function(node, vOrder, size) { nodePos <- which(node == vOrder) size <- size[siz...
/functions/parent_sets.R
no_license
hwchang1201/my-r-order-mcmc
R
false
false
2,808
r
# Returns the number of possible parent sets of given node # consistent with given order. # # node: node index # vOrder: ordering of node indexes # size: vector defining allowed parent set sizes (e.g. 0:3) getNumParentSets <- function(node, vOrder, size) { nodePos <- which(node == vOrder) size <- size[siz...
############## summary of how many outbreak/non outbreak cases at each vaccination level ############## outbreak defined as 5 + cases over 1 year (w sensitivity of 10+ and 20+ cases) library(tidyverse) ############## run sensitivity analysis with outbreak defined as 10 or 20 cases over 1 year ###### 94% Vaccination ##...
/assessment_of_outbreak_potential_deviations_from_homogeneity.R
no_license
epibayes/Measles-Spatial-Clustering-and-Aggregation-Effects
R
false
false
11,012
r
############## summary of how many outbreak/non outbreak cases at each vaccination level ############## outbreak defined as 5 + cases over 1 year (w sensitivity of 10+ and 20+ cases) library(tidyverse) ############## run sensitivity analysis with outbreak defined as 10 or 20 cases over 1 year ###### 94% Vaccination ##...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/paws.devicefarm_operations.R \name{get_device_instance} \alias{get_device_instance} \title{Returns information about a device instance belonging to a private device fleet} \usage{ get_device_instance(arn) } \arguments{ \item{arn}{[required] T...
/service/paws.devicefarm/man/get_device_instance.Rd
permissive
CR-Mercado/paws
R
false
true
593
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/paws.devicefarm_operations.R \name{get_device_instance} \alias{get_device_instance} \title{Returns information about a device instance belonging to a private device fleet} \usage{ get_device_instance(arn) } \arguments{ \item{arn}{[required] T...
\name{geneloc} \alias{geneloc} \docType{data} \title{ Artificial data for Matrix eQTL sample code: Gene location file. } \description{ Artificial Gene location file for 10 genes. \tabular{llll}{ geneid \tab chr \tab left \tab right \cr Gene_01 \tab chr1 \tab 721289 \tab 731289 \cr Gene_02 \tab chr1 ...
/man/geneloc.Rd
no_license
xidianwwj/MatrixEQTL
R
false
false
996
rd
\name{geneloc} \alias{geneloc} \docType{data} \title{ Artificial data for Matrix eQTL sample code: Gene location file. } \description{ Artificial Gene location file for 10 genes. \tabular{llll}{ geneid \tab chr \tab left \tab right \cr Gene_01 \tab chr1 \tab 721289 \tab 731289 \cr Gene_02 \tab chr1 ...
setwd("C:/Users/kevin/Desktop/R Programming/Exploratory data analysis/exdata_data_household_power_consumption") data<-read.csv2("household_power_consumption.txt") data$Date<-as.Date(as.character(data$Date),"%d/%m/%Y") data<-data[data$Date>as.Date("2007-01-31"),] data<-data[data$Date<as.Date("2007-02-03"),] data$Gl...
/figure/plot2.R
no_license
kevchun/ExData_Plotting1
R
false
false
583
r
setwd("C:/Users/kevin/Desktop/R Programming/Exploratory data analysis/exdata_data_household_power_consumption") data<-read.csv2("household_power_consumption.txt") data$Date<-as.Date(as.character(data$Date),"%d/%m/%Y") data<-data[data$Date>as.Date("2007-01-31"),] data<-data[data$Date<as.Date("2007-02-03"),] data$Gl...
testlist <- list(latLongs = structure(c(5.45596067867572e-310, 1.07434015940589e-114, 7.10610793424161e-15), .Dim = c(1L, 3L)), r = 2.73349246602624e+161) result <- do.call(MGDrivE::calcCos,testlist) str(result)
/MGDrivE/inst/testfiles/calcCos/libFuzzer_calcCos/calcCos_valgrind_files/1612732960-test.R
no_license
akhikolla/updatedatatype-list2
R
false
false
212
r
testlist <- list(latLongs = structure(c(5.45596067867572e-310, 1.07434015940589e-114, 7.10610793424161e-15), .Dim = c(1L, 3L)), r = 2.73349246602624e+161) result <- do.call(MGDrivE::calcCos,testlist) str(result)
# getChromInfoFromUCSC = function(species) { # dir = tempdir() # op = qq.options(READ.ONLY = FALSE) # qq.options(code.pattern = "@\\{CODE\\}") # filename = qq("@{species}_getChromInfoFromUCSC") # if(file.exists(qq("@{dir}/@{filename}"))) { # df = read.table(qq("@{dir}/@{filename}"), sep = "\t", header = TRUE, ...
/R/function_memorized.R
no_license
AvinashGupta/epic
R
false
false
1,063
r
# getChromInfoFromUCSC = function(species) { # dir = tempdir() # op = qq.options(READ.ONLY = FALSE) # qq.options(code.pattern = "@\\{CODE\\}") # filename = qq("@{species}_getChromInfoFromUCSC") # if(file.exists(qq("@{dir}/@{filename}"))) { # df = read.table(qq("@{dir}/@{filename}"), sep = "\t", header = TRUE, ...
#remove the variables in the Global Environment rm(list = ls()) churn<-read.csv('CustomerChurn.csv') #UNDERSTANDING AND PLAYING AROUND WITH DATA summary(churn) str(churn) levels(churn$Partner)<-c(0,1) levels(churn$Dependents)<-c(0,1) levels(churn$gender)<-c(0,1) levels(churn$PhoneService)<-c(0,1) #separating the...
/churnProjectPilot.R
no_license
Deepan32/Customer-Churn-Prediction
R
false
false
1,292
r
#remove the variables in the Global Environment rm(list = ls()) churn<-read.csv('CustomerChurn.csv') #UNDERSTANDING AND PLAYING AROUND WITH DATA summary(churn) str(churn) levels(churn$Partner)<-c(0,1) levels(churn$Dependents)<-c(0,1) levels(churn$gender)<-c(0,1) levels(churn$PhoneService)<-c(0,1) #separating the...
library(tidyverse) library(lubridate) library(ggthemes) # import data nobel_winners <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-05-14/nobel_winners.csv") nobel_winner_all_pubs <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/m...
/2019_05_14nobelprize/tidytuesday2019_05_14.R
no_license
carter8/tidytuesday
R
false
false
1,255
r
library(tidyverse) library(lubridate) library(ggthemes) # import data nobel_winners <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-05-14/nobel_winners.csv") nobel_winner_all_pubs <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/m...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/skm_cpp_rd.r \name{skm_minmax_cpp} \alias{skm_minmax_cpp} \title{skm_minmax_cpp} \usage{ skm_minmax_cpp(x, s_must) } \arguments{ \item{x}{an m x n matrix often m > n} \item{s_must}{matrix x row index start from 0 that must be sele...
/man/skm_minmax_cpp.Rd
no_license
cran/skm
R
false
true
1,380
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/skm_cpp_rd.r \name{skm_minmax_cpp} \alias{skm_minmax_cpp} \title{skm_minmax_cpp} \usage{ skm_minmax_cpp(x, s_must) } \arguments{ \item{x}{an m x n matrix often m > n} \item{s_must}{matrix x row index start from 0 that must be sele...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/generate.initial.values.R \name{generate.initial.values} \alias{generate.initial.values} \title{Generate initial values for plateau envelopes} \usage{ generate.initial.values(y, x.clim, x.nonclim = NULL, constrain.beta = FALSE, random = FAL...
/man/generate.initial.values.Rd
no_license
moanam/plateau
R
false
true
1,369
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/generate.initial.values.R \name{generate.initial.values} \alias{generate.initial.values} \title{Generate initial values for plateau envelopes} \usage{ generate.initial.values(y, x.clim, x.nonclim = NULL, constrain.beta = FALSE, random = FAL...
find_minor_f <- function(conf_mtx) { f_stat <- NULL for (i in c(1,2,5,6)) { newf <- (2 * conf_mtx$byClass[i,1] * conf_mtx$byClass[i,3]) / (conf_mtx$byClass[i,1] + conf_mtx$byClass[i,3]) if (is.nan(newf)) {newf <- 0} f_stat<- c(f_stat, newf) } return(mean(f_stat)) }
/Assignment3/find_minor_class_f_stat.R
no_license
asterix135/CMTH642_Assignments
R
false
false
319
r
find_minor_f <- function(conf_mtx) { f_stat <- NULL for (i in c(1,2,5,6)) { newf <- (2 * conf_mtx$byClass[i,1] * conf_mtx$byClass[i,3]) / (conf_mtx$byClass[i,1] + conf_mtx$byClass[i,3]) if (is.nan(newf)) {newf <- 0} f_stat<- c(f_stat, newf) } return(mean(f_stat)) }
\name{ggplot.profr} \alias{ggplot.profr} \title{Visualise profiling data with ggplot2.} \usage{\method{ggplot}{profr} (data, ..., minlabel=0.1, angle=0)} \description{ Visualise profiling data with ggplot2. Visualise profiling data stored in a \code{profr} data.frame. } \details{ This will plot the call tree of...
/man/ggplot.profr.Rd
no_license
andrie/profr
R
false
false
805
rd
\name{ggplot.profr} \alias{ggplot.profr} \title{Visualise profiling data with ggplot2.} \usage{\method{ggplot}{profr} (data, ..., minlabel=0.1, angle=0)} \description{ Visualise profiling data with ggplot2. Visualise profiling data stored in a \code{profr} data.frame. } \details{ This will plot the call tree of...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/extract_tests.R \name{extract_tests} \alias{extract_tests} \title{Extract tests from source} \usage{ extract_tests(pkg = ".", filter = NULL, verbose = getOption("verbose", FALSE), full.path = NA, force = FALSE) } \arguments{ \i...
/man/extract_tests.Rd
no_license
cran/testextra
R
false
true
1,413
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/extract_tests.R \name{extract_tests} \alias{extract_tests} \title{Extract tests from source} \usage{ extract_tests(pkg = ".", filter = NULL, verbose = getOption("verbose", FALSE), full.path = NA, force = FALSE) } \arguments{ \i...
############################################################################## # Stable Trait, Autoregressive Trait, State Model with Multiple Indicators ## # ## # There are three indicators of the construct at each of 10 waves. However ## # ...
/inst/models/nightly/startsTestMissing.R
permissive
trbrick/OpenMx
R
false
false
10,106
r
############################################################################## # Stable Trait, Autoregressive Trait, State Model with Multiple Indicators ## # ## # There are three indicators of the construct at each of 10 waves. However ## # ...
# This is the user-interface definition of a Shiny web application. # You can find out more about building applications with Shiny here: # # http://shiny.rstudio.com # library(shiny) library(shinyDND) library(shinyTree) ### Prueba 1 shinyUI(fluidPage( #Titulo titlePanel("Modelado predictivo y Ser...
/Shiny/MPST/ui.R
no_license
jcbermud/Tarea-Series-de-tiempo
R
false
false
8,285
r
# This is the user-interface definition of a Shiny web application. # You can find out more about building applications with Shiny here: # # http://shiny.rstudio.com # library(shiny) library(shinyDND) library(shinyTree) ### Prueba 1 shinyUI(fluidPage( #Titulo titlePanel("Modelado predictivo y Ser...
# Disable sass cache local_disable_cache() test_that("extend works", { # allow for css rules to be reordered within a definition split_sort <- function(x) { sort( sub("\\s+$", "", # remove tailing sub("^\\s+", "", # remove leading strsplit(x, ",")[[1]] ) ) ) } expe...
/tests/testthat/test-extend.R
permissive
rstudio/sass
R
false
false
529
r
# Disable sass cache local_disable_cache() test_that("extend works", { # allow for css rules to be reordered within a definition split_sort <- function(x) { sort( sub("\\s+$", "", # remove tailing sub("^\\s+", "", # remove leading strsplit(x, ",")[[1]] ) ) ) } expe...
#mesenchymal subset #Mesenchymal embryonic only hindgut_Mes_std <- subset(hindgut_dev_std, ident = c("0", "14", "3", "2", "1", "10", "13", "16")) DefaultAssay(hindgut_Mes_std) <- "RNA" mes.list <- SplitObject(hindgut_Mes_std, split.by = "stage") for (i in 1:3){ mes.list[[i]] <- NormalizeData(mes.list[[i]], ...
/H.Fazilaty et al codes (Fig3 and Supp Fig 4-5).R
no_license
hassanfazilaty/embryonic_inflamed_colon
R
false
false
9,469
r
#mesenchymal subset #Mesenchymal embryonic only hindgut_Mes_std <- subset(hindgut_dev_std, ident = c("0", "14", "3", "2", "1", "10", "13", "16")) DefaultAssay(hindgut_Mes_std) <- "RNA" mes.list <- SplitObject(hindgut_Mes_std, split.by = "stage") for (i in 1:3){ mes.list[[i]] <- NormalizeData(mes.list[[i]], ...
library(anominate) ### Name: plot.anominate ### Title: alpha-NOMINATE Coordinate Plot Function ### Aliases: plot.anominate ### Keywords: ideal point estimation, NOMINATE, Bayesian latent variable ### models ### ** Examples data(sen111_anom) plot(sen111_anom)
/data/genthat_extracted_code/anominate/examples/plot.anominate.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
268
r
library(anominate) ### Name: plot.anominate ### Title: alpha-NOMINATE Coordinate Plot Function ### Aliases: plot.anominate ### Keywords: ideal point estimation, NOMINATE, Bayesian latent variable ### models ### ** Examples data(sen111_anom) plot(sen111_anom)
library(readxl) library(polycor) library(psycho) library(nFactors) library(ClustOfVar) library(ape) setwd("~/h2020") cordis_h2020projects <- read_excel("cordis-h2020projects.xlsx") mydata<-cordis_h2020projects attach(mydata) table(coordinatorCountry) write.table(table(coordinatorCountry), file="countries...
/h2020_syntax_181025.R
no_license
g7gazdasag/h2020
R
false
false
5,304
r
library(readxl) library(polycor) library(psycho) library(nFactors) library(ClustOfVar) library(ape) setwd("~/h2020") cordis_h2020projects <- read_excel("cordis-h2020projects.xlsx") mydata<-cordis_h2020projects attach(mydata) table(coordinatorCountry) write.table(table(coordinatorCountry), file="countries...
tryCatch({ if(tab$name == "basicProductSales"){ ### x축에 표현되야 하는 단위로 group_by -> summarize로 집계함 progress.value$now <- progress.value$now + 1 progress$set(message = "매출, 주문 건수/수량 계산 중", value = progress.value$now) debug.fun(state = "progress", o...
/2017_pshop_dashboard/make_table.R
no_license
L3earl/portfolio
R
false
false
19,214
r
tryCatch({ if(tab$name == "basicProductSales"){ ### x축에 표현되야 하는 단위로 group_by -> summarize로 집계함 progress.value$now <- progress.value$now + 1 progress$set(message = "매출, 주문 건수/수량 계산 중", value = progress.value$now) debug.fun(state = "progress", o...
library(evd) ### Name: exiplot ### Title: Plot Estimates of the Extremal Index ### Aliases: exiplot ### Keywords: hplot ### ** Examples sdat <- mar(100, psi = 0.5) tlim <- quantile(sdat, probs = c(0.4,0.9)) exiplot(sdat, tlim) exiplot(sdat, tlim, r = 4, add = TRUE, lty = 2) exiplot(sdat, tlim, r = 0, add = TRUE, lt...
/data/genthat_extracted_code/evd/examples/exiplot.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
330
r
library(evd) ### Name: exiplot ### Title: Plot Estimates of the Extremal Index ### Aliases: exiplot ### Keywords: hplot ### ** Examples sdat <- mar(100, psi = 0.5) tlim <- quantile(sdat, probs = c(0.4,0.9)) exiplot(sdat, tlim) exiplot(sdat, tlim, r = 4, add = TRUE, lty = 2) exiplot(sdat, tlim, r = 0, add = TRUE, lt...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/createNormalDatabase.R \name{calculateTangentNormal} \alias{calculateTangentNormal} \title{Calculate tangent normal} \usage{ calculateTangentNormal( tumor.coverage.file, normalDB, num.eigen = 20, ignore.sex = FALSE, sex = NULL ) } \...
/man/calculateTangentNormal.Rd
permissive
lima1/PureCN
R
false
true
1,577
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/createNormalDatabase.R \name{calculateTangentNormal} \alias{calculateTangentNormal} \title{Calculate tangent normal} \usage{ calculateTangentNormal( tumor.coverage.file, normalDB, num.eigen = 20, ignore.sex = FALSE, sex = NULL ) } \...
#-----------------Code adapted from Geir-Arne Fuglstad----------------# validFn <- function(surv){ pcprior<-list(theta = list(prior = "pc.prec", params = c(3, 0.05))) '%ni%'<-Negate('%in%') #--------------------# # Load packages #--------------------# library(tidyr) library(rgdal) library(sp) library...
/codes/validation_wealth.R
permissive
JulianneMeisnerUW/LivestockMaps
R
false
false
9,858
r
#-----------------Code adapted from Geir-Arne Fuglstad----------------# validFn <- function(surv){ pcprior<-list(theta = list(prior = "pc.prec", params = c(3, 0.05))) '%ni%'<-Negate('%in%') #--------------------# # Load packages #--------------------# library(tidyr) library(rgdal) library(sp) library...
`print.cca` <- function (x, digits = max(3, getOption("digits") - 3), ...) { writeLines(strwrap(pasteCall(x$call))) cat("\n") chi <- c(x$tot.chi, x$pCCA$tot.chi, x$CCA$tot.chi, x$CA$tot.chi) props <- chi/chi[1] rnk <- c(NA, x$pCCA$rank, x$CCA$rank, x$CA$rank) ## report no. of real axes in db...
/R/print.cca.R
no_license
cstan11/vegan
R
false
false
3,492
r
`print.cca` <- function (x, digits = max(3, getOption("digits") - 3), ...) { writeLines(strwrap(pasteCall(x$call))) cat("\n") chi <- c(x$tot.chi, x$pCCA$tot.chi, x$CCA$tot.chi, x$CA$tot.chi) props <- chi/chi[1] rnk <- c(NA, x$pCCA$rank, x$CCA$rank, x$CA$rank) ## report no. of real axes in db...
\name{emf} \Rdversion{1.1} \alias{emf} \alias{devEMF} \title{Enhanced Metafile Graphics Device} \description{ 'emf' starts the graphics device driver for producing enhanced metafile (emf+/emf) graphics, which can imported natively as vector graphics in both LibreOffice and Microsoft Office. } \usage{ emf(file = ...
/man/emf.Rd
no_license
cran/devEMF
R
false
false
5,347
rd
\name{emf} \Rdversion{1.1} \alias{emf} \alias{devEMF} \title{Enhanced Metafile Graphics Device} \description{ 'emf' starts the graphics device driver for producing enhanced metafile (emf+/emf) graphics, which can imported natively as vector graphics in both LibreOffice and Microsoft Office. } \usage{ emf(file = ...
#get gene info for a genomic intervall # will call ensembl rest API (http://mar2017.rest.ensembl.org/) # fetch.gene.info.rest = function(assembly = NULL, #'hg19' or 'hg38' chr = NULL, #'chr1' or '1' start = NULL, #'12345678' ...
/fetch.gene.info.rest_jil_v1.0.r
no_license
WiebkeSchmitt/EpiPrimerProject
R
false
false
2,578
r
#get gene info for a genomic intervall # will call ensembl rest API (http://mar2017.rest.ensembl.org/) # fetch.gene.info.rest = function(assembly = NULL, #'hg19' or 'hg38' chr = NULL, #'chr1' or '1' start = NULL, #'12345678' ...