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
library(diffdepprop) ### Name: diffpci ### Title: Calculates various confidence intervals for the difference of ### two dependent proportions ### Aliases: diffpci ### ** Examples # a=59, b=23, c=3, d=37, n=122, type I error is 0.05 diffpci(59,23,3,37,122,0.05)
/data/genthat_extracted_code/diffdepprop/examples/diffpci.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
270
r
library(diffdepprop) ### Name: diffpci ### Title: Calculates various confidence intervals for the difference of ### two dependent proportions ### Aliases: diffpci ### ** Examples # a=59, b=23, c=3, d=37, n=122, type I error is 0.05 diffpci(59,23,3,37,122,0.05)
# REpresenting class-SR patterns for individual species ## frequency of different abundance classes classfreq=rbind(table(as.numeric(databp$domlevels)), table(as.numeric(databp$domlevels[databp$ALIEN==1])), table(as.numeric(databp$domlevels[databp$ALIEN==0]))) classfreq=classfre...
/article 1 - SR-richness/species illustration/species illustration.R
no_license
maudbv/Abundance-richness-correlation-BP
R
false
false
22,944
r
# REpresenting class-SR patterns for individual species ## frequency of different abundance classes classfreq=rbind(table(as.numeric(databp$domlevels)), table(as.numeric(databp$domlevels[databp$ALIEN==1])), table(as.numeric(databp$domlevels[databp$ALIEN==0]))) classfreq=classfre...
fitness.func <- function(individual) { A <- 10 n <- length(individual) sum1 <- lapply(1:n, function(i) { xi <- individual[i] return( (xi ^ 2) / 4000) }) prod1 <- lapply(1:n, function(i) { xi <- individual[i] return(cos(xi / sqrt(i))) }) sum1 <- unlist(sum1) sum1 <- sum(sum1) prod1 <- unlist(prod1)...
/CS_472/project1/src/griewangk.r
no_license
engrnasirkhan/UofI
R
false
false
494
r
fitness.func <- function(individual) { A <- 10 n <- length(individual) sum1 <- lapply(1:n, function(i) { xi <- individual[i] return( (xi ^ 2) / 4000) }) prod1 <- lapply(1:n, function(i) { xi <- individual[i] return(cos(xi / sqrt(i))) }) sum1 <- unlist(sum1) sum1 <- sum(sum1) prod1 <- unlist(prod1)...
library(RSurveillance) ### Name: pfree.calc ### Title: Probability of freedom over time ### Aliases: pfree.calc ### Keywords: methods ### ** Examples # examples for pfree.calc pfree.calc(0.8, 0.01, 0.5) pfree.calc(rep(0.6,24), 0.01, 0.5) pfree.calc(runif(10, 0.4, 0.6), 0.01, 0.5) pfree.calc(runif(10, 0.4, 0.6), run...
/data/genthat_extracted_code/RSurveillance/examples/pfree.calc.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
350
r
library(RSurveillance) ### Name: pfree.calc ### Title: Probability of freedom over time ### Aliases: pfree.calc ### Keywords: methods ### ** Examples # examples for pfree.calc pfree.calc(0.8, 0.01, 0.5) pfree.calc(rep(0.6,24), 0.01, 0.5) pfree.calc(runif(10, 0.4, 0.6), 0.01, 0.5) pfree.calc(runif(10, 0.4, 0.6), run...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/assembly_end_correction.R \name{gRanges23UTR100nt} \alias{gRanges23UTR100nt} \title{Title} \usage{ gRanges23UTR100nt(grset) } \arguments{ \item{grset}{} } \description{ Title }
/man/gRanges23UTR100nt.Rd
no_license
hilgers-lab/ciaTaiLoR
R
false
true
255
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/assembly_end_correction.R \name{gRanges23UTR100nt} \alias{gRanges23UTR100nt} \title{Title} \usage{ gRanges23UTR100nt(grset) } \arguments{ \item{grset}{} } \description{ Title }
library(mvnTest) ### Name: DH.test ### Title: Doornik-Hansen test for Multivariate Normality ### Aliases: DH.test ### ** Examples ## generating n bivariate normal random variables... dat <- rmvnorm(n=200,mean=rep(0,2),sigma=matrix(c(4,2,2,4),2,2)) res <- DH.test(dat) res ## generating n bivariate t distribu...
/data/genthat_extracted_code/mvnTest/examples/DH.test.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
574
r
library(mvnTest) ### Name: DH.test ### Title: Doornik-Hansen test for Multivariate Normality ### Aliases: DH.test ### ** Examples ## generating n bivariate normal random variables... dat <- rmvnorm(n=200,mean=rep(0,2),sigma=matrix(c(4,2,2,4),2,2)) res <- DH.test(dat) res ## generating n bivariate t distribu...
context("Google SSL tests") # Certificates from https://pki.goog/ test_that("google certs validate", { # CRAN checks have to work offline skip("no longer available") # 2023: this seems broken? # Google CA root certs gsr4 <- read_cert('https://pki.goog/repo/certs/gsr4.der', der = TRUE) gtsr1 <- read_cert('...
/tests/testthat/test_google.R
no_license
cran/openssl
R
false
false
1,493
r
context("Google SSL tests") # Certificates from https://pki.goog/ test_that("google certs validate", { # CRAN checks have to work offline skip("no longer available") # 2023: this seems broken? # Google CA root certs gsr4 <- read_cert('https://pki.goog/repo/certs/gsr4.der', der = TRUE) gtsr1 <- read_cert('...
# users can either step through this file, or call this file with # r -f example.R # THIS ASSUMES THAT THE TESTHINT DATABASE EXISTS. The recipe for building that # database is in ../dbInitialization/createHintTest.sql # THIS EXAMPLE USES THE BRAIN HINT OUTPUT MADE BY RUNNING make hint at /scratch/data/footprints pri...
/generate_db/master/bronchus_20/hint.R
no_license
xtmgah/genomics-footprint
R
false
false
2,170
r
# users can either step through this file, or call this file with # r -f example.R # THIS ASSUMES THAT THE TESTHINT DATABASE EXISTS. The recipe for building that # database is in ../dbInitialization/createHintTest.sql # THIS EXAMPLE USES THE BRAIN HINT OUTPUT MADE BY RUNNING make hint at /scratch/data/footprints pri...
dt <- read.table("household_power_consumption.txt", sep = ";", header = TRUE, na.strings = "?", stringsAsFactors = FALSE) subset <- dt[dt$Date %in% c("1/2/2007", "2/2/2007"),] Datetime <- paste(as.Date(subset$Date, format("%d/%m/%Y")), subset$Time) subset$Datetime <- as.POSIXct(Datetime) str(subset)...
/plot2.R
no_license
hcxyeah/ExData_Plotting1
R
false
false
549
r
dt <- read.table("household_power_consumption.txt", sep = ";", header = TRUE, na.strings = "?", stringsAsFactors = FALSE) subset <- dt[dt$Date %in% c("1/2/2007", "2/2/2007"),] Datetime <- paste(as.Date(subset$Date, format("%d/%m/%Y")), subset$Time) subset$Datetime <- as.POSIXct(Datetime) str(subset)...
rm(list=ls()) ## Need these for Rscript library(microbenchmark) library(rstiefel) library(tidyverse) library(tidyverse) library(cowplot) library(colorspace) source("fit-subspace.R") source("generateData.R") source("subspace-functions.R") nbench_times <- 10 Svec <- c(2, 10, 25, 50) Pvec <- seq(from=1000, to=10000, b...
/scalability_simulation.R
no_license
afranks86/shared-subspace
R
false
false
2,100
r
rm(list=ls()) ## Need these for Rscript library(microbenchmark) library(rstiefel) library(tidyverse) library(tidyverse) library(cowplot) library(colorspace) source("fit-subspace.R") source("generateData.R") source("subspace-functions.R") nbench_times <- 10 Svec <- c(2, 10, 25, 50) Pvec <- seq(from=1000, to=10000, b...
# # Use the description field to make nice names # niceNames = function(ff) { des = parameters(ff)$desc idx = which(!is.na(des)) colnames(ff)[idx] = des[idx] ff }
/niceNames.R
no_license
rogerswt/wade_tools_lecture
R
false
false
173
r
# # Use the description field to make nice names # niceNames = function(ff) { des = parameters(ff)$desc idx = which(!is.na(des)) colnames(ff)[idx] = des[idx] ff }
tabPanel("Home", value = "tab_welcome", icon = icon('home'), fluidPage( br(), fluidRow( column(2), column(3, align = 'left', br(), h3('RFM Analysis'), p('RFM (recency, frequency, monetary) analysis is a behavior based technique used to segment cus...
/inst/app-rfm/ui/ui_welcome.R
no_license
cran/xplorerr
R
false
false
2,256
r
tabPanel("Home", value = "tab_welcome", icon = icon('home'), fluidPage( br(), fluidRow( column(2), column(3, align = 'left', br(), h3('RFM Analysis'), p('RFM (recency, frequency, monetary) analysis is a behavior based technique used to segment cus...
final_merger <- function(update_topics){ # Load Helper Function for Poverty source("topic_help_function/pov_help_function_sunny.R") source("topic_help_function/detailed_help_function.R") source("topic_help_function/pop_help_function.R") source("topic_help_function/edu_help_function.R") source("topic_help_function/lep...
/final_merger.R
permissive
AAPIData/quickstats_raw_data
R
false
false
4,042
r
final_merger <- function(update_topics){ # Load Helper Function for Poverty source("topic_help_function/pov_help_function_sunny.R") source("topic_help_function/detailed_help_function.R") source("topic_help_function/pop_help_function.R") source("topic_help_function/edu_help_function.R") source("topic_help_function/lep...
#' Pekalska's approach to speeding up Sammon's mapping. #' #' Creates a k-dimensional representation of the data. As input, a subsample and #' its k-dimensional mapping are required. The method approximates the subsample #' mapping to a linear mapping based on the distances matrix of the subsample #' and then applies t...
/R/pekalska.R
no_license
fatore/mp
R
false
false
1,503
r
#' Pekalska's approach to speeding up Sammon's mapping. #' #' Creates a k-dimensional representation of the data. As input, a subsample and #' its k-dimensional mapping are required. The method approximates the subsample #' mapping to a linear mapping based on the distances matrix of the subsample #' and then applies t...
#' @include internal.R NULL #' Planning unit solution status #' #' Extract planning unit solution status values. #' #' @param x [problem()] (i.e., [`ConservationProblem-class`]) object. #' #' @param solution object with solution data. #' #' @return `matrix` object containing solution values for planning units. #' #' @...
/R/planning_unit_solution_status.R
no_license
bbest/prioritizr
R
false
false
14,117
r
#' @include internal.R NULL #' Planning unit solution status #' #' Extract planning unit solution status values. #' #' @param x [problem()] (i.e., [`ConservationProblem-class`]) object. #' #' @param solution object with solution data. #' #' @return `matrix` object containing solution values for planning units. #' #' @...
#################################################################################### ########################################## Educational - For reference # file %>% # filter(Year > 2025 & Year <= 2055, # Chill_season != "chill_2025-2026" & # Chill_season != "chill_2055-2056") %>% # group_by(Chill_season) %>% main_o...
/educational/educational.R
permissive
aacharyakaushik/Ag
R
false
false
18,833
r
#################################################################################### ########################################## Educational - For reference # file %>% # filter(Year > 2025 & Year <= 2055, # Chill_season != "chill_2025-2026" & # Chill_season != "chill_2055-2056") %>% # group_by(Chill_season) %>% main_o...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/user_management.R \name{modify_password} \alias{modify_password} \title{Modifies the password for an user} \usage{ modify_password(con, salt, username, password) } \arguments{ \item{con}{\code{\link[pool]{dbPool}} connection object} \item{sa...
/man/modify_password.Rd
no_license
johnaponte/shinyPassprot
R
false
true
560
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/user_management.R \name{modify_password} \alias{modify_password} \title{Modifies the password for an user} \usage{ modify_password(con, salt, username, password) } \arguments{ \item{con}{\code{\link[pool]{dbPool}} connection object} \item{sa...
#' module_water_L133.water_demand_livestock #' #' Calculate livestock water coefficients by region ID / GCAM_commodity/ water type #' #' @param command API command to execute #' @param ... other optional parameters, depending on command #' @return Depends on \code{command}: either a vector of required inputs, #' a vect...
/input/gcamdata/R/zchunk_L133.water_demand_livestock.R
permissive
ceewindia/gcam-core
R
false
false
8,184
r
#' module_water_L133.water_demand_livestock #' #' Calculate livestock water coefficients by region ID / GCAM_commodity/ water type #' #' @param command API command to execute #' @param ... other optional parameters, depending on command #' @return Depends on \code{command}: either a vector of required inputs, #' a vect...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/cache.R \name{cache-management} \alias{cache-management} \alias{cacheOn} \alias{cacheOff} \alias{clearCache} \alias{cacheOff} \alias{clearCache} \title{Manage the HTTP cache} \usage{ cacheOn() cacheOff() clearCache() } \value{ Nothing. Func...
/man/cache-management.Rd
no_license
billdenney/httpcache
R
false
true
461
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/cache.R \name{cache-management} \alias{cache-management} \alias{cacheOn} \alias{cacheOff} \alias{clearCache} \alias{cacheOff} \alias{clearCache} \title{Manage the HTTP cache} \usage{ cacheOn() cacheOff() clearCache() } \value{ Nothing. Func...
#Script para demosntracao do estudo de funcoes ?sample args(sample) #visualiar paramentros da funcao args(mean) args(sd) #Built-in abs(-43) #valor absoluto sum(c(1:5)) mean(c(1:5)) round(c(1.1:5.8)) #arrendondar valores rev(c(1:5)) #reverte o valor do conjunto seq(1:5) sort(rev(c(1:5))) #ordena um conjunto append(c...
/Parte2-Rfundamentos/02-Funções.R
permissive
alletsc/R-Scripts-para-Introducao
R
false
false
1,246
r
#Script para demosntracao do estudo de funcoes ?sample args(sample) #visualiar paramentros da funcao args(mean) args(sd) #Built-in abs(-43) #valor absoluto sum(c(1:5)) mean(c(1:5)) round(c(1.1:5.8)) #arrendondar valores rev(c(1:5)) #reverte o valor do conjunto seq(1:5) sort(rev(c(1:5))) #ordena um conjunto append(c...
################################################################################ # Table-1 #Accounting of Subjects for Total xxxx Measurements by Dose Group and Overall #Following a Single and Repeat IV or IM Dose(s) of xxxx (All Subjects in Study R2222-HV-1326) ##################################################...
/util/stat/summary_of_studies.R
no_license
fyang72/handbook
R
false
false
20,119
r
################################################################################ # Table-1 #Accounting of Subjects for Total xxxx Measurements by Dose Group and Overall #Following a Single and Repeat IV or IM Dose(s) of xxxx (All Subjects in Study R2222-HV-1326) ##################################################...
# -------------------------------------------------------------------- # Author: Group 1: # Willem Houck, 429434 # Niels Janssen, 450759 # Tim de Jonge van Ellemeet, 425288 # Dani?l de Bondt 416090 # -------------------------------------------------------------------- ## Use this code skeleton to implement the determi...
/DeterministicMCD.R
no_license
WillemHouck/topics
R
false
false
20,824
r
# -------------------------------------------------------------------- # Author: Group 1: # Willem Houck, 429434 # Niels Janssen, 450759 # Tim de Jonge van Ellemeet, 425288 # Dani?l de Bondt 416090 # -------------------------------------------------------------------- ## Use this code skeleton to implement the determi...
#' Generate initialization for optimization #' #' @param W Numeric vector of counts #' @param M Numeric vector of sequencing depth #' @param X Matrix of covariates associated with abundance (including intercept) #' @param X_star Matrix of covariates associated with dispersion (including intercept) #' @param np Number o...
/R/genInits.R
no_license
aa-m-sa/corncob
R
false
false
2,222
r
#' Generate initialization for optimization #' #' @param W Numeric vector of counts #' @param M Numeric vector of sequencing depth #' @param X Matrix of covariates associated with abundance (including intercept) #' @param X_star Matrix of covariates associated with dispersion (including intercept) #' @param np Number o...
# batchBTC_recursive_solution.R: # Detect changes in a batch of data containing # multiple change points. # # First, look for the ML change point in the batch. # Then, divide the batch into two non-overlapping segments: # segmentLeft = observations up to the CP # segmentRight = observations after the CP. # and ap...
/app/CPD/batchBTC_recursive_solution.R
no_license
borjagomez/CPD-Backend
R
false
false
3,940
r
# batchBTC_recursive_solution.R: # Detect changes in a batch of data containing # multiple change points. # # First, look for the ML change point in the batch. # Then, divide the batch into two non-overlapping segments: # segmentLeft = observations up to the CP # segmentRight = observations after the CP. # and ap...
#install.packages('rvest') #install.packages('stringr') #install.packages('dplyr') #install.packages('lubridate') #install.packages('readr') #install.packages("xlsx") # Load packages library(rvest) library(stringr) library(dplyr) library(lubridate) library(readr) library(xlsx) #Place the folder path where the excel f...
/recentmcnews/mcscraping.R
no_license
ghtest12/R-Programming
R
false
false
3,224
r
#install.packages('rvest') #install.packages('stringr') #install.packages('dplyr') #install.packages('lubridate') #install.packages('readr') #install.packages("xlsx") # Load packages library(rvest) library(stringr) library(dplyr) library(lubridate) library(readr) library(xlsx) #Place the folder path where the excel f...
# Outliers test script ########################################################################################### # Clear all data in memory rm(list=union(ls(), ls())) # Load the neccessary packages for the following analysis. First, install packages if # they have not been installed on local hard drive. source("~/...
/PracticeFiles/Exploratory_Analysis-OUTLIERS.R
no_license
ChrisKeyes/SEM_Project
R
false
false
14,034
r
# Outliers test script ########################################################################################### # Clear all data in memory rm(list=union(ls(), ls())) # Load the neccessary packages for the following analysis. First, install packages if # they have not been installed on local hard drive. source("~/...
context("test-pc_projection") test_that("pc_projection works", { # tolernce for results supposed to be 0s tol <- 1e-5 nirdata <- data("NIRsoil", package = "prospectr") Xu <- NIRsoil$spc[!as.logical(NIRsoil$train), ] Yu <- NIRsoil$CEC[!as.logical(NIRsoil$train)] Yr <- NIRsoil$CEC[as.logical(NI...
/tests/testthat/test-pc_projection.R
no_license
cran/resemble
R
false
false
7,194
r
context("test-pc_projection") test_that("pc_projection works", { # tolernce for results supposed to be 0s tol <- 1e-5 nirdata <- data("NIRsoil", package = "prospectr") Xu <- NIRsoil$spc[!as.logical(NIRsoil$train), ] Yu <- NIRsoil$CEC[!as.logical(NIRsoil$train)] Yr <- NIRsoil$CEC[as.logical(NI...
createRSE = function(bamDir, bamFiles, bedData){ countsList = lapply(bamFiles, function( myBamFile ) { bam = GenomicAlignments::readGAlignments(file.path(bamDir, myBamFile)) counts = as( GenomicRanges::countOverlaps( bedData, bam ), "dsparseVector") out = list( file = myBamFile, counts = counts) ...
/package/R/bamPeaksToRSE.R
no_license
zorrodong/destin
R
false
false
2,951
r
createRSE = function(bamDir, bamFiles, bedData){ countsList = lapply(bamFiles, function( myBamFile ) { bam = GenomicAlignments::readGAlignments(file.path(bamDir, myBamFile)) counts = as( GenomicRanges::countOverlaps( bedData, bam ), "dsparseVector") out = list( file = myBamFile, counts = counts) ...
# 1) Loading the data required for Competition getwd() setwd("./University of Toronto - Mississauga/4 - Fourth Year/STA314/Competition/all") sample_submission <- read.csv("SampleSubmission.csv") test_data <- read.csv("test_predictors.csv") training_data <- read.csv("trainingdata.csv") library(gbm) set.seed(1) ...
/Attempts/Attempt11-Boosting and Changed Rate Attempt.R
no_license
pnkonge/Statistical-Learning
R
false
false
3,323
r
# 1) Loading the data required for Competition getwd() setwd("./University of Toronto - Mississauga/4 - Fourth Year/STA314/Competition/all") sample_submission <- read.csv("SampleSubmission.csv") test_data <- read.csv("test_predictors.csv") training_data <- read.csv("trainingdata.csv") library(gbm) set.seed(1) ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/order_gammag2.R \name{order_gammag2} \alias{order_gammag2} \title{Random Sampling of k-th Order Statistics from a Gamma G II Distribution} \usage{ order_gammag2(size, spec, a, k, n, alpha = 0.05, ...) } \arguments{ \item{size}{numeri...
/man/order_gammag2.Rd
no_license
cran/orders
R
false
true
2,284
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/order_gammag2.R \name{order_gammag2} \alias{order_gammag2} \title{Random Sampling of k-th Order Statistics from a Gamma G II Distribution} \usage{ order_gammag2(size, spec, a, k, n, alpha = 0.05, ...) } \arguments{ \item{size}{numeri...
#*************** Collaborative filtering(CF).***************** # ============================================================ library(Matrix) library(recommenderlab) library(slam) library(data.table) #' Calculates rating predictions according to CF formula. #' #' @param ratings_matrix (dgCMatrix) #' @param simila...
/functions/colla_filtering.R
permissive
melkyed/Reading_Recommender
R
false
false
10,406
r
#*************** Collaborative filtering(CF).***************** # ============================================================ library(Matrix) library(recommenderlab) library(slam) library(data.table) #' Calculates rating predictions according to CF formula. #' #' @param ratings_matrix (dgCMatrix) #' @param simila...
# fitqtlF: fit a multiple-qtl model to each of several phenotypes # return vector of LOD scores # # @param cross cross object # @param pheno.cols # @param qtl qtl object # @param formula QTL formula # @param covar covariate matrix (data.frame) # @param method whether to use haley-knott regression or imputation...
/R/fitqtlF.R
no_license
sens/funqtl
R
false
false
1,269
r
# fitqtlF: fit a multiple-qtl model to each of several phenotypes # return vector of LOD scores # # @param cross cross object # @param pheno.cols # @param qtl qtl object # @param formula QTL formula # @param covar covariate matrix (data.frame) # @param method whether to use haley-knott regression or imputation...
require(MetaIntegrator) dataObj = cohortobj$originalData$GSE35571 dataObj = classFunction(dataObj, column = "disease status:ch1", diseaseTerms = "asthmatic") dataObj$pheno$group = as.numeric(dataObj$class) #Three datasets from MetaIntegrator master = getGEOData(c( "GSE65204", "GSE64913", "GSE63142")) #master = get...
/pipeline.R
no_license
bg49623/asthma_meta_analysis
R
false
false
6,589
r
require(MetaIntegrator) dataObj = cohortobj$originalData$GSE35571 dataObj = classFunction(dataObj, column = "disease status:ch1", diseaseTerms = "asthmatic") dataObj$pheno$group = as.numeric(dataObj$class) #Three datasets from MetaIntegrator master = getGEOData(c( "GSE65204", "GSE64913", "GSE63142")) #master = get...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/doc-data.R \docType{data} \name{radf_crit} \alias{radf_crit} \title{Stored Monte Carlo Critical Values} \format{ A list with lower level lists that contain \describe{ \item{adf_cv:}{Augmented Dickey-Fuller} \item{badf_cv:}{Backward ...
/fuzzedpackages/exuber/man/radf_crit.Rd
no_license
akhikolla/testpackages
R
false
true
1,160
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/doc-data.R \docType{data} \name{radf_crit} \alias{radf_crit} \title{Stored Monte Carlo Critical Values} \format{ A list with lower level lists that contain \describe{ \item{adf_cv:}{Augmented Dickey-Fuller} \item{badf_cv:}{Backward ...
#Problem 4. Quantifying uncertainty: some basic frequentist ideas #B. # Load the library # you might have to install this the first time #install.packages("mlbench") library(mlbench) # Load the data ozone = data(Ozone, package='mlbench') # Look at the help file for details ?Ozone # Scrub the missing values # Extrac...
/exercise2/ozone.R
no_license
diegoolano/ut-SDS383D-statsII
R
false
false
9,990
r
#Problem 4. Quantifying uncertainty: some basic frequentist ideas #B. # Load the library # you might have to install this the first time #install.packages("mlbench") library(mlbench) # Load the data ozone = data(Ozone, package='mlbench') # Look at the help file for details ?Ozone # Scrub the missing values # Extrac...
#' @title Fiscal management report #' @description The fiscal management report will contain comparative #' statements with the limits referred to in the fiscal responsibility law, of #' the following amounts: total personnel expenses, showing expenses with #' assets, inactive and pensioners, net consolidated debt, gra...
/R/get_fiscal.R
permissive
rodrigoesborges/siconfir-1
R
false
false
2,755
r
#' @title Fiscal management report #' @description The fiscal management report will contain comparative #' statements with the limits referred to in the fiscal responsibility law, of #' the following amounts: total personnel expenses, showing expenses with #' assets, inactive and pensioners, net consolidated debt, gra...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/DataVisServer.R \name{DataVisServer} \alias{DataVisServer} \title{DataVisServer} \usage{ DataVisServer(input, output) } \arguments{ \item{output}{} } \value{ output } \description{ Creates and exports the server for the 'data visualisation' p...
/babyShiny/man/DataVisServer.Rd
no_license
TomHSY/babyShiny
R
false
true
337
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/DataVisServer.R \name{DataVisServer} \alias{DataVisServer} \title{DataVisServer} \usage{ DataVisServer(input, output) } \arguments{ \item{output}{} } \value{ output } \description{ Creates and exports the server for the 'data visualisation' p...
makeCacheMatrix <- function(x = matrix()) { inv <- NULL set <- function(y) { x <<- y inv <<- NULL } get <- function() x setInverse <- function(inverse) inv <<- inverse getInverse <- function() inv list(set = set, get = get, setInverse = setInverse, getInverse = getInverse) }
/makeCacheMatrix.R
no_license
questionaled/datasciencecoursera
R
false
false
319
r
makeCacheMatrix <- function(x = matrix()) { inv <- NULL set <- function(y) { x <<- y inv <<- NULL } get <- function() x setInverse <- function(inverse) inv <<- inverse getInverse <- function() inv list(set = set, get = get, setInverse = setInverse, getInverse = getInverse) }
##################################################################################### ## Author: Jenny Sjaarda ## Project: proxyMR ## ## Time-stamp: <[settings.R] by JS 2021-06-01 10:42:03 CEST> ## ## Description: ## ## ## History: ## #####################################################################################...
/code/settings.R
no_license
jennysjaarda/proxyMR
R
false
false
2,688
r
##################################################################################### ## Author: Jenny Sjaarda ## Project: proxyMR ## ## Time-stamp: <[settings.R] by JS 2021-06-01 10:42:03 CEST> ## ## Description: ## ## ## History: ## #####################################################################################...
# Reading in Data ds = read.csv('Social_Network_Ads.csv') ds = ds[, 3:5] # Scaling and splitting library(caTools) ds[,1:2] = scale(ds[,1:2]) split = sample.split(ds$Purchased, SplitRatio = 0.75) train = subset(ds, split == TRUE) test = subset(ds, split == FALSE) # KNN library(class) y_pred = knn(train[, -3], ...
/templates/classification_template.r
permissive
dipanwita2019/ml_projects
R
false
false
2,138
r
# Reading in Data ds = read.csv('Social_Network_Ads.csv') ds = ds[, 3:5] # Scaling and splitting library(caTools) ds[,1:2] = scale(ds[,1:2]) split = sample.split(ds$Purchased, SplitRatio = 0.75) train = subset(ds, split == TRUE) test = subset(ds, split == FALSE) # KNN library(class) y_pred = knn(train[, -3], ...
# Exercise-3: Calling built-in functions # Create a variable `my.name` that contains your name my.name <- "John Chen" # Create a variable `name.length` that holds how many letters are in your name (use the `nchars()` function) name.length <- nchar(my.name) # Print the number of letters in your name print(name.length...
/exercise-3/exercise.R
permissive
jxchen16/module6-functions
R
false
false
1,417
r
# Exercise-3: Calling built-in functions # Create a variable `my.name` that contains your name my.name <- "John Chen" # Create a variable `name.length` that holds how many letters are in your name (use the `nchars()` function) name.length <- nchar(my.name) # Print the number of letters in your name print(name.length...
n <- 100000000 values <- floor(cumsum(1/seq_len(n))) ## 0-based indexing like C++ positions <- c(0, 1, 1 + which(diff(values) == 1)) paste(positions, collapse = ", ") ## 0, 1, 4, 11, 31, 83, 227, 616, 1674, 4550, 12367, 33617, 91380, 248397, 675214, 1835421, 4989191, 13562027, 36865412
/suminv/suminv.R
permissive
zettsu-t/cPlusPlusFriend
R
false
false
297
r
n <- 100000000 values <- floor(cumsum(1/seq_len(n))) ## 0-based indexing like C++ positions <- c(0, 1, 1 + which(diff(values) == 1)) paste(positions, collapse = ", ") ## 0, 1, 4, 11, 31, 83, 227, 616, 1674, 4550, 12367, 33617, 91380, 248397, 675214, 1835421, 4989191, 13562027, 36865412
# create task tables for gif generation create_timestep_gif_tasks <- function(timestep_ind, folders){ # prepare a data.frame with one row per task timesteps <- readRDS(sc_retrieve(timestep_ind, '2_process.yml')) tasks <- data_frame(timestep=timesteps) %>% mutate(task_name = strftime(timestep, format = '%Y%m...
/6_visualize/src/create_gif_tasks.R
no_license
mwernimont/gage-conditions-gif
R
false
false
6,640
r
# create task tables for gif generation create_timestep_gif_tasks <- function(timestep_ind, folders){ # prepare a data.frame with one row per task timesteps <- readRDS(sc_retrieve(timestep_ind, '2_process.yml')) tasks <- data_frame(timestep=timesteps) %>% mutate(task_name = strftime(timestep, format = '%Y%m...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mclustcomp.R \name{mclustcomp} \alias{mclustcomp} \title{Measures for Comparing Clusterings} \usage{ mclustcomp(x, y, types = "all", tversky.param = list()) } \arguments{ \item{x, y}{vectors of clustering labels} \item{types}{\code{"all"} fo...
/mclustcomp/man/mclustcomp.Rd
no_license
akhikolla/updatedatatype-list3
R
false
true
5,532
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mclustcomp.R \name{mclustcomp} \alias{mclustcomp} \title{Measures for Comparing Clusterings} \usage{ mclustcomp(x, y, types = "all", tversky.param = list()) } \arguments{ \item{x, y}{vectors of clustering labels} \item{types}{\code{"all"} fo...
get_1000g <- function(x){ x1 <- do.call(rbind,lapply(strsplit(x,'\\|'),as.numeric)) colnames(x1)<-c('1000g_AF','1000g_Hom') as.data.frame(x1) } get_ExAC <- function(x){ x1 <- do.call(rbind,lapply(strsplit(x,'\\|'),as.numeric)) colnames(x1)<-c('ExAC_AC','ExAC_Hom','ExAC_AF') as.data.frame(x1) } get...
/SherryPlot/functions_essentialFile.R
no_license
SherryDong/create_plot_by_R_base
R
false
false
10,020
r
get_1000g <- function(x){ x1 <- do.call(rbind,lapply(strsplit(x,'\\|'),as.numeric)) colnames(x1)<-c('1000g_AF','1000g_Hom') as.data.frame(x1) } get_ExAC <- function(x){ x1 <- do.call(rbind,lapply(strsplit(x,'\\|'),as.numeric)) colnames(x1)<-c('ExAC_AC','ExAC_Hom','ExAC_AF') as.data.frame(x1) } get...
#' Reorder sections #' #' Reorder text sections in an e-book based on a user-provided function. #' #' Many e-books have chronologically ordered sections based on quality metadata. #' This results in properly book sections in the nested data frame. #' However, some poorly formatted e-books have their internal sections o...
/R/reorder.R
permissive
ropensci/epubr
R
false
false
2,478
r
#' Reorder sections #' #' Reorder text sections in an e-book based on a user-provided function. #' #' Many e-books have chronologically ordered sections based on quality metadata. #' This results in properly book sections in the nested data frame. #' However, some poorly formatted e-books have their internal sections o...
hm <- read.table("pt.PT_test2.hm.s100.0.txt") rep = c("LTR_Gypsy.rep_int.txt","LTR_Copia.rep_int.txt","LTR_Caulimovirus.rep_int.txt","RC_Helitron.rep_int.txt") pdf("Figure_8.pdf",height=15,width=20) hm <- read.table("pt.PT_test2.hm.s100.0.txt") par(mar = c(8.1,6.1, 3.1, 3.1)) par(mfrow=c(2,2)) read.table("LTR_Gypsy.rep...
/code/fig8/fig8.r
no_license
Ajinkya-IISERB/CoalRep
R
false
false
4,494
r
hm <- read.table("pt.PT_test2.hm.s100.0.txt") rep = c("LTR_Gypsy.rep_int.txt","LTR_Copia.rep_int.txt","LTR_Caulimovirus.rep_int.txt","RC_Helitron.rep_int.txt") pdf("Figure_8.pdf",height=15,width=20) hm <- read.table("pt.PT_test2.hm.s100.0.txt") par(mar = c(8.1,6.1, 3.1, 3.1)) par(mfrow=c(2,2)) read.table("LTR_Gypsy.rep...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot.R \name{plot_flight_vertical_time} \alias{plot_flight_vertical_time} \title{Plot the vertical profile of the recorded positions of a flight from lapsed time perspective.} \usage{ plot_flight_vertical_time(poss) } \arguments{ \item{poss}{...
/man/plot_flight_vertical_time.Rd
no_license
euctrl-pru/trrrj
R
false
true
800
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot.R \name{plot_flight_vertical_time} \alias{plot_flight_vertical_time} \title{Plot the vertical profile of the recorded positions of a flight from lapsed time perspective.} \usage{ plot_flight_vertical_time(poss) } \arguments{ \item{poss}{...
#### Herramientas para el Análisis de Series de Tiempo en R - Ejercitación 3 #### ## Limpiar la memoria rm(list=ls()) ## Apertura de librerias library(tidyverse) #Manejo de bases de datos y otros library(openxlsx) #Lectura de xlsx library(lubridate) #Manejo de variables en formato fecha library(zoo) #Seri...
/Clase 3/Ejercitacion 3.R
permissive
mateosuster/Series-de-Tiempo-en-R-CEPAL
R
false
false
5,045
r
#### Herramientas para el Análisis de Series de Tiempo en R - Ejercitación 3 #### ## Limpiar la memoria rm(list=ls()) ## Apertura de librerias library(tidyverse) #Manejo de bases de datos y otros library(openxlsx) #Lectura de xlsx library(lubridate) #Manejo de variables en formato fecha library(zoo) #Seri...
## intent list - association rule setwd("C://Users/Administrator/Desktop") intent_list<- read.csv("intent_list.csv", header= TRUE) head(intent_list) ## compute support intent01 <- aggregate(.~intent + next., intent_list, function(x) length(x)) head(intent01[order(intent01$X),]) names(intent01) ...
/IntentClassifier_SwitchingRules.R
no_license
realsh/yun
R
false
false
1,788
r
## intent list - association rule setwd("C://Users/Administrator/Desktop") intent_list<- read.csv("intent_list.csv", header= TRUE) head(intent_list) ## compute support intent01 <- aggregate(.~intent + next., intent_list, function(x) length(x)) head(intent01[order(intent01$X),]) names(intent01) ...
rm(list=ls()) #load libraries for data, plotting and testing library(OECD) library(ggplot2) library(lmtest) library(ggiraphExtra) library(tseries) library(mctest) library(scatterplot3d) #get data from OECD library inflation_data=get_dataset("KEI", filter="CP+CPALTT01.DNK.GP.A", start_time=1983, end_time=(2019)) unemp...
/Dan primo.R
no_license
DanishMarcellino/DanishR
R
false
false
3,288
r
rm(list=ls()) #load libraries for data, plotting and testing library(OECD) library(ggplot2) library(lmtest) library(ggiraphExtra) library(tseries) library(mctest) library(scatterplot3d) #get data from OECD library inflation_data=get_dataset("KEI", filter="CP+CPALTT01.DNK.GP.A", start_time=1983, end_time=(2019)) unemp...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ihme_latest.R \name{ihme_latest} \alias{ihme_latest} \title{Download the latest IHME projection} \usage{ ihme_latest(latestdate = "latest") } \arguments{ \item{latestdate}{A character string denoting the date of the projection, e.g. "May 12"....
/man/ihme_latest.Rd
no_license
eossiander/covidutilities
R
false
true
517
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ihme_latest.R \name{ihme_latest} \alias{ihme_latest} \title{Download the latest IHME projection} \usage{ ihme_latest(latestdate = "latest") } \arguments{ \item{latestdate}{A character string denoting the date of the projection, e.g. "May 12"....
#install.packages("tidyverse") library(tidyverse) library(readxl) # read in data income <- read_xlsx("income.xlsx") lifeex <- read_xlsx("life_expectancy.xlsx") # clean income data income2015 <- select(income,'GDP per capita',`2015.0`) income2015 <- filter(income2015,!is.na(`2015.0`)) income2015 <- rename(income2015,c...
/public_health_case_study.R
no_license
alonzi/open_data_case_study
R
false
false
1,622
r
#install.packages("tidyverse") library(tidyverse) library(readxl) # read in data income <- read_xlsx("income.xlsx") lifeex <- read_xlsx("life_expectancy.xlsx") # clean income data income2015 <- select(income,'GDP per capita',`2015.0`) income2015 <- filter(income2015,!is.na(`2015.0`)) income2015 <- rename(income2015,c...
# --------------------------------------------------------------------------- # # CBM systems paper - extended simulation study for revision - # Case B: failure times earlier than expected # --------------------------------------------------------------------------- # # packages, code files, example system source("ext...
/extsim-case-b.R
no_license
wuhaonn/cbm-rbd
R
false
false
2,733
r
# --------------------------------------------------------------------------- # # CBM systems paper - extended simulation study for revision - # Case B: failure times earlier than expected # --------------------------------------------------------------------------- # # packages, code files, example system source("ext...
# Set the working directory this.dir <- dirname(parent.frame(2)$ofile) setwd(this.dir) source("./init.R") loadData() print("Plotting") with(household,plot(Timestamp,Global_active_power, type="l", ylab="Global Active Power (kilowatts)", xlab="", ...
/plot2.R
no_license
zaros/ExData_Plotting1
R
false
false
472
r
# Set the working directory this.dir <- dirname(parent.frame(2)$ofile) setwd(this.dir) source("./init.R") loadData() print("Plotting") with(household,plot(Timestamp,Global_active_power, type="l", ylab="Global Active Power (kilowatts)", xlab="", ...
#' LK #' #' Compute the LK statistics from MVS allele frequencies #' @references RC Lewontin and J Krakauer. Distribution of gene frequency as a test of the theory of the selective neutrality of polymorphisms. Genetics 74(1):175–195. 1973 #' @details The LK is computed as follow, \eqn{LK=\frac{(n-1) Fst}{mean(F_{ST})}}...
/R/LK.R
no_license
madoui/metavariant
R
false
false
925
r
#' LK #' #' Compute the LK statistics from MVS allele frequencies #' @references RC Lewontin and J Krakauer. Distribution of gene frequency as a test of the theory of the selective neutrality of polymorphisms. Genetics 74(1):175–195. 1973 #' @details The LK is computed as follow, \eqn{LK=\frac{(n-1) Fst}{mean(F_{ST})}}...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ca-classes-methods.r \name{constructive_aggregation_} \alias{constructive_aggregation_} \title{constructive_aggregation_} \usage{ constructive_aggregation_(committee_obj, base_ensemble_obj) } \arguments{ \item{committee_obj}{\code{\link{commi...
/man/constructive_aggregation_.Rd
no_license
vcerqueira/tsensembler
R
false
true
658
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ca-classes-methods.r \name{constructive_aggregation_} \alias{constructive_aggregation_} \title{constructive_aggregation_} \usage{ constructive_aggregation_(committee_obj, base_ensemble_obj) } \arguments{ \item{committee_obj}{\code{\link{commi...
#' Cocoa water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Banana. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WyAv - Annual precipitation (mm) #' \item WmDryLen - Lengt...
/RDOCS/COCOAWater.R
no_license
alstat/ALUES_dataprep
R
false
false
820
r
#' Cocoa water requirement for land evaluation #' #' A dataset containing the water characteristics of the crop requirements for farming Banana. #' #' @details #' The following are the factors for evaluation: #' #' \itemize{ #' \item WyAv - Annual precipitation (mm) #' \item WmDryLen - Lengt...
# load functions source("functions/regulations-gov-API4.R") ################### # CFPB COMMENTS # init with first page of results, the most recent 250 comments CFPBcomments1 <- map_dfr(.x = c(1), .f = search_agency4, agency = "CFPB", documenttype = "Public Su...
/functions/regulations-gov-API4-example.R
no_license
zoeang/rulemaking
R
false
false
4,127
r
# load functions source("functions/regulations-gov-API4.R") ################### # CFPB COMMENTS # init with first page of results, the most recent 250 comments CFPBcomments1 <- map_dfr(.x = c(1), .f = search_agency4, agency = "CFPB", documenttype = "Public Su...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/peaks.annotations.R \name{peaks.annotaions} \alias{peaks.annotaions} \title{peaks.annotaions} \usage{ peaks.annotaions(peaks, ref, is.Ratio = T) } \arguments{ \item{peaks}{is a GenomeRanges object with matadata colum that is named 'TF' (TF - ...
/man/peaks.annotaions.Rd
no_license
anton-tsukanov/ClanChiPeaks
R
false
true
594
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/peaks.annotations.R \name{peaks.annotaions} \alias{peaks.annotaions} \title{peaks.annotaions} \usage{ peaks.annotaions(peaks, ref, is.Ratio = T) } \arguments{ \item{peaks}{is a GenomeRanges object with matadata colum that is named 'TF' (TF - ...
# Halla los divisores postivos de n # Los divisores propios son los divisores excluyendo a n # Uno = T, se incluye el 1 entre los divisores, uno = F no se incluye divisores <- function(n, propios=F, uno=T) { n <- trunc(abs(n)) # Convierte n en un entero positivo if(n == 1) {return(1)} if(uno) { inicio <- 1 ...
/algebra/divisores.R
no_license
jjdeharo/General
R
false
false
453
r
# Halla los divisores postivos de n # Los divisores propios son los divisores excluyendo a n # Uno = T, se incluye el 1 entre los divisores, uno = F no se incluye divisores <- function(n, propios=F, uno=T) { n <- trunc(abs(n)) # Convierte n en un entero positivo if(n == 1) {return(1)} if(uno) { inicio <- 1 ...
\name{Plot.Blend} \alias{Plot.Blend} \title{Plots of the results.} \description{Plots of the results of the joint analysis of the experiments.} \usage{Plot.Blend(BL, titles = c(NA,NA), posleg = 2, xlabel = NA, ylabel = NA, boxleg = FALSE, color = TRUE, expcolor = NA, casc = TRUE)} ...
/man/Plot.Blend.Rd
no_license
cran/Blendstat
R
false
false
2,402
rd
\name{Plot.Blend} \alias{Plot.Blend} \title{Plots of the results.} \description{Plots of the results of the joint analysis of the experiments.} \usage{Plot.Blend(BL, titles = c(NA,NA), posleg = 2, xlabel = NA, ylabel = NA, boxleg = FALSE, color = TRUE, expcolor = NA, casc = TRUE)} ...
library(RCurl) library(googleVis) tb_dict <- read.csv( text = getURL( "https://raw.githubusercontent.com/datamustekeers/WHOtb_data_analysis/master/data/TB_data_dictionary_2018-07-04.csv" ), header = T ) tb_data <- read.csv( text = getURL( "https://raw.githubusercontent.com/datamustek...
/sampleFile.R
no_license
GabuTheGreat/shinyDashboard
R
false
false
876
r
library(RCurl) library(googleVis) tb_dict <- read.csv( text = getURL( "https://raw.githubusercontent.com/datamustekeers/WHOtb_data_analysis/master/data/TB_data_dictionary_2018-07-04.csv" ), header = T ) tb_data <- read.csv( text = getURL( "https://raw.githubusercontent.com/datamustek...
#'Get crown radius of a plant #' #'Calculates the crown radius of a plant, given the x,y,z coordinates of the #'leaves. See Details. Typically not invoked by user, but used by #'\code{\link{summary.plant3d}} to estimate crown width. #' #'The crown radius is the distance from the centre of the plant to the furthes...
/R/getR.R
no_license
cran/YplantQMC
R
false
false
2,565
r
#'Get crown radius of a plant #' #'Calculates the crown radius of a plant, given the x,y,z coordinates of the #'leaves. See Details. Typically not invoked by user, but used by #'\code{\link{summary.plant3d}} to estimate crown width. #' #'The crown radius is the distance from the centre of the plant to the furthes...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/misc.R \name{step} \alias{step} \title{A General Step Wrapper} \usage{ step(subclass, ...) } \arguments{ \item{subclass}{A character string for the resulting class. For example, if \code{subclass = "blah"} the step object that is returned has...
/man/step.Rd
no_license
deann88/recipes
R
false
true
557
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/misc.R \name{step} \alias{step} \title{A General Step Wrapper} \usage{ step(subclass, ...) } \arguments{ \item{subclass}{A character string for the resulting class. For example, if \code{subclass = "blah"} the step object that is returned has...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/nice_p.R \name{nice_p} \alias{nice_p} \title{Create nice P-values} \usage{ nice_p(pval, digits = 4) } \arguments{ \item{pval}{P-value to be converted} \item{digits}{Number of digits to round} } \value{ A numeric object } \description{ This f...
/man/nice_p.Rd
no_license
bsurial/bernr
R
false
true
542
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/nice_p.R \name{nice_p} \alias{nice_p} \title{Create nice P-values} \usage{ nice_p(pval, digits = 4) } \arguments{ \item{pval}{P-value to be converted} \item{digits}{Number of digits to round} } \value{ A numeric object } \description{ This f...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/clean.R \name{clean} \alias{clean} \title{Clean the pheontype and expression data from TCGA} \usage{ clean(phe, expr) } \arguments{ \item{phe}{data.frame, the raw expression matrix with colname of molecular id and individual ids.} \item{expr...
/man/clean.Rd
no_license
Feng-Zhang/signatureFlow
R
false
true
668
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/clean.R \name{clean} \alias{clean} \title{Clean the pheontype and expression data from TCGA} \usage{ clean(phe, expr) } \arguments{ \item{phe}{data.frame, the raw expression matrix with colname of molecular id and individual ids.} \item{expr...
implement_error = function(U_target, SUM) { Ua = U_target * SUM Ub = SUM - Ua rbeta(1, Ua, Ub) } # U_target = runif(1000, 0.01, 0.99) # U_real = sapply(U_target, function(x) implement_error(U_target = x, SUM = 10)) # # windows() # plot(U_target ~ U_real)
/SimFitSRA/Functions/z3_implement_error_function.R
no_license
bstaton1/r-n-shell
R
false
false
269
r
implement_error = function(U_target, SUM) { Ua = U_target * SUM Ub = SUM - Ua rbeta(1, Ua, Ub) } # U_target = runif(1000, 0.01, 0.99) # U_real = sapply(U_target, function(x) implement_error(U_target = x, SUM = 10)) # # windows() # plot(U_target ~ U_real)
library(DiceKriging) library(rgl) library(MASS) ###################################### ###################################### ## Partie 2 : fonction de Branin ###################################### ###################################### ## plot of the test function n.grid <- 50 x.grid <- y.grid <- seq(0,1...
/labSessions/TP2/R/students_script.R
no_license
NicolasDurrande/EMSE_Gaussian_process_models
R
false
false
1,424
r
library(DiceKriging) library(rgl) library(MASS) ###################################### ###################################### ## Partie 2 : fonction de Branin ###################################### ###################################### ## plot of the test function n.grid <- 50 x.grid <- y.grid <- seq(0,1...
# Exercise 1: practice with basic R syntax # Create a variable `hometown` that stores the city in which you were born hometown <- "Columbus" # Assign your name to the variable `my_name` my_name <- "Cindy" # Assign your height (in inches) to a variable `my_height` my_height <- "60" # Create a variable `puppies` equa...
/chapter-05-exercises/exercise-1/exercise.R
permissive
ckzhao/book-exercises
R
false
false
818
r
# Exercise 1: practice with basic R syntax # Create a variable `hometown` that stores the city in which you were born hometown <- "Columbus" # Assign your name to the variable `my_name` my_name <- "Cindy" # Assign your height (in inches) to a variable `my_height` my_height <- "60" # Create a variable `puppies` equa...
# # This is the user-interface definition of a Shiny web application. You can # run the application by clicking 'Run App' above. # # Find out more about building applications with Shiny here: # # http://shiny.rstudio.com/ # library(shiny) shinyUI(fluidPage( titlePanel("Predict Income from Education ...
/ui.R
no_license
wtf13/data-products
R
false
false
818
r
# # This is the user-interface definition of a Shiny web application. You can # run the application by clicking 'Run App' above. # # Find out more about building applications with Shiny here: # # http://shiny.rstudio.com/ # library(shiny) shinyUI(fluidPage( titlePanel("Predict Income from Education ...
################################################################ ### Code for lecture 6: Model Selection in Survival Analysis ### ################################################################ halibut = read.table("h:/teaching/athens/BIO223 (Survival-Yiannoutsos)/data/halibut.dat", quote="\"") names(halibut) = ...
/Survival Analysis/Lectures/Lecture 6/Rcode/lecture6.R
no_license
MichaelBelias/My-Complete-Book-In-R
R
false
false
9,740
r
################################################################ ### Code for lecture 6: Model Selection in Survival Analysis ### ################################################################ halibut = read.table("h:/teaching/athens/BIO223 (Survival-Yiannoutsos)/data/halibut.dat", quote="\"") names(halibut) = ...
#source("~/buckets/b1/crudoB/R/823_epic.r") #Necesita para correr en Google Cloud #16 GB de memoria RAM #256 GB de espacio en el disco local #8 vCPU #clase_binaria2 1={BAJA+2,BAJA+1} 0={CONTINUA} #Entrena en 202009 con 5-fold cross validation #Aplica el modelo a 202011 #funciona automaticamente con ...
/823_epic_V2.R
no_license
CristiandSoraci/scripts_dm
R
false
false
18,519
r
#source("~/buckets/b1/crudoB/R/823_epic.r") #Necesita para correr en Google Cloud #16 GB de memoria RAM #256 GB de espacio en el disco local #8 vCPU #clase_binaria2 1={BAJA+2,BAJA+1} 0={CONTINUA} #Entrena en 202009 con 5-fold cross validation #Aplica el modelo a 202011 #funciona automaticamente con ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/reporter-stop.R \docType{data} \name{StopReporter} \alias{StopReporter} \title{Test reporter: stop on error.} \format{An object of class \code{R6ClassGenerator} of length 24.} \usage{ StopReporter } \description{ The default reporter, execute...
/man/StopReporter.Rd
no_license
bedatadriven/testthat
R
false
true
1,153
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/reporter-stop.R \docType{data} \name{StopReporter} \alias{StopReporter} \title{Test reporter: stop on error.} \format{An object of class \code{R6ClassGenerator} of length 24.} \usage{ StopReporter } \description{ The default reporter, execute...
#' Author: Ted Kwartler #' Date: 6-30-2018 #' Purpose: Rewrite the C14 Example # Libs library(arules) # WD setwd("C:/Users/Edward/Desktop/HarvardSummerAdmin2018/Lessons/6_July24-Ethics_RecoEngines_Clustering/day6_data") # Data faceDF <- read.csv("Faceplate.csv") # Examine faceDF # Drop Transaction ID & convert to ...
/lessons/6_July24-Ethics_RecoEngines_Clustering/day6_scripts/A_AssociationRules.R
no_license
bpratt1/HarvardSummerStudent2018
R
false
false
2,680
r
#' Author: Ted Kwartler #' Date: 6-30-2018 #' Purpose: Rewrite the C14 Example # Libs library(arules) # WD setwd("C:/Users/Edward/Desktop/HarvardSummerAdmin2018/Lessons/6_July24-Ethics_RecoEngines_Clustering/day6_data") # Data faceDF <- read.csv("Faceplate.csv") # Examine faceDF # Drop Transaction ID & convert to ...
##Write a program that prints the multiplication table for numbers up to 12. print("Enter the number n to print multiplication table of any number from 1 to 12"); p<-as.integer(readline()); if(p >= 12) { print("Please enter a valid number,enter the number AGAIN from 1 to 12"); p<-as.integer(readline()); } f...
/multiplication_table.R
no_license
pranavgurditta/R-programs
R
false
false
383
r
##Write a program that prints the multiplication table for numbers up to 12. print("Enter the number n to print multiplication table of any number from 1 to 12"); p<-as.integer(readline()); if(p >= 12) { print("Please enter a valid number,enter the number AGAIN from 1 to 12"); p<-as.integer(readline()); } f...
#INFO 201 M18 Exercise 5 Server #Require the following: shiny, HSUAR, dyplr, and ggplot2 library(shiny) library(HSAUR) library(dplyr) library(ggplot2) #Load the dataset 'womensrole' from the HSUAR package (same way you would load a built in dataset) data <- womensrole #Here you will define the data that is shown ba...
/exercise-5/server.R
permissive
andyjohnson70/m18-shiny
R
false
false
1,671
r
#INFO 201 M18 Exercise 5 Server #Require the following: shiny, HSUAR, dyplr, and ggplot2 library(shiny) library(HSAUR) library(dplyr) library(ggplot2) #Load the dataset 'womensrole' from the HSUAR package (same way you would load a built in dataset) data <- womensrole #Here you will define the data that is shown ba...
#------------------------------------------------------------- # # 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...
/src/test/scripts/functions/frame/FrameLeftIndexing.R
permissive
apache/systemds
R
false
false
1,745
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...
library("lme4") library("lmerTest") library("lattice") library("plyr") library("dplyr") library("ggplot2") library("emmeans") library("Rmisc") #library("MASS") library("multcomp") library("reshape2") library("tidyr") #library("data.table") library("Hmisc") library("stringr") ######################## # theme for plot...
/R_Scripts/Pericytes/In vivo/John and Megan/Pericyte_oscillations_vel_invivo_MR.R
no_license
jstobart/Jill_ca_analysis_tests
R
false
false
5,549
r
library("lme4") library("lmerTest") library("lattice") library("plyr") library("dplyr") library("ggplot2") library("emmeans") library("Rmisc") #library("MASS") library("multcomp") library("reshape2") library("tidyr") #library("data.table") library("Hmisc") library("stringr") ######################## # theme for plot...
#+ Setup remotes::install_github('rmcelreath/rethinking', upgrade=F) library(rethinking) #' ## R code 6.1 #+ R code 6.1 set.seed(1914) N <- 200 # num grant proposals p <- 0.1 # proportion to select # uncorrelated newsworthiness and trustworthiness nw <- rnorm(N) tw <- rnorm(N) # select top 10% of combined scores s <-...
/scripts/ch06.R
no_license
liao961120/rethinking_code
R
false
false
7,601
r
#+ Setup remotes::install_github('rmcelreath/rethinking', upgrade=F) library(rethinking) #' ## R code 6.1 #+ R code 6.1 set.seed(1914) N <- 200 # num grant proposals p <- 0.1 # proportion to select # uncorrelated newsworthiness and trustworthiness nw <- rnorm(N) tw <- rnorm(N) # select top 10% of combined scores s <-...
valiData::comma_broken_report(valiData::vf_comma_broken("~/Desktop/fake/Academic_terms.csv") l<- dir("~/Desktop/fake",full.names = T, pattern = ".csv") x<- lapply(l,valiData:::vf_csv_broken) cat(valiData:::comma_broken_report(x) ) ...
/_backlog/shinyHappy/practice_scripts.R
permissive
data-steve/data-steve.github.io
R
false
false
715
r
valiData::comma_broken_report(valiData::vf_comma_broken("~/Desktop/fake/Academic_terms.csv") l<- dir("~/Desktop/fake",full.names = T, pattern = ".csv") x<- lapply(l,valiData:::vf_csv_broken) cat(valiData:::comma_broken_report(x) ) ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/scorecard_class.R \name{Scorecard_adjust} \alias{Scorecard_adjust} \alias{Scorecard_adjust} \title{Scorecard adjust method entry point} \description{ Scorecard adjust method entry point Scorecard adjust method entry point } \details{ calling...
/man/Scorecard_adjust.Rd
no_license
gravesee/rubbish
R
false
true
498
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/scorecard_class.R \name{Scorecard_adjust} \alias{Scorecard_adjust} \alias{Scorecard_adjust} \title{Scorecard adjust method entry point} \description{ Scorecard adjust method entry point Scorecard adjust method entry point } \details{ calling...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/methyl_circle_plot.R \name{methyl_circle_plot} \alias{methyl_circle_plot} \title{Draw methylation circle plot} \usage{ methyl_circle_plot( snp, vcfFile, bamFile, refFile, build = "hg19", dame = NULL, letterSize = 2.5, pointSiz...
/man/methyl_circle_plot.Rd
permissive
JianpingQuan/DAMEfinder
R
false
true
2,119
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/methyl_circle_plot.R \name{methyl_circle_plot} \alias{methyl_circle_plot} \title{Draw methylation circle plot} \usage{ methyl_circle_plot( snp, vcfFile, bamFile, refFile, build = "hg19", dame = NULL, letterSize = 2.5, pointSiz...
setwd("C:/DataScience/course-4/exdata_data_household_power_consumption") #Reading, naming and subsetting power consumption data dataFile <- "C:\\DataScience\\course-4\\exdata_data_household_power_consumption\\household_power_consumption.txt" data <- read.table(dataFile, header=TRUE, sep=";", stringsAsFactors=FALSE, d...
/plot4.R
no_license
jchagger/ExData_Plotting1
R
false
false
1,503
r
setwd("C:/DataScience/course-4/exdata_data_household_power_consumption") #Reading, naming and subsetting power consumption data dataFile <- "C:\\DataScience\\course-4\\exdata_data_household_power_consumption\\household_power_consumption.txt" data <- read.table(dataFile, header=TRUE, sep=";", stringsAsFactors=FALSE, d...
options(repr.plot.width=13, repr.plot.height=5.5) data_graph <- data %>% mutate(open_char = ifelse(open == 1, 'Open', 'Closed')) %>% group_by(open_char, day_week) %>% summarize(total_events_by_open_close = sum(exist)) %>% ungroup() data_graph <- data_graph %>% left_join(totals) data_graph <- data...
/Mode/roadster/spaces/_DEV SANDBOX/Activity By Hour.abe869456dbb/notebook/cell-number-6.fe0ba3f83d2e.r
no_license
DMilmont/mode
R
false
false
960
r
options(repr.plot.width=13, repr.plot.height=5.5) data_graph <- data %>% mutate(open_char = ifelse(open == 1, 'Open', 'Closed')) %>% group_by(open_char, day_week) %>% summarize(total_events_by_open_close = sum(exist)) %>% ungroup() data_graph <- data_graph %>% left_join(totals) data_graph <- data...
################################################################################ # Sampling Central: Alla # Cria um stream simples para cada coluna do histograma dos dados # Usa os elementos mais centrais de cada coluna do histograma para fazer a amostragem sampleCentral <- function(dataGeo_, sampleSize_){ histNum...
/Simulations/Parameters/headers/algorithms.R
no_license
SensorNet-UFAL/DTN-Model4EnvApplications
R
false
false
13,813
r
################################################################################ # Sampling Central: Alla # Cria um stream simples para cada coluna do histograma dos dados # Usa os elementos mais centrais de cada coluna do histograma para fazer a amostragem sampleCentral <- function(dataGeo_, sampleSize_){ histNum...
# # Copyright SAS Institute # # Licensed under the Apache License, Version 2.0 (the License); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
/tests/testthat/test.rswat.R
permissive
kesmit13/R-swat
R
false
false
16,214
r
# # Copyright SAS Institute # # Licensed under the Apache License, Version 2.0 (the License); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{c.stim} \alias{c.stim} \title{Combine stim} \usage{ \method{c}{stim}(...) } \arguments{ \item{...}{stim to be concatenated} } \value{ stimlist } \description{ Combine stim } \keyword{internal}
/man/c.stim.Rd
permissive
debruine/webmorphR
R
false
true
285
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{c.stim} \alias{c.stim} \title{Combine stim} \usage{ \method{c}{stim}(...) } \arguments{ \item{...}{stim to be concatenated} } \value{ stimlist } \description{ Combine stim } \keyword{internal}
# Machining Learning # Aula 1 # Prof. Neylson Crepalde # Lucas Cesar Fernandes Ferreira # -------------------------------- # # Vamos investigar a relação entre as variáveis # Sepal.Length e Petal.Length do banco de dados iris # Carregar o banco de dados data(iris) # Verifica os primeiros casos head(iris...
/Aula1.R
no_license
Abalord/Machine-Learning
R
false
false
825
r
# Machining Learning # Aula 1 # Prof. Neylson Crepalde # Lucas Cesar Fernandes Ferreira # -------------------------------- # # Vamos investigar a relação entre as variáveis # Sepal.Length e Petal.Length do banco de dados iris # Carregar o banco de dados data(iris) # Verifica os primeiros casos head(iris...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ISOParameterDirection.R \docType{class} \name{ISOParameterDirection} \alias{ISOParameterDirection} \title{ISOParameterDirection} \format{ \code{\link{R6Class}} object. } \value{ Object of \code{\link{R6Class}} for modelling an ISOPa...
/man/ISOParameterDirection.Rd
no_license
cran/geometa
R
false
true
9,693
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ISOParameterDirection.R \docType{class} \name{ISOParameterDirection} \alias{ISOParameterDirection} \title{ISOParameterDirection} \format{ \code{\link{R6Class}} object. } \value{ Object of \code{\link{R6Class}} for modelling an ISOPa...
## run TAGM require(pRoloc) load(file = "arabidposis_pbsrep1.rda") fData(arabidposis_pbsrep1)$markers[fData(arabidposis_pbsrep1)$markers %in% c("cytosolic ribosomes", "extracellular")] <- "unknown" mcmc_arabidposis_pbsrep1 <- tagmMcmcTrain(object = arabidposis_pbsrep1, fcol = "markers", ...
/hpcscripts/araPBSrep1.R
no_license
ococrook/2020-Harriet-Arabidopsis
R
false
false
497
r
## run TAGM require(pRoloc) load(file = "arabidposis_pbsrep1.rda") fData(arabidposis_pbsrep1)$markers[fData(arabidposis_pbsrep1)$markers %in% c("cytosolic ribosomes", "extracellular")] <- "unknown" mcmc_arabidposis_pbsrep1 <- tagmMcmcTrain(object = arabidposis_pbsrep1, fcol = "markers", ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/model.R \name{ord.inits} \alias{ord.inits} \title{Identify the order of an inits} \usage{ \method{ord}{inits}(x, ...) } \arguments{ \item{x}{inits} \item{...}{ignored} } \value{ numeric } \description{ Identifies the order of an inits. } \de...
/man/ord.inits.Rd
no_license
bergsmat/nonmemica
R
false
true
514
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/model.R \name{ord.inits} \alias{ord.inits} \title{Identify the order of an inits} \usage{ \method{ord}{inits}(x, ...) } \arguments{ \item{x}{inits} \item{...}{ignored} } \value{ numeric } \description{ Identifies the order of an inits. } \de...
fitted.fittedlooplist2r <- function(object,...){ g <- object thenames <- g$Estimates[,1:(which(colnames(g$Estimates)=="n")-1)] thelengths <- lapply(g$models, function(x) length(x$pred.x)) rowvec <- mapply(function(x,y) rep(x,each=y),1:length(thelengths),y=thelengths) thenames <- thenames[rowvec,] ...
/hysteresis/R/fitted.fittedlooplist2r.R
no_license
ingted/R-Examples
R
false
false
564
r
fitted.fittedlooplist2r <- function(object,...){ g <- object thenames <- g$Estimates[,1:(which(colnames(g$Estimates)=="n")-1)] thelengths <- lapply(g$models, function(x) length(x$pred.x)) rowvec <- mapply(function(x,y) rep(x,each=y),1:length(thelengths),y=thelengths) thenames <- thenames[rowvec,] ...
testlist <- list(Beta = 0, CVLinf = -1.37672045511449e-268, FM = 3.81959242373749e-313, L50 = 0, L95 = 0, LenBins = 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), LenMids = numeric(0), Linf = 0, MK = 0, Ml = numeric(0), Prob = structure(0, .Dim = c(1L, 1L)), SL50 = 9.9794...
/DLMtool/inst/testfiles/LBSPRgen/AFL_LBSPRgen/LBSPRgen_valgrind_files/1615827051-test.R
no_license
akhikolla/updatedatatype-list2
R
false
false
487
r
testlist <- list(Beta = 0, CVLinf = -1.37672045511449e-268, FM = 3.81959242373749e-313, L50 = 0, L95 = 0, LenBins = 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), LenMids = numeric(0), Linf = 0, MK = 0, Ml = numeric(0), Prob = structure(0, .Dim = c(1L, 1L)), SL50 = 9.9794...
varWeights <- function(formula, data) { # Extract the variables from the formula. vars <- as.character(attr(terms(model.frame(formula, data)), "variables"))[-1L] target <- vars[[1]] inputs <- vars[-1] # Obtain the absolute correlations between x and the target. abscor <- function(x) abs(suppress...
/package/R/varWeights.R
no_license
araymund/wsrpart
R
false
false
1,043
r
varWeights <- function(formula, data) { # Extract the variables from the formula. vars <- as.character(attr(terms(model.frame(formula, data)), "variables"))[-1L] target <- vars[[1]] inputs <- vars[-1] # Obtain the absolute correlations between x and the target. abscor <- function(x) abs(suppress...
##This R Script would select required data from household_power_consumption.txt ##assumption is the txt file is in exdata_data_household_power_consumption directory under working ##directory. In this example sqldf used to extract the required data for ploting plot1 #Include libraries. If any library not found then ins...
/plot1.R
no_license
ajitap/ExData_Plotting1
R
false
false
1,128
r
##This R Script would select required data from household_power_consumption.txt ##assumption is the txt file is in exdata_data_household_power_consumption directory under working ##directory. In this example sqldf used to extract the required data for ploting plot1 #Include libraries. If any library not found then ins...
context("simulation") test_that("simulate_data", { # simulate data r <- raster::raster(matrix(1, ncol = 100, nrow = 100)) s <- simulate_data(r, n = 2, model = RandomFields::RMgauss(), transform = plogis) # check simulated data expect_true(raster::compareRaster(r, s[[1]], res = TRUE, orig...
/tests/testthat/test_simulate.R
no_license
IsaakBM/prioritizr
R
false
false
1,483
r
context("simulation") test_that("simulate_data", { # simulate data r <- raster::raster(matrix(1, ncol = 100, nrow = 100)) s <- simulate_data(r, n = 2, model = RandomFields::RMgauss(), transform = plogis) # check simulated data expect_true(raster::compareRaster(r, s[[1]], res = TRUE, orig...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/S3_definitions.R \name{print.rate} \alias{print.rate} \title{Print an rate object} \usage{ \method{print}{rate}(x, subset = NULL, ...) } \arguments{ \item{x}{an \code{rate} object} \item{subset}{a logical condition to subset results table by...
/man/print.rate.Rd
no_license
mattdowle/popEpi
R
false
true
631
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/S3_definitions.R \name{print.rate} \alias{print.rate} \title{Print an rate object} \usage{ \method{print}{rate}(x, subset = NULL, ...) } \arguments{ \item{x}{an \code{rate} object} \item{subset}{a logical condition to subset results table by...
#' Pipe operator #' #' @name %>% #' @rdname pipe #' @keywords internal #' @export #' @importFrom magrittr %>% #' @usage lhs \%>\% rhs NULL # global vars (rlang::.data not working) if(getRversion() >= "2.15.1") utils::globalVariables( c(".", "altitude", "latitude", "longitude", "setNames", "estado", "cidade", "...
/R/xxx.R
no_license
rcleoni/cepR
R
false
false
512
r
#' Pipe operator #' #' @name %>% #' @rdname pipe #' @keywords internal #' @export #' @importFrom magrittr %>% #' @usage lhs \%>\% rhs NULL # global vars (rlang::.data not working) if(getRversion() >= "2.15.1") utils::globalVariables( c(".", "altitude", "latitude", "longitude", "setNames", "estado", "cidade", "...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/irf.R \name{irf} \alias{irf} \title{Impulse Response Function} \usage{ irf(x, n.ahead=24, ident=NULL, shockinfo=NULL, save.store=FALSE, applyfun=NULL, cores=NULL, verbose=TRUE) } \arguments{ \item{x}{object of class \code{bvar}.} ...
/man/irf.Rd
no_license
lnsongxf/BTSM
R
false
true
1,163
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/irf.R \name{irf} \alias{irf} \title{Impulse Response Function} \usage{ irf(x, n.ahead=24, ident=NULL, shockinfo=NULL, save.store=FALSE, applyfun=NULL, cores=NULL, verbose=TRUE) } \arguments{ \item{x}{object of class \code{bvar}.} ...