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
#### Accuracy assessment by Sam #### # need to be rewritten to be more generalized applicable install.packages("raster") install.packages("rgdal") library(raster) library(rgdal) ### build confusion matrix based on own classification setwd("path_to_working_directory") classif_res<-raster("classificatio...
/accuracy_assessment.R
no_license
LSFE/R_scripts
R
false
false
2,520
r
#### Accuracy assessment by Sam #### # need to be rewritten to be more generalized applicable install.packages("raster") install.packages("rgdal") library(raster) library(rgdal) ### build confusion matrix based on own classification setwd("path_to_working_directory") classif_res<-raster("classificatio...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/eval-tidy.R \docType{data} \name{tidyeval-data} \alias{tidyeval-data} \alias{.data} \alias{.env} \title{Data pronouns for tidy evaluation} \usage{ .data .env } \description{ These pronouns allow you to be explicit about where to find objects...
/man/tidyeval-data.Rd
permissive
egnha/rlang
R
false
true
2,041
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/eval-tidy.R \docType{data} \name{tidyeval-data} \alias{tidyeval-data} \alias{.data} \alias{.env} \title{Data pronouns for tidy evaluation} \usage{ .data .env } \description{ These pronouns allow you to be explicit about where to find objects...
filter_for_groups <- function( grouped_data, group_var = 'cell_type', groups = c('fibroblast', 'cancer'), FUN = mean, n_req = 1, to_keep = c('SNAI1', 'SNAI2', 'TWIST1', 'VIM', 'ZEB1', 'ZEB2') ) { # grouped_data should consist of columns whose 'sizes' we want to measure and compare between g...
/sc_functions.R
no_license
m20ty/decoupling_emt_stroma
R
false
false
54,296
r
filter_for_groups <- function( grouped_data, group_var = 'cell_type', groups = c('fibroblast', 'cancer'), FUN = mean, n_req = 1, to_keep = c('SNAI1', 'SNAI2', 'TWIST1', 'VIM', 'ZEB1', 'ZEB2') ) { # grouped_data should consist of columns whose 'sizes' we want to measure and compare between g...
## #============================================================================= ## FUN.Pformula calls FUN.with.trans ## ## Takes: fomula = a formula-object ## effect = character-object ("none", "time", "individual", "twoways") ## ## Gives: A List with P+1 components ## (first for depend. variabl...
/phtt/R/FUN.Pformula.R
no_license
ingted/R-Examples
R
false
false
3,556
r
## #============================================================================= ## FUN.Pformula calls FUN.with.trans ## ## Takes: fomula = a formula-object ## effect = character-object ("none", "time", "individual", "twoways") ## ## Gives: A List with P+1 components ## (first for depend. variabl...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mpspline.R \name{mpspline_fit1} \alias{mpspline_fit1} \title{Fit spline parameters} \usage{ mpspline_fit1( s = NULL, p = NULL, var_name = NULL, d = NULL, vhigh = NULL, vlow = NULL ) } \arguments{ \item{s}{data.frame; data for one ...
/man/mpspline_fit1.Rd
no_license
obrl-soil/mpspline2
R
false
true
1,296
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mpspline.R \name{mpspline_fit1} \alias{mpspline_fit1} \title{Fit spline parameters} \usage{ mpspline_fit1( s = NULL, p = NULL, var_name = NULL, d = NULL, vhigh = NULL, vlow = NULL ) } \arguments{ \item{s}{data.frame; data for one ...
## This functions makes an special Matrix, with 4 functions ## the functions works for caching the inverse matrix ## result, the makeCacheMatrix returns a List with the 4 ## functions, and the cacheSolve does the Matrix Inverse ## computation ## makeCacheMatrix returns a list with 4 functions ## to manipulate the ma...
/cachematrix.R
no_license
shreig/ProgrammingAssignment2
R
false
false
1,118
r
## This functions makes an special Matrix, with 4 functions ## the functions works for caching the inverse matrix ## result, the makeCacheMatrix returns a List with the 4 ## functions, and the cacheSolve does the Matrix Inverse ## computation ## makeCacheMatrix returns a list with 4 functions ## to manipulate the ma...
GetFixedPar_Uni <- function(Dist, GASPar) { FixedPar = NULL if (Dist == "norm") { if (!GASPar$location) FixedPar = c(FixedPar, a1 = 0, b1 = 0) if (!GASPar$scale) FixedPar = c(FixedPar, a2 = 0, b2 = 0) } if (Dist == "snorm") { if (!GASPar$location) ...
/R/ParameterConstraints.R
no_license
HanjoStudy/GAS
R
false
false
6,296
r
GetFixedPar_Uni <- function(Dist, GASPar) { FixedPar = NULL if (Dist == "norm") { if (!GASPar$location) FixedPar = c(FixedPar, a1 = 0, b1 = 0) if (!GASPar$scale) FixedPar = c(FixedPar, a2 = 0, b2 = 0) } if (Dist == "snorm") { if (!GASPar$location) ...
library(glmnet) mydata = read.table("../../../../TrainingSet/FullSet/ReliefF/ovary.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="mae",alpha=0.01,family="gaussian",standardize=FALSE) sink('./ovary_008.txt',append=TRUE) prin...
/Model/EN/ReliefF/ovary/ovary_008.R
no_license
esbgkannan/QSMART
R
false
false
345
r
library(glmnet) mydata = read.table("../../../../TrainingSet/FullSet/ReliefF/ovary.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="mae",alpha=0.01,family="gaussian",standardize=FALSE) sink('./ovary_008.txt',append=TRUE) prin...
#Carrega as bases # NEI <- readRDS("summarySCC_PM25.rds") # SCC <- readRDS("Source_Classification_Code.rds") Baltimore <- c() years <- c(1999, 2008) for (i in years){ Baltimore <- append(Baltimore, sum(NEI[NEI$fips==24510 & NEI$year==i,"Emissions"]))...
/plot2.R
no_license
andrekahirata/ExData_Plotting2
R
false
false
481
r
#Carrega as bases # NEI <- readRDS("summarySCC_PM25.rds") # SCC <- readRDS("Source_Classification_Code.rds") Baltimore <- c() years <- c(1999, 2008) for (i in years){ Baltimore <- append(Baltimore, sum(NEI[NEI$fips==24510 & NEI$year==i,"Emissions"]))...
#' trim_ts #' #' @param x Data from ts_filter. #' @param group Name of grouping variable. Default (NULL) will use #' variable of grouped data frames or look for variables labelled #' "group" or "filter". Set this to FALSE to override these defaults. #' @return Trimmed data frame #' @export trim_ts <- function(x, g...
/R/utils.R
no_license
dmbeskow/rtweet
R
false
false
3,519
r
#' trim_ts #' #' @param x Data from ts_filter. #' @param group Name of grouping variable. Default (NULL) will use #' variable of grouped data frames or look for variables labelled #' "group" or "filter". Set this to FALSE to override these defaults. #' @return Trimmed data frame #' @export trim_ts <- function(x, g...
install.packages("plyr") library(plyr) setwd("C:/Users/mkim2/Downloads/UCI HAR Dataset") # Read in the data and merging both files into one subjectTest = read.table('./test/subject_test.txt',header=FALSE) xTest = read.table('./test/x_test.txt',header=FALSE) yTest = read.table('./test/y_test.txt',header=FA...
/run_analysis.R
no_license
kjdaddy47/CourseProject_Getting-and-Cleaning-Data
R
false
false
1,491
r
install.packages("plyr") library(plyr) setwd("C:/Users/mkim2/Downloads/UCI HAR Dataset") # Read in the data and merging both files into one subjectTest = read.table('./test/subject_test.txt',header=FALSE) xTest = read.table('./test/x_test.txt',header=FALSE) yTest = read.table('./test/y_test.txt',header=FA...
rm(list=ls(all=TRUE)) library(devtools) # install and load defined list of packages ipak <- function(pkg){ new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] if (length(new.pkg)) install.packages(new.pkg, dependencies = TRUE,repos = "http://cran.us.r-project.org") sapply(pkg, require, character.o...
/NA_QUASS_script.R
no_license
albertostefanelli/QUASS_network_analysis_exam
R
false
false
25,091
r
rm(list=ls(all=TRUE)) library(devtools) # install and load defined list of packages ipak <- function(pkg){ new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] if (length(new.pkg)) install.packages(new.pkg, dependencies = TRUE,repos = "http://cran.us.r-project.org") sapply(pkg, require, character.o...
\name{Finhom} \alias{Finhom} \title{ Inhomogeneous Empty Space Function } \description{ Estimates the inhomogeneous empty space function of a non-stationary point pattern. } \usage{ Finhom(X, lambda = NULL, lmin = NULL, ..., sigma = NULL, varcov = NULL, r = NULL, breaks = NULL, ratio = FALSE, up...
/man/Finhom.Rd
no_license
kasselhingee/spatstat
R
false
false
6,378
rd
\name{Finhom} \alias{Finhom} \title{ Inhomogeneous Empty Space Function } \description{ Estimates the inhomogeneous empty space function of a non-stationary point pattern. } \usage{ Finhom(X, lambda = NULL, lmin = NULL, ..., sigma = NULL, varcov = NULL, r = NULL, breaks = NULL, ratio = FALSE, up...
usePackage <- function(p) { if (!is.element(p, installed.packages()[,1])) install.packages(p, dep = TRUE, repos = "https://cran.itam.mx/") require(p, character.only = TRUE) } # usePackage('tidyverse') # usePackage('shiny') # usePackage('shiny.semantic') # usePackage('semantic.dashboard') # usePackage(...
/app.R
permissive
salvadormarmol/shiny-developer-test
R
false
false
7,377
r
usePackage <- function(p) { if (!is.element(p, installed.packages()[,1])) install.packages(p, dep = TRUE, repos = "https://cran.itam.mx/") require(p, character.only = TRUE) } # usePackage('tidyverse') # usePackage('shiny') # usePackage('shiny.semantic') # usePackage('semantic.dashboard') # usePackage(...
#' A object of NJtree painter #' #' @import reshape2 reshape ape ggplot2 deconstructSigs RColorBrewer #' #' @param maf MAF object #' @return NJtree plot (phylogenetic tree and heatmap) #' #' @examples #' maf <- read.Maf("311252",dat.dir = './data/multi_lesion', BSG = "BSgenome.Hsapiens.UCSC.hg19") #' plot.N...
/R/plot.NJtree.R
no_license
zorrodong/MesKit
R
false
false
24,890
r
#' A object of NJtree painter #' #' @import reshape2 reshape ape ggplot2 deconstructSigs RColorBrewer #' #' @param maf MAF object #' @return NJtree plot (phylogenetic tree and heatmap) #' #' @examples #' maf <- read.Maf("311252",dat.dir = './data/multi_lesion', BSG = "BSgenome.Hsapiens.UCSC.hg19") #' plot.N...
######################################### ### Results section "Milwaukee wastewater ### seasonality is supported spatially ### across the United States" ### Lou LaMartina, finalized Mar 19, 2020 ######################################### setwd("~/Desktop/TimeSeries_final") library(phyloseq) library(ggplot2) library(...
/Code/TimeSeries7_results5_Spatial.R
no_license
NewtonLabUWM/Sewage_TimeSeries
R
false
false
22,589
r
######################################### ### Results section "Milwaukee wastewater ### seasonality is supported spatially ### across the United States" ### Lou LaMartina, finalized Mar 19, 2020 ######################################### setwd("~/Desktop/TimeSeries_final") library(phyloseq) library(ggplot2) library(...
#!/usr/bin/env Rscript # Copyright by Daniel Loos # # Research Group Systems Biology and Bioinformatics - Head: Assoc. Prof. Dr. Gianni Panagiotou # https://www.leibniz-hki.de/en/systembiologie-und-bioinformatik.html # Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI) # ...
/back_end/scripts/file_checksums.R
permissive
danlooo/DAnIEL
R
false
false
1,632
r
#!/usr/bin/env Rscript # Copyright by Daniel Loos # # Research Group Systems Biology and Bioinformatics - Head: Assoc. Prof. Dr. Gianni Panagiotou # https://www.leibniz-hki.de/en/systembiologie-und-bioinformatik.html # Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI) # ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/self_similarity_metrics.R \name{fs_cd} \alias{fs_cd} \title{CD (R2) from lm} \usage{ fs_cd(two_fs) } \arguments{ \item{two_fs}{wide dataframe or matrix: 2 rows, nspp columns} } \value{ cd (R2) from lm() } \description{ CD (R2) from lm }
/man/fs_cd.Rd
permissive
diazrenata/scadsanalysis
R
false
true
315
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/self_similarity_metrics.R \name{fs_cd} \alias{fs_cd} \title{CD (R2) from lm} \usage{ fs_cd(two_fs) } \arguments{ \item{two_fs}{wide dataframe or matrix: 2 rows, nspp columns} } \value{ cd (R2) from lm() } \description{ CD (R2) from lm }
#' ggplot2 mapping #' #' @export #' @template args #' @param map (character) One of world, world2, state, usa, county, france, #' italy, or nz #' @param color Default color of your points. #' @param size point size, Default: 3 #' @param point_color Default color of your points. Deprecated, use #' `color` #' @param name...
/R/map_ggplot.R
permissive
corersky/mapr
R
false
false
5,924
r
#' ggplot2 mapping #' #' @export #' @template args #' @param map (character) One of world, world2, state, usa, county, france, #' italy, or nz #' @param color Default color of your points. #' @param size point size, Default: 3 #' @param point_color Default color of your points. Deprecated, use #' `color` #' @param name...
library(pacman) ### Name: p_vignette ### Title: View Package Vignette(s) ### Aliases: p_vignette p_vign ### Keywords: package vignette ### ** Examples ## Not run: ##D p_vignette(interactive = FALSE) ##D p_vignette() ##D p_vign() ##D p_vign(pacman) ##D p_vign(grid, utils) ##D p_vign(grid, utils, interactive = FALSE...
/data/genthat_extracted_code/pacman/examples/p_vignette.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
362
r
library(pacman) ### Name: p_vignette ### Title: View Package Vignette(s) ### Aliases: p_vignette p_vign ### Keywords: package vignette ### ** Examples ## Not run: ##D p_vignette(interactive = FALSE) ##D p_vignette() ##D p_vign() ##D p_vign(pacman) ##D p_vign(grid, utils) ##D p_vign(grid, utils, interactive = FALSE...
library(data.table) library(dplyr) # read training data X_train <- read.table("./UCI HAR Dataset/train/X_train.txt") y_train <- read.table("./UCI HAR Dataset/train/y_train.txt") subject_train <- read.table("./UCI HAR Dataset/train/subject_train.txt") # read test data X_test <- read.table("./UCI HAR Datas...
/run_analysis.R
no_license
Muthusigappi/Getting-and-Cleaning-Data
R
false
false
1,858
r
library(data.table) library(dplyr) # read training data X_train <- read.table("./UCI HAR Dataset/train/X_train.txt") y_train <- read.table("./UCI HAR Dataset/train/y_train.txt") subject_train <- read.table("./UCI HAR Dataset/train/subject_train.txt") # read test data X_test <- read.table("./UCI HAR Datas...
context("Test non-exported functions") current_R_version <- gsub("R version ([0-9.]+) .+$", "\\1", R.version.string) ## test .choose_possible_alpha ## test_that("test: .choose_possible_alpha", { ## skip on CRAN skip_on_cran() ## get data ans1 <- outbreaker2:::.choose_possible_alpha(1:10, 1) ans2 <- outbrea...
/tests/testthat/test_non_exported.R
no_license
finlaycampbell/outbreaker2
R
false
false
7,506
r
context("Test non-exported functions") current_R_version <- gsub("R version ([0-9.]+) .+$", "\\1", R.version.string) ## test .choose_possible_alpha ## test_that("test: .choose_possible_alpha", { ## skip on CRAN skip_on_cran() ## get data ans1 <- outbreaker2:::.choose_possible_alpha(1:10, 1) ans2 <- outbrea...
#' @param edge A matrix with two columns, with each row listing the parent and #' child node of an edge in a phylogenetic tree. Property `edge` of objects #' of class `phylo`.
/man-roxygen/edgeParam.R
no_license
ms609/TreeTools
R
false
false
177
r
#' @param edge A matrix with two columns, with each row listing the parent and #' child node of an edge in a phylogenetic tree. Property `edge` of objects #' of class `phylo`.
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/getSentiment.R \name{getSentiment} \alias{getSentiment} \title{Send text to Microsoft Cognitive Services' Sentiment API} \usage{ getSentiment(textdf, apikey = NULL, cogapi = NULL) } \arguments{ \item{textdf}{A data.frame consisting of two col...
/man/getSentiment.Rd
no_license
lockedata/TextAnalysis
R
false
true
754
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/getSentiment.R \name{getSentiment} \alias{getSentiment} \title{Send text to Microsoft Cognitive Services' Sentiment API} \usage{ getSentiment(textdf, apikey = NULL, cogapi = NULL) } \arguments{ \item{textdf}{A data.frame consisting of two col...
#' Plot prediction graph for mvr model #' #' Plot prediction graph using pls package's `predplot` function but with ability #' to add statistical labeling #' #' @param mvr mvr object (pls model) #' @param ncomp number of component #' @param location legend position #' @param show select statistics to show #' @param ...
/R/plsplot.R
no_license
chengvt/cheng
R
false
false
4,396
r
#' Plot prediction graph for mvr model #' #' Plot prediction graph using pls package's `predplot` function but with ability #' to add statistical labeling #' #' @param mvr mvr object (pls model) #' @param ncomp number of component #' @param location legend position #' @param show select statistics to show #' @param ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/a2pr.R \name{a2pr} \alias{a2pr} \title{Pitch and roll from acceleration} \usage{ a2pr(A, sampling_rate = NULL, fc = NULL) } \arguments{ \item{A}{An nx3 acceleration matrix with columns [ax ay az] or acceleration sensor list (e.g., from readta...
/R/tagtools/man/a2pr.Rd
no_license
FlukeAndFeather/TagTools
R
false
true
2,267
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/a2pr.R \name{a2pr} \alias{a2pr} \title{Pitch and roll from acceleration} \usage{ a2pr(A, sampling_rate = NULL, fc = NULL) } \arguments{ \item{A}{An nx3 acceleration matrix with columns [ax ay az] or acceleration sensor list (e.g., from readta...
# library(plyr) # library(dplyr) # try
/test.R
no_license
galabananana/hellofresh
R
false
false
39
r
# library(plyr) # library(dplyr) # try
#' @export #' #' @title Trend for Binary Outcomes from Complex Survey Designs #' #' @description \code{TrendNPS_Binary} fits trend models of binary outcomes for #' four approaches: #' #' \enumerate{ \item the unreplicated generalized linear mixed model with #' variance components as specified by Piepho an...
/R/TrendNPS_Binary.R
no_license
LAStarcevich/TrendNPS
R
false
false
22,776
r
#' @export #' #' @title Trend for Binary Outcomes from Complex Survey Designs #' #' @description \code{TrendNPS_Binary} fits trend models of binary outcomes for #' four approaches: #' #' \enumerate{ \item the unreplicated generalized linear mixed model with #' variance components as specified by Piepho an...
# plots 'green + UV-green' Green_Temp <- ggplot(green_glm_quasibinom3, aes_string(x = names(green_glm_quasibinom3$model)[3], y = Percent_green )) + geom_ribbon(stat = "smooth", method = "glm", method.args = list(family = "quasibinomial"), fill="azure2") + stat_smooth(method = "g...
/Scripts/Export_plots.R
no_license
vcabon/FloralTraitsUrbanisation
R
false
false
6,924
r
# plots 'green + UV-green' Green_Temp <- ggplot(green_glm_quasibinom3, aes_string(x = names(green_glm_quasibinom3$model)[3], y = Percent_green )) + geom_ribbon(stat = "smooth", method = "glm", method.args = list(family = "quasibinomial"), fill="azure2") + stat_smooth(method = "g...
# This file is a part of the soRvi program (http://louhos.github.com/sorvi/) # Copyright (C) 2010-2012 Louhos <louhos.github.com>. All rights reserved. # This program is open source software; you can redistribute it and/or modify # it under the terms of the FreeBSD License (keep this notice): # http://en.wikipedia....
/R/get.province.info.R
permissive
hyvonen/soRvi-dev
R
false
false
9,902
r
# This file is a part of the soRvi program (http://louhos.github.com/sorvi/) # Copyright (C) 2010-2012 Louhos <louhos.github.com>. All rights reserved. # This program is open source software; you can redistribute it and/or modify # it under the terms of the FreeBSD License (keep this notice): # http://en.wikipedia....
# load packages ----------------------------------------------------------- library(lme4) library(lmerTest) library(emmeans) library(ltm) #to compute cronbachs alpha library(sjPlot) library(patchwork) library(paletti) library(tidyverse) # load data --------------------------------------------------------------- ## ses...
/behavioral_analysis.R
no_license
IMC-Lab/conCFT
R
false
false
13,248
r
# load packages ----------------------------------------------------------- library(lme4) library(lmerTest) library(emmeans) library(ltm) #to compute cronbachs alpha library(sjPlot) library(patchwork) library(paletti) library(tidyverse) # load data --------------------------------------------------------------- ## ses...
### ### ### Distinct model ### ### #### Library #### source("scirpts/models/model_Manuscript1D.R") library(data.table) library(dplyr) library(ITRC) #### Model initialisation #### model.name <- "manuscript1d" output.path <- "/media/knt/sdb2/KN/ITRC/resources/model/distinct/2019-04-12/" #output.path <- "resources/model/...
/scirpts/models/distinct/script_model_Distinct.R
no_license
sysbiosig/FRA
R
false
false
3,612
r
### ### ### Distinct model ### ### #### Library #### source("scirpts/models/model_Manuscript1D.R") library(data.table) library(dplyr) library(ITRC) #### Model initialisation #### model.name <- "manuscript1d" output.path <- "/media/knt/sdb2/KN/ITRC/resources/model/distinct/2019-04-12/" #output.path <- "resources/model/...
##################################################################################################################### ############# Plots of phylogenetic diversity within alpine summits (alpha) ################################################## ############# Hannah E. Marx, 20 Jan 2019 ################################...
/R/03_AlphaDiv/plot_phyloDivAlpha.R
no_license
hmarx/Sawtooth-Alpine-PD
R
false
false
6,470
r
##################################################################################################################### ############# Plots of phylogenetic diversity within alpine summits (alpha) ################################################## ############# Hannah E. Marx, 20 Jan 2019 ################################...
path <- system.file("testScripts/R", package="aroma.affymetrix"); pathname <- file.path(path, "installUtils.R"); source(pathname); library("R.utils"); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Install # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - verbose && enter(...
/inst/testScripts/futures/HG-U133_Plus_2/01c.installPackages.R
no_license
microarray/aroma.affymetrix
R
false
false
704
r
path <- system.file("testScripts/R", package="aroma.affymetrix"); pathname <- file.path(path, "installUtils.R"); source(pathname); library("R.utils"); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Install # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - verbose && enter(...
rm(list=ls()) library(DBI) library(RSQLite) library(dplyr) ## 2nd Attempt setwd("~/git/M5Forecasting-Uncertainty") drv <- dbDriver("SQLite") con <- dbConnect(drv, dbname = "bosh.db", host = "localhost", user = "jpcryne") items <- dbGetQuery(con, "SELECT * FROM items") categories <- dbGetQuery(con, "SELECT * FROM categ...
/submission_style_sales_data.R
permissive
chrisgschon/M5Forecasting-Uncertainty
R
false
false
22,119
r
rm(list=ls()) library(DBI) library(RSQLite) library(dplyr) ## 2nd Attempt setwd("~/git/M5Forecasting-Uncertainty") drv <- dbDriver("SQLite") con <- dbConnect(drv, dbname = "bosh.db", host = "localhost", user = "jpcryne") items <- dbGetQuery(con, "SELECT * FROM items") categories <- dbGetQuery(con, "SELECT * FROM categ...
testlist <- list(x1 = NaN, x2 = numeric(0), y1 = c(NaN, NaN, NaN, NaN, -1.5315802203582e+280, 5.72883791535397e-313, NaN, 3.32653113638211e-111, 0, 0, 0), y2 = numeric(0)) result <- do.call(palm:::euc_distances,testlist) str(result)
/palm/inst/testfiles/euc_distances/libFuzzer_euc_distances/euc_distances_valgrind_files/1612969171-test.R
no_license
akhikolla/updatedatatype-list2
R
false
false
238
r
testlist <- list(x1 = NaN, x2 = numeric(0), y1 = c(NaN, NaN, NaN, NaN, -1.5315802203582e+280, 5.72883791535397e-313, NaN, 3.32653113638211e-111, 0, 0, 0), y2 = numeric(0)) result <- do.call(palm:::euc_distances,testlist) str(result)
#' @template Initialize-Boiler-Plate #' #' @param .Object no manual documentation #' @param times no manual documentation #' @param mat no manual documentation #' @param initialValues no manual documentation #' @param inputFluxes no manual documentation #' @param solverfunc no manual documentation #' @param pass no...
/pkg/R/Model.R
no_license
Celeste-Huang/SoilR-exp
R
false
false
13,395
r
#' @template Initialize-Boiler-Plate #' #' @param .Object no manual documentation #' @param times no manual documentation #' @param mat no manual documentation #' @param initialValues no manual documentation #' @param inputFluxes no manual documentation #' @param solverfunc no manual documentation #' @param pass no...
info.ordinal.cat <- function( model, link, theta, x, icat ){ ### Returns the contribution to the information matrix from an observation ### of icat. ### model is 1 for linear model ### 2 for quadratic model ### link is 1 for logistic link ### 2 for complementary log-log ### theta is vect...
/R/info.ordinal.cat.R
permissive
cran/asypow
R
false
false
2,030
r
info.ordinal.cat <- function( model, link, theta, x, icat ){ ### Returns the contribution to the information matrix from an observation ### of icat. ### model is 1 for linear model ### 2 for quadratic model ### link is 1 for logistic link ### 2 for complementary log-log ### theta is vect...
context("tidyr-pivot-wider") sc <- testthat_spark_connection() test_that("can pivot all cols to wide", { test_requires_version("2.3.0") sdf <- copy_to(sc, tibble::tibble(key = c("x", "y", "z"), val = 1:3)) pv <- tidyr::pivot_wider( sdf, names_from = key, values_from = val, names_sort = TRUE ) %>% ...
/tests/testthat/test-tidyr-pivot-wider.R
permissive
andrew-christianson/sparklyr
R
false
false
6,633
r
context("tidyr-pivot-wider") sc <- testthat_spark_connection() test_that("can pivot all cols to wide", { test_requires_version("2.3.0") sdf <- copy_to(sc, tibble::tibble(key = c("x", "y", "z"), val = 1:3)) pv <- tidyr::pivot_wider( sdf, names_from = key, values_from = val, names_sort = TRUE ) %>% ...
# ELEVATR demo # 2018-05-01 # LPB #prelims library(elevatr) # for elevation inqueries library(sp) # for spatial dataset classification library(rgdal) # for transformation library(raster) # for raster plotting library(lattice) # for contour plotting library(rasterVis) # also for contour plotting # ...
/presentation/elevatr.R
permissive
LaurenBomeisl/Bio381_2018
R
false
false
3,934
r
# ELEVATR demo # 2018-05-01 # LPB #prelims library(elevatr) # for elevation inqueries library(sp) # for spatial dataset classification library(rgdal) # for transformation library(raster) # for raster plotting library(lattice) # for contour plotting library(rasterVis) # also for contour plotting # ...
/07_03.R
no_license
dain1403/RStudio
R
false
false
11,151
r
##### from / after Ron Wehrens ------ pickPeaksPos_RW <- function(x, span) { x <- signal::sgolayfilt(x, p=2, n=21, m=0) span.width <- span *2+1 loc.max <- span.width +1 - apply(embed(x, span.width), 1, which.max) loc.max[loc.max == 1 | loc.max == span.width] <- NA pks <- loc.max + 0:(length(loc.max)-1) unique(pks...
/R/peaks_pick+plot.r
no_license
bpollner/aquap2
R
false
false
16,231
r
##### from / after Ron Wehrens ------ pickPeaksPos_RW <- function(x, span) { x <- signal::sgolayfilt(x, p=2, n=21, m=0) span.width <- span *2+1 loc.max <- span.width +1 - apply(embed(x, span.width), 1, which.max) loc.max[loc.max == 1 | loc.max == span.width] <- NA pks <- loc.max + 0:(length(loc.max)-1) unique(pks...
#' Interface between the Zelig Model logit.mixed and #' the Pre-existing Model-fitting Method #' @param formula a formula #' @param family a \code{family} object. This parameter should be changed to #' \code{link}, since it currently allows to interpret a \code{gamma.mixed} #' model as any other #' @param ... para...
/R/zelig2logit.mixed.R
no_license
cran/ZeligMultilevel
R
false
false
763
r
#' Interface between the Zelig Model logit.mixed and #' the Pre-existing Model-fitting Method #' @param formula a formula #' @param family a \code{family} object. This parameter should be changed to #' \code{link}, since it currently allows to interpret a \code{gamma.mixed} #' model as any other #' @param ... para...
# # 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( # Application title t...
/app-6.R
no_license
sabrinazaf/36-315proj
R
false
false
1,557
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( # Application title t...
## Getting and Cleaning Data Course Project #First set the working directory and obtain the data set # No test on whether the file or folder exists since I know the # file doesn't exist and I want it in this folder setwd("/users/jen/R_Programming") fileUrl <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfi...
/run_analysis.R
no_license
sierchio/GettingAndCleaningDataProject
R
false
false
3,557
r
## Getting and Cleaning Data Course Project #First set the working directory and obtain the data set # No test on whether the file or folder exists since I know the # file doesn't exist and I want it in this folder setwd("/users/jen/R_Programming") fileUrl <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfi...
library("dtw") ## dtw idx <- seq(0,6.28,len=100); ref <- sin(idx)+runif(100)/10; samp <- cos(idx+50) warpfun <- dtw(samp, ref, keep.internals = TRUE) # necessary for the plot wx2 <- warp(warpfun) warpedsamp <- samp[wx2] plot(idx, ref, type = "l", xlab ...
/time-warping-demos/dtw-demo/dtw-demo.R
no_license
mjmg/R-demo-files
R
false
false
633
r
library("dtw") ## dtw idx <- seq(0,6.28,len=100); ref <- sin(idx)+runif(100)/10; samp <- cos(idx+50) warpfun <- dtw(samp, ref, keep.internals = TRUE) # necessary for the plot wx2 <- warp(warpfun) warpedsamp <- samp[wx2] plot(idx, ref, type = "l", xlab ...
#' @title MP #' #' @description multi-period object #' #' @param group which group (defined by period first treated) an group-time average treatment effect is for #' @param t which time period a group-time average treatment effect is for #' @param att the group-average treatment effect for group \code{group} and time #...
/R/MP.R
no_license
Lingbing/did
R
false
false
2,232
r
#' @title MP #' #' @description multi-period object #' #' @param group which group (defined by period first treated) an group-time average treatment effect is for #' @param t which time period a group-time average treatment effect is for #' @param att the group-average treatment effect for group \code{group} and time #...
library (shiny) shinyUI(fluidPage( # Application title headerPanel("Hello Movies!") # Sidebar with a slider input for number of observations ,sidebarPanel( width=2 ,checkboxGroupInput( inputId="genre", label="Genre", choices=c("Action", "Animation", "...
/homework2/ui.r
no_license
matchbookiii/msan622
R
false
false
1,210
r
library (shiny) shinyUI(fluidPage( # Application title headerPanel("Hello Movies!") # Sidebar with a slider input for number of observations ,sidebarPanel( width=2 ,checkboxGroupInput( inputId="genre", label="Genre", choices=c("Action", "Animation", "...
setMethod( f = "estimate", signature = signature( statistic = "character", stratification = "CompactStratificationEqualArea", samplingPattern = "SamplingPatternRandomComposite", data = "data.frame" ), definition = function(statistic, stratification, samplingPatter...
/R/methods_estimate.R
no_license
cran/spcosa
R
false
false
8,777
r
setMethod( f = "estimate", signature = signature( statistic = "character", stratification = "CompactStratificationEqualArea", samplingPattern = "SamplingPatternRandomComposite", data = "data.frame" ), definition = function(statistic, stratification, samplingPatter...
#!/usr/bin/Rscript # Purpose: HTML Experiments # Date: 2014-10-10 # Author: http://timelyportfolio.blogspot.com, Tim Hagmann # Notes: WINDOWS: In order for it to work, RTools() has to be installed # R Version: R version 3.1.1 -- "Sock it to Me" ###############################...
/00_main.R
no_license
greenore/Rhtml
R
false
false
760
r
#!/usr/bin/Rscript # Purpose: HTML Experiments # Date: 2014-10-10 # Author: http://timelyportfolio.blogspot.com, Tim Hagmann # Notes: WINDOWS: In order for it to work, RTools() has to be installed # R Version: R version 3.1.1 -- "Sock it to Me" ###############################...
#Gerardo Hidalgo-Cuellar #November 29, 2017 #Titanic Project from Kaggle, feature engineering tutorial #sets the working directory setwd("~/Dropbox/kaggle_titanic") #importing data train <- read.csv("~/Dropbox/kaggle_titanic/train.csv") test <- read.csv("~/Dropbox/kaggle_titanic/test.csv") #making a new dataframe c...
/feature_engineering.R
no_license
ghidalgo93/kaggle_titanic
R
false
false
1,912
r
#Gerardo Hidalgo-Cuellar #November 29, 2017 #Titanic Project from Kaggle, feature engineering tutorial #sets the working directory setwd("~/Dropbox/kaggle_titanic") #importing data train <- read.csv("~/Dropbox/kaggle_titanic/train.csv") test <- read.csv("~/Dropbox/kaggle_titanic/test.csv") #making a new dataframe c...
#_________________________________________________ #GC content #______________________________________ my_gc<- function(s){ sz <- unlist(strsplit(s, split="")) mg <- length(which(sz=="G")) mc <- length(which(sz=="C")) mg+mc } #____________________________ #GC ratio #______________________________________...
/str_function.R
no_license
meher861982/SSFeature
R
false
false
2,003
r
#_________________________________________________ #GC content #______________________________________ my_gc<- function(s){ sz <- unlist(strsplit(s, split="")) mg <- length(which(sz=="G")) mc <- length(which(sz=="C")) mg+mc } #____________________________ #GC ratio #______________________________________...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/normalize.R \name{normalize} \alias{normalize} \title{Normalize numeric variables} \usage{ normalize(data, new_min = 0, new_max = 1) } \arguments{ \item{data}{a data frame.} \item{new_min}{minimum for the transformed variables.} \item{new_m...
/man/normalize.Rd
no_license
Rkabacoff/factorAnalysis
R
false
true
918
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/normalize.R \name{normalize} \alias{normalize} \title{Normalize numeric variables} \usage{ normalize(data, new_min = 0, new_max = 1) } \arguments{ \item{data}{a data frame.} \item{new_min}{minimum for the transformed variables.} \item{new_m...
h5writeDatasetHelper <- function (obj, h5dataset, index = NULL, start = NULL, stride = NULL, block = NULL, count = NULL) { try({ h5spaceFile <- H5Dget_space(h5dataset) on.exit(H5Sclose(h5spaceFile)) }) if (!is.null(index)) { s = H5Sget_simple...
/R/h5write.R
no_license
KasperSkytte/rhdf5
R
false
false
7,447
r
h5writeDatasetHelper <- function (obj, h5dataset, index = NULL, start = NULL, stride = NULL, block = NULL, count = NULL) { try({ h5spaceFile <- H5Dget_space(h5dataset) on.exit(H5Sclose(h5spaceFile)) }) if (!is.null(index)) { s = H5Sget_simple...
library(Hmisc) dir.create(file.path(tempdir(),'plots'),showWarnings=FALSE) app <- Builder$new( Static$new( urls = c('/css','/images','/javascript'), root = '.' ), Static$new(urls='/plots',root=tempdir()), Brewery$new( url='/brew', root='.', imagepath=file.path(tempdir(),'plots'...
/Hmisc/config.R
no_license
gwd999/RookTutorial
R
false
false
398
r
library(Hmisc) dir.create(file.path(tempdir(),'plots'),showWarnings=FALSE) app <- Builder$new( Static$new( urls = c('/css','/images','/javascript'), root = '.' ), Static$new(urls='/plots',root=tempdir()), Brewery$new( url='/brew', root='.', imagepath=file.path(tempdir(),'plots'...
## Dominic Mullen ## 7/14/2016 ## Retention Data SQL queries: # library(data.table) # library (RPostgreSQL) driver <- dbDriver("PostgreSQL") conn <- dbConnect(driver, host="superevilmegacorp.redshift.amplitude.com", port="5439", dbname="superevilmegacorp", user=...
/Shiny Dashboard/R/retentionData.R
no_license
dmullen17/work-samples
R
false
false
7,667
r
## Dominic Mullen ## 7/14/2016 ## Retention Data SQL queries: # library(data.table) # library (RPostgreSQL) driver <- dbDriver("PostgreSQL") conn <- dbConnect(driver, host="superevilmegacorp.redshift.amplitude.com", port="5439", dbname="superevilmegacorp", user=...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/WbiplotV2.R \name{Wbiplot} \alias{Wbiplot} \title{Weighted Biplot} \usage{ Wbiplot(df, numer1, denom1 = 1, numer2, denom2 = 1, cx = 0.5) } \arguments{ \item{df}{a dataframe with numeric values only} \item{numer1}{numerator of firs...
/man/Wbiplot.Rd
no_license
cran/analytics
R
false
true
1,802
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/WbiplotV2.R \name{Wbiplot} \alias{Wbiplot} \title{Weighted Biplot} \usage{ Wbiplot(df, numer1, denom1 = 1, numer2, denom2 = 1, cx = 0.5) } \arguments{ \item{df}{a dataframe with numeric values only} \item{numer1}{numerator of firs...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RcppExports.R \name{getOpProperties} \alias{getOpProperties} \title{Op Properties} \usage{ getOpProperties(op_name) } \arguments{ \item{op_name}{Unique identifier of operation} } \value{ List with properties of op } \description{ Get properti...
/man/getOpProperties.Rd
permissive
beansrowning/rtensorflow
R
false
true
342
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RcppExports.R \name{getOpProperties} \alias{getOpProperties} \title{Op Properties} \usage{ getOpProperties(op_name) } \arguments{ \item{op_name}{Unique identifier of operation} } \value{ List with properties of op } \description{ Get properti...
library(stream) ### Name: DSD_mlbenchGenerator ### Title: mlbench Data Stream Generator ### Aliases: DSD_mlbenchGenerator ### ** Examples stream <- DSD_mlbenchGenerator(method="cassini") plot(stream, n=500)
/data/genthat_extracted_code/stream/examples/DSD_mlbenchGenerator.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
215
r
library(stream) ### Name: DSD_mlbenchGenerator ### Title: mlbench Data Stream Generator ### Aliases: DSD_mlbenchGenerator ### ** Examples stream <- DSD_mlbenchGenerator(method="cassini") plot(stream, n=500)
# @author Yisong Zhen # @since 2018-10-08 # @parent # read cardiac_mef2.ChIP.R #--- library(chipenrich) macs2.rat.peaks <- .get_macs2_result_filenames(raw_data_path) %>% map(.get_macs_summit_result) %>% map(function(x) x + 200) # find the proper set for rat and annot...
/epigeneticX/cardiac_pathway.R
no_license
zhenyisong/core.facility
R
false
false
781
r
# @author Yisong Zhen # @since 2018-10-08 # @parent # read cardiac_mef2.ChIP.R #--- library(chipenrich) macs2.rat.peaks <- .get_macs2_result_filenames(raw_data_path) %>% map(.get_macs_summit_result) %>% map(function(x) x + 200) # find the proper set for rat and annot...
\name{coxr2} \alias{coxr2} \title{ R-Squared under the Cox model } \description{ Calculate the R-squared, aka explained randomness, based on the partial likelihood ratio statistic under the Cox model. } \usage{ ##object is the result of a 'coxph' coxr2(object) } \arguments{ \item{object}{ The result of a coxph fit...
/man/coxr2.Rd
no_license
cran/CoxR2
R
false
false
1,292
rd
\name{coxr2} \alias{coxr2} \title{ R-Squared under the Cox model } \description{ Calculate the R-squared, aka explained randomness, based on the partial likelihood ratio statistic under the Cox model. } \usage{ ##object is the result of a 'coxph' coxr2(object) } \arguments{ \item{object}{ The result of a coxph fit...
# @ Youyi Fong, Fred Hutchinson Cancer Research Center # Modified from code written by Ben Cowling and Wey Wen Lim (March 30, 2018) downloaded from https://datadryad.org/stash/dataset/doi:10.5061/dryad.cv37539 iorw=function(formula.effect, formula.mediators, data, family=NULL, nboot=10000, numCores=1, save.steps=FA...
/R/iorw.R
no_license
cran/kyotil
R
false
false
5,511
r
# @ Youyi Fong, Fred Hutchinson Cancer Research Center # Modified from code written by Ben Cowling and Wey Wen Lim (March 30, 2018) downloaded from https://datadryad.org/stash/dataset/doi:10.5061/dryad.cv37539 iorw=function(formula.effect, formula.mediators, data, family=NULL, nboot=10000, numCores=1, save.steps=FA...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/R6Classes_H5File.R \docType{class} \name{H5File-class} \alias{H5File} \alias{H5File-class} \title{Class for interacting with HDF5 files.} \value{ Object of class \code{\link{H5File}}. } \description{ This class represents an open HDF5 File-id...
/man/H5File-class.Rd
permissive
Novartis/hdf5r
R
false
true
22,360
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/R6Classes_H5File.R \docType{class} \name{H5File-class} \alias{H5File} \alias{H5File-class} \title{Class for interacting with HDF5 files.} \value{ Object of class \code{\link{H5File}}. } \description{ This class represents an open HDF5 File-id...
rm(list = ls()) setwd("/Users/whitneyhung/Documents/panc-local/thesis/whitneydata") # setwd("/Users/mbpr/Downloads/tmp/") #install.packages("data.table") # install.packages("stringr") # install.packages("ez") library(ez) library(data.table) library(stringr) library(dplyr) library(stringr) library(ggplot2) # install.pac...
/questionresp_modified_base3.R
no_license
ilovedc74/CaffeinatedEye
R
false
false
24,462
r
rm(list = ls()) setwd("/Users/whitneyhung/Documents/panc-local/thesis/whitneydata") # setwd("/Users/mbpr/Downloads/tmp/") #install.packages("data.table") # install.packages("stringr") # install.packages("ez") library(ez) library(data.table) library(stringr) library(dplyr) library(stringr) library(ggplot2) # install.pac...
#!/usr/bin/Rscript # Script for taking in all the 1000 genomes snp info # usage: Rscript ./PopData_2ndRound.R 3 # - - - - - - - - - - - # Take in the part number: args<-commandArgs(T) chrNum <- args[1] write("*** Starting import of the SNP and population data for the chromosome ***", stdout()) # Load the dat...
/PopData2ndRound.R
permissive
ash8/PopTargs
R
false
false
9,541
r
#!/usr/bin/Rscript # Script for taking in all the 1000 genomes snp info # usage: Rscript ./PopData_2ndRound.R 3 # - - - - - - - - - - - # Take in the part number: args<-commandArgs(T) chrNum <- args[1] write("*** Starting import of the SNP and population data for the chromosome ***", stdout()) # Load the dat...
# http://geo2tag.org/?page_id=671&lang=en_US # https://geocode-maps.yandex.ru/1.x/?geocode=metro Tretyakovskaya&results=100&format=json # geocodeList <- eval(as.list(args(.geocode))$service) '.geocode' <- function(loc=NULL,area=c("bounding","point","shape"),place="" ,select=c("top","expand","all")...
/R/xxx.geocode.R
no_license
nplatonov/ursa
R
false
false
16,723
r
# http://geo2tag.org/?page_id=671&lang=en_US # https://geocode-maps.yandex.ru/1.x/?geocode=metro Tretyakovskaya&results=100&format=json # geocodeList <- eval(as.list(args(.geocode))$service) '.geocode' <- function(loc=NULL,area=c("bounding","point","shape"),place="" ,select=c("top","expand","all")...
getOutcomeColumnNumber <- function (outcome){ if (outcome == "heart attack") { columnNumber <- 11 } else if (outcome == "heart failure") { columnNumber <- 17 } else if (outcome == "pneumonia") { columnNumber <- 23 } else { stop("invalid outcome") } return (columnNumber) } getStateOutcomeWith...
/rankhospital.R
no_license
harshjain3112/Programming-Assignment-3
R
false
false
2,022
r
getOutcomeColumnNumber <- function (outcome){ if (outcome == "heart attack") { columnNumber <- 11 } else if (outcome == "heart failure") { columnNumber <- 17 } else if (outcome == "pneumonia") { columnNumber <- 23 } else { stop("invalid outcome") } return (columnNumber) } getStateOutcomeWith...
d <- generateFakeData() # model fitting only (fit <- fSAE(y0 ~ x + area2, data=d$sam, area="area")) # model fitting and small area estimation, unit-level model saeHB <- fSAE(y0 ~ x + area2, data=d$sam, area="area", popdata=d$Xpop, silent=TRUE) saeHB # print a summary EST(saeHB) # small area estimates SE(sa...
/hbsae/examples/fSAE.R
no_license
ingted/R-Examples
R
false
false
1,417
r
d <- generateFakeData() # model fitting only (fit <- fSAE(y0 ~ x + area2, data=d$sam, area="area")) # model fitting and small area estimation, unit-level model saeHB <- fSAE(y0 ~ x + area2, data=d$sam, area="area", popdata=d$Xpop, silent=TRUE) saeHB # print a summary EST(saeHB) # small area estimates SE(sa...
context("ml classification - one vs rest") test_that("ml_one_vs_rest() default params", { test_requires_latest_spark() sc <- testthat_spark_connection() test_default_args(sc, ml_one_vs_rest) }) test_that("ml_one_vs_rest() param setting", { test_requires_latest_spark() sc <- testthat_spark_connection() tes...
/tests/testthat/test-ml-classification-one-vs-rest.R
permissive
zslajchrt/sparklyr
R
false
false
1,635
r
context("ml classification - one vs rest") test_that("ml_one_vs_rest() default params", { test_requires_latest_spark() sc <- testthat_spark_connection() test_default_args(sc, ml_one_vs_rest) }) test_that("ml_one_vs_rest() param setting", { test_requires_latest_spark() sc <- testthat_spark_connection() tes...
# deduplicate vietnam <- vietnam %>% select(publication_number, application_numbers, priority_numbers_long, inpadoc_first_family_member_number, inpadoc_first_family_member_number) vietnam$appln_duplicated <- duplicated(vietnam$application_numbers) vietpr1 <- filter(vietnam, appln_duplicated == FALSE) %>% separate_...
/vietnam_dedup_workings.R
no_license
poldham/blog
R
false
false
789
r
# deduplicate vietnam <- vietnam %>% select(publication_number, application_numbers, priority_numbers_long, inpadoc_first_family_member_number, inpadoc_first_family_member_number) vietnam$appln_duplicated <- duplicated(vietnam$application_numbers) vietpr1 <- filter(vietnam, appln_duplicated == FALSE) %>% separate_...
gta25_setup <- function(internal.name=NULL, in.dev=F, author=NULL, wipe.data=F, wipe.figs=T){ ## Cutoffs and definitions source('0 report production/GTA 25/help files/GTA 25 cutoff and definitions.R') ## chapt...
/help files/Producer console.R
no_license
global-trade-alert/gta-25
R
false
false
10,393
r
gta25_setup <- function(internal.name=NULL, in.dev=F, author=NULL, wipe.data=F, wipe.figs=T){ ## Cutoffs and definitions source('0 report production/GTA 25/help files/GTA 25 cutoff and definitions.R') ## chapt...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/checkbox.R \name{multiple_checkbox} \alias{multiple_checkbox} \title{Create Semantic UI multiple checkbox} \usage{ multiple_checkbox(input_id, label, choices, selected = NULL, position = "grouped", type = "radio", ...) } \arguments{ \item{i...
/man/multiple_checkbox.Rd
permissive
karthees89/shiny.semantic
R
false
true
1,071
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/checkbox.R \name{multiple_checkbox} \alias{multiple_checkbox} \title{Create Semantic UI multiple checkbox} \usage{ multiple_checkbox(input_id, label, choices, selected = NULL, position = "grouped", type = "radio", ...) } \arguments{ \item{i...
library(readr) library(ggplot2) library(dplyr) library(ggthemes) assign_periods <- function(d) { mutate(d, period = case_when ( date < "2020-03-16" ~ "1H Mar", date >= "2020-03-16" & date < "2020-04-01" ~ "2H Mar", date >= "2020-04-01" & date < "2020-04-16" ~ "1H Apr", date >= "2020-04-16" & date < "2020-05-0...
/estimate_rt.R
no_license
arienmalec/covid_bayarea
R
false
false
1,344
r
library(readr) library(ggplot2) library(dplyr) library(ggthemes) assign_periods <- function(d) { mutate(d, period = case_when ( date < "2020-03-16" ~ "1H Mar", date >= "2020-03-16" & date < "2020-04-01" ~ "2H Mar", date >= "2020-04-01" & date < "2020-04-16" ~ "1H Apr", date >= "2020-04-16" & date < "2020-05-0...
#'Play a short rap ad lib. #' #'\code{skrrrahh} is exactly like \code{beep} from the beepr package #'(https://cran.r-project.org/web/packages/beepr/index.html). #'The only difference is in the automatically loaded sounds available. #'\code{skrrrahh} uses rap adlibs from [The Rap Board](http://therapboard.com/). #' ...
/R/skrrrahh.R
no_license
jefferis/BRRR
R
false
false
5,866
r
#'Play a short rap ad lib. #' #'\code{skrrrahh} is exactly like \code{beep} from the beepr package #'(https://cran.r-project.org/web/packages/beepr/index.html). #'The only difference is in the automatically loaded sounds available. #'\code{skrrrahh} uses rap adlibs from [The Rap Board](http://therapboard.com/). #' ...
library(haven) library(forecast) library(fma) library(tseries) library(expsmooth) library(lmtest) library(zoo) library(ggplot2) library(imputeTS) library(lubridate) well_data <- read.csv("../data/well_agg_all_times.csv") start_date <- ymd(substr(as.character(well_data$new_date_time[1]),1,10), tz = Sys.timezone()) en...
/Time Series/imputing.R
no_license
ashwinb6/fall2_hw_team6
R
false
false
879
r
library(haven) library(forecast) library(fma) library(tseries) library(expsmooth) library(lmtest) library(zoo) library(ggplot2) library(imputeTS) library(lubridate) well_data <- read.csv("../data/well_agg_all_times.csv") start_date <- ymd(substr(as.character(well_data$new_date_time[1]),1,10), tz = Sys.timezone()) en...
\name{make_add_xml} \alias{make_add_xml} \title{Make it so the xml is an 'add'. make it so the xml is an 'add' to be commited to solr} \usage{ make_add_xml(obj) } \arguments{ \item{obj}{list to perform on} } \description{ Make it so the xml is an 'add'. make it so the xml is an 'add' to be commited to solr } \a...
/man/make_add_xml.Rd
no_license
hadley/helpr
R
false
false
368
rd
\name{make_add_xml} \alias{make_add_xml} \title{Make it so the xml is an 'add'. make it so the xml is an 'add' to be commited to solr} \usage{ make_add_xml(obj) } \arguments{ \item{obj}{list to perform on} } \description{ Make it so the xml is an 'add'. make it so the xml is an 'add' to be commited to solr } \a...
library(shiny) library(shinydashboard) library(stringr) library(lubridate) #print('go live version') yr = year(Sys.Date()) dat = paste0(as.character(str_pad(side='left', month(Sys.Date()), 2, '0')), '-01-', yr) end_last_month = as.Date(dat, '%m-%d-%Y') - 1 dashboardPage(skin='red', dashboardHeader...
/Professional/Applications/Operations-Intelligence-Dashboard/v2/LiveTesting/ui.R
no_license
paulmattheww/Original-Projects
R
false
false
17,636
r
library(shiny) library(shinydashboard) library(stringr) library(lubridate) #print('go live version') yr = year(Sys.Date()) dat = paste0(as.character(str_pad(side='left', month(Sys.Date()), 2, '0')), '-01-', yr) end_last_month = as.Date(dat, '%m-%d-%Y') - 1 dashboardPage(skin='red', dashboardHeader...
# Practice exam = read.csv("csv_exam.csv") exam # %>% 는 파이프라인이라고 보면 됨. (다음 함수에 그대로 전달해 줌.) exam %>% filter(class == 1) # dataset %>% filter (col_name == or != ?)을 통해서 추출하면 된다. # %>% = ( command + shift + m ) exam %>% filter(class != 1) exam %>% filter(math > 50) exam %>% filter(english >= 70) ######### # filter에 ...
/exercise/script3.R
no_license
signature95/HR_solution
R
false
false
5,251
r
# Practice exam = read.csv("csv_exam.csv") exam # %>% 는 파이프라인이라고 보면 됨. (다음 함수에 그대로 전달해 줌.) exam %>% filter(class == 1) # dataset %>% filter (col_name == or != ?)을 통해서 추출하면 된다. # %>% = ( command + shift + m ) exam %>% filter(class != 1) exam %>% filter(math > 50) exam %>% filter(english >= 70) ######### # filter에 ...
# Load the dataset hpc <- read.csv("household_power_consumption.txt", sep = ";") # Only retain the data for 2007-02-01 and 2007-02-02 hpc <- subset(hpc, Date %in% c("1/2/2007","2/2/2007")) # Convert Global_active_power column into a numeric hpc <- transform(hpc, Global_active_power = as.numeric(as.character(Global_ac...
/plot1.R
no_license
jedlejedi/ExData_Plotting1
R
false
false
622
r
# Load the dataset hpc <- read.csv("household_power_consumption.txt", sep = ";") # Only retain the data for 2007-02-01 and 2007-02-02 hpc <- subset(hpc, Date %in% c("1/2/2007","2/2/2007")) # Convert Global_active_power column into a numeric hpc <- transform(hpc, Global_active_power = as.numeric(as.character(Global_ac...
#正态分布函数rnorm( ) #泊松分布函数rpois( ) #指数分布函数rexp( ) #Gamma分布函数rgamma( ) #均匀分布函数runif( ) #二项分布函数rbinom( ) #几何分布函数rgeom( ) #离散型分布:两点分布,二项分布,泊松分布 # 连续型分布:均匀分布,指数分布,正态分布 #test
/分布.R
no_license
limetestlife/R
R
false
false
333
r
#正态分布函数rnorm( ) #泊松分布函数rpois( ) #指数分布函数rexp( ) #Gamma分布函数rgamma( ) #均匀分布函数runif( ) #二项分布函数rbinom( ) #几何分布函数rgeom( ) #离散型分布:两点分布,二项分布,泊松分布 # 连续型分布:均匀分布,指数分布,正态分布 #test
context("quantile residuals") library(gmvarkit) # NOTE that some test use random elements that might change if simulate.gsmvar is modified # ALSO: These tests do not really cover the numerical integration as is! # Set: which_def <- numeric(0) in the appropriate place in the function quantile_residuals to test numerica...
/tests/testthat/test_quantileResiduals.R
no_license
saviviro/gmvarkit
R
false
false
15,572
r
context("quantile residuals") library(gmvarkit) # NOTE that some test use random elements that might change if simulate.gsmvar is modified # ALSO: These tests do not really cover the numerical integration as is! # Set: which_def <- numeric(0) in the appropriate place in the function quantile_residuals to test numerica...
library(shiny) library(shinyBS) library(ggplot2) # Define UI for application that draws a histogram ui <- shinyUI(pageWithSidebar( # Application title headerPanel("Preference Sample-Size Calculator"), # Need to add tooltips for descriptions of inputs. # Pass syntax: 1 to by 0.4 # Sidebar with a slid...
/sample-size/ui.r
no_license
essmyman/clinical-trials-website
R
false
false
2,636
r
library(shiny) library(shinyBS) library(ggplot2) # Define UI for application that draws a histogram ui <- shinyUI(pageWithSidebar( # Application title headerPanel("Preference Sample-Size Calculator"), # Need to add tooltips for descriptions of inputs. # Pass syntax: 1 to by 0.4 # Sidebar with a slid...
#' Settings #' #' Automatically load RDocumentation and make it active, so that it overrides the default #' documentation? #' #' When you load in the RDocumentation package, you'll be prompted to autoload #' the package whenever you start R. When RDocumentation is loaded, it will automatically #' override the defau...
/R/settings.R
no_license
valgur/RDocumentation
R
false
false
2,325
r
#' Settings #' #' Automatically load RDocumentation and make it active, so that it overrides the default #' documentation? #' #' When you load in the RDocumentation package, you'll be prompted to autoload #' the package whenever you start R. When RDocumentation is loaded, it will automatically #' override the defau...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_track_audio_features.R \name{get_track_audio_features} \alias{get_track_audio_features} \title{Gets audio features of a single track} \usage{ get_track_audio_features( track_id, output = c("tidy", "raw"), limit = 20, offset = 0, ...
/man/get_track_audio_features.Rd
permissive
LennyyGH/spotidy
R
false
true
1,187
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_track_audio_features.R \name{get_track_audio_features} \alias{get_track_audio_features} \title{Gets audio features of a single track} \usage{ get_track_audio_features( track_id, output = c("tidy", "raw"), limit = 20, offset = 0, ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/fcat.R \name{as.fcat.tbl_df} \alias{as.fcat.tbl_df} \title{Convert a data frame to a format catalog} \usage{ \method{as.fcat}{tbl_df}(x) } \arguments{ \item{x}{The data frame to convert.} } \value{ A format catalog based on the information co...
/man/as.fcat.tbl_df.Rd
no_license
armenic/fmtr
R
false
true
3,101
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/fcat.R \name{as.fcat.tbl_df} \alias{as.fcat.tbl_df} \title{Convert a data frame to a format catalog} \usage{ \method{as.fcat}{tbl_df}(x) } \arguments{ \item{x}{The data frame to convert.} } \value{ A format catalog based on the information co...
source( "masternegloglikeeps1.R" ) source("eudicottree.R" ) library( "expm" ) source( "Qmatrixwoodherb2.R" ) source("Pruning2.R") bichrom.dataset<-read.table( "eudicotvals.txt",header=FALSE,sep=",",stringsAsFactors=FALSE) last.state=50 uniform.samples<-read.csv("sample351.csv",header=FALSE) a<- as.numeric(t(uniform....
/Full model optimizations/explorelikeuni351.R
no_license
roszenil/Bichromdryad
R
false
false
745
r
source( "masternegloglikeeps1.R" ) source("eudicottree.R" ) library( "expm" ) source( "Qmatrixwoodherb2.R" ) source("Pruning2.R") bichrom.dataset<-read.table( "eudicotvals.txt",header=FALSE,sep=",",stringsAsFactors=FALSE) last.state=50 uniform.samples<-read.csv("sample351.csv",header=FALSE) a<- as.numeric(t(uniform....
library(tidyverse) library(dplyr) library(na.tools) library(ggimage) library(ggrepel) # Data from https://github.com/ryurko/nflscrapR-data/blob/master/play_by_play_data/regular_season/reg_pbp_2019.csv pbp <- read_csv("data/reg_pbp_2019.csv") # Data from https://raw.githubusercontent.com/statsbylopez/BlogPosts/master/n...
/nfl.R
no_license
netguru-hackathon/r-scrapper
R
false
false
8,759
r
library(tidyverse) library(dplyr) library(na.tools) library(ggimage) library(ggrepel) # Data from https://github.com/ryurko/nflscrapR-data/blob/master/play_by_play_data/regular_season/reg_pbp_2019.csv pbp <- read_csv("data/reg_pbp_2019.csv") # Data from https://raw.githubusercontent.com/statsbylopez/BlogPosts/master/n...
######### 4.2 library("MASS") data("UScereal") attach(UScereal) names(UScereal) head(UScereal) # mfr, shelf - categorical table(mfr, shelf) barplot(table(mfr, shelf), beside = TRUE, legend = T) barplot(table(shelf, mfr), beside = TRUE, legend = T) # fat - numerical, vitamins - categorical boxplot(fat ~ vitamins) # f...
/03-Bivariate-data/pre-third-ex.R
no_license
GerganaLp/R-statistics-2017
R
false
false
1,145
r
######### 4.2 library("MASS") data("UScereal") attach(UScereal) names(UScereal) head(UScereal) # mfr, shelf - categorical table(mfr, shelf) barplot(table(mfr, shelf), beside = TRUE, legend = T) barplot(table(shelf, mfr), beside = TRUE, legend = T) # fat - numerical, vitamins - categorical boxplot(fat ~ vitamins) # f...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/check_data.R \name{test_long} \alias{test_long} \title{Valid longitude Test for valid longitude. Between -180 and 180} \usage{ test_long(x) } \arguments{ \item{x}{A longitude} } \description{ Valid longitude Test for valid longitude. ...
/man/test_long.Rd
no_license
Hackout2/mapData
R
false
false
406
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/check_data.R \name{test_long} \alias{test_long} \title{Valid longitude Test for valid longitude. Between -180 and 180} \usage{ test_long(x) } \arguments{ \item{x}{A longitude} } \description{ Valid longitude Test for valid longitude. ...
create_report <- function(input, output_dir, has_code, opts) { if (opts$suppress_report) { return("") } input <- absolute(input) input_dir <- dirname(input) uses_git <- git2r::in_repository(input_dir) if (uses_git) { r <- git2r::repository(input_dir, discover = TRUE) s <- git2r::status(r, ign...
/R/report.R
permissive
workflowr/workflowr
R
false
false
30,672
r
create_report <- function(input, output_dir, has_code, opts) { if (opts$suppress_report) { return("") } input <- absolute(input) input_dir <- dirname(input) uses_git <- git2r::in_repository(input_dir) if (uses_git) { r <- git2r::repository(input_dir, discover = TRUE) s <- git2r::status(r, ign...
# --------------------------------------------------------------------------------------------- # Title: CS710 Final Project # Author: Hanna Lu # --------------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------...
/final_project.R
no_license
Hanna520/CS710-Final-Project
R
false
false
10,287
r
# --------------------------------------------------------------------------------------------- # Title: CS710 Final Project # Author: Hanna Lu # --------------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/test.r \name{test.tabular.chisq} \alias{test.tabular.chisq} \title{test for contingency table} \usage{ test.tabular.chisq(x, y) } \arguments{ \item{x}{vector} \item{y}{another vector} } \value{ a list with two componments: p.value and method...
/man/test.tabular.chisq.Rd
no_license
eusebe/biostat2
R
false
true
430
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/test.r \name{test.tabular.chisq} \alias{test.tabular.chisq} \title{test for contingency table} \usage{ test.tabular.chisq(x, y) } \arguments{ \item{x}{vector} \item{y}{another vector} } \value{ a list with two componments: p.value and method...
## makeCacheMatrix allows the creation of object that is populated with ## a matrix. The cacheSolve can be used to update the makeCacheMatrix object ## to include the inverse of the matrix. This inverse is cache/saved after ## it is originaly set, thus it will not be calculated again until it set to null ## or the obje...
/cachematrix.R
no_license
lsoulie1973/ProgrammingAssignment2
R
false
false
1,778
r
## makeCacheMatrix allows the creation of object that is populated with ## a matrix. The cacheSolve can be used to update the makeCacheMatrix object ## to include the inverse of the matrix. This inverse is cache/saved after ## it is originaly set, thus it will not be calculated again until it set to null ## or the obje...
library(tidyverse) library(spotifyr) library(here) library(glue) library(fs) tribble( ~album_name, ~album_uri, "Taylor Swift", "7mzrIsaAjnXihW3InKjlC3", "Fearless", "2dqn5yOQWdyGwOpOIi9O4x", "Fearless (Taylor's Version)", "4hDok0OAJd57SGIT8xuWJH", "Speak N...
/data-raw/album-covers.R
permissive
hadley/taylor
R
false
false
1,617
r
library(tidyverse) library(spotifyr) library(here) library(glue) library(fs) tribble( ~album_name, ~album_uri, "Taylor Swift", "7mzrIsaAjnXihW3InKjlC3", "Fearless", "2dqn5yOQWdyGwOpOIi9O4x", "Fearless (Taylor's Version)", "4hDok0OAJd57SGIT8xuWJH", "Speak N...
#' #' PUB-685: Throw error when MARGIN = c(1,2) #' #' #' Ensure that an error about the margin is thrown when passing in c(1,2) for the MARGIN in apply setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f"))) source('../h2o-runit.R') test.pub_685_margin.err.throw <- function(H2Oserver) { hex <- as.h2o(...
/h2o-r/tests/testdir_jira/runit_pub_685_apply_margin_throwErr.R
permissive
mrgloom/h2o-3
R
false
false
704
r
#' #' PUB-685: Throw error when MARGIN = c(1,2) #' #' #' Ensure that an error about the margin is thrown when passing in c(1,2) for the MARGIN in apply setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f"))) source('../h2o-runit.R') test.pub_685_margin.err.throw <- function(H2Oserver) { hex <- as.h2o(...
library(glmnet) library(caret) library(data.table) options(warn=-1) # data_pre <- function(data_input,label_input){ # input_dat = fread('/home/binyang_ni/python/data/LC002_Tissue_QCpassed_093Up_20170309.CPM.txt',stringsAsFactors=FALSE, check.names=TRUE ,sep = '\t') # input_dat = read.csv('/home/binyang_ni/python/d...
/Elastic_model/glmnet_project/cv-ten_times.R
no_license
NZbryan/R_Feature_Engineering
R
false
false
4,496
r
library(glmnet) library(caret) library(data.table) options(warn=-1) # data_pre <- function(data_input,label_input){ # input_dat = fread('/home/binyang_ni/python/data/LC002_Tissue_QCpassed_093Up_20170309.CPM.txt',stringsAsFactors=FALSE, check.names=TRUE ,sep = '\t') # input_dat = read.csv('/home/binyang_ni/python/d...
library(DESeq2) library(tidyverse) ## Import Data ## ----------- counts <- read.delim("counts.tsv", stringsAsFactors=F) countdata <- counts %>% column_to_rownames("X") %>% # turn the geneid column into rownames as.matrix() head(countdata) # Get the total number of counts per gene cpg <- rowSums(...
/Script1.R
no_license
Valentin-K/isped_rna
R
false
false
1,932
r
library(DESeq2) library(tidyverse) ## Import Data ## ----------- counts <- read.delim("counts.tsv", stringsAsFactors=F) countdata <- counts %>% column_to_rownames("X") %>% # turn the geneid column into rownames as.matrix() head(countdata) # Get the total number of counts per gene cpg <- rowSums(...
% Part of the dcemri package for R % Distributed under the BSD license: see dcemri/COPYING % % $Id$ \name{readANALYZE} \alias{readANALYZE} \alias{read.analyze.content} \title{readANALYZE} \description{ These functions read in the header information and multi-dimensional array from a binary file in Analyze 7.5 form...
/pkg/dcemriS4withNIfTi/man/read_anlz.Rd
permissive
bjw34032/dcemri
R
false
false
1,653
rd
% Part of the dcemri package for R % Distributed under the BSD license: see dcemri/COPYING % % $Id$ \name{readANALYZE} \alias{readANALYZE} \alias{read.analyze.content} \title{readANALYZE} \description{ These functions read in the header information and multi-dimensional array from a binary file in Analyze 7.5 form...
getwd() setwd("C:/rWork/rProjects/R-in-Action/analytics/clustering_stocks") (d=read.csv("stock_data.csv",header = TRUE)) str(d) dim(d) head(d) tail(d) is.na(d) d$Y=as.factor(d$Y) d$Y train=d[1:2000,] train test=d[2001:3000,] test library(randomForest) library(Metrics) model=randomForest(Y~.,d=train) model pred=predict(...
/modeling(regression)/rf_practice.R
no_license
apoorvakarn/R-in-Action
R
false
false
487
r
getwd() setwd("C:/rWork/rProjects/R-in-Action/analytics/clustering_stocks") (d=read.csv("stock_data.csv",header = TRUE)) str(d) dim(d) head(d) tail(d) is.na(d) d$Y=as.factor(d$Y) d$Y train=d[1:2000,] train test=d[2001:3000,] test library(randomForest) library(Metrics) model=randomForest(Y~.,d=train) model pred=predict(...
library(shiny) library(drc) data <- read.csv("LULC-BioclimaticParameters.csv", encoding = "UTF-8") data2<-data shinyUI(fluidPage( titlePanel("Data Products: Predict Evapotranspiration with Precipitation data in Yucatán Península, México"), sidebarLayout( sidebarPanel( sliderInput("sliderP", "Wh...
/Course-Project-Data-Products/ui.R
no_license
edgarodriguez/Coursera-ShinyApp
R
false
false
871
r
library(shiny) library(drc) data <- read.csv("LULC-BioclimaticParameters.csv", encoding = "UTF-8") data2<-data shinyUI(fluidPage( titlePanel("Data Products: Predict Evapotranspiration with Precipitation data in Yucatán Península, México"), sidebarLayout( sidebarPanel( sliderInput("sliderP", "Wh...