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
################################################## ### Global.R setGeneric("privateA",function(object){standardGeneric("privateA")}) setGeneric("publicA",function(object){standardGeneric("publicA")}) setGeneric("publicB",function(objectV,objectW){standardGeneric("publicB")}) functionClassicA <- func...
/packS4/R/global.R
no_license
ingted/R-Examples
R
false
false
725
r
################################################## ### Global.R setGeneric("privateA",function(object){standardGeneric("privateA")}) setGeneric("publicA",function(object){standardGeneric("publicA")}) setGeneric("publicB",function(objectV,objectW){standardGeneric("publicB")}) functionClassicA <- func...
tabItem("dpt", box( title = "Titre", width = 12, "à venir" ) )
/src/ui/35_ui_dpt.R
no_license
NicolasImberty/Prenoms
R
false
false
119
r
tabItem("dpt", box( title = "Titre", width = 12, "à venir" ) )
\name{CPart} \alias{CPart} \alias{CP} \title{Creates a fuzzy partition} \description{This is the implementation in R of a fuzzy partition, described in, chapter 1, pages 005-009 at Ishibuchi et al.\ . It has a sister function, with different parameter, but with the same objective. It provides a wrapper to create the ap...
/man/CPart.Rd
no_license
cran/FKBL
R
false
false
1,399
rd
\name{CPart} \alias{CPart} \alias{CP} \title{Creates a fuzzy partition} \description{This is the implementation in R of a fuzzy partition, described in, chapter 1, pages 005-009 at Ishibuchi et al.\ . It has a sister function, with different parameter, but with the same objective. It provides a wrapper to create the ap...
library(shiny) library(ggplot2) plotAreaT <- function(section = "upper", q1 = -1.5, label.quantiles=TRUE, dist = "T", xlab=" ") { require(ggplot2) x <- seq(-4, 4, by = 0.01) df <- 10 data <- data.frame(x = x, density = dt(x, df)) p <- ggplot(data, aes(x, y=density)) + geom_line() + xlab(xlab) quantile1 <-...
/99-ReferenceApps/shiny_apps/testing/server.R
permissive
nwstephens/shiny-day-2016
R
false
false
2,402
r
library(shiny) library(ggplot2) plotAreaT <- function(section = "upper", q1 = -1.5, label.quantiles=TRUE, dist = "T", xlab=" ") { require(ggplot2) x <- seq(-4, 4, by = 0.01) df <- 10 data <- data.frame(x = x, density = dt(x, df)) p <- ggplot(data, aes(x, y=density)) + geom_line() + xlab(xlab) quantile1 <-...
rm(list = ls()) require(openxlsx) require(tidyr) require(dplyr) require(ggplot2) require(psych) setwd("D:/abroad/Harvard/18spring courses/SOCIOL 198/final") ####2016#### dat <- read.csv("D:/abroad/Harvard/18spring courses/SOCIOL 198/final/data/alltmlong16.csv") companylist16 <- as.data.frame(unique(dat$ticker)) idlist...
/reshape.R
no_license
SUN-Wenjun/SOCIOL-198
R
false
false
22,906
r
rm(list = ls()) require(openxlsx) require(tidyr) require(dplyr) require(ggplot2) require(psych) setwd("D:/abroad/Harvard/18spring courses/SOCIOL 198/final") ####2016#### dat <- read.csv("D:/abroad/Harvard/18spring courses/SOCIOL 198/final/data/alltmlong16.csv") companylist16 <- as.data.frame(unique(dat$ticker)) idlist...
/Plot3.r
no_license
Majeson/ExData_Plotting1
R
false
false
1,259
r
\name{make.lags} \title{ Lags vectors and covariates correctly so that an autoregressive model can be estimated by regression. } \usage{ make.lags(x, lags, cov,nobs=3500) } \arguments{ \item{x}{ Vector or matrix representing a univariate or multivariate time series. (rows are assumed to idex time) } \item{lags}{ Vect...
/man/make.lags.bak.Rd
no_license
cran/funfits
R
false
false
1,847
rd
\name{make.lags} \title{ Lags vectors and covariates correctly so that an autoregressive model can be estimated by regression. } \usage{ make.lags(x, lags, cov,nobs=3500) } \arguments{ \item{x}{ Vector or matrix representing a univariate or multivariate time series. (rows are assumed to idex time) } \item{lags}{ Vect...
base <- read.csv("C:/Users/Disponible/Documents/Nueva carpeta/CORPUS/portales_1M.csv", fileEncoding = 'UTF-8') base2 <- read.csv("C:/Users/Disponible/Documents/Nueva carpeta/CORPUS/portales_1.csv") base$texto_simple <- NULL base$salario_men_med <- NULL base$termino_simp <- NULL base$termino <- NULL base$X <- NULL bas...
/Procesamiento base perl.R
no_license
amaurydata100tific/Procesamiento-base-para-perl
R
false
false
2,038
r
base <- read.csv("C:/Users/Disponible/Documents/Nueva carpeta/CORPUS/portales_1M.csv", fileEncoding = 'UTF-8') base2 <- read.csv("C:/Users/Disponible/Documents/Nueva carpeta/CORPUS/portales_1.csv") base$texto_simple <- NULL base$salario_men_med <- NULL base$termino_simp <- NULL base$termino <- NULL base$X <- NULL bas...
#!/usr/bin/env Rscript #----------------------------------------------------------------------------------# # Constructs phenotypes from WLS data # Author: Joel Becker # Notes: # #----------------------------------------------------------------------------------# ####################################################...
/10_Prediction/10.1.1_construct_WLS_phenotypes.R
no_license
LabLemos/PGI_Repo
R
false
false
38,820
r
#!/usr/bin/env Rscript #----------------------------------------------------------------------------------# # Constructs phenotypes from WLS data # Author: Joel Becker # Notes: # #----------------------------------------------------------------------------------# ####################################################...
## Assignment: 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 than compute it repeatedly ## (there are also alternatives to matrix inversion that we will not discuss here). ## Your assignment is to write a ...
/cachematrix.R
no_license
kpeeples/ProgrammingAssignment2
R
false
false
2,321
r
## Assignment: 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 than compute it repeatedly ## (there are also alternatives to matrix inversion that we will not discuss here). ## Your assignment is to write a ...
stability_feature_selection <- function(group = Group$group1){ library(stabs) # lets solve for Q pfer = 1 pie = .9 p = ncol(group$Train$X) q = sqrt(pfer*p*(2*pie-1)) cols = stabsel(group$Train$X, group$Train$Y, fitfun = glmnet.lasso, sampling.type = "SS", ...
/rice/undergrad/stat-413/Functions/Feature Selection/stability_feature_selection.R
no_license
rodgers2000/Projects
R
false
false
526
r
stability_feature_selection <- function(group = Group$group1){ library(stabs) # lets solve for Q pfer = 1 pie = .9 p = ncol(group$Train$X) q = sqrt(pfer*p*(2*pie-1)) cols = stabsel(group$Train$X, group$Train$Y, fitfun = glmnet.lasso, sampling.type = "SS", ...
setwd("~/Documents/datasciencecoursera/Getting and Cleaning Data/Week 1") #question1 getdata.data.ss06hid <- read.csv("~/Documents/datasciencecoursera/Getting and Cleaning Data/Week 1/getdata-data-ss06hid.csv") #VAL = '24' and TYPE = '1' houses = getdata.data.ss06hid x = houses[,'VAL'] y = houses[,'TYPE'] z = complete....
/Getting and Cleaning Data/Week 1/quiz1.R
no_license
johnkalish/datasciencecoursera
R
false
false
962
r
setwd("~/Documents/datasciencecoursera/Getting and Cleaning Data/Week 1") #question1 getdata.data.ss06hid <- read.csv("~/Documents/datasciencecoursera/Getting and Cleaning Data/Week 1/getdata-data-ss06hid.csv") #VAL = '24' and TYPE = '1' houses = getdata.data.ss06hid x = houses[,'VAL'] y = houses[,'TYPE'] z = complete....
GetProvince = function(input_code){ file = 'Database projet v2.xlsx' provinces = read_excel(file, sheet = 'provinces') file = 'code-postaux-belge.csv' df = read_csv2(file) province_vector = vector() distances = vector() names = vector() lon1 = (df%>%filter(Code == input_code))$Longitude lat1 = (df%>%f...
/ANAPROM/Shiny/.ipynb_checkpoints/Get_Province-checkpoint.R
no_license
ApprovisionnementLegumes/Modele
R
false
false
1,026
r
GetProvince = function(input_code){ file = 'Database projet v2.xlsx' provinces = read_excel(file, sheet = 'provinces') file = 'code-postaux-belge.csv' df = read_csv2(file) province_vector = vector() distances = vector() names = vector() lon1 = (df%>%filter(Code == input_code))$Longitude lat1 = (df%>%f...
rm(list=ls()) source(paste0(here::here(), "/0-config.R")) #Set adjustment covariates Wvars <- c("sex", "arm", "brthmon", "vagbrth", "hdlvry", "single", "trth2o", "cleanck", "impfloor", "hfoodsec", "hhwealth_quart","W_mage", "W_mhtcm", "W_mwtkg", "W_mbmi", "W_fage",...
/src/03-coxPH-allDeaths.R
no_license
child-growth/ki-mortality
R
false
false
6,063
r
rm(list=ls()) source(paste0(here::here(), "/0-config.R")) #Set adjustment covariates Wvars <- c("sex", "arm", "brthmon", "vagbrth", "hdlvry", "single", "trth2o", "cleanck", "impfloor", "hfoodsec", "hhwealth_quart","W_mage", "W_mhtcm", "W_mwtkg", "W_mbmi", "W_fage",...
#------------------------------------------------------ #------------------------------------------------------ # dat_sim.R # - Simulates longitudinal and time-to-event data using the algorithm described in Section 5. # Created by Ruth Keogh #------------------------------------------------------ #--------------...
/dat_sim.R
no_license
hc704/causal_sim
R
false
false
2,724
r
#------------------------------------------------------ #------------------------------------------------------ # dat_sim.R # - Simulates longitudinal and time-to-event data using the algorithm described in Section 5. # Created by Ruth Keogh #------------------------------------------------------ #--------------...
#==================================================================================================# # Script created by Mark Christie, contact at Redpath.Christie@gmail.com # Script created in version R 3.3.1 # This script: Generates model output for Lampre Resistance project # Usage notes: Set all parameters bel...
/lamprey4.3/source/Reference/Growth.R
no_license
ChristieLab/Lamprey-Model
R
false
false
1,705
r
#==================================================================================================# # Script created by Mark Christie, contact at Redpath.Christie@gmail.com # Script created in version R 3.3.1 # This script: Generates model output for Lampre Resistance project # Usage notes: Set all parameters bel...
#' @include JDBCObject.R NULL #' JDBCResult class #' #' Base class for \code{\linkS4class{JDBCQueryResult}} and \code{\linkS4class{JDBCUpdateResult}}. #' #' @family result classes #' @export setClass("JDBCResult", contains = c("DBIResult", "JDBCObject", "VIRTUAL")) RESULT_SET_TYPE <- list( TYPE_FORWARD_ONLY = 1...
/R/JDBCResult.R
no_license
hoesler/dbj
R
false
false
1,254
r
#' @include JDBCObject.R NULL #' JDBCResult class #' #' Base class for \code{\linkS4class{JDBCQueryResult}} and \code{\linkS4class{JDBCUpdateResult}}. #' #' @family result classes #' @export setClass("JDBCResult", contains = c("DBIResult", "JDBCObject", "VIRTUAL")) RESULT_SET_TYPE <- list( TYPE_FORWARD_ONLY = 1...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/meteo-autoplot.R \name{autoplot.meteo_coverage} \alias{autoplot.meteo_coverage} \title{autoplot method for meteo_coverage objects} \usage{ \method{autoplot}{meteo_coverage}(object) } \arguments{ \item{object}{(data.frame) a data.frame} } \val...
/man/autoplot.meteo_coverage.Rd
permissive
martgnz/rnoaa
R
false
true
458
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/meteo-autoplot.R \name{autoplot.meteo_coverage} \alias{autoplot.meteo_coverage} \title{autoplot method for meteo_coverage objects} \usage{ \method{autoplot}{meteo_coverage}(object) } \arguments{ \item{object}{(data.frame) a data.frame} } \val...
/textminingdengue.R
no_license
RihabOueslati/DataMiningProject
R
false
false
3,113
r
library(zoo) ### Name: zoo ### Title: Z's Ordered Observations ### Aliases: zoo with.zoo range.zoo print.zoo as.zoo.factor summary.zoo ### str.zoo is.zoo [.zoo [<-.zoo $.zoo $<-.zoo subset.zoo head.zoo ### tail.zoo Ops.zoo t.zoo cumsum.zoo cumprod.zoo cummin.zoo cummax.zoo ### mean.zoo median.zoo na.contiguous ...
/data/genthat_extracted_code/zoo/examples/zoo.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
5,119
r
library(zoo) ### Name: zoo ### Title: Z's Ordered Observations ### Aliases: zoo with.zoo range.zoo print.zoo as.zoo.factor summary.zoo ### str.zoo is.zoo [.zoo [<-.zoo $.zoo $<-.zoo subset.zoo head.zoo ### tail.zoo Ops.zoo t.zoo cumsum.zoo cumprod.zoo cummin.zoo cummax.zoo ### mean.zoo median.zoo na.contiguous ...
## This file contains two functions: 1. makeCacheMatrix, and 2. cacheSolve ## makeCacheMatrix takes a matrix as an argument returns a list of functions ## cacheSolve takes the list returned by makeCacheMatrix as an argument ## makeCacheMatrix function creates a special "matrix" object than can cache its inverse ## It ...
/cachematrix.R
no_license
sndsjh2014/ProgrammingAssignment2
R
false
false
2,484
r
## This file contains two functions: 1. makeCacheMatrix, and 2. cacheSolve ## makeCacheMatrix takes a matrix as an argument returns a list of functions ## cacheSolve takes the list returned by makeCacheMatrix as an argument ## makeCacheMatrix function creates a special "matrix" object than can cache its inverse ## It ...
library("VariantAnnotation") library(TxDb.Hsapiens.UCSC.hg19.knownGene) txdb_hg19 <- TxDb.Hsapiens.UCSC.hg19.knownGene #1. Want to look at the methylation percentages of #the jd and hpne samples at cpg sites. #amit said the meth percentages looked a little high #for the jd sample(over half had 100%) #the mc histo...
/sanchari/j432_j446/examineFixedOxbs.r
no_license
chungtseng/hmcPaper_scripts2
R
false
false
16,862
r
library("VariantAnnotation") library(TxDb.Hsapiens.UCSC.hg19.knownGene) txdb_hg19 <- TxDb.Hsapiens.UCSC.hg19.knownGene #1. Want to look at the methylation percentages of #the jd and hpne samples at cpg sites. #amit said the meth percentages looked a little high #for the jd sample(over half had 100%) #the mc histo...
#source("/nr/project/stat/Smitte/Lakselus_stad/Rfunc-magne/make.weight.new.r") make.weight <- function(antall0,datadir.lok){ #moving fish from one cage to another #We have an array of dimension 3. #First dimension is time #Second dimension is the cage we move from and #third dimension is the dimension we move...
/R/MagnesRutiner/make.weight.r
no_license
Kotkot/RecaSimfish
R
false
false
17,070
r
#source("/nr/project/stat/Smitte/Lakselus_stad/Rfunc-magne/make.weight.new.r") make.weight <- function(antall0,datadir.lok){ #moving fish from one cage to another #We have an array of dimension 3. #First dimension is time #Second dimension is the cage we move from and #third dimension is the dimension we move...
library(ggplot2) NEI <- readRDS("data/summarySCC_PM25.rds") SCC <- readRDS("data/Source_Classification_Code.rds") SCCcoal <- SCC[grepl("coal", SCC$Short.Name, ignore.case = T),] NEIcoal <- NEI[NEI$SCC %in% SCCcoal$SCC,] totalCoal <- aggregate(Emissions ~ year + type, NEIcoal, sum) png("plot4.png",height=480,width=48...
/week4/plot4.R
no_license
parthrai/exploratory-data-analysis
R
false
false
706
r
library(ggplot2) NEI <- readRDS("data/summarySCC_PM25.rds") SCC <- readRDS("data/Source_Classification_Code.rds") SCCcoal <- SCC[grepl("coal", SCC$Short.Name, ignore.case = T),] NEIcoal <- NEI[NEI$SCC %in% SCCcoal$SCC,] totalCoal <- aggregate(Emissions ~ year + type, NEIcoal, sum) png("plot4.png",height=480,width=48...
\name{source_gist} \alias{source_gist} \title{Run a script on gist} \usage{ source_gist(entry, ...) } \arguments{ \item{entry}{either full url (character), gist ID (numeric or character of numeric). If only an entry ID is specified and the entry has multiple code block, the first entry is sourced.} \item{....
/devtools/man/source_gist.Rd
no_license
radfordneal/R-package-mods
R
false
false
1,128
rd
\name{source_gist} \alias{source_gist} \title{Run a script on gist} \usage{ source_gist(entry, ...) } \arguments{ \item{entry}{either full url (character), gist ID (numeric or character of numeric). If only an entry ID is specified and the entry has multiple code block, the first entry is sourced.} \item{....
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/files.R \name{list_files_in_folder} \alias{list_files_in_folder} \title{Get list of files from a folder} \usage{ list_files_in_folder(id = "root", page_size = NULL, page_token = NULL, order_by = NULL, spaces = NULL, corpus = NULL) } \argume...
/man/list_files_in_folder.Rd
permissive
hairizuanbinnoorazman/googledrive
R
false
true
1,562
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/files.R \name{list_files_in_folder} \alias{list_files_in_folder} \title{Get list of files from a folder} \usage{ list_files_in_folder(id = "root", page_size = NULL, page_token = NULL, order_by = NULL, spaces = NULL, corpus = NULL) } \argume...
## Reading the data in from the course website. fileURL<-"https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" download.file(fileURL, "household_power_consumption.zip", method='curl') data<-read.table(unz('household_power_consumption.zip', 'household_power_consumption.txt'), ...
/plot3.r
no_license
m2d4dj/ExData_Plotting1
R
false
false
1,327
r
## Reading the data in from the course website. fileURL<-"https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" download.file(fileURL, "household_power_consumption.zip", method='curl') data<-read.table(unz('household_power_consumption.zip', 'household_power_consumption.txt'), ...
## What Gaul Has ## Editing Author: oldenkam ## Date: 3/14/2017 ## Purpose: ## whatGaulHas is a function that returns a closest string match to a user's string. This function returns that match's ## relavant information. The first argument, country is a correctly spelled and correctly cased Admin 0 name string that su...
/ihme/R/what_gaulhas.r
no_license
oldenkam/compost-the-most
R
false
false
3,312
r
## What Gaul Has ## Editing Author: oldenkam ## Date: 3/14/2017 ## Purpose: ## whatGaulHas is a function that returns a closest string match to a user's string. This function returns that match's ## relavant information. The first argument, country is a correctly spelled and correctly cased Admin 0 name string that su...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/abundance.R \name{abundance} \alias{abundance} \title{Abundance} \usage{ abundance(individuals) } \arguments{ \item{individuals}{data frame; a data frame of individual mussel records.} } \value{ A data frame of sampled sites with the calculat...
/man/abundance.Rd
permissive
mpdougherty/mcat
R
false
true
623
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/abundance.R \name{abundance} \alias{abundance} \title{Abundance} \usage{ abundance(individuals) } \arguments{ \item{individuals}{data frame; a data frame of individual mussel records.} } \value{ A data frame of sampled sites with the calculat...
# Correlation heatmap with Pearson method, to visualize correlation matrix #' Function to obtain correlation heatmap #' @import ggplot2 #' #' @export heatmap <- function(data){ cormat <- round(cor(data),3) cormat <- reorder_cormat(cormat) # Reorder the correlation matrix upper_tri <- get_upper_tri...
/R/Heatmap.R
no_license
tanxuezhi/HourlyPrecipExtr
R
false
false
1,478
r
# Correlation heatmap with Pearson method, to visualize correlation matrix #' Function to obtain correlation heatmap #' @import ggplot2 #' #' @export heatmap <- function(data){ cormat <- round(cor(data),3) cormat <- reorder_cormat(cormat) # Reorder the correlation matrix upper_tri <- get_upper_tri...
my_theme <- theme(legend.title = element_blank(), legend.position = 'top', legend.text = element_text(color = 'white', family = 'ubuntu', size = 12), plot.background = element_rect(color = 'black', fill = 'black'), ...
/Statistica/Part2/my_theme.R
no_license
xooxoo/Courses
R
false
false
1,049
r
my_theme <- theme(legend.title = element_blank(), legend.position = 'top', legend.text = element_text(color = 'white', family = 'ubuntu', size = 12), plot.background = element_rect(color = 'black', fill = 'black'), ...
################################################################################ # Barcelona Graduate School of Economics # Master's Degree in Data Science ################################################################################ # Course : Statistical Modelling and Inference # Title : BVS Practical Workshop # ...
/bigp/code/bvsw.R
no_license
nandanrao/statistical-modelling
R
false
false
21,178
r
################################################################################ # Barcelona Graduate School of Economics # Master's Degree in Data Science ################################################################################ # Course : Statistical Modelling and Inference # Title : BVS Practical Workshop # ...
# Get amap lat lon coordinates #' @title Get the GCJ02 Coordinates Parsed by Amap #' @param location Location name, vector, maximum length is 10. #' @param key Application key of amap.com. #' @importFrom magrittr `%>%` #' @importFrom jsonlite fromJSON #' @importFrom tidyr separate #' @importFrom tibble as_tibble #' @re...
/R/geocode_amap.R
no_license
jimrpy/getcoords
R
false
false
1,714
r
# Get amap lat lon coordinates #' @title Get the GCJ02 Coordinates Parsed by Amap #' @param location Location name, vector, maximum length is 10. #' @param key Application key of amap.com. #' @importFrom magrittr `%>%` #' @importFrom jsonlite fromJSON #' @importFrom tidyr separate #' @importFrom tibble as_tibble #' @re...
library(devtools) require(roxygen2) rm(list = ls()) # clear workspace before building getwd() setwd("/Users/kprovost/Documents/Github/") #dir.create('./subsppLabelR/') setwd(paste(getwd(), '/subsppLabelR/', sep='')) #setwd(paste(getwd(),"/Documents/Github/speciesPairNicheOverlap/",sep="")) #create('./') roxygenize(...
/howToBuildAPackage.R
no_license
kaiyaprovost/misc_scripts
R
false
false
1,235
r
library(devtools) require(roxygen2) rm(list = ls()) # clear workspace before building getwd() setwd("/Users/kprovost/Documents/Github/") #dir.create('./subsppLabelR/') setwd(paste(getwd(), '/subsppLabelR/', sep='')) #setwd(paste(getwd(),"/Documents/Github/speciesPairNicheOverlap/",sep="")) #create('./') roxygenize(...
function(data, factors, num) { # Load package library(FactoMineR) # PCA analysis, samples are data points, miRNAs are features # In data, rows are samples, columns are miRNA features pca_df = PCA(data, ncp=num, graph=FALSE) # Find proportion of variance, etc. prop_of_var <- pca_df$eig[1:num,] dir.create("Re...
/R_Code/PCA/analyze_PCs_samples.R
permissive
Halmoni100/miRNA_dataPlus
R
false
false
2,533
r
function(data, factors, num) { # Load package library(FactoMineR) # PCA analysis, samples are data points, miRNAs are features # In data, rows are samples, columns are miRNA features pca_df = PCA(data, ncp=num, graph=FALSE) # Find proportion of variance, etc. prop_of_var <- pca_df$eig[1:num,] dir.create("Re...
meta.transport <- function(y, x, D, expr = TRUE, simp = TRUE, steps = FALSE, primes = FALSE, stop_on_nonid = TRUE) { v <- get.vertex.attribute(D[[1]], "name") s <- v[which(vertex.attributes(D[[1]])$description == "S")] interventions <- setdiff(v, union(y, s)) D.causal <- induced.subgraph(D[[1]], v[!(v %in% s)])...
/R/meta.transport.R
no_license
COVID-19-Causal-Reasoning/causaleffect
R
false
false
1,002
r
meta.transport <- function(y, x, D, expr = TRUE, simp = TRUE, steps = FALSE, primes = FALSE, stop_on_nonid = TRUE) { v <- get.vertex.attribute(D[[1]], "name") s <- v[which(vertex.attributes(D[[1]])$description == "S")] interventions <- setdiff(v, union(y, s)) D.causal <- induced.subgraph(D[[1]], v[!(v %in% s)])...
if (requireNamespace("spelling", quietly = TRUE)) { if (!covr::in_covr()) { spelling::spell_check_test( vignettes = TRUE, error = FALSE, skip_on_cran = TRUE ) } }
/tests/spelling.R
permissive
franzbischoff/sandbox
R
false
false
187
r
if (requireNamespace("spelling", quietly = TRUE)) { if (!covr::in_covr()) { spelling::spell_check_test( vignettes = TRUE, error = FALSE, skip_on_cran = TRUE ) } }
% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/dtime.R \name{dcut} \alias{dcut} \alias{dcut.sub} \title{Function to extract a vector or matrix from EMU-Trackdata at a single time point of to create another EMU-trackdata object between two times.} \usage{ dcut(trackdata, left.time,...
/man/dcut.Rd
no_license
hywel/emuR
R
false
false
3,766
rd
% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/dtime.R \name{dcut} \alias{dcut} \alias{dcut.sub} \title{Function to extract a vector or matrix from EMU-Trackdata at a single time point of to create another EMU-trackdata object between two times.} \usage{ dcut(trackdata, left.time,...
#Grafico de Cajas p = plot_ly(tabla, y = ~Costo, color = ~Ruta, type = "box",boxpoints = 'all',boxmean="sd")
/Code/Ejercicio4/AnalisisExploratorio.R
no_license
CristianPachacama/DisenioExperimental
R
false
false
108
r
#Grafico de Cajas p = plot_ly(tabla, y = ~Costo, color = ~Ruta, type = "box",boxpoints = 'all',boxmean="sd")
HartiganShapes <- function(array3D,numClust,algSteps=10,niter=10,stopCr=0.0001,simul,initLl,initials, verbose){ #,computCost time_iter <- list() comp_time <- c() list_ic1 <- list() list_ic1_step <- list() vect_all_rate <- c() ll <- 1 : numClust dist <- matrix(0, dim(array3D)[3], n...
/R/HartiganShapes.R
no_license
cran/Anthropometry
R
false
false
9,906
r
HartiganShapes <- function(array3D,numClust,algSteps=10,niter=10,stopCr=0.0001,simul,initLl,initials, verbose){ #,computCost time_iter <- list() comp_time <- c() list_ic1 <- list() list_ic1_step <- list() vect_all_rate <- c() ll <- 1 : numClust dist <- matrix(0, dim(array3D)[3], n...
#! Rscript targatt_competitor_ddos.R -- #### COMPETITOR TARGETED ATTACK: DDoS Attack ---- # Simulate num ddos attacks numDDoSAttacks <- function(targdos_decision){ num_ddos_attacks <- 0 if (targdos_decision == 0) {0} else{ num_ddos_attacks = round(rgamma(1,5,1)) } num_ddos_attacks } # DDoS duration (l) ...
/Attackers/Competitor/targatt_competitor_ddos.R
no_license
cybeco/cybersecandcyberinsurance
R
false
false
1,978
r
#! Rscript targatt_competitor_ddos.R -- #### COMPETITOR TARGETED ATTACK: DDoS Attack ---- # Simulate num ddos attacks numDDoSAttacks <- function(targdos_decision){ num_ddos_attacks <- 0 if (targdos_decision == 0) {0} else{ num_ddos_attacks = round(rgamma(1,5,1)) } num_ddos_attacks } # DDoS duration (l) ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/fmtcatch_handle_indir.R \name{make_param} \alias{make_param} \title{Check input directory name} \usage{ make_param(datdir, year_ad, month, pref_name) } \arguments{ \item{datdir}{<- "../data/"} \item{year_ad}{<- 2018 # Not fiscal} \item{mont...
/_bk/fmtcatch/man/make_param.Rd
permissive
gitter-badger/gyokaikyor
R
false
true
508
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/fmtcatch_handle_indir.R \name{make_param} \alias{make_param} \title{Check input directory name} \usage{ make_param(datdir, year_ad, month, pref_name) } \arguments{ \item{datdir}{<- "../data/"} \item{year_ad}{<- 2018 # Not fiscal} \item{mont...
library(swirl) install_course_github('johnsanterre','All_The_Quizzes') swirl()
/Admin/Quizzes.r
no_license
lancedacy/6306
R
false
false
78
r
library(swirl) install_course_github('johnsanterre','All_The_Quizzes') swirl()
dropDownNavPage(tableName = tableName)
/inst/UI/newData/ui.R
no_license
mpio-be/DataEntry
R
false
false
39
r
dropDownNavPage(tableName = tableName)
### load libraries library(tidyverse) library(scales) library(spatstat) library(geosphere) library(colorspace) library(patchwork) library(brms) library(ggridges) ### load output # modelling results -- can either download or create using 'miseq/scripts/geoextent_brm_host_modelfit.R' (run before proceeding, if needed) ...
/miseq/scripts/geoextent_brm_host_output.R
no_license
aguilart/SporeSizeFungalKingdom
R
false
false
25,615
r
### load libraries library(tidyverse) library(scales) library(spatstat) library(geosphere) library(colorspace) library(patchwork) library(brms) library(ggridges) ### load output # modelling results -- can either download or create using 'miseq/scripts/geoextent_brm_host_modelfit.R' (run before proceeding, if needed) ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pssmooth.R \name{riskCurve} \alias{riskCurve} \title{Estimation of Conditional Clinical Endpoint Risk under Placebo and Treatment Given Biomarker Response to Treatment in a Baseline Surrogate Measure Three-Phase Sampling Design} \usage{ ...
/man/riskCurve.Rd
no_license
cran/pssmooth
R
false
true
8,786
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pssmooth.R \name{riskCurve} \alias{riskCurve} \title{Estimation of Conditional Clinical Endpoint Risk under Placebo and Treatment Given Biomarker Response to Treatment in a Baseline Surrogate Measure Three-Phase Sampling Design} \usage{ ...
#' data parse functions #' #' Parses AWUDS excel files into R data frames. #' #' @param file_path chr, path to the excel file (including file extension) #' @param citations logical, citations were included as part of the output for Export data #' #' @importFrom readxl read_excel #' @importFrom readxl excel_sheets #' ...
/R/parseDataFunctions.R
permissive
rwdudley-usgs/wateRuse
R
false
false
5,317
r
#' data parse functions #' #' Parses AWUDS excel files into R data frames. #' #' @param file_path chr, path to the excel file (including file extension) #' @param citations logical, citations were included as part of the output for Export data #' #' @importFrom readxl read_excel #' @importFrom readxl excel_sheets #' ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/classifier_fns.R \name{colNameReplace} \alias{colNameReplace} \title{Replace One Set of Column Names With Another} \usage{ colNameReplace(array, name.before, name.after) } \arguments{ \item{name.after}{} } \value{ array } \description{ Replac...
/man/colNameReplace.Rd
no_license
n8thangreen/STIecoPredict
R
false
true
361
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/classifier_fns.R \name{colNameReplace} \alias{colNameReplace} \title{Replace One Set of Column Names With Another} \usage{ colNameReplace(array, name.before, name.after) } \arguments{ \item{name.after}{} } \value{ array } \description{ Replac...
/20180529clusterEPCI.R
no_license
loduplo/flexOrange
R
false
false
11,107
r
#' Abundance ratio #' #' Creates a vector containing the abundance ratio for each peptide #' @param dat a data frame containing columns with median peptide abundances #' @param group column string or number (numerator of ratio) #' @param ctrl column string or number (demoninator of ratio) #' defaults to "ctrl_med" #' @...
/R/abun_ratio.R
permissive
tsoleary/proteomixr
R
false
false
492
r
#' Abundance ratio #' #' Creates a vector containing the abundance ratio for each peptide #' @param dat a data frame containing columns with median peptide abundances #' @param group column string or number (numerator of ratio) #' @param ctrl column string or number (demoninator of ratio) #' defaults to "ctrl_med" #' @...
# install.packages('keras') # install.packages('purrr') # install.packages('functional') library(IsolationForest) library(MASS) library(caret) library(fGarch) library(fitdistrplus) library(pracma) library(BBmisc) library(functional) library(dplyr) library(keras) library(lubridate) library(tensorflow) Sys.sleep(5) insta...
/bs2/Model2_medium.R
no_license
paai-lab/Online-Anomaly-Detection-Extension-2021
R
false
false
16,330
r
# install.packages('keras') # install.packages('purrr') # install.packages('functional') library(IsolationForest) library(MASS) library(caret) library(fGarch) library(fitdistrplus) library(pracma) library(BBmisc) library(functional) library(dplyr) library(keras) library(lubridate) library(tensorflow) Sys.sleep(5) insta...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/BSDA-package.R \docType{data} \name{Irises} \alias{Irises} \title{R.A. Fishers famous data on Irises} \format{ A data frame/tibble with 150 observations on five variables \describe{ \item{sepal_length}{sepal length (in cm)} \item{sepal_widt...
/man/Irises.Rd
no_license
alanarnholt/BSDA
R
false
true
1,218
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/BSDA-package.R \docType{data} \name{Irises} \alias{Irises} \title{R.A. Fishers famous data on Irises} \format{ A data frame/tibble with 150 observations on five variables \describe{ \item{sepal_length}{sepal length (in cm)} \item{sepal_widt...
rm(list=ls()) getwd() #setwd() source('D:/Dropbox/Dropbox/HEC/Code/exp1.1/.Rprofile') library("forecast") ; library("xts") ; library("data.table") ; library("reshape2") library("ggplot2") setwd(pth.dropbox.code) ; source("./DataAdaptor/00_data_adaptor_test.R") setwd(pth.dropbox.code) ; source("./ModelFitting/ets/et...
/ModelFitting/ets/ets_testing.R
no_license
wellermatt/exp1.1
R
false
false
1,917
r
rm(list=ls()) getwd() #setwd() source('D:/Dropbox/Dropbox/HEC/Code/exp1.1/.Rprofile') library("forecast") ; library("xts") ; library("data.table") ; library("reshape2") library("ggplot2") setwd(pth.dropbox.code) ; source("./DataAdaptor/00_data_adaptor_test.R") setwd(pth.dropbox.code) ; source("./ModelFitting/ets/et...
## these 2 functions together will cache the inverse of a matrixdown ## this function exposes 4 member functions: set, get, setInverse, getInverse ## this stores the inverse of a matrix in cache makeCacheMatrix <- function(x = matrix()) { m <- NULL # assign inverse variable to null for later use set <- function...
/cachematrix.R
no_license
rlharmon/ProgrammingAssignment2
R
false
false
1,045
r
## these 2 functions together will cache the inverse of a matrixdown ## this function exposes 4 member functions: set, get, setInverse, getInverse ## this stores the inverse of a matrix in cache makeCacheMatrix <- function(x = matrix()) { m <- NULL # assign inverse variable to null for later use set <- function...
library(compositions) ### Name: pairwiseplot ### Title: Creates a paneled plot like pairs for two different datasets. ### Aliases: pairwisePlot pairwisePlot.default ### Keywords: hplot ### ** Examples X <- rnorm(100) Y <- rnorm.acomp(100,acomp(c(A=1,B=1,C=1)),0.1*diag(3))+acomp(t(outer(c(0.2,0.3,0.4),X,"^"))) pai...
/data/genthat_extracted_code/compositions/examples/pairwisePlot.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
1,655
r
library(compositions) ### Name: pairwiseplot ### Title: Creates a paneled plot like pairs for two different datasets. ### Aliases: pairwisePlot pairwisePlot.default ### Keywords: hplot ### ** Examples X <- rnorm(100) Y <- rnorm.acomp(100,acomp(c(A=1,B=1,C=1)),0.1*diag(3))+acomp(t(outer(c(0.2,0.3,0.4),X,"^"))) pai...
vbar=0.05 T=280 a=4.192 b=0.02665 R=0.083145 P=R*T/(vbar-b)-a/(vbar*(vbar+b)+b*(vbar-b)) cat(P,"\n")
/co2.R
no_license
d42knight/chem160homework6
R
false
false
100
r
vbar=0.05 T=280 a=4.192 b=0.02665 R=0.083145 P=R*T/(vbar-b)-a/(vbar*(vbar+b)+b*(vbar-b)) cat(P,"\n")
# setup code block if (!require(stringr)){install.packages("stringr")} if (!require(udpipe)){install.packages("udpipe")} if (!require(textrank)){install.packages("textrank")} if (!require(lattice)){install.packages("lattice")} if (!require(igraph)){install.packages("igraph")} if (!require(ggraph)){install.packages("ggr...
/dependencies.r
no_license
ankitasaraf/Shiny_text_an
R
false
false
786
r
# setup code block if (!require(stringr)){install.packages("stringr")} if (!require(udpipe)){install.packages("udpipe")} if (!require(textrank)){install.packages("textrank")} if (!require(lattice)){install.packages("lattice")} if (!require(igraph)){install.packages("igraph")} if (!require(ggraph)){install.packages("ggr...
# # boxplot_monthly_compare_runs.R # #' Box-and-whisker plots of baseline and scenario simulated monthly averaged nutrient and plankton data with credible intervals derived from Monte Carlo StrathE2E runs. #' #' Creates a multi-panel plot comparing a range of simulated monthly averaged nutrient and plankton data f...
/R/boxplot_monthly_compare_runs.R
no_license
cran/StrathE2E2
R
false
false
16,629
r
# # boxplot_monthly_compare_runs.R # #' Box-and-whisker plots of baseline and scenario simulated monthly averaged nutrient and plankton data with credible intervals derived from Monte Carlo StrathE2E runs. #' #' Creates a multi-panel plot comparing a range of simulated monthly averaged nutrient and plankton data f...
## The following two functions together calculates the inversion of a matrix. ##The first function makeCacheMatrix initiates and stores the values calculated in the second cacheSolve function. ## # makeCacheMatrix creates a list with four functions (get,set,getinverse,setinverse) and the two elements m and x. #makeC...
/cachematrix.R
no_license
Kroysler/ProgrammingAssignment2
R
false
false
1,619
r
## The following two functions together calculates the inversion of a matrix. ##The first function makeCacheMatrix initiates and stores the values calculated in the second cacheSolve function. ## # makeCacheMatrix creates a list with four functions (get,set,getinverse,setinverse) and the two elements m and x. #makeC...
#--------------------------------------------------------------- # IARP Version 1.3 # Added user identified indemnity # 9th February 2015 # Nirav Khimashia #--------------------------------------------------------------- library(shiny) #library(leaflet) library(RColorBrewer) library(scales) library(lattice) library(dp...
/server.R
no_license
asiariskcentre/test2
R
false
false
44,834
r
#--------------------------------------------------------------- # IARP Version 1.3 # Added user identified indemnity # 9th February 2015 # Nirav Khimashia #--------------------------------------------------------------- library(shiny) #library(leaflet) library(RColorBrewer) library(scales) library(lattice) library(dp...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_gallery_subjects.R \name{get_gallery_subjects} \alias{get_gallery_subjects} \title{get gallery subjects} \usage{ get_gallery_subjects(gallery) } \arguments{ \item{gallery}{The gallery in which the subjects are enrolled.} } \value{ A vecto...
/man/get_gallery_subjects.Rd
permissive
guptam/facerec
R
false
true
706
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_gallery_subjects.R \name{get_gallery_subjects} \alias{get_gallery_subjects} \title{get gallery subjects} \usage{ get_gallery_subjects(gallery) } \arguments{ \item{gallery}{The gallery in which the subjects are enrolled.} } \value{ A vecto...
library(shiny) library(shinydashboard) # Define UI for application that draws a histogram shinyUI({ dbHeader <- dashboardHeader( title = 'ExploraDatos', titleWidth = 200, tags$li(a(href = 'https://twitter.com/DBuesos', img(src = 'https:...
/ShinyApp/ui.R
no_license
JuveCampos/ExploraDatosMX
R
false
false
33,703
r
library(shiny) library(shinydashboard) # Define UI for application that draws a histogram shinyUI({ dbHeader <- dashboardHeader( title = 'ExploraDatos', titleWidth = 200, tags$li(a(href = 'https://twitter.com/DBuesos', img(src = 'https:...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/extractSaveData.R \name{l_getSavedata_Fileinfo} \alias{l_getSavedata_Fileinfo} \title{local function that does the work of getSaveData_Fileinfo} \usage{ l_getSavedata_Fileinfo(outfile, outfiletext, summaries) } \arguments{ \item{outf...
/man/l_getSavedata_Fileinfo.Rd
no_license
myunghoshin/MplusAutomation
R
false
true
1,599
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/extractSaveData.R \name{l_getSavedata_Fileinfo} \alias{l_getSavedata_Fileinfo} \title{local function that does the work of getSaveData_Fileinfo} \usage{ l_getSavedata_Fileinfo(outfile, outfiletext, summaries) } \arguments{ \item{outf...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/s3control_operations.R \name{s3control_put_public_access_block} \alias{s3control_put_public_access_block} \title{Creates or modifies the PublicAccessBlock configuration for an AWS account} \usage{ s3control_put_public_access_block(PublicAcces...
/cran/paws.storage/man/s3control_put_public_access_block.Rd
permissive
TWarczak/paws
R
false
true
1,444
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/s3control_operations.R \name{s3control_put_public_access_block} \alias{s3control_put_public_access_block} \title{Creates or modifies the PublicAccessBlock configuration for an AWS account} \usage{ s3control_put_public_access_block(PublicAcces...
#' @include desc_statby.R utilities_base.R utilities_color.R NULL #' @import ggplot2 #' @importFrom magrittr %>% #' @importFrom dplyr group_by_ #' @importFrom dplyr group_by #' @importFrom dplyr arrange_ #' @importFrom dplyr mutate #' @importFrom dplyr do #' @importFrom dplyr summarise #' @importFrom dplyr everything #...
/R/utilities.R
no_license
Chiamh/ggpubr
R
false
false
34,974
r
#' @include desc_statby.R utilities_base.R utilities_color.R NULL #' @import ggplot2 #' @importFrom magrittr %>% #' @importFrom dplyr group_by_ #' @importFrom dplyr group_by #' @importFrom dplyr arrange_ #' @importFrom dplyr mutate #' @importFrom dplyr do #' @importFrom dplyr summarise #' @importFrom dplyr everything #...
library(glmnet) mydata = read.table("../../../../TrainingSet/FullSet/Correlation/pleura.csv",head=T,sep=",") x = as.matrix(mydata[,4:ncol(mydata)]) y = as.matrix(mydata[,1]) set.seed(123) glm = cv.glmnet(x,y,nfolds=10,type.measure="mse",alpha=0.01,family="gaussian",standardize=TRUE) sink('./pleura_005.txt',append=TRUE)...
/Model/EN/Correlation/pleura/pleura_005.R
no_license
esbgkannan/QSMART
R
false
false
350
r
library(glmnet) mydata = read.table("../../../../TrainingSet/FullSet/Correlation/pleura.csv",head=T,sep=",") x = as.matrix(mydata[,4:ncol(mydata)]) y = as.matrix(mydata[,1]) set.seed(123) glm = cv.glmnet(x,y,nfolds=10,type.measure="mse",alpha=0.01,family="gaussian",standardize=TRUE) sink('./pleura_005.txt',append=TRUE)...
# t student t.corr <- function(r, sample) { t <- r * (sqrt(sample - 2)) / sqrt(1 - r^2) xd <- seq(0.001, 0.999, 0.001) distr <- qt(xd, df = sample - 2) significance <- xd[which.min(abs(distr - t))] out <- list(corr = r, tvalue = t, signif = significance) return(out) } # extract significant for correlation ...
/script/routines/statistics.R
permissive
oloapinivad/MiLES
R
false
false
2,451
r
# t student t.corr <- function(r, sample) { t <- r * (sqrt(sample - 2)) / sqrt(1 - r^2) xd <- seq(0.001, 0.999, 0.001) distr <- qt(xd, df = sample - 2) significance <- xd[which.min(abs(distr - t))] out <- list(corr = r, tvalue = t, signif = significance) return(out) } # extract significant for correlation ...
library(testthat) library(freqdom) test_check("freqdom")
/tests/testthat/testthat.R
no_license
kidzik/freqdom
R
false
false
58
r
library(testthat) library(freqdom) test_check("freqdom")
get_allchronologies <- function(all_downloads, settings) { chron_file <- paste0("data/output/chronologies_v", settings$version, ".rds") if (!file.exists(chron_file)) { chronologies <- list() for (i in 1:length(all_downloads)) { chronologies[[i]] <- try(get_chroncontrol(all_do...
/R/get_allchronologies.R
no_license
PalEON-Project/stepps-baconizing
R
false
false
664
r
get_allchronologies <- function(all_downloads, settings) { chron_file <- paste0("data/output/chronologies_v", settings$version, ".rds") if (!file.exists(chron_file)) { chronologies <- list() for (i in 1:length(all_downloads)) { chronologies[[i]] <- try(get_chroncontrol(all_do...
library(nycflights13) library(tidyverse) # ! dplyr overwrites some base functions, so you need to type eg. stats::lag() or stats::filter() sqrt(2) ^ 2 == 2 # gives FALSE, because these are number approximations near(sqrt(2) ^ 2, 2) nov_dec <- filter(flights, month == 11 | month == 12) nov_dec <- filter(flights, mon...
/5_Data_transformation.R
no_license
Alicja1990/r4ds
R
false
false
2,937
r
library(nycflights13) library(tidyverse) # ! dplyr overwrites some base functions, so you need to type eg. stats::lag() or stats::filter() sqrt(2) ^ 2 == 2 # gives FALSE, because these are number approximations near(sqrt(2) ^ 2, 2) nov_dec <- filter(flights, month == 11 | month == 12) nov_dec <- filter(flights, mon...
#'Generate random deviates shifted Poisson pdf #' #'This function generates random deviates from the shifted Poisson distribution. #'The shift is fixed to 1. #'@param n the number of random deviates to generate #'@param lambda vector of positive means (of an ordinary Poisson distribution) #'@return A vector of shifted...
/R/rshiftpois.R
no_license
benaug/move.HMM
R
false
false
425
r
#'Generate random deviates shifted Poisson pdf #' #'This function generates random deviates from the shifted Poisson distribution. #'The shift is fixed to 1. #'@param n the number of random deviates to generate #'@param lambda vector of positive means (of an ordinary Poisson distribution) #'@return A vector of shifted...
x = c(3.545, 2.6, 3.245, 3.93, 3.995, 3.115, 3.235, 3.225, 2.44, 3.24, 2.29, 2.5, 4.02) y = c(30, 32, 30, 24, 26, 30, 33, 27, 37, 32, 37, 34, 26) data = data.frame(x, y) varx = var(x) vary = var(y) varxy = var(x, y) cor = varxy / sqrt(varx * vary) data cor plot(x, y, main="Weight vs Fuel Efficiency", xlab="Wei...
/VIT/MAT2001 - Statistics for Engineers/LAB Assessment 2/Q2.R
no_license
namsnath/MiscellaneousCode
R
false
false
359
r
x = c(3.545, 2.6, 3.245, 3.93, 3.995, 3.115, 3.235, 3.225, 2.44, 3.24, 2.29, 2.5, 4.02) y = c(30, 32, 30, 24, 26, 30, 33, 27, 37, 32, 37, 34, 26) data = data.frame(x, y) varx = var(x) vary = var(y) varxy = var(x, y) cor = varxy / sqrt(varx * vary) data cor plot(x, y, main="Weight vs Fuel Efficiency", xlab="Wei...
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function makeCacheMatrix <- function(x = matrix()) { i <- NULL set <- function(y) { x <<- y i <<- NULL } get <- function() x setinverse <- function(inver...
/cachematrix.R
no_license
paliashivani0/ProgrammingAssignment2
R
false
false
807
r
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function makeCacheMatrix <- function(x = matrix()) { i <- NULL set <- function(y) { x <<- y i <<- NULL } get <- function() x setinverse <- function(inver...
# Bivariate kernel function centered at 0,0 with isotropic bandwidth h kernel2d <- function(x, y, h) { 1/(2*pi*h*h)*exp(-0.5*(x*x+y*y)/(h*h)) } # Approximation of definite integral of f over a grid with gridsize dx x dy via summation dintegral <- function(f, dx, dy) { sum(f)*dx*dy } # Fast fourier transform of a ...
/R/kernel2d.R
no_license
tilmandavies/sparr
R
false
false
723
r
# Bivariate kernel function centered at 0,0 with isotropic bandwidth h kernel2d <- function(x, y, h) { 1/(2*pi*h*h)*exp(-0.5*(x*x+y*y)/(h*h)) } # Approximation of definite integral of f over a grid with gridsize dx x dy via summation dintegral <- function(f, dx, dy) { sum(f)*dx*dy } # Fast fourier transform of a ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/smoteNew.R \name{smoteNew} \alias{smoteNew} \title{smoteNew is a necessary function that modifies the SMOTE algorithm.} \usage{ smoteNew(data.x, data.y, K, dup_size = 0, class.to.oversample) } \arguments{ \item{data.x}{A data frame or matrix ...
/man/smoteNew.Rd
no_license
cran/sambia
R
false
true
1,211
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/smoteNew.R \name{smoteNew} \alias{smoteNew} \title{smoteNew is a necessary function that modifies the SMOTE algorithm.} \usage{ smoteNew(data.x, data.y, K, dup_size = 0, class.to.oversample) } \arguments{ \item{data.x}{A data frame or matrix ...
### DAVID Functions: # Change-log: # V1.0 20-06-2014 Erik Initiation of this file # V2.0 17-07-2014 Erik also accepting gene lists in "DAVID" # V2.1 18-07-2014 Erik debug "DAVID" # V2.2 19-07-2014 Erik also accepting a vector of probe_names in "get.mod.members" for dat & adjust "DAVID" # V2.3 08-05-2015 Erik Added "s...
/RFunctions/DAVID.functions_V2.3.R
no_license
transcriptome-in-transition/Transcriptome-in-transition
R
false
false
7,113
r
### DAVID Functions: # Change-log: # V1.0 20-06-2014 Erik Initiation of this file # V2.0 17-07-2014 Erik also accepting gene lists in "DAVID" # V2.1 18-07-2014 Erik debug "DAVID" # V2.2 19-07-2014 Erik also accepting a vector of probe_names in "get.mod.members" for dat & adjust "DAVID" # V2.3 08-05-2015 Erik Added "s...
EveryBarState = R6Class('EveryBarState', public = list( curhigh = -Inf, curlow = Inf, #newhighflag = F update = function(d) { high = as.n...
/src/strategy/shock/nbarclass.R
no_license
zhurui1351/alpha
R
false
false
3,534
r
EveryBarState = R6Class('EveryBarState', public = list( curhigh = -Inf, curlow = Inf, #newhighflag = F update = function(d) { high = as.n...
#Construct data.frame of simulation values to use for R simulations library(data.table) def_wd <- "/Users/Scott/Documents/Dissertation/Paper1/SimulationCode/RSimulationCode" setwd(def_wd) RSimVals <- data.table(nsamp = 10, ncondlevels = 2, condEffSizeStr = "c(1,1)", GenWithMeasError = TRUE, MeasError...
/RSimulationCode/ConstructRSimulationValues.R
no_license
skvanburen/CompDTUPaperCode
R
false
false
8,393
r
#Construct data.frame of simulation values to use for R simulations library(data.table) def_wd <- "/Users/Scott/Documents/Dissertation/Paper1/SimulationCode/RSimulationCode" setwd(def_wd) RSimVals <- data.table(nsamp = 10, ncondlevels = 2, condEffSizeStr = "c(1,1)", GenWithMeasError = TRUE, MeasError...
test_that("prediction_spd Works", { p <- diag(rep(1,3)) # 3x3 SPD matrix V <- repmat(p, 5) # N=5 coefficients V X <- matrix(c(1,2,3,4,5,6,7,8,9,1,2,3,4,5,6)/10, nrow=3) # rows = Xi components (3), cols = number of covariates (5) expect_equal(class(prediction_spd(p = p,V = V, X = X)), "array") })
/tests/testthat/test-prediction_spd.R
permissive
zhangzjjjjjj/MGLMRiem
R
false
false
308
r
test_that("prediction_spd Works", { p <- diag(rep(1,3)) # 3x3 SPD matrix V <- repmat(p, 5) # N=5 coefficients V X <- matrix(c(1,2,3,4,5,6,7,8,9,1,2,3,4,5,6)/10, nrow=3) # rows = Xi components (3), cols = number of covariates (5) expect_equal(class(prediction_spd(p = p,V = V, X = X)), "array") })
# Define UI for application that plots random distributions #get About panel tabPanelAbout <- source("about.r")$value shinyUI(pageWithSidebar( # Application title headerPanel("NADA and Substitution Methods - Simulator"), # Sidebar with a slider input for number of observations sidebarPanel( se...
/ui.R
permissive
YoJimboDurant/shiny_NADA_test
R
false
false
4,730
r
# Define UI for application that plots random distributions #get About panel tabPanelAbout <- source("about.r")$value shinyUI(pageWithSidebar( # Application title headerPanel("NADA and Substitution Methods - Simulator"), # Sidebar with a slider input for number of observations sidebarPanel( se...
library(fRLR) ### Name: fRLR-package ### Title: A short title line describing what the package does ### Aliases: fRLR-package fRLR ### Keywords: package ### ** Examples ## Not run: ##D ## Optional simple examples of the most important functions ##D ## These can be in \dontrun{} and \donttest{} blocks. ...
/data/genthat_extracted_code/fRLR/examples/fRLR-package.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
349
r
library(fRLR) ### Name: fRLR-package ### Title: A short title line describing what the package does ### Aliases: fRLR-package fRLR ### Keywords: package ### ** Examples ## Not run: ##D ## Optional simple examples of the most important functions ##D ## These can be in \dontrun{} and \donttest{} blocks. ...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/utilities.R \name{rnorm_tcont} \alias{rnorm_tcont} \title{Generate contaminated normally distributed data} \usage{ rnorm_tcont(n, mean = 0, sd = 1, cprop = 0.1, csd = 3) } \arguments{ \item{n}{number of observations} \item{mean}{mean...
/man/rnorm_tcont.Rd
no_license
livioivil/resamplingMCP
R
false
false
624
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/utilities.R \name{rnorm_tcont} \alias{rnorm_tcont} \title{Generate contaminated normally distributed data} \usage{ rnorm_tcont(n, mean = 0, sd = 1, cprop = 0.1, csd = 3) } \arguments{ \item{n}{number of observations} \item{mean}{mean...
\name{dat.plourde} \alias{dat.plourde} \docType{data} \title{ A Meta-Analysis for Comparing the Fluoroscopy Time in Percutaneous Coronary Intervention Between Radial and Femoral Accesses } \description{ This dataset serves as an example of meta-analysis of mean differences. } \usage{data("dat.plourde")} \form...
/man/dat.plourde.Rd
no_license
cran/altmeta
R
false
false
1,131
rd
\name{dat.plourde} \alias{dat.plourde} \docType{data} \title{ A Meta-Analysis for Comparing the Fluoroscopy Time in Percutaneous Coronary Intervention Between Radial and Femoral Accesses } \description{ This dataset serves as an example of meta-analysis of mean differences. } \usage{data("dat.plourde")} \form...
#' generateLearningCurve = function(lrn, task, test.size = 0.3, test.inds = NULL, n.seq = seq(0.1, 1, by = 0.1), measures, repls = 1L) { l = length(lrn) for (i in 1:l) { lrn[[i]] = checkLearner(lrn[[i]]) } # assertClass(task, "Task") n = task$task.desc$size # assertNumeric(n.seq, min.len = 2L, a...
/todo-files/generateLearningCurve.R
no_license
narayana1208/mlr
R
false
false
2,740
r
#' generateLearningCurve = function(lrn, task, test.size = 0.3, test.inds = NULL, n.seq = seq(0.1, 1, by = 0.1), measures, repls = 1L) { l = length(lrn) for (i in 1:l) { lrn[[i]] = checkLearner(lrn[[i]]) } # assertClass(task, "Task") n = task$task.desc$size # assertNumeric(n.seq, min.len = 2L, a...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://assets-cdn.github.com"> <link rel="dns-prefetch" href="https://avatars0.githubusercontent.com"> <link rel="dns-prefetch" href="https://avatars1.githubusercontent.com"> <link rel="dns-prefetch" href=...
/plot4.R
no_license
asingh71DS/explor2
R
false
false
41,836
r
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://assets-cdn.github.com"> <link rel="dns-prefetch" href="https://avatars0.githubusercontent.com"> <link rel="dns-prefetch" href="https://avatars1.githubusercontent.com"> <link rel="dns-prefetch" href=...
library(rgdal) library(rgeos) library(tidyverse) library(tmap) library(leaflet) library(sf) library(RColorBrewer) #set working directory setwd("~/Desktop/UChicago Harris/Spring 2019/GIS & Spatial Analysis /Assignment 2") #load tract data - 2015 census.data <- read.csv("NJ Tract ACS_15_5YR_DP03/ACS_15_5YR_DP03.csv") ...
/Assignment2 - NJ Median Income.R
no_license
spaykin/NJ-Income-Mapping
R
false
false
2,487
r
library(rgdal) library(rgeos) library(tidyverse) library(tmap) library(leaflet) library(sf) library(RColorBrewer) #set working directory setwd("~/Desktop/UChicago Harris/Spring 2019/GIS & Spatial Analysis /Assignment 2") #load tract data - 2015 census.data <- read.csv("NJ Tract ACS_15_5YR_DP03/ACS_15_5YR_DP03.csv") ...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/table.Distributions.R \name{table.Distributions} \alias{table.Distributions} \title{Distributions Summary: Statistics and Stylized Facts} \usage{ table.Distributions(R, scale = NA, digits = 4) } \arguments{ \item{R}{an xts, vector, ma...
/man/table.Distributions.Rd
no_license
tsbattman/PerformanceAnalytics
R
false
false
1,414
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/table.Distributions.R \name{table.Distributions} \alias{table.Distributions} \title{Distributions Summary: Statistics and Stylized Facts} \usage{ table.Distributions(R, scale = NA, digits = 4) } \arguments{ \item{R}{an xts, vector, ma...
# # This is a Shiny web application. You can run the application by clicking # the 'Run App' button above. # # Find out more about building applications with Shiny here: # # http://shiny.rstudio.com/ # library(shiny) library(shinythemes) # Define UI for application that draws a histogram ui <- navbarPage(theme = ...
/v1/app.R
no_license
michaelzchen/InnovationRates-Colleges
R
false
false
13,212
r
# # This is a Shiny web application. You can run the application by clicking # the 'Run App' button above. # # Find out more about building applications with Shiny here: # # http://shiny.rstudio.com/ # library(shiny) library(shinythemes) # Define UI for application that draws a histogram ui <- navbarPage(theme = ...
## -------------------------------------------------------------------------- ## ## Penalized Multivariate Analysis ## http://cran.r-project.org/web/packages/PMA/index.html ## -------------------------------------------------------------------------- ##
/models/Penalized Multivariate Analysis.R
no_license
data-science-competitions/Kaggle-Africa-Soil-Property-Prediction-Challenge
R
false
false
257
r
## -------------------------------------------------------------------------- ## ## Penalized Multivariate Analysis ## http://cran.r-project.org/web/packages/PMA/index.html ## -------------------------------------------------------------------------- ##
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/HigherOrderRiskPreferences.R \name{compute_function} \alias{compute_function} \title{Computes a continuous and smooth utility function from the given utility points} \usage{ compute_function( x, y, ids = NULL, mode = 1, p...
/man/compute_function.Rd
no_license
cran/utilityFunctionTools
R
false
true
2,444
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/HigherOrderRiskPreferences.R \name{compute_function} \alias{compute_function} \title{Computes a continuous and smooth utility function from the given utility points} \usage{ compute_function( x, y, ids = NULL, mode = 1, p...
setwd("/Users/loey/Desktop/Research/FakeNews/LyingKids/Expt1_web/analysis/SONA") library(tidyverse) raw <- read_csv("raw.csv") length(unique(raw$subjID)) demograph <- raw %>% select(subjID, stillimages, comments) %>% distinct() write_csv(demograph, "demographic.csv") cleaned <- raw %>% select(-c(stillimages, c...
/Expt1_web/analysis/SONA/cleanData.R
no_license
la-oey/LyingKids
R
false
false
645
r
setwd("/Users/loey/Desktop/Research/FakeNews/LyingKids/Expt1_web/analysis/SONA") library(tidyverse) raw <- read_csv("raw.csv") length(unique(raw$subjID)) demograph <- raw %>% select(subjID, stillimages, comments) %>% distinct() write_csv(demograph, "demographic.csv") cleaned <- raw %>% select(-c(stillimages, c...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/RcppExports.R \name{LLcollapse_perm} \alias{LLcollapse_perm} \title{Permutation distribution of Li and Leal's collapsed variant statistic, v_c} \usage{ LLcollapse_perm(ccdata, ccstatus, nperms, maf, maf_controls = FALSE) } \arguments{...
/man/LLcollapse_perm.Rd
permissive
jsanjak/buRden
R
false
false
1,374
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/RcppExports.R \name{LLcollapse_perm} \alias{LLcollapse_perm} \title{Permutation distribution of Li and Leal's collapsed variant statistic, v_c} \usage{ LLcollapse_perm(ccdata, ccstatus, nperms, maf, maf_controls = FALSE) } \arguments{...
library(org.Rn.eg.db) library(org.Hs.eg.db) library(xlsxjars) library(rJava) library(xlsx) library(DOSE) library(clusterProfiler) library(psych) library("readr") library(caret) library(randomForest) library(e1071) library(gbm) library(mlbench) library(caretEnsemble) library(topGO) library(drc) librar...
/deal_with_data_tg_invitro.R
no_license
wuhuichen/Hepatotoxicity
R
false
false
2,691
r
library(org.Rn.eg.db) library(org.Hs.eg.db) library(xlsxjars) library(rJava) library(xlsx) library(DOSE) library(clusterProfiler) library(psych) library("readr") library(caret) library(randomForest) library(e1071) library(gbm) library(mlbench) library(caretEnsemble) library(topGO) library(drc) librar...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/negative-hypergeometric-distribution.R \name{NegHyper} \alias{NegHyper} \alias{dnhyper} \alias{pnhyper} \alias{qnhyper} \alias{rnhyper} \title{Negative hypergeometric distribution} \usage{ dnhyper(x, n, m, r, log = FALSE) pnhyper(q, n, m, r,...
/man/NegHyper.Rd
no_license
alexfun/extraDistr
R
false
true
3,448
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/negative-hypergeometric-distribution.R \name{NegHyper} \alias{NegHyper} \alias{dnhyper} \alias{pnhyper} \alias{qnhyper} \alias{rnhyper} \title{Negative hypergeometric distribution} \usage{ dnhyper(x, n, m, r, log = FALSE) pnhyper(q, n, m, r,...
## check top of console and here that wd has changed getwd() ## notice where file browser is now a <- 2 b <- 3 siqSq <- 0.5 ## this typo was good actually x <- runif(40) y <- a + b * x + rnorm(40, sd = sqrt(sigSq)) sigSq <- 0.5 y <- a + b * x + rnorm(40, sd = sqrt(sigSq)) x y (avgX <- mean(x)) write(avgX, "avgX.txt") p...
/lessons/misc-r/code/block01_postProject.R
permissive
karthik/bc
R
false
false
1,312
r
## check top of console and here that wd has changed getwd() ## notice where file browser is now a <- 2 b <- 3 siqSq <- 0.5 ## this typo was good actually x <- runif(40) y <- a + b * x + rnorm(40, sd = sqrt(sigSq)) sigSq <- 0.5 y <- a + b * x + rnorm(40, sd = sqrt(sigSq)) x y (avgX <- mean(x)) write(avgX, "avgX.txt") p...
# Human readable details of formatting done readableOutputUI <- function(id) { ns <- NS(id) tabPanel("Readable formatting record") }
/Shiny Modules/readableOutput.R
no_license
zannah-rain/Feature-EngineeR
R
false
false
140
r
# Human readable details of formatting done readableOutputUI <- function(id) { ns <- NS(id) tabPanel("Readable formatting record") }
#' Assemble a data frame of incident hospitalizations due to #' COVID-19 or influenza as they were available as of a specified issue date. #' #' @param issue_date character issue date (i.e. report date) to use for #' constructing truths in format 'yyyy-mm-dd' #' @param location_code character vector of location codes. ...
/R/healthdata_data.R
no_license
reichlab/covidData
R
false
false
9,387
r
#' Assemble a data frame of incident hospitalizations due to #' COVID-19 or influenza as they were available as of a specified issue date. #' #' @param issue_date character issue date (i.e. report date) to use for #' constructing truths in format 'yyyy-mm-dd' #' @param location_code character vector of location codes. ...
plot_fits <- function(prepped_fishery, fit){ # check <- case_studies %>% # filter(economic_model == 3, case_study == "realistic", # period == "end", window == "10") # check <- case_studies %>% slice(5) prepped_fishery <- check$prepped_fishery[[1]] fit <- check$scrooge_fit[[1]]$result sampled_yea...
/functions/plot_fits.R
permissive
DanOvando/scrooge
R
false
false
4,913
r
plot_fits <- function(prepped_fishery, fit){ # check <- case_studies %>% # filter(economic_model == 3, case_study == "realistic", # period == "end", window == "10") # check <- case_studies %>% slice(5) prepped_fishery <- check$prepped_fishery[[1]] fit <- check$scrooge_fit[[1]]$result sampled_yea...
source("orchids_setup_data.R") library(nimble) nimbleOptions(disallow_multivariate_argument_expressions = FALSE) orchids_code <- nimbleCode({ ## ------------------------------------------------- ## Parameters: ## s: survival probability ## psiV: transitions from vegetative ## psiF: transitions fr...
/Content/examples_code/multi_state_CR_orchids/orchids_basic.R
no_license
lponisio/Vogelwarte_NIMBLE_workshop
R
false
false
3,447
r
source("orchids_setup_data.R") library(nimble) nimbleOptions(disallow_multivariate_argument_expressions = FALSE) orchids_code <- nimbleCode({ ## ------------------------------------------------- ## Parameters: ## s: survival probability ## psiV: transitions from vegetative ## psiF: transitions fr...
source("makeSim.R") load("meanDispPairs.RData") library("DESeq2") library("PoiClaClu") library("mclust") set.seed(1) n <- 2000 # create 20 samples, then remove first group, leaving 16 # this way the groups are equidistant from each other m <- 20 k <- 4 methods <- c("norm Eucl","log2 Eucl","rlog Eucl","VST Eucl","PoisD...
/inst/script/simulateCluster.R
no_license
zihua/DESeq2
R
false
false
2,665
r
source("makeSim.R") load("meanDispPairs.RData") library("DESeq2") library("PoiClaClu") library("mclust") set.seed(1) n <- 2000 # create 20 samples, then remove first group, leaving 16 # this way the groups are equidistant from each other m <- 20 k <- 4 methods <- c("norm Eucl","log2 Eucl","rlog Eucl","VST Eucl","PoisD...