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
# Example of Modeling using caret # Import necessary libraries library(dplyr) library(readr) library(caret) library(neuralnet) ds = read_csv("~/Desktop/exchanges.csv") # Split dataset into training and testing ## In this case we are performing a 70/30 split, so we will ## use the 70% of the dataset to build the mod...
/advanced_modeling_neural_regression.R
no_license
gnebbia/R_basic_modeling
R
false
false
2,145
r
# Example of Modeling using caret # Import necessary libraries library(dplyr) library(readr) library(caret) library(neuralnet) ds = read_csv("~/Desktop/exchanges.csv") # Split dataset into training and testing ## In this case we are performing a 70/30 split, so we will ## use the 70% of the dataset to build the mod...
#n is an integer library(gmp) user_dec <- readline("Enter decimal: ") n <-as.bigz(user_dec) n l <- vector() inc <- 1 while(n >= 1) { temp <- as.bigz(n %% 2) l[inc] <- toString(temp) n <- as.bigz(n/2) inc <- inc+1 } bin <- as.integer(rev(l)) bin #binary to dec? user_bin <- readline("Enter bina...
/simple dec to binary converter.R
no_license
fishjosh/CS-Homework-Help
R
false
false
608
r
#n is an integer library(gmp) user_dec <- readline("Enter decimal: ") n <-as.bigz(user_dec) n l <- vector() inc <- 1 while(n >= 1) { temp <- as.bigz(n %% 2) l[inc] <- toString(temp) n <- as.bigz(n/2) inc <- inc+1 } bin <- as.integer(rev(l)) bin #binary to dec? user_bin <- readline("Enter bina...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mnt-package.R \name{print.mnt} \alias{print.mnt} \title{Print method for tests of multivariate normality} \usage{ \method{print}{mnt}(x, ...) } \arguments{ \item{x}{object of class "mnt".} \item{...}{further arguments to be passed to or from...
/man/print.mnt.Rd
no_license
cran/mnt
R
false
true
781
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mnt-package.R \name{print.mnt} \alias{print.mnt} \title{Print method for tests of multivariate normality} \usage{ \method{print}{mnt}(x, ...) } \arguments{ \item{x}{object of class "mnt".} \item{...}{further arguments to be passed to or from...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/service.general.R \name{service.output_message} \alias{service.output_message} \title{Produce message for warning or cat} \usage{ service.output_message(x, custom_phrase, warning_type) } \arguments{ \item{x}{Numeric. The value to be ...
/man/service.output_message.Rd
no_license
cran/kidney.epi
R
false
true
951
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/service.general.R \name{service.output_message} \alias{service.output_message} \title{Produce message for warning or cat} \usage{ service.output_message(x, custom_phrase, warning_type) } \arguments{ \item{x}{Numeric. The value to be ...
library("data.table") #Reads in data from file then subsets data for specified dates powerDT <- data.table::fread(input = "household_power_consumption.txt" , na.strings="?" ) # Prevents histogram from printing in scientific notation powerDT[, Global_active_power := lapply(.SD, a...
/plot1.R
no_license
praj1998/exploratorydatascience
R
false
false
810
r
library("data.table") #Reads in data from file then subsets data for specified dates powerDT <- data.table::fread(input = "household_power_consumption.txt" , na.strings="?" ) # Prevents histogram from printing in scientific notation powerDT[, Global_active_power := lapply(.SD, a...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gnorm.R \name{gnorm} \alias{gnorm} \alias{dgnorm} \alias{pgnorm} \alias{qgnorm} \alias{rgnorm} \title{The generalized normal distribution} \source{ \code{dgnorm}, \code{pgnorm}, \code{qgnorm} and\code{rgnorm} are all parametrized as in Versio...
/man/gnorm.Rd
no_license
maryclare/gnorm
R
false
true
3,052
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gnorm.R \name{gnorm} \alias{gnorm} \alias{dgnorm} \alias{pgnorm} \alias{qgnorm} \alias{rgnorm} \title{The generalized normal distribution} \source{ \code{dgnorm}, \code{pgnorm}, \code{qgnorm} and\code{rgnorm} are all parametrized as in Versio...
# Name: dm07_allocate_multiple_contacts.R ## Description: Assign each of the multiple contacts to a row ## Input file: combined_6_v4.qs ## Functions: ## Output file: combined_7_v4.qs # Packages ---------------------------------------------------------------- library(data.table) # Source user written scripts --------...
/r/version_4/dm07_allocate_multiple_contacts_v4.R
permissive
seabbs/comix_data_clean
R
false
false
4,688
r
# Name: dm07_allocate_multiple_contacts.R ## Description: Assign each of the multiple contacts to a row ## Input file: combined_6_v4.qs ## Functions: ## Output file: combined_7_v4.qs # Packages ---------------------------------------------------------------- library(data.table) # Source user written scripts --------...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/KmedoidsResult.R \docType{class} \name{KmedoidsResult-class} \alias{KmedoidsResult-class} \title{An S4 class to represent the result of kmedoids clustering} \description{ An S4 class to represent the result of kmedoids clustering } \section{S...
/man/KmedoidsResult-class.Rd
no_license
parthsarthi313/fastkmedoids
R
false
true
570
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/KmedoidsResult.R \docType{class} \name{KmedoidsResult-class} \alias{KmedoidsResult-class} \title{An S4 class to represent the result of kmedoids clustering} \description{ An S4 class to represent the result of kmedoids clustering } \section{S...
# run both scripts source("src/do_something.R") source("src/path-test.R") # seems alright!
/run-scripts.R
no_license
lfoswald/demo_repo_1
R
false
false
94
r
# run both scripts source("src/do_something.R") source("src/path-test.R") # seems alright!
/XGBLC_model/xgblc_1.R
no_license
Xudeh/XGBLC
R
false
false
12,217
r
setwd("C:/Users/yanyan/Documents/R/data") if (!file.exists("household_power_consumption")) { if (!file.exists("exdata_data_household_power_consumption.zip")) { stop("was expecting power consumption txt or zip file") } else { unzip("exdata_data_household_power_consumption.zip") } ...
/plot4.R
no_license
cylilian/ExData_Plotting1
R
false
false
1,390
r
setwd("C:/Users/yanyan/Documents/R/data") if (!file.exists("household_power_consumption")) { if (!file.exists("exdata_data_household_power_consumption.zip")) { stop("was expecting power consumption txt or zip file") } else { unzip("exdata_data_household_power_consumption.zip") } ...
#' Determine static web URL address for Zillow data #' #' This function is designed to fetch the full URL of Zillow's public research #' data via the site's static-address `.csv` links. It is specificaly designed #' as a utility in actually fetching the data. #' #' @param zillow_var The variable name to read in. The fu...
/R/read.R
no_license
ryapric/ZillowTools
R
false
false
2,296
r
#' Determine static web URL address for Zillow data #' #' This function is designed to fetch the full URL of Zillow's public research #' data via the site's static-address `.csv` links. It is specificaly designed #' as a utility in actually fetching the data. #' #' @param zillow_var The variable name to read in. The fu...
\name{decay} \alias{decay} \title{Radioactive Decay} \description{ The data come from an experiment performed by Meyer and Von Schweidler in 1905 concerning radioactive decay. The data represent the time in days, and the degree of radioactivity measured at that time for a particular material. } \usage{data(decay...
/man/decay.Rd
no_license
louisaslett/durham-Rpkg
R
false
false
633
rd
\name{decay} \alias{decay} \title{Radioactive Decay} \description{ The data come from an experiment performed by Meyer and Von Schweidler in 1905 concerning radioactive decay. The data represent the time in days, and the degree of radioactivity measured at that time for a particular material. } \usage{data(decay...
##.nimbleProjectClassMasterList <- new.env(, emptyenv()) projectNameCreator <- labelFunctionCreator('P') nfCompilationInfoClass <- setRefClass('nfCompilationInfoClass', fields = list( nfProc = 'ANY', ## an nfProcessing object nfGenerator = 'ANY', ## a nfGenerator, which is a function with ...
/packages/nimble/R/nimbleProject.R
permissive
vishalbelsare/nimble
R
false
false
73,866
r
##.nimbleProjectClassMasterList <- new.env(, emptyenv()) projectNameCreator <- labelFunctionCreator('P') nfCompilationInfoClass <- setRefClass('nfCompilationInfoClass', fields = list( nfProc = 'ANY', ## an nfProcessing object nfGenerator = 'ANY', ## a nfGenerator, which is a function with ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/stat_mean_line.R \name{stat_mean_line} \alias{stat_mean_line} \title{Stat Mean Line} \usage{ stat_mean_line(mapping = NULL, data = NULL, geom = "hline", position = "identity", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ...) } \a...
/man/stat_mean_line.Rd
no_license
shonawilde/wsdmiscr
R
false
true
484
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/stat_mean_line.R \name{stat_mean_line} \alias{stat_mean_line} \title{Stat Mean Line} \usage{ stat_mean_line(mapping = NULL, data = NULL, geom = "hline", position = "identity", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ...) } \a...
# Module UI #' @title mod_table_piecesui and mod_table_pieces #' @description A shiny Module that ... #' #' @param id shiny id #' #' @export #' @importFrom shiny NS tagList #' @import DT #' @examples mod_table_piecesui <- function(id){ ns <- NS(id) tagList( withLoader( DT::DTOutput( ns("piec...
/shinylego-master1/R/mod_table_pieces.R
permissive
lukuiR/Rpublic
R
false
false
1,837
r
# Module UI #' @title mod_table_piecesui and mod_table_pieces #' @description A shiny Module that ... #' #' @param id shiny id #' #' @export #' @importFrom shiny NS tagList #' @import DT #' @examples mod_table_piecesui <- function(id){ ns <- NS(id) tagList( withLoader( DT::DTOutput( ns("piec...
#initialize library(shiny) library(shinythemes) library(datasets) library(lmtest) library(reshape2) library(mgcv) library(MCMCpack) library(maptools) library(nlme) library(AICcmodavg) library(bsplus) #======================================================================= # UI: #=================================...
/old_files/SR_model_Run_brood_switch_o.R
no_license
hhamazaki/Shiny-Apps
R
false
false
79,971
r
#initialize library(shiny) library(shinythemes) library(datasets) library(lmtest) library(reshape2) library(mgcv) library(MCMCpack) library(maptools) library(nlme) library(AICcmodavg) library(bsplus) #======================================================================= # UI: #=================================...
#main runner for everything init_workspace <- function(){ library(knitr) #library(reshape2) library(GEOquery) #library(refGenome) #library(rtracklayer) #library(limma) #library(affy) library(stringr) #library(lattice) #library(ggplot2) #library(caret) #library(FactoMineR) library(FSelector) ...
/Scripts/main.R
no_license
bbradt/Alzheimers-Project
R
false
false
3,738
r
#main runner for everything init_workspace <- function(){ library(knitr) #library(reshape2) library(GEOquery) #library(refGenome) #library(rtracklayer) #library(limma) #library(affy) library(stringr) #library(lattice) #library(ggplot2) #library(caret) #library(FactoMineR) library(FSelector) ...
context("Check grade_result_strict messages") expect_message <- function(x, message, correct) { expect_s3_class(x, "gradethis_graded") expect_equal(x$correct, correct) expect_true(grepl(message, paste0(x$message, collapse = ""), fixed = TRUE)) } test_that("Correct messages without random praise", { glue_corre...
/tests/testthat/test_zzzz-test_result_message.R
permissive
friep/gradethis
R
false
false
1,088
r
context("Check grade_result_strict messages") expect_message <- function(x, message, correct) { expect_s3_class(x, "gradethis_graded") expect_equal(x$correct, correct) expect_true(grepl(message, paste0(x$message, collapse = ""), fixed = TRUE)) } test_that("Correct messages without random praise", { glue_corre...
# --- Simulate SCR data --- library(secr) library(fields) create.thinned.capthist <- function (capthist) { # attributes for thinned capture history attr <- attributes(capthist) nzeros <- summary(capthist)$zeros attr$dim[1] <- attr$dim[1] - nzeros # remove individuals...
/R/sim.scr.pop.R
no_license
david-borchers/HMM-JSSCR
R
false
false
3,127
r
# --- Simulate SCR data --- library(secr) library(fields) create.thinned.capthist <- function (capthist) { # attributes for thinned capture history attr <- attributes(capthist) nzeros <- summary(capthist)$zeros attr$dim[1] <- attr$dim[1] - nzeros # remove individuals...
#' Obtain the Horvitz-Thompson direct estimates and standard errors using delta method for multiple surveys. #' #' #' @param births A list of child-month data from multiple surveys from \code{\link{getBirths}}. The name of the list is used as the identifier in the output. #' @param years String vector of the year inte...
/R/countrySummary_mult.R
no_license
kant/SUMMER
R
false
false
3,127
r
#' Obtain the Horvitz-Thompson direct estimates and standard errors using delta method for multiple surveys. #' #' #' @param births A list of child-month data from multiple surveys from \code{\link{getBirths}}. The name of the list is used as the identifier in the output. #' @param years String vector of the year inte...
movies = read.table("movieLens.txt", header=FALSE, sep="|", quote="\"") str(movies) colnames(movies) = c("ID", "Title", "ReleaseDate", "VideoReleaseDate", "IMDB", "Unknown", "Action", "Adventure", "Animation", "Childrens", "Comedy", "Crime", "Documentary", "Drama", "Fantasy", "FilmNoir", "Horror", "Musical", "Mystery"...
/analytics-edge/week6/movieLens.R
no_license
1ambda/data-analysis
R
false
false
1,240
r
movies = read.table("movieLens.txt", header=FALSE, sep="|", quote="\"") str(movies) colnames(movies) = c("ID", "Title", "ReleaseDate", "VideoReleaseDate", "IMDB", "Unknown", "Action", "Adventure", "Animation", "Childrens", "Comedy", "Crime", "Documentary", "Drama", "Fantasy", "FilmNoir", "Horror", "Musical", "Mystery"...
library(readr) library(dplyr) library(tidyr) source("./functions/funcs_for_new_normal.R") load("./produced_data/cepal_18_countries") quiet_iso <- purrr::quietly(add_iso) my_growth <- function(x) { pg <- 100*(x - dplyr::lag(x))/ dplyr::lag(x) } cepalstat_capital_formation <- read_delim( "./raw_data/formacio...
/scripts/read_gcf_cepalstat.R
no_license
ricardomayerb/new_normal
R
false
false
7,773
r
library(readr) library(dplyr) library(tidyr) source("./functions/funcs_for_new_normal.R") load("./produced_data/cepal_18_countries") quiet_iso <- purrr::quietly(add_iso) my_growth <- function(x) { pg <- 100*(x - dplyr::lag(x))/ dplyr::lag(x) } cepalstat_capital_formation <- read_delim( "./raw_data/formacio...
#READ THE TEST DATA test_data_001 <- readRDS("../testdata/test_data_001.rds") test_data_002<-test_data_001[1:4,] class(test_data_002)<-"summary.rms" expect_doppelganger <- function(title, fig, path = NULL, ...) { testthat::skip_if_not_installed("vdiffr") vdiffr::expect_doppelganger(title, fig, path = path...
/tests/testthat/test-orm_forestplot.R
no_license
cran/ormPlot
R
false
false
1,461
r
#READ THE TEST DATA test_data_001 <- readRDS("../testdata/test_data_001.rds") test_data_002<-test_data_001[1:4,] class(test_data_002)<-"summary.rms" expect_doppelganger <- function(title, fig, path = NULL, ...) { testthat::skip_if_not_installed("vdiffr") vdiffr::expect_doppelganger(title, fig, path = path...
testlist <- list(rates = c(-Inf, Inf, 0), thresholds = numeric(0), x = -6.76385741726459e-231) result <- do.call(grattan::IncomeTax,testlist) str(result)
/grattan/inst/testfiles/IncomeTax/libFuzzer_IncomeTax/IncomeTax_valgrind_files/1610051922-test.R
no_license
akhikolla/updated-only-Issues
R
false
false
153
r
testlist <- list(rates = c(-Inf, Inf, 0), thresholds = numeric(0), x = -6.76385741726459e-231) result <- do.call(grattan::IncomeTax,testlist) str(result)
library(data.table) library(ukbnmr) library(ggplot2) library(ggthemes) library(palettetown) # Make output directory system("mkdir -p pkg_check", wait=TRUE) # Load in full pre-release raw data and extended sample information raw <- fread("data/raw/processed/UKB_phase1_results.txt") sinfo <- fread("data/raw/processed/h...
/src/04_pkg_sanity_check/01_pkg_sanity_check.R
permissive
sritchie73/UKB_NMR_QC_paper
R
false
false
9,617
r
library(data.table) library(ukbnmr) library(ggplot2) library(ggthemes) library(palettetown) # Make output directory system("mkdir -p pkg_check", wait=TRUE) # Load in full pre-release raw data and extended sample information raw <- fread("data/raw/processed/UKB_phase1_results.txt") sinfo <- fread("data/raw/processed/h...
# Final Data Viz Project # DMV Capstone Data # Tyler Hutcherson # Data Cleaning library(dplyr) library(purrr) library(readr) setwd("~/Desktop/Data_Science/Capstone_2016/DMV_Capstone") df <- read.csv("final_data.csv") df$Fatality <- as.factor(df$Fatality) data <- df[df$VehicleSpeedLimit < 80 & df$VehicleSpeedLimit > ...
/project_data/dataclean.R
no_license
tylerhutcherson/VACrashes
R
false
false
4,278
r
# Final Data Viz Project # DMV Capstone Data # Tyler Hutcherson # Data Cleaning library(dplyr) library(purrr) library(readr) setwd("~/Desktop/Data_Science/Capstone_2016/DMV_Capstone") df <- read.csv("final_data.csv") df$Fatality <- as.factor(df$Fatality) data <- df[df$VehicleSpeedLimit < 80 & df$VehicleSpeedLimit > ...
library(testthat) library(atl) test_check("atl")
/tests/testthat.R
no_license
14Gus/atl
R
false
false
50
r
library(testthat) library(atl) test_check("atl")
fileUrl <- "https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06hid.csv" surveydata <- read.csv(fileUrl) surveydata <- strsplit(names(surveydata), "wgtp") surveydata[123] # Q2 fileUrl <- "https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2FGDP.csv" gdp <- read.csv(fileUrl, skip = 5, header=FALSE, stringsAsFa...
/Getting and Cleaning Data/week4_Quiz.R
no_license
datahasbyte/datasciencecoursera
R
false
false
1,481
r
fileUrl <- "https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06hid.csv" surveydata <- read.csv(fileUrl) surveydata <- strsplit(names(surveydata), "wgtp") surveydata[123] # Q2 fileUrl <- "https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2FGDP.csv" gdp <- read.csv(fileUrl, skip = 5, header=FALSE, stringsAsFa...
#' @title spEMD #' @aliases spEMD #' #' @description 2D EMD for spatial objects #' @author Pierre Roudier #' #' @param data . #' @param zcol . #' @param method . #' @param n.imf.max . #' @param n.sp.max . #' @param n.extrema.min . #' @param stoprule . #' @param stoprule.extrema . #' @param thresh.extrema . #' @param to...
/R/spemd.r
no_license
juejack/spemd
R
false
false
10,290
r
#' @title spEMD #' @aliases spEMD #' #' @description 2D EMD for spatial objects #' @author Pierre Roudier #' #' @param data . #' @param zcol . #' @param method . #' @param n.imf.max . #' @param n.sp.max . #' @param n.extrema.min . #' @param stoprule . #' @param stoprule.extrema . #' @param thresh.extrema . #' @param to...
#' Find the minimum number of coins needed to make change #' #' \code{DPChange} uses a dynamic programming approach to calculate the minimum number of coins (of denominations listed in \code{coins}) required to make change for \code{money}. #' #' @param money An integer specifying the amount to be made into chang...
/R/ch5_sequence_alignment.R
no_license
slargman/compeau.pevzner
R
false
false
7,644
r
#' Find the minimum number of coins needed to make change #' #' \code{DPChange} uses a dynamic programming approach to calculate the minimum number of coins (of denominations listed in \code{coins}) required to make change for \code{money}. #' #' @param money An integer specifying the amount to be made into chang...
#Author: Giuseppe Angele' rm(list = ls()) ### Pepsimulator ### Global options and packages options(scipen = 999) options(stringsAsFactors = F) os_folder_struc <- if(Sys.info()["sysname"]=="Darwin"){"/Volumes/OMDINT/"} else {"S:/"} #setwd(paste0(os_folder_struc,"OMD Strategy Team/Advanced Analytics")) librar...
/global.R
no_license
omdemea/pepsimulator
R
false
false
797
r
#Author: Giuseppe Angele' rm(list = ls()) ### Pepsimulator ### Global options and packages options(scipen = 999) options(stringsAsFactors = F) os_folder_struc <- if(Sys.info()["sysname"]=="Darwin"){"/Volumes/OMDINT/"} else {"S:/"} #setwd(paste0(os_folder_struc,"OMD Strategy Team/Advanced Analytics")) librar...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/scatter.plot.R \name{scatter.plot} \alias{scatter.plot} \title{Scatter Plot} \usage{ scatter.plot(dat, cat.pre, cont.pre, cont.out, alpha = 0.5, filename, plot.percentage = 100) } \arguments{ \item{dat}{Dataframe to take info from.} \item{...
/man/scatter.plot.Rd
no_license
ricardoruiz2897/Wangr-Packager
R
false
true
771
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/scatter.plot.R \name{scatter.plot} \alias{scatter.plot} \title{Scatter Plot} \usage{ scatter.plot(dat, cat.pre, cont.pre, cont.out, alpha = 0.5, filename, plot.percentage = 100) } \arguments{ \item{dat}{Dataframe to take info from.} \item{...
\name{pairwise.fc} \alias{pairwise.fc} \title{ Compute pairwise fold changes } \description{ This function computes pairwise fold changes. It also works for logarithmic data. } \usage{ pairwise.fc(x, g, ave = mean, log = TRUE, base = 2, mod.fc = TRUE, ...) } \arguments{ \item{x}{ numeric vector. } \item{g}{ g...
/man/pairwiseFC.Rd
no_license
stamats/MKmisc
R
false
false
1,798
rd
\name{pairwise.fc} \alias{pairwise.fc} \title{ Compute pairwise fold changes } \description{ This function computes pairwise fold changes. It also works for logarithmic data. } \usage{ pairwise.fc(x, g, ave = mean, log = TRUE, base = 2, mod.fc = TRUE, ...) } \arguments{ \item{x}{ numeric vector. } \item{g}{ g...
############################################################################### # Script to run the total analysis of the Myrcia specimen database # # # # Runs the analysis from end to end on the specimen data extracted from our # ...
/run_analysis.R
no_license
barnabywalker/monographic_db_changes_analysis
R
false
false
1,116
r
############################################################################### # Script to run the total analysis of the Myrcia specimen database # # # # Runs the analysis from end to end on the specimen data extracted from our # ...
context("obtain_existing_path") # Function in R/utility.R # Setup ------------------------------------------------------------------------ # Create and move to a temporary, nested directory tmp_dir <- tempfile("test-obtain_existing_path-") nested_dir <- file.path(tmp_dir, "nested") cwd <- getwd() on.exit(setwd(cwd))...
/tests/testthat/test-obtain_existing_path.R
permissive
antass/workflowr
R
false
false
4,203
r
context("obtain_existing_path") # Function in R/utility.R # Setup ------------------------------------------------------------------------ # Create and move to a temporary, nested directory tmp_dir <- tempfile("test-obtain_existing_path-") nested_dir <- file.path(tmp_dir, "nested") cwd <- getwd() on.exit(setwd(cwd))...
library(shiny) shinyUI( fluidPage( titlePanel("Linear Regression"), p("Documentation"), p("For Coursera evaluation - Perform linear regression on your csv/txst file and predict based on new entries"), p("The first tab shows the model and its parameters"), p("The second tab shows your predict dat...
/ui.R
no_license
ameliachen/dataproducts
R
false
false
1,599
r
library(shiny) shinyUI( fluidPage( titlePanel("Linear Regression"), p("Documentation"), p("For Coursera evaluation - Perform linear regression on your csv/txst file and predict based on new entries"), p("The first tab shows the model and its parameters"), p("The second tab shows your predict dat...
#' Add data to an object #' #' Update the contents of a Matrix or matrix object, adding new dimension #' indices if necessary. #' #' @param x An object to add data to, either specified by name or by value. #' If specified by name (as a character vector), the object is changed in place (i.e., the function will hav...
/varray/pkg/R/add.data.Matrix.R
permissive
tplate/fuzzy-llama
R
false
false
9,478
r
#' Add data to an object #' #' Update the contents of a Matrix or matrix object, adding new dimension #' indices if necessary. #' #' @param x An object to add data to, either specified by name or by value. #' If specified by name (as a character vector), the object is changed in place (i.e., the function will hav...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ScriptFonctionsSourcesVpack.r \name{RepNAbyMean} \alias{RepNAbyMean} \title{Replace NA by mean} \usage{ RepNAbyMean(TAB) } \arguments{ \item{TAB}{a table with numeric values with possible NAs} } \value{ the same table as TAB but without anymo...
/man/RepNAbyMean.Rd
no_license
RenaudJau/Renaudpack2
R
false
true
606
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ScriptFonctionsSourcesVpack.r \name{RepNAbyMean} \alias{RepNAbyMean} \title{Replace NA by mean} \usage{ RepNAbyMean(TAB) } \arguments{ \item{TAB}{a table with numeric values with possible NAs} } \value{ the same table as TAB but without anymo...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/add_vep.R \name{add_vep} \alias{add_vep} \title{Adds Variant Effect Predictor information to an edit_table object} \usage{ add_vep(this, vep_file) } \arguments{ \item{this}{an edit_table object} \item{vep_file}{character giving path ...
/man/add_vep.Rd
no_license
sudhaveturi/editTools
R
false
false
491
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/add_vep.R \name{add_vep} \alias{add_vep} \title{Adds Variant Effect Predictor information to an edit_table object} \usage{ add_vep(this, vep_file) } \arguments{ \item{this}{an edit_table object} \item{vep_file}{character giving path ...
#' Raw reads for paralog screen from CHyMErA paper #' #' A dataset containing raw read counts from a paralog-targeting library #' using the CHyMErA system, as described in Gonatopoulos-Pournatzis et al. #' (2020). #' #' @format A data frame with 92,746 rows and 32 variables: #' \describe{ #' \item{ID}{guide ID} #' ...
/R/data.R
permissive
HenryWard/orthrus
R
false
false
4,110
r
#' Raw reads for paralog screen from CHyMErA paper #' #' A dataset containing raw read counts from a paralog-targeting library #' using the CHyMErA system, as described in Gonatopoulos-Pournatzis et al. #' (2020). #' #' @format A data frame with 92,746 rows and 32 variables: #' \describe{ #' \item{ID}{guide ID} #' ...
#' For a given process \code{X} eigendecompose it's spectral density #' and use an inverse fourier transform to get coefficients of the optimal #' filter. For details please refer to Hormann et al paper. #' #' @title Compute DPCA filter coefficients #' @param X multivariate stationary time series #' @param V correlatio...
/freqdom/R/dprcomp.R
no_license
ingted/R-Examples
R
false
false
1,600
r
#' For a given process \code{X} eigendecompose it's spectral density #' and use an inverse fourier transform to get coefficients of the optimal #' filter. For details please refer to Hormann et al paper. #' #' @title Compute DPCA filter coefficients #' @param X multivariate stationary time series #' @param V correlatio...
library(dplyr) library(tidyr) library(sqldf) setwd("C:/Users/slc404/OneDrive - Sherwin-Williams/Rprojects/Coursera/Exploratory Data Analysis/Week 1") data <- read.csv.sql("household_power_consumption.txt", sql = "select * from file where Date == '1/2/2007' ", header = TRUE, sep = ";") data2 <- read.csv.sql("househ...
/ExData_Plotting1-master/Plot1.R
no_license
pirlojeh/datasciencecoursera
R
false
false
714
r
library(dplyr) library(tidyr) library(sqldf) setwd("C:/Users/slc404/OneDrive - Sherwin-Williams/Rprojects/Coursera/Exploratory Data Analysis/Week 1") data <- read.csv.sql("household_power_consumption.txt", sql = "select * from file where Date == '1/2/2007' ", header = TRUE, sep = ";") data2 <- read.csv.sql("househ...
##'Extreme Learning Machine Cox Model for High Dimensional Survival Analysis ##' @title ELMCoxBAR ##' @param x The covariates(predictor variables) of training data. ##' @param y Survival time and censored status of training data. Must be a Surv \code{survival} object ##' @param Kernel_type Type of kernel matrix. Cur...
/R/ELMCoxBAR.R
no_license
whcsu/ELMCoxBAR
R
false
false
3,625
r
##'Extreme Learning Machine Cox Model for High Dimensional Survival Analysis ##' @title ELMCoxBAR ##' @param x The covariates(predictor variables) of training data. ##' @param y Survival time and censored status of training data. Must be a Surv \code{survival} object ##' @param Kernel_type Type of kernel matrix. Cur...
#' Data Pre-Processor #' #' @description A helper function to assist in pre-processing the user-supplied #' input data for use with other functions. #' Typically, this function will process the data and return another dataframe. #' This function ensures that the supplied data will be compitable with every #' function w...
/R/process_data.R
no_license
marbhic/iglu
R
false
false
7,202
r
#' Data Pre-Processor #' #' @description A helper function to assist in pre-processing the user-supplied #' input data for use with other functions. #' Typically, this function will process the data and return another dataframe. #' This function ensures that the supplied data will be compitable with every #' function w...
#K-Fold cross-validation #Compare results from different values of K #KNN, RandomForest, GLM, or SVN #libraries #library(dplyr) # for data manipulation library(caret) # for model-building #library(DMwR) # for smote implementation #library(purrr) # for functional programming (map) install.packages("pROC") library(pROC)...
/KFoldCrossValidation_Study.R
no_license
christianadriano/ML_VotingAggregation
R
false
false
5,754
r
#K-Fold cross-validation #Compare results from different values of K #KNN, RandomForest, GLM, or SVN #libraries #library(dplyr) # for data manipulation library(caret) # for model-building #library(DMwR) # for smote implementation #library(purrr) # for functional programming (map) install.packages("pROC") library(pROC)...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/quality_control.R \name{positiveControlR2} \alias{positiveControlR2} \title{Plot R2 of positive control counts} \usage{ positiveControlR2(nano) } \arguments{ \item{nano}{The nano object} } \description{ Plot correlation matrix for the top 100...
/nanoR/man/positiveControlR2.Rd
no_license
acolajanni/GENEXPRESSO
R
false
true
430
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/quality_control.R \name{positiveControlR2} \alias{positiveControlR2} \title{Plot R2 of positive control counts} \usage{ positiveControlR2(nano) } \arguments{ \item{nano}{The nano object} } \description{ Plot correlation matrix for the top 100...
### title: plot3.R # # purpose: make plot for Module 4 (Exploratory Data Analysis), # Week 1, Course Project 1 for coursera's data science specialization # # input: electric power consumption data set # https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip # # description of file is...
/plot3.R
no_license
chenerous/ExData_Plotting1
R
false
false
1,512
r
### title: plot3.R # # purpose: make plot for Module 4 (Exploratory Data Analysis), # Week 1, Course Project 1 for coursera's data science specialization # # input: electric power consumption data set # https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip # # description of file is...
library(shiny) library(shinydashboard) library(data.table) library(DT) shinyServer(function(input, output) { vals<-reactiveValues() vals$Data<-data.table( Brands=paste0("Brand",1:10), Forecasted_Growth=sample(1:20,10), Last_Year_Purchase=round(rnorm(10,1000,1000)^2), Contact=paste0("Brand",1:10,"...
/server.R
no_license
odongow/clif_sandbox
R
false
false
5,739
r
library(shiny) library(shinydashboard) library(data.table) library(DT) shinyServer(function(input, output) { vals<-reactiveValues() vals$Data<-data.table( Brands=paste0("Brand",1:10), Forecasted_Growth=sample(1:20,10), Last_Year_Purchase=round(rnorm(10,1000,1000)^2), Contact=paste0("Brand",1:10,"...
library(openair) library(plyr) library(dplyr) library(rmweather) library(ranger) library(magrittr) library(globals) library(future) library(foreach) library(iterators) library(parallel) library(doFuture) library(readxl) library(doParallel) plan(multicore) registerDoParallel(cores = detectCores()- 1) registerDoFuture() ...
/Data and code/2017/Wuhan_Urban/RWshort.R
no_license
songnku/COVID-19-AQ
R
false
false
2,945
r
library(openair) library(plyr) library(dplyr) library(rmweather) library(ranger) library(magrittr) library(globals) library(future) library(foreach) library(iterators) library(parallel) library(doFuture) library(readxl) library(doParallel) plan(multicore) registerDoParallel(cores = detectCores()- 1) registerDoFuture() ...
#' Get a journal citation style from internet repository #' #' @param name Name of the journal, exactly as in \url{https://github.com/citation-style-language/styles}. #' #' @return The CSL file is saved in the working directory #' @export #' #' @examples #' \dontrun{ #' get_csl("peerj") #' } get_csl <- function(name) {...
/R/get_csl.R
permissive
connorp/grateful
R
false
false
563
r
#' Get a journal citation style from internet repository #' #' @param name Name of the journal, exactly as in \url{https://github.com/citation-style-language/styles}. #' #' @return The CSL file is saved in the working directory #' @export #' #' @examples #' \dontrun{ #' get_csl("peerj") #' } get_csl <- function(name) {...
bias.correct <- function(met.bias, vars.met, dat.train, GCM, yrs.cal, n, path.out, seed=2509){ # Inputs: # met.bias = data frame of all daily met data # vars.met = vector of variables to downscale, **in the order they should be done** # dat.train = name of the training dataset # yrs.cal - data frame of the series to...
/scripts/Old Workflow/bias_correct_day_ensloop.R
no_license
PalEON-Project/modeling_met_ensemble
R
false
false
35,477
r
bias.correct <- function(met.bias, vars.met, dat.train, GCM, yrs.cal, n, path.out, seed=2509){ # Inputs: # met.bias = data frame of all daily met data # vars.met = vector of variables to downscale, **in the order they should be done** # dat.train = name of the training dataset # yrs.cal - data frame of the series to...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RMark-package.R \docType{data} \name{wwdo.popan} \alias{wwdo.popan} \alias{wwdo.09} \alias{wwdo.10} \title{White-winged dove Jolly-Seber POPAN Analysis Details} \format{ The format is 2 data frames, one for 2009 and one for 2010. 2009 has 510...
/RMark/man/wwdo.popan.Rd
no_license
jlaake/RMark
R
false
true
9,859
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RMark-package.R \docType{data} \name{wwdo.popan} \alias{wwdo.popan} \alias{wwdo.09} \alias{wwdo.10} \title{White-winged dove Jolly-Seber POPAN Analysis Details} \format{ The format is 2 data frames, one for 2009 and one for 2010. 2009 has 510...
#' XML namespaces. #' #' \code{xml_ns} extracts all namespaces from a document, matching each #' unique namespace url with the prefix it was first associated with. Default #' namespaces are named \code{d1}, \code{d2} etc. Use \code{xml_ns_rename} #' to change the prefixes. Once you have a namespace object, you can pass...
/xml2/R/xml_namespaces.R
no_license
ingted/R-Examples
R
false
false
2,088
r
#' XML namespaces. #' #' \code{xml_ns} extracts all namespaces from a document, matching each #' unique namespace url with the prefix it was first associated with. Default #' namespaces are named \code{d1}, \code{d2} etc. Use \code{xml_ns_rename} #' to change the prefixes. Once you have a namespace object, you can pass...
# Read in prepped data and scz scores #install.packages("semPlot", repos = "file://tsd-evs/shared/R/cran") ## @knitr pf_model_setup require('lavaan') require('semPlot') require('psych') require('tidyverse') require('foreign') itemdat <- read.table('./scratch_data/all_items_prs.txt', header = T) dat...
/scripts/02_pfact_modelling.R
no_license
psychgen/scz-prs-psychopathol-dev
R
false
false
8,655
r
# Read in prepped data and scz scores #install.packages("semPlot", repos = "file://tsd-evs/shared/R/cran") ## @knitr pf_model_setup require('lavaan') require('semPlot') require('psych') require('tidyverse') require('foreign') itemdat <- read.table('./scratch_data/all_items_prs.txt', header = T) dat...
\name{ssDate} \alias{ssDate} \alias{as.ssDate} \alias{is.ssDate} \title{ ssDate Objects } \description{ The function \code{ssDate} is used to create \code{ssDate} (spreadsheet date) objects, which are useful for reading and writing dates in spreadsheet form, i.e., as the number of days since December 30, 1899. ...
/man/ssDate.Rd
no_license
cran/tis
R
false
false
1,673
rd
\name{ssDate} \alias{ssDate} \alias{as.ssDate} \alias{is.ssDate} \title{ ssDate Objects } \description{ The function \code{ssDate} is used to create \code{ssDate} (spreadsheet date) objects, which are useful for reading and writing dates in spreadsheet form, i.e., as the number of days since December 30, 1899. ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Crawler.R \name{get_links} \alias{get_links} \title{Extract the links from the current page and creates a data frame from the links} \usage{ get_links(uri, page, level) } \arguments{ \item{uri}{uri where the links was found} \item{page}{the ...
/man/get_links.Rd
no_license
DDS-MCSM/group-assignment-team-04
R
false
true
555
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Crawler.R \name{get_links} \alias{get_links} \title{Extract the links from the current page and creates a data frame from the links} \usage{ get_links(uri, page, level) } \arguments{ \item{uri}{uri where the links was found} \item{page}{the ...
# script to create landcover layer for use in paper. For the revised analysis, # we're using both the Koppen climate classificaitons and the MODIS MCDQ1 # landcover to generate vpd thresholds for the burnable landscape. This script # is going to combine those two layers for visualization and use with climate # data #...
/r/lc_koppen_mashup.R
permissive
mbjoseph/tmin
R
false
false
2,285
r
# script to create landcover layer for use in paper. For the revised analysis, # we're using both the Koppen climate classificaitons and the MODIS MCDQ1 # landcover to generate vpd thresholds for the burnable landscape. This script # is going to combine those two layers for visualization and use with climate # data #...
\name{ghap.blockgen} \alias{ghap.blockgen} \title{ Haplotype block generator } \description{ This function generates HapBlocks based on sliding windows. The window and the step size can be specified in markers or kbp. For each window, block coordinates are generated. } \usage{ ghap.blockgen(object, windowsize = 10,...
/man/blockgen.Rd
no_license
cran/GHap
R
false
false
1,845
rd
\name{ghap.blockgen} \alias{ghap.blockgen} \title{ Haplotype block generator } \description{ This function generates HapBlocks based on sliding windows. The window and the step size can be specified in markers or kbp. For each window, block coordinates are generated. } \usage{ ghap.blockgen(object, windowsize = 10,...
checkCluster <- function(x=SS){ # Ana Fernandes # makes a check for presence of clustering in SS for (i in 1:length(x$SSid)){ if (length(b<-x[x$SSclustering!='N',]$SSid)>0){ print ("ATTENTION: there is clustering for SSid's:") print (b) stop() } } }
/WKRDB-EST2/subgroup4/funs/checkCluster.R
no_license
ices-eg/WK_RDBES
R
false
false
254
r
checkCluster <- function(x=SS){ # Ana Fernandes # makes a check for presence of clustering in SS for (i in 1:length(x$SSid)){ if (length(b<-x[x$SSclustering!='N',]$SSid)>0){ print ("ATTENTION: there is clustering for SSid's:") print (b) stop() } } }
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ses_operations.R \name{ses_create_configuration_set_tracking_options} \alias{ses_create_configuration_set_tracking_options} \title{Creates an association between a configuration set and a custom domain for open and click event tracking} \usag...
/cran/paws.customer.engagement/man/ses_create_configuration_set_tracking_options.Rd
permissive
TWarczak/paws
R
false
true
1,315
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ses_operations.R \name{ses_create_configuration_set_tracking_options} \alias{ses_create_configuration_set_tracking_options} \title{Creates an association between a configuration set and a custom domain for open and click event tracking} \usag...
#@since 1.8.2 require tk require tkextlib/blt = class Tk::BLT::Bitmap < TkObject extend TkCore == Class Methods --- compose(text, keys = {}) #@todo --- compose_with_name(name, text, keys = {}) #@todo --- data(name) #@todo --- exist?(name) #@todo --- height(name) #@todo --- new(type, name, data, key...
/target/rubydoc/refm/api/src/tkextlib/blt/bitmap.rd
no_license
nacyot/omegat-rurima-ruby
R
false
false
553
rd
#@since 1.8.2 require tk require tkextlib/blt = class Tk::BLT::Bitmap < TkObject extend TkCore == Class Methods --- compose(text, keys = {}) #@todo --- compose_with_name(name, text, keys = {}) #@todo --- data(name) #@todo --- exist?(name) #@todo --- height(name) #@todo --- new(type, name, data, key...
# Copyright 2019 Province of British Columbia # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
/00_data_prep/01_load_moose_data.R
permissive
bcgov/telemetry
R
false
false
8,417
r
# Copyright 2019 Province of British Columbia # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
library(VFS) ### Name: weather ### Title: Ten years of daily weather data ### Aliases: weather ### Keywords: datasets ### ** Examples # state college GHCN data # # created by: # weather <- read.dly(system.file("extdata", "USC00368449.dly", package = "VFS")) data("weather") # same object: 10 years of daily weather ...
/data/genthat_extracted_code/VFS/examples/weather.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
481
r
library(VFS) ### Name: weather ### Title: Ten years of daily weather data ### Aliases: weather ### Keywords: datasets ### ** Examples # state college GHCN data # # created by: # weather <- read.dly(system.file("extdata", "USC00368449.dly", package = "VFS")) data("weather") # same object: 10 years of daily weather ...
# This is the user-interface definition of a Shiny web application. You can # run the application by clicking 'Run App' above. library(shinydashboard) sidebar <- dashboardSidebar( sidebarMenu( menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")), menuItem("Transactions", icon = ...
/sensibank_dashboard/ui.R
no_license
ktb55/sensibank
R
false
false
4,592
r
# This is the user-interface definition of a Shiny web application. You can # run the application by clicking 'Run App' above. library(shinydashboard) sidebar <- dashboardSidebar( sidebarMenu( menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")), menuItem("Transactions", icon = ...
library(glmnet) mydata = read.table("../../../../TrainingSet/FullSet/ReliefF/thyroid.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.05,family="gaussian",standardize=TRUE) sink('./thyroid_023.txt',append=TRUE) p...
/Model/EN/ReliefF/thyroid/thyroid_023.R
no_license
esbgkannan/QSMART
R
false
false
348
r
library(glmnet) mydata = read.table("../../../../TrainingSet/FullSet/ReliefF/thyroid.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.05,family="gaussian",standardize=TRUE) sink('./thyroid_023.txt',append=TRUE) p...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mergeCalls.R \name{mergeCalls} \alias{mergeCalls} \alias{mergeCalls,GRanges-method} \title{Automatic merging of overlapped nucleosome calls} \usage{ mergeCalls( calls, min.overlap = 50, discard.low = 0.2, mc.cores = 1, verbose = TRU...
/man/mergeCalls.Rd
no_license
nucleosome-dynamics/nucleR
R
false
true
2,607
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mergeCalls.R \name{mergeCalls} \alias{mergeCalls} \alias{mergeCalls,GRanges-method} \title{Automatic merging of overlapped nucleosome calls} \usage{ mergeCalls( calls, min.overlap = 50, discard.low = 0.2, mc.cores = 1, verbose = TRU...
pnbinom41 <- function(x, r, p){ sum(choose(r:x - 1, r - 1) * (1 - p)^(r:x - r) * p^r) }
/functions/pnbinom41.R
no_license
anhnguyendepocen/ECON41
R
false
false
90
r
pnbinom41 <- function(x, r, p){ sum(choose(r:x - 1, r - 1) * (1 - p)^(r:x - r) * p^r) }
# load data from txt file (this takes a while) if( !exists("powercon_df") ) powercon_df <- read.csv(file="data/household_power_consumption.txt", header = TRUE, sep = ";", dec=".", stringsAsFactors=FALSE,na.strings=c("NA","NaN", " ","?"), colClasses = c("character","character",rep("numeric",7))) # create subset as we...
/plot3.R
no_license
morpher6/ExData_Plotting1
R
false
false
1,208
r
# load data from txt file (this takes a while) if( !exists("powercon_df") ) powercon_df <- read.csv(file="data/household_power_consumption.txt", header = TRUE, sep = ";", dec=".", stringsAsFactors=FALSE,na.strings=c("NA","NaN", " ","?"), colClasses = c("character","character",rep("numeric",7))) # create subset as we...
#JEFFREY YOUNG, 2017 #there are 4 options for activation functions, 3 with a derivative sigmoid <- function(x,dx){ if(dx==FALSE) temp <- (1/(1+exp(-x))) else temp <- (1/(1+exp(-x)))*(1-(1/(1+exp(-x)))) return(temp) } tootoo <- function(x,dx){ if(dx==FALSE) temp <- (tanh(x)) else temp <- (1/(cosh(x))^2)...
/Feed Forward Neural Network.R
no_license
jyoungeconomics/feedforwardneuralnetwork
R
false
false
5,620
r
#JEFFREY YOUNG, 2017 #there are 4 options for activation functions, 3 with a derivative sigmoid <- function(x,dx){ if(dx==FALSE) temp <- (1/(1+exp(-x))) else temp <- (1/(1+exp(-x)))*(1-(1/(1+exp(-x)))) return(temp) } tootoo <- function(x,dx){ if(dx==FALSE) temp <- (tanh(x)) else temp <- (1/(cosh(x))^2)...
################################################################ ################## Wrangling the Pound Hill Dataset ############ ################################################################ ############# Load the dataset ############### # header = false because the raw data don't have real headers MyData <- as.ma...
/Week3/code/DataWrang.R
no_license
ee-jackson/QMEEbootcamp
R
false
false
2,176
r
################################################################ ################## Wrangling the Pound Hill Dataset ############ ################################################################ ############# Load the dataset ############### # header = false because the raw data don't have real headers MyData <- as.ma...
setwd("../../analysis/hervh") a=read.delim("hervh.dynamicBoundaries.txt",header=F) b=read.delim("hervh.nonDynamicBoundaries.txt",header=F) files = list.files(path="DI",pattern="DI",full.names=T) #for (file in files[seq(1,12,2)]){ t50 = read.delim("hervh.sorted_rnaseq.bed",header=F)[1:50,] t50$name = paste0(t50$V1,":...
/hervh/plotDI.profile.dyn.nondyn.tile.r
no_license
bioinfx/cvdc_scripts
R
false
false
2,988
r
setwd("../../analysis/hervh") a=read.delim("hervh.dynamicBoundaries.txt",header=F) b=read.delim("hervh.nonDynamicBoundaries.txt",header=F) files = list.files(path="DI",pattern="DI",full.names=T) #for (file in files[seq(1,12,2)]){ t50 = read.delim("hervh.sorted_rnaseq.bed",header=F)[1:50,] t50$name = paste0(t50$V1,":...
#avalon x cadenza initial data preperation setwd("C:/Users/ac14037/project.phd.main/") source("rotation1scripts_v4/scripts/r/functions.R") library(dplyr) library(tibble) # ____________________________________________________________________________ # INITIAL PROCESSING ...
/scripts/r/rialto.x.savannah/rialto.x.savannah.initial.data.processing.R
no_license
alexcoulton/phd
R
false
false
8,034
r
#avalon x cadenza initial data preperation setwd("C:/Users/ac14037/project.phd.main/") source("rotation1scripts_v4/scripts/r/functions.R") library(dplyr) library(tibble) # ____________________________________________________________________________ # INITIAL PROCESSING ...
% Generated by roxygen2 (4.0.1): do not edit by hand \name{TaxonChildren} \alias{TaxonChildren} \alias{TaxonParents} \title{Gathers A List Of Taxonomic Parents and Offspring} \usage{ TaxonChildren(MyHiers) TaxonParents(MyHier) } \arguments{ \item{MyHiers}{A vector or single filename for downloaded hierarchy pages} \i...
/man/TaxonChildren.rd
no_license
saulwiggin/reol
R
false
false
1,350
rd
% Generated by roxygen2 (4.0.1): do not edit by hand \name{TaxonChildren} \alias{TaxonChildren} \alias{TaxonParents} \title{Gathers A List Of Taxonomic Parents and Offspring} \usage{ TaxonChildren(MyHiers) TaxonParents(MyHier) } \arguments{ \item{MyHiers}{A vector or single filename for downloaded hierarchy pages} \i...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/init-files.R \name{bdc_init_files} \alias{bdc_init_files} \title{Initializes the files based on a database connection} \usage{ bdc_init_files( con, folder = "files", no_transactions = 50000, batch_size = 5000, no_files = 5 ) } \argu...
/man/bdc_init_files.Rd
permissive
sonthuybacha/big-data
R
false
true
618
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/init-files.R \name{bdc_init_files} \alias{bdc_init_files} \title{Initializes the files based on a database connection} \usage{ bdc_init_files( con, folder = "files", no_transactions = 50000, batch_size = 5000, no_files = 5 ) } \argu...
#------------------------------------------------------------------------------- # Copyright (c) 2019-2020 University of Newcastle upon Tyne. All rights reserved. # # This program and the accompanying materials # are made available under the terms of the GNU Public License v3.0. # # You should have received a copy of t...
/tests/testthat/test-smk-ds.capscale_assign.R
permissive
StuartWheater/dsMicrobiomeClient
R
false
false
2,258
r
#------------------------------------------------------------------------------- # Copyright (c) 2019-2020 University of Newcastle upon Tyne. All rights reserved. # # This program and the accompanying materials # are made available under the terms of the GNU Public License v3.0. # # You should have received a copy of t...
context("Get graph properties") test_that("Getting the graph object log is possible", { # Create a random graph and add # an edge as well graph <- create_graph() %>% add_gnm_graph( n = 10, m = 22, set_seed = 23) %>% add_edge( from = 5, to = 10) # Get the graph's log ...
/tests/testthat/test-get_graph_properties.R
permissive
rich-iannone/DiagrammeR
R
false
false
759
r
context("Get graph properties") test_that("Getting the graph object log is possible", { # Create a random graph and add # an edge as well graph <- create_graph() %>% add_gnm_graph( n = 10, m = 22, set_seed = 23) %>% add_edge( from = 5, to = 10) # Get the graph's log ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot_CIs.R \name{plot_CIs} \alias{plot_CIs} \title{plot_CIs} \usage{ plot_CIs(df, title, plot.contrasts, plot.contrasts.2, ypos, type, offset, labels) } \arguments{ \item{df}{input dataset. Requires a "genotype" column. Response needs to be...
/man/plot_CIs.Rd
no_license
mikeod38/dauergut
R
false
true
1,511
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot_CIs.R \name{plot_CIs} \alias{plot_CIs} \title{plot_CIs} \usage{ plot_CIs(df, title, plot.contrasts, plot.contrasts.2, ypos, type, offset, labels) } \arguments{ \item{df}{input dataset. Requires a "genotype" column. Response needs to be...
################################################################################ ### Map of total people recovered by county ################################################################################ counties$total_recovered_percapita <- round(100 * counties$total_recovered / counties$POP2018, 2) frac <- 0.5 * m...
/maps/total_recovered_percapita.R
no_license
VinayArora404219/TN_COVID
R
false
false
1,466
r
################################################################################ ### Map of total people recovered by county ################################################################################ counties$total_recovered_percapita <- round(100 * counties$total_recovered / counties$POP2018, 2) frac <- 0.5 * m...
#' @title Decompose portfolio risk into individual asset contributions and provide tabular report #' #' @description Compute the asset contributions to Sd, VaR and ES of returns based on Euler's theorem #' #' @importFrom stats cov resid qnorm #' @importFrom xts xts #' #' #' @param object fit object of class \code...
/R/assetDecomp.R
no_license
freephys/factorAnalytics
R
false
false
5,789
r
#' @title Decompose portfolio risk into individual asset contributions and provide tabular report #' #' @description Compute the asset contributions to Sd, VaR and ES of returns based on Euler's theorem #' #' @importFrom stats cov resid qnorm #' @importFrom xts xts #' #' #' @param object fit object of class \code...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pipemodelMain.R \name{rankWDZ} \alias{rankWDZ} \title{rankWDZ} \usage{ rankWDZ(WDZPath, SOBResult, N, newPosClassLabel) } \arguments{ \item{WDZPath}{character} \item{SOBResult}{dataframe} \item{N}{integer} } \value{ a list of the top N Zone...
/man/rankWDZ.Rd
permissive
PelizaC-Jacobs/SOBPredictR
R
false
true
463
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pipemodelMain.R \name{rankWDZ} \alias{rankWDZ} \title{rankWDZ} \usage{ rankWDZ(WDZPath, SOBResult, N, newPosClassLabel) } \arguments{ \item{WDZPath}{character} \item{SOBResult}{dataframe} \item{N}{integer} } \value{ a list of the top N Zone...
#' Plot Expected And Simulated Values #' #' This function will take two data.frames, a simulated and an expected data.frame, and plots the points over top of each other to visualize just how closely they match. #' #' @param expDf This is a data.frame of expected results for a plot. Must contain a "Step" column (x-axis)...
/R/plotExpSim.R
no_license
davis-research/SortieIO
R
false
false
3,874
r
#' Plot Expected And Simulated Values #' #' This function will take two data.frames, a simulated and an expected data.frame, and plots the points over top of each other to visualize just how closely they match. #' #' @param expDf This is a data.frame of expected results for a plot. Must contain a "Step" column (x-axis)...
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307392674e+77, 7.2928470650322e-304, 1.22810536108214e+146, 4.12396251261199e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(8L, 3L))) result <- do.call(CNull:::communities_individual_based_sampling_alpha,testlist) str...
/CNull/inst/testfiles/communities_individual_based_sampling_alpha/AFL_communities_individual_based_sampling_alpha/communities_individual_based_sampling_alpha_valgrind_files/1615784790-test.R
no_license
akhikolla/updatedatatype-list2
R
false
false
328
r
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307392674e+77, 7.2928470650322e-304, 1.22810536108214e+146, 4.12396251261199e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(8L, 3L))) result <- do.call(CNull:::communities_individual_based_sampling_alpha,testlist) str...
#' @import lme4 methods #' @importFrom stats dnorm na.omit pchisq pnorm qnorm quantile resid summary.glm # Extending glmerMod to contain RR parameters for plot and summary functions RRglmerMod <- setClass( # Set the name for the class "RRglmerMod", # Store the RR parameters in a list slots = c(RRparam = "list...
/GLMMRR/R/RRglmer.R
no_license
ingted/R-Examples
R
false
false
5,976
r
#' @import lme4 methods #' @importFrom stats dnorm na.omit pchisq pnorm qnorm quantile resid summary.glm # Extending glmerMod to contain RR parameters for plot and summary functions RRglmerMod <- setClass( # Set the name for the class "RRglmerMod", # Store the RR parameters in a list slots = c(RRparam = "list...
#Set the working directory setwd("~/Text-Analysis/") #Call libraries used in the script library(wordcloud) library(tm) library(RColorBrewer) library(twitteR) #unzip file zipF<- "data/twitter/neverAgain.csv.zip" outDir<-"data/twitter" unzip(zipF,exdir=outDir) #load file with saved tweets tweets <- read.csv("data/twi...
/RScripts/wordcloudTwitter.R
no_license
fiore969/Text-Analysis
R
false
false
1,827
r
#Set the working directory setwd("~/Text-Analysis/") #Call libraries used in the script library(wordcloud) library(tm) library(RColorBrewer) library(twitteR) #unzip file zipF<- "data/twitter/neverAgain.csv.zip" outDir<-"data/twitter" unzip(zipF,exdir=outDir) #load file with saved tweets tweets <- read.csv("data/twi...
##===================================## ## Author: Guido España ##===================================## ## Libraries------------- ##===================================## library(tidyverse) output_dir = '../output' output_dir_sims = '../output_experiments' ##===================================## ## Gather data---------...
/analysis/scripts/collect_data_uncertainty_scenarios.R
no_license
confunguido/prioritizing_interventions_basic_training
R
false
false
1,119
r
##===================================## ## Author: Guido España ##===================================## ## Libraries------------- ##===================================## library(tidyverse) output_dir = '../output' output_dir_sims = '../output_experiments' ##===================================## ## Gather data---------...
# This file is generated by make.paws. Please do not edit here. #' @importFrom paws.common populate #' @include cloudcontrolapi_service.R NULL .cloudcontrolapi$cancel_resource_request_input <- function(...) { args <- c(as.list(environment()), list(...)) shape <- structure(list(RequestToken = structure(logical(0), ...
/cran/paws.developer.tools/R/cloudcontrolapi_interfaces.R
permissive
paws-r/paws
R
false
false
11,202
r
# This file is generated by make.paws. Please do not edit here. #' @importFrom paws.common populate #' @include cloudcontrolapi_service.R NULL .cloudcontrolapi$cancel_resource_request_input <- function(...) { args <- c(as.list(environment()), list(...)) shape <- structure(list(RequestToken = structure(logical(0), ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/fsl_bet.R, R/fslhd.R \name{fsl_bet} \alias{fsl_bet} \alias{fslbet} \title{Use FSL's Brain Extraction Tool (BET)} \usage{ fsl_bet(..., outfile = tempfile(fileext = ".nii.gz"), retimg = FALSE) fslbet(infile, outfile = NULL, retimg = TRUE, reor...
/man/fslbet.Rd
no_license
STMhub/fslr
R
false
true
1,273
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/fsl_bet.R, R/fslhd.R \name{fsl_bet} \alias{fsl_bet} \alias{fslbet} \title{Use FSL's Brain Extraction Tool (BET)} \usage{ fsl_bet(..., outfile = tempfile(fileext = ".nii.gz"), retimg = FALSE) fslbet(infile, outfile = NULL, retimg = TRUE, reor...
#' Turn ticks inward #' #' @export inward_tick <- function(length = 2, unit = "mm"){ list( theme(axis.ticks.length = unit(-length, unit), axis.ticks = element_line(size = rel(.5)), axis.text.x = element_text(margin = unit(c(2*length, 0, 0, 0), units = unit)), ...
/R/ggplot_theme.R
no_license
KeachMurakami/funkea
R
false
false
1,954
r
#' Turn ticks inward #' #' @export inward_tick <- function(length = 2, unit = "mm"){ list( theme(axis.ticks.length = unit(-length, unit), axis.ticks = element_line(size = rel(.5)), axis.text.x = element_text(margin = unit(c(2*length, 0, 0, 0), units = unit)), ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/v1_nonlinear_TSNE.R \name{do.tsne} \alias{do.tsne} \title{t-distributed Stochastic Neighbor Embedding} \usage{ do.tsne( X, ndim = 2, perplexity = 30, eta = 0.05, maxiter = 2000, jitter = 0.3, jitterdecay = 0.99, momentum = 0.5...
/man/nonlinear_TSNE.Rd
permissive
weiquanpan/Rdimtools
R
false
true
2,920
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/v1_nonlinear_TSNE.R \name{do.tsne} \alias{do.tsne} \title{t-distributed Stochastic Neighbor Embedding} \usage{ do.tsne( X, ndim = 2, perplexity = 30, eta = 0.05, maxiter = 2000, jitter = 0.3, jitterdecay = 0.99, momentum = 0.5...
############################################################################# ## Question 5 ## ## Cut the GDP ranking into 5 separate quantile groups. ## Make a table versus Income.Group. ## How many countries are Lower middle income but among the 38 nations ## with highest GDP? ## ## See Q-3.R ####################...
/Quiz-3/Q-5.R
no_license
tsloan/GettingCleaningData
R
false
false
377
r
############################################################################# ## Question 5 ## ## Cut the GDP ranking into 5 separate quantile groups. ## Make a table versus Income.Group. ## How many countries are Lower middle income but among the 38 nations ## with highest GDP? ## ## See Q-3.R ####################...
#:# libraries library(digest) library(mlr) library(OpenML) library(farff) #:# config set.seed(1) #:# data dataset <- getOMLDataSet(data.name = "PhishingWebsites") head(dataset$data) #:# preprocessing head(dataset$data) #:# model task = makeClassifTask(id = "task", data = dataset$data, target = "Result") lrn = makeL...
/models/openml_PhishingWebsites/classification_Result/6cf90a71b3943a69ea85088848249b3b/code.R
no_license
pysiakk/CaseStudies2019S
R
false
false
726
r
#:# libraries library(digest) library(mlr) library(OpenML) library(farff) #:# config set.seed(1) #:# data dataset <- getOMLDataSet(data.name = "PhishingWebsites") head(dataset$data) #:# preprocessing head(dataset$data) #:# model task = makeClassifTask(id = "task", data = dataset$data, target = "Result") lrn = makeL...
library(scorecardModelUtils) ### Name: missing_val ### Title: Missing value imputation ### Aliases: missing_val ### ** Examples data <- iris data$Species <- as.character(data$Species) data$Y <- sample(0:1,size=nrow(data),replace=TRUE) data[sample(1:nrow(data),size=25),"Sepal.Length"] <- NA data[sample(1:nrow(data),...
/data/genthat_extracted_code/scorecardModelUtils/examples/missing_val.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
449
r
library(scorecardModelUtils) ### Name: missing_val ### Title: Missing value imputation ### Aliases: missing_val ### ** Examples data <- iris data$Species <- as.character(data$Species) data$Y <- sample(0:1,size=nrow(data),replace=TRUE) data[sample(1:nrow(data),size=25),"Sepal.Length"] <- NA data[sample(1:nrow(data),...
# header---- library(xlsx) library(data.table) library(plyr) library(stats) library(lubridate) save(list=ls(all=T),file='EDA.RData') setwd("~/Google Drive/Purdue University/Academics/Sem-2/PredModel/Project/CSV") # data---- # import data lst<-list.files() length(lst) for (i in 1:length(lst)) { assign(paste("df.",to...
/meta/Station Data(woAOT)/EDA_complete.R
no_license
nikhilsoni1/Air-Quality-Prediction
R
false
false
1,309
r
# header---- library(xlsx) library(data.table) library(plyr) library(stats) library(lubridate) save(list=ls(all=T),file='EDA.RData') setwd("~/Google Drive/Purdue University/Academics/Sem-2/PredModel/Project/CSV") # data---- # import data lst<-list.files() length(lst) for (i in 1:length(lst)) { assign(paste("df.",to...
/g_knn.result.R
no_license
floroChen/SPinterpoleMethComparison
R
false
false
1,564
r
# set comparison tolerance tol <- 0.0001 context("Test `build_datalist()` behavior") test_that("Test build_datalist()", { expect_true(length(build_datalist(mtcars, at = list(cyl = c(4,6)))) == 2) expect_true(length(build_datalist(mtcars, at = list(cyl = c(4,6), wt = c(1,1.5)))) == 4) #expect_error(build_da...
/tests/testthat/tests-core.R
no_license
jonrobinson2/margins
R
false
false
3,444
r
# set comparison tolerance tol <- 0.0001 context("Test `build_datalist()` behavior") test_that("Test build_datalist()", { expect_true(length(build_datalist(mtcars, at = list(cyl = c(4,6)))) == 2) expect_true(length(build_datalist(mtcars, at = list(cyl = c(4,6), wt = c(1,1.5)))) == 4) #expect_error(build_da...
########## # Ex. 01 ########## # Assign the url to the csv file. data_file = 'lab1_sbuxPrices.csv' # Load the data frame using read.csv sbux_df = read.csv(data_file, header = TRUE, stringsAsFactors = FALSE) # sbux_df should be a data frame object. Data frames are rectangular data # objects typically with observation...
/coursera/comp-finance-econometrics/lab1.R
no_license
Peque/peque
R
false
false
6,124
r
########## # Ex. 01 ########## # Assign the url to the csv file. data_file = 'lab1_sbuxPrices.csv' # Load the data frame using read.csv sbux_df = read.csv(data_file, header = TRUE, stringsAsFactors = FALSE) # sbux_df should be a data frame object. Data frames are rectangular data # objects typically with observation...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{UCSCStyle} \alias{UCSCStyle} \title{UCSCStyle} \usage{ UCSCStyle(x) } \arguments{ \item{x}{(GRanges, GRangesList or list of GRanges) The object to transform to UCSC style} } \value{ The same x object with the styles of the seqle...
/man/UCSCStyle.Rd
no_license
bernatgel/CopyNumberPlots
R
false
true
1,811
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{UCSCStyle} \alias{UCSCStyle} \title{UCSCStyle} \usage{ UCSCStyle(x) } \arguments{ \item{x}{(GRanges, GRangesList or list of GRanges) The object to transform to UCSC style} } \value{ The same x object with the styles of the seqle...
NN_Repeated <- function(Data, DV_Name, Activation = 'tanh', Hidden = c(6, 4, 2), Algorithm = 'rprop+', Stepmax = 3e4, Threshold = 1, Rep = 5, Seed = 1, Trace = TRUE, Plot = TRUE) { library('neuralnet') ############################################################################################################...
/NeuralNetworks_Repeated.R
no_license
adityatadimeti/wildfire-prediction
R
false
false
1,494
r
NN_Repeated <- function(Data, DV_Name, Activation = 'tanh', Hidden = c(6, 4, 2), Algorithm = 'rprop+', Stepmax = 3e4, Threshold = 1, Rep = 5, Seed = 1, Trace = TRUE, Plot = TRUE) { library('neuralnet') ############################################################################################################...
zero_x = function(sound) { word = sound@left start_samp = word[1] end_samp = word[length(word)] start_idx = 1 end_idx = length(word) # Zero Crossing works # If start is postive if (start_samp >= 0) { while (start_samp >= 0) { start_idx = start_idx + 1 start_samp = word[start_idx] } } else if (star...
/zero_x.R
no_license
ryancallihan/r_audio_manipulation_morpheme
R
false
false
1,622
r
zero_x = function(sound) { word = sound@left start_samp = word[1] end_samp = word[length(word)] start_idx = 1 end_idx = length(word) # Zero Crossing works # If start is postive if (start_samp >= 0) { while (start_samp >= 0) { start_idx = start_idx + 1 start_samp = word[start_idx] } } else if (star...