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
REflection Nov 30 This week has been rather short due to Holidays. On Tuesday, we had the opportunity to talk to the creator of iPhyton notebook. It was an interesting experience to have one of the creators of a framework that we are using in class to talk directly to us. It really put our work into perspective. The ...
/stat157Analyzer.R
no_license
bonghyun5/reflection
R
false
false
502
r
REflection Nov 30 This week has been rather short due to Holidays. On Tuesday, we had the opportunity to talk to the creator of iPhyton notebook. It was an interesting experience to have one of the creators of a framework that we are using in class to talk directly to us. It really put our work into perspective. The ...
#' Plot annual deviates #' #' @export #' plot_annual_devs <- function(report, year0 = 1972, file_name = "REs_y") { REs_y <- report$par.random[names(report$par.random) %in% "ln_ydev"] yr <- year0:(year0 + (length(REs_y) - 1)) dat <- data.frame(Year = yr, Ydev = REs_y) p <- ggplot(data = dat, aes(x ...
/R/plot_annual_devs.R
permissive
quantifish/TagGrowth
R
false
false
626
r
#' Plot annual deviates #' #' @export #' plot_annual_devs <- function(report, year0 = 1972, file_name = "REs_y") { REs_y <- report$par.random[names(report$par.random) %in% "ln_ydev"] yr <- year0:(year0 + (length(REs_y) - 1)) dat <- data.frame(Year = yr, Ydev = REs_y) p <- ggplot(data = dat, aes(x ...
#!/usr/bin/env Rscript rm(list=ls()) graphics.off() #source("scriptd_stats01_read_feature_fc.R") #brain.feature = cbind(fc) #report.name = "fc" source("scriptd_stats01_read_feature.R") brain.feature = scale(cbind(fsl.vbm, alff, reho, label.fa, label.md, tract.fa, tract.md)) #brain.feature = scale(cbind(fc)) report.n...
/scriptd_stats02_svm_t_sex.R
no_license
NxNiki/BrainImagingAnalysisCode
R
false
false
4,661
r
#!/usr/bin/env Rscript rm(list=ls()) graphics.off() #source("scriptd_stats01_read_feature_fc.R") #brain.feature = cbind(fc) #report.name = "fc" source("scriptd_stats01_read_feature.R") brain.feature = scale(cbind(fsl.vbm, alff, reho, label.fa, label.md, tract.fa, tract.md)) #brain.feature = scale(cbind(fc)) report.n...
rm(list=ls()) pars <- c('alpha','beta','gamma','delta','epsilon','omega') nlin_pars <- c('epsilon','omega') vars <- c('X','Y') eq_X <- 'alpha*X-beta*(1+epsilon*sin(2*pi*(t/50+omega)))*X*Y' eq_Y <- 'delta*(1+epsilon*sin(2*pi*(t/50+omega)))*X*Y-gamma*Y' equations <- c(eq_X,eq_Y) names(equations) <- vars theta <- c(2/3, ...
/previous_backup/Lotka-Volterra-seasonal-1/compNLStoSLS_Lotka-Volterra-seasonal-final.R
no_license
haroldship/complexity-2019-code
R
false
false
4,882
r
rm(list=ls()) pars <- c('alpha','beta','gamma','delta','epsilon','omega') nlin_pars <- c('epsilon','omega') vars <- c('X','Y') eq_X <- 'alpha*X-beta*(1+epsilon*sin(2*pi*(t/50+omega)))*X*Y' eq_Y <- 'delta*(1+epsilon*sin(2*pi*(t/50+omega)))*X*Y-gamma*Y' equations <- c(eq_X,eq_Y) names(equations) <- vars theta <- c(2/3, ...
if (!file.exists("./data")){dir.create("./data")} zipUrl <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip" download.file(zipUrl, destfile = "./data/Dataset.zip",method="curl") unzip("./data/Dataset.zip") ## Merging of data sets features <- read.table("./data/UCI HAR Dataset/fea...
/run_analysis.R
no_license
rmanansa/GettingAndCleaningData
R
false
false
2,481
r
if (!file.exists("./data")){dir.create("./data")} zipUrl <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip" download.file(zipUrl, destfile = "./data/Dataset.zip",method="curl") unzip("./data/Dataset.zip") ## Merging of data sets features <- read.table("./data/UCI HAR Dataset/fea...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{next_dev} \alias{next_dev} \title{Return next level up device Returns the variable name of the next level in the device hierarchy} \usage{ next_dev(x) } \arguments{ \item{x}{String input of device name, such as \code{"device_1"}...
/man/next_dev.Rd
no_license
gchung05/mdsstat
R
false
true
546
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{next_dev} \alias{next_dev} \title{Return next level up device Returns the variable name of the next level in the device hierarchy} \usage{ next_dev(x) } \arguments{ \item{x}{String input of device name, such as \code{"device_1"}...
#' Calculate the Rayleigh Isotope Curve #' #' This function calculates the delta values of the residual material #' along a Rayleigh curve and returns a data.frame of results. #' #' @param delta_initial The initial delta value #' @param epsilon The isotope enrichement factor #' @param element (optional) The element sys...
/R/calc_rayleigh.R
permissive
biogeochem/rayleigh
R
false
false
1,480
r
#' Calculate the Rayleigh Isotope Curve #' #' This function calculates the delta values of the residual material #' along a Rayleigh curve and returns a data.frame of results. #' #' @param delta_initial The initial delta value #' @param epsilon The isotope enrichement factor #' @param element (optional) The element sys...
# R script to find the list of Eurpean individuals within the gEUVADIS. library(gdata) # Read in sample data from 1000genomes and ID numbers from gEUVADIS. TG <- read.xls("20130606_sample_info.xlsx", header = TRUE, sheet = "Sample Info", stringsAsFactors = FALSE) GEU_samples <- read.table("GEUVADIS_samples.txt", heade...
/step02_get_EUR_samples.R
no_license
ScottPDickinson/geuvadis_example_files
R
false
false
702
r
# R script to find the list of Eurpean individuals within the gEUVADIS. library(gdata) # Read in sample data from 1000genomes and ID numbers from gEUVADIS. TG <- read.xls("20130606_sample_info.xlsx", header = TRUE, sheet = "Sample Info", stringsAsFactors = FALSE) GEU_samples <- read.table("GEUVADIS_samples.txt", heade...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bootPairs0.R \name{bootPairs0} \alias{bootPairs0} \title{Compute matrix of n999 rows and p-1 columns of bootstrap `sum' index (strength from older criterion Cr1, with newer Cr2 and Cr3).} \usage{ bootPairs0(mtx, ctrl = 0, n999 = 9) } ...
/man/bootPairs0.Rd
no_license
Srisai85/generalCorr
R
false
true
3,292
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bootPairs0.R \name{bootPairs0} \alias{bootPairs0} \title{Compute matrix of n999 rows and p-1 columns of bootstrap `sum' index (strength from older criterion Cr1, with newer Cr2 and Cr3).} \usage{ bootPairs0(mtx, ctrl = 0, n999 = 9) } ...
# Computation of EWMA survival function (mean monitoring) xtewma.sf <- function(l, c, df, mu, n, zr=0, hs=0, sided="two", limits="fix", mode="tan", q=1, r=40) { if ( l<=0 || l>1 ) warning("l is typically between 0 and 1 -- you should really know what you do") if ( c <= 0 ) warning("usua...
/R/xtewma.sf.R
no_license
cran/spc
R
false
false
1,514
r
# Computation of EWMA survival function (mean monitoring) xtewma.sf <- function(l, c, df, mu, n, zr=0, hs=0, sided="two", limits="fix", mode="tan", q=1, r=40) { if ( l<=0 || l>1 ) warning("l is typically between 0 and 1 -- you should really know what you do") if ( c <= 0 ) warning("usua...
library(shiny) library(tidyverse) library(shinyWidgets) # Define UI for application that draws a Poisson probability plot and give a probability of event based on Poisson distribution ui <- navbarPage( setBackgroundColor( color = c("#E4F9F9", "#BDF1F1"), gradient = "linear", direction = "...
/ui.R
no_license
WaleedAljomah/DS_Capstone_Poisson
R
false
false
2,594
r
library(shiny) library(tidyverse) library(shinyWidgets) # Define UI for application that draws a Poisson probability plot and give a probability of event based on Poisson distribution ui <- navbarPage( setBackgroundColor( color = c("#E4F9F9", "#BDF1F1"), gradient = "linear", direction = "...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tidy_stats.aovlist.R \name{tidy_stats.aovlist} \alias{tidy_stats.aovlist} \title{Create a tidy stats data frame from an aovlist object} \usage{ \method{tidy_stats}{aovlist}(model, args = NULL) } \arguments{ \item{model}{Output of \code{aov()}...
/man/tidy_stats.aovlist.Rd
permissive
ikbentimkramer/tidystats-v0.3
R
false
true
660
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tidy_stats.aovlist.R \name{tidy_stats.aovlist} \alias{tidy_stats.aovlist} \title{Create a tidy stats data frame from an aovlist object} \usage{ \method{tidy_stats}{aovlist}(model, args = NULL) } \arguments{ \item{model}{Output of \code{aov()}...
#' tree structure of files #' #' @param dir one directory #' #' @export #' bdy.tree <- function(dir=''){ command=paste('BaiduPCS-Go.exe tree',dir) x <- system(command = command, intern = T,show.output.on.console = F) Encoding(x) = 'UTF-8' cat(paste0(x,collapse = '\n')) }
/R/bdy.tree.R
permissive
yikeshu0611/RBaiduYun
R
false
false
304
r
#' tree structure of files #' #' @param dir one directory #' #' @export #' bdy.tree <- function(dir=''){ command=paste('BaiduPCS-Go.exe tree',dir) x <- system(command = command, intern = T,show.output.on.console = F) Encoding(x) = 'UTF-8' cat(paste0(x,collapse = '\n')) }
library(MissMech) ### Name: Mls ### Title: ML Estimates of Mean and Covariance Based on Incomplete Data ### Aliases: Mls Sexpect ### ** Examples set.seed <- 50 n <- 200 p <- 4 pctmiss <- 0.2 # Generate 20% missing data y <- matrix(rnorm(n * p),nrow = n) missing <- matrix(runif(n * p), nrow = n) < pctmiss y[missing]...
/data/genthat_extracted_code/MissMech/examples/Mls.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
397
r
library(MissMech) ### Name: Mls ### Title: ML Estimates of Mean and Covariance Based on Incomplete Data ### Aliases: Mls Sexpect ### ** Examples set.seed <- 50 n <- 200 p <- 4 pctmiss <- 0.2 # Generate 20% missing data y <- matrix(rnorm(n * p),nrow = n) missing <- matrix(runif(n * p), nrow = n) < pctmiss y[missing]...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/map.R \name{map_listings} \alias{map_listings} \title{Mapped listing data} \usage{ map_listings( locations = NULL, listing_type = "sale", search_type = "city", city_isolated = NULL, county_isolated = NULL, zipcode_isolated = NULL,...
/man/map_listings.Rd
no_license
abresler/realtR
R
false
true
3,630
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/map.R \name{map_listings} \alias{map_listings} \title{Mapped listing data} \usage{ map_listings( locations = NULL, listing_type = "sale", search_type = "city", city_isolated = NULL, county_isolated = NULL, zipcode_isolated = NULL,...
#' @details #' MachineShop provides a common interface to machine learning and statistical #' models provided by other packages. Supported models are summarized in the #' table below according to the types of response variables with which each can #' be used. #' #' \tabular{lcccc}{ #' \strong{Model Objects} \tab \s...
/R/MachineShop-package.R
no_license
guhjy/MachineShop
R
false
false
2,784
r
#' @details #' MachineShop provides a common interface to machine learning and statistical #' models provided by other packages. Supported models are summarized in the #' table below according to the types of response variables with which each can #' be used. #' #' \tabular{lcccc}{ #' \strong{Model Objects} \tab \s...
install.packages("zoo") install.packages("plyr") install.packages("dplyr") install.packages("quantmod") install.packages("ggplot2") install.packages("reshape2") install.packages("scales") install.packages("openair") library(zoo) library(quantmod) library(ggplot2) library(reshape2) library(plyr) library(scales) library...
/R_installing_general_packages.R
no_license
Yvonne-Li/R-Codes
R
false
false
344
r
install.packages("zoo") install.packages("plyr") install.packages("dplyr") install.packages("quantmod") install.packages("ggplot2") install.packages("reshape2") install.packages("scales") install.packages("openair") library(zoo) library(quantmod) library(ggplot2) library(reshape2) library(plyr) library(scales) library...
#' A function for fast IA-SVA #' #' The iterative procedure of fast IA-SVA is implemented in this #' function (fast_iasva). fast_iasva() iteratively identifies a hidden factor #' for unwanted variation while accounting for all known factors, and #' computes its contribution (i.e., the percentage of unmodeled variation...
/R/fast_iasva2.R
no_license
dleelab/leedonghyung
R
false
false
7,861
r
#' A function for fast IA-SVA #' #' The iterative procedure of fast IA-SVA is implemented in this #' function (fast_iasva). fast_iasva() iteratively identifies a hidden factor #' for unwanted variation while accounting for all known factors, and #' computes its contribution (i.e., the percentage of unmodeled variation...
library(ggplot2) library(gridExtra) library(DESeq2) library(scde) library(ComplexHeatmap) library(viridis) library(circlize) setwd("/address/to/working/directory/") ## importing row data anno <- read.table("./index/Pseudomonas_aeruginosa_pao1.ASM676v1.45.gtf", sep = "\t") anno <- anno[...
/run_pseudomonas.R
no_license
saliba-lab/single-bacterium-transcriptome-profiling
R
false
false
5,811
r
library(ggplot2) library(gridExtra) library(DESeq2) library(scde) library(ComplexHeatmap) library(viridis) library(circlize) setwd("/address/to/working/directory/") ## importing row data anno <- read.table("./index/Pseudomonas_aeruginosa_pao1.ASM676v1.45.gtf", sep = "\t") anno <- anno[...
# 모델 성능 평가 # model <- naiveBayse(훈련 데이터, ...) # predict <- predict(model, 테스트 데이터, type = "...") # Naive Bayes 알고리즘에서 스팸 메시지 분류 결과/확률 정리 sms_results <- read.csv(file = "mlwr/sms_results.csv") head(sms_results) library(dplyr) # spam/ham 분류에서 예측 확률이 50% 근처인 경우 - 예측하기 애매한 경우 # 모델이 잘못 예측할 가능성이 크다. sms_results %>% fil...
/ml13.r
no_license
andoyeon/lab-r
R
false
false
2,782
r
# 모델 성능 평가 # model <- naiveBayse(훈련 데이터, ...) # predict <- predict(model, 테스트 데이터, type = "...") # Naive Bayes 알고리즘에서 스팸 메시지 분류 결과/확률 정리 sms_results <- read.csv(file = "mlwr/sms_results.csv") head(sms_results) library(dplyr) # spam/ham 분류에서 예측 확률이 50% 근처인 경우 - 예측하기 애매한 경우 # 모델이 잘못 예측할 가능성이 크다. sms_results %>% fil...
library(tidyverse) hd <- read.csv("/Users/ShuLFO/Downloads/What Your Heart Rate Is Telling You/datasets/Cleveland_hd.csv") View(hd) hd <- hd %>% mutate(hd = ifelse(class > 0, 1,0), sex = factor(sex, levels = 0:1, labels = c("Female", "Male"))) hd_sex <- chisq.test(hd$hd, hd$sex) hd_age <- t.test(hd$age ~ hd$hd) hd_h...
/HeartDesease.R
no_license
Shumaerc/HeartDesease
R
false
false
1,489
r
library(tidyverse) hd <- read.csv("/Users/ShuLFO/Downloads/What Your Heart Rate Is Telling You/datasets/Cleveland_hd.csv") View(hd) hd <- hd %>% mutate(hd = ifelse(class > 0, 1,0), sex = factor(sex, levels = 0:1, labels = c("Female", "Male"))) hd_sex <- chisq.test(hd$hd, hd$sex) hd_age <- t.test(hd$age ~ hd$hd) hd_h...
# before using S in the equation, controlling for competition, city, platform, and num of weekends. # normalize duration and make prep.period to be the same percentage of the previous original duration getIV <- function(ThetaAll,para,deal_data,D1total,D2barnh,D1,D2,isholiday,Theta_est_nh,maxS){ if(isholiday==0){...
/holiday_models_1.1_Shat_new.R
no_license
siminl/Project-Coupon
R
false
false
13,461
r
# before using S in the equation, controlling for competition, city, platform, and num of weekends. # normalize duration and make prep.period to be the same percentage of the previous original duration getIV <- function(ThetaAll,para,deal_data,D1total,D2barnh,D1,D2,isholiday,Theta_est_nh,maxS){ if(isholiday==0){...
# Introductory H2O Machine Learning Tutorial # Prepared for H2O Open Chicago 2016: http://open.h2o.ai/chicago.html # First step is to download & install the h2o R library # The latest version is available by clicking on the R tab here: http://h2o-release.s3.amazonaws.com/h2o/latest_stable.html # Load the H2O library...
/H2O package exploration practice problem/intro-to-h2o.R
no_license
heenabansal/R-projects
R
false
false
20,241
r
# Introductory H2O Machine Learning Tutorial # Prepared for H2O Open Chicago 2016: http://open.h2o.ai/chicago.html # First step is to download & install the h2o R library # The latest version is available by clicking on the R tab here: http://h2o-release.s3.amazonaws.com/h2o/latest_stable.html # Load the H2O library...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hftsimulator.r \name{lazysubmission} \alias{lazysubmission} \title{lazysubmission} \usage{ lazysubmission(instrumentid, longholding = NULL, shortholding = NULL) } \arguments{ \item{instrumentid}{character, instrument identifier} \item{longho...
/man/lazysubmission.Rd
no_license
wh1100717/High-Frequency-Trading-Simulation-System
R
false
true
852
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hftsimulator.r \name{lazysubmission} \alias{lazysubmission} \title{lazysubmission} \usage{ lazysubmission(instrumentid, longholding = NULL, shortholding = NULL) } \arguments{ \item{instrumentid}{character, instrument identifier} \item{longho...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/sumTable.R \name{sumTable} \alias{sumTable} \title{sumTable} \usage{ sumTable(tsList) } \arguments{ \item{tsList}{list of just the selected variable (i.e. truncate list by 5 if time=T in iterVarSelRF)} } \description{ Function to summarize t...
/man/sumTable.Rd
no_license
lesliejmatthews/LakeTrophicModelling
R
false
true
443
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/sumTable.R \name{sumTable} \alias{sumTable} \title{sumTable} \usage{ sumTable(tsList) } \arguments{ \item{tsList}{list of just the selected variable (i.e. truncate list by 5 if time=T in iterVarSelRF)} } \description{ Function to summarize t...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/helping_functions.R \name{lik_1par} \alias{lik_1par} \title{1-parameter likelihood function for bivariate data} \usage{ lik_1par(rho, m1, m2, m3, m4, x1_0, x2_0, h1, h2) } \arguments{ \item{rho}{The local Gaussian correlation, with respect to...
/man/lik_1par.Rd
no_license
hotneim/lg
R
false
true
778
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/helping_functions.R \name{lik_1par} \alias{lik_1par} \title{1-parameter likelihood function for bivariate data} \usage{ lik_1par(rho, m1, m2, m3, m4, x1_0, x2_0, h1, h2) } \arguments{ \item{rho}{The local Gaussian correlation, with respect to...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/omd.R \name{form_cost_matrix} \alias{form_cost_matrix} \title{Converts a matrix with `n` rows and with columns `lat`, `lon`, into a cost matrix of size (n x n).} \usage{ form_cost_matrix(dat) } \arguments{ \item{Matrix}{whose rows are data po...
/omd/man/form_cost_matrix.Rd
no_license
amishra-stats/omd
R
false
true
512
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/omd.R \name{form_cost_matrix} \alias{form_cost_matrix} \title{Converts a matrix with `n` rows and with columns `lat`, `lon`, into a cost matrix of size (n x n).} \usage{ form_cost_matrix(dat) } \arguments{ \item{Matrix}{whose rows are data po...
library(glmnet) mydata = read.table("../../../../TrainingSet/FullSet/AvgRank/lymphoid.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.03,family="gaussian",standardize=FALSE) sink('./lymphoid_014.txt',append=TRUE...
/Model/EN/AvgRank/lymphoid/lymphoid_014.R
no_license
esbgkannan/QSMART
R
false
false
351
r
library(glmnet) mydata = read.table("../../../../TrainingSet/FullSet/AvgRank/lymphoid.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.03,family="gaussian",standardize=FALSE) sink('./lymphoid_014.txt',append=TRUE...
# ui.R library("shiny") # Define UI shinyUI( pageWithSidebar( # Title headerPanel("Visualizing a Function of Two Variables") , # User Input in sidebar panel sidebarPanel( helpText("This application can be used to visualize common functions of two variables. First, select a function...
/ui.R
no_license
lziegelmeier/DDPProject
R
false
false
1,989
r
# ui.R library("shiny") # Define UI shinyUI( pageWithSidebar( # Title headerPanel("Visualizing a Function of Two Variables") , # User Input in sidebar panel sidebarPanel( helpText("This application can be used to visualize common functions of two variables. First, select a function...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bezier.R \name{geom_bezier} \alias{geom_bezier} \alias{stat_bezier} \alias{stat_bezier2} \alias{geom_bezier2} \alias{stat_bezier0} \alias{geom_bezier0} \title{Create quadratic or cubic bezier curves} \usage{ stat_bezier(mapping = NULL, data =...
/man/geom_bezier.Rd
permissive
teunbrand/ggforce
R
false
true
6,694
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bezier.R \name{geom_bezier} \alias{geom_bezier} \alias{stat_bezier} \alias{stat_bezier2} \alias{geom_bezier2} \alias{stat_bezier0} \alias{geom_bezier0} \title{Create quadratic or cubic bezier curves} \usage{ stat_bezier(mapping = NULL, data =...
# # Copyright 2007-2016 The OpenMx Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
/R/MxFitFunctionAlgebra.R
permissive
falkcarl/OpenMx
R
false
false
5,155
r
# # Copyright 2007-2016 The OpenMx Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
# step 10 # packages library(data.table) library(dplyr) library(tidyverse) library(ggplot2) library(ggforestplot) ### data mother <- fread("./001_glycosuria/reviewer_analysis/GWAS_revision2/step5/output/GWAS_output_final.txt", header = T) mother_sig <- subset(mother, P <= 5e-8) mother_SNP <- subset(mother, P == min(m...
/scripts/reviewer_analysis/revision_2/step10.R
no_license
mattlee821/001_glycosuria_GWAS
R
false
false
2,939
r
# step 10 # packages library(data.table) library(dplyr) library(tidyverse) library(ggplot2) library(ggforestplot) ### data mother <- fread("./001_glycosuria/reviewer_analysis/GWAS_revision2/step5/output/GWAS_output_final.txt", header = T) mother_sig <- subset(mother, P <= 5e-8) mother_SNP <- subset(mother, P == min(m...
################################################################### ## MLE (Empirical Bayesian) Gaussian Update ## ## This script performs a Gaussian Update of the GIA processes ## ## Given ## ## 1. MLE parameter values ...
/Experiment1a/Rscript/02GP_MLE_update.R
no_license
WhythiskolaveriD/GM_experiments_BDV
R
false
false
543
r
################################################################### ## MLE (Empirical Bayesian) Gaussian Update ## ## This script performs a Gaussian Update of the GIA processes ## ## Given ## ## 1. MLE parameter values ...
# clustering the data, and the cluster id becomes a new feature for the dataset ## selected features after Boruta feature selection q3 <- subset(q2, select = colnames(q2) %in% selected_cols) ## clustering and the cluster id will be a new feature set.seed(1) kc <- kmeans(model.matrix(~.+0,data=q3), 6) kc$cluster q3[, ...
/classification_for_imbalanced_data/clustering_in_classification.R
permissive
hanhanwu/Hanhan_Data_Science_Practice
R
false
false
2,647
r
# clustering the data, and the cluster id becomes a new feature for the dataset ## selected features after Boruta feature selection q3 <- subset(q2, select = colnames(q2) %in% selected_cols) ## clustering and the cluster id will be a new feature set.seed(1) kc <- kmeans(model.matrix(~.+0,data=q3), 6) kc$cluster q3[, ...
# GMRA Using Cover Trees #' Orthogonal projection #' #' TODO: Implement randomized low-rank SVD approach #' @param A matrix with data in rows #' @param The shift value to be subtracted from each row of X #' @param The rank of the projection to be extracted #' #' @export projector = function(X,mu,dim) { x = svd(t(ap...
/R/gmra_ct.R
permissive
n8epi/gmRa
R
false
false
3,241
r
# GMRA Using Cover Trees #' Orthogonal projection #' #' TODO: Implement randomized low-rank SVD approach #' @param A matrix with data in rows #' @param The shift value to be subtracted from each row of X #' @param The rank of the projection to be extracted #' #' @export projector = function(X,mu,dim) { x = svd(t(ap...
rm(list=ls()) .libPaths("/global/home/users/cbrook/R/x86_64-pc-linux-gnu-library/4.0") #setwd("/Users/caraebrook/Documents/R/R_repositories/Berkeley-Reopening/Dec-2020/all-runs/Re-Run-12-24/FigS1/") #no group, no test, no trace library(data.table) library(plyr) library(dplyr) library(deSolve) library(matrixStats) li...
/all-model-runs/Fig4-Layered-Interventions-lower-prop-UCB/weekly/weekly-2-test-days-trace-1-symp.R
no_license
carabrook/Berkeley-COVID-testing
R
false
false
85,538
r
rm(list=ls()) .libPaths("/global/home/users/cbrook/R/x86_64-pc-linux-gnu-library/4.0") #setwd("/Users/caraebrook/Documents/R/R_repositories/Berkeley-Reopening/Dec-2020/all-runs/Re-Run-12-24/FigS1/") #no group, no test, no trace library(data.table) library(plyr) library(dplyr) library(deSolve) library(matrixStats) li...
suppressMessages({library(ProjectTemplate); load.project()}) load("cache/models.RData") digs <- options("digits") options(digits = 2) # Prepare data ------------------------------------------------------------ data_auc_ci <- models %>% select(country, Model, starts_with("AUC")) %>% mutate( ...
/src/fig_auc.R
no_license
eribul/NH_luxation_infektion
R
false
false
2,241
r
suppressMessages({library(ProjectTemplate); load.project()}) load("cache/models.RData") digs <- options("digits") options(digits = 2) # Prepare data ------------------------------------------------------------ data_auc_ci <- models %>% select(country, Model, starts_with("AUC")) %>% mutate( ...
points.ve <- function(x, col='#225588', cex=0.5, pch=19, ...){ points(x$p, col=col, cex=cex, pch=pch, ...) }
/R/points.ve.R
no_license
cran/voronoi
R
false
false
109
r
points.ve <- function(x, col='#225588', cex=0.5, pch=19, ...){ points(x$p, col=col, cex=cex, pch=pch, ...) }
ggshadow_histogram <- function(data, mapping = aes(), facet_var, nrow = NULL, ncol = NULL, bg_fill = "grey", bg_alpha = 0.5, ...){ ggplot(data, mapping) + geom_histogram(data = data[, names(data) != facet_var], fill = bg_fill, alpha = bg_alpha) + geom_histogram(...) + facet_wrap(facet_var, nrow, ncol)...
/R/ggshadow.R
no_license
KevinRPan/BrattleExtras
R
false
false
950
r
ggshadow_histogram <- function(data, mapping = aes(), facet_var, nrow = NULL, ncol = NULL, bg_fill = "grey", bg_alpha = 0.5, ...){ ggplot(data, mapping) + geom_histogram(data = data[, names(data) != facet_var], fill = bg_fill, alpha = bg_alpha) + geom_histogram(...) + facet_wrap(facet_var, nrow, ncol)...
source('testingDataset.R') #AUData <- filter(conventionals_HUC, ID305B_1 %in% 'VAW-H01R_JMS04A00' | # ID305B_2 %in% 'VAW-H01R_JMS04A00' | # ID305B_2 %in% 'VAW-H01R_JMS04A00')%>% # left_join(WQSvalues, by = 'CLASS') x <-filter(conventionals_HUC, FDT_STA_ID %in% '4APKP-4-DRBA')# ...
/R&S_app_v4/appModules_Testing/buildEnter_new.R
no_license
EmmaVJones/Rivers-StreamsAssessment
R
false
false
16,039
r
source('testingDataset.R') #AUData <- filter(conventionals_HUC, ID305B_1 %in% 'VAW-H01R_JMS04A00' | # ID305B_2 %in% 'VAW-H01R_JMS04A00' | # ID305B_2 %in% 'VAW-H01R_JMS04A00')%>% # left_join(WQSvalues, by = 'CLASS') x <-filter(conventionals_HUC, FDT_STA_ID %in% '4APKP-4-DRBA')# ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Class_survey.R \docType{data} \name{Class_survey} \alias{Class_survey} \title{Survey of students in a statistics class} \format{ A data frame with 27 rows, each of which is an individual student: \itemize{ \item vehicle: Type of car the stude...
/man/Class_survey.Rd
no_license
dtkaplan/StatsUsingTechnologyData
R
false
true
934
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Class_survey.R \docType{data} \name{Class_survey} \alias{Class_survey} \title{Survey of students in a statistics class} \format{ A data frame with 27 rows, each of which is an individual student: \itemize{ \item vehicle: Type of car the stude...
library(visreg) f <- system.file('tests', 'unusual-formulas.R', package='visreg') source(f)
/tests/run/test-unusual-formulas.R
no_license
cran/visreg
R
false
false
92
r
library(visreg) f <- system.file('tests', 'unusual-formulas.R', package='visreg') source(f)
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ses_operations.R \name{ses_set_receipt_rule_position} \alias{ses_set_receipt_rule_position} \title{Sets the position of the specified receipt rule in the receipt rule set} \usage{ ses_set_receipt_rule_position(RuleSetName, RuleName, After) } ...
/paws/man/ses_set_receipt_rule_position.Rd
permissive
ryanb8/paws
R
false
true
1,364
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ses_operations.R \name{ses_set_receipt_rule_position} \alias{ses_set_receipt_rule_position} \title{Sets the position of the specified receipt rule in the receipt rule set} \usage{ ses_set_receipt_rule_position(RuleSetName, RuleName, After) } ...
## Caching the Inverse of a Matrix ## Matrix inversion is usually a costly computation and their may ## be some benefit to caching the inverse of a matrix rather than ## compute it repeatedly. ## This function creates a special "matrix" object that can cache ## its inverse. makeCacheMatrix <- function(x = matrix(...
/cachematrix.R
no_license
banzayats/ProgrammingAssignment2
R
false
false
1,751
r
## Caching the Inverse of a Matrix ## Matrix inversion is usually a costly computation and their may ## be some benefit to caching the inverse of a matrix rather than ## compute it repeatedly. ## This function creates a special "matrix" object that can cache ## its inverse. makeCacheMatrix <- function(x = matrix(...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/ci_handouts_pdf.R \name{ci_handouts_pdf} \alias{ci_handouts_pdf} \title{Use the handout version of slides} \usage{ ci_handouts_pdf(subtitle, location, institute, cover, cover_offset, fontsize, lang = "english", slide_level = 2, keep...
/man/ci_handouts_pdf.Rd
no_license
ThierryO/corpident
R
false
false
957
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/ci_handouts_pdf.R \name{ci_handouts_pdf} \alias{ci_handouts_pdf} \title{Use the handout version of slides} \usage{ ci_handouts_pdf(subtitle, location, institute, cover, cover_offset, fontsize, lang = "english", slide_level = 2, keep...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot_barcode_qc.R \name{.prepare_barcode_counts} \alias{.prepare_barcode_counts} \title{Prepare count annotations for number of cells passing each filtering method} \usage{ .prepare_barcode_counts(sce, sample_name, ambient_rna_filter, facets)...
/man/dot-prepare_barcode_counts.Rd
permissive
keshav-motwani/scanalysis
R
false
true
665
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot_barcode_qc.R \name{.prepare_barcode_counts} \alias{.prepare_barcode_counts} \title{Prepare count annotations for number of cells passing each filtering method} \usage{ .prepare_barcode_counts(sce, sample_name, ambient_rna_filter, facets)...
#Copyright 2012 The Board of Regents of the University of Wisconsin System. #Contributors: Jason Shao, James McCurdy, Enhai Xie, Adam G.W. Halstead, #Michael H. Whitney, Nathan DiPiazza, Trey K. Sato and Yury V. Bukhman # #This file is part of GCAT. # #GCAT is free software: you can redistribute it and/or modify #it u...
/R/GCAT/R/class.well.R
no_license
thethirduniverse/GCAT
R
false
false
18,659
r
#Copyright 2012 The Board of Regents of the University of Wisconsin System. #Contributors: Jason Shao, James McCurdy, Enhai Xie, Adam G.W. Halstead, #Michael H. Whitney, Nathan DiPiazza, Trey K. Sato and Yury V. Bukhman # #This file is part of GCAT. # #GCAT is free software: you can redistribute it and/or modify #it u...
# General notes ----------------------------------------------------------- # This file contains the wrappers for the models supported by DHARMa. DHARMa is interaction with packages ONLY via the wrappers. Below are # # 1) supported models in getPossibleModels # 2) generic S3 wrapper functions (function names see "Ne...
/R/compatibility.R
no_license
cran/DHARMa
R
false
false
21,788
r
# General notes ----------------------------------------------------------- # This file contains the wrappers for the models supported by DHARMa. DHARMa is interaction with packages ONLY via the wrappers. Below are # # 1) supported models in getPossibleModels # 2) generic S3 wrapper functions (function names see "Ne...
setwd("C:\\Users\\bef\\Desktop\\exdata_data_household_power_consumption") data_full<-read.csv("household_power_consumption.txt",sep=";",head=T,skip=0,na.strings="?",nrows=2075259, check.names=F, stringsAsFactors=F, comment.char="", quote='\"') data_full$Date <- as.Date(data_full$Date, format="%d/%m/%Y") ## Subsetting...
/plot4.R
no_license
brianfleharty/Exploratory_Data_Analysis
R
false
false
1,244
r
setwd("C:\\Users\\bef\\Desktop\\exdata_data_household_power_consumption") data_full<-read.csv("household_power_consumption.txt",sep=";",head=T,skip=0,na.strings="?",nrows=2075259, check.names=F, stringsAsFactors=F, comment.char="", quote='\"') data_full$Date <- as.Date(data_full$Date, format="%d/%m/%Y") ## Subsetting...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/comparison.R \name{selection_coverage} \alias{selection_coverage} \title{Intersection of two coverages.} \usage{ selection_coverage(x, y, thresholds) } \arguments{ \item{x}{Numeric matrix.} \item{y}{Numeric matrix.} \item{thresholds}{Numeri...
/man/selection_coverage.Rd
no_license
hmorzaria/zonator
R
false
true
762
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/comparison.R \name{selection_coverage} \alias{selection_coverage} \title{Intersection of two coverages.} \usage{ selection_coverage(x, y, thresholds) } \arguments{ \item{x}{Numeric matrix.} \item{y}{Numeric matrix.} \item{thresholds}{Numeri...
#set your working directory here# setwd("/Users/aymaneldahrawy/Documents/Coursera/Exploratory data analysis assignment") #read the files# NEI <- readRDS("summarySCC_PM25.rds") SCC <- readRDS("Source_Classification_Code.rds") #Question 1# NEI_1999 <- subset(NEI,NEI$year==1999) NEI_2002 <- subset(NEI,NEI$year==2002) NEI_...
/plot1.R
no_license
xamante/Exploratory-data-analysis-assignment
R
false
false
767
r
#set your working directory here# setwd("/Users/aymaneldahrawy/Documents/Coursera/Exploratory data analysis assignment") #read the files# NEI <- readRDS("summarySCC_PM25.rds") SCC <- readRDS("Source_Classification_Code.rds") #Question 1# NEI_1999 <- subset(NEI,NEI$year==1999) NEI_2002 <- subset(NEI,NEI$year==2002) NEI_...
setwd("/home/whb17/Documents/project3/project_files/feature_selection/ex_7/") library(limma) library(heatmap3) library(SNFtool) library(glmnet) set.seed(12) df.prot.tt <- read.csv("../../data/ex_7/prot_testtrain_body.csv", header=TRUE, row.names = 1) # Gene test/train set df.prot.tt <- read.csv("../../data/ex_7/pr...
/feature_selection/ex_7/de7_2_stripped.R
no_license
whtbowers/multiomics
R
false
false
5,651
r
setwd("/home/whb17/Documents/project3/project_files/feature_selection/ex_7/") library(limma) library(heatmap3) library(SNFtool) library(glmnet) set.seed(12) df.prot.tt <- read.csv("../../data/ex_7/prot_testtrain_body.csv", header=TRUE, row.names = 1) # Gene test/train set df.prot.tt <- read.csv("../../data/ex_7/pr...
## sampling of data using stratified k-fold cross validation stratified_sample <- function(data_df, kfolds, cat_colname){ set.seed(42) train <- fold(data_df, k = kfolds, cat_col = cat_colname) train_index <- list() folds <- c(1:kfolds) for(i in folds){ train_index[[i]] <- which(train$.folds==i) } retu...
/src/scripts/data-sampling.R
no_license
sinchanabhat/Interpretable-Machine-Learning
R
false
false
337
r
## sampling of data using stratified k-fold cross validation stratified_sample <- function(data_df, kfolds, cat_colname){ set.seed(42) train <- fold(data_df, k = kfolds, cat_col = cat_colname) train_index <- list() folds <- c(1:kfolds) for(i in folds){ train_index[[i]] <- which(train$.folds==i) } retu...
#' @title Calculate the xy-coordinates of nodes in a phylogenetic tree #' @param phy A phylogenetic tree of class 'phylo' #' @param type Specify whether to return coordinates for all nodes or just tips #' @export `tree.coord` <- function(phy, type=c('all','tips')) { # make sure that a valid type has been passed to ...
/R/tree.coord.R
permissive
stoufferlab/phyloint
R
false
false
993
r
#' @title Calculate the xy-coordinates of nodes in a phylogenetic tree #' @param phy A phylogenetic tree of class 'phylo' #' @param type Specify whether to return coordinates for all nodes or just tips #' @export `tree.coord` <- function(phy, type=c('all','tips')) { # make sure that a valid type has been passed to ...
### Functions for runing the simulation ## Bug appears when p=0.05, n.imptuation = 100, n.random.seed=3 ## The call: ## do.call(impute::impute.knn, c(list(as.matrix(dataset)), list(NULL)) ## Creates a memory dump. setwd('../') source('simulation_fns.R') ##############################################################...
/R/bug_replication/bug_impute_knn.R
no_license
davidpham87/ethz_missing_data
R
false
false
1,124
r
### Functions for runing the simulation ## Bug appears when p=0.05, n.imptuation = 100, n.random.seed=3 ## The call: ## do.call(impute::impute.knn, c(list(as.matrix(dataset)), list(NULL)) ## Creates a memory dump. setwd('../') source('simulation_fns.R') ##############################################################...
#' prioritizrdata: Conservation Planning Datasets #' #' The \pkg{prioritizrdata} package is a supplemental package that contains #' example datasets for conservation planning. It is intended to be used #' alongside the \pkg{prioritizr} package. #' #' @details This package contains the following datasets: #' #' \describ...
/R/package.R
no_license
prioritizr/prioritizrdata
R
false
false
780
r
#' prioritizrdata: Conservation Planning Datasets #' #' The \pkg{prioritizrdata} package is a supplemental package that contains #' example datasets for conservation planning. It is intended to be used #' alongside the \pkg{prioritizr} package. #' #' @details This package contains the following datasets: #' #' \describ...
# LOAD the leaflet library library(leaflet) # LOAD the geojsonio library library(geojsonio) # Basic example from https://rstudio.github.io/leaflet/ get_basic_map = function(){ m = leaflet() %>% addTiles() %>% # Add default OpenStreetMap map tiles addMarkers(lng=174.768, lat=-36.852, popup="The birthplac...
/basics/06_leaflet.R
no_license
georgeslabreche/to-R-ino
R
false
false
2,665
r
# LOAD the leaflet library library(leaflet) # LOAD the geojsonio library library(geojsonio) # Basic example from https://rstudio.github.io/leaflet/ get_basic_map = function(){ m = leaflet() %>% addTiles() %>% # Add default OpenStreetMap map tiles addMarkers(lng=174.768, lat=-36.852, popup="The birthplac...
continuity <- function (data, timestamp = NULL, timediff = 30) { if (is.null(timestamp)) { data = createTimestamp(data) } else { data = createTimestamp(data, timestamp = timestamp) } data$dayOfYear = data$yday + data$hour/24 dt = timediff/(24 * 60) data$diff[2:nrow(data)] = ...
/R/continuity.r
no_license
lhmet-forks/FREddyPro
R
false
false
827
r
continuity <- function (data, timestamp = NULL, timediff = 30) { if (is.null(timestamp)) { data = createTimestamp(data) } else { data = createTimestamp(data, timestamp = timestamp) } data$dayOfYear = data$yday + data$hour/24 dt = timediff/(24 * 60) data$diff[2:nrow(data)] = ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rfda.R \docType{package} \name{rfda} \alias{rfda} \alias{rfda-package} \title{rfda: a tool of functional data analysis} \description{ This package provides the tools to perform the functional data analysis. Especially the FPCA method via PACE...
/man/rfda.Rd
permissive
alexchang2017/rfda
R
false
true
4,308
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rfda.R \docType{package} \name{rfda} \alias{rfda} \alias{rfda-package} \title{rfda: a tool of functional data analysis} \description{ This package provides the tools to perform the functional data analysis. Especially the FPCA method via PACE...
setwd('/Users/kramerPro/Google Drive/Machine Learning/HW 1/') library(readr) data <- read_csv('letter-recognition.csv',col_names = F) data[,2:17] <- data[,2:17]/15 # normalizing data train <- data[1:10000,] test <- data[10001:20000,] A_B_train <- subset(train, X1 == 'A' | X1 == 'B') write.csv2(A_B_train,file = '/U...
/1-layer-perceptron/Hw1pre.R
no_license
kramer102/MachineLearning2016
R
false
false
2,023
r
setwd('/Users/kramerPro/Google Drive/Machine Learning/HW 1/') library(readr) data <- read_csv('letter-recognition.csv',col_names = F) data[,2:17] <- data[,2:17]/15 # normalizing data train <- data[1:10000,] test <- data[10001:20000,] A_B_train <- subset(train, X1 == 'A' | X1 == 'B') write.csv2(A_B_train,file = '/U...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_dataset.R \name{get_dataset} \alias{get_dataset} \title{get_dataset: download entire dataset from ECB SDW} \usage{ get_dataset(datasetId = "ECB_AME1", flowRef = dataid2flowref(datasetId)) } \arguments{ \item{datasetId}{Dataset ID, typical...
/man/get_dataset.Rd
no_license
Karagul/ecbapi
R
false
true
697
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_dataset.R \name{get_dataset} \alias{get_dataset} \title{get_dataset: download entire dataset from ECB SDW} \usage{ get_dataset(datasetId = "ECB_AME1", flowRef = dataid2flowref(datasetId)) } \arguments{ \item{datasetId}{Dataset ID, typical...
#testing #test blah 1 + 1 4+1+2 +6
/test.r
no_license
ldittmar/test
R
false
false
36
r
#testing #test blah 1 + 1 4+1+2 +6
# # options.R # # Spatstat options and other internal states # # $Revision: 1.89 $ $Date: 2020/10/14 02:20:30 $ # # .spEnv <- new.env() putSpatstatVariable <- function(name, value) { assign(name, value, envir=.spEnv) } getSpatstatVariable <- function(name) { get(name, envir=.spEnv) } existsSpatstatVa...
/R/options.R
no_license
rubak/spatstat
R
false
false
23,333
r
# # options.R # # Spatstat options and other internal states # # $Revision: 1.89 $ $Date: 2020/10/14 02:20:30 $ # # .spEnv <- new.env() putSpatstatVariable <- function(name, value) { assign(name, value, envir=.spEnv) } getSpatstatVariable <- function(name) { get(name, envir=.spEnv) } existsSpatstatVa...
library(shiny) library(shinyjs) fieldsMandatory <- c("name", "favourite_pkg") ui <- fluidPage( titlePanel("Mimicking a Google Form with a Shiny app"), div( id = "form", textInput("name", "Name", ""), textInput("favourite_pkg", "Favourite R package"), checkboxInput("use...
/1. Shiny/09 24 Mimicking a Google Form with a Shiny app.R
no_license
richarddeng88/Developing_Data_Products
R
false
false
1,232
r
library(shiny) library(shinyjs) fieldsMandatory <- c("name", "favourite_pkg") ui <- fluidPage( titlePanel("Mimicking a Google Form with a Shiny app"), div( id = "form", textInput("name", "Name", ""), textInput("favourite_pkg", "Favourite R package"), checkboxInput("use...
#' @title Return a list with statistics summary of the file ts.txt #' #' @description #' This function takes the object ts, generated with \link{createFBTS} #' and return a list with statistics summary of this object #' #' @param ts \code{data.table} The output ts obtained with \link{createFBTS} #' @param calendar \c...
/R/getStatsFBts.R
no_license
rte-antares-rpackage/fbAntares
R
false
false
3,580
r
#' @title Return a list with statistics summary of the file ts.txt #' #' @description #' This function takes the object ts, generated with \link{createFBTS} #' and return a list with statistics summary of this object #' #' @param ts \code{data.table} The output ts obtained with \link{createFBTS} #' @param calendar \c...
#' Search Catalogue of Life for taxonomic IDs #' #' @export #' @param name The string to search for. Only exact matches found the name given #' will be returned, unless one or wildcards are included in the search #' string. An * (asterisk) character denotes a wildcard; a % (percentage) #' character may also be...
/R/col_search.R
permissive
nsm120/taxize
R
false
false
8,519
r
#' Search Catalogue of Life for taxonomic IDs #' #' @export #' @param name The string to search for. Only exact matches found the name given #' will be returned, unless one or wildcards are included in the search #' string. An * (asterisk) character denotes a wildcard; a % (percentage) #' character may also be...
## 1. read in raw tally files #' Read in some raw tally files. #' #' @param filename File to parse. #' @param CIA I have no clue. #' @return data frame of the tally information. import_raw_tally <- function(filename, CIA = TRUE) { df <- read.delim(filename, header = FALSE) #100654 if (CIA) { df <- df[-grep("^...
/R/import_raw_tally.R
no_license
abelew/FiTnEss
R
false
false
762
r
## 1. read in raw tally files #' Read in some raw tally files. #' #' @param filename File to parse. #' @param CIA I have no clue. #' @return data frame of the tally information. import_raw_tally <- function(filename, CIA = TRUE) { df <- read.delim(filename, header = FALSE) #100654 if (CIA) { df <- df[-grep("^...
E3F40dv.R GISS Model E 1979 ocn/atm rar 03/04 E3F40dv: old vegetation is replaced with dynamic vegetation model (Ent) E3F40: replace this section by a description of what distinguishes this run ? Use as many lines as you need. Look carefully at all the possible ? choices, particular...
/templates/E3F40dv.R
no_license
Racha711/GCAP2
R
false
false
8,926
r
E3F40dv.R GISS Model E 1979 ocn/atm rar 03/04 E3F40dv: old vegetation is replaced with dynamic vegetation model (Ent) E3F40: replace this section by a description of what distinguishes this run ? Use as many lines as you need. Look carefully at all the possible ? choices, particular...
#' Daily Indices to GeoTiff #' #' This function wraps the daily_indices function. It writes data to a geotiff #' file in the working directory. #' #' #' @param tmin a data.frame or matrix with 12 or 52 columns representing #' monthly or weekly minimum temperature data; rows represent different #' locations. #' @para...
/R/daily_indices2geotiff.R
no_license
jjvanderwal/climates
R
false
false
2,767
r
#' Daily Indices to GeoTiff #' #' This function wraps the daily_indices function. It writes data to a geotiff #' file in the working directory. #' #' #' @param tmin a data.frame or matrix with 12 or 52 columns representing #' monthly or weekly minimum temperature data; rows represent different #' locations. #' @para...
library(shiny) library(leaflet) library(ggmap) crimes_vector <- c("AGGRAVATED ASSAULT" = "AGGRAVATED ASSAULT", "ARSON" = "ARSON", "BURGLARY" = "BURGLARY", "CRIMINAL HOMICIDE" = "CRIMINAL HOMICIDE", "DISORDERLY CONDUCT" = "DISORDERLY CONDUCT", "DRUNK / ALCOHOL / DRUGS" = "DRUNK / ALCOHOL / DRUGS", ...
/la-crimes-shiny-app/ui.r
no_license
carlosror/la_crimes
R
false
false
5,237
r
library(shiny) library(leaflet) library(ggmap) crimes_vector <- c("AGGRAVATED ASSAULT" = "AGGRAVATED ASSAULT", "ARSON" = "ARSON", "BURGLARY" = "BURGLARY", "CRIMINAL HOMICIDE" = "CRIMINAL HOMICIDE", "DISORDERLY CONDUCT" = "DISORDERLY CONDUCT", "DRUNK / ALCOHOL / DRUGS" = "DRUNK / ALCOHOL / DRUGS", ...
## Started 27 Feb 2019 ## ## By Ailene ## ## Marginal effects from Stan models ## ############################################ # housekeeping rm(list=ls()) options(stringsAsFactors = FALSE) #libraries library(RColorBrewer) library(geosphere) library(rstan) library(chillR) library(rgl) # Setting working directory. A...
/analyses/bb_analysis/models_stan_plotting_mu_ests.R
no_license
lizzieinvancouver/ospree
R
false
false
13,867
r
## Started 27 Feb 2019 ## ## By Ailene ## ## Marginal effects from Stan models ## ############################################ # housekeeping rm(list=ls()) options(stringsAsFactors = FALSE) #libraries library(RColorBrewer) library(geosphere) library(rstan) library(chillR) library(rgl) # Setting working directory. A...
library(shiny) library(sigmajs) ui <- fluidPage( fluidRow( column(2, selectInput('node', "", selected = 3, choices = 1:20)), column(2, actionButton("delete", "Delete node")) ), fluidRow( sigmajsOutput("sg", height = "100vh") ) ) server <- function(input, output) { ids <- as.character(seq(1, 20)) nodes <...
/demo/drop-node.R
permissive
takewiki/sigmajs
R
false
false
739
r
library(shiny) library(sigmajs) ui <- fluidPage( fluidRow( column(2, selectInput('node', "", selected = 3, choices = 1:20)), column(2, actionButton("delete", "Delete node")) ), fluidRow( sigmajsOutput("sg", height = "100vh") ) ) server <- function(input, output) { ids <- as.character(seq(1, 20)) nodes <...
### install cran task view ### ctv::update.views(c("Finance","Econometrics", "MachineLearning","TimeSeries"))
/22_December_2020_CRAN_UPDATE.R
no_license
SivuyileNzimeni/tidy_tuesday_attempts
R
false
false
129
r
### install cran task view ### ctv::update.views(c("Finance","Econometrics", "MachineLearning","TimeSeries"))
library(base, quietly = TRUE) library(methods, quietly = TRUE) library(datasets, quietly = TRUE) library(utils, quietly = TRUE) library(grDevices, quietly = TRUE) library(graphics, quietly = TRUE) library(stats, quietly = TRUE) library(plyr, quietly = TRUE) library(dplyr, quietly = TRUE) library(reshape, quietly = TRUE...
/_rslurm_randomD/slurm_run.R
no_license
laurieKell/mydas
R
false
false
1,273
r
library(base, quietly = TRUE) library(methods, quietly = TRUE) library(datasets, quietly = TRUE) library(utils, quietly = TRUE) library(grDevices, quietly = TRUE) library(graphics, quietly = TRUE) library(stats, quietly = TRUE) library(plyr, quietly = TRUE) library(dplyr, quietly = TRUE) library(reshape, quietly = TRUE...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RnBSet-class.R \docType{methods} \name{meth,RnBSet-method} \alias{meth} \alias{meth,RnBSet-method} \title{meth-methods} \usage{ \S4method{meth}{RnBSet}(object, type = "sites", row.names = FALSE, i = NULL, j = NULL) } \arguments{ \item{objec...
/man/meth-methods.Rd
no_license
cirruswolke/RnBeads
R
false
true
1,411
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RnBSet-class.R \docType{methods} \name{meth,RnBSet-method} \alias{meth} \alias{meth,RnBSet-method} \title{meth-methods} \usage{ \S4method{meth}{RnBSet}(object, type = "sites", row.names = FALSE, i = NULL, j = NULL) } \arguments{ \item{objec...
getwd() setwd("/Users/honglinzhang/Documents/redwood/Courses/iDA MOOC Data Scientist/cousera/03. explore data analysis/project 1/Exploratory-Data-Analysis/") list.files() power <- read.table("household_power_consumption.txt",header = T,sep = ";") power$Date <- as.Date(power$Date,format="%d/%m/%Y") df <- power[(power$Da...
/project 1.R
no_license
hlzhangsg/Exploratory-Data-Analysis
R
false
false
2,798
r
getwd() setwd("/Users/honglinzhang/Documents/redwood/Courses/iDA MOOC Data Scientist/cousera/03. explore data analysis/project 1/Exploratory-Data-Analysis/") list.files() power <- read.table("household_power_consumption.txt",header = T,sep = ";") power$Date <- as.Date(power$Date,format="%d/%m/%Y") df <- power[(power$Da...
if (interactive()) savehistory(); library("aroma.affymetrix"); log <- Verbose(threshold=-10, timestamp=TRUE); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Settings # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - naVersion <- "30"; genomeVersion <- "hg18"; use...
/inst/buildScripts/chipTypes/GenomeWideSNP_6/na30/GenomeWideSNP_6,UFL,na30.R
no_license
microarray/aroma.affymetrix
R
false
false
4,973
r
if (interactive()) savehistory(); library("aroma.affymetrix"); log <- Verbose(threshold=-10, timestamp=TRUE); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Settings # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - naVersion <- "30"; genomeVersion <- "hg18"; use...
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function makeCacheMatrix <- function(x = matrix()) { inver <- NULL set <- function(y) { x <<- y inver <<- NULL } get <- function() x setinverse <- function(inverse) inver <<- i...
/cachematrix.R
no_license
farfour/ProgrammingAssignment2
R
false
false
756
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()) { inver <- NULL set <- function(y) { x <<- y inver <<- NULL } get <- function() x setinverse <- function(inverse) inver <<- i...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/blr-stepwise-selection.R \name{blr_step_aic_both} \alias{blr_step_aic_both} \alias{plot.blr_step_aic_both} \title{Stepwise AIC selection} \usage{ blr_step_aic_both(model, details = FALSE, ...) \method{plot}{blr_step_aic_both}(x, text_size = ...
/man/blr_step_aic_both.Rd
permissive
guhjy/blorr
R
false
true
1,984
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/blr-stepwise-selection.R \name{blr_step_aic_both} \alias{blr_step_aic_both} \alias{plot.blr_step_aic_both} \title{Stepwise AIC selection} \usage{ blr_step_aic_both(model, details = FALSE, ...) \method{plot}{blr_step_aic_both}(x, text_size = ...
# Bayesian GLM # Josh Nowak # 09/2021 ################################################################################ # Packages library(jagsUI) ################################################################################ # No external data needed #################################################################...
/scripts/binomial_multiple_int_coefs.R
no_license
Huh/wy_wrkshp
R
false
false
1,905
r
# Bayesian GLM # Josh Nowak # 09/2021 ################################################################################ # Packages library(jagsUI) ################################################################################ # No external data needed #################################################################...
library(knitr) library(leaps) library(MASS) ############################# # Select Data ########################### #county_data_fred <- county_data_fred[-c(672, 941, 1578, 1318),] #save(county_data_fred, file = "county_data_fred.RData") load("RData/County/county_data_fred.RData") data <- county_data_fred ###########...
/Code/Old/State County Analysis/County Regression.R
no_license
man44duke/Thesis
R
false
false
5,546
r
library(knitr) library(leaps) library(MASS) ############################# # Select Data ########################### #county_data_fred <- county_data_fred[-c(672, 941, 1578, 1318),] #save(county_data_fred, file = "county_data_fred.RData") load("RData/County/county_data_fred.RData") data <- county_data_fred ###########...
# ========================================================================== # 50 Things You Should Know About Data # # Unit 09-05 work with list # ========================================================================== # clean up # clear plots: like click on the button clear all plots in the plots panel # ...
/L-09/L-09-05_work-with-list.r
no_license
ursklahr/50-t-y-n-t-k-a-d
R
false
false
2,631
r
# ========================================================================== # 50 Things You Should Know About Data # # Unit 09-05 work with list # ========================================================================== # clean up # clear plots: like click on the button clear all plots in the plots panel # ...
# example 4.1 of section 4.1.1 # (example 4.1 of section 4.1.1) : Managing data : Cleaning data : Treating missing values (NAs) # Title: Checking locations of missing data custdata <- read.table('custdata.tsv', header=TRUE,sep='\t') summary(custdata[is.na(custdata$housing.type), # Note: 1 c...
/ch4.r
no_license
msisson/PDSwR
R
false
false
12,320
r
# example 4.1 of section 4.1.1 # (example 4.1 of section 4.1.1) : Managing data : Cleaning data : Treating missing values (NAs) # Title: Checking locations of missing data custdata <- read.table('custdata.tsv', header=TRUE,sep='\t') summary(custdata[is.na(custdata$housing.type), # Note: 1 c...
# team_db_query.r # # f.teamdb.query <- function(dataset) { # Database query function of TEAM production database. Returns a R Object for # each dataset and saves to the workspace. The function contains views or pre- # built queries. These should not be changed. Do not call this function # repeatedly during sc...
/tools/team_db_query.R
no_license
ConservationInternational/teamcode
R
false
false
7,041
r
# team_db_query.r # # f.teamdb.query <- function(dataset) { # Database query function of TEAM production database. Returns a R Object for # each dataset and saves to the workspace. The function contains views or pre- # built queries. These should not be changed. Do not call this function # repeatedly during sc...
context("utils") test_that("%||% works", { expect_equal(1, 1 %||% 7) expect_equal(1, NULL %||% 1) expect_equal(1, c() %||% 1) expect_equal(1, 1 %||% stop("oh no")) }) test_that("add_email_scope() works", { expect_identical(add_email_scope(), "email") expect_identical(add_email_scope("email"), "email") e...
/tests/testthat/test-utils.R
permissive
takewiki/gargle
R
false
false
505
r
context("utils") test_that("%||% works", { expect_equal(1, 1 %||% 7) expect_equal(1, NULL %||% 1) expect_equal(1, c() %||% 1) expect_equal(1, 1 %||% stop("oh no")) }) test_that("add_email_scope() works", { expect_identical(add_email_scope(), "email") expect_identical(add_email_scope("email"), "email") e...
get_non_parallel_cv <- function(X, Y, lambdas, non_zeros, label, penalization, max_iterations, ...
/functions/get_non_parallel_cv.R
no_license
acsala/2018_multiset_sRDA
R
false
false
5,261
r
get_non_parallel_cv <- function(X, Y, lambdas, non_zeros, label, penalization, max_iterations, ...
#' noVarCols #' #' Identifying all columns with no variance #' #' @param dat Dataframe #' #' @return Index positions for columns with no variance #' @export #' #' @examples #' sub_iris <- iris[1:50,] #' noVarCols(sub_iris) #' sub_iris <- sub_iris[,-noVarCols(sub_iris)] #' noVarCols <- function(dat) { catLengths <- ...
/R/noVarCols.R
no_license
JonWayland/uncoveR
R
false
false
423
r
#' noVarCols #' #' Identifying all columns with no variance #' #' @param dat Dataframe #' #' @return Index positions for columns with no variance #' @export #' #' @examples #' sub_iris <- iris[1:50,] #' noVarCols(sub_iris) #' sub_iris <- sub_iris[,-noVarCols(sub_iris)] #' noVarCols <- function(dat) { catLengths <- ...
## ## Analyse the best-fitting GEE models (averaged) ## library(ggplot2) library(gridExtra) library(aod) library(data.table) library(dplyr) library(xlsx) library(geepack) source("init.r") # either load GEE models or fit them from scratch gee.path = file.path(models.dir, "gees.RData") if (file.exists(gee.path)) { lo...
/analyse gees.r
permissive
matthewgthomas/mosuo-kinship
R
false
false
22,346
r
## ## Analyse the best-fitting GEE models (averaged) ## library(ggplot2) library(gridExtra) library(aod) library(data.table) library(dplyr) library(xlsx) library(geepack) source("init.r") # either load GEE models or fit them from scratch gee.path = file.path(models.dir, "gees.RData") if (file.exists(gee.path)) { lo...
# tests for annotations fxn in ropensnp context("annotations") test_that("annotations returns the correct class", { skip_on_cran() one <- suppressMessages(annotations(snp = "rs7903146", output = "snpedia")) expect_is(one, "data.frame") expect_is( suppressMessages(annotations(snp = "rs7903146", output = "...
/tests/testthat/test-annotations.R
permissive
cran/rsnps
R
false
false
570
r
# tests for annotations fxn in ropensnp context("annotations") test_that("annotations returns the correct class", { skip_on_cran() one <- suppressMessages(annotations(snp = "rs7903146", output = "snpedia")) expect_is(one, "data.frame") expect_is( suppressMessages(annotations(snp = "rs7903146", output = "...
# throw(iv,ip,ang,g,col) will animate a projectile motion # future: iv[vi1, vi2, vi3...], ang[ang1,ang2,...] # multiple plots at one time throw <- function(iv=10,ang=90,g=9.81, ip=c(0,0),simT=5,col='red',lwd=2,lty=1, type='l',wait=.1,asp=1) { # iv <- initial velocity in direction of angle # ang <- angle o...
/softDevelopement/library_R/motion/proMotion_1.R
no_license
zaeemyousaf/zaeem
R
false
false
4,838
r
# throw(iv,ip,ang,g,col) will animate a projectile motion # future: iv[vi1, vi2, vi3...], ang[ang1,ang2,...] # multiple plots at one time throw <- function(iv=10,ang=90,g=9.81, ip=c(0,0),simT=5,col='red',lwd=2,lty=1, type='l',wait=.1,asp=1) { # iv <- initial velocity in direction of angle # ang <- angle o...
#' Clean_Sigma function #' #' Primarily a convenience function, Clean_Sigma estimates a correlation (Sigma) matrix that may contain substantial amounts of missing data and returns it in an easily usable form for the glasso function. #' @param x Data used to estimate the correlation matrix. #' @param cor_method Characte...
/R/Clean_Sigma.R
no_license
EpidemiologyDVM/duke-rnet-quick
R
false
false
934
r
#' Clean_Sigma function #' #' Primarily a convenience function, Clean_Sigma estimates a correlation (Sigma) matrix that may contain substantial amounts of missing data and returns it in an easily usable form for the glasso function. #' @param x Data used to estimate the correlation matrix. #' @param cor_method Characte...
/GDXFilesUSAIDDataVr2.R
no_license
caosmax/AFrica_LAC
R
false
false
21,131
r
################################################################################ ### Example of scale color ################################################################################ ### Simple scatter plot with defaults colors sp_color <- ggplot(df_data, aes(x=Avg_net_depth, y=Biomass, ...
/R/Scale_color/discrete_color_scales.R
no_license
JBLecomte/ggplot2-Introduction
R
false
false
2,682
r
################################################################################ ### Example of scale color ################################################################################ ### Simple scatter plot with defaults colors sp_color <- ggplot(df_data, aes(x=Avg_net_depth, y=Biomass, ...
pdf("disco_xyz.pdf") library('snapshot') library("plot3D") pos=snap.read.2('../../../R/etacs/snapshot_000','POS ',debug=1,gas=1) xp = pos$x yp = pos$y zp = pos$z id=snap.read.2('../../../R/etacs/snapshot_000','ID ',debug=1,gas=1) idc = id[which(-5 < xp & xp < 5 & -5 < yp & yp < 5 & 2 < zp & zp < 10)] data <- data....
/work/cecere/R/lineas/vectores3D_indice.R
no_license
marialda27/mhd-disks
R
false
false
2,475
r
pdf("disco_xyz.pdf") library('snapshot') library("plot3D") pos=snap.read.2('../../../R/etacs/snapshot_000','POS ',debug=1,gas=1) xp = pos$x yp = pos$y zp = pos$z id=snap.read.2('../../../R/etacs/snapshot_000','ID ',debug=1,gas=1) idc = id[which(-5 < xp & xp < 5 & -5 < yp & yp < 5 & 2 < zp & zp < 10)] data <- data....
# Exploratory Data Analysis Assignment 1 #Script for plot 1 #load the data.table package library(data.table) #read the data from the file in working directory into a dataset all_data <- read.table("household_power_consumption.txt", sep = ";",header = TRUE, na.strings = "?") #subset only the 2007-02-01 and 2007-02-02...
/plot1.r
no_license
tiavlovskiegor24/ExData_Plotting1
R
false
false
814
r
# Exploratory Data Analysis Assignment 1 #Script for plot 1 #load the data.table package library(data.table) #read the data from the file in working directory into a dataset all_data <- read.table("household_power_consumption.txt", sep = ";",header = TRUE, na.strings = "?") #subset only the 2007-02-01 and 2007-02-02...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/check_distribution.R \name{check_distribution} \alias{check_distribution} \title{Simple check if distribution provided in defineUM() belongs to a list of supported distributions.} \usage{ check_distribution(object) } \arguments{ \item{object}...
/man/check_distribution.Rd
no_license
edzer/spup
R
false
true
602
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/check_distribution.R \name{check_distribution} \alias{check_distribution} \title{Simple check if distribution provided in defineUM() belongs to a list of supported distributions.} \usage{ check_distribution(object) } \arguments{ \item{object}...
/old usb backup/janet3.rd
no_license
htbrdd/rdworks-files
R
false
false
74,169
rd
#Classify wood and leaf from random forest classifier if(file.exists(angle.file.name)& !(file.exists(gsub(".asc","_0_10_NORM.asc",c2c.file))& file.exists(gsub(".asc","_0_50_NORM.asc",c2c.file))& file.exists(gsub(".asc","_0_75_NORM.asc",c2c.file)))| overwrite) classMetricCalc(angle...
/R/source_functions/classMetricCalc.R
no_license
MichaKoe/TLSLeAF
R
false
false
351
r
#Classify wood and leaf from random forest classifier if(file.exists(angle.file.name)& !(file.exists(gsub(".asc","_0_10_NORM.asc",c2c.file))& file.exists(gsub(".asc","_0_50_NORM.asc",c2c.file))& file.exists(gsub(".asc","_0_75_NORM.asc",c2c.file)))| overwrite) classMetricCalc(angle...
#' Download brazilian microdata. #' #' #' @param dataset Standardized name of brazilian public microdadata. See available datasets with get_available_datasets() #' @param i Period(year/quarter) to download, use get_available_periods(dataset) to see available periods #' @param unzip (optional) logical. Should fi...
/R/download_functions.R
no_license
pereiragc/microdadosBrasil
R
false
false
9,260
r
#' Download brazilian microdata. #' #' #' @param dataset Standardized name of brazilian public microdadata. See available datasets with get_available_datasets() #' @param i Period(year/quarter) to download, use get_available_periods(dataset) to see available periods #' @param unzip (optional) logical. Should fi...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/misc.R \name{get_NSMAP} \alias{get_NSMAP} \title{Retrieve the Genologics namespace map} \usage{ get_NSMAP() } \value{ a named vector of xmlNameSpaces } \description{ Retrieve the Genologics namespace map } \seealso{ Other Lims: \code{\link{Li...
/man/get_NSMAP.Rd
no_license
BigelowLab/genologicsr
R
false
true
803
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/misc.R \name{get_NSMAP} \alias{get_NSMAP} \title{Retrieve the Genologics namespace map} \usage{ get_NSMAP() } \value{ a named vector of xmlNameSpaces } \description{ Retrieve the Genologics namespace map } \seealso{ Other Lims: \code{\link{Li...