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
##################################################### #' #' Estimates \eqn{\beta}s per population and a bootstrap confidence interval #' #' Estimate populations (Population specific FST) or individual coancestries #' and a bootstrap confidence interval, assuming random mating #' #' If betaijT=TRUE, and the f...
/R/betas.R
no_license
cran/hierfstat
R
false
false
5,920
r
##################################################### #' #' Estimates \eqn{\beta}s per population and a bootstrap confidence interval #' #' Estimate populations (Population specific FST) or individual coancestries #' and a bootstrap confidence interval, assuming random mating #' #' If betaijT=TRUE, and the f...
library(showtext) dest <- file.path("C:", "Windows", "Fonts", "ARIALN.ttf") font_add("arialn", regular = dest) showtext_auto() setwd("E:/Documents/GitHub/EBIO-R-Code/EBIO 3080/Lab/Week 5/Data") flyDnDs <- read.csv("FlyDnDs.csv", header = TRUE) meanDnDs <- mean(flyDnDs$DnDs) par(bg = "#eee9d3") par(mar = c(4.1, 5, 4.1...
/EBIO 3080/Lab/Week 5/Pre-Lab/Week5_Pre-Lab.R
no_license
dmwo/EBIO-R-Code
R
false
false
1,185
r
library(showtext) dest <- file.path("C:", "Windows", "Fonts", "ARIALN.ttf") font_add("arialn", regular = dest) showtext_auto() setwd("E:/Documents/GitHub/EBIO-R-Code/EBIO 3080/Lab/Week 5/Data") flyDnDs <- read.csv("FlyDnDs.csv", header = TRUE) meanDnDs <- mean(flyDnDs$DnDs) par(bg = "#eee9d3") par(mar = c(4.1, 5, 4.1...
\name{XTRA 1} \alias{mixed} \alias{mtmixed} \alias{mtgsru} \alias{mm} \alias{NNS} \alias{GSFLM} \alias{GSRR} \alias{GS2EIGEN} \alias{NNSEARCH} \alias{predict_FLMSS} \title{ Mixed model solver } \description{ Function to solve univariate mixed models with or without the usage of omic information. This f...
/man/mix.Rd
no_license
alenxav/bWGR
R
false
false
3,501
rd
\name{XTRA 1} \alias{mixed} \alias{mtmixed} \alias{mtgsru} \alias{mm} \alias{NNS} \alias{GSFLM} \alias{GSRR} \alias{GS2EIGEN} \alias{NNSEARCH} \alias{predict_FLMSS} \title{ Mixed model solver } \description{ Function to solve univariate mixed models with or without the usage of omic information. This f...
#ultiple Linear/Non-linear regression to determine train delay given 46 factors library(MASS) library(caret) library(xlsx) library(neuralnet) library(e1071) a<-read.csv("TSC_430.csv",sep=",") b<-read.csv("TSC_Meta_data",sheet="Sheet2",header=TRUE) colnames(a)<-b[,2] #Averaging factors o...
/Regression_for_predicting_traindelay.R
no_license
aishiitm/Internship-with-Tech-Mahindra
R
false
false
5,688
r
#ultiple Linear/Non-linear regression to determine train delay given 46 factors library(MASS) library(caret) library(xlsx) library(neuralnet) library(e1071) a<-read.csv("TSC_430.csv",sep=",") b<-read.csv("TSC_Meta_data",sheet="Sheet2",header=TRUE) colnames(a)<-b[,2] #Averaging factors o...
defineModule(sim, list( name="disturbanceDriver", description="generate parameters for the generic percolation model",# spades::spread()", keywords=c("fire"), authors=c(person(c("Steve", "G"), "Cumming", email="stevec@sbf.ulaval.ca", role=c("aut", "cre"))), childModules=character(), version=numeric_version...
/disturbanceDriver/disturbanceDriver.R
no_license
SteveCumming/BEACONs
R
false
false
4,872
r
defineModule(sim, list( name="disturbanceDriver", description="generate parameters for the generic percolation model",# spades::spread()", keywords=c("fire"), authors=c(person(c("Steve", "G"), "Cumming", email="stevec@sbf.ulaval.ca", role=c("aut", "cre"))), childModules=character(), version=numeric_version...
#' pribor #' #' A function returning data frame of PRague InterBank OffeRed rates (PRIBOR). #' #' The function expects date input, and returns data frame of two or more columns - date, and relevant PRIBOR rate (as determined by `maturity` parameter). #' #' PRIBOR rates are reported as fractions, i.e. not as percentages...
/R/pribor.R
permissive
jla-data/czechrates
R
false
false
4,816
r
#' pribor #' #' A function returning data frame of PRague InterBank OffeRed rates (PRIBOR). #' #' The function expects date input, and returns data frame of two or more columns - date, and relevant PRIBOR rate (as determined by `maturity` parameter). #' #' PRIBOR rates are reported as fractions, i.e. not as percentages...
#' Finding DMR #' #' Finding DMR by Wilcoxon, t-Student, Kolmogorov-Smirnow tests or logistic regression, logistic regression with mixed models, #' logistic regression with mixed models with correlation matrix. #' In Ttest, Wilcoxon and Ks are compared methylation rate between x and y prob on the same position and chro...
/R/find_DMR.R
no_license
geneticsMiNIng/metR
R
false
false
4,878
r
#' Finding DMR #' #' Finding DMR by Wilcoxon, t-Student, Kolmogorov-Smirnow tests or logistic regression, logistic regression with mixed models, #' logistic regression with mixed models with correlation matrix. #' In Ttest, Wilcoxon and Ks are compared methylation rate between x and y prob on the same position and chro...
library(data.table) library(ggplot2) library(wpp2017) ## IHME pops/mort source("/home/j/temp/central_comp/libraries/current/r/get_demographics.R") source("/home/j/temp/central_comp/libraries/current/r/get_demographics_template.R") mortality_2016_demographics <- get_demographics(gbd_team="mort", gbd_round_id=4) pops <...
/abs_cohorts.R
no_license
ngraetz/cfr
R
false
false
35,063
r
library(data.table) library(ggplot2) library(wpp2017) ## IHME pops/mort source("/home/j/temp/central_comp/libraries/current/r/get_demographics.R") source("/home/j/temp/central_comp/libraries/current/r/get_demographics_template.R") mortality_2016_demographics <- get_demographics(gbd_team="mort", gbd_round_id=4) pops <...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/add-link.R \name{add_link} \alias{add_link} \title{Add other association link plot on correlation plot.} \usage{ add_link(df, mapping = NULL, spec.key = "spec", env.key = "env", curvature = NULL, spec.label.hspace = NULL, spec.label.vspace ...
/man/add_link.Rd
no_license
xma82/ggcor
R
false
true
2,624
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/add-link.R \name{add_link} \alias{add_link} \title{Add other association link plot on correlation plot.} \usage{ add_link(df, mapping = NULL, spec.key = "spec", env.key = "env", curvature = NULL, spec.label.hspace = NULL, spec.label.vspace ...
data<-read.csv2("Salaries.csv",sep=",",header=TRUE) data$X<-NULL salaire<-as.data.frame(data) summary(data) library(tree) tree.Lin<-tree(salary~yrs.service+yrs.since.phd,data=salaire) #1.2.c tree.model<-tree(log(salary)~yrs.service+yrs.since.phd,data=salaire) plot(tree.Lin) text(tree.Lin,cex=.75) #1.3 salar.deciles<...
/Cours 5A/Big Data/Module 3 Modélisation/TD2/Pour les pd/td2.R
no_license
hejoseph/workspace
R
false
false
2,333
r
data<-read.csv2("Salaries.csv",sep=",",header=TRUE) data$X<-NULL salaire<-as.data.frame(data) summary(data) library(tree) tree.Lin<-tree(salary~yrs.service+yrs.since.phd,data=salaire) #1.2.c tree.model<-tree(log(salary)~yrs.service+yrs.since.phd,data=salaire) plot(tree.Lin) text(tree.Lin,cex=.75) #1.3 salar.deciles<...
#--------------- hurst_scan<-scan('mercyhurst.txt',what=character(),sep='\n') hurst_lines<-data_frame(line=1:24066,text=hurst_scan) hurst_lines$group<-hurst_lines$line %/% 80 hurst_words<-unnest_tokens(hurst_lines,word,text) afinn<-get_sentiments('afinn') hurst_words<-inner_join(hurst_words,afinn) hurst_groups<-hurs...
/Test Example Problems/test_examples.R
no_license
justinminsk/Communication-and-Data
R
false
false
3,914
r
#--------------- hurst_scan<-scan('mercyhurst.txt',what=character(),sep='\n') hurst_lines<-data_frame(line=1:24066,text=hurst_scan) hurst_lines$group<-hurst_lines$line %/% 80 hurst_words<-unnest_tokens(hurst_lines,word,text) afinn<-get_sentiments('afinn') hurst_words<-inner_join(hurst_words,afinn) hurst_groups<-hurs...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/collection_migrate.R \name{collection_migrate} \alias{collection_migrate} \title{Migrate documents to another collection} \usage{ collection_migrate(conn, name, target.collection, split.key, forward.timeout = NULL, async = NULL, raw = FALSE...
/man/collection_migrate.Rd
permissive
melsiddieg/solrium
R
false
true
1,955
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/collection_migrate.R \name{collection_migrate} \alias{collection_migrate} \title{Migrate documents to another collection} \usage{ collection_migrate(conn, name, target.collection, split.key, forward.timeout = NULL, async = NULL, raw = FALSE...
library(RWeka) multiplot <- function(..., plotlist=NULL, file, cols=1, layout=NULL) { library(grid) # Make a list from the ... arguments and plotlist plots <- c(list(...), plotlist) numPlots = length(plots) # If layout is NULL, then use 'cols' to determine layout if (is.null(layout)) { # Make ...
/scripts/weka.R
no_license
nddsg/forward-backward-ppr
R
false
false
8,964
r
library(RWeka) multiplot <- function(..., plotlist=NULL, file, cols=1, layout=NULL) { library(grid) # Make a list from the ... arguments and plotlist plots <- c(list(...), plotlist) numPlots = length(plots) # If layout is NULL, then use 'cols' to determine layout if (is.null(layout)) { # Make ...
# This script creates a SQL table of CFPB comment metadata # subset to Dodd-Frank dockets or RINs as identified by Davis Polk library(DBI) library(RSQLite) library(tidyverse) # API version v4 = FALSE ## now pulling from new search of API v4 if(v4){ load(here::here("data", "CFPBcomments.Rdata")) comments_all ...
/functions/sql_comment_metadata_CFPB.R
no_license
zoeang/rulemaking
R
false
false
5,635
r
# This script creates a SQL table of CFPB comment metadata # subset to Dodd-Frank dockets or RINs as identified by Davis Polk library(DBI) library(RSQLite) library(tidyverse) # API version v4 = FALSE ## now pulling from new search of API v4 if(v4){ load(here::here("data", "CFPBcomments.Rdata")) comments_all ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utility_define_param.R \name{define.param} \alias{define.param} \title{Define climateR configuration} \usage{ define.param(param, service = NULL) } \arguments{ \item{param}{the parameter(s) of interest} \item{service}{the dataset for which a...
/man/define.param.Rd
permissive
mbjoseph/climateR
R
false
true
616
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utility_define_param.R \name{define.param} \alias{define.param} \title{Define climateR configuration} \usage{ define.param(param, service = NULL) } \arguments{ \item{param}{the parameter(s) of interest} \item{service}{the dataset for which a...
context("logging x and y values") # Helper to check if a logging result has the correct structure expect_logging_result_structure = function(x) { expect_true(is.list(x)) expect_true(is.data.frame(x$pars)) expect_true(is.numeric(x$obj.vals)) } test_that("logging for functions with matrix input works well", { f...
/tests/testthat/test_logging.R
permissive
DrRoad/smoof
R
false
false
4,426
r
context("logging x and y values") # Helper to check if a logging result has the correct structure expect_logging_result_structure = function(x) { expect_true(is.list(x)) expect_true(is.data.frame(x$pars)) expect_true(is.numeric(x$obj.vals)) } test_that("logging for functions with matrix input works well", { f...
############################################################################################################ # ANÁLISE EMPÍRICA - ESTIMAÇÃO OLS E EFEITOS FIXOS (LAST YEAR) ############################################################################################################ ...
/4.5 - Estimação RDD Paramétrico (last year).R
no_license
joseeduardo-gs/do-political-parties-matter
R
false
false
23,941
r
############################################################################################################ # ANÁLISE EMPÍRICA - ESTIMAÇÃO OLS E EFEITOS FIXOS (LAST YEAR) ############################################################################################################ ...
# Andy Philips # andrew.philips@colorado.edu # 06/08/17 # --------------------------------# shinyUI(fluidPage( includeCSS("style.css"), titlePanel("Central Limit Theorem Simulator"), sidebarLayout(position = "right", sidebarPanel( radioButtons("dist", "Choose Distribution", c("Normal" =...
/CLT-Simulator/ui.R
no_license
anhnguyendepocen/Shiny-2
R
false
false
1,656
r
# Andy Philips # andrew.philips@colorado.edu # 06/08/17 # --------------------------------# shinyUI(fluidPage( includeCSS("style.css"), titlePanel("Central Limit Theorem Simulator"), sidebarLayout(position = "right", sidebarPanel( radioButtons("dist", "Choose Distribution", c("Normal" =...
setwd("C://Project1") getwd() dataset <- read.csv("./household_power_consumption.txt", header=T, sep=';', na.strings="?", nrows=2075259, check.names=F, stringsAsFactors=F, comment.char="", quote='\"') dataset$Date <- as.Date(dataset$Date, format="%d/%m/%Y") data <- subset(dataset, subset=(Date >= "2007-02-01" &...
/plot4.R
no_license
williewilkins/ExData_Plotting1
R
false
false
1,150
r
setwd("C://Project1") getwd() dataset <- read.csv("./household_power_consumption.txt", header=T, sep=';', na.strings="?", nrows=2075259, check.names=F, stringsAsFactors=F, comment.char="", quote='\"') dataset$Date <- as.Date(dataset$Date, format="%d/%m/%Y") data <- subset(dataset, subset=(Date >= "2007-02-01" &...
#basic class that points to the database and allows easier manipulations setClass("BuxcoDB", representation(db.name="character", annotation.table="character"), prototype=prototype(db.name=character(0), annotation.table="Additional_labels")) .run.update.statement <- function(db.con, query){ state <- dbSendStatement(d...
/R/BuxcoDB.R
no_license
dbottomly/plethy
R
false
false
26,316
r
#basic class that points to the database and allows easier manipulations setClass("BuxcoDB", representation(db.name="character", annotation.table="character"), prototype=prototype(db.name=character(0), annotation.table="Additional_labels")) .run.update.statement <- function(db.con, query){ state <- dbSendStatement(d...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/dse22e.R \docType{data} \name{dse22e} \alias{dse22e} \title{Dataset for Exercise E, Chapter 22} \format{A \code{data.frame} with 9 rows and 7 variables: \describe{ \item{y}{} \item{x1}{} \item{x2}{} \item{x3}{} \item{x4}{} \item{x5}{}...
/man/dse22e.Rd
no_license
danielgil1/aprean3
R
false
false
540
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/dse22e.R \docType{data} \name{dse22e} \alias{dse22e} \title{Dataset for Exercise E, Chapter 22} \format{A \code{data.frame} with 9 rows and 7 variables: \describe{ \item{y}{} \item{x1}{} \item{x2}{} \item{x3}{} \item{x4}{} \item{x5}{}...
#' FindBestModel #' #' @description Find the best model for a given forecast time #' #' @param dfPerf The performance dataframe #' @param forecast The forecast time #' @param vecOutcome The vector of outcome considered #' #' @return The label of the best model #' @export FindBestModel <- function(dfPerf, forecast = 7, ...
/R/FindBestModel.R
no_license
thomasferte/PredictCovidOpen
R
false
false
615
r
#' FindBestModel #' #' @description Find the best model for a given forecast time #' #' @param dfPerf The performance dataframe #' @param forecast The forecast time #' @param vecOutcome The vector of outcome considered #' #' @return The label of the best model #' @export FindBestModel <- function(dfPerf, forecast = 7, ...
#This is an applicaiton that predicts the next word based on ngram user input library(shiny) # Define UI for the application shinyUI(fluidPage( titlePanel("Next Word Prediction"), sidebarLayout( sidebarPanel( # Create the text input box textInput("inpNgram", label = h5("Please provide th...
/ui.R
no_license
cmba50/Final
R
false
false
691
r
#This is an applicaiton that predicts the next word based on ngram user input library(shiny) # Define UI for the application shinyUI(fluidPage( titlePanel("Next Word Prediction"), sidebarLayout( sidebarPanel( # Create the text input box textInput("inpNgram", label = h5("Please provide th...
# These functions are depricated # Only relsurv uses them, and I'm working on that ratetable <- function(...) { datecheck <- function(x) inherits(x, c("Date", "POSIXt", "date", "chron")) args <- list(...) nargs <- length(args) ll <- sapply(args, length) n <- max(ll) # We assume this is t...
/Recommended/survival/R/ratetableold.R
no_license
lukaszdaniel/ivory
R
false
false
1,791
r
# These functions are depricated # Only relsurv uses them, and I'm working on that ratetable <- function(...) { datecheck <- function(x) inherits(x, c("Date", "POSIXt", "date", "chron")) args <- list(...) nargs <- length(args) ll <- sapply(args, length) n <- max(ll) # We assume this is t...
\name{toBiblatex} \alias{toBiblatex} \alias{toBibtex} \alias{toBibtex.BibEntry} \title{Convert BibEntry objects to BibTeX or BibLaTeX} \usage{ toBiblatex(object, ...) \method{toBibtex}{BibEntry}(object, note.replace.field = c("urldate", "pubsate", "addendum"), extra.fields = NULL, ...) } \arguments{ \i...
/man/toBiblatex.Rd
no_license
aurora-mareviv/RefManageR
R
false
false
3,918
rd
\name{toBiblatex} \alias{toBiblatex} \alias{toBibtex} \alias{toBibtex.BibEntry} \title{Convert BibEntry objects to BibTeX or BibLaTeX} \usage{ toBiblatex(object, ...) \method{toBibtex}{BibEntry}(object, note.replace.field = c("urldate", "pubsate", "addendum"), extra.fields = NULL, ...) } \arguments{ \i...
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307429747e+77, 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_alpha/AFL_communities_individual_based_sampling_alpha/communities_individual_based_sampling_alpha_valgrind_files/1615769617-test.R
no_license
akhikolla/updatedatatype-list2
R
false
false
362
r
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307429747e+77, 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_...
library(testthat) library(cprint) test_check("cprint")
/tests/testthat.R
no_license
bgreenwell/cprint
R
false
false
56
r
library(testthat) library(cprint) test_check("cprint")
setwd("~/Documents/PushMe/Data") require(ggplot2) require(reshape2) require(splines) require(signal) require(entropy) require(RSEIS) rm(results) results = data.frame("time"=0, "meanX"=0, "meanY"=0, "meanZ"=0, "sdX"=0, "sdY"=0, "sdZ"=0, "sdT"=0, "energyX"=0, "energyY"=0, "energyZ"=0, "energyT"=0, "lat"=mean(sample$Latit...
/continuousMethod.R
permissive
jhrrsn/push_me
R
false
false
2,928
r
setwd("~/Documents/PushMe/Data") require(ggplot2) require(reshape2) require(splines) require(signal) require(entropy) require(RSEIS) rm(results) results = data.frame("time"=0, "meanX"=0, "meanY"=0, "meanZ"=0, "sdX"=0, "sdY"=0, "sdZ"=0, "sdT"=0, "energyX"=0, "energyY"=0, "energyZ"=0, "energyT"=0, "lat"=mean(sample$Latit...
######## load packages library(tidyverse) library(corrplot) library(fastDummies) library(rpart) library(rpart.plot) library(caret) library(glmnet) library(randomForest) library(ROCR) library(pROC) library(naivebayes) library(xgboost) library(e1071) library(vegan) library(factoextra) library(kableExtra)...
/Bank_Marketing_Campaign_Analysis.R
no_license
davidzhang647/Machine_Learning_Projects
R
false
false
13,767
r
######## load packages library(tidyverse) library(corrplot) library(fastDummies) library(rpart) library(rpart.plot) library(caret) library(glmnet) library(randomForest) library(ROCR) library(pROC) library(naivebayes) library(xgboost) library(e1071) library(vegan) library(factoextra) library(kableExtra)...
# Hierarchical Clustering dataset<-read.csv("Mall_Customers.csv") X=dataset[4:5] #Using the dendogram to find the optimal number of clusters dendogram=hclust(dist(X,method="euclidean"),method="ward.D") plot(dendogram, main=paste("Dendogram"), xlab="Customers", ylab="Euclidean Distances") #Fitting hie...
/03_Clustering/Hierarchical_Clustering/Hierarchical_Clustering_R_AM.R
no_license
AMDonati/ML_Algorithms_inR
R
false
false
736
r
# Hierarchical Clustering dataset<-read.csv("Mall_Customers.csv") X=dataset[4:5] #Using the dendogram to find the optimal number of clusters dendogram=hclust(dist(X,method="euclidean"),method="ward.D") plot(dendogram, main=paste("Dendogram"), xlab="Customers", ylab="Euclidean Distances") #Fitting hie...
#' @title Creatinine Normalisation #' @description Creatinine Normalisation (CN) is a useful method much like region of interest normalisation that can normalise spectra based on the total area of the creatinine signal at the chemical shift 3.05ppm. #' @details `creNorm()` works by dividing each element in a row with t...
/R/creNorm.R
permissive
kbario/concentr8r
R
false
false
5,031
r
#' @title Creatinine Normalisation #' @description Creatinine Normalisation (CN) is a useful method much like region of interest normalisation that can normalise spectra based on the total area of the creatinine signal at the chemical shift 3.05ppm. #' @details `creNorm()` works by dividing each element in a row with t...
screePlotAPA <- function(data, rep=1000, cent=.05) { library(nFactors) library(ggplot2) ev <- eigen(cor(data)) # get eigenvalues eig <- ev$values # eigenvalues ap <- parallel(subject = nrow(data), var = ncol(data), rep = rep, cent = cent) eig_pa <- ap$eigen$qevpea # The 95 centile nS <- nScree(x=ev$values...
/Factor Analysis/screePlotAPA.R
no_license
storopoli/R_Scripts
R
false
false
2,205
r
screePlotAPA <- function(data, rep=1000, cent=.05) { library(nFactors) library(ggplot2) ev <- eigen(cor(data)) # get eigenvalues eig <- ev$values # eigenvalues ap <- parallel(subject = nrow(data), var = ncol(data), rep = rep, cent = cent) eig_pa <- ap$eigen$qevpea # The 95 centile nS <- nScree(x=ev$values...
library(nimble) ### Name: Wishart ### Title: The Wishart Distribution ### Aliases: Wishart dwish_chol rwish_chol wishart ### ** Examples df <- 40 ch <- chol(matrix(c(1, .7, .7, 1), 2)) x <- rwish_chol(1, ch, df = df) dwish_chol(x, ch, df = df)
/data/genthat_extracted_code/nimble/examples/Wishart.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
252
r
library(nimble) ### Name: Wishart ### Title: The Wishart Distribution ### Aliases: Wishart dwish_chol rwish_chol wishart ### ** Examples df <- 40 ch <- chol(matrix(c(1, .7, .7, 1), 2)) x <- rwish_chol(1, ch, df = df) dwish_chol(x, ch, df = df)
library(dplyr) library(ggplot2) library(lubridate) library(stringr) # Input ------------------------------------------------------------------- data = read.csv('gun-violence-data_01-2013_03-2018.csv') # Understand data --------------------------------------------------------- glimpse(data) count_unique ...
/Gun Violence in US/EDA.R
no_license
kennhan/DataVis
R
false
false
3,389
r
library(dplyr) library(ggplot2) library(lubridate) library(stringr) # Input ------------------------------------------------------------------- data = read.csv('gun-violence-data_01-2013_03-2018.csv') # Understand data --------------------------------------------------------- glimpse(data) count_unique ...
##Plot 2 #Geting the data and transforming the first two collumns into a single variable for time tabela1 <- read.table(file = "household_power_consumption.txt",sep = ";",header = T,colClasses = c(rep("character",2),rep("numeric",7)),na.strings = "?") tabela1[,1]<- as.Date(tabela1[,1],"%d/%m/%Y") tabela2 <- subset.dat...
/Plot 2.R
no_license
Alibanio/ExData_Plotting1
R
false
false
744
r
##Plot 2 #Geting the data and transforming the first two collumns into a single variable for time tabela1 <- read.table(file = "household_power_consumption.txt",sep = ";",header = T,colClasses = c(rep("character",2),rep("numeric",7)),na.strings = "?") tabela1[,1]<- as.Date(tabela1[,1],"%d/%m/%Y") tabela2 <- subset.dat...
#install.packages("smoothmest") #install.packages("extraDistr") #install.packages("truncdist") library(MASS) #library(smoothmest) library(stats) library(extraDistr) set.seed(106) eps=runif(15) dexp_err = -log(log(eps^-1)) f = function( x, alpha , beta, gamma){ alpha*exp(-exp(beta-gamma*x)) } x = seq(from=1,to=15) y ...
/proj1.R
no_license
sinasanei/Genetic-Algorithms-and-their-applications-in-statistics
R
false
false
5,033
r
#install.packages("smoothmest") #install.packages("extraDistr") #install.packages("truncdist") library(MASS) #library(smoothmest) library(stats) library(extraDistr) set.seed(106) eps=runif(15) dexp_err = -log(log(eps^-1)) f = function( x, alpha , beta, gamma){ alpha*exp(-exp(beta-gamma*x)) } x = seq(from=1,to=15) y ...
library(tidyverse) library(imager) ############################# # # Color transformation # ########################### bi <- load.image("images/black_iris.jpg") bi_df <- bi %>% as.data.frame() %>% mutate(cc = factor(cc,labels=c('R','G','B'))) %>% group_by(cc) %>% mutate(cd = ecdf(value)(value) * 3.5) %>% u...
/okeeffe.R
no_license
doritge/img_processing
R
false
false
1,987
r
library(tidyverse) library(imager) ############################# # # Color transformation # ########################### bi <- load.image("images/black_iris.jpg") bi_df <- bi %>% as.data.frame() %>% mutate(cc = factor(cc,labels=c('R','G','B'))) %>% group_by(cc) %>% mutate(cd = ecdf(value)(value) * 3.5) %>% u...
## ## Plot closeness ## closeness <- function(file){ # Cumulative proportion of intronic sQTLs/non-sQTLs distances to the closest exon table<-read.table(file) distances<-as.factor(table[,2]) df<-as.data.frame(table(factor(distances))) df<-df[-c(1),] df<-rbind(c(0,0),df) total= sum(df$Freq) df$h = df...
/4.Blueprint/Enrichments/closeness.R
no_license
dgarmar/MT
R
false
false
975
r
## ## Plot closeness ## closeness <- function(file){ # Cumulative proportion of intronic sQTLs/non-sQTLs distances to the closest exon table<-read.table(file) distances<-as.factor(table[,2]) df<-as.data.frame(table(factor(distances))) df<-df[-c(1),] df<-rbind(c(0,0),df) total= sum(df$Freq) df$h = df...
setwd("C:/Users/smull2/R/exploratory") pfile<-file("household_power_consumption.txt","r") power.raw<-read.table(text = grep("^[1,2]/2/2007",readLines(pfile),value=TRUE),sep=";",dec=".",na.strings="?",header=FALSE,stringsAsFactors=FALSE) str(power.raw) ##Use colClasses to help when readLines ##colClass<-read.table("hou...
/Plot1.R
no_license
smullen17/ExData_Plotting1
R
false
false
1,501
r
setwd("C:/Users/smull2/R/exploratory") pfile<-file("household_power_consumption.txt","r") power.raw<-read.table(text = grep("^[1,2]/2/2007",readLines(pfile),value=TRUE),sep=";",dec=".",na.strings="?",header=FALSE,stringsAsFactors=FALSE) str(power.raw) ##Use colClasses to help when readLines ##colClass<-read.table("hou...
normalize_pipe_rhs <- function(rhs, binding) { if (!rlang::is_quosure(rhs)) { stop(paste("'rhs' parameter must be a quosure. Try calling", "'rhs <- rlang::enquo(rhs)' first")) } # Turn bare symbols into functions. if (rlang::is_symbol(rlang::f_rhs(rhs))) { rlang::f_rhs(rhs) <- rlang::lan...
/R/normalize.R
no_license
atheriel/rrails
R
false
false
3,588
r
normalize_pipe_rhs <- function(rhs, binding) { if (!rlang::is_quosure(rhs)) { stop(paste("'rhs' parameter must be a quosure. Try calling", "'rhs <- rlang::enquo(rhs)' first")) } # Turn bare symbols into functions. if (rlang::is_symbol(rlang::f_rhs(rhs))) { rlang::f_rhs(rhs) <- rlang::lan...
library(pollagg) # Fit a model y <- matrix(c(10, 900, 50, 50), ncol = 2, byrow = TRUE) n <- rowSums(y) fit <- yapa(y = y, n = n, dates = NULL, iter = 1000, chains = 3) # Test model fit if(!all(dim(fit$params$theta) == c(1500, 2, 2))) { stop("yapa is not returning results as expected") } # Test plot p <- plot(fit) ...
/tests/test-yapa.R
permissive
alexpavlakis/pollagg
R
false
false
621
r
library(pollagg) # Fit a model y <- matrix(c(10, 900, 50, 50), ncol = 2, byrow = TRUE) n <- rowSums(y) fit <- yapa(y = y, n = n, dates = NULL, iter = 1000, chains = 3) # Test model fit if(!all(dim(fit$params$theta) == c(1500, 2, 2))) { stop("yapa is not returning results as expected") } # Test plot p <- plot(fit) ...
library(TrenaProjectBrainCell) library(RUnit) library(trenaSGM) library(org.Hs.eg.db) #------------------------------------------------------------------------------------------------------------------------ if(!exists("tp")) { message(sprintf("--- creating instance of TrenaProjectBrainCell")) tp <- TrenaProjectB...
/inst/unitTests/test_TrenaProjectBrainCell.R
permissive
PriceLab/TrenaProjectBrainCell
R
false
false
15,715
r
library(TrenaProjectBrainCell) library(RUnit) library(trenaSGM) library(org.Hs.eg.db) #------------------------------------------------------------------------------------------------------------------------ if(!exists("tp")) { message(sprintf("--- creating instance of TrenaProjectBrainCell")) tp <- TrenaProjectB...
testlist <- list(id = NULL, id = NULL, booklet_id = c(8168473L, 2127314835L, 171177770L, -1942759639L, -1815221204L, 601253144L, -804651186L, 2094281728L, 860713787L, -971707632L, -1475044502L, 870040598L, -1182814578L, -1415711445L, 1901326755L, -1882837573L, 1340545259L, 1156041943L, 823641812L, -1106109928L, -10...
/dexterMST/inst/testfiles/is_person_booklet_sorted/AFL_is_person_booklet_sorted/is_person_booklet_sorted_valgrind_files/1615940028-test.R
no_license
akhikolla/updatedatatype-list1
R
false
false
826
r
testlist <- list(id = NULL, id = NULL, booklet_id = c(8168473L, 2127314835L, 171177770L, -1942759639L, -1815221204L, 601253144L, -804651186L, 2094281728L, 860713787L, -971707632L, -1475044502L, 870040598L, -1182814578L, -1415711445L, 1901326755L, -1882837573L, 1340545259L, 1156041943L, 823641812L, -1106109928L, -10...
library(ape) testtree <- read.tree("2548_1.txt") unrooted_tr <- unroot(testtree) write.tree(unrooted_tr, file="2548_1_unrooted.txt")
/codeml_files/newick_trees_processed/2548_1/rinput.R
no_license
DaniBoo/cyanobacteria_project
R
false
false
135
r
library(ape) testtree <- read.tree("2548_1.txt") unrooted_tr <- unroot(testtree) write.tree(unrooted_tr, file="2548_1_unrooted.txt")
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/stats_met.R \name{stats_met} \alias{stats_met} \title{Statistical Methods} \usage{ stats_met() } \value{ } \description{ Statistical Methods } \examples{ }
/man/stats_met.Rd
permissive
sbalci/histopathRaddins
R
false
true
236
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/stats_met.R \name{stats_met} \alias{stats_met} \title{Statistical Methods} \usage{ stats_met() } \value{ } \description{ Statistical Methods } \examples{ }
### comp_plot_sdhunter_year <- function(group = spgp, var = "sdhunter", prov = "", zone = "", M = out2, castes = jdat$castes ){ dsum = as.data.frame(M$summary...
/functions/comparison_plotting_function_sdhunter_year.R
no_license
AdamCSmithCWS/CWS_National_Harvest_Survey
R
false
false
1,314
r
### comp_plot_sdhunter_year <- function(group = spgp, var = "sdhunter", prov = "", zone = "", M = out2, castes = jdat$castes ){ dsum = as.data.frame(M$summary...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot_gg.R \name{plot_gg} \alias{plot_gg} \title{Transform ggplot2 objects into 3D} \usage{ plot_gg( ggobj, width = 3, height = 3, height_aes = NULL, invert = FALSE, shadow_intensity = 0.5, units = c("in", "cm", "mm"), scale = ...
/man/plot_gg.Rd
no_license
hiter-joe/rayshader
R
false
true
9,105
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot_gg.R \name{plot_gg} \alias{plot_gg} \title{Transform ggplot2 objects into 3D} \usage{ plot_gg( ggobj, width = 3, height = 3, height_aes = NULL, invert = FALSE, shadow_intensity = 0.5, units = c("in", "cm", "mm"), scale = ...
isat_my=function(y, mc = TRUE, ar = NULL, ewma = NULL, mxreg = NULL, iis = TRUE, sis = TRUE, tis = FALSE, uis = FALSE, blocks = NULL, ratio.threshold = 0.8, max.block.size = 30, t.pval = 0.001, wald.pval = t.pval, vcov.type = c("ordinary", "white", "newey-west"), ...
/ISA_indicator_saturation_v2.R
no_license
zuzanale/Master-thesis
R
false
false
18,439
r
isat_my=function(y, mc = TRUE, ar = NULL, ewma = NULL, mxreg = NULL, iis = TRUE, sis = TRUE, tis = FALSE, uis = FALSE, blocks = NULL, ratio.threshold = 0.8, max.block.size = 30, t.pval = 0.001, wald.pval = t.pval, vcov.type = c("ordinary", "white", "newey-west"), ...
## These functions can compute the inverse matrix of 'x' ## to save time, if the matrix has been calculated, the inverse ## matrix should be retrieved from the cache ## This function creates a special "matrix" object that can cache its inverse makeCacheMatrix <- function(x = matrix()) { m <- NULL set <- function(...
/cachematrix.R
no_license
wangjun341/ProgrammingAssignment2
R
false
false
954
r
## These functions can compute the inverse matrix of 'x' ## to save time, if the matrix has been calculated, the inverse ## matrix should be retrieved from the cache ## This function creates a special "matrix" object that can cache its inverse makeCacheMatrix <- function(x = matrix()) { m <- NULL set <- function(...
\name{dtWV} \alias{dtWV} \title{Noncentral t Distribution Density by W.V.} \description{ Compute the density function \eqn{f(x)} of the t distribution with \code{df} degrees of freedom and non-centrality parameter \code{ncp}, according to Wolfgang Viechtbauer's proposal in 2002. } \usage{%--> ../R/t-nonc-fn.R + ...
/man/dtWV.Rd
no_license
cran/DPQ
R
false
false
3,305
rd
\name{dtWV} \alias{dtWV} \title{Noncentral t Distribution Density by W.V.} \description{ Compute the density function \eqn{f(x)} of the t distribution with \code{df} degrees of freedom and non-centrality parameter \code{ncp}, according to Wolfgang Viechtbauer's proposal in 2002. } \usage{%--> ../R/t-nonc-fn.R + ...
### Load packages require( geomorph ) require( ape ) #Clear workspace rm( list = ls() ) #Set working directory to where turtle landmark data (from supplemental folder) is stored setwd( "INSERT DIRECTORY PATH" ) #Load landmark data and transform to correct format for GPA commands temp.file <- list.fi...
/Dataset 11. Labyrinth shape model comparisons.R
no_license
SerjoschaEvers/Turtle-Labyrinth-Ecomorphology-and-Evolution-Data
R
false
false
15,719
r
### Load packages require( geomorph ) require( ape ) #Clear workspace rm( list = ls() ) #Set working directory to where turtle landmark data (from supplemental folder) is stored setwd( "INSERT DIRECTORY PATH" ) #Load landmark data and transform to correct format for GPA commands temp.file <- list.fi...
library(igraph) load_graph <- function(filename) { edgelist <- read.table(filename, sep = "", header = F) return(edgelist) } convert_graph <- function(graph_df) { e <- c() for(i in 1:nrow(graph_df)) { row <- graph_df[i,] e <- c(e, row[[1]] + 1) e <- c(e, row[[2]] + 1) } return(graph(edges = e, n = max(gra...
/hypermap/hyper_embed.R
no_license
mananshah99/hyperbolic
R
false
false
476
r
library(igraph) load_graph <- function(filename) { edgelist <- read.table(filename, sep = "", header = F) return(edgelist) } convert_graph <- function(graph_df) { e <- c() for(i in 1:nrow(graph_df)) { row <- graph_df[i,] e <- c(e, row[[1]] + 1) e <- c(e, row[[2]] + 1) } return(graph(edges = e, n = max(gra...
# Solution to question 2 # V, the given matrix: V <- matrix(c(3, -1, 1, -1, 5, -1, 1, -1, 3), 3) # Q (orthogonal here) contains eigenvectors in its columns: Q <- eigen(V)$vectors # D contains the inverse square roots of of V's eigenvalues # on the diagonal, zeros elsewhere: D <- diag(1/sqrt(eigen(V)...
/week2/question2.R
no_license
david-dobor/8004
R
false
false
450
r
# Solution to question 2 # V, the given matrix: V <- matrix(c(3, -1, 1, -1, 5, -1, 1, -1, 3), 3) # Q (orthogonal here) contains eigenvectors in its columns: Q <- eigen(V)$vectors # D contains the inverse square roots of of V's eigenvalues # on the diagonal, zeros elsewhere: D <- diag(1/sqrt(eigen(V)...
\name{LaplacesDemonCpp-package} \alias{LaplacesDemonCpp-package} \alias{LaplacesDemonCpp} \alias{.colVars} \alias{.iqagh} \alias{.iqaghsg} \alias{.iqcagh} \alias{.laaga} \alias{.labfgs} \alias{.labhhh} \alias{.lacg} \alias{.ladfp} \alias{.lahar} \alias{.lahj} \alias{.lalbfgs} \alias{.lalm} \alias{.lanm} \alias{.lanr} \...
/man/LaplacesDemonCpp-package.Rd
permissive
sakex/LaplacesDemonCpp
R
false
false
2,319
rd
\name{LaplacesDemonCpp-package} \alias{LaplacesDemonCpp-package} \alias{LaplacesDemonCpp} \alias{.colVars} \alias{.iqagh} \alias{.iqaghsg} \alias{.iqcagh} \alias{.laaga} \alias{.labfgs} \alias{.labhhh} \alias{.lacg} \alias{.ladfp} \alias{.lahar} \alias{.lahj} \alias{.lalbfgs} \alias{.lalm} \alias{.lanm} \alias{.lanr} \...
#Use fold change change data to look for trends in gene expression changes and make line plots install.packages("ggplot2") install.packages("reshape2") install.packages("pheatmap") install.packages("tidyr") install.packages("reshape") library(ggplot2) library(reshape2) library(pheatmap) library(tidyr) library(resh...
/sleuth.maplot.rerun.R
no_license
Jawara22/fragillis
R
false
false
18,289
r
#Use fold change change data to look for trends in gene expression changes and make line plots install.packages("ggplot2") install.packages("reshape2") install.packages("pheatmap") install.packages("tidyr") install.packages("reshape") library(ggplot2) library(reshape2) library(pheatmap) library(tidyr) library(resh...
\name{tesseract} \alias{tesseract} \alias{TesseractBaseAPI-class} \alias{SetImage} \alias{Recognize} \alias{SetRectangle} \alias{SetSourceResolution} \alias{GetInputName} \alias{SetInputName} \alias{GetDatapath} \alias{GetInitLanguages} \alias{ReadConfigFile} \alias{GetSourceYResolution} \alias{IsValidWord} \alias{Init...
/man/tesseract.Rd
no_license
aorimi/Rtesseract
R
false
false
3,256
rd
\name{tesseract} \alias{tesseract} \alias{TesseractBaseAPI-class} \alias{SetImage} \alias{Recognize} \alias{SetRectangle} \alias{SetSourceResolution} \alias{GetInputName} \alias{SetInputName} \alias{GetDatapath} \alias{GetInitLanguages} \alias{ReadConfigFile} \alias{GetSourceYResolution} \alias{IsValidWord} \alias{Init...
#' Tests of radiative transfer models library(PEcAnRTM) context("SAIL models") data(model.list) setkey(model.list, modname) p <- defparam("pro4sail") pout <- pro4sail(p) test.dim <- c(2101,4) test_that("Returns matrix", { expect_is(pout, "matrix") }) test_that("Correct dimensions", { expe...
/modules/rtm/tests/testthat/test.sail.R
permissive
davidjpmoore/pecan
R
false
false
437
r
#' Tests of radiative transfer models library(PEcAnRTM) context("SAIL models") data(model.list) setkey(model.list, modname) p <- defparam("pro4sail") pout <- pro4sail(p) test.dim <- c(2101,4) test_that("Returns matrix", { expect_is(pout, "matrix") }) test_that("Correct dimensions", { expe...
### XXX is the stuff in this file correct or should we be exporting *formatted* values to ### meet the needs of consumers of this? Do we ened to support both? #' Create Enriched flat value table with paths #' #' #' This function creates a flat tabular file of cell values and #' corresponding paths. #' #' List columns...
/R/tt_export.R
permissive
jcheng5/rtables
R
false
false
6,986
r
### XXX is the stuff in this file correct or should we be exporting *formatted* values to ### meet the needs of consumers of this? Do we ened to support both? #' Create Enriched flat value table with paths #' #' #' This function creates a flat tabular file of cell values and #' corresponding paths. #' #' List columns...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mod_table_pieces.R \name{mod_table_piecesui} \alias{mod_table_piecesui} \alias{mod_table_pieces} \title{mod_table_piecesui and mod_table_pieces} \usage{ mod_table_piecesui(id) mod_table_pieces( input, output, session, scale_obj, st...
/man/mod_table_piecesui.Rd
permissive
federman/shinylego
R
false
true
523
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mod_table_pieces.R \name{mod_table_piecesui} \alias{mod_table_piecesui} \alias{mod_table_pieces} \title{mod_table_piecesui and mod_table_pieces} \usage{ mod_table_piecesui(id) mod_table_pieces( input, output, session, scale_obj, st...
# # This file is for plot 1 for Expolitory Data Analysis Project 1 # ############################################################################### # Step 1 Set the file locations and read the file # Note: This file assumes the data file exists in the "explore_p_1" subdirectory # under the working directory ###...
/plot1.R
no_license
MGoodman10/ExData_Plotting1
R
false
false
1,310
r
# # This file is for plot 1 for Expolitory Data Analysis Project 1 # ############################################################################### # Step 1 Set the file locations and read the file # Note: This file assumes the data file exists in the "explore_p_1" subdirectory # under the working directory ###...
context("Checking findVariance") test_that("One cat column, one measure col, and no date columns give correct df", { df <- data.frame(Gender = c('F','M','M','M','M','F','F','F'), LOS = c(3.2,NA,5,1.3,2.4,4,9,5)) dfRes <- findVariation(df = df, categoricalCols = "Gender"...
/tests/testthat/test-find-variance.R
permissive
Quantitative72/healthcareai-r
R
false
false
17,564
r
context("Checking findVariance") test_that("One cat column, one measure col, and no date columns give correct df", { df <- data.frame(Gender = c('F','M','M','M','M','F','F','F'), LOS = c(3.2,NA,5,1.3,2.4,4,9,5)) dfRes <- findVariation(df = df, categoricalCols = "Gender"...
# Apriori # Data Preprocessing # install.packages('arules') library(arules) dataset = read.csv('~/Dropbox/github/machine_learning_udemy/machine-learning-udemy/part-5-association-rule-learning/Apriori/Market_Basket_Optimisation.csv', header = FALSE) dataset = read.transactions('~/Dropbox/github/machine_learning_udemy/m...
/part-5-association-rule-learning/Apriori/apriori.R
no_license
adamzolotarev/machine-learning-udemy
R
false
false
691
r
# Apriori # Data Preprocessing # install.packages('arules') library(arules) dataset = read.csv('~/Dropbox/github/machine_learning_udemy/machine-learning-udemy/part-5-association-rule-learning/Apriori/Market_Basket_Optimisation.csv', header = FALSE) dataset = read.transactions('~/Dropbox/github/machine_learning_udemy/m...
#capturing old digitized data require(digitize) ##there is no angle correction on this if the file is rotated you get wrong values ca = ReadAndCal('~/Documents/Adam/Lobster/LFA38/Jan2020/CampbellandDugganTotalEffortTotalTraps.png') #click xlow, xhigh, ylow, yhigh and calibratin is now ca dp = DigitData(col = 'red') ...
/inst/IP/DigitizingOldFigs.r
no_license
jfontestad/bio.lobster
R
false
false
1,281
r
#capturing old digitized data require(digitize) ##there is no angle correction on this if the file is rotated you get wrong values ca = ReadAndCal('~/Documents/Adam/Lobster/LFA38/Jan2020/CampbellandDugganTotalEffortTotalTraps.png') #click xlow, xhigh, ylow, yhigh and calibratin is now ca dp = DigitData(col = 'red') ...
hero <- function(bullets, dragons) { ifelse(bullets / dragons >= 2, TRUE, FALSE) }
/R/8_kyu/Is_he_gonna_survive.R
no_license
y0wel/Codewars-Kata
R
false
false
84
r
hero <- function(bullets, dragons) { ifelse(bullets / dragons >= 2, TRUE, FALSE) }
# plotmo.R: plot the model response when varying one or two predictors # # Stephen Milborrow Sep 2006 Cape Town plotmo <- function(object = stop("no 'object' argument"), type = NULL, nresponse = NA, pt.col = 0, jitter = .5, smooth.col = 0, level = 0, func ...
/plotmo/R/plotmo.R
no_license
ingted/R-Examples
R
false
false
67,472
r
# plotmo.R: plot the model response when varying one or two predictors # # Stephen Milborrow Sep 2006 Cape Town plotmo <- function(object = stop("no 'object' argument"), type = NULL, nresponse = NA, pt.col = 0, jitter = .5, smooth.col = 0, level = 0, func ...
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31638858795802e+77, 9.53818252170339e+295, 1.22810536108214e+146, 4.12396251261199e-221, 0), .Dim = c(5L, 1L))) result <- do.call(CNull:::communities_individual_based_sampling_beta,testlist) str(result)
/CNull/inst/testfiles/communities_individual_based_sampling_beta/AFL_communities_individual_based_sampling_beta/communities_individual_based_sampling_beta_valgrind_files/1615833592-test.R
no_license
akhikolla/updatedatatype-list2
R
false
false
270
r
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31638858795802e+77, 9.53818252170339e+295, 1.22810536108214e+146, 4.12396251261199e-221, 0), .Dim = c(5L, 1L))) result <- do.call(CNull:::communities_individual_based_sampling_beta,testlist) str(result)
data <- read.table("./data/household_power_consumption.txt", header=TRUE, sep=";", stringsAsFactors=FALSE, dec=".") data1 <- subset(data,as.Date(data$Date,"%d/%m/%Y")=="2007-02-01") data2 <- subset(data,as.Date(data$Date,"%d/%m/%Y")=="2007-02-02") data3 <- rbind(data1,data2) data4 <- strptime(paste(data3$Date,data3$Tim...
/plot3.R
no_license
weizuo/ExData_Plotting1
R
false
false
805
r
data <- read.table("./data/household_power_consumption.txt", header=TRUE, sep=";", stringsAsFactors=FALSE, dec=".") data1 <- subset(data,as.Date(data$Date,"%d/%m/%Y")=="2007-02-01") data2 <- subset(data,as.Date(data$Date,"%d/%m/%Y")=="2007-02-02") data3 <- rbind(data1,data2) data4 <- strptime(paste(data3$Date,data3$Tim...
# set up parallelized portion from qsub jobnum <- as.numeric(commandArgs()[3]) root_path <- commandArgs()[4] outpath <- commandArgs()[5] if (Sys.info()[1] == "Linux"){ j <- "FILEPATH" h <- paste0("FILEPATH",Sys.info()[6]) package_lib <- paste0(j,'FILEPATH') } else { j <- "FILEPATH" h <- "FILEPATH" packag...
/gbd_2017/nonfatal_code/ntd_schisto/extract_par_species_parallel.r
no_license
Nermin-Ghith/ihme-modeling
R
false
false
8,805
r
# set up parallelized portion from qsub jobnum <- as.numeric(commandArgs()[3]) root_path <- commandArgs()[4] outpath <- commandArgs()[5] if (Sys.info()[1] == "Linux"){ j <- "FILEPATH" h <- paste0("FILEPATH",Sys.info()[6]) package_lib <- paste0(j,'FILEPATH') } else { j <- "FILEPATH" h <- "FILEPATH" packag...
## ----setup,echo=FALSE,include=FALSE-------------------------------------- library(knitr) library(bodenmiller) library(ggplot2) library(dplyr) library(reshape2) library(RColorBrewer) knitr::opts_chunk$set(warning=FALSE, fig.keep='high', fig.align='center') do.f...
/data/genthat_extracted_code/bodenmiller/vignettes/bodenmiller.R
no_license
surayaaramli/typeRrh
R
false
false
4,239
r
## ----setup,echo=FALSE,include=FALSE-------------------------------------- library(knitr) library(bodenmiller) library(ggplot2) library(dplyr) library(reshape2) library(RColorBrewer) knitr::opts_chunk$set(warning=FALSE, fig.keep='high', fig.align='center') do.f...
# load the required packages install.packages("caret") install.packages("rattle") install.packages("rpart") install.packages("rpart.plot") install.packages("randomForest") install.packages("repmis") install.packages("e1071") library(caret) library(rattle) library(rpart) library(rpart.plot) library(randomForest) librar...
/predict.R
no_license
CherryPon/predictionAssignment
R
false
false
1,664
r
# load the required packages install.packages("caret") install.packages("rattle") install.packages("rpart") install.packages("rpart.plot") install.packages("randomForest") install.packages("repmis") install.packages("e1071") library(caret) library(rattle) library(rpart) library(rpart.plot) library(randomForest) librar...
library(raster) library(rgdal) library(ggplot2) library(reshape2) library(plyr) # -------------------------------------------------------------------------------- # Note: This first part I found in a tutorial online: # https://downwithtime.wordpress.com/2013/12/04/naturalearthdata-and-r-in-ggplot2/ # --------...
/natearthtest.R
permissive
coreyabshire/ivmooc-gtap
R
false
false
7,272
r
library(raster) library(rgdal) library(ggplot2) library(reshape2) library(plyr) # -------------------------------------------------------------------------------- # Note: This first part I found in a tutorial online: # https://downwithtime.wordpress.com/2013/12/04/naturalearthdata-and-r-in-ggplot2/ # --------...
library(Signac) library(Seurat) library(ggplot2) library(harmony) library(dplyr) options(future.globals.maxSize = 50000 * 1024^2) load('../data_processed/obj_all.rda') ######## Quality control to filter cells ######## ## Filter cells # RNA-seq: nCount_RNA, percent.mt # ATAC-seq: nCount_ATAC, nucleosome_signal, TSS...
/preprocessing.R
permissive
xbendl/singlecell-multiomics-developmental-human-brain
R
false
false
9,098
r
library(Signac) library(Seurat) library(ggplot2) library(harmony) library(dplyr) options(future.globals.maxSize = 50000 * 1024^2) load('../data_processed/obj_all.rda') ######## Quality control to filter cells ######## ## Filter cells # RNA-seq: nCount_RNA, percent.mt # ATAC-seq: nCount_ATAC, nucleosome_signal, TSS...
library(data.table) library(ggplot2) library(fts) library(Rmisc) library(lubridate) library(gtools) library(dplyr) library(zoo) setwd("D://codes//Rfile//investment theory and practice//") files <- list.files(".//factor_daily//return//") factor.data <- NULL for (file in files){ path <- paste0(".//fac...
/Volatility-Managed Portfolios Sometimes it Works/codes/vol-timing.R
no_license
coolgan/Quantitative-Finance
R
false
false
24,009
r
library(data.table) library(ggplot2) library(fts) library(Rmisc) library(lubridate) library(gtools) library(dplyr) library(zoo) setwd("D://codes//Rfile//investment theory and practice//") files <- list.files(".//factor_daily//return//") factor.data <- NULL for (file in files){ path <- paste0(".//fac...
# Data Types # Vector # Lists # Matrices # Array # DataFrames & Factors my.var <- 432 is.vector(my.var) # Characters # Numeric and Integer # Logical # Complex
/R/dataTypes.R
no_license
thedatatot/rahul_kumar
R
false
false
166
r
# Data Types # Vector # Lists # Matrices # Array # DataFrames & Factors my.var <- 432 is.vector(my.var) # Characters # Numeric and Integer # Logical # Complex
source("main.R") # most 5 star reviewed companies top5StarCompanies = reviews %>% filter(stars == 5) %>% group_by(business_id) %>% summarise(Count = n()) %>% arrange(desc(Count)) %>% ungroup() %>% mutate(BusinessID = reorder(business_id,Count)) %>% head(10) top5StarCompanies = inner_join(top5StarCompani...
/src/5Star-Reviewed-Restaurants.R
no_license
HENRY-JERRY/mit-805-2020-yelp-project
R
false
false
806
r
source("main.R") # most 5 star reviewed companies top5StarCompanies = reviews %>% filter(stars == 5) %>% group_by(business_id) %>% summarise(Count = n()) %>% arrange(desc(Count)) %>% ungroup() %>% mutate(BusinessID = reorder(business_id,Count)) %>% head(10) top5StarCompanies = inner_join(top5StarCompani...
#' Budget manager #' #' This package is a personnal project to manage a budget #' #' @name budgetmanager #' #' @import magrittr #' NULL
/R/budgetmanager.R
no_license
denrou/budgetmanager
R
false
false
136
r
#' Budget manager #' #' This package is a personnal project to manage a budget #' #' @name budgetmanager #' #' @import magrittr #' NULL
traf <- read.csv("flow_occ.txt") nint <- nrow(traf) # number of 5-min intervals, 1740 ## Suppose starts on March 14th, 2003, Friday at midnight (we don't know the time) ## then ends at 1am on Thur, March 20th day <- rep(c("Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"), ...
/trafficJams/data-raw/flow_occ.R
no_license
debnolan/DynDocs
R
false
false
860
r
traf <- read.csv("flow_occ.txt") nint <- nrow(traf) # number of 5-min intervals, 1740 ## Suppose starts on March 14th, 2003, Friday at midnight (we don't know the time) ## then ends at 1am on Thur, March 20th day <- rep(c("Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"), ...
context("junit") test_that("multiplication works", { expect_equal(1 * 2, 2) expect_equal(2 * 2, 3) expect_equal(3 * 2, 6) expect_equal(4 * 2, 6) }) test_that("summation works", { expect_equal(1 + 1, 2) expect_equal(2 + 2, 5) expect_equal(3 + 3, 6) expect_equal(4 + 4, 8) })
/tests/testthat/test-junit.R
no_license
yutannihilation/testthatJunitRporterTest
R
false
false
292
r
context("junit") test_that("multiplication works", { expect_equal(1 * 2, 2) expect_equal(2 * 2, 3) expect_equal(3 * 2, 6) expect_equal(4 * 2, 6) }) test_that("summation works", { expect_equal(1 + 1, 2) expect_equal(2 + 2, 5) expect_equal(3 + 3, 6) expect_equal(4 + 4, 8) })
context("ifan vs dfan") test_that("Can create FFTrees object with dfan", { object <- FFTrees(diagnosis ~., data = heartdisease, algorithm = "dfan") expect_is(object = object, class = "FFTrees") }) test_that("Different results with ifan and dfan", { trees_ifan <- FFTrees(diagnosis ~., ...
/tests/testthat/test-ifan_v_dfan.R
no_license
Barardo/FFTrees
R
false
false
631
r
context("ifan vs dfan") test_that("Can create FFTrees object with dfan", { object <- FFTrees(diagnosis ~., data = heartdisease, algorithm = "dfan") expect_is(object = object, class = "FFTrees") }) test_that("Different results with ifan and dfan", { trees_ifan <- FFTrees(diagnosis ~., ...
## ----eval=FALSE,include=FALSE------------------------------------------------- ## source("../../rnw2pdf.R") ## rnw2pdf("lecture-survival") ## rnw2pdf("lecture-survival",tangle=TRUE)
/lectures/survival/lecture-survival.R
no_license
rbchan/applied-popdy
R
false
false
185
r
## ----eval=FALSE,include=FALSE------------------------------------------------- ## source("../../rnw2pdf.R") ## rnw2pdf("lecture-survival") ## rnw2pdf("lecture-survival",tangle=TRUE)
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/auth.R \name{orcid_auth} \alias{orcid_auth} \alias{rorcid-auth} \title{ORCID authorization} \usage{ orcid_auth(scope = "/authenticate", reauth = FALSE, redirect_uri = getOption("rorcid.redirect_uri")) } \arguments{ \item{scope}{(character) ...
/man/orcid_auth.Rd
permissive
pkraker/rorcid
R
false
true
2,216
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/auth.R \name{orcid_auth} \alias{orcid_auth} \alias{rorcid-auth} \title{ORCID authorization} \usage{ orcid_auth(scope = "/authenticate", reauth = FALSE, redirect_uri = getOption("rorcid.redirect_uri")) } \arguments{ \item{scope}{(character) ...
library(TOAST) library(peakRAM) # config = "n_100_DE_pattern_2_1_1_replicate_1" test_TOAST_TPM = function(config) { RDatafile = sprintf(file.path("../simulation", config, "simulation.RData")) load(RDatafile) # Will use: observed_TPM, rho_from_TPM, clinical_variables, adjusted_signature_gene_TPM (only for cel...
/R/simulation_test_TOAST_TPM.R
permissive
Sun-lab/CARseq_pipelines
R
false
false
3,283
r
library(TOAST) library(peakRAM) # config = "n_100_DE_pattern_2_1_1_replicate_1" test_TOAST_TPM = function(config) { RDatafile = sprintf(file.path("../simulation", config, "simulation.RData")) load(RDatafile) # Will use: observed_TPM, rho_from_TPM, clinical_variables, adjusted_signature_gene_TPM (only for cel...
# -------------------------------------------------------- # ARGUMENTS: # data - a dataframe # respvar - a string; variable name of the response variable # env - a string; variable name of the environment variable # is.random - logical; indicates whether genotype/treatment is random or not; default value is FALSE (FIXE...
/R3.0.2 Package Creation/PBTools/R/graph_mea1s_diagplots.R
no_license
djnpisano/RScriptLibrary
R
false
false
2,559
r
# -------------------------------------------------------- # ARGUMENTS: # data - a dataframe # respvar - a string; variable name of the response variable # env - a string; variable name of the environment variable # is.random - logical; indicates whether genotype/treatment is random or not; default value is FALSE (FIXE...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/wfm.R \name{docs} \alias{docs} \alias{docs<-} \title{Extract Document Names} \usage{ docs(wfm) docs(wfm) <- value } \arguments{ \item{wfm}{an object of type wfm} \item{value}{replacement if assignment} } \value{ A list of document names. } ...
/man/docs.Rd
no_license
markwestcott34/austin
R
false
true
435
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/wfm.R \name{docs} \alias{docs} \alias{docs<-} \title{Extract Document Names} \usage{ docs(wfm) docs(wfm) <- value } \arguments{ \item{wfm}{an object of type wfm} \item{value}{replacement if assignment} } \value{ A list of document names. } ...
#' Creates a dataframe with predictions from each model #' and real choices #' params tree dataframe compare_link_prediction <- function(df.tree, params.Gomez2013, params.Aragon2017){ # We can compare with barabasi becaus the choice is independent of the alpha parents <- df.tree$parent parents.users <- df.tree$p...
/R/link_prediction.R
permissive
elaragon/generative-discussion-threads
R
false
false
3,312
r
#' Creates a dataframe with predictions from each model #' and real choices #' params tree dataframe compare_link_prediction <- function(df.tree, params.Gomez2013, params.Aragon2017){ # We can compare with barabasi becaus the choice is independent of the alpha parents <- df.tree$parent parents.users <- df.tree$p...
#' Extract multiple subclades from a phylogeny based on node numbers #' #' Given a tree and a vector or list of nodes, this function extracts subclades and #' returns a list of smaller trees. #' #' @param tree An ape-style phylogenetic tree. #' @param nodes A named list or vector of node numbers that subtend the clade ...
/R/extractClade.R
no_license
jesusNPL/addTaxa
R
false
false
3,302
r
#' Extract multiple subclades from a phylogeny based on node numbers #' #' Given a tree and a vector or list of nodes, this function extracts subclades and #' returns a list of smaller trees. #' #' @param tree An ape-style phylogenetic tree. #' @param nodes A named list or vector of node numbers that subtend the clade ...
library(shiny) library(shinydashboard) library(data.table) library(ggplot2) data = data.table(group = rep(c(1, 3, 6), each = 10), x = rep(1:10, times = 3), value = rnorm(30)) sidebar <- dashboardSidebar( uiOutput("Sidebar") ) body <- dashboardBody( uiOutput("TABUI") ) # Put them together into a dashboardPage ui ...
/R/shiny-examples/08_dynamic-tabs/app5.R
no_license
michellymenezes/ladybird-umbrella
R
false
false
1,926
r
library(shiny) library(shinydashboard) library(data.table) library(ggplot2) data = data.table(group = rep(c(1, 3, 6), each = 10), x = rep(1:10, times = 3), value = rnorm(30)) sidebar <- dashboardSidebar( uiOutput("Sidebar") ) body <- dashboardBody( uiOutput("TABUI") ) # Put them together into a dashboardPage ui ...
# testSource # Load the library require(RCurl) # Provide the web address of the file: fileURL <- getURL('https://raw.githubusercontent.com/SCBI-MigBirds/MigBirds/master/data/exampleBirdData.csv') # Read in the data: birdCounts <- read.csv(text = fileURL) birdCounts
/testSource.R
no_license
SCBI-MigBirds/scbi-migbirds.github.io
R
false
false
274
r
# testSource # Load the library require(RCurl) # Provide the web address of the file: fileURL <- getURL('https://raw.githubusercontent.com/SCBI-MigBirds/MigBirds/master/data/exampleBirdData.csv') # Read in the data: birdCounts <- read.csv(text = fileURL) birdCounts
# @title .onAttach # @description Load required data into gloval enviroment # @keywords internal .onAttach<- function (libname, pkgname){ packageStartupMessage(paste0( " ==============================================================\n", " \n", " CAMPARI analysis tools ...
/R/misc.R
no_license
clangi/CampaRi
R
false
false
8,170
r
# @title .onAttach # @description Load required data into gloval enviroment # @keywords internal .onAttach<- function (libname, pkgname){ packageStartupMessage(paste0( " ==============================================================\n", " \n", " CAMPARI analysis tools ...
###Script for task 04 ###Author: April Armes ###Group: IMAAS library(ggplot2)#loads ggplot 2 diamonds # calls diamonds dataset nrow(diamonds)#tells you how many rows diamonds dataset has -> a lot. set.seed(1410) #makes the results the same for everyone dsmall <- diamonds[sample(nrow(diamonds), 100), ] #creates a vect...
/R/Task_4.R
no_license
Nuapril/GEOL_590
R
false
false
4,234
r
###Script for task 04 ###Author: April Armes ###Group: IMAAS library(ggplot2)#loads ggplot 2 diamonds # calls diamonds dataset nrow(diamonds)#tells you how many rows diamonds dataset has -> a lot. set.seed(1410) #makes the results the same for everyone dsmall <- diamonds[sample(nrow(diamonds), 100), ] #creates a vect...
% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/Transition_functions.r \name{cjs_gamma} \alias{cjs_gamma} \alias{ms2_gamma} \alias{ms_gamma} \title{HMM Transition matrix functions} \usage{ cjs_gamma(pars, m, F, T) } \arguments{ \item{pars}{list of real parameter values f...
/marked/man/cjs_gamma.Rd
no_license
bmcclintock/marked
R
false
false
900
rd
% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/Transition_functions.r \name{cjs_gamma} \alias{cjs_gamma} \alias{ms2_gamma} \alias{ms_gamma} \title{HMM Transition matrix functions} \usage{ cjs_gamma(pars, m, F, T) } \arguments{ \item{pars}{list of real parameter values f...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gutenberg_richter_densities.R \name{qGR} \alias{qGR} \title{Inverse cumulative distribution function for Gutenberg Richter distribution} \usage{ qGR(p, b, mw_min) } \arguments{ \item{p}{vector of probabilities} \item{b}{Gutenberg-Richter b v...
/R/rptha/man/qGR.Rd
permissive
GeoscienceAustralia/ptha
R
false
true
628
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gutenberg_richter_densities.R \name{qGR} \alias{qGR} \title{Inverse cumulative distribution function for Gutenberg Richter distribution} \usage{ qGR(p, b, mw_min) } \arguments{ \item{p}{vector of probabilities} \item{b}{Gutenberg-Richter b v...
## The functions are used to calculate and cache the inverse of a matrix ## The following function creates a list containing functions to set and ## get the values of a matrix and its inverse makeCacheMatrix <- function(x = matrix()) { inv <- NULL set <- function(y) { x <<- y inv <- ...
/cachematrix.R
no_license
luciawrq/ProgrammingAssignment2
R
false
false
963
r
## The functions are used to calculate and cache the inverse of a matrix ## The following function creates a list containing functions to set and ## get the values of a matrix and its inverse makeCacheMatrix <- function(x = matrix()) { inv <- NULL set <- function(y) { x <<- y inv <- ...
source("Project1Lib.R") fn_Plot4 <- function(x) { fname <- "plot4.png" cat("Creating",fname, "\n") # attach(hpc) par(mfrow=c(2,2)) plot(hpc$DateTime, hpc$Global_active_power, type="l", ylab="Global Active Power", xlab="") plot(DateTime, Voltage, type="l", ylab="Voltage",xlab="datetime") # yrange<-ran...
/plot4.R
no_license
nate43026/ExData_Plotting1
R
false
false
962
r
source("Project1Lib.R") fn_Plot4 <- function(x) { fname <- "plot4.png" cat("Creating",fname, "\n") # attach(hpc) par(mfrow=c(2,2)) plot(hpc$DateTime, hpc$Global_active_power, type="l", ylab="Global Active Power", xlab="") plot(DateTime, Voltage, type="l", ylab="Voltage",xlab="datetime") # yrange<-ran...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/DataOrganization.R \name{NumberPermsAnySize} \alias{NumberPermsAnySize} \title{Total Number of Permutations of all sizes} \usage{ NumberPermsAnySize(n, min = 1) } \arguments{ \item{n}{The total number of choices} \item{min}{The total number ...
/man/NumberPermsAnySize.Rd
no_license
alexbrodersen/teis
R
false
true
796
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/DataOrganization.R \name{NumberPermsAnySize} \alias{NumberPermsAnySize} \title{Total Number of Permutations of all sizes} \usage{ NumberPermsAnySize(n, min = 1) } \arguments{ \item{n}{The total number of choices} \item{min}{The total number ...
library(datafsm) context("Main evolve_model function") test_that("evolve_model() returns correct type of object", { cdata <- data.frame(period = 1:5, outcome = c(1,2,1,1,1), my.decision1 = c(1,0,1,1,1), other.decision1 = c(0,0,0,1,1)) result <- evolve_model(cdata, cv=FALSE) ...
/tests/testthat/test_mainfunc.R
permissive
jdblischak/datafsm
R
false
false
1,556
r
library(datafsm) context("Main evolve_model function") test_that("evolve_model() returns correct type of object", { cdata <- data.frame(period = 1:5, outcome = c(1,2,1,1,1), my.decision1 = c(1,0,1,1,1), other.decision1 = c(0,0,0,1,1)) result <- evolve_model(cdata, cv=FALSE) ...
gcv_function <- function(alpha,gamma2,beta) { f = (alpha^2)/(gamma2 + alpha^2); ### length(f); ### length(beta); if(length(f)>length(beta)) { f=f[1:length(beta)]; } else { if(length(beta)>length(f)) { iend = length(beta) beta=beta[...
/R/gcv_function.R
no_license
cran/PEIP
R
false
false
430
r
gcv_function <- function(alpha,gamma2,beta) { f = (alpha^2)/(gamma2 + alpha^2); ### length(f); ### length(beta); if(length(f)>length(beta)) { f=f[1:length(beta)]; } else { if(length(beta)>length(f)) { iend = length(beta) beta=beta[...
########################################################################################################################## ## Loop BKMR model through 100 seeds ## 11/18/2019 ########################################################################################################################## #install.packages("bkm...
/BKMR/HPC/bkmr_loop_model_25.R
no_license
yanellinunez/Commentary-to-mixture-methods-paper
R
false
false
7,118
r
########################################################################################################################## ## Loop BKMR model through 100 seeds ## 11/18/2019 ########################################################################################################################## #install.packages("bkm...
#' @name windfarmGA #' @description The initiating function of an optimization run which will #' interactively check user-inputs. If all inputs are correct, an optimization #' will be started. #' #' @export #' #' @param dns The data source name (interpretation varies by driver — for some #' drivers, dsn is a file...
/R/windfarmGA.R
no_license
allenfieldin/windfarmGA
R
false
false
8,756
r
#' @name windfarmGA #' @description The initiating function of an optimization run which will #' interactively check user-inputs. If all inputs are correct, an optimization #' will be started. #' #' @export #' #' @param dns The data source name (interpretation varies by driver — for some #' drivers, dsn is a file...
source('global.R') fluidPage( #tab title title="time2pub", #titlePanel(h2("Journal-Specific Fast-Track time2pub Visualization",align='center')), mainPanel(width=12, # tags$style(type="text/css", # ".shiny-output-error { visibility: hidden; }", # ...
/ui.R
permissive
joshuamwang/time2pub
R
false
false
2,291
r
source('global.R') fluidPage( #tab title title="time2pub", #titlePanel(h2("Journal-Specific Fast-Track time2pub Visualization",align='center')), mainPanel(width=12, # tags$style(type="text/css", # ".shiny-output-error { visibility: hidden; }", # ...