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
\name{set.outgroup-methods} \docType{methods} \alias{set.outgroup,GENOME-method} \alias{set.outgroup-methods} \title{Define an outgroup} \description{ This generic function defines the outgroup by matching the specified vector against each region. \cr } \usage{ \S4method{set.outgroup}{GENOME}(object,new.outgro...
/man/set.outgroup-methods.Rd
no_license
pievos101/PopGenome
R
false
false
750
rd
\name{set.outgroup-methods} \docType{methods} \alias{set.outgroup,GENOME-method} \alias{set.outgroup-methods} \title{Define an outgroup} \description{ This generic function defines the outgroup by matching the specified vector against each region. \cr } \usage{ \S4method{set.outgroup}{GENOME}(object,new.outgro...
minpop <- function(datmat){ # function to find minimum population of matrix, assume data for different life stages are in columns, each row is diff time step apply(datmat, 1, sum) -> tpop min(tpop) -> minpop return(minpop) }
/R/minpop.r
no_license
openfields/Ambcitsci
R
false
false
226
r
minpop <- function(datmat){ # function to find minimum population of matrix, assume data for different life stages are in columns, each row is diff time step apply(datmat, 1, sum) -> tpop min(tpop) -> minpop return(minpop) }
#----------------------------------------------------------------------- # Copyright (C) 2012-2016 Serge Iovleff, University Lille 1, Inria # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as # published by the Free Software Fo...
/fuzzedpackages/MixAll/R/kmmNames.R
no_license
akhikolla/testpackages
R
false
false
3,738
r
#----------------------------------------------------------------------- # Copyright (C) 2012-2016 Serge Iovleff, University Lille 1, Inria # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as # published by the Free Software Fo...
#' #' @title #' Combinatorially Symmetric Cross-validation (CSCV) #' #' @description #' Performs combinatorial symmetric cross-validation #' given a true matrix 'M' and 'S' number of composite sub-matrices. #' #' @details #' 'cscv' performs the CSCV algorithim as detailed by Bailey et al (2015) #' The Probability ...
/R/cscv.R
permissive
Nourdine2015/quanttools
R
false
false
19,471
r
#' #' @title #' Combinatorially Symmetric Cross-validation (CSCV) #' #' @description #' Performs combinatorial symmetric cross-validation #' given a true matrix 'M' and 'S' number of composite sub-matrices. #' #' @details #' 'cscv' performs the CSCV algorithim as detailed by Bailey et al (2015) #' The Probability ...
version="Pu-seq analysis v1.0" ##functions moving.ave <- function(data, n){ r <- c() for(i in 1:length(data)){ d.data = data[max(1,i-n): min(length(data), i+n)] d.data <- d.data[!is.infinite(d.data)] # exluding "Inf" d.data <- d.data[!is.nan(d.data)] # exluding "NaN" r[i]=mean(d.data) ...
/Pu-seq.R
no_license
yasukasu/Pu-seq.R
R
false
false
17,425
r
version="Pu-seq analysis v1.0" ##functions moving.ave <- function(data, n){ r <- c() for(i in 1:length(data)){ d.data = data[max(1,i-n): min(length(data), i+n)] d.data <- d.data[!is.infinite(d.data)] # exluding "Inf" d.data <- d.data[!is.nan(d.data)] # exluding "NaN" r[i]=mean(d.data) ...
############################################## #To start off we can clear all the variables #from the current environment #and close all the plots. ############################################## rm(list = ls()) graphics.off() library("aimsir17") library("astsa") library("dplyr") library("forecast") library("ggplot2")...
/WindGForecasting.R
permissive
Tianle97/Forecasting_IEWEnergy
R
false
false
2,452
r
############################################## #To start off we can clear all the variables #from the current environment #and close all the plots. ############################################## rm(list = ls()) graphics.off() library("aimsir17") library("astsa") library("dplyr") library("forecast") library("ggplot2")...
source("fetch_data.R") plot1 <- function(data=NULL) { if(is.null(data)) data <- fetch_data() png("plot1.png", width=480, height=480, units='px', bg='white') hist(data$Global_active_power, main="Global Active Power", xlab="Global Active Power (kilowatts)", ylab="Frequency", c...
/plot1.R
no_license
saicool/ExData_Plotting1
R
false
false
347
r
source("fetch_data.R") plot1 <- function(data=NULL) { if(is.null(data)) data <- fetch_data() png("plot1.png", width=480, height=480, units='px', bg='white') hist(data$Global_active_power, main="Global Active Power", xlab="Global Active Power (kilowatts)", ylab="Frequency", c...
extractSubRaster <- function(file,r,c,size,factor){ raw <- raster(file) return(data.frame(simplifyBlock(getValuesBlock(raw,row=r,nrows=size,col=c,ncols=size),factor,size)/100)) #r<-setExtent(r,extent(raster(paste0(Sys.getenv("CN_HOME"),'/Models/Synthetic/Density/temp_raster_pop.asc')))) #writeRaster(r,paste0(Sy...
/R/extractSubRaster.R
no_license
JusteRaimbault/r-spatialmorphology
R
false
false
422
r
extractSubRaster <- function(file,r,c,size,factor){ raw <- raster(file) return(data.frame(simplifyBlock(getValuesBlock(raw,row=r,nrows=size,col=c,ncols=size),factor,size)/100)) #r<-setExtent(r,extent(raster(paste0(Sys.getenv("CN_HOME"),'/Models/Synthetic/Density/temp_raster_pop.asc')))) #writeRaster(r,paste0(Sy...
\name{AHE_master} \alias{AHE_master} \docType{data} \title{AHE_master} \description{Master dataset for the continent of Africa by country including varaibles to aid in the study of environment, behavior and human health. As of now, the master dataset contains cross sectional data for 2016 but will eventually include pa...
/man/AHE_master.Rd
no_license
erinabbott5/AfricaEnvHealth
R
false
false
1,946
rd
\name{AHE_master} \alias{AHE_master} \docType{data} \title{AHE_master} \description{Master dataset for the continent of Africa by country including varaibles to aid in the study of environment, behavior and human health. As of now, the master dataset contains cross sectional data for 2016 but will eventually include pa...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/text_mining.R \name{textTokenizer} \alias{textTokenizer} \title{Tokenize Vectors into Words} \usage{ textTokenizer( text, exclude = NA, lang = NA, min_word_freq = 5, min_word_len = 2, keep_spaces = FALSE, lowercase = TRUE, rem...
/man/textTokenizer.Rd
no_license
vahidnouri/lares
R
false
true
2,799
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/text_mining.R \name{textTokenizer} \alias{textTokenizer} \title{Tokenize Vectors into Words} \usage{ textTokenizer( text, exclude = NA, lang = NA, min_word_freq = 5, min_word_len = 2, keep_spaces = FALSE, lowercase = TRUE, rem...
library(shiny) library(shinydashboard) d<-getwd() setwd(d) source("Svm.R") options(warn = -1) shinyServer<-function(input, output){ Data <- data.frame() Results <- reactive(data.frame(input$age, input$gender, input$cp, input$restingbp, input$cholestrol, input$fastingbp, input$restc...
/server.R
no_license
aadityajain545/Heart-Disease-Prediction
R
false
false
939
r
library(shiny) library(shinydashboard) d<-getwd() setwd(d) source("Svm.R") options(warn = -1) shinyServer<-function(input, output){ Data <- data.frame() Results <- reactive(data.frame(input$age, input$gender, input$cp, input$restingbp, input$cholestrol, input$fastingbp, input$restc...
# This file will contain all functions realated to KARMA DATA Processing. ################# DataSource Metadata ####################### ## DataSource Metadata :- Function to create a dataframe (to use this dataframe again) kfnGetDataSourceMetadata <- function(){ SourceData <- data.frame( DSID = as.integer(1), ...
/Shiny Auth App/KarmaDataFunctions.R
no_license
AshutoshAgrahari/R_Practice
R
false
false
6,880
r
# This file will contain all functions realated to KARMA DATA Processing. ################# DataSource Metadata ####################### ## DataSource Metadata :- Function to create a dataframe (to use this dataframe again) kfnGetDataSourceMetadata <- function(){ SourceData <- data.frame( DSID = as.integer(1), ...
library(ggplot2) asyncResults <- read.csv("./async-results.csv") names(asyncResults) <- c("time") syncResults <- read.csv("./sync-results.csv") names(syncResults) <- c("time") results <- data.frame(time=numeric(), type=character()) for (time in asyncResults$time) { results <- rbind(results, list(time=c(as.numeric(...
/analysis.r
no_license
halbgut/stream-api-performance
R
false
false
668
r
library(ggplot2) asyncResults <- read.csv("./async-results.csv") names(asyncResults) <- c("time") syncResults <- read.csv("./sync-results.csv") names(syncResults) <- c("time") results <- data.frame(time=numeric(), type=character()) for (time in asyncResults$time) { results <- rbind(results, list(time=c(as.numeric(...
# simulate.R # R version of Excel sheet HEMAA model_Simulation_17Nov_E.coli and five other sheets # Apr 2017 simulate = function(inbug, inresBSI, inresResp, inresUTI){ set.seed(1234) # to avoid getting different answer when re-trying previous resistance level ## common parameters n.sims = 100000 # can be la...
/simulate.R
no_license
agbarnett/costEcoli
R
false
false
6,419
r
# simulate.R # R version of Excel sheet HEMAA model_Simulation_17Nov_E.coli and five other sheets # Apr 2017 simulate = function(inbug, inresBSI, inresResp, inresUTI){ set.seed(1234) # to avoid getting different answer when re-trying previous resistance level ## common parameters n.sims = 100000 # can be la...
#' Get loudness #' #' Estimates subjective loudness per frame, in sone. Based on EMBSD speech #' quality measure, particularly the matlab code in Yang (1999) and Timoney et #' al. (2004). Note that there are many ways to estimate loudness and many other #' factors, ignored by this model, that could influence subjective...
/R/loudness.R
no_license
fxcebx/soundgen
R
false
false
16,055
r
#' Get loudness #' #' Estimates subjective loudness per frame, in sone. Based on EMBSD speech #' quality measure, particularly the matlab code in Yang (1999) and Timoney et #' al. (2004). Note that there are many ways to estimate loudness and many other #' factors, ignored by this model, that could influence subjective...
library(tidymodels) library(tune) library(mlbench) data(PimaIndiansDiabetes) # ------------------------------------------------------------------------------ set.seed(151) pima_rs <- vfold_cv(PimaIndiansDiabetes, repeats = 3) tree_mod <- decision_tree(cost_complexity = tune(), min_n = tune()) %>% set_mode("clas...
/inst/examples/pima_cart.R
no_license
NanaAkwasiAbayieBoateng/tune
R
false
false
873
r
library(tidymodels) library(tune) library(mlbench) data(PimaIndiansDiabetes) # ------------------------------------------------------------------------------ set.seed(151) pima_rs <- vfold_cv(PimaIndiansDiabetes, repeats = 3) tree_mod <- decision_tree(cost_complexity = tune(), min_n = tune()) %>% set_mode("clas...
maxFileSize=100 options(shiny.maxRequestSize=maxFileSize*1024^2) options(shiny.launch.browser = .rs.invokeShinyWindowExternal) shiny::runApp("~/App-evalDecoys/")
/launchEvalDecoyShinyApp.R
permissive
GTPB/PDA18
R
false
false
162
r
maxFileSize=100 options(shiny.maxRequestSize=maxFileSize*1024^2) options(shiny.launch.browser = .rs.invokeShinyWindowExternal) shiny::runApp("~/App-evalDecoys/")
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/OptiNum.R \name{OptiNum} \alias{OptiNum} \title{Finding an optimal number of clusters} \source{ Malika Charrad, Nadia Ghazzali, Veronique Boiteau, Azam Niknafs (2014). NbClust: An R Package for Determining the Relevant Number of Cluster...
/man/OptiNum.Rd
no_license
cran/CluMP
R
false
true
2,086
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/OptiNum.R \name{OptiNum} \alias{OptiNum} \title{Finding an optimal number of clusters} \source{ Malika Charrad, Nadia Ghazzali, Veronique Boiteau, Azam Niknafs (2014). NbClust: An R Package for Determining the Relevant Number of Cluster...
#' The 'Warp' class object #' #' This class provide the warping method which can be used to warp the original signal to sinusoidal like signal. #' @docType class #' @importFrom R6 R6Class #' @export #' @keywords data #' @return an \code{\link{R6Class}} object which can be used for doing interpolation using reproduci...
/R/WarpSin.r
no_license
mu2013/KGode
R
false
false
8,092
r
#' The 'Warp' class object #' #' This class provide the warping method which can be used to warp the original signal to sinusoidal like signal. #' @docType class #' @importFrom R6 R6Class #' @export #' @keywords data #' @return an \code{\link{R6Class}} object which can be used for doing interpolation using reproduci...
list.of.packages <- c("data.table","sp","rgdal","rgeos","spdep") new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])] if(length(new.packages)) install.packages(new.packages) lapply(list.of.packages, require, character.only=T) if(.Platform$OS.type == "unix"){ prefix = "~" }else{...
/project_code/manual_boundaries.R
no_license
devinit/p20_spatial_2018
R
false
false
2,114
r
list.of.packages <- c("data.table","sp","rgdal","rgeos","spdep") new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])] if(length(new.packages)) install.packages(new.packages) lapply(list.of.packages, require, character.only=T) if(.Platform$OS.type == "unix"){ prefix = "~" }else{...
# Description: # Generate Documents # Knowns: # of topics # Unknown: document length # word distribution # topic distribution # # Figure 7 in Heinrich # rm(list = ls()) library(MCMCpack) library(tidyverse) k <- 2 # number of topics M <- 10 # let's create 10 documents vocab <- c('\U1F4D8', '\U1F4D5'...
/scripts/gen_docs_tidy.R
permissive
ctufts/LDA_Inference_Book
R
false
false
1,430
r
# Description: # Generate Documents # Knowns: # of topics # Unknown: document length # word distribution # topic distribution # # Figure 7 in Heinrich # rm(list = ls()) library(MCMCpack) library(tidyverse) k <- 2 # number of topics M <- 10 # let's create 10 documents vocab <- c('\U1F4D8', '\U1F4D5'...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/events.R \name{plot_hypnodensity} \alias{plot_hypnodensity} \title{Plot a hypnodensity graph.} \usage{ plot_hypnodensity( hypnodensity, stages = c("AWA", "REM", "N1", "N2", "N3"), colors = c("#5BBCD6", "#FF0000", "#00A08A", "#F2AD00", "...
/man/plot_hypnodensity.Rd
permissive
cran/rsleep
R
false
true
1,192
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/events.R \name{plot_hypnodensity} \alias{plot_hypnodensity} \title{Plot a hypnodensity graph.} \usage{ plot_hypnodensity( hypnodensity, stages = c("AWA", "REM", "N1", "N2", "N3"), colors = c("#5BBCD6", "#FF0000", "#00A08A", "#F2AD00", "...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/describe.R \name{stat_range} \alias{stat_range} \title{Range} \usage{ stat_range(x) } \arguments{ \item{x}{a numeric vector} } \value{ Range of \code{x} } \description{ Compute the range of a numeric vector } \examples{ stat_range(mtcars$mpg)...
/man/stat_range.Rd
no_license
anandkumar90/descriptr
R
false
true
362
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/describe.R \name{stat_range} \alias{stat_range} \title{Range} \usage{ stat_range(x) } \arguments{ \item{x}{a numeric vector} } \value{ Range of \code{x} } \description{ Compute the range of a numeric vector } \examples{ stat_range(mtcars$mpg)...
#wersja testowa #exercise 2 #test of labeling
/test.R
no_license
AnnaMatysiak/Data-Analysis-III-main-project
R
false
false
47
r
#wersja testowa #exercise 2 #test of labeling
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/checkers.R \name{misc-checkers} \alias{misc-checkers} \title{Miscellaneous checkers} \arguments{ \item{\dots}{Check items, i.e., formulae that are one-sided or have a string as left-hand side (see \emph{Check Formulae of Local Scope} in the d...
/man/misc-checkers.Rd
permissive
cran/valaddin
R
false
true
4,532
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/checkers.R \name{misc-checkers} \alias{misc-checkers} \title{Miscellaneous checkers} \arguments{ \item{\dots}{Check items, i.e., formulae that are one-sided or have a string as left-hand side (see \emph{Check Formulae of Local Scope} in the d...
/init/Vendee.Presidentielle.2017.Tour2.R
no_license
Cyrano71/Geographie_Electorale_France
R
false
false
2,221
r
#' List HDF Groups, Datasets or Attributes #' #' List groups, datasets or attribute in an HDF file. #' #' @name hql_list NULL #' List HDF Objects #' #' @keywords internal list_hdf = function(what = c("GROUP", "DATASET", "ATTRIBUTE"), path) { script = sprintf('SHOW %s "%s/"', what, path) get_cursor_values...
/R/list.r
no_license
cran/hdfqlr
R
false
false
2,834
r
#' List HDF Groups, Datasets or Attributes #' #' List groups, datasets or attribute in an HDF file. #' #' @name hql_list NULL #' List HDF Objects #' #' @keywords internal list_hdf = function(what = c("GROUP", "DATASET", "ATTRIBUTE"), path) { script = sprintf('SHOW %s "%s/"', what, path) get_cursor_values...
# Collect all results and put it in a matrix # original design is in the matrix Design # Total number of rows of Design = TotalCells #first load one workspace, for example, cell 1 of the Design matrix #save the number of replications within that cell Row <- 1 load(file.path("results",paste("MyResult", "Row", Row,".Rdat...
/src/simulation/r_code/collectResults.R
permissive
rushkock/sim_study_thesis
R
false
false
1,583
r
# Collect all results and put it in a matrix # original design is in the matrix Design # Total number of rows of Design = TotalCells #first load one workspace, for example, cell 1 of the Design matrix #save the number of replications within that cell Row <- 1 load(file.path("results",paste("MyResult", "Row", Row,".Rdat...
context("dll module") test_that("dll module",{ expect_true(dll_r_finite(10)) expect_true(!dll_r_finite(NaN)) expect_true(!dll_r_finite(Inf)) expect_true(!dll_r_finite(-Inf)) expect_true(!dll_is_na(10)) expect_true(!dll_is_na(NaN)) expect_true(!dll_is_na(Inf)) expect_true(!dll_is_na(-Inf)) expect_true(!dll_is_nan(10))...
/rtest/tests/testthat/test-dll.r
permissive
rustr/rustr
R
false
false
466
r
context("dll module") test_that("dll module",{ expect_true(dll_r_finite(10)) expect_true(!dll_r_finite(NaN)) expect_true(!dll_r_finite(Inf)) expect_true(!dll_r_finite(-Inf)) expect_true(!dll_is_na(10)) expect_true(!dll_is_na(NaN)) expect_true(!dll_is_na(Inf)) expect_true(!dll_is_na(-Inf)) expect_true(!dll_is_nan(10))...
# This file is generated by make.paws. Please do not edit here. #' @importFrom paws.common new_handlers new_service set_config NULL #' Amazon Personalize #' #' @description #' Amazon Personalize is a machine learning service that makes it easy to #' add individualized recommendations to customers. #' #' @param #' conf...
/paws/R/personalize_service.R
permissive
williazo/paws
R
false
false
7,526
r
# This file is generated by make.paws. Please do not edit here. #' @importFrom paws.common new_handlers new_service set_config NULL #' Amazon Personalize #' #' @description #' Amazon Personalize is a machine learning service that makes it easy to #' add individualized recommendations to customers. #' #' @param #' conf...
######################################################################## #' Return the number of the system's physical CPU cores #' @export num_physical_cores <- function() { proc <- readLines("/proc/cpuinfo") core_id <- paste0( grep("^physical id", proc, value = TRUE), " | ", grep("^core id", p...
/R/parallel.R
no_license
tanaylab/tgutil
R
false
false
1,902
r
######################################################################## #' Return the number of the system's physical CPU cores #' @export num_physical_cores <- function() { proc <- readLines("/proc/cpuinfo") core_id <- paste0( grep("^physical id", proc, value = TRUE), " | ", grep("^core id", p...
\name{StoichiometryMath-class} \docType{class} \alias{StoichiometryMath-class} \alias{math,StoichiometryMath-method} \alias{math<-,StoichiometryMath-method} \title{SBML type "StoichiometryMath"} \description{Dynamically defines the stoichiometry of a \code{\linkS4class{SpeciesReference}}.} \section{Instantiation}{ Obj...
/man/StoichiometryMath-class.Rd
no_license
cran/rsbml
R
false
false
1,567
rd
\name{StoichiometryMath-class} \docType{class} \alias{StoichiometryMath-class} \alias{math,StoichiometryMath-method} \alias{math<-,StoichiometryMath-method} \title{SBML type "StoichiometryMath"} \description{Dynamically defines the stoichiometry of a \code{\linkS4class{SpeciesReference}}.} \section{Instantiation}{ Obj...
#' ggraph extensions to ggplot2 #' #' This help page lists all exported ggproto classes defined by ggraph. In #' general these should be of no concern to the user as the main interface to #' the functionality is, as with ggplot2, the `geom_*` format. As opposed #' to ggplot2 there really aren't any use for separate `st...
/R/ggproto-classes.R
permissive
cran/ggraph
R
false
false
1,650
r
#' ggraph extensions to ggplot2 #' #' This help page lists all exported ggproto classes defined by ggraph. In #' general these should be of no concern to the user as the main interface to #' the functionality is, as with ggplot2, the `geom_*` format. As opposed #' to ggplot2 there really aren't any use for separate `st...
################################################################################ # LOADING LIBRARIES ################################################################################ using<-function(...) { libs<-unlist(list(...)) req<-unlist(lapply(libs,require,character.only=TRUE)) need<-libs[req==FALSE] if(le...
/code/scripts_abi/KAMILA/Version2/v2_unscaled_pre_process_multi_morbid_data_ordinal_continuous.R
no_license
EpiCompBio/Barracudas
R
false
false
8,121
r
################################################################################ # LOADING LIBRARIES ################################################################################ using<-function(...) { libs<-unlist(list(...)) req<-unlist(lapply(libs,require,character.only=TRUE)) need<-libs[req==FALSE] if(le...
#' Lightweight `R` project management #' #' The goals of this package are to provide: #' #' - some lightweight package-dependency management tools for `R` projects, #' relying on the `DESCRIPTION` file. #' - some tools to support RMarkdown-based workflows. #' #' The `DESCRIPTION` file is used, perhaps more famousl...
/R/projthis-package.R
permissive
jimsforks/projthis
R
false
false
1,555
r
#' Lightweight `R` project management #' #' The goals of this package are to provide: #' #' - some lightweight package-dependency management tools for `R` projects, #' relying on the `DESCRIPTION` file. #' - some tools to support RMarkdown-based workflows. #' #' The `DESCRIPTION` file is used, perhaps more famousl...
library(RNentropy) ### Name: RN_BarresLab_design ### Title: RN_BarresLab_design ### Aliases: RN_BarresLab_design ### Keywords: datasets ### ** Examples data(RN_Brain_Example_design)
/data/genthat_extracted_code/RNentropy/examples/RN_BarresLab_design.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
189
r
library(RNentropy) ### Name: RN_BarresLab_design ### Title: RN_BarresLab_design ### Aliases: RN_BarresLab_design ### Keywords: datasets ### ** Examples data(RN_Brain_Example_design)
## JHU Coursera R Programming Week 3 - Assignment #2 ## March 2018 ## author: Bushra Waheed ## Caching the Inverse of a Matrix ## Matrix inversion is usually a costly computation and there may be some benefit to caching the inverse of a matrix rather ## rather than compute it repeatedly. ## Below are a pair of funct...
/cachematrix.R
no_license
expertbushra/ProgrammingAssignment2
R
false
false
1,272
r
## JHU Coursera R Programming Week 3 - Assignment #2 ## March 2018 ## author: Bushra Waheed ## Caching the Inverse of a Matrix ## Matrix inversion is usually a costly computation and there may be some benefit to caching the inverse of a matrix rather ## rather than compute it repeatedly. ## Below are a pair of funct...
# ============================================================================== # Query the game graph for games similar to the requested game and that also # have the requested features # ============================================================================== QueryByGameAndFeatures <- function(g, g.es, game, f...
/workspace/3-app/functions/QueryByGameAndFeatures.r
no_license
dinhani/gamediscovery2
R
false
false
567
r
# ============================================================================== # Query the game graph for games similar to the requested game and that also # have the requested features # ============================================================================== QueryByGameAndFeatures <- function(g, g.es, game, f...
#EX_3_2 #page 5 #Piecewise Constant PDF Fx<-numeric(11) f <- function(c1)c1#representing the function of constant variable to integrate f2<-function(c2)c2 cum<-integrate(f,15,20) p_sunnyday<-cum$value/17.5#to calculate the probabilty of sunny day p_sunnyday cum2<-integrate(f2,20,25) p_rainyday<-(cum2$value/22...
/Introduction_To_Probability_by_Dimitri_P._Bertsekas_And_John_N._Tsitsiklis/CH3/EX3.2/EX_3_2.R
permissive
FOSSEE/R_TBC_Uploads
R
false
false
510
r
#EX_3_2 #page 5 #Piecewise Constant PDF Fx<-numeric(11) f <- function(c1)c1#representing the function of constant variable to integrate f2<-function(c2)c2 cum<-integrate(f,15,20) p_sunnyday<-cum$value/17.5#to calculate the probabilty of sunny day p_sunnyday cum2<-integrate(f2,20,25) p_rainyday<-(cum2$value/22...
library(GetTDData) ### Name: read.TD.files ### Title: Reading excel files from Tesouro Direto ### Aliases: read.TD.files ### ** Examples # Downloads data from tesouro direto (only 1 file for simplicity) dl.folder ='TD Files' ## Not run: ##D download.TD.data(asset.codes = 'LTN', dl.folder = dl.folder, n.dl = 1) #...
/data/genthat_extracted_code/GetTDData/examples/read.TD.files.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
413
r
library(GetTDData) ### Name: read.TD.files ### Title: Reading excel files from Tesouro Direto ### Aliases: read.TD.files ### ** Examples # Downloads data from tesouro direto (only 1 file for simplicity) dl.folder ='TD Files' ## Not run: ##D download.TD.data(asset.codes = 'LTN', dl.folder = dl.folder, n.dl = 1) #...
library("MASS") attach('survey') m=mean(Height, na.rm=T) s=sd(Height, na.rm=T) mmale=mean(Height[Sex=='Male'], na.rm=T) mfemale=mean(Height[Sex=='Female'], na.rm=T) smale=sd(Height[Sex=="Male"], na.rm=T) sfemale=sd(Height[Sex=="Female"], na.rm=T) p=sum(Height>m-s & Height<m+s, na.rm=T) 100 * p / sum( !is.na(Height)) #...
/upr3_zad1.R
no_license
ralitsa-d/Statistics
R
false
false
408
r
library("MASS") attach('survey') m=mean(Height, na.rm=T) s=sd(Height, na.rm=T) mmale=mean(Height[Sex=='Male'], na.rm=T) mfemale=mean(Height[Sex=='Female'], na.rm=T) smale=sd(Height[Sex=="Male"], na.rm=T) sfemale=sd(Height[Sex=="Female"], na.rm=T) p=sum(Height>m-s & Height<m+s, na.rm=T) 100 * p / sum( !is.na(Height)) #...
#Obs=data #set the input data in numeric list Obs=test2 ##Seting initial nt_guess <- 300 states=6 threshold=10 # Expextation Maximization nt_pre <- nt_guess nt_now <- EM_nt_test(Obs, states, nt_pre, threshold) #added threshold #threshold=mean((nt_now[[5]]+nt_now[[7]]))*3 iters=0 error=c() while (abs(nt_now[[1]]-...
/main_test.R
permissive
Lihsin08/Probalistic-Models-Time-Series
R
false
false
627
r
#Obs=data #set the input data in numeric list Obs=test2 ##Seting initial nt_guess <- 300 states=6 threshold=10 # Expextation Maximization nt_pre <- nt_guess nt_now <- EM_nt_test(Obs, states, nt_pre, threshold) #added threshold #threshold=mean((nt_now[[5]]+nt_now[[7]]))*3 iters=0 error=c() while (abs(nt_now[[1]]-...
library(sqlscore) ### Name: select_statement ### Title: Generate a SELECT statement from a model ### Aliases: select_statement ### ** Examples # Basic select statements mod <- glm(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width + Species, data=datasets::iris) select_statement(mod, src_table="tbl_...
/data/genthat_extracted_code/sqlscore/examples/select_statement.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
1,271
r
library(sqlscore) ### Name: select_statement ### Title: Generate a SELECT statement from a model ### Aliases: select_statement ### ** Examples # Basic select statements mod <- glm(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width + Species, data=datasets::iris) select_statement(mod, src_table="tbl_...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/chemspider.R \name{cs_extcompinfo} \alias{cs_extcompinfo} \title{Get extended record details by ChemSpider ID} \usage{ cs_extcompinfo(csid, token, verbose = TRUE, ...) } \arguments{ \item{csid}{character, ChemSpider ID.} \item{token}{charac...
/man/cs_extcompinfo.Rd
permissive
FADHLyemen/webchem
R
false
true
1,546
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/chemspider.R \name{cs_extcompinfo} \alias{cs_extcompinfo} \title{Get extended record details by ChemSpider ID} \usage{ cs_extcompinfo(csid, token, verbose = TRUE, ...) } \arguments{ \item{csid}{character, ChemSpider ID.} \item{token}{charac...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/update_betaObsLC.R \name{update_betaObsLC} \alias{update_betaObsLC} \title{Update regression coefficients \code{betaObs}. #' @description An multivariate normal prior distribution is used to update the regression coefficients \code{betaObs} ...
/man/update_betaObsLC.Rd
permissive
anthopolos/EHRMiss
R
false
true
916
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/update_betaObsLC.R \name{update_betaObsLC} \alias{update_betaObsLC} \title{Update regression coefficients \code{betaObs}. #' @description An multivariate normal prior distribution is used to update the regression coefficients \code{betaObs} ...
library(plyr) require(utils) library(RJSONIO) library(reshape) ## import warning("need to set.diff each month") files <- list.files(path = "~/Data/Infogroup/InfoGroupNewLeads/") filenames <- paste("~/Data/Infogroup/InfoGroupNewLeads/", files, sep="") length(filenames) is(filenames) read_csv_filename <- function(fil...
/InfoGroupGeocode.R
no_license
awsacbee/Infogroup
R
false
false
1,362
r
library(plyr) require(utils) library(RJSONIO) library(reshape) ## import warning("need to set.diff each month") files <- list.files(path = "~/Data/Infogroup/InfoGroupNewLeads/") filenames <- paste("~/Data/Infogroup/InfoGroupNewLeads/", files, sep="") length(filenames) is(filenames) read_csv_filename <- function(fil...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/C4.R \docType{data} \name{Bacteria} \alias{Bacteria} \title{Chapter 4 Bacteria} \format{ A data frame with 36 rows and three columns (Building, Location, and Count) } \usage{ Bacteria } \description{ Two students, Isaac and Courtney, sampled ...
/man/Bacteria.Rd
no_license
minceb/Stats2Labs
R
false
true
1,358
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/C4.R \docType{data} \name{Bacteria} \alias{Bacteria} \title{Chapter 4 Bacteria} \format{ A data frame with 36 rows and three columns (Building, Location, and Count) } \usage{ Bacteria } \description{ Two students, Isaac and Courtney, sampled ...
#script 8 #171122 #creating label alsfrs.w <- read.csv("alsfrs.w.csv") rownames(alsfrs.w) <- alsfrs.w[, 1] alsfrs.w[, 1] <- NULL rel.err.diff <- 0 #calculation of relative errors of Weibull and linear library(minpack.lm) for (i in 2:nrow(alsfrs.w)) { x <- alsfrs.w[1, ] y <- alsfrs.w[i, ] x <- x[!is.na(y...
/script 8.R
no_license
sofyhsh92/ml_als
R
false
false
1,428
r
#script 8 #171122 #creating label alsfrs.w <- read.csv("alsfrs.w.csv") rownames(alsfrs.w) <- alsfrs.w[, 1] alsfrs.w[, 1] <- NULL rel.err.diff <- 0 #calculation of relative errors of Weibull and linear library(minpack.lm) for (i in 2:nrow(alsfrs.w)) { x <- alsfrs.w[1, ] y <- alsfrs.w[i, ] x <- x[!is.na(y...
#' BMI men GWAS summary dataset (made available from GIANT consortium data files) #' #' The dataset 'bmimen' is a data.frame object with the summary results of a GWAS analysis. #' #' @docType data #' #' @usage data(bmimen) #' #' @format A dataframe with simulated GWAS results (simulated using plink 1.9) #' \itemize{ #'...
/R/PheGWASData.R
no_license
Shicheng-Guo/PheGWAS
R
false
false
3,719
r
#' BMI men GWAS summary dataset (made available from GIANT consortium data files) #' #' The dataset 'bmimen' is a data.frame object with the summary results of a GWAS analysis. #' #' @docType data #' #' @usage data(bmimen) #' #' @format A dataframe with simulated GWAS results (simulated using plink 1.9) #' \itemize{ #'...
#' R6 Class containing specific attributes and methods for Covid19 Data Hub #' #' @description Attributes and methods for COVID-19 data provided by the #' Covid19 Data Hub #' #' @details This dataset supports both national and subnational data sources #' with national level data returned by default. National data is so...
/R/Covid19DataHub.R
permissive
kathsherratt/covidregionaldata
R
false
false
5,244
r
#' R6 Class containing specific attributes and methods for Covid19 Data Hub #' #' @description Attributes and methods for COVID-19 data provided by the #' Covid19 Data Hub #' #' @details This dataset supports both national and subnational data sources #' with national level data returned by default. National data is so...
#' @title Integer-valued optimal univariate allocation under constraints for stratified sampling #' @description Simple algorithm from paper Friedrich et al. (2015) for integer-valued optimal #' allocation in stratified sampling #' #' @param n - target sample size for allocation #' @param Nh - population sizes ...
/SimpleGreedy.R
no_license
rwieczor/recursive_Neyman
R
false
false
3,091
r
#' @title Integer-valued optimal univariate allocation under constraints for stratified sampling #' @description Simple algorithm from paper Friedrich et al. (2015) for integer-valued optimal #' allocation in stratified sampling #' #' @param n - target sample size for allocation #' @param Nh - population sizes ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/callbacks_mixup_preds_rnn.R \name{RNNRegularizer} \alias{RNNRegularizer} \title{RNNRegularizer} \usage{ RNNRegularizer(alpha = 0, beta = 0) } \arguments{ \item{alpha}{alpha} \item{beta}{beta} } \value{ None } \description{ `Callback` that ad...
/man/RNNRegularizer.Rd
permissive
Cdk29/fastai
R
false
true
367
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/callbacks_mixup_preds_rnn.R \name{RNNRegularizer} \alias{RNNRegularizer} \title{RNNRegularizer} \usage{ RNNRegularizer(alpha = 0, beta = 0) } \arguments{ \item{alpha}{alpha} \item{beta}{beta} } \value{ None } \description{ `Callback` that ad...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/prepost.R \name{prepost.test} \alias{prepost.test} \title{Pretest-posttest RCT for quantitative observations with possible missing values} \usage{ prepost.test(baseline, post, treatment, conf.level = 0.95, delta = "estimate") } \arguments{ ...
/man/prepost.test.Rd
no_license
vivek2319/MESS
R
false
true
1,830
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/prepost.R \name{prepost.test} \alias{prepost.test} \title{Pretest-posttest RCT for quantitative observations with possible missing values} \usage{ prepost.test(baseline, post, treatment, conf.level = 0.95, delta = "estimate") } \arguments{ ...
# Rscript signif_ctcf_logo.R set.seed(21122020) outFolder <- file.path("SIGNIF_CTCF_LOGO") dir.create(outFolder, recursive = TRUE) # source("http://bioconductor.org/biocLite.R") # BiocManager::install("Logolas") library("Logolas") library("Biostrings") library("msa") library("ggseqlogo") require(ggplot2) library(gr...
/signif_ctcf_logo.R
no_license
marzuf/v2_Yuanlong_Cancer_HiC_data_TAD_DA
R
false
false
14,144
r
# Rscript signif_ctcf_logo.R set.seed(21122020) outFolder <- file.path("SIGNIF_CTCF_LOGO") dir.create(outFolder, recursive = TRUE) # source("http://bioconductor.org/biocLite.R") # BiocManager::install("Logolas") library("Logolas") library("Biostrings") library("msa") library("ggseqlogo") require(ggplot2) library(gr...
#File to Recode 1979 CES Data for 1979 election #load data data("ces7980") #recode Gender (V1537) look_for(ces7980, "sex") table(ces7980$V1537, ces7980$V4008) ces7980$male<-Recode(ces7980$V1537, "1=1; 2=0; 0=NA") val_labels(ces7980$male)<-c(Female=0, Male=1) #checks val_labels(ces7980$male) table(ces7980$male) #reco...
/R_Scripts/2_5_ces7980_recode.R
no_license
sjkiss/class_voting_canada_2019
R
false
false
7,890
r
#File to Recode 1979 CES Data for 1979 election #load data data("ces7980") #recode Gender (V1537) look_for(ces7980, "sex") table(ces7980$V1537, ces7980$V4008) ces7980$male<-Recode(ces7980$V1537, "1=1; 2=0; 0=NA") val_labels(ces7980$male)<-c(Female=0, Male=1) #checks val_labels(ces7980$male) table(ces7980$male) #reco...
[settings] comment_use_indent=false
/config/geany/filedefs/filetypes.makefile
no_license
twmccart/dotfiles
R
false
false
36
makefile
[settings] comment_use_indent=false
library(Combinations) source(system.file("examples", "combinationEx.R", package = "Combinations")) z = rnorm(25) f = streamingHist(z) o = combinations(length(z), 4, f) f$counts f$bins
/tests/events.R
no_license
omegahat/Combinations
R
false
false
189
r
library(Combinations) source(system.file("examples", "combinationEx.R", package = "Combinations")) z = rnorm(25) f = streamingHist(z) o = combinations(length(z), 4, f) f$counts f$bins
#' Range Code Sheet #' #' Generates a range coding sheet for coding words. #' #' @param codes Character vector of codes. #' @param file A connection, or a character string naming the file to print to #' (.txt or .doc is recommended). #' @references Miles, M. B. & Huberman, A. M. (1994). An expanded sourcebook: #' Qu...
/R/cm_range.temp.R
no_license
trinker/qdap2
R
false
false
1,699
r
#' Range Code Sheet #' #' Generates a range coding sheet for coding words. #' #' @param codes Character vector of codes. #' @param file A connection, or a character string naming the file to print to #' (.txt or .doc is recommended). #' @references Miles, M. B. & Huberman, A. M. (1994). An expanded sourcebook: #' Qu...
library("rcompanion") library("car") library("fastR") library(dbplyr) library(ggplot2) #Repeated Measures ANOVA - How has player salary changed over time? #independent variable is yearID #Creating a Dataframe of necessary columns keeps <- c("yearID", "salary", "playerID", "teamID") baseballSalariesM <- baseballSalari...
/SalariesOverTime_RepeatedANOVA.R
no_license
jazippay/baseball_aTeam
R
false
false
9,149
r
library("rcompanion") library("car") library("fastR") library(dbplyr) library(ggplot2) #Repeated Measures ANOVA - How has player salary changed over time? #independent variable is yearID #Creating a Dataframe of necessary columns keeps <- c("yearID", "salary", "playerID", "teamID") baseballSalariesM <- baseballSalari...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/DCdensity.R \name{DCdensity} \alias{DCdensity} \title{McCrary Sorting Test} \usage{ DCdensity(runvar, cutpoint, bin = NULL, bw = NULL, verbose = FALSE, plot = TRUE, ext.out = FALSE, htest = FALSE) } \arguments{ \item{runvar}{numerical vecto...
/man/DCdensity.Rd
no_license
cran/rdd
R
false
true
2,636
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/DCdensity.R \name{DCdensity} \alias{DCdensity} \title{McCrary Sorting Test} \usage{ DCdensity(runvar, cutpoint, bin = NULL, bw = NULL, verbose = FALSE, plot = TRUE, ext.out = FALSE, htest = FALSE) } \arguments{ \item{runvar}{numerical vecto...
c DCNF-Autarky [version 0.0.1]. c Copyright (c) 2018-2019 Swansea University. c c Input Clause Count: 29433 c Performing E1-Autarky iteration. c Remaining clauses count after E-Reduction: 29433 c c Input Parameter (command line, file): c input filename QBFLIB/Diptarama-Jordan-Shinohara/Generalized-Tic-Tac-Toe/gtt...
/code/dcnf-ankit-optimized/Results/QBFLIB-2018/E1/Experiments/Diptarama-Jordan-Shinohara/Generalized-Tic-Tac-Toe/gttt_2_2_00102030_4x4_torus_w/gttt_2_2_00102030_4x4_torus_w.R
no_license
arey0pushpa/dcnf-autarky
R
false
false
729
r
c DCNF-Autarky [version 0.0.1]. c Copyright (c) 2018-2019 Swansea University. c c Input Clause Count: 29433 c Performing E1-Autarky iteration. c Remaining clauses count after E-Reduction: 29433 c c Input Parameter (command line, file): c input filename QBFLIB/Diptarama-Jordan-Shinohara/Generalized-Tic-Tac-Toe/gtt...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/inference-methods.R \name{inferGenotypes} \alias{inferGenotypes} \alias{inferGenotypes,ASEset-method} \title{infererence of genotypes from ASEset count data} \usage{ inferGenotypes( x, strand = "*", return.class = "matrix", return.all...
/man/inferGenotypes.Rd
no_license
pappewaio/AllelicImbalance
R
false
true
971
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/inference-methods.R \name{inferGenotypes} \alias{inferGenotypes} \alias{inferGenotypes,ASEset-method} \title{infererence of genotypes from ASEset count data} \usage{ inferGenotypes( x, strand = "*", return.class = "matrix", return.all...
## Plot 4 : Project 1 : Exploratory Data Analysis ## 1. Read the source data ## 2. Use the Transform and subset function to select the valid data set ## 3. Use the plot and the png function to create a graph and generate a plot4.png ## The assumption is the source data file is in the current working directory rawdat...
/plot4.R
no_license
courserans/ExData_Plotting1
R
false
false
1,471
r
## Plot 4 : Project 1 : Exploratory Data Analysis ## 1. Read the source data ## 2. Use the Transform and subset function to select the valid data set ## 3. Use the plot and the png function to create a graph and generate a plot4.png ## The assumption is the source data file is in the current working directory rawdat...
library(readr) library(data.table) library(zoo) library(caret) library(e1071) library(Matrix) library(proxy) library(qlcMatrix) library(cccd) library(igraph) library(gtools) library(plyr) library(dplyr) library(sqldf) library(DMwR) library(Rtsne) setwd("/media/branden/SSHD1/kaggle/bnp") ################## ## FUNCTIONS...
/bnp/data_trans/data_trans_v12.R
no_license
brandenkmurray/kaggle
R
false
false
15,466
r
library(readr) library(data.table) library(zoo) library(caret) library(e1071) library(Matrix) library(proxy) library(qlcMatrix) library(cccd) library(igraph) library(gtools) library(plyr) library(dplyr) library(sqldf) library(DMwR) library(Rtsne) setwd("/media/branden/SSHD1/kaggle/bnp") ################## ## FUNCTIONS...
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.32784507357645e-308, 4.48502250775333e-296, 1.22810536108214e+146, 4.12396251261199e-221, 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), .Dim = c(5L, 7L))) result <- do.call(CNull:::communities_individual...
/CNull/inst/testfiles/communities_individual_based_sampling_beta/AFL_communities_individual_based_sampling_beta/communities_individual_based_sampling_beta_valgrind_files/1615830535-test.R
no_license
akhikolla/updatedatatype-list2
R
false
false
362
r
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.32784507357645e-308, 4.48502250775333e-296, 1.22810536108214e+146, 4.12396251261199e-221, 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), .Dim = c(5L, 7L))) result <- do.call(CNull:::communities_individual...
# this function handles the parameter resamplingTpye and must be placed inside runMrt() and runGdal() checkResamplingType <- function(resamplingType,tool,quiet=FALSE) { if (missing(resamplingType)) { resamplingType <- "near" } resamplingType <- raster::trim(tolower(as.character(resamplingType))) tool...
/R/doOptions.R
permissive
mlampros/MODIS
R
false
false
6,465
r
# this function handles the parameter resamplingTpye and must be placed inside runMrt() and runGdal() checkResamplingType <- function(resamplingType,tool,quiet=FALSE) { if (missing(resamplingType)) { resamplingType <- "near" } resamplingType <- raster::trim(tolower(as.character(resamplingType))) tool...
# housekeeping rm(list=ls()) if(length(dev.list()["RStudioGD"])>1) dev.off(dev.list()["RStudioGD"]) # specifiy folder for results results_folder <- "F:/bioeconomic_results_v2_10_morefish/" if(!dir.exists(results_folder)) dir.create(results_folder) memory.limit(32608) #### user inputs #### source("user_input.R") #### ...
/master_script.R
permissive
FishEconomist/bioeconomic_MPA
R
false
false
2,663
r
# housekeeping rm(list=ls()) if(length(dev.list()["RStudioGD"])>1) dev.off(dev.list()["RStudioGD"]) # specifiy folder for results results_folder <- "F:/bioeconomic_results_v2_10_morefish/" if(!dir.exists(results_folder)) dir.create(results_folder) memory.limit(32608) #### user inputs #### source("user_input.R") #### ...
# Plotting fishing time using gs gs = net_mensuration.db( DS="bottom.contact", net.root.dir=net.root.dir ) # bring in estimates of bottom contact times from scanmar load("filteredlm.RData") str(gs) gs$bottom_duration = gs$bottom_duration/60 summary(gs$bottom_duration) max_num = max(gs$bottom_duration) hist(gs$bottom...
/Fishing Time/Histogram of fishing time frequency.R
no_license
jgmunden/misc
R
false
false
5,793
r
# Plotting fishing time using gs gs = net_mensuration.db( DS="bottom.contact", net.root.dir=net.root.dir ) # bring in estimates of bottom contact times from scanmar load("filteredlm.RData") str(gs) gs$bottom_duration = gs$bottom_duration/60 summary(gs$bottom_duration) max_num = max(gs$bottom_duration) hist(gs$bottom...
CMADE <- function(par, fn, ..., lower, upper, control=list()) { library("ringbuffer") ## Function to check the presence of options in the arguments specified by the user # @name - argument name # @default - default value of the argument # RETURN: value specified by user if the given argument name found, def...
/Constriants/DES/Darwinian reflection/CMADEv2017.R
no_license
Jagorius/EvolutionAlgorithms
R
false
false
16,406
r
CMADE <- function(par, fn, ..., lower, upper, control=list()) { library("ringbuffer") ## Function to check the presence of options in the arguments specified by the user # @name - argument name # @default - default value of the argument # RETURN: value specified by user if the given argument name found, def...
# Name: Eva Roth # Date: 15.11.2017 # File for exercise no.2 - regression and model validation # Link to data source: http://www.helsinki.fi/~kvehkala/JYTmooc/JYTOPKYS3-data.txt learning2014 <- read.table ("http://www.helsinki.fi/~kvehkala/JYTmooc/JYTOPKYS3-data.txt", sep="\t", header=TRUE) # Checking dimensions and...
/Data/create_learning2014.R
no_license
evaroth/IODS-project
R
false
false
2,358
r
# Name: Eva Roth # Date: 15.11.2017 # File for exercise no.2 - regression and model validation # Link to data source: http://www.helsinki.fi/~kvehkala/JYTmooc/JYTOPKYS3-data.txt learning2014 <- read.table ("http://www.helsinki.fi/~kvehkala/JYTmooc/JYTOPKYS3-data.txt", sep="\t", header=TRUE) # Checking dimensions and...
#5.1 data = c(1,2,2,3,1,2,3,3,1,2,3,3,1) fdata = factor(data) fdata rdata = factor(data,labels=c("I","II","III")) rdata levels(fdata) = c('I','II','III') fdata mons = c("March","April","January","November","January", "September","October","September","November","August", "January","November","Nove...
/spector ch5.R
no_license
processis/learnSpector
R
false
false
2,288
r
#5.1 data = c(1,2,2,3,1,2,3,3,1,2,3,3,1) fdata = factor(data) fdata rdata = factor(data,labels=c("I","II","III")) rdata levels(fdata) = c('I','II','III') fdata mons = c("March","April","January","November","January", "September","October","September","November","August", "January","November","Nove...
#(1) #λ=1をパラメータとする指数分布から100個のデータを無作為抽出し、その結果のヒストグラムを表示 N<-100 s<-rexp(N,1) hist(s,breaks=15,freq=F) #(2) #(1)のような無作為抽出を10000回シミュレートし、標本分散を10000個計算する。その標本分散の標本平均を表示 T<-10000 sample_vars<-numeric(T) for (i in 1:T) { s<-rexp(N,1) sample_vars[i]<-var(s) } hist(sample_vars,breaks=50,freq=F) mean(sample_vars) #(3) #(...
/5.指数分布と重ねヒストグラム.R
no_license
Tsubasa1205/gumball
R
false
false
2,434
r
#(1) #λ=1をパラメータとする指数分布から100個のデータを無作為抽出し、その結果のヒストグラムを表示 N<-100 s<-rexp(N,1) hist(s,breaks=15,freq=F) #(2) #(1)のような無作為抽出を10000回シミュレートし、標本分散を10000個計算する。その標本分散の標本平均を表示 T<-10000 sample_vars<-numeric(T) for (i in 1:T) { s<-rexp(N,1) sample_vars[i]<-var(s) } hist(sample_vars,breaks=50,freq=F) mean(sample_vars) #(3) #(...
set.seed(500) n<-10000 poly<-rpois(n,lambda = rgamma(n,shape=2,rate=5)) a_old<-1 b_old<-1 reps_em<-1 repeat{ C<-vector() D<-vector() for(i in 1:length(poly)){ C_mid<-(poly[i]+a_old)/(1+b_old) D_mid<-digamma(poly[i]+a_old)-log(1+b_old) C<-append(C,C_mid) D<-append(D,D_m...
/scripts/fou_3.R
no_license
philorfa/Computational_Statistics
R
false
false
1,061
r
set.seed(500) n<-10000 poly<-rpois(n,lambda = rgamma(n,shape=2,rate=5)) a_old<-1 b_old<-1 reps_em<-1 repeat{ C<-vector() D<-vector() for(i in 1:length(poly)){ C_mid<-(poly[i]+a_old)/(1+b_old) D_mid<-digamma(poly[i]+a_old)-log(1+b_old) C<-append(C,C_mid) D<-append(D,D_m...
#!/opt/R-3.1.1/bin/Rscript library(BiSeq) data(promoters) aitlcov <- "SampleID_AITL.10up.cov" norcov <- "SampleID_Normal.10up.cov" colData <- DataFrame(group = c("AITL"),row.names = c("SampleID_AITL")) aitl <- readBismark(aitlcov, colData= colData) colData <- DataFrame(group = c("Normal"),row.names = c("Samp...
/RRBS/biseq_pwdmr.R
permissive
littlegq/ShellScripts
R
false
false
1,518
r
#!/opt/R-3.1.1/bin/Rscript library(BiSeq) data(promoters) aitlcov <- "SampleID_AITL.10up.cov" norcov <- "SampleID_Normal.10up.cov" colData <- DataFrame(group = c("AITL"),row.names = c("SampleID_AITL")) aitl <- readBismark(aitlcov, colData= colData) colData <- DataFrame(group = c("Normal"),row.names = c("Samp...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/SQLContext.R \name{infer_type} \alias{infer_type} \title{infer the SQL type} \usage{ infer_type(x) } \description{ infer the SQL type }
/man/infer_type.Rd
no_license
baharak/SparkR
R
false
false
223
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/SQLContext.R \name{infer_type} \alias{infer_type} \title{infer the SQL type} \usage{ infer_type(x) } \description{ infer the SQL type }
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.32835646627302e-308, 9.53818252170339e+295, 1.22810536108214e+146, 4.12396251261199e-221, 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), .Dim = c(5L, 7L))) result <- do.call(CNull:::communities_individual...
/CNull/inst/testfiles/communities_individual_based_sampling_beta/AFL_communities_individual_based_sampling_beta/communities_individual_based_sampling_beta_valgrind_files/1615831865-test.R
no_license
akhikolla/updatedatatype-list2
R
false
false
362
r
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.32835646627302e-308, 9.53818252170339e+295, 1.22810536108214e+146, 4.12396251261199e-221, 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), .Dim = c(5L, 7L))) result <- do.call(CNull:::communities_individual...
#################################################### # Load libraries #################################################### path <- "/Research/MCDI/MCDI-analysis/code/MNLFA" locs <- c("G:/My Drive", "I:", "/Volumes", "/home/tkmd/Insync/day00096@umn.edu/Google Drive") for (i in locs) if (dir.exists(paste0(i,...
/code/MNLFA/aMNLFA_MBCDI_1fac.R
no_license
TrevorKMDay/MCDI-analysis
R
false
false
6,378
r
#################################################### # Load libraries #################################################### path <- "/Research/MCDI/MCDI-analysis/code/MNLFA" locs <- c("G:/My Drive", "I:", "/Volumes", "/home/tkmd/Insync/day00096@umn.edu/Google Drive") for (i in locs) if (dir.exists(paste0(i,...
# # Copyright 2007-2019 by the individuals mentioned in the source code history # # 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 #...
/inst/models/nightly/CSOLNP_segfault_regression_test--unidentifed_EFA.R
no_license
mirkoruks/OpenMx
R
false
false
4,154
r
# # Copyright 2007-2019 by the individuals mentioned in the source code history # # 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 #...
#' parse_mods_special #' #' @noRd parse_mods_special <- function( tbl, modification = NULL ) { if (is.null(modification) == TRUE) { stop("No modifications table specified for parse_mods") } modification_trunc <- modification %>% dpl...
/R/parse_mods_special.R
permissive
davidsbutcher/GUPPI
R
false
false
1,710
r
#' parse_mods_special #' #' @noRd parse_mods_special <- function( tbl, modification = NULL ) { if (is.null(modification) == TRUE) { stop("No modifications table specified for parse_mods") } modification_trunc <- modification %>% dpl...
#Work in default working directory #Download file, unzip it if it does not exist setwd("C:/Users/soloveynv/Documents/R Scripts/Coursera/Exploratory_Data_Analysis/Exploratory_Data_Analysis_CourseProject2") URL <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_data.zip" destFile <- "exdatadataNEI_data.zip" if...
/Exploratory_Data_Analysis_CourseProject2/plot6.R
no_license
YspAnimal/Exploratory_Data_Analysis
R
false
false
1,821
r
#Work in default working directory #Download file, unzip it if it does not exist setwd("C:/Users/soloveynv/Documents/R Scripts/Coursera/Exploratory_Data_Analysis/Exploratory_Data_Analysis_CourseProject2") URL <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_data.zip" destFile <- "exdatadataNEI_data.zip" if...
#Fig 4 longitudinal analysis for Lieberman et al, PLoS Biology 2020 #naliebe@uw.edu library(tidyverse) library(forestmangr) library(DESeq2) library(clusterProfiler) library(org.Hs.eg.db) library(viridis) library(cowplot) setwd("~/Desktop") metadata_file <- file.choose() metadata <- read_csv(metadata_file) all_sa...
/Fig4_BC_longitudinal.R
permissive
greninger-lab/COVID19-RNAseq
R
false
false
7,882
r
#Fig 4 longitudinal analysis for Lieberman et al, PLoS Biology 2020 #naliebe@uw.edu library(tidyverse) library(forestmangr) library(DESeq2) library(clusterProfiler) library(org.Hs.eg.db) library(viridis) library(cowplot) setwd("~/Desktop") metadata_file <- file.choose() metadata <- read_csv(metadata_file) all_sa...
breakAt <-function(data,runlength){ newframe <- data[1:runlength,] i<- 1 while(i*runlength < nrow(data)){ from <- (runlength * i) +1 to <- runlength * (i+1) newframe <- data.frame(newframe, data[from:to,]) i <- i + 1 } newframe } restoreAt <- function(data,breakpoint){ newframe <- data...
/util.R
no_license
rmercuur/meatSimDataAnalysis
R
false
false
985
r
breakAt <-function(data,runlength){ newframe <- data[1:runlength,] i<- 1 while(i*runlength < nrow(data)){ from <- (runlength * i) +1 to <- runlength * (i+1) newframe <- data.frame(newframe, data[from:to,]) i <- i + 1 } newframe } restoreAt <- function(data,breakpoint){ newframe <- data...
unzip("data/exdata-data-NEI_data.zip", exdir = "data" ) NEI <- readRDS("data//summarySCC_PM25.rds") SCC <- readRDS("data//Source_Classification_Code.rds") motorRowsFilter <- grep("motor", SCC$Short.Name, ignore.case = TRUE) motorRowsinSCC <- SCC[motorRowsFilter, ] motorRowsIds <- as.character(motorRowsinSCC$SCC) ...
/Course Project 2/Plot5.R
no_license
element824/Exploratory-Data-Analysis-on-Coursera
R
false
false
789
r
unzip("data/exdata-data-NEI_data.zip", exdir = "data" ) NEI <- readRDS("data//summarySCC_PM25.rds") SCC <- readRDS("data//Source_Classification_Code.rds") motorRowsFilter <- grep("motor", SCC$Short.Name, ignore.case = TRUE) motorRowsinSCC <- SCC[motorRowsFilter, ] motorRowsIds <- as.character(motorRowsinSCC$SCC) ...
testthat::test_that("test_values", { df <- data.frame(x = 1:4, y = 5:8, z = c(1:3, NA)) setup <- setup_test_values(df_name = "X", col_name = "x", values = 1:4) test <- test(setup, df) testthat::expect_true(test$test_result) setup <- setup_test_values(df_name = "X", col_n...
/tests/testthat/test_test_values.R
no_license
holmesjoli/validR
R
false
false
798
r
testthat::test_that("test_values", { df <- data.frame(x = 1:4, y = 5:8, z = c(1:3, NA)) setup <- setup_test_values(df_name = "X", col_name = "x", values = 1:4) test <- test(setup, df) testthat::expect_true(test$test_result) setup <- setup_test_values(df_name = "X", col_n...
setMethodS3("calculateWeights", "ExonRmaPlm", function(this, units=NULL, ram=NULL, force=FALSE, ..., verbose=FALSE) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Local functions # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Lookup MASS::psi.hube...
/R/ExonRmaPlm.calculateWeights.R
no_license
HenrikBengtsson/aroma.affymetrix
R
false
false
4,389
r
setMethodS3("calculateWeights", "ExonRmaPlm", function(this, units=NULL, ram=NULL, force=FALSE, ..., verbose=FALSE) { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Local functions # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Lookup MASS::psi.hube...
q1 <- function() { # question 1 # Create a logical vector that identifies the households on greater than # 10 acres who sold more than $10,000 worth of agriculture products. Assign # that logical vector to the variable agricultureLogical. Apply the which() # function like this to identify the rows ...
/GettingCleaningData/Quizzes/Quiz3.R
no_license
RM1900/Coursera_JH_Data_Science_Specialization
R
false
false
5,484
r
q1 <- function() { # question 1 # Create a logical vector that identifies the households on greater than # 10 acres who sold more than $10,000 worth of agriculture products. Assign # that logical vector to the variable agricultureLogical. Apply the which() # function like this to identify the rows ...
# # Reset environment # rm(list = ls()) # Remove environemnent variables graphics.off() # Close any open graphics # # Libraries # library(serial) library(magrittr) library(stringr) # # Script # con <- serialConnection(name = "test_con", port = "COM4", ...
/R_SerialRead_C12880MA_V_Alpha.R
no_license
AndriyHz/Hamamatsu-u-Spectrometer-C12880MA
R
false
false
1,726
r
# # Reset environment # rm(list = ls()) # Remove environemnent variables graphics.off() # Close any open graphics # # Libraries # library(serial) library(magrittr) library(stringr) # # Script # con <- serialConnection(name = "test_con", port = "COM4", ...
# Exercise-1: practice with basic syntax # Create a variable `hometown` that stores the city in which you were born hometown <- 'Victoria' # Assign your name to the variable `my.name` my.name <- 'Morgan' # Assign your height to a variable `my.height` my.height <- 3234 # Create a variable `puppies` equal to the numb...
/exercise-1/exercise.R
permissive
mackmor13/m5-r-intro
R
false
false
832
r
# Exercise-1: practice with basic syntax # Create a variable `hometown` that stores the city in which you were born hometown <- 'Victoria' # Assign your name to the variable `my.name` my.name <- 'Morgan' # Assign your height to a variable `my.height` my.height <- 3234 # Create a variable `puppies` equal to the numb...
# toFunction: Convert an x to string # Distribution x: Provide a summary of each distribution x setMethod("toFunction", signature(x = "SimNorm"), function(x) { paste("rnorm(1, ", x@mean, ", ", x@sd, ")", sep = "") }) setMethod("toFunction", signature(x = "SimUnif"), function(x) { paste("runif(1, ", x@min, ",...
/simsem/R/toFunction-methods.R
no_license
pairach/simsem
R
false
false
2,287
r
# toFunction: Convert an x to string # Distribution x: Provide a summary of each distribution x setMethod("toFunction", signature(x = "SimNorm"), function(x) { paste("rnorm(1, ", x@mean, ", ", x@sd, ")", sep = "") }) setMethod("toFunction", signature(x = "SimUnif"), function(x) { paste("runif(1, ", x@min, ",...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/2-1-psiform.R \name{psiform} \alias{psiform} \title{A tail-based test statistics (TTS) for differential expression detection.} \usage{ psiform( ..., y, G = NULL, dim_u = 5, weight = "none", scale = FALSE, lambda = NULL, a = 3....
/man/psiform.Rd
no_license
SkadiEye/Psiform
R
false
true
1,329
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/2-1-psiform.R \name{psiform} \alias{psiform} \title{A tail-based test statistics (TTS) for differential expression detection.} \usage{ psiform( ..., y, G = NULL, dim_u = 5, weight = "none", scale = FALSE, lambda = NULL, a = 3....
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/atrous_vt.R \name{at.wd} \alias{at.wd} \title{a trous (AT) based additive decompostion using Daubechies family wavelet} \usage{ at.wd(x, wf, J, boundary = "periodic") } \arguments{ \item{x}{The input time series.} \item{wf}{Name o...
/man/at.wd.Rd
no_license
Allisterh/WASP
R
false
true
1,630
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/atrous_vt.R \name{at.wd} \alias{at.wd} \title{a trous (AT) based additive decompostion using Daubechies family wavelet} \usage{ at.wd(x, wf, J, boundary = "periodic") } \arguments{ \item{x}{The input time series.} \item{wf}{Name o...
k4 <- function(x){ (1/24)*(k1(x)^4 - 0.5*k1(x)^2 + 7/240) }
/R/k4.R
permissive
dan410/sseigfun
R
false
false
64
r
k4 <- function(x){ (1/24)*(k1(x)^4 - 0.5*k1(x)^2 + 7/240) }
#' Function to retrive spelling suggestions #' #' Retrive the pmid (PubMed identifier). #' #' @param expr is expression to look for (e.g., H2AX) #' @param db is the data base to look for spelling suggestions (e.g., pmc) #' @param service is the service name (e.g., Entrez) #' @details The function uses internally the ...
/R/spelleR.R
no_license
devSJR/mdcr
R
false
false
1,199
r
#' Function to retrive spelling suggestions #' #' Retrive the pmid (PubMed identifier). #' #' @param expr is expression to look for (e.g., H2AX) #' @param db is the data base to look for spelling suggestions (e.g., pmc) #' @param service is the service name (e.g., Entrez) #' @details The function uses internally the ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/lookup.R \name{lookup_variables} \alias{lookup_variables} \title{Lookup Variables} \usage{ lookup_variables( codes = NULL, messages = getOption("wqbc.messages", default = TRUE) ) } \arguments{ \item{codes}{An optional character vector of ...
/man/lookup_variables.Rd
permissive
bcgov/wqbc
R
false
true
868
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/lookup.R \name{lookup_variables} \alias{lookup_variables} \title{Lookup Variables} \usage{ lookup_variables( codes = NULL, messages = getOption("wqbc.messages", default = TRUE) ) } \arguments{ \item{codes}{An optional character vector of ...
app <- ShinyDriver$new("../") app$snapshotInit("displaytest") app$snapshot() app$setInputs(hide = "click") app$snapshot() app$setInputs(show = "click") app$snapshot() app$setInputs(toggle = "click") app$snapshot() app$setInputs(toggle = "click") app$setInputs(toggle_cond = "click") app$setInputs(condition = TRUE) app$...
/tests/testthat/shinytest/display/tests/displaytest.R
no_license
mmoisse/dqshiny
R
false
false
504
r
app <- ShinyDriver$new("../") app$snapshotInit("displaytest") app$snapshot() app$setInputs(hide = "click") app$snapshot() app$setInputs(show = "click") app$snapshot() app$setInputs(toggle = "click") app$snapshot() app$setInputs(toggle = "click") app$setInputs(toggle_cond = "click") app$setInputs(condition = TRUE) app$...
# Read in data library(haven) data <- read_stata("StudentSurveyData.dta") # Set up CFA library(lavaan) model <- ' # Feelings of Preparedness Prep =~ NA*teamworkcollab + populartools + projectmanagement + futureinterncareer + developercommunity + portfolio + advancedcourses # Standardized solution Prep ~~ 1 * Prep ' ...
/Analysis/Feelings of Preparedness/FeelingsOfPreparedness.R
permissive
pacbard/Classroom-Report-2018
R
false
false
1,734
r
# Read in data library(haven) data <- read_stata("StudentSurveyData.dta") # Set up CFA library(lavaan) model <- ' # Feelings of Preparedness Prep =~ NA*teamworkcollab + populartools + projectmanagement + futureinterncareer + developercommunity + portfolio + advancedcourses # Standardized solution Prep ~~ 1 * Prep ' ...
\name{refSCMfit} \alias{refSCMfit} %- Also NEED an '\alias' for EACH other topic documented here. \title{Refining Estimation of VARMA Model via SCM Approch %% ~~function to do ... ~~ } \description{Refine estimation of a VARMA model specified via the SCM approach by removing insignificant parameters %% ~~ A concise ...
/man/refSCMfit.Rd
no_license
tsay/MTS
R
false
false
1,778
rd
\name{refSCMfit} \alias{refSCMfit} %- Also NEED an '\alias' for EACH other topic documented here. \title{Refining Estimation of VARMA Model via SCM Approch %% ~~function to do ... ~~ } \description{Refine estimation of a VARMA model specified via the SCM approach by removing insignificant parameters %% ~~ A concise ...
\name{cjoint-package} \alias{cjoint-package} \alias{cjoint} \docType{package} \title{ cjoint: A Package for Estimating Average Marginal Component-specific Effects for Conjoint Survey Experiments } \description{ This package allows researchers to estimate the causal effects of attributes in conjoint survey experiments. ...
/man/cjoint-package.Rd
no_license
cran/cjoint
R
false
false
1,181
rd
\name{cjoint-package} \alias{cjoint-package} \alias{cjoint} \docType{package} \title{ cjoint: A Package for Estimating Average Marginal Component-specific Effects for Conjoint Survey Experiments } \description{ This package allows researchers to estimate the causal effects of attributes in conjoint survey experiments. ...
library(aws) ### Name: lpaws ### Title: Local polynomial smoothing by AWS ### Aliases: lpaws ### Keywords: smooth nonparametric regression ### ** Examples library(aws) # 1D local polynomial smoothing ## Not run: demo(lpaws_ex1) # 2D local polynomial smoothing ## Not run: demo(lpaws_ex2)
/data/genthat_extracted_code/aws/examples/lpaws.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
297
r
library(aws) ### Name: lpaws ### Title: Local polynomial smoothing by AWS ### Aliases: lpaws ### Keywords: smooth nonparametric regression ### ** Examples library(aws) # 1D local polynomial smoothing ## Not run: demo(lpaws_ex1) # 2D local polynomial smoothing ## Not run: demo(lpaws_ex2)
#' import shiny #' import shinydashboard #' import shinyjs #' import later #' import igvShiny #' import DT #' import VariantAnnotation #' import cytofSGM #' importFrom RColorBrewer brewer.pal #' import later #--------------------------------------------------------------------------------------------------------------...
/R/CytofViz.R
permissive
PriceLab/cytofViz
R
false
false
14,607
r
#' import shiny #' import shinydashboard #' import shinyjs #' import later #' import igvShiny #' import DT #' import VariantAnnotation #' import cytofSGM #' importFrom RColorBrewer brewer.pal #' import later #--------------------------------------------------------------------------------------------------------------...