content
large_stringlengths
0
6.46M
path
large_stringlengths
3
331
license_type
large_stringclasses
2 values
repo_name
large_stringlengths
5
125
language
large_stringclasses
1 value
is_vendor
bool
2 classes
is_generated
bool
2 classes
length_bytes
int64
4
6.46M
extension
large_stringclasses
75 values
text
stringlengths
0
6.46M
library(Matrix) library(plyr) library(ggplot2) library(RColorBrewer) source("~/lib/util/R/intervals.R") source("~/lib/util/R/mouse.R") source("~/lib/util/R/viz/genome.r") load("~/db/subspecies/sso.Rdata") load("~/db/populations/CC/ss") strains <- read.table("~/tmp/strains.txt", header = TRUE, sep = "\t") ## retrieve...
/R/sso.pairwise.R
no_license
eduardoscopel/util
R
false
false
4,718
r
library(Matrix) library(plyr) library(ggplot2) library(RColorBrewer) source("~/lib/util/R/intervals.R") source("~/lib/util/R/mouse.R") source("~/lib/util/R/viz/genome.r") load("~/db/subspecies/sso.Rdata") load("~/db/populations/CC/ss") strains <- read.table("~/tmp/strains.txt", header = TRUE, sep = "\t") ## retrieve...
highlighting <- function(n_blocks = c(10, 5), n_test_reps = 1) { # Kruschke 2009, the "canonical" highlighting design # The default numbers of blocks are those used in the original experiment. X <- list(); class(X) <- "learnExp" X$n_test_reps <- n_test_reps # This determines the number of times the set of test ...
/dissectingEXIT/R/highlighting.R
no_license
SamPaskewitz/dissecting-EXIT
R
false
false
3,958
r
highlighting <- function(n_blocks = c(10, 5), n_test_reps = 1) { # Kruschke 2009, the "canonical" highlighting design # The default numbers of blocks are those used in the original experiment. X <- list(); class(X) <- "learnExp" X$n_test_reps <- n_test_reps # This determines the number of times the set of test ...
#' pretty print a statistical model #' #' export the model as a table with confidence interval and p-values #' #' @param mod a lm, glm or coxph object #' @param ... other options passed to \code{confint} #' #' @examples #' \dontrun{ #' ## lm #' mod_lm <- lm(dist ~ speed, data = cars) #' pretty_model(mod_lm) #' #' ...
/R/pretty_model.R
no_license
lbraglia/lbstat
R
false
false
2,242
r
#' pretty print a statistical model #' #' export the model as a table with confidence interval and p-values #' #' @param mod a lm, glm or coxph object #' @param ... other options passed to \code{confint} #' #' @examples #' \dontrun{ #' ## lm #' mod_lm <- lm(dist ~ speed, data = cars) #' pretty_model(mod_lm) #' #' ...
#' @importFrom ANTsRCore maskImage #' @export ANTsRCore::maskImage
/R/maskImage_import.R
permissive
ANTsX/ANTsR
R
false
false
67
r
#' @importFrom ANTsRCore maskImage #' @export ANTsRCore::maskImage
Analytics_Data1$Seniority2<-Analytics_Data1$Seniority^2 #QUADRATIC TRANSFORMATION (2nd ORDER) Analytics_Data1$Seniority3<-Analytics_Data1$Seniority^3 #CUBIC TRANSFORMATION (3rd ORDER) Analytics_Data1$ln_Seniority<-log(Analytics_Data1$Seniority) #LOGARITHMIC TRANSFORMATION #fraction of sample to be used for training p<...
/Econ 494 Pt. 2 R Code.R
no_license
jadynbell/Gender-Pay-Gap-
R
false
false
4,514
r
Analytics_Data1$Seniority2<-Analytics_Data1$Seniority^2 #QUADRATIC TRANSFORMATION (2nd ORDER) Analytics_Data1$Seniority3<-Analytics_Data1$Seniority^3 #CUBIC TRANSFORMATION (3rd ORDER) Analytics_Data1$ln_Seniority<-log(Analytics_Data1$Seniority) #LOGARITHMIC TRANSFORMATION #fraction of sample to be used for training p<...
context("Convert an iGraph graph to a Networkx graph") source("utils.R") test_that("save an iGraph graph to a Networkx json", { skip_if_no_networkx() test_netx <- netx2igraph(test_json_fixture_path) igraph2json(test_netx, path = test_json_save_path) test_loaded_netx <- netx2igraph(test_json_save_path) exp...
/tests/testthat/test-convert-igraph-to-networkx.R
permissive
griff-rees/py2Rgraphs
R
false
false
1,209
r
context("Convert an iGraph graph to a Networkx graph") source("utils.R") test_that("save an iGraph graph to a Networkx json", { skip_if_no_networkx() test_netx <- netx2igraph(test_json_fixture_path) igraph2json(test_netx, path = test_json_save_path) test_loaded_netx <- netx2igraph(test_json_save_path) exp...
library(data.table) library(readr) library(sqldf) library(dplyr) getwd() setwd("/Users/davidmilbern/Documents/ABA- Hackathon- Loan Approval") #file <- readr::read_csv("train_u6lujuX_CVtuZ9i.csv") file<- read.csv("train_u6lujuX_CVtuZ9i.csv", sep=",", header=T, strip.white = T, na.strings = c("NA","NaN","","?","NAN"), ...
/HackathonPretraining.R
no_license
dmilbern/Hackathon--Loan-Data
R
false
false
2,272
r
library(data.table) library(readr) library(sqldf) library(dplyr) getwd() setwd("/Users/davidmilbern/Documents/ABA- Hackathon- Loan Approval") #file <- readr::read_csv("train_u6lujuX_CVtuZ9i.csv") file<- read.csv("train_u6lujuX_CVtuZ9i.csv", sep=",", header=T, strip.white = T, na.strings = c("NA","NaN","","?","NAN"), ...
#packages.install(plot3d) library(plot3D) u = seq(0, 1, length=10) v = seq(-pi, pi, length=40) x = outer(sqrt(u), cos(v)) y = outer(sqrt(u), sin(v)) z = x*y surf3D(x, y, z, colkey=FALSE, bty="b2", main="Hyperbolic Paraboloid in R")
/R_Projects/Pringle/hyperbolicParaboloidGraph.R
no_license
DevilEars/Optics
R
false
false
284
r
#packages.install(plot3d) library(plot3D) u = seq(0, 1, length=10) v = seq(-pi, pi, length=40) x = outer(sqrt(u), cos(v)) y = outer(sqrt(u), sin(v)) z = x*y surf3D(x, y, z, colkey=FALSE, bty="b2", main="Hyperbolic Paraboloid in R")
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/helpers.R \name{safeSQLVar} \alias{safeSQLVar} \title{Safe SQL String} \usage{ safeSQLVar(var) } \arguments{ \item{var}{String to be made safe} } \value{ Safe sql string } \description{ Safe SQL String } \examples{ safeSQLVar("unsafe' string"...
/man/safeSQLVar.Rd
no_license
willforbes/rsqlhelpers
R
false
true
324
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/helpers.R \name{safeSQLVar} \alias{safeSQLVar} \title{Safe SQL String} \usage{ safeSQLVar(var) } \arguments{ \item{var}{String to be made safe} } \value{ Safe sql string } \description{ Safe SQL String } \examples{ safeSQLVar("unsafe' string"...
aic <- function(model) { ssr <- sum(model$residuals^2) t <- length(model$residuals) npar <- length(model$coef) return( "AIC" = log(ssr/t) + npar * 2/t ) }
/energy_markets/time_series_analysis_of_the_german_market/aic.R
no_license
piraburu/EAP_master
R
false
false
174
r
aic <- function(model) { ssr <- sum(model$residuals^2) t <- length(model$residuals) npar <- length(model$coef) return( "AIC" = log(ssr/t) + npar * 2/t ) }
create_ensemble_of_GUIDE_forests <- function(num_partition, num_of_folds, rand_seeds, check_forest_exist) { #clear_forests() # TODO: parallelize this maybe because sub functions are already parallelize for (seed in rand_seeds) { if (check_forest_exist) { check <- check_if_forest_e...
/40_ensemble_of_cerp_guide_forests.R
no_license
mythicalprogrammer/thesis_cerp_guide_forest
R
false
false
689
r
create_ensemble_of_GUIDE_forests <- function(num_partition, num_of_folds, rand_seeds, check_forest_exist) { #clear_forests() # TODO: parallelize this maybe because sub functions are already parallelize for (seed in rand_seeds) { if (check_forest_exist) { check <- check_if_forest_e...
#' calculate Kelly criterion ratio (leverage or bet size) for a strategy #' #' Kelly criterion ratio (leverage or bet size) for a strategy. #' #' The Kelly Criterion was identified by Bell Labs scientist John Kelly, and #' applied to blackjack and stock strategy sizing by Ed Thorpe. #' #' The Kelly ratio can be simp...
/R/KellyRatio.R
no_license
sanjivkv/PerformanceAnalytics
R
false
false
3,216
r
#' calculate Kelly criterion ratio (leverage or bet size) for a strategy #' #' Kelly criterion ratio (leverage or bet size) for a strategy. #' #' The Kelly Criterion was identified by Bell Labs scientist John Kelly, and #' applied to blackjack and stock strategy sizing by Ed Thorpe. #' #' The Kelly ratio can be simp...
#' #' hotbox.R #' #' Heat kernel for a one-dimensional rod #' and two-dimensional rectangle #' #' Code from Greg McSwiggan and Adrian Baddeley hotbox <- function(Xsource, Xquery, sigma, ..., W=NULL, squared=FALSE, nmax=20) { #' heat kernel in a rectangle check.1.real(sigma) if(is.null(W))...
/R/hotbox.R
no_license
spatstat/spatstat.core
R
false
false
1,962
r
#' #' hotbox.R #' #' Heat kernel for a one-dimensional rod #' and two-dimensional rectangle #' #' Code from Greg McSwiggan and Adrian Baddeley hotbox <- function(Xsource, Xquery, sigma, ..., W=NULL, squared=FALSE, nmax=20) { #' heat kernel in a rectangle check.1.real(sigma) if(is.null(W))...
#welcome.R #Package startup and unload functions # === Libraries that are used ===# library("roxygen2") library("igraph") library("networkD3") library("shiny") .onLoad <- function(libname, pkgname) { invisible() } .onAttach <- function(libname, pkgname) { # Startup message m <- character() m[1] <- "\...
/R/welcome.R
permissive
DogaIster/Rview
R
false
false
405
r
#welcome.R #Package startup and unload functions # === Libraries that are used ===# library("roxygen2") library("igraph") library("networkD3") library("shiny") .onLoad <- function(libname, pkgname) { invisible() } .onAttach <- function(libname, pkgname) { # Startup message m <- character() m[1] <- "\...
#' GCI - Green Chlorophyll Index #' #' This function is used to estimate leaf chlorophyll content of plants species. #' #' @param G A raster layer object with the reflectance values for the Green band. #' @param NIR A raster layer object with the reflectance values for the Near Infrared band. #' @return GCI - Gre...
/R/GCI.R
no_license
cran/nightmares
R
false
false
1,155
r
#' GCI - Green Chlorophyll Index #' #' This function is used to estimate leaf chlorophyll content of plants species. #' #' @param G A raster layer object with the reflectance values for the Green band. #' @param NIR A raster layer object with the reflectance values for the Near Infrared band. #' @return GCI - Gre...
################################################### ## Course project 1 - run_analysis.R ########## ## ## This script focuses on the data cleaning and processing of wearable ## computing data. It is the project 1 of the data cleaning course. ## Please see for details the commented code below. ## ######################...
/run_analysis.R
no_license
andreasjahnen/cleaning_data_project1
R
false
false
3,705
r
################################################### ## Course project 1 - run_analysis.R ########## ## ## This script focuses on the data cleaning and processing of wearable ## computing data. It is the project 1 of the data cleaning course. ## Please see for details the commented code below. ## ######################...
library(TSTr) ### Name: addToTree ### Title: Adds a set of strings to a ternary search tree ### Aliases: addToTree ### ** Examples fruitTree <- newTree(c("apple", "orange")) fruitTree <- addToTree(fruitTree, c("lemon", "pear"))
/data/genthat_extracted_code/TSTr/examples/addToTree.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
235
r
library(TSTr) ### Name: addToTree ### Title: Adds a set of strings to a ternary search tree ### Aliases: addToTree ### ** Examples fruitTree <- newTree(c("apple", "orange")) fruitTree <- addToTree(fruitTree, c("lemon", "pear"))
create_error <- function(source, message, call) { structure(list(source = source, message = message, call = call), class = c("instrumentr_error", "simpleError", "error", "condition")) }
/R/create_error.R
permissive
PRL-PRG/instrumentr
R
false
false
205
r
create_error <- function(source, message, call) { structure(list(source = source, message = message, call = call), class = c("instrumentr_error", "simpleError", "error", "condition")) }
without <- function(x, y) { x[x %notin% y] }
/BRT-code-salvage/helper-funs/without.R
no_license
rvanmazijk/Hons-thesis-code-salvage
R
false
false
49
r
without <- function(x, y) { x[x %notin% y] }
###PAAD miRNA ####read in partial coeficient function ####read in tcompfiles from "By cancer log2 fold with median mutations.r" ##PAAD is.na(tcomp)<- sapply(tcomp, is.infinite) is.na(tcomp)<- sapply(tcomp, is.nan) mirnaset<- tcomp[,-c(1,2)] edits<- cbind(NewNames, stri_sub(NewNames[,1], 9)) CancerPatients<-...
/miRNA mutation by cancer type/PAAD miRNA.r
no_license
PinarSiyah/Archived-R-files
R
false
false
6,995
r
###PAAD miRNA ####read in partial coeficient function ####read in tcompfiles from "By cancer log2 fold with median mutations.r" ##PAAD is.na(tcomp)<- sapply(tcomp, is.infinite) is.na(tcomp)<- sapply(tcomp, is.nan) mirnaset<- tcomp[,-c(1,2)] edits<- cbind(NewNames, stri_sub(NewNames[,1], 9)) CancerPatients<-...
library(tidyr) library(RMySQL) library(jsonlite) library(stringi) library(dplyr) # Getting the data from external sources #-------------------------------------------------------------------------------------------------------------------- #Getting the data from the database con <- dbConnect(RMySQL::MySQL(), ...
/data_cleaning.R
no_license
edotjioe/RMovieGenreComparator
R
false
false
6,020
r
library(tidyr) library(RMySQL) library(jsonlite) library(stringi) library(dplyr) # Getting the data from external sources #-------------------------------------------------------------------------------------------------------------------- #Getting the data from the database con <- dbConnect(RMySQL::MySQL(), ...
#' Downloads NLDAS light data #' @description This function downloads NLDAS incoming shortwave radiation data #' (w m-2). When using the NLDAS_DL function to download data from many sites, sometimes #' sites will fail to download data (possibly due to volume of requests). This function #' adds in an additional check to...
/R/NLDAS_DL_bulk.R
no_license
psavoy/StreamLightUtils
R
false
false
3,301
r
#' Downloads NLDAS light data #' @description This function downloads NLDAS incoming shortwave radiation data #' (w m-2). When using the NLDAS_DL function to download data from many sites, sometimes #' sites will fail to download data (possibly due to volume of requests). This function #' adds in an additional check to...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/dataManipulations.R \name{as.data.frame.list} \alias{as.data.frame.list} \title{Convert a list to a data frame} \usage{ \method{as.data.frame}{list}(x, row.names = NULL, optional = FALSE, ...) } \arguments{ \item{x}{A \code{list} where all of...
/man/as.data.frame.list.Rd
permissive
ivanliu1989/RQuant
R
false
true
551
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/dataManipulations.R \name{as.data.frame.list} \alias{as.data.frame.list} \title{Convert a list to a data frame} \usage{ \method{as.data.frame}{list}(x, row.names = NULL, optional = FALSE, ...) } \arguments{ \item{x}{A \code{list} where all of...
#' Select nodes from an HTML document #' #' More easily extract pieces out of HTML documents using XPath and CSS #' selectors. CSS selectors are particularly useful in conjunction with #' \url{http://selectorgadget.com/}: it makes it easy to find exactly #' which selector you should be using. If you haven't used CSS se...
/R/selectors.R
no_license
te159/rvest
R
false
false
4,677
r
#' Select nodes from an HTML document #' #' More easily extract pieces out of HTML documents using XPath and CSS #' selectors. CSS selectors are particularly useful in conjunction with #' \url{http://selectorgadget.com/}: it makes it easy to find exactly #' which selector you should be using. If you haven't used CSS se...
\name{bw.ppl} \alias{bw.ppl} \title{ Likelihood Cross Validation Bandwidth Selection for Kernel Density } \description{ Uses likelihood cross-validation to select a smoothing bandwidth for the kernel estimation of point process intensity. } \usage{ bw.ppl(X, \dots, srange=NULL, ns=16, sigma=NULL, weights=NULL,...
/man/bw.ppl.Rd
no_license
rubak/spatstat
R
false
false
3,738
rd
\name{bw.ppl} \alias{bw.ppl} \title{ Likelihood Cross Validation Bandwidth Selection for Kernel Density } \description{ Uses likelihood cross-validation to select a smoothing bandwidth for the kernel estimation of point process intensity. } \usage{ bw.ppl(X, \dots, srange=NULL, ns=16, sigma=NULL, weights=NULL,...
library(ape) testtree <- read.tree("1926_1.txt") unrooted_tr <- unroot(testtree) write.tree(unrooted_tr, file="1926_1_unrooted.txt")
/codeml_files/newick_trees_processed/1926_1/rinput.R
no_license
DaniBoo/cyanobacteria_project
R
false
false
135
r
library(ape) testtree <- read.tree("1926_1.txt") unrooted_tr <- unroot(testtree) write.tree(unrooted_tr, file="1926_1_unrooted.txt")
library(ggplot2) library(egg) source('rscripts/funcs.R') source('rscripts/settings_galaxy.R') r_seq <- seq(0, 35, .1) band_seq <- seq(3, 33, 3) ind_seq <- sapply(band_seq, function(x) which(r_seq == x)) color_list <- c('dark red', 'dark blue', 'dark green') slice_list <- lapply(1:3, function(slice_num){ read.csv(...
/rscripts/gal_plot.R
no_license
btroycraft/stabilizing_statistics_bootstrap
R
false
false
7,682
r
library(ggplot2) library(egg) source('rscripts/funcs.R') source('rscripts/settings_galaxy.R') r_seq <- seq(0, 35, .1) band_seq <- seq(3, 33, 3) ind_seq <- sapply(band_seq, function(x) which(r_seq == x)) color_list <- c('dark red', 'dark blue', 'dark green') slice_list <- lapply(1:3, function(slice_num){ read.csv(...
\name{mycorrhizal_network} \alias{mycorrhizal_network} \docType{data} \title{Mycorrhizal network from La Réunion island} \description{Mycorrhizal intercation network between orchids and mycorrhizal fungi from La Réunion island (Martos et al., 2012) along with the reconstructed phylogenetic trees of the orchids and the ...
/man/mycorrhizal_network.Rd
no_license
hmorlon/PANDA
R
false
false
1,683
rd
\name{mycorrhizal_network} \alias{mycorrhizal_network} \docType{data} \title{Mycorrhizal network from La Réunion island} \description{Mycorrhizal intercation network between orchids and mycorrhizal fungi from La Réunion island (Martos et al., 2012) along with the reconstructed phylogenetic trees of the orchids and the ...
# ------------------------------------------------------------------------- # String Abbreviations# # ------------------------------------------------------------------------- # To abbreviate strings you can use abbreviate () : # ---------------------------------------------------------------------...
/char_strings/string_abbreviations.R
no_license
ttedla/data_analysis
R
false
false
762
r
# ------------------------------------------------------------------------- # String Abbreviations# # ------------------------------------------------------------------------- # To abbreviate strings you can use abbreviate () : # ---------------------------------------------------------------------...
#' Get affiliation by languoid #' #' Takes any vector of languoids and return affiliation. #' @param x A character vector of the languoids (can be written in lower case) #' @param glottolog.source A character vector that define which glottolog database is used: 'original' or 'modified' (by default) #' @author George Mo...
/R/aff.lang.R
no_license
Bouri/lingtypology
R
false
false
1,065
r
#' Get affiliation by languoid #' #' Takes any vector of languoids and return affiliation. #' @param x A character vector of the languoids (can be written in lower case) #' @param glottolog.source A character vector that define which glottolog database is used: 'original' or 'modified' (by default) #' @author George Mo...
library(survival) # Construct AR1 covariance matrix AR1 <- function(tau, m) { if(m==1) {R <- 1} if(m > 1) { R <- diag(1, m) for(i in 1:(m-1)) { for(j in (i+1):m) { R[i,j] <- R[j,i] <- tau^(abs(i-j)) } } } return(R) } # generate covariates with different cov structure covariate...
/R_functions.R
no_license
UM-KevinHe/TimeVaryingCox
R
false
false
17,437
r
library(survival) # Construct AR1 covariance matrix AR1 <- function(tau, m) { if(m==1) {R <- 1} if(m > 1) { R <- diag(1, m) for(i in 1:(m-1)) { for(j in (i+1):m) { R[i,j] <- R[j,i] <- tau^(abs(i-j)) } } } return(R) } # generate covariates with different cov structure covariate...
install.packages('tokenizers') library('tokenizers') rawtxt <- "Hello Mr. Smith, how are you doing today? The weather is great, and city is awesome. The sky is pinkish-blue. Seeing the sky is amazing. You shouldn't eat cardboard" tktxt <- tokenize_sentences(rawtxt, lowercase = FALSE, strip_punct = FALSE, simplify = FA...
/Feature engineering/Text Analysis in R.R
no_license
Rezar/METCS688
R
false
false
1,535
r
install.packages('tokenizers') library('tokenizers') rawtxt <- "Hello Mr. Smith, how are you doing today? The weather is great, and city is awesome. The sky is pinkish-blue. Seeing the sky is amazing. You shouldn't eat cardboard" tktxt <- tokenize_sentences(rawtxt, lowercase = FALSE, strip_punct = FALSE, simplify = FA...
########################## # Analysis ########################## # clean environment rm(list=ls()) # read in the simulation output load("./Output/MC_Out.RData") # function to compute RMSE rmse <- function(pred, true=1){ return(sqrt(mean((pred-true)^2))) } # create empty folder (if not existing already) ifelse(!d...
/MCAnalysis.R
no_license
sjuhl/nonparametric_IV
R
false
false
16,679
r
########################## # Analysis ########################## # clean environment rm(list=ls()) # read in the simulation output load("./Output/MC_Out.RData") # function to compute RMSE rmse <- function(pred, true=1){ return(sqrt(mean((pred-true)^2))) } # create empty folder (if not existing already) ifelse(!d...
#' @title SupplFigure4 #' @description Plot supplementary figure 4 #' @param df_human Human immunopeptidomicvs dataframe from GetHumanMHCIdata #' @return supplementary figure 4 #' @seealso #' \code{\link[ggplot2]{ggplot}},\code{\link[ggplot2]{aes}},\code{\link[ggplot2]{geom_smooth}},\code{\link[ggplot2]{facet_wrap}} ...
/R/SupplFigure4.R
no_license
CaronLab/MHCIatlas
R
false
false
1,149
r
#' @title SupplFigure4 #' @description Plot supplementary figure 4 #' @param df_human Human immunopeptidomicvs dataframe from GetHumanMHCIdata #' @return supplementary figure 4 #' @seealso #' \code{\link[ggplot2]{ggplot}},\code{\link[ggplot2]{aes}},\code{\link[ggplot2]{geom_smooth}},\code{\link[ggplot2]{facet_wrap}} ...
###Chapter 1 Introduction to Repeated Measures ANOVA ###Explore the Working Memory Data # wm in Data Camp's workspace # Convert subject to a factor wm$subject <- factor(wm$subject) # Summary statistics by all groups describeBy(wm, wm$condition) # Boxplot iq versus condition boxplot(wm$iq ~ wm$condition, m...
/Introduction to Repeated Measures ANOVA.R
no_license
JoshuaHaden/Intro-to-Statistics-with-R-Repeated-Measures-ANOVA-Data-Camp
R
false
false
4,218
r
###Chapter 1 Introduction to Repeated Measures ANOVA ###Explore the Working Memory Data # wm in Data Camp's workspace # Convert subject to a factor wm$subject <- factor(wm$subject) # Summary statistics by all groups describeBy(wm, wm$condition) # Boxplot iq versus condition boxplot(wm$iq ~ wm$condition, m...
data("pbmcSmall") test_that("Test SeuratFromDino", { expect_that(SeuratFromDino(pbmcSmall, nCores = 2), is_a("Seurat")) })
/tests/testthat/test-SeuratFromDino.R
no_license
JBrownBiostat/Dino
R
false
false
128
r
data("pbmcSmall") test_that("Test SeuratFromDino", { expect_that(SeuratFromDino(pbmcSmall, nCores = 2), is_a("Seurat")) })
\name{indiv.1m.ssc} \alias{indiv.1m.ssc} \alias{asympt.ssc} \alias{known.ssc} \alias{unknown.ssc} \title{ Sample size computation with an individual testing procedure in the context of multiple continuous endpoints } \description{ This function computes the sample size with an individual testing procedure in the conte...
/man/indiv.1m.ssc.Rd
no_license
cran/rPowerSampleSize
R
false
false
3,235
rd
\name{indiv.1m.ssc} \alias{indiv.1m.ssc} \alias{asympt.ssc} \alias{known.ssc} \alias{unknown.ssc} \title{ Sample size computation with an individual testing procedure in the context of multiple continuous endpoints } \description{ This function computes the sample size with an individual testing procedure in the conte...
library(lubridate) data <- readRDS(schedule_data_path) # data$BEGDATE <- as.Date(data$`Section Begin Date`) # data$ENDDATE <- as.Date(data$`Ending Date`) data$BEGTIME <- as.character(data$`Beginning Time`) data$ENDTIME <- as.character(data$`Ending Time`) WU.as.hms <- function(h) { require(lubridate) h <- as....
/02-DateAndTime.R
no_license
erikpal/WUschedule
R
false
false
764
r
library(lubridate) data <- readRDS(schedule_data_path) # data$BEGDATE <- as.Date(data$`Section Begin Date`) # data$ENDDATE <- as.Date(data$`Ending Date`) data$BEGTIME <- as.character(data$`Beginning Time`) data$ENDTIME <- as.character(data$`Ending Time`) WU.as.hms <- function(h) { require(lubridate) h <- as....
\name{plotDistri} \alias{plotDistri} \title{ Plot function to represent density of trait values } \description{ Plot function to represent density of trait values } \usage{ plotDistri(traits = NULL, var.1 = NULL, var.2 = NULL, col.dens = NULL, plot.ask = TRUE, ylim.cex = 1, cex.leg = 0.8, polyg = TRUE, multip...
/.Archive man/man/plotDistri.Rd
no_license
ben9216/cati
R
false
false
2,786
rd
\name{plotDistri} \alias{plotDistri} \title{ Plot function to represent density of trait values } \description{ Plot function to represent density of trait values } \usage{ plotDistri(traits = NULL, var.1 = NULL, var.2 = NULL, col.dens = NULL, plot.ask = TRUE, ylim.cex = 1, cex.leg = 0.8, polyg = TRUE, multip...
#' @param d string vector of species names #' @param write TRUE/FALSE if to write the function output tc_algaeClassify <- function( d = NULL, write = FALSE ) { if (is.null(d) | length(d) == 0) { stop("No input species") } # compare with algaebase online database # algae_search(d$Dataset1[4], long = TRUE...
/R/algaeClassify.R
no_license
emilio-berti/taxclean
R
false
false
905
r
#' @param d string vector of species names #' @param write TRUE/FALSE if to write the function output tc_algaeClassify <- function( d = NULL, write = FALSE ) { if (is.null(d) | length(d) == 0) { stop("No input species") } # compare with algaebase online database # algae_search(d$Dataset1[4], long = TRUE...
# # Calculate confusion matrices for all ranks # create_confmats <- function(fmdat, scores = NULL, labels = NULL, keep_fmdat = FALSE, ...) { # === Validate input arguments === # Create fmdat from scores and labels if fmdat is missing fmdat <- .create_src_obj(fmdat, "fmdat", reformat_da...
/R/pl3_create_confmats.R
no_license
cran/precrec
R
false
false
2,979
r
# # Calculate confusion matrices for all ranks # create_confmats <- function(fmdat, scores = NULL, labels = NULL, keep_fmdat = FALSE, ...) { # === Validate input arguments === # Create fmdat from scores and labels if fmdat is missing fmdat <- .create_src_obj(fmdat, "fmdat", reformat_da...
irls <- function(A,b,tolr,tolx,p,maxiter) { Mnorm <-function(X) { ### the norm function in matlab ## returns the largest singular value of the matrix or vector ## here we create a function to duplicate this bizare behavior s = svd(X, 0, 0) return(max(s$d)) } eps = .Machine...
/R/irls.R
no_license
cran/PEIP
R
false
false
1,437
r
irls <- function(A,b,tolr,tolx,p,maxiter) { Mnorm <-function(X) { ### the norm function in matlab ## returns the largest singular value of the matrix or vector ## here we create a function to duplicate this bizare behavior s = svd(X, 0, 0) return(max(s$d)) } eps = .Machine...
library(data.table) library(Hmisc) library(weights) source("functions/build_filename_suffix.R") source("functions/make_qois_for_tables_and_figs.R") fam_adj <- TRUE exclude_alloc <- FALSE exclude_top_2_pct <- FALSE exclude_top_decile_female_earners <- FALSE exclude_top_decile_male_earners <- FALSE IN_DIR <- "main/6b_...
/main/8b_perform_decomposition_non_imputed/2_make_qois_for_tables_and_figs.R
no_license
dtburk/selfreliance
R
false
false
1,975
r
library(data.table) library(Hmisc) library(weights) source("functions/build_filename_suffix.R") source("functions/make_qois_for_tables_and_figs.R") fam_adj <- TRUE exclude_alloc <- FALSE exclude_top_2_pct <- FALSE exclude_top_decile_female_earners <- FALSE exclude_top_decile_male_earners <- FALSE IN_DIR <- "main/6b_...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RcppExports.R \name{finite_moment_test} \alias{finite_moment_test} \title{Finite Moment Test} \usage{ finite_moment_test( obs, k, r = 0L, psi = 2, u = 1, force_random_variate_sample = 0L, ignore_errors = 0L, verbose = 0L, ra...
/finity/man/finite_moment_test.Rd
no_license
akhikolla/InformationHouse
R
false
true
2,133
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RcppExports.R \name{finite_moment_test} \alias{finite_moment_test} \title{Finite Moment Test} \usage{ finite_moment_test( obs, k, r = 0L, psi = 2, u = 1, force_random_variate_sample = 0L, ignore_errors = 0L, verbose = 0L, ra...
install.packages("rattle.data") library(rattle.data) help(rattle.data) wssplot <- function(data , nc=15, seed=1234){ wss <- (nrow(data)-1 )*sum(apply(data , 2, var )) for ( i in 2:nc){ set.seed(seed) wss[i] <- sum(kmeans(data , cen...
/실습2.R
no_license
wooa1201/18_ADP
R
false
false
866
r
install.packages("rattle.data") library(rattle.data) help(rattle.data) wssplot <- function(data , nc=15, seed=1234){ wss <- (nrow(data)-1 )*sum(apply(data , 2, var )) for ( i in 2:nc){ set.seed(seed) wss[i] <- sum(kmeans(data , cen...
###### ## CFDERS data summary code ###### # Background -------------------------------------------------------------- ## Here is where you would actually source the functions in "CFDERS_data_summary_for_communities_functions.R" Importantly, all of these functions will require connection to the shared drive. # Set pat...
/Code/CFDERS_data_summary_for_communities_script.R
no_license
GMRI-SEL/COCA-EcoAndEcon
R
false
false
8,082
r
###### ## CFDERS data summary code ###### # Background -------------------------------------------------------------- ## Here is where you would actually source the functions in "CFDERS_data_summary_for_communities_functions.R" Importantly, all of these functions will require connection to the shared drive. # Set pat...
library(solaR) ### Name: A4_prodGCPV ### Title: Performance of a grid connected PV system. ### Aliases: prodGCPV ### Keywords: utilities constructors ### ** Examples library(lattice) library(latticeExtra) lat=37.2; G0dm=c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta=c(10, 14.1, 15.6, ...
/data/genthat_extracted_code/solaR/examples/prodGCPV.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
3,646
r
library(solaR) ### Name: A4_prodGCPV ### Title: Performance of a grid connected PV system. ### Aliases: prodGCPV ### Keywords: utilities constructors ### ** Examples library(lattice) library(latticeExtra) lat=37.2; G0dm=c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta=c(10, 14.1, 15.6, ...
require(nnet) args <- commandArgs(TRUE) table <- paste(fromJSON(file="config.json", method="C")$DATA_DIR, "/", args[2], "/multinomialQuestion/multinomialQuestionData_", args[1], ".txt", sep="") formula <- "result~" for (i in seq_along(args)) { if (i > 2) { formula <- paste(formula, args[i], sep="+") } ...
/scripts/multinomialQuestionScript.R
no_license
Hakaan256/logger
R
false
false
494
r
require(nnet) args <- commandArgs(TRUE) table <- paste(fromJSON(file="config.json", method="C")$DATA_DIR, "/", args[2], "/multinomialQuestion/multinomialQuestionData_", args[1], ".txt", sep="") formula <- "result~" for (i in seq_along(args)) { if (i > 2) { formula <- paste(formula, args[i], sep="+") } ...
################################################################################################ # Prepared for the textbook: # Data Analysis for Business, Economics, and Policy # by Gabor BEKES and Gabor KEZDI # Cambridge University Press 2021 # # License: Free to share, modify and use for educational purposes. Not...
/ch10-gender-earnings-understand/ch10-gender-earnings-multireg.R
no_license
LIKE4986/da_case_studies
R
false
false
12,961
r
################################################################################################ # Prepared for the textbook: # Data Analysis for Business, Economics, and Policy # by Gabor BEKES and Gabor KEZDI # Cambridge University Press 2021 # # License: Free to share, modify and use for educational purposes. Not...
#' Optimum \code{k} Measures Based Upon a Fixed Total Researcher Effort #' #' Given a fixed researcher effort (e.g., total number of assays able to be run), #' this function plots the optimum \code{k} measurements per individual to use #' in order to obtain the smallest confidence interval at an expected intraclass...
/R/effort.R
no_license
matthewwolak/ICC
R
false
false
5,936
r
#' Optimum \code{k} Measures Based Upon a Fixed Total Researcher Effort #' #' Given a fixed researcher effort (e.g., total number of assays able to be run), #' this function plots the optimum \code{k} measurements per individual to use #' in order to obtain the smallest confidence interval at an expected intraclass...
#' Hydrological data from IMGW #' #' Downloading hourly, daily, and monthly hydrological data from the measurement stations available in the danepubliczne.imgw.pl collection #' #' @param interval temporal resolution of the data ("daily" , "monthly", or "semiannual_and_annual") #' @param year vector of years (e.g., 1966...
/R/hydro_imgw.R
permissive
Schuch666/climate
R
false
false
2,179
r
#' Hydrological data from IMGW #' #' Downloading hourly, daily, and monthly hydrological data from the measurement stations available in the danepubliczne.imgw.pl collection #' #' @param interval temporal resolution of the data ("daily" , "monthly", or "semiannual_and_annual") #' @param year vector of years (e.g., 1966...
\name{qfunction-package} \alias{qfunction-package} \alias{qfunction} \docType{package} \title{ Q function } \description{ Regressing outcome at time 2 on coveriates and previous treatment choice, in order to get the optimal treatment at time 2 which can maximize outcome. Then go back to do the same to time 1. } \de...
/man/qfunction-package.Rd
no_license
helenshunshun/qfunction
R
false
false
814
rd
\name{qfunction-package} \alias{qfunction-package} \alias{qfunction} \docType{package} \title{ Q function } \description{ Regressing outcome at time 2 on coveriates and previous treatment choice, in order to get the optimal treatment at time 2 which can maximize outcome. Then go back to do the same to time 1. } \de...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/post_ticket.R \name{post_ticket} \alias{post_ticket} \title{Create a client connection to the Zendesk API} \usage{ post_ticket(requester_name, requester_email, body, subject, group, tags = list(), public, cli = client()) } \arguments{ \item...
/man/post_ticket.Rd
no_license
gino1009/RZendesk
R
false
true
1,494
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/post_ticket.R \name{post_ticket} \alias{post_ticket} \title{Create a client connection to the Zendesk API} \usage{ post_ticket(requester_name, requester_email, body, subject, group, tags = list(), public, cli = client()) } \arguments{ \item...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/eyer-analysis.R \name{analyse_fixation_areas} \alias{analyse_fixation_areas} \title{Analyses time spent in each area} \usage{ analyse_fixation_areas(obj, areas = list()) } \arguments{ \item{obj}{\code{\link{EyerObject}}} \item{areas}{list of...
/man/analyse_fixation_areas.Rd
permissive
hejtmy/eyer
R
false
true
748
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/eyer-analysis.R \name{analyse_fixation_areas} \alias{analyse_fixation_areas} \title{Analyses time spent in each area} \usage{ analyse_fixation_areas(obj, areas = list()) } \arguments{ \item{obj}{\code{\link{EyerObject}}} \item{areas}{list of...
reddit = read.csv('reddit.csv') str(reddit) library(ggplot2) levels(reddit$age.range) = c("Under 18", "18-24", "25-34", "35-44", "45-54", "55-64", "65 or Above") levels(reddit$age.range) plot(x=reddit$age.range) ?qqplot
/Data Analysis with R/lesson2/reddit_script.R
no_license
rsloot/MOOCs
R
false
false
222
r
reddit = read.csv('reddit.csv') str(reddit) library(ggplot2) levels(reddit$age.range) = c("Under 18", "18-24", "25-34", "35-44", "45-54", "55-64", "65 or Above") levels(reddit$age.range) plot(x=reddit$age.range) ?qqplot
library(shiny) library(splines) Data <- readRDS("WebScrapeRenaultCars.Rda") shinyUI( pageWithSidebar( headerPanel("Residual value model Renault"), sidebarPanel( selectInput("model", "model", choices = (Data$Type), multiple = FALSE, selected = ""), numer...
/ui.R
no_license
bartvink/Developing-Data-Products
R
false
false
1,126
r
library(shiny) library(splines) Data <- readRDS("WebScrapeRenaultCars.Rda") shinyUI( pageWithSidebar( headerPanel("Residual value model Renault"), sidebarPanel( selectInput("model", "model", choices = (Data$Type), multiple = FALSE, selected = ""), numer...
library(readr) library(ggplot2) library(meta) library(forestplot) library(stringr) trials <- read_csv("/Users/hannahmoyer/Desktop/finalallsearches.csv") totalpatients <- sum(trials$Total) #Make a subset for the g34 analysis, where g34s are reported per_arm_g34_trials <- subset(trials, Isthere4data == "yes" ) g34total...
/hannahprimaries.R
no_license
Hannahmo210/combo
R
false
false
4,379
r
library(readr) library(ggplot2) library(meta) library(forestplot) library(stringr) trials <- read_csv("/Users/hannahmoyer/Desktop/finalallsearches.csv") totalpatients <- sum(trials$Total) #Make a subset for the g34 analysis, where g34s are reported per_arm_g34_trials <- subset(trials, Isthere4data == "yes" ) g34total...
## read in the population data, the results data, and rosetta table population <- read.csv("population_matched_fix.csv",colClasses=c(rep("numeric",9),rep("character",4))) results <- read.csv("afgh_rnd_2nd_raw_html/afghanistanrunoff.csv",header=TRUE) match_table <- read.csv("rosetta_fix.csv",colClasses=c(rep("character"...
/R scripts/Comparisons to population.R
no_license
cha63506/afghanistan-2014-analysis
R
false
false
3,912
r
## read in the population data, the results data, and rosetta table population <- read.csv("population_matched_fix.csv",colClasses=c(rep("numeric",9),rep("character",4))) results <- read.csv("afgh_rnd_2nd_raw_html/afghanistanrunoff.csv",header=TRUE) match_table <- read.csv("rosetta_fix.csv",colClasses=c(rep("character"...
## ------------------------------------------------ ## Comparing CST proportions in AA vs nonAA ## ------------------------------------------------ load("mm_no_mPTB_june25_2017.rda") # ct.no.mPTB, pt.no.mPTB, mt.no.mPTB, selPh.25 (race.cst.freq <- table(mt.no.mPTB$race2, mt.no.mPTB$cst)) (race.cst.perc <- 100 * r...
/cmp_CSTs_bw_AA_and_nonAA.R
no_license
drsisu/M_and_M
R
false
false
6,229
r
## ------------------------------------------------ ## Comparing CST proportions in AA vs nonAA ## ------------------------------------------------ load("mm_no_mPTB_june25_2017.rda") # ct.no.mPTB, pt.no.mPTB, mt.no.mPTB, selPh.25 (race.cst.freq <- table(mt.no.mPTB$race2, mt.no.mPTB$cst)) (race.cst.perc <- 100 * r...
"print.pca" <- function(x, nmodes=6, ...) { cn <- class(x) cat("\nCall:\n ", paste(deparse(x$call), sep = "\n", collapse = "\n"), "\n\n", sep = "") cat("Class:\n ", cn, "\n\n", sep = "") cat("Number of eigenvalues:\n ", length(x$L), "\n\n", sep="") inds <- 1:nm...
/ver_devel/bio3d/R/print.pca.R
no_license
Grantlab/bio3d
R
false
false
887
r
"print.pca" <- function(x, nmodes=6, ...) { cn <- class(x) cat("\nCall:\n ", paste(deparse(x$call), sep = "\n", collapse = "\n"), "\n\n", sep = "") cat("Class:\n ", cn, "\n\n", sep = "") cat("Number of eigenvalues:\n ", length(x$L), "\n\n", sep="") inds <- 1:nm...
polyval <- function(v,x) { n <- length(v) y <- x*0+v[1]; for (i in 2:n) { y <- v[i] +x*y } return(y) }
/DbtTools/Statistics/R/polyval.R
no_license
markus-flicke/KD_Projekt_1
R
false
false
135
r
polyval <- function(v,x) { n <- length(v) y <- x*0+v[1]; for (i in 2:n) { y <- v[i] +x*y } return(y) }
# create plots to describe norovirus forecasts: # setwd("/home/johannes/Documents/hhh4predict/Theory/Article_Theory/data_analysis_forecasting/") setwd("noro") library(surveillance) library(hhh4addon) data("noroBE") # get helper functions: source("../auxiliary_functions.R") source("../basic_settings.R") # get result...
/noro/plots_forecasts_noro.R
no_license
MartinPDLE/Thesis-Code
R
false
false
9,678
r
# create plots to describe norovirus forecasts: # setwd("/home/johannes/Documents/hhh4predict/Theory/Article_Theory/data_analysis_forecasting/") setwd("noro") library(surveillance) library(hhh4addon) data("noroBE") # get helper functions: source("../auxiliary_functions.R") source("../basic_settings.R") # get result...
# Write ---------------------------------------------------------------- context("Writing R Objects") df <- data.frame(a = 1:3, b = letters[1:3], stringsAsFactors = FALSE) test_that("Write some data.frames", { skip_if_no_token() options(boxr.verbose = FALSE) expect_is(box_write(df, "test.csv"), "boxr_fi...
/tests/testthat/test_11_write.R
permissive
alexbrodersen/boxr
R
false
false
745
r
# Write ---------------------------------------------------------------- context("Writing R Objects") df <- data.frame(a = 1:3, b = letters[1:3], stringsAsFactors = FALSE) test_that("Write some data.frames", { skip_if_no_token() options(boxr.verbose = FALSE) expect_is(box_write(df, "test.csv"), "boxr_fi...
# Experimenting with future plans # libraries: ------------------------------------------------------------------ library(future) # function telling us where we are waiting: ----------------------------------- wait_where = function(x){ # Wait x seconds, then return the process id for the Rsession you waited in. i...
/future/planning_experiment_no1.R
no_license
jbhender/CSCAR_Workshops
R
false
false
2,651
r
# Experimenting with future plans # libraries: ------------------------------------------------------------------ library(future) # function telling us where we are waiting: ----------------------------------- wait_where = function(x){ # Wait x seconds, then return the process id for the Rsession you waited in. i...
setConstructorS3("PriorityList",function() { father <- GTHeuristic() father$solutionType <- "PriorityList" extend(father,"PriorityList", priorityList = NULL) }) setMethodS3("DBsave","PriorityList", function(this,con=NULL,...) { NextMethod("DBsave",this,con) pl <- this$priorityList d...
/lib/Optimization/Problems/JSS/base/PriorityList.R
no_license
pedabreu/OptimizationFramework
R
false
false
2,620
r
setConstructorS3("PriorityList",function() { father <- GTHeuristic() father$solutionType <- "PriorityList" extend(father,"PriorityList", priorityList = NULL) }) setMethodS3("DBsave","PriorityList", function(this,con=NULL,...) { NextMethod("DBsave",this,con) pl <- this$priorityList d...
##Assignment Caching the Inverse of a Matrix #make cache matrix #cachematrix.R ##set the value of the vector ##get the value of the vector ##set the value of the mean ##get the value of the mean ## This function creates a special matrix object that can chche its inverse makeCacheMatrix <- function(x = matrix()) { ...
/cachematrix.R
no_license
Alishagaba/ProgrammingAssignment2
R
false
false
995
r
##Assignment Caching the Inverse of a Matrix #make cache matrix #cachematrix.R ##set the value of the vector ##get the value of the vector ##set the value of the mean ##get the value of the mean ## This function creates a special matrix object that can chche its inverse makeCacheMatrix <- function(x = matrix()) { ...
suppressPackageStartupMessages( c( library(e1071), library(shiny), library(shinythemes), library(slam) )) shinyUI( fluidPage( theme = shinytheme("journal"), tabPanel("Next Word Prediction", fluidRow( ...
/ui.R
no_license
DataUrbanEconGeek/JHDSCapstone
R
false
false
3,464
r
suppressPackageStartupMessages( c( library(e1071), library(shiny), library(shinythemes), library(slam) )) shinyUI( fluidPage( theme = shinytheme("journal"), tabPanel("Next Word Prediction", fluidRow( ...
# Getting settings for as many of these as I can from the old framework # in files rdv.configuration.orig.R [abbreviated here as rco] and # rdv.extra.config.R [abbreviated here as rec]. cols rows pixel.size repetition reprsent.goal.scale.factor spp.hab.info.table.A.TOT spp.used.in.reserve.selection.vector num.obj...
/projects/rdvPackages/reserveselection/R/variables.R
no_license
langfob/rdv-framework-frozen-google-code-export-do-not-change
R
false
false
3,125
r
# Getting settings for as many of these as I can from the old framework # in files rdv.configuration.orig.R [abbreviated here as rco] and # rdv.extra.config.R [abbreviated here as rec]. cols rows pixel.size repetition reprsent.goal.scale.factor spp.hab.info.table.A.TOT spp.used.in.reserve.selection.vector num.obj...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/quadmesh-package.R \docType{data} \name{etopo} \alias{etopo} \title{World topography map} \description{ A simplified version of 'Etopo2'. The Etopo2 data set was reduced 20X to create this raster layer of global relief. See code in 'data-raw/...
/man/etopo.Rd
no_license
MilesMcBain/quadmesh
R
false
true
331
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/quadmesh-package.R \docType{data} \name{etopo} \alias{etopo} \title{World topography map} \description{ A simplified version of 'Etopo2'. The Etopo2 data set was reduced 20X to create this raster layer of global relief. See code in 'data-raw/...
## global variables for show method .g_wid <- options()$width; .g_decwid <- round(.g_wid*0.60) ## decorator width .g_decs <- paste(paste(rep("=", .g_decwid),collapse=""),"\n", sep="") ##--------------------## ## setter and getter ##--------------------## setMethod("actionTrack", "RTCAtimeline", function(object) { ob...
/R/AllMethods.R
no_license
Accio/RTCA
R
false
false
6,590
r
## global variables for show method .g_wid <- options()$width; .g_decwid <- round(.g_wid*0.60) ## decorator width .g_decs <- paste(paste(rep("=", .g_decwid),collapse=""),"\n", sep="") ##--------------------## ## setter and getter ##--------------------## setMethod("actionTrack", "RTCAtimeline", function(object) { ob...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/matrix.R \name{get_idf} \alias{get_idf} \title{Inverse document-frequency scaling matrix} \usage{ get_idf(dtm, log_scale = log, smooth_idf = TRUE) } \arguments{ \item{dtm}{a document-term matrix of class \code{dgCMatrix} or \code{dgTMatrix}.}...
/man/get_idf.Rd
permissive
kbenoit/text2vec
R
false
true
1,045
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/matrix.R \name{get_idf} \alias{get_idf} \title{Inverse document-frequency scaling matrix} \usage{ get_idf(dtm, log_scale = log, smooth_idf = TRUE) } \arguments{ \item{dtm}{a document-term matrix of class \code{dgCMatrix} or \code{dgTMatrix}.}...
#' Graphical User Interface to Check Images for Color Constriants #' #' A graphical user interface (GUI) to check an existing jpg/png image for (possible) #' color constraints. The image will be converted to protanope vision, deutanope vision, #' and a desaturated version (monochromatic vision). #' Allows a rapid check...
/colorspace/R/hcl_converter.R
no_license
docker-oilgains/clauswilke.dataviz.2018
R
false
false
5,458
r
#' Graphical User Interface to Check Images for Color Constriants #' #' A graphical user interface (GUI) to check an existing jpg/png image for (possible) #' color constraints. The image will be converted to protanope vision, deutanope vision, #' and a desaturated version (monochromatic vision). #' Allows a rapid check...
## Put comments here that give an overall description of what your ## functions do ## This function create a special matrix to: set and get the value the matrix, and set and get the value of the inverse matrix. makeCacheMatrix <- function(x = matrix()) { m <- NULL set <- function(y) { ...
/cachematrix.R
no_license
eleonorecrespo/ProgrammingAssignment2
R
false
false
1,272
r
## Put comments here that give an overall description of what your ## functions do ## This function create a special matrix to: set and get the value the matrix, and set and get the value of the inverse matrix. makeCacheMatrix <- function(x = matrix()) { m <- NULL set <- function(y) { ...
## The purpose of this assignment is to build a function that caches ## the inverse of a matrix, as a way to avoid time costly recalculation ## of the inverse matrix. ## This function creates a special "matrix" object that can cache ##its inverse. makeCacheMatrix <- function(x = matrix()) { inv <- NULL set <- fun...
/cachematrix.R
no_license
abraamgergis/ProgrammingAssignment2
R
false
false
1,023
r
## The purpose of this assignment is to build a function that caches ## the inverse of a matrix, as a way to avoid time costly recalculation ## of the inverse matrix. ## This function creates a special "matrix" object that can cache ##its inverse. makeCacheMatrix <- function(x = matrix()) { inv <- NULL set <- fun...
car_accident <- read.csv("car_accident.csv", fileEncoding="UTF-8") car_accident colnames(car_accident)[1] <- "index" car_accident car_accident$num_injury <- (car_accident$serious_injury + car_accident$minor_injury + car_accident$only_report) car_accident car_accident$category[order(car_accident$num_death, decreasing = ...
/quant2018/Assignment3.R
no_license
taehuA/forhandin
R
false
false
1,041
r
car_accident <- read.csv("car_accident.csv", fileEncoding="UTF-8") car_accident colnames(car_accident)[1] <- "index" car_accident car_accident$num_injury <- (car_accident$serious_injury + car_accident$minor_injury + car_accident$only_report) car_accident car_accident$category[order(car_accident$num_death, decreasing = ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/make_formulas.R \name{make_formulas} \alias{make_formulas} \title{Process formulas and store in nested list} \usage{ make_formulas(input_forms, var_names, par_names, n_states) } \arguments{ \item{input_forms}{Nested list of formulas, with two...
/man/make_formulas.Rd
no_license
Allisterh/hmmTMB
R
false
true
1,220
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/make_formulas.R \name{make_formulas} \alias{make_formulas} \title{Process formulas and store in nested list} \usage{ make_formulas(input_forms, var_names, par_names, n_states) } \arguments{ \item{input_forms}{Nested list of formulas, with two...
testlist <- list(b = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0...
/mcga/inst/testfiles/ByteVectorToDoubles/AFL_ByteVectorToDoubles/ByteVectorToDoubles_valgrind_files/1613098839-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
390
r
testlist <- list(b = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0...
library(redCohort) # Maximum number of cores to be used: maxCores <- parallel::detectCores() # The folder where the study intermediate and result files will be written: outputFolder <- "c:/REDCDM" # Details for connecting to the server: connectionDetails <- DatabaseConnector::createConnectionDetails( ...
/extras/CodeToRun.R
permissive
QSB-yuhs/RedCohort
R
false
false
2,004
r
library(redCohort) # Maximum number of cores to be used: maxCores <- parallel::detectCores() # The folder where the study intermediate and result files will be written: outputFolder <- "c:/REDCDM" # Details for connecting to the server: connectionDetails <- DatabaseConnector::createConnectionDetails( ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{transform_dates} \alias{transform_dates} \title{lapply transformation of dates using mutate_excel_date} \usage{ transform_dates(mgt) } \arguments{ \item{mgt}{crop management sheet or table} } \description{ Transformation of date...
/man/transform_dates.Rd
permissive
CIP-RIU/traittools
R
false
true
334
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{transform_dates} \alias{transform_dates} \title{lapply transformation of dates using mutate_excel_date} \usage{ transform_dates(mgt) } \arguments{ \item{mgt}{crop management sheet or table} } \description{ Transformation of date...
#' @title classifica Classe DAP #' @description the center of the class that the DAP belongs. #' @param dfClassesDAP a frequency distribution with the attributes $classe and $centro #' @param dap integer Diameter at breast height #' @examples #' dados <- c(1,2,3,4) #' dados = defineClasses2(dados,2) #' classific...
/Fgmutils/R/classificaClasseDAP.R
no_license
ingted/R-Examples
R
false
false
655
r
#' @title classifica Classe DAP #' @description the center of the class that the DAP belongs. #' @param dfClassesDAP a frequency distribution with the attributes $classe and $centro #' @param dap integer Diameter at breast height #' @examples #' dados <- c(1,2,3,4) #' dados = defineClasses2(dados,2) #' classific...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hkmeans.R \name{hkmeans} \alias{hkmeans} \alias{hkmeans_tree} \alias{print.hkmeans} \title{Hierarchical k-means clustering} \usage{ hkmeans(x, k, hc.metric = "euclidean", hc.method = "ward.D2", iter.max = 10, km.algorithm = "Hartigan-Wong")...
/man/hkmeans.Rd
no_license
lioutasb/factoextra
R
false
true
2,763
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hkmeans.R \name{hkmeans} \alias{hkmeans} \alias{hkmeans_tree} \alias{print.hkmeans} \title{Hierarchical k-means clustering} \usage{ hkmeans(x, k, hc.metric = "euclidean", hc.method = "ward.D2", iter.max = 10, km.algorithm = "Hartigan-Wong")...
cces <- cces %>% mutate(abc_12 = recode(cces$religpew_baptist_12, "2=1; 4=1; else=0")) cces <- cces %>% mutate(epis_12 = recode(cces$religpew_episcop_12, "1:90=1; else=0")) cces <- cces %>% mutate(luth_12 = recode(cces$religpew_lutheran_12, "1=1; 4=1; else=0")) cces <- cces %>% mutate(meth_12 = recode(c...
/mainline12.R
no_license
ryanburge/cces_panel
R
false
false
927
r
cces <- cces %>% mutate(abc_12 = recode(cces$religpew_baptist_12, "2=1; 4=1; else=0")) cces <- cces %>% mutate(epis_12 = recode(cces$religpew_episcop_12, "1:90=1; else=0")) cces <- cces %>% mutate(luth_12 = recode(cces$religpew_lutheran_12, "1=1; 4=1; else=0")) cces <- cces %>% mutate(meth_12 = recode(c...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/textify.R \name{grouper} \alias{grouper} \title{created centered multi-column grouped labels with approporiate underlining} \usage{ grouper(gl_vector, col_widths) } \description{ created centered multi-column grouped labels with approporiate ...
/man/grouper.Rd
permissive
bdempe18/rchitex
R
false
true
334
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/textify.R \name{grouper} \alias{grouper} \title{created centered multi-column grouped labels with approporiate underlining} \usage{ grouper(gl_vector, col_widths) } \description{ created centered multi-column grouped labels with approporiate ...
library("GenomicRanges") flank_distance <- 400 positive_genomic_overlaps <- findOverlaps(snp_ranges,alu_positive,ignore.strand=TRUE) negative_genomic_overlaps <- findOverlaps(snp_ranges,alu_negative,ignore.strand=TRUE) positive_distance <- cbind.data.frame(alu_family=alu_positive$alufamily[subjectHits(positive_genomic_...
/scripts/snp_freq_within.R
no_license
mglubber/snp_bias
R
false
false
949
r
library("GenomicRanges") flank_distance <- 400 positive_genomic_overlaps <- findOverlaps(snp_ranges,alu_positive,ignore.strand=TRUE) negative_genomic_overlaps <- findOverlaps(snp_ranges,alu_negative,ignore.strand=TRUE) positive_distance <- cbind.data.frame(alu_family=alu_positive$alufamily[subjectHits(positive_genomic_...
\name{ggplot} \alias{ggplot} \title{Create a new ggplot plot} \usage{ ggplot(data = NULL, ...) } \arguments{ \item{data}{default data set} \item{...}{other arguments passed to specific methods} } \description{ Create a new ggplot plot } \seealso{ \url{http://had.co.nz/ggplot2} } \keyword{internal}
/man/ggplot.Rd
no_license
briandk/ggplot2
R
false
false
311
rd
\name{ggplot} \alias{ggplot} \title{Create a new ggplot plot} \usage{ ggplot(data = NULL, ...) } \arguments{ \item{data}{default data set} \item{...}{other arguments passed to specific methods} } \description{ Create a new ggplot plot } \seealso{ \url{http://had.co.nz/ggplot2} } \keyword{internal}
############################################################################## # Copyright (c) 2012-2017 Russell V. Lenth # # # # This file is part of the emmeans package for R (*emmeans*) # # ...
/R/plot.emm.R
no_license
karthy257/emmeans
R
false
false
22,910
r
############################################################################## # Copyright (c) 2012-2017 Russell V. Lenth # # # # This file is part of the emmeans package for R (*emmeans*) # # ...
#### Necessary Librarie #### library(readxl) library(mFilter) #### Reading Excel Data #### my_data <- read_excel("Data.xlsx") #### Converting it to quarterly time series data ts <- ts(my_data$Close, frequency = 4) #### Plotting it to observe #### plot(ts, main = "Honeywell Quarterly Stock Data") #### creating fu...
/Decision Making with Non-Linear Programming Analysis/Module_6_Non_Linear_Programming_Hodrick_Filter_Mustafa_Abdullayev_R_Part_2.R.R
no_license
abdulmusto/R-Projects
R
false
false
505
r
#### Necessary Librarie #### library(readxl) library(mFilter) #### Reading Excel Data #### my_data <- read_excel("Data.xlsx") #### Converting it to quarterly time series data ts <- ts(my_data$Close, frequency = 4) #### Plotting it to observe #### plot(ts, main = "Honeywell Quarterly Stock Data") #### creating fu...
library(sensiPhy) ### Name: samp_continuous ### Title: Species Sampling uncertainty - Trait Evolution Continuous ### Characters ### Aliases: samp_continuous ### ** Examples ## Don't show: #Load data: data("primates") #Model trait evolution accounting for phylogenetic uncertainty adultMass<-primates$data$adultMas...
/data/genthat_extracted_code/sensiPhy/examples/samp_continuous.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
1,449
r
library(sensiPhy) ### Name: samp_continuous ### Title: Species Sampling uncertainty - Trait Evolution Continuous ### Characters ### Aliases: samp_continuous ### ** Examples ## Don't show: #Load data: data("primates") #Model trait evolution accounting for phylogenetic uncertainty adultMass<-primates$data$adultMas...
#' @name plotRRNAMappingRate #' @author Michael Steinbaugh, Rory Kirchner, Victor Barrera #' @inherit bioverbs::plotRRNAMappingRate #' @note Updated 2019-09-16. #' #' @inheritParams acidroxygen::params #' @param ... Additional arguments. #' #' @examples #' data(bcb) #' plotRRNAMappingRate(bcb) NULL #' @rdname plotRR...
/R/plotRRNAMappingRate-methods.R
permissive
tauqeer9/bcbioRNASeq
R
false
false
3,387
r
#' @name plotRRNAMappingRate #' @author Michael Steinbaugh, Rory Kirchner, Victor Barrera #' @inherit bioverbs::plotRRNAMappingRate #' @note Updated 2019-09-16. #' #' @inheritParams acidroxygen::params #' @param ... Additional arguments. #' #' @examples #' data(bcb) #' plotRRNAMappingRate(bcb) NULL #' @rdname plotRR...
library(hmmm) ### Name: summary.hmmmmod ### Title: summary and print for the class hmmmmod ### Aliases: summary.hmmmmod print.hmmmmod ### Keywords: package ### ** Examples marginals<-marg.list(c("g-m","m-l","g-l"),mflag="m") model<-hmmm.model(marg=marginals,lev=c(3,7),names=c("A","B")) summary(model) # or print(mod...
/data/genthat_extracted_code/hmmm/examples/summary.hmmmmod.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
326
r
library(hmmm) ### Name: summary.hmmmmod ### Title: summary and print for the class hmmmmod ### Aliases: summary.hmmmmod print.hmmmmod ### Keywords: package ### ** Examples marginals<-marg.list(c("g-m","m-l","g-l"),mflag="m") model<-hmmm.model(marg=marginals,lev=c(3,7),names=c("A","B")) summary(model) # or print(mod...
# global data get once Pop <- readRDS("data/pop.rds") # To avoid problems with changing datafile names from worldbank, I have will read a prepared RDS file. # the code for getting the data is commented out and given at the end of this file (commented out) # Download worldbank population since 1950 dataset fro...
/global.R
no_license
vanni1/DataProductsWeek4
R
false
false
1,130
r
# global data get once Pop <- readRDS("data/pop.rds") # To avoid problems with changing datafile names from worldbank, I have will read a prepared RDS file. # the code for getting the data is commented out and given at the end of this file (commented out) # Download worldbank population since 1950 dataset fro...
tmp1 <- read.table("train/X_train.txt") tmp2 <- read.table("test/X_test.txt") X <- rbind(tmp1, tmp2) tmp1 <- read.table("train/subject_train.txt") tmp2 <- read.table("test/subject_test.txt") S <- rbind(tmp1, tmp2) tmp1 <- read.table("train/y_train.txt") tmp2 <- read.table("test/y_test.txt") Y <- rbind(tmp1, tmp2) #...
/run_analysis.R
no_license
Mickwen/Cleaning-Data-Course-Project
R
false
false
1,757
r
tmp1 <- read.table("train/X_train.txt") tmp2 <- read.table("test/X_test.txt") X <- rbind(tmp1, tmp2) tmp1 <- read.table("train/subject_train.txt") tmp2 <- read.table("test/subject_test.txt") S <- rbind(tmp1, tmp2) tmp1 <- read.table("train/y_train.txt") tmp2 <- read.table("test/y_test.txt") Y <- rbind(tmp1, tmp2) #...
\name{bpec.contourPlot} \encoding{ISO-8859-1} \Rdversion{1.1} \alias{bpec.contourPlot} \title{Plot contours of inferred clusters on geographical map} \description{Plots the contours for a set of population clusters, adding points for sampling locations, with larger points representing inferred ancestral locations. Assu...
/man/bpec.contourPlot.Rd
no_license
cran/BPEC
R
false
false
3,843
rd
\name{bpec.contourPlot} \encoding{ISO-8859-1} \Rdversion{1.1} \alias{bpec.contourPlot} \title{Plot contours of inferred clusters on geographical map} \description{Plots the contours for a set of population clusters, adding points for sampling locations, with larger points representing inferred ancestral locations. Assu...
# clear workspace rm(list=ls()) set.seed(19) setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) #load packages library(network) #load in data ### Read in data load("../../main/main_net.Rdata") load("../../main/main_cov.Rdata") # drop EU countries. 25 countries EU <- c("Austria","Belgium","Bulgaria", "Cypr...
/Code/supplementary/Omit_EU/EU_ergm_prep.R
no_license
desmarais-lab/FDI_IGERT_H
R
false
false
990
r
# clear workspace rm(list=ls()) set.seed(19) setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) #load packages library(network) #load in data ### Read in data load("../../main/main_net.Rdata") load("../../main/main_cov.Rdata") # drop EU countries. 25 countries EU <- c("Austria","Belgium","Bulgaria", "Cypr...
# # 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) # Define UI for application that draws a histogram ui <- fluidPage( navbarPage("First Shiny Pl...
/Section-10-01/app.R
no_license
neloyshome/Section-10-01
R
false
false
2,477
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) # Define UI for application that draws a histogram ui <- fluidPage( navbarPage("First Shiny Pl...
#synthesize delta H values (min, median, max, mean delta H for each metric) for southern CA data #read in delta H data #original run #OLD: deltaH <- read.csv("L:/San Juan WQIP_KTQ/Data/Working/Regional_Curves_CSCI_ASCI_Annie/Data/Flow/subset_woutLARsitematches/DeltaH/FFMS_deltaH_original/FFMS_deltaH_all_class.csv...
/deltaH_summary_csci_asci_data.R
no_license
SCCWRP/SOC_FESS
R
false
false
12,519
r
#synthesize delta H values (min, median, max, mean delta H for each metric) for southern CA data #read in delta H data #original run #OLD: deltaH <- read.csv("L:/San Juan WQIP_KTQ/Data/Working/Regional_Curves_CSCI_ASCI_Annie/Data/Flow/subset_woutLARsitematches/DeltaH/FFMS_deltaH_original/FFMS_deltaH_all_class.csv...
fit_glm <- function(data) { X <- data$X_1 y <- data$y_1 data_frame <- data.frame(y = y) data_frame <- cbind(data_frame, as.data.frame(X)) model <- lm(y ~ ., data = data_frame) return(model) } fit_target_glm <- function(data) { set.seed(9999) X <- data$X_2 y <- data$y_2 data_fram...
/R/glm.R
no_license
diego-s/reproducing_sugiyama_2007
R
false
false
2,717
r
fit_glm <- function(data) { X <- data$X_1 y <- data$y_1 data_frame <- data.frame(y = y) data_frame <- cbind(data_frame, as.data.frame(X)) model <- lm(y ~ ., data = data_frame) return(model) } fit_target_glm <- function(data) { set.seed(9999) X <- data$X_2 y <- data$y_2 data_fram...
# required_data(c("STG_CYCLER", "STG_TRACK")) #AWS docker IMAGE PITÄÄ REBUILDAA, ETTÄ TOIMII PILVESSÄ. source("global.R") #kaadu global_dont_multicore <<- FALSE con <- connDB(con, "flaimme") required_data(c("STG_TEAM","ADM_CYCLER_INFO", "ADM_CYCLER_DECK", "ADM_OPTIMAL_MOVES", "STG_TRACK", "SRC_TRACK", "SRC_TRACK_P...
/scripts/solution/main.R
no_license
Laurigit/flAImme
R
false
false
23,174
r
# required_data(c("STG_CYCLER", "STG_TRACK")) #AWS docker IMAGE PITÄÄ REBUILDAA, ETTÄ TOIMII PILVESSÄ. source("global.R") #kaadu global_dont_multicore <<- FALSE con <- connDB(con, "flaimme") required_data(c("STG_TEAM","ADM_CYCLER_INFO", "ADM_CYCLER_DECK", "ADM_OPTIMAL_MOVES", "STG_TRACK", "SRC_TRACK", "SRC_TRACK_P...
#' `geodimension` S3 class #' #' Internal low-level constructor that creates new objects with the correct #' structure. #' #' @param name A string, name of the dimension. #' @param level A `geolevel`. #' #' @return A `geodimension` object. #' #' @keywords internal new_geodimension <- function(name = NULL, ...
/R/geodimension.R
permissive
josesamos/geodimension
R
false
false
2,776
r
#' `geodimension` S3 class #' #' Internal low-level constructor that creates new objects with the correct #' structure. #' #' @param name A string, name of the dimension. #' @param level A `geolevel`. #' #' @return A `geodimension` object. #' #' @keywords internal new_geodimension <- function(name = NULL, ...
housePC_data <- read.table("household_power_consumption.txt", header=TRUE, sep=";", stringsAsFactors=FALSE, dec=".") Datesubset <- housePC_data[housePC_data$Date %in% c("1/2/2007","2/2/2007") ,] datetime <- strptime(paste(Datesubset$Date, Datesubset$Time, sep=" "), "%d/%m/%Y %H:%M:%S") globalActivePower <- as.num...
/plot2.R
no_license
ProOsama/ExData_Plotting1
R
false
false
506
r
housePC_data <- read.table("household_power_consumption.txt", header=TRUE, sep=";", stringsAsFactors=FALSE, dec=".") Datesubset <- housePC_data[housePC_data$Date %in% c("1/2/2007","2/2/2007") ,] datetime <- strptime(paste(Datesubset$Date, Datesubset$Time, sep=" "), "%d/%m/%Y %H:%M:%S") globalActivePower <- as.num...