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
# # Data Wrangling en R para Programadores SQL # Autor: Marciano Moreno, marciano_moreno@acm.org # # dplyr.R - Demostración de Dplyr install.packages("dplyr") install.packages(c("nycflights13", "Lahman")) install.packages("RSQLite") library(dplyr) library(nycflights13) library(RSQLite) #Exploración de datos ref_fligh...
/dplyr.R
no_license
marcianomoreno/datawrangling
R
false
false
2,566
r
# # Data Wrangling en R para Programadores SQL # Autor: Marciano Moreno, marciano_moreno@acm.org # # dplyr.R - Demostración de Dplyr install.packages("dplyr") install.packages(c("nycflights13", "Lahman")) install.packages("RSQLite") library(dplyr) library(nycflights13) library(RSQLite) #Exploración de datos ref_fligh...
# function for simulating data for model M_0 with t capture occassions # paramters is a list of parameters need to generate the data described below # output is the desired data to output, can return W, Wp C or S # 3/15/2016 source("Simulate_X.R") source("X_to_C.R") source("Simulate_S.R") sim.data.M0<-function(paramet...
/Code/Sim_Data.R
no_license
AmandaEllis/Sampler_Project
R
false
false
2,412
r
# function for simulating data for model M_0 with t capture occassions # paramters is a list of parameters need to generate the data described below # output is the desired data to output, can return W, Wp C or S # 3/15/2016 source("Simulate_X.R") source("X_to_C.R") source("Simulate_S.R") sim.data.M0<-function(paramet...
# This is the user-interface definition of a Shiny web application. # You can find out more about building applications with Shiny here: # # http://shiny.rstudio.com # library(shiny) library(shinydashboard) library(ggplot2) library(dplyr) library(DT) library(data.table) library(naniar) library(visdat) library(skimr) ...
/app.R
no_license
BioData-Club/nhanes_explore
R
false
false
12,708
r
# This is the user-interface definition of a Shiny web application. # You can find out more about building applications with Shiny here: # # http://shiny.rstudio.com # library(shiny) library(shinydashboard) library(ggplot2) library(dplyr) library(DT) library(data.table) library(naniar) library(visdat) library(skimr) ...
#' Read a Minitab Portable Worksheet with an .mtp3 file extension. #' #' This function will load the specified Minitab Portable Worksheet into #' memory. #' #' @param data.file The name of the data file to be read. #' @param x The path to the data set to be loaded. #' @param variable.name The name to be assigned to in ...
/R/reader.mtp.R
no_license
arturochian/LoadMyData
R
false
false
736
r
#' Read a Minitab Portable Worksheet with an .mtp3 file extension. #' #' This function will load the specified Minitab Portable Worksheet into #' memory. #' #' @param data.file The name of the data file to be read. #' @param x The path to the data set to be loaded. #' @param variable.name The name to be assigned to in ...
### Started 8 December 2015 ## ### By Ailene Ettinger ### setwd("~/Documents/GitHub/radcliffe") rm(list=ls()) options(stringsAsFactors=FALSE) ##load packages library(reshape) library(tidyr) # make list to store all the derived dataset cleaning functions clean.raw <- list() clean.raw$marchin <- function(filename="Budbu...
/Analyses/radcliffe_merge_exp.R
no_license
AileneKane/radcliffe
R
false
false
68,618
r
### Started 8 December 2015 ## ### By Ailene Ettinger ### setwd("~/Documents/GitHub/radcliffe") rm(list=ls()) options(stringsAsFactors=FALSE) ##load packages library(reshape) library(tidyr) # make list to store all the derived dataset cleaning functions clean.raw <- list() clean.raw$marchin <- function(filename="Budbu...
#' @rdname plot.spv #' @method plot spvlistforlist #' @export plot.spvlistforlist <- function (x, which =c("fds", "vdgsim", "vdgquantile", "vdgboth", "boxplots"), np = 50, alpha = 7/sqrt(length(x[[1]][[1]]$spv)), points.colour = "#39BEB1", points.s...
/R/plot.spvlistforlist.R
no_license
cran/vdg
R
false
false
8,107
r
#' @rdname plot.spv #' @method plot spvlistforlist #' @export plot.spvlistforlist <- function (x, which =c("fds", "vdgsim", "vdgquantile", "vdgboth", "boxplots"), np = 50, alpha = 7/sqrt(length(x[[1]][[1]]$spv)), points.colour = "#39BEB1", points.s...
library(googlesheets) ### Name: gs_read_cellfeed ### Title: Read data from cells ### Aliases: gs_read_cellfeed ### ** Examples ## Not run: ##D gap_ss <- gs_gap() # register the Gapminder example sheet ##D col_4_and_above <- ##D gs_read_cellfeed(gap_ss, ws = "Asia", range = cell_limits(c(NA, 4))) ##D col_4_and_ab...
/data/genthat_extracted_code/googlesheets/examples/gs_read_cellfeed.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
435
r
library(googlesheets) ### Name: gs_read_cellfeed ### Title: Read data from cells ### Aliases: gs_read_cellfeed ### ** Examples ## Not run: ##D gap_ss <- gs_gap() # register the Gapminder example sheet ##D col_4_and_above <- ##D gs_read_cellfeed(gap_ss, ws = "Asia", range = cell_limits(c(NA, 4))) ##D col_4_and_ab...
lns <- readLines('README.Rmd') vcr_start <- grep("vcr", lns)[1] f <- basename(tempfile(fileext = ".Rmd")) cat(lns[vcr_start:length(lns)], file=f, sep="\n") knitr::knit(f, output = "README.md") unlink(f)
/make_readme.R
permissive
ropensci/vcr
R
false
false
203
r
lns <- readLines('README.Rmd') vcr_start <- grep("vcr", lns)[1] f <- basename(tempfile(fileext = ".Rmd")) cat(lns[vcr_start:length(lns)], file=f, sep="\n") knitr::knit(f, output = "README.md") unlink(f)
library(tm) library(stringr) library(dplyr) library(e1071) load(file = "informacion.Rdata") load( file = "questions_2015.Rdata") # We are going to apply preprocesing text mining functions questions_corpus <- Corpus(VectorSource(questions$body)) remove_lat <- function(x){gsub("<p>","",x)} questions_corpus = tm_...
/score_classification.R
no_license
Qalfredo/StackExchange-Project
R
false
false
2,048
r
library(tm) library(stringr) library(dplyr) library(e1071) load(file = "informacion.Rdata") load( file = "questions_2015.Rdata") # We are going to apply preprocesing text mining functions questions_corpus <- Corpus(VectorSource(questions$body)) remove_lat <- function(x){gsub("<p>","",x)} questions_corpus = tm_...
# This is the user-interface definition of a Shiny web application. # You can find out more about building applications with Shiny here: # # http://shiny.rstudio.com # library(shiny) library(dplyr) library(openxlsx) library(plotly) library(DT) shinyUI(fluidPage( titlePanel("Fay-Herriot model"), sidebarLayout( ...
/ui.R
no_license
WojciechDopieralski/shinyFHmodel
R
false
false
2,918
r
# This is the user-interface definition of a Shiny web application. # You can find out more about building applications with Shiny here: # # http://shiny.rstudio.com # library(shiny) library(dplyr) library(openxlsx) library(plotly) library(DT) shinyUI(fluidPage( titlePanel("Fay-Herriot model"), sidebarLayout( ...
\name{comm2sci} \alias{comm2sci} \title{Get scientific names from common names.} \usage{ comm2sci(commnames, db = "eol", itisby = "search", simplify = TRUE, ...) } \arguments{ \item{commnames}{One or more common names or partial names.} \item{db}{Data source, one of \emph{"eol"} (default), \emph{"itis"}, \emph...
/man/comm2sci.Rd
permissive
dlebauer/taxize_
R
false
false
1,569
rd
\name{comm2sci} \alias{comm2sci} \title{Get scientific names from common names.} \usage{ comm2sci(commnames, db = "eol", itisby = "search", simplify = TRUE, ...) } \arguments{ \item{commnames}{One or more common names or partial names.} \item{db}{Data source, one of \emph{"eol"} (default), \emph{"itis"}, \emph...
#' Calculates the threshold for one condition #' \code{one_threshold} calculates the threshold for one condition #' one_threshold #' @keywords internal #' @export one_threshold <- function(d, prob, log, groups, funname, guess, lapses, curves) { if (length(groups) == 0) curves <- curves el...
/R/one_threshold.R
no_license
cran/quickpsy
R
false
false
1,404
r
#' Calculates the threshold for one condition #' \code{one_threshold} calculates the threshold for one condition #' one_threshold #' @keywords internal #' @export one_threshold <- function(d, prob, log, groups, funname, guess, lapses, curves) { if (length(groups) == 0) curves <- curves el...
## Watson Language Identification # IBM SPSS Modeler Node # Install function for packages packages <- function(x){ x <- as.character(match.call()[[2]]) if (!require(x,character.only=TRUE)){ install.packages(pkgs=x,repos="http://cran.r-project.org") require(x,character.only=TRUE) } } packages(httr...
/Source code/script.r
permissive
KushalVenkatesh/Watson_Language_ID
R
false
false
2,376
r
## Watson Language Identification # IBM SPSS Modeler Node # Install function for packages packages <- function(x){ x <- as.character(match.call()[[2]]) if (!require(x,character.only=TRUE)){ install.packages(pkgs=x,repos="http://cran.r-project.org") require(x,character.only=TRUE) } } packages(httr...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/01Classes.R \name{newparam} \alias{newparam} \title{Create new simulation control parameter object} \usage{ newparam(dataframe, type = "default", x, z) } \arguments{ \item{dataframe}{(data frame) original data to be used in simulatio...
/man/newparam.Rd
no_license
cran/preprosim
R
false
true
1,506
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/01Classes.R \name{newparam} \alias{newparam} \title{Create new simulation control parameter object} \usage{ newparam(dataframe, type = "default", x, z) } \arguments{ \item{dataframe}{(data frame) original data to be used in simulatio...
# Test de chi-cuadrado # Al responder 30 personas una encuesta con respuestas: mucho, normal, poco; se obtienen los resultados: 15, 5, 10, respectivamente # ¿Estos resultados son significativamente distintos de unas respuestas equiprobables, es decir, 10, 10, 10? respuestas <- c(15,5,10) probabilidad <- rep(1/3,3) t...
/estadistica/chi-cuadrado_test.R
no_license
jjdeharo/General
R
false
false
378
r
# Test de chi-cuadrado # Al responder 30 personas una encuesta con respuestas: mucho, normal, poco; se obtienen los resultados: 15, 5, 10, respectivamente # ¿Estos resultados son significativamente distintos de unas respuestas equiprobables, es decir, 10, 10, 10? respuestas <- c(15,5,10) probabilidad <- rep(1/3,3) t...
testlist <- list(G = numeric(0), Rn = numeric(0), atmp = numeric(0), ra = numeric(0), relh = numeric(0), rs = numeric(0), temp = c(8.5728629954997e-312, 1.56898424065867e+82, 8.96970809549085e-158, -1.3258495253834e-113, 2.79620616433656e-119, -6.80033518839696e+41, 2.68298522855314e-211, 1444042902...
/meteor/inst/testfiles/ET0_PenmanMonteith/AFL_ET0_PenmanMonteith/ET0_PenmanMonteith_valgrind_files/1615839383-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
1,054
r
testlist <- list(G = numeric(0), Rn = numeric(0), atmp = numeric(0), ra = numeric(0), relh = numeric(0), rs = numeric(0), temp = c(8.5728629954997e-312, 1.56898424065867e+82, 8.96970809549085e-158, -1.3258495253834e-113, 2.79620616433656e-119, -6.80033518839696e+41, 2.68298522855314e-211, 1444042902...
##### This code helps ##### 1. locate the grid info for each project ##### 2. create the buffer using different radius and ##### 3. find out grid that are located in the buffer region. ##### We use multiple file as input, ##### Load Data ##### aid <- readOGR(dsn = path.expand("/Users/mxube/Desktop/aid/reduced_vers...
/aid/reduced_version/only_africa/aid_buffer/buffer_generate.R
no_license
Abel73/China-Aid-and-Africa-Conflict
R
false
false
2,848
r
##### This code helps ##### 1. locate the grid info for each project ##### 2. create the buffer using different radius and ##### 3. find out grid that are located in the buffer region. ##### We use multiple file as input, ##### Load Data ##### aid <- readOGR(dsn = path.expand("/Users/mxube/Desktop/aid/reduced_vers...
testlist <- list(data = structure(4.89053717943093e-315, .Dim = c(1L, 1L)), x = structure(c(1.39069146974254e-309, 3.94604863000294e-114, 1.26575548613742e-309, 4.78479882539232e-304, 2.64895706299806e-260, 1.0323506673724e-310, 3.75956971383845e-227, 0, 2.90905852271326e-319, 1.39069146974254e-309,...
/distr6/inst/testfiles/C_EmpiricalMVPdf/libFuzzer_C_EmpiricalMVPdf/C_EmpiricalMVPdf_valgrind_files/1610036724-test.R
no_license
akhikolla/updated-only-Issues
R
false
false
724
r
testlist <- list(data = structure(4.89053717943093e-315, .Dim = c(1L, 1L)), x = structure(c(1.39069146974254e-309, 3.94604863000294e-114, 1.26575548613742e-309, 4.78479882539232e-304, 2.64895706299806e-260, 1.0323506673724e-310, 3.75956971383845e-227, 0, 2.90905852271326e-319, 1.39069146974254e-309,...
## read in emissions data and classification code emissions_data <- readRDS("summarySCC_PM25.rds") class_code <- readRDS("Source_Classification_Code.rds") ## subset data from Baltimore City, LA county and from type "on road" baltLA_car_data <- subset(emissions_data, emissions_data$fips=="24510" | ...
/plot6.R
no_license
Paresh1110/ExData4
R
false
false
992
r
## read in emissions data and classification code emissions_data <- readRDS("summarySCC_PM25.rds") class_code <- readRDS("Source_Classification_Code.rds") ## subset data from Baltimore City, LA county and from type "on road" baltLA_car_data <- subset(emissions_data, emissions_data$fips=="24510" | ...
model <- DualEndpointBeta(E0 = c(0, 100), Emax = c(0, 500), delta1 = c(0, 5), mode = c(1, 15), refDose=10, useLogDose=TRUE, refDoseBeta = 1000, ...
/examples/Model-class-DualEndpointBeta.R
no_license
insightsengineering/crmPack
R
false
false
506
r
model <- DualEndpointBeta(E0 = c(0, 100), Emax = c(0, 500), delta1 = c(0, 5), mode = c(1, 15), refDose=10, useLogDose=TRUE, refDoseBeta = 1000, ...
###################################################################################################### # Title: Functions for various exploratory analysis operations on data frames # Author: Sanjay, Dheekshitha PS # Created on: June 14, 2018 # Description: Consolidated file for all functionsto be used out of the box fo...
/R/r-batch-eda-utilities.R
no_license
zhaoxiaohe/analysisPipelines
R
false
false
17,098
r
###################################################################################################### # Title: Functions for various exploratory analysis operations on data frames # Author: Sanjay, Dheekshitha PS # Created on: June 14, 2018 # Description: Consolidated file for all functionsto be used out of the box fo...
# Qualitative variable modeling (classification problem) # data source: https://www.kaggle.com/sakshigoyal7/credit-card-customers # exploratory data alysis done additionaly in Python at: # https://github.com/pzeb23/Python_code/tree/master/Non-parametric_models library(tree) library(rpart) library(rpart.plot) ### Za...
/BankChurnersModel.R
no_license
pzeb23/AnalysisInR
R
false
false
3,833
r
# Qualitative variable modeling (classification problem) # data source: https://www.kaggle.com/sakshigoyal7/credit-card-customers # exploratory data alysis done additionaly in Python at: # https://github.com/pzeb23/Python_code/tree/master/Non-parametric_models library(tree) library(rpart) library(rpart.plot) ### Za...
#' Give consent to do things that require permission #' #' Potentially destructive actions require that you confirm that you really #' want to do them. If you're running a script and you know that you want to #' perform those actions, you can preemptively provide \code{consent}. #' #' @param expr Code to evaluate with ...
/R/consent.R
no_license
npelikan/rcrunch
R
false
false
1,559
r
#' Give consent to do things that require permission #' #' Potentially destructive actions require that you confirm that you really #' want to do them. If you're running a script and you know that you want to #' perform those actions, you can preemptively provide \code{consent}. #' #' @param expr Code to evaluate with ...
Sys.setenv("INSTALLDIR"="C:/PROGRA~1/R/R-3.5.1/library/Certara.NLME8/InstallDirNLME") library(Certara.NLME8) host=hosts[[1]] dataset = NlmeDataset(workingDir=getwd()) param = NlmeEngineExtraParams(PARAMS_METHOD=METHOD_FOCE_ELS, PARAMS_NUM_ITERATIONS=1000) cm=ReadNlmeCovariateEffectModel...
/Certara.NLME8/inst/extdata/Stepwise/run.r
no_license
phxnlmedev/rpackages
R
false
false
641
r
Sys.setenv("INSTALLDIR"="C:/PROGRA~1/R/R-3.5.1/library/Certara.NLME8/InstallDirNLME") library(Certara.NLME8) host=hosts[[1]] dataset = NlmeDataset(workingDir=getwd()) param = NlmeEngineExtraParams(PARAMS_METHOD=METHOD_FOCE_ELS, PARAMS_NUM_ITERATIONS=1000) cm=ReadNlmeCovariateEffectModel...
source("load_data.R") plot4 <- function(data=NULL) { if(is.null(data)) data <- load_data() png("plot4.png", width=400, height=400) par(mfrow=c(2,2)) # 1 plot(data$Time, data$Global_active_power, typ...
/plot4.R
no_license
psouthekal/datasciencecoursera
R
false
false
1,351
r
source("load_data.R") plot4 <- function(data=NULL) { if(is.null(data)) data <- load_data() png("plot4.png", width=400, height=400) par(mfrow=c(2,2)) # 1 plot(data$Time, data$Global_active_power, typ...
% Generated by roxygen2 (4.0.1): do not edit by hand \name{messages_info} \alias{messages_info} \title{Extract information from a list of messages} \usage{ messages_info(messages, what = "id") } \arguments{ \item{messages}{The output from \link{messages}.} \item{what}{Either \code{'id'}, \code{'threadId'}, \code{'next...
/man/messages_info.Rd
no_license
lcolladotor/gmailr
R
false
false
1,083
rd
% Generated by roxygen2 (4.0.1): do not edit by hand \name{messages_info} \alias{messages_info} \title{Extract information from a list of messages} \usage{ messages_info(messages, what = "id") } \arguments{ \item{messages}{The output from \link{messages}.} \item{what}{Either \code{'id'}, \code{'threadId'}, \code{'next...
library(stringr) library(purrr) library(dplyr) library(httr) #POSSIBLY REMOVE THESE LINES IF WE HAVE TO FOR AUTOMATION #library(rstudioapi) #API_KEY <- askForPassword(prompt = "Enter Mapbox API Key") #--END PROPOSED REMOVES run_geocode <- function(df) { # STEP 1 df_filter <- df %>% filter(is.na(latitude) | ...
/data_prep_scripts/auto_geocode_functions.R
permissive
maxachis/food-access-map-data
R
false
false
1,733
r
library(stringr) library(purrr) library(dplyr) library(httr) #POSSIBLY REMOVE THESE LINES IF WE HAVE TO FOR AUTOMATION #library(rstudioapi) #API_KEY <- askForPassword(prompt = "Enter Mapbox API Key") #--END PROPOSED REMOVES run_geocode <- function(df) { # STEP 1 df_filter <- df %>% filter(is.na(latitude) | ...
# change this to your own directory setwd("C:/Users/user1/Documents/GitHub/ggplot2_tutorial/time_ranges") library(readr) library(ggplot2) data <- read_csv("data/age_data.csv") p <- ggplot() for(i in 1:nrow(data)){ x <- c(data$min_year[i],data$max_year[i]) y <- c(data$arrangement[i],data$arrangement[i]) plot....
/time_ranges/time_range_plot.R
no_license
yeshancqcq/ggplot2_tutorial
R
false
false
2,052
r
# change this to your own directory setwd("C:/Users/user1/Documents/GitHub/ggplot2_tutorial/time_ranges") library(readr) library(ggplot2) data <- read_csv("data/age_data.csv") p <- ggplot() for(i in 1:nrow(data)){ x <- c(data$min_year[i],data$max_year[i]) y <- c(data$arrangement[i],data$arrangement[i]) plot....
library(configural) ### Name: cor_covariance ### Title: Calculate the asymptotic sampling covariance matrix for the ### unique elements of a correlation matrix ### Aliases: cor_covariance ### ** Examples cor_covariance(matrix(c(1, .2, .3, .2, 1, .3, .3, .3, 1), ncol = 3), 100)
/data/genthat_extracted_code/configural/examples/cor_covariance.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
287
r
library(configural) ### Name: cor_covariance ### Title: Calculate the asymptotic sampling covariance matrix for the ### unique elements of a correlation matrix ### Aliases: cor_covariance ### ** Examples cor_covariance(matrix(c(1, .2, .3, .2, 1, .3, .3, .3, 1), ncol = 3), 100)
################################################################################ # Aim: Download full text pdfs, given PMID and url # # Contact: Herm Lamberink, h.j.lamberink@umcutrecht.nl # Date: 2018-03-19 ############################# .libPaths( c(.libPaths(), "/mnt/data/live02/stress/hlamberink/RLibrary"...
/scripts/obtainingPDFS/7_url.to.pdfdownloadRE2.R
permissive
wmotte/frrp
R
false
false
83,839
r
################################################################################ # Aim: Download full text pdfs, given PMID and url # # Contact: Herm Lamberink, h.j.lamberink@umcutrecht.nl # Date: 2018-03-19 ############################# .libPaths( c(.libPaths(), "/mnt/data/live02/stress/hlamberink/RLibrary"...
testlist <- list(A = structure(c(1.38997190089718e-309, 3.81575932257023e-236, 3.80851568444077e-236), .Dim = c(1L, 3L)), B = structure(0, .Dim = c(1L, 1L))) result <- do.call(multivariance:::match_rows,testlist) str(result)
/multivariance/inst/testfiles/match_rows/AFL_match_rows/match_rows_valgrind_files/1613126265-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
226
r
testlist <- list(A = structure(c(1.38997190089718e-309, 3.81575932257023e-236, 3.80851568444077e-236), .Dim = c(1L, 3L)), B = structure(0, .Dim = c(1L, 1L))) result <- do.call(multivariance:::match_rows,testlist) str(result)
#============================================================# Load cleaned data news_pop_svm <- read.csv('Newspop_cleaned.csv', stringsAsFactors = TRUE) str(news_pop_pred) #============================================================# Load required packages library(reshape2) library(DAAG) library(e1071) library(l...
/Popularity prediction/SVM.R
no_license
kahmannC/ml
R
false
false
11,641
r
#============================================================# Load cleaned data news_pop_svm <- read.csv('Newspop_cleaned.csv', stringsAsFactors = TRUE) str(news_pop_pred) #============================================================# Load required packages library(reshape2) library(DAAG) library(e1071) library(l...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ctDataHelp.R \name{AnomAuth} \alias{AnomAuth} \title{AnomAuth} \format{data frame with 2722 rows, 14 columns. Column Y1 represents anomia, Y2 Authoritarianism, dTx the time interval for measurement occasion x.} \source{ See \url{http://psycn...
/man/AnomAuth.Rd
no_license
davan690/ctsem
R
false
true
474
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ctDataHelp.R \name{AnomAuth} \alias{AnomAuth} \title{AnomAuth} \format{data frame with 2722 rows, 14 columns. Column Y1 represents anomia, Y2 Authoritarianism, dTx the time interval for measurement occasion x.} \source{ See \url{http://psycn...
#' @name sleuth_to_count #' #' @title Convert a sleuth object to count #' #' @description Convert a sleuth object to a count matrix with the condition names. #' #' @param obj \code{sleuth} object. #' @param log bool; should natural log be returned? #' @param normalize bool; should normalized counts be returned #' @para...
/R/sleuth_to_count.R
no_license
nstroustrup/HelpingHand
R
false
false
1,546
r
#' @name sleuth_to_count #' #' @title Convert a sleuth object to count #' #' @description Convert a sleuth object to a count matrix with the condition names. #' #' @param obj \code{sleuth} object. #' @param log bool; should natural log be returned? #' @param normalize bool; should normalized counts be returned #' @para...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/systemApi.r \name{system$userInfo} \alias{system$userInfo} \title{Get information about the Windows identity used to fulfill the request. This depends on the service's authentication method and the credentials passed by the client. ...
/man/system-cash-userInfo.Rd
permissive
eddyrene/PI-Web-API-Client-R
R
false
true
687
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/systemApi.r \name{system$userInfo} \alias{system$userInfo} \title{Get information about the Windows identity used to fulfill the request. This depends on the service's authentication method and the credentials passed by the client. ...
################################# # FNNs Classification Paper # # # # Helper Functions File # # # # Anonymized # ################################# FNN_Preprocess <- function(func_cov, scalar...
/FNN_FunctionsFile.R
no_license
caojiguo/FunClassifiers
R
false
false
32,838
r
################################# # FNNs Classification Paper # # # # Helper Functions File # # # # Anonymized # ################################# FNN_Preprocess <- function(func_cov, scalar...
check_for_settlements_names <- function(text, rai) { sol <- c() for (j in seq_len(str_length(rai))) { exm <- str_sub(rai, start = 1, end = j) if (length(text[grep(exm, text)]) == 1) { sol <- text[grep(exm, text)] } } ...
/Getting know of an address/check_for_settlements_names.R
no_license
vydevyatnikov/Graduate_work
R
false
false
413
r
check_for_settlements_names <- function(text, rai) { sol <- c() for (j in seq_len(str_length(rai))) { exm <- str_sub(rai, start = 1, end = j) if (length(text[grep(exm, text)]) == 1) { sol <- text[grep(exm, text)] } } ...
c DCNF-Autarky [version 0.0.1]. c Copyright (c) 2018-2019 Swansea University. c c Input Clause Count: 7 c Performing E1-Autarky iteration. c Input Parameter (command line, file): c input filename QBFLIB/Jordan-Kaiser/reduction-finding-full-set-params-k1c3n4/query05_falsequ_1344n.qdimacs c output filename /tmp/dc...
/code/dcnf-ankit-optimized/Results/QBFLIB-2018/E1/Experiments/Jordan-Kaiser/reduction-finding-full-set-params-k1c3n4/query05_falsequ_1344n/query05_falsequ_1344n.R
no_license
arey0pushpa/dcnf-autarky
R
false
false
657
r
c DCNF-Autarky [version 0.0.1]. c Copyright (c) 2018-2019 Swansea University. c c Input Clause Count: 7 c Performing E1-Autarky iteration. c Input Parameter (command line, file): c input filename QBFLIB/Jordan-Kaiser/reduction-finding-full-set-params-k1c3n4/query05_falsequ_1344n.qdimacs c output filename /tmp/dc...
# tests for eol_invasive fxn in taxize context("eol_invasive") gisd <- suppressWarnings(eol_invasive(name='Brassica oleracea', dataset='gisd', verbose=FALSE)) mineps <- suppressWarnings(eol_invasive(name='Ciona intestinalis', dataset='mineps', verbose=FALSE)) test_that("eol_invasive returns the correct value", { exp...
/tests/testthat/test-eol_invasive.R
permissive
eduardszoecs/taxize
R
false
false
803
r
# tests for eol_invasive fxn in taxize context("eol_invasive") gisd <- suppressWarnings(eol_invasive(name='Brassica oleracea', dataset='gisd', verbose=FALSE)) mineps <- suppressWarnings(eol_invasive(name='Ciona intestinalis', dataset='mineps', verbose=FALSE)) test_that("eol_invasive returns the correct value", { exp...
# ------------------------------------------------------------------------------ # Purpose: This script searches for the CMIP5 netcdf files, checks to see if # the files contains any information about ocean depth. File information and # dpeth status is collected into a single data frame then exported as a .csv # Output...
/oceanpH/exec/methods_check/exploratory/L1_get_depth_info.R
no_license
JGCRI/OA_variability
R
false
false
1,780
r
# ------------------------------------------------------------------------------ # Purpose: This script searches for the CMIP5 netcdf files, checks to see if # the files contains any information about ocean depth. File information and # dpeth status is collected into a single data frame then exported as a .csv # Output...
## ========================================================================== ## Versions: version string information ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ## methods and class defined together so available for prototypes elsewhere .Versions <- setClass("Versions", contains="list...
/R/VersionsClass.R
no_license
mukhyala/Biobase
R
false
false
4,443
r
## ========================================================================== ## Versions: version string information ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ## methods and class defined together so available for prototypes elsewhere .Versions <- setClass("Versions", contains="list...
# # TTR: Technical Trading Rules # # Copyright (C) 2007-2013 Joshua M. Ulrich # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option...
/R/MovingAverages.R
no_license
dshen1/TTR
R
false
false
14,396
r
# # TTR: Technical Trading Rules # # Copyright (C) 2007-2013 Joshua M. Ulrich # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option...
install.packages(c("rgdal","ggmap","sp","maptools","viridis","magrittr","scales","gridExtra","data.table", "tidyverse","lubridate","factoextra","tfplot","tsfa","cluster","IRdisplay","foreign","extrafont", "showtext","grid")) suppressPackageStartupMessages({ library(rgdal,warn.c...
/피너트리팀_포스트코로나시각화대회_최종본.r
no_license
syppp/Competition_PostCovid19
R
false
false
45,256
r
install.packages(c("rgdal","ggmap","sp","maptools","viridis","magrittr","scales","gridExtra","data.table", "tidyverse","lubridate","factoextra","tfplot","tsfa","cluster","IRdisplay","foreign","extrafont", "showtext","grid")) suppressPackageStartupMessages({ library(rgdal,warn.c...
testlist <- list(a = 0L, b = 0L, x = c(-1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1124073473L, -196609L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -14680052L, 2293759L, -10682368L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L...
/grattan/inst/testfiles/anyOutside/libFuzzer_anyOutside/anyOutside_valgrind_files/1610131575-test.R
no_license
akhikolla/updated-only-Issues
R
false
false
493
r
testlist <- list(a = 0L, b = 0L, x = c(-1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1124073473L, -196609L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -1L, -14680052L, 2293759L, -10682368L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L...
# Install and load packages package_names <- c("survey","dplyr","foreign","devtools") lapply(package_names, function(x) if(!x %in% installed.packages()) install.packages(x)) lapply(package_names, require, character.only=T) install_github("e-mitchell/meps_r_pkg/MEPS") library(MEPS) options(survey.lonely.ps...
/mepstrends/hc_use/json/code/r/avgEVT__married__education__.r
permissive
RandomCriticalAnalysis/MEPS-summary-tables
R
false
false
4,335
r
# Install and load packages package_names <- c("survey","dplyr","foreign","devtools") lapply(package_names, function(x) if(!x %in% installed.packages()) install.packages(x)) lapply(package_names, require, character.only=T) install_github("e-mitchell/meps_r_pkg/MEPS") library(MEPS) options(survey.lonely.ps...
#' Convert PLEXOS files to SQLite databases #' #' Functions to process PLEXOS solution and input files and dump them into SQLite databases #' that are easier to read. #' #' \code{process_solution} converts a single zipped PLEXOS solution into a SQLite database. #' The resulting database file has a simplified structure ...
/R/process_folder.R
no_license
NREL/rplexos
R
false
false
4,344
r
#' Convert PLEXOS files to SQLite databases #' #' Functions to process PLEXOS solution and input files and dump them into SQLite databases #' that are easier to read. #' #' \code{process_solution} converts a single zipped PLEXOS solution into a SQLite database. #' The resulting database file has a simplified structure ...
################################# # # maxnet ENMdetails object #### ################################# # maxnet.name <- "maxnet" maxnet.fun <- maxnet::maxnet maxnet.msgs <- function(tune.args, other.settings) { if(!("rm" %in% names(tune.args)) | !("fc" %in% names(tune.args))) { stop("Maxent settings must includ...
/R/enm.maxnet.R
no_license
andrepazv/ENMeval
R
false
false
3,148
r
################################# # # maxnet ENMdetails object #### ################################# # maxnet.name <- "maxnet" maxnet.fun <- maxnet::maxnet maxnet.msgs <- function(tune.args, other.settings) { if(!("rm" %in% names(tune.args)) | !("fc" %in% names(tune.args))) { stop("Maxent settings must includ...
#!/usr/bin/env Rscript require("RPostgreSQL") # create a connection pw <- { "testgres" } # loads the PostgreSQL driver drv <- dbDriver("PostgreSQL") # creates a connection to the postgres database note that "con" will be used later in each connection to the database con <- dbConnect(drv, dbname = "Field_Station2", ...
/r_script
no_license
vika19/REU-Field-Station
R
false
false
2,916
#!/usr/bin/env Rscript require("RPostgreSQL") # create a connection pw <- { "testgres" } # loads the PostgreSQL driver drv <- dbDriver("PostgreSQL") # creates a connection to the postgres database note that "con" will be used later in each connection to the database con <- dbConnect(drv, dbname = "Field_Station2", ...
###### Create correlated random variable ###### x <- rnorm(10000) y <- rnorm(10000) rho <- 0.3 # Test correlation (both close to 0) cov(x, y) cor(x, y) # Design correlated random variable z <- rho * x + sqrt(1 - rho ^ 2) * y cov(x, z) cor(x, z) #these numbers are the same because they follow the...
/2021S QF202 Recitation 2.R
no_license
lmaksymenko/QF202
R
false
false
4,253
r
###### Create correlated random variable ###### x <- rnorm(10000) y <- rnorm(10000) rho <- 0.3 # Test correlation (both close to 0) cov(x, y) cor(x, y) # Design correlated random variable z <- rho * x + sqrt(1 - rho ^ 2) * y cov(x, z) cor(x, z) #these numbers are the same because they follow the...
library(BiDimRegression) ### Name: predict.lm2 ### Title: Predict method for Bidimensional Regression Model Fits ### Aliases: predict.lm2 ### ** Examples lm2euc <- lm2(depV1+depV2~indepV1+indepV2, NakayaData, transformation = 'Euclidean') predict(lm2euc, NakayaData[, 3:4])
/data/genthat_extracted_code/BiDimRegression/examples/predict.lm2.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
281
r
library(BiDimRegression) ### Name: predict.lm2 ### Title: Predict method for Bidimensional Regression Model Fits ### Aliases: predict.lm2 ### ** Examples lm2euc <- lm2(depV1+depV2~indepV1+indepV2, NakayaData, transformation = 'Euclidean') predict(lm2euc, NakayaData[, 3:4])
# The ratio of boys to girls born in Russia is 1.09:1. # What proportion of Russian families with exactly 6 children will have at least 3 boys? (Ignore the probability of multiple births.) ans <- 0 for(i in 3:6) ans <- ans + dbinom(i, 6, 1.09/(1+1.09)) cat(round(ans,digits = 3), "\n")
/Artificial Intelligence/Binomial Distribution #2/main.r
no_license
mudream4869/hackerrank-code
R
false
false
291
r
# The ratio of boys to girls born in Russia is 1.09:1. # What proportion of Russian families with exactly 6 children will have at least 3 boys? (Ignore the probability of multiple births.) ans <- 0 for(i in 3:6) ans <- ans + dbinom(i, 6, 1.09/(1+1.09)) cat(round(ans,digits = 3), "\n")
#' Remove all but the specified individuals from a genelight \{adegenet\} object #' #' The script, having deleted individuals, optionally identifies resultant monomorphic loci or loci #' with all values missing and deletes them (using gl.filter.monomorphs.r). The script also optionally #' recalculates statistics made r...
/R/gl.keep.ind.r
no_license
carlopacioni/dartR
R
false
false
4,632
r
#' Remove all but the specified individuals from a genelight \{adegenet\} object #' #' The script, having deleted individuals, optionally identifies resultant monomorphic loci or loci #' with all values missing and deletes them (using gl.filter.monomorphs.r). The script also optionally #' recalculates statistics made r...
qmq <- function(x, y) { if (! (is.numeric(x) || is.character(x))) stop("'x' not numeric or character") if (! (is.numeric(y) || is.character(y))) stop("'y' not numeric or character") if (is.numeric(x)) x <- d2q(x) if (is.numeric(y)) y <- d2q(y) if (! (is.character(x...
/rcdd/R/qmq.R
no_license
ingted/R-Examples
R
false
false
441
r
qmq <- function(x, y) { if (! (is.numeric(x) || is.character(x))) stop("'x' not numeric or character") if (! (is.numeric(y) || is.character(y))) stop("'y' not numeric or character") if (is.numeric(x)) x <- d2q(x) if (is.numeric(y)) y <- d2q(y) if (! (is.character(x...
FindInitialVectors <- function(theta, utimes0, utimes1) { eps <- 0.01 w0 <- rep(0, length(utimes0)) w1 <- rep(0, length(utimes1)) w1[utimes1 < theta] <- rep(eps, sum(utimes1 < theta)) n00 <- sum(utimes0 < theta) w0[utimes0 < theta] <- rep(eps/n00, n00) gap <- sum(w1) - sum(w0) w0[utimes0 >= theta] <-...
/R/FindInitialVectors.R
no_license
nchenderson/DelayedSurvFit
R
false
false
536
r
FindInitialVectors <- function(theta, utimes0, utimes1) { eps <- 0.01 w0 <- rep(0, length(utimes0)) w1 <- rep(0, length(utimes1)) w1[utimes1 < theta] <- rep(eps, sum(utimes1 < theta)) n00 <- sum(utimes0 < theta) w0[utimes0 < theta] <- rep(eps/n00, n00) gap <- sum(w1) - sum(w0) w0[utimes0 >= theta] <-...
#' Optimize the Dimensional Anchors Position using the Graphviz algorithm #' #' Allows to compute the best arrangement of Dimensional Anchors so that #' visualization efficiency (i.e. maintaining graph structure) is optimized. #' The Graphviz algorithm is implemented in C++ for optimal computational efficiency. #...
/R/do.optimGraphviz.R
no_license
cran/Radviz
R
false
false
4,350
r
#' Optimize the Dimensional Anchors Position using the Graphviz algorithm #' #' Allows to compute the best arrangement of Dimensional Anchors so that #' visualization efficiency (i.e. maintaining graph structure) is optimized. #' The Graphviz algorithm is implemented in C++ for optimal computational efficiency. #...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/tools-arrays.R \name{colwise-rowise} \alias{cols_means} \alias{cols_variances} \alias{colwise-rowise} \alias{rows_means} \alias{rows_variances} \title{Colwise and rowwise operations} \usage{ cols_variances(x) rows_variances(x) cols_...
/man/colwise-rowise.Rd
no_license
lionel-/gsim
R
false
false
810
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/tools-arrays.R \name{colwise-rowise} \alias{cols_means} \alias{cols_variances} \alias{colwise-rowise} \alias{rows_means} \alias{rows_variances} \title{Colwise and rowwise operations} \usage{ cols_variances(x) rows_variances(x) cols_...
/functions_nve.R
no_license
mhheien/IRiR-1
R
false
false
3,366
r
#' @name pathway_vectorization #' @title Vectorization of pathways #' #' @description This function vectorizes pathways by creating pathway-gene profile. #' #' @param expression_profile Gene expression profile contains gene expression. Rownames are entrez IDs. Colnames are sample names. #' #' @param condition A vector ...
/R/pathway_vectorization.R
no_license
github-gs/QPA
R
false
false
2,533
r
#' @name pathway_vectorization #' @title Vectorization of pathways #' #' @description This function vectorizes pathways by creating pathway-gene profile. #' #' @param expression_profile Gene expression profile contains gene expression. Rownames are entrez IDs. Colnames are sample names. #' #' @param condition A vector ...
library(vegan) library(phyloseq) library(ape) source("https://raw.githubusercontent.com/jesusNPL/Public/master/ordinate_mod.R") data("varespec") ### Run ENVFIT ### # Create a distance matrix dist <- vegdist(varespec, method = "bray") # PCoA using APE pcoa_ape <- pcoa(dist) # PCoA using stats pcoa_stats <- cmdscale...
/PCoA_Taylor.R
no_license
jesusNPL/Public
R
false
false
1,582
r
library(vegan) library(phyloseq) library(ape) source("https://raw.githubusercontent.com/jesusNPL/Public/master/ordinate_mod.R") data("varespec") ### Run ENVFIT ### # Create a distance matrix dist <- vegdist(varespec, method = "bray") # PCoA using APE pcoa_ape <- pcoa(dist) # PCoA using stats pcoa_stats <- cmdscale...
library(glmnet) mydata = read.table("../../../../TrainingSet/FullSet/Correlation/upper_aerodigestive_tract.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.35,family="gaussian",standardize=FALSE) sink('./upper_ae...
/Model/EN/Correlation/upper_aerodigestive_tract/upper_aerodigestive_tract_048.R
no_license
esbgkannan/QSMART
R
false
false
389
r
library(glmnet) mydata = read.table("../../../../TrainingSet/FullSet/Correlation/upper_aerodigestive_tract.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.35,family="gaussian",standardize=FALSE) sink('./upper_ae...
library(shiny) shinyServer(function(input, output) { output$myPlot <- renderPlot({ distType <- input$Distribution size <- input$sampleSize if(distType == "Normal"){ randomvec <- rnorm(size, mean = as.numeric(input$mean), sd = as.numeric(input$sd)) } ...
/server.R
no_license
arshaddd/Developing_Data_Products_W4
R
false
false
478
r
library(shiny) shinyServer(function(input, output) { output$myPlot <- renderPlot({ distType <- input$Distribution size <- input$sampleSize if(distType == "Normal"){ randomvec <- rnorm(size, mean = as.numeric(input$mean), sd = as.numeric(input$sd)) } ...
#' Raw Data Import for USGS NWIS QW Data #' #' Imports data from NWIS web service. This function gets the data from here: \url{http://nwis.waterdata.usgs.gov/nwis/qwdata} #' A list of parameter codes can be found here: \url{http://nwis.waterdata.usgs.gov/nwis/pmcodes/} #' A list of statistic codes can be found here: \u...
/R/readNWISqw.r
permissive
kbrannan/dataRetrieval
R
false
false
5,328
r
#' Raw Data Import for USGS NWIS QW Data #' #' Imports data from NWIS web service. This function gets the data from here: \url{http://nwis.waterdata.usgs.gov/nwis/qwdata} #' A list of parameter codes can be found here: \url{http://nwis.waterdata.usgs.gov/nwis/pmcodes/} #' A list of statistic codes can be found here: \u...
yadirGetToken <- function(){ browseURL("https://oauth.yandex.ru/authorize?response_type=token&client_id=c441fa0194f04f4ea2c238c0c2c40ec9") token <- readline(prompt = "Enter your token: ") return(token) }
/R/yadirGetToken.R
no_license
alex-www-marketing/ryandexdirect_edit
R
false
false
216
r
yadirGetToken <- function(){ browseURL("https://oauth.yandex.ru/authorize?response_type=token&client_id=c441fa0194f04f4ea2c238c0c2c40ec9") token <- readline(prompt = "Enter your token: ") return(token) }
"permutations" <- function(n) { ##function permutations from package e1071 if (n == 1) return(matrix(1)) else if (n < 2) stop("n must be a positive integer") z <- matrix(1) for (i in 2:n) { x <- cbind(z, i) a <- c(1:i, 1:(i - 1)) z <- matri...
/R/permutations.R
no_license
l5d1l5/relaimpo
R
false
false
544
r
"permutations" <- function(n) { ##function permutations from package e1071 if (n == 1) return(matrix(1)) else if (n < 2) stop("n must be a positive integer") z <- matrix(1) for (i in 2:n) { x <- cbind(z, i) a <- c(1:i, 1:(i - 1)) z <- matri...
.str_quote <- function(strings) { purrr::map_chr(strings, function(string) { paste0("\"", string, "\"") }) %>% paste0(collapse = ", ") } .str_df <- function(df) { col_names <- paste0(colnames(df), collapse = ", ") paste0(nrow(df), " x ", ncol(df), " (", col_names, ")") } .str_list <- function(l) { purr...
/R/helper_print.R
permissive
five-dots/ml4e
R
false
false
3,412
r
.str_quote <- function(strings) { purrr::map_chr(strings, function(string) { paste0("\"", string, "\"") }) %>% paste0(collapse = ", ") } .str_df <- function(df) { col_names <- paste0(colnames(df), collapse = ", ") paste0(nrow(df), " x ", ncol(df), " (", col_names, ")") } .str_list <- function(l) { purr...
tuneIrace = function(learner, task, resampling, measures, par.set, control, opt.path, show.info) { requirePackages("irace", why = "tuneIrace", default.method = "load") cx = function(x) convertXLogicalsNotAsStrings(x, par.set) hookRun = function(experiment, config = list()) { rin = experiment$instance tun...
/R/tuneIrace.R
no_license
gragusa/mlr
R
false
false
2,530
r
tuneIrace = function(learner, task, resampling, measures, par.set, control, opt.path, show.info) { requirePackages("irace", why = "tuneIrace", default.method = "load") cx = function(x) convertXLogicalsNotAsStrings(x, par.set) hookRun = function(experiment, config = list()) { rin = experiment$instance tun...
# Repeat pure genomics model 5 times (100 times on the server) # Library and working directory library(tidyverse) library(tidymodels) library(themis) library(vip) library(patchwork) # Prepare input data f <- list.files("input_data", pattern = "*pheno.geno.Rda", full.names = T) pheno_geno <- readRDS(f) for (i in 1:10...
/R/original_model/ML_replicates.R
no_license
stefanogg/CLOGEN
R
false
false
4,922
r
# Repeat pure genomics model 5 times (100 times on the server) # Library and working directory library(tidyverse) library(tidymodels) library(themis) library(vip) library(patchwork) # Prepare input data f <- list.files("input_data", pattern = "*pheno.geno.Rda", full.names = T) pheno_geno <- readRDS(f) for (i in 1:10...
### ========================================================================= ### DelayedNaryIsoOp objects ### ------------------------------------------------------------------------- ### ### Representation of a delayed N-ary isometric operation. ### The input arrays must be "conformable" i.e. they all must have the s...
/R/DelayedNaryIsoOp-class.R
no_license
LTLA/DelayedArray
R
false
false
5,039
r
### ========================================================================= ### DelayedNaryIsoOp objects ### ------------------------------------------------------------------------- ### ### Representation of a delayed N-ary isometric operation. ### The input arrays must be "conformable" i.e. they all must have the s...
### calcDistMax.R --- #---------------------------------------------------------------------- ## author: Brice Ozenne ## created: jun 21 2017 (16:44) ## Version: ## last-updated: sep 21 2018 (16:24) ## By: Brice Ozenne ## Update #: 615 #-----------------------------------------------------------------...
/R/calcDistMax.R
no_license
kkholst/lavaSearch2
R
false
false
16,686
r
### calcDistMax.R --- #---------------------------------------------------------------------- ## author: Brice Ozenne ## created: jun 21 2017 (16:44) ## Version: ## last-updated: sep 21 2018 (16:24) ## By: Brice Ozenne ## Update #: 615 #-----------------------------------------------------------------...
### to be careful about here: # each time another env block is used as env.only --> use another 'both' so as not to overwrite sth (or solve this in any way) # for combination approach: ### just cbind the env in order: fam, env.new, interactions ### bild list with the right.names and give it to function as argument ...
/gabriela/3-onlyfarm/ImputedSNPs/4.1-Genome-wide-learn-LASSO-4blocks.R
no_license
fuchslab/gabriela
R
false
false
6,952
r
### to be careful about here: # each time another env block is used as env.only --> use another 'both' so as not to overwrite sth (or solve this in any way) # for combination approach: ### just cbind the env in order: fam, env.new, interactions ### bild list with the right.names and give it to function as argument ...
#============================================================================== # SI FIGURE: CORRELATIONS BETWEEN ACCURACY AND X METRICS #============================================================================== #------------------------------------------------------------------------------ # Preamble #----------...
/scripts/si_correlations.R
permissive
willbradshaw/geac
R
false
false
9,890
r
#============================================================================== # SI FIGURE: CORRELATIONS BETWEEN ACCURACY AND X METRICS #============================================================================== #------------------------------------------------------------------------------ # Preamble #----------...
# test biases: ntests <- 100 res <- data.frame(run = 1:ntests, idbias = runif(ntests), rankbias = runif(ntests), cv_id = NA, cor_w_rank = NA) for (i in seq_len(nrow(res))) { x <- generate_interaction_probs(n_ind = sample(5:20, 1), id_bias = res$idbias[i], rank_bias = res$rankbias[i]) # generate 10000 'interactions'...
/tests/testthat/test-generate_interaction_probs.R
no_license
gobbios/EloRating.extension
R
false
false
1,042
r
# test biases: ntests <- 100 res <- data.frame(run = 1:ntests, idbias = runif(ntests), rankbias = runif(ntests), cv_id = NA, cor_w_rank = NA) for (i in seq_len(nrow(res))) { x <- generate_interaction_probs(n_ind = sample(5:20, 1), id_bias = res$idbias[i], rank_bias = res$rankbias[i]) # generate 10000 'interactions'...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tau.R \name{tau_p} \alias{tau_p} \title{Pimentel's tau_b} \usage{ tau_p(x, y, estimator = "values", p11 = 0, p01 = 0, p10 = 0) } \arguments{ \item{x, y}{vectors to be correlated. Must be numeric and have the same length.} \item{estimator}{st...
/man/tau_p.Rd
no_license
cran/mazeinda
R
false
true
1,040
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tau.R \name{tau_p} \alias{tau_p} \title{Pimentel's tau_b} \usage{ tau_p(x, y, estimator = "values", p11 = 0, p01 = 0, p10 = 0) } \arguments{ \item{x, y}{vectors to be correlated. Must be numeric and have the same length.} \item{estimator}{st...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_default_mhcnuggets_folder.R \name{get_default_mhcnuggets_folder} \alias{get_default_mhcnuggets_folder} \title{Get the path to the folder where this package installs MHCnuggets by default} \usage{ get_default_mhcnuggets_folder() } \value{ ...
/man/get_default_mhcnuggets_folder.Rd
no_license
cran/mhcnuggetsr
R
false
true
568
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_default_mhcnuggets_folder.R \name{get_default_mhcnuggets_folder} \alias{get_default_mhcnuggets_folder} \title{Get the path to the folder where this package installs MHCnuggets by default} \usage{ get_default_mhcnuggets_folder() } \value{ ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/wrenchSource.R \name{.getReference} \alias{.getReference} \title{This function generates the reference.} \usage{ .getReference(mat, ref.est = "sw.means", ...) } \arguments{ \item{mat}{count matrix; rows are features and columns are samples} ...
/man/dot-getReference.Rd
no_license
HCBravoLab/Wrench
R
false
true
502
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/wrenchSource.R \name{.getReference} \alias{.getReference} \title{This function generates the reference.} \usage{ .getReference(mat, ref.est = "sw.means", ...) } \arguments{ \item{mat}{count matrix; rows are features and columns are samples} ...
\name{bamsignals-package} \alias{bamsignals-package} \alias{bamsignals} \docType{package} \title{ What the package does (short line) } \description{ More about what it does (maybe more than one line) ~~ A concise (1-5 lines) description of the package ~~ } \details{ \tabular{ll}{ Package: \tab bamsignals\cr Type: \tab ...
/bamsignals/man/bamsignals-package.Rd
no_license
al2na/cmbr
R
false
false
865
rd
\name{bamsignals-package} \alias{bamsignals-package} \alias{bamsignals} \docType{package} \title{ What the package does (short line) } \description{ More about what it does (maybe more than one line) ~~ A concise (1-5 lines) description of the package ~~ } \details{ \tabular{ll}{ Package: \tab bamsignals\cr Type: \tab ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/SED_SAMPLES.R \name{SED_SAMPLES} \alias{SED_SAMPLES} \title{Extract instantaneous sediment sample information from the HYDAT database} \source{ HYDAT } \usage{ SED_SAMPLES(hydat_path = NULL, STATION_NUMBER = NULL, PROV_TERR_STATE_LOC = NULL...
/man/SED_SAMPLES.Rd
permissive
stephhazlitt/tidyhydat
R
false
true
2,598
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/SED_SAMPLES.R \name{SED_SAMPLES} \alias{SED_SAMPLES} \title{Extract instantaneous sediment sample information from the HYDAT database} \source{ HYDAT } \usage{ SED_SAMPLES(hydat_path = NULL, STATION_NUMBER = NULL, PROV_TERR_STATE_LOC = NULL...
rankhospital <- function(state, outcome, num = "best") { library(plyr) ## Read outcome data data <- read.csv("outcome-of-care-measures.csv", colClasses = "character") ## Check that state and outcome are valid if(!any(data$State == state)) stop("invalid state") if(!(outcom...
/02_R_progamming/week_4/prog_assign_3_hospital_quality/rankhospital.R
no_license
tommyilpazzo/datasciencecoursera
R
false
false
1,434
r
rankhospital <- function(state, outcome, num = "best") { library(plyr) ## Read outcome data data <- read.csv("outcome-of-care-measures.csv", colClasses = "character") ## Check that state and outcome are valid if(!any(data$State == state)) stop("invalid state") if(!(outcom...
test_that("update_csasstyle() works", { wd <- getwd() testing_path <- file.path(tempdir(), "test-update-csasstyle-resdoc") unlink(testing_path, recursive = TRUE, force = TRUE) dir.create(testing_path, showWarnings = FALSE) setwd(testing_path) suppressMessages(csasdown::draft( system.file("rmarkdown", "...
/tests/testthat/test-update-csasstyle.R
permissive
pbs-assess/csasdown
R
false
false
2,395
r
test_that("update_csasstyle() works", { wd <- getwd() testing_path <- file.path(tempdir(), "test-update-csasstyle-resdoc") unlink(testing_path, recursive = TRUE, force = TRUE) dir.create(testing_path, showWarnings = FALSE) setwd(testing_path) suppressMessages(csasdown::draft( system.file("rmarkdown", "...
fastDoCall("complex", list(imaginary = 1:3)) ## if we already have a list (e.g. a data frame) ## we need c() to add further arguments tmp <- expand.grid(letters[1:2], 1:3, c("+", "-")) fastDoCall("paste", c(tmp, sep = "")) ## examples of where objects will be found. A <- 2 f <- function(x) print(x^2) env <-...
/Gmisc/inst/examples/fastDoCall_ex.R
no_license
ingted/R-Examples
R
false
false
958
r
fastDoCall("complex", list(imaginary = 1:3)) ## if we already have a list (e.g. a data frame) ## we need c() to add further arguments tmp <- expand.grid(letters[1:2], 1:3, c("+", "-")) fastDoCall("paste", c(tmp, sep = "")) ## examples of where objects will be found. A <- 2 f <- function(x) print(x^2) env <-...
library(shiny) library(plotly) library(ggplot2) # Define UI for application that draws a histogram shinyUI(fluidPage( titlePanel("Canada Unemployment Rate from 2012 to 2017"), sidebarLayout( sidebarPanel( h1("Move the month slider!"), sliderInput("slider1", "Slide Me!",...
/ui.R
no_license
WeiLiMontreal/Developing_Data_Product-Week4Pro
R
false
false
689
r
library(shiny) library(plotly) library(ggplot2) # Define UI for application that draws a histogram shinyUI(fluidPage( titlePanel("Canada Unemployment Rate from 2012 to 2017"), sidebarLayout( sidebarPanel( h1("Move the month slider!"), sliderInput("slider1", "Slide Me!",...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{add_julia_processes} \alias{add_julia_processes} \title{Add additional Julia worker processes to parallelize workloads} \usage{ add_julia_processes(...) } \arguments{ \item{...}{Refer to the Julia documentation for available par...
/man/add_julia_processes.Rd
no_license
cran/iai
R
false
true
697
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{add_julia_processes} \alias{add_julia_processes} \title{Add additional Julia worker processes to parallelize workloads} \usage{ add_julia_processes(...) } \arguments{ \item{...}{Refer to the Julia documentation for available par...
# Test utils context("Test defac conversion of factors") test_that("defac works for all types of factors", { a <- as.factor(LETTERS) b <- ordered(c(1, 3, '09', 7, 5, "B")) expect_is(defac(a), "character") expect_is(defac(b), "character") a2 <- defac(a) b2 <- defac(b) expect_identical(levels(a),...
/tests/testthat/test-utils.R
no_license
cran/eeptools
R
false
false
6,688
r
# Test utils context("Test defac conversion of factors") test_that("defac works for all types of factors", { a <- as.factor(LETTERS) b <- ordered(c(1, 3, '09', 7, 5, "B")) expect_is(defac(a), "character") expect_is(defac(b), "character") a2 <- defac(a) b2 <- defac(b) expect_identical(levels(a),...
#A simple exercise for setting values for nodesize, sampsize and mtry in randomForest modelling #Used for require(randomForest) library(PresenceAbsence) #For AUC calculation #loops for nodesize, sampsize and mtry #nodesize ########################################### nodesize.results<-matrix(data = NA, nrow = 50, n...
/2. random forest setting.R
no_license
simonhallstan/Refmodels-RI-
R
false
false
3,972
r
#A simple exercise for setting values for nodesize, sampsize and mtry in randomForest modelling #Used for require(randomForest) library(PresenceAbsence) #For AUC calculation #loops for nodesize, sampsize and mtry #nodesize ########################################### nodesize.results<-matrix(data = NA, nrow = 50, n...
#The following code is to combine and arrange the output from the simulation study #according to type of design (accuracy, location, no effect) for the purpose of #creating plots and investigating the performance. B0I <- c(3,1,0,-1,-3) B0II <- c(3,1,0,-1,-3) B1I <- c(2,1,0.5,0,-0.5,-1,-2) B1II <- c(2,1,0.5,0,-...
/Paper 3 simulations/Plots/Plots Simulation Study N = 50.R
no_license
joliencremers/Circular-Interpretation-BJMSP
R
false
false
39,957
r
#The following code is to combine and arrange the output from the simulation study #according to type of design (accuracy, location, no effect) for the purpose of #creating plots and investigating the performance. B0I <- c(3,1,0,-1,-3) B0II <- c(3,1,0,-1,-3) B1I <- c(2,1,0.5,0,-0.5,-1,-2) B1II <- c(2,1,0.5,0,-...
library(dplyr) ##reading column names into the vector named features features <- read.table("UCI HAR Dataset\\features.txt") features <- features$V2 ##reading test data message("reading test dataset...") test_data <- read.table("UCI HAR D...
/run_analysis.R
no_license
kozh1121/getdata
R
false
false
3,947
r
library(dplyr) ##reading column names into the vector named features features <- read.table("UCI HAR Dataset\\features.txt") features <- features$V2 ##reading test data message("reading test dataset...") test_data <- read.table("UCI HAR D...
####################################################### # MJ Counotte # # A very simple-fast references list # # https://ispmbern.github.io/covid-19/living-review/ # # # ########################################...
/living-review/ReferencesShinyApp/ui.R
no_license
ISPMBern/covid-19
R
false
false
1,371
r
####################################################### # MJ Counotte # # A very simple-fast references list # # https://ispmbern.github.io/covid-19/living-review/ # # # ########################################...
<!-- This syntax can be used to add comments that are ignored during knitting process. --> ##### Collaborators: <!-- BE SURE TO LIST ALL COLLABORATORS HERE! --> External SOurces : http://soutik.github.io/NYC-Flight-Analysis/ ##### Instructions: Before beginning this assignment, please ensure you have access to R an...
/problem-set1.R
no_license
nivdungebhagyashri/DS_with_R
R
false
false
11,300
r
<!-- This syntax can be used to add comments that are ignored during knitting process. --> ##### Collaborators: <!-- BE SURE TO LIST ALL COLLABORATORS HERE! --> External SOurces : http://soutik.github.io/NYC-Flight-Analysis/ ##### Instructions: Before beginning this assignment, please ensure you have access to R an...
# Chapter 4.2 # Medicorp example # The following code shows how to plot a simple linear regression line library(readxl) # Import data from an Excel workbook MEDDICORP <- read_excel("C:\\Users\\Zack\\Documents\\Spring 2021\\MATH 212\\Data Sets\\MEDDICORP4.xlsx", sheet=1) # View Data head(MEDDICORP) # Create a vari...
/MATH 212/R Files/Chapter 4.2.R
no_license
zackroder/Spring-2021
R
false
false
2,737
r
# Chapter 4.2 # Medicorp example # The following code shows how to plot a simple linear regression line library(readxl) # Import data from an Excel workbook MEDDICORP <- read_excel("C:\\Users\\Zack\\Documents\\Spring 2021\\MATH 212\\Data Sets\\MEDDICORP4.xlsx", sheet=1) # View Data head(MEDDICORP) # Create a vari...
#' Title #' #' @param x #' #' @return #' @export #' #' @examples myseq_graph <- function(x){ if (is.data.frame(x) != "TRUE"){ stop("x should be data frame") } else if (ncol(x) != 4){ stop("x must have 4 values") } else { num <- vector(mode = "double", length = nrow(x)) for (i in seq_along(num)...
/R/function2.R
permissive
jiarong0829/hw04pjiarong0829
R
false
false
794
r
#' Title #' #' @param x #' #' @return #' @export #' #' @examples myseq_graph <- function(x){ if (is.data.frame(x) != "TRUE"){ stop("x should be data frame") } else if (ncol(x) != 4){ stop("x must have 4 values") } else { num <- vector(mode = "double", length = nrow(x)) for (i in seq_along(num)...
# Libraries used in the program library(openxlsx) # retrieve data from an excel file library(tidyverse) # organize the data library(moments) # determine the moments based on empirical information library(ChainLadder) # estimate the development factors (function ata) library(ggplot2) # visual analysis of the data ...
/Results.R
no_license
tatianasantos/MFW-RA
R
false
false
11,978
r
# Libraries used in the program library(openxlsx) # retrieve data from an excel file library(tidyverse) # organize the data library(moments) # determine the moments based on empirical information library(ChainLadder) # estimate the development factors (function ata) library(ggplot2) # visual analysis of the data ...
#' Produces graphs of IAAO standards over time #' #' @param stats the output of iaao_stats #' @param ratios the output of reformat_data #' @param min_reporting_yr the minimum year to plot #' @param max_reporting_yr the maximum year to ploy #' @param jurisdiction_name the name of the jurisdiction analyzed #' @return a l...
/R/iaao_graphs.R
permissive
jrockower/cmfproperty
R
false
false
3,904
r
#' Produces graphs of IAAO standards over time #' #' @param stats the output of iaao_stats #' @param ratios the output of reformat_data #' @param min_reporting_yr the minimum year to plot #' @param max_reporting_yr the maximum year to ploy #' @param jurisdiction_name the name of the jurisdiction analyzed #' @return a l...
# Load packages library(shiny) library(dplyr) # Load error identification data load("manualIdentifiers.r") # Generate error identification regular expressions splitDelimitersOne <- lapply(poorPhrasesDocument[,"phrase"], function(item){ paste0("(?<=",item,")") }) %>% paste(., collapse = "|") splitDelimite...
/server.R
no_license
zcolburn/Lab-Report-Corrector_Shiny-App
R
false
false
5,926
r
# Load packages library(shiny) library(dplyr) # Load error identification data load("manualIdentifiers.r") # Generate error identification regular expressions splitDelimitersOne <- lapply(poorPhrasesDocument[,"phrase"], function(item){ paste0("(?<=",item,")") }) %>% paste(., collapse = "|") splitDelimite...
dat_lim <- function(dat, ZLIM){ dat[dat < ZLIM[1]] = ZLIM[1] dat[dat > ZLIM[2]] = ZLIM[2] return(dat) } library(MASS) #Calculate production log ratios between high and low diversity treatments: prefix <- '~/Roms_tools/Run/NPacS1_' VTR <- c(0, 0.1) avgFiles <- paste0(prefix, VTR, '/npacS_avg.nc') bio...
/Rscripts/Plot_diff.R
permissive
BingzhangChen/ROMS-NPZDcont
R
false
false
2,328
r
dat_lim <- function(dat, ZLIM){ dat[dat < ZLIM[1]] = ZLIM[1] dat[dat > ZLIM[2]] = ZLIM[2] return(dat) } library(MASS) #Calculate production log ratios between high and low diversity treatments: prefix <- '~/Roms_tools/Run/NPacS1_' VTR <- c(0, 0.1) avgFiles <- paste0(prefix, VTR, '/npacS_avg.nc') bio...
# Classify Emails # Ye (Kate) Cai # 2019-04-26 ###### Overview ############################################################# # We have a data set of emails. We would like to classify "fake news" from real. # The data have raw features: text body, news title, and news source. The # response is "Real" or "Fake". ...
/Code/text_mining_intro_script_20190426.R
no_license
YeahCai/TextMining2019
R
false
false
8,371
r
# Classify Emails # Ye (Kate) Cai # 2019-04-26 ###### Overview ############################################################# # We have a data set of emails. We would like to classify "fake news" from real. # The data have raw features: text body, news title, and news source. The # response is "Real" or "Fake". ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/auxiliary_giotto.R \name{addGeneStatistics} \alias{addGeneStatistics} \title{addGeneStatistics} \usage{ addGeneStatistics( gobject, expression_values = c("normalized", "scaled", "custom"), detection_threshold = 0, return_gobject = TRU...
/man/addGeneStatistics.Rd
permissive
RubD/Giotto
R
false
true
1,255
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/auxiliary_giotto.R \name{addGeneStatistics} \alias{addGeneStatistics} \title{addGeneStatistics} \usage{ addGeneStatistics( gobject, expression_values = c("normalized", "scaled", "custom"), detection_threshold = 0, return_gobject = TRU...
library(tidyverse) col_drop <- c('fpNodeId', 'packet_stemid', 'position', 'pot_stemid', 'Photo_20181129.60.1', 'Photo_20181204.32.1', 'Flowering Date_20180524.40.1') DS_polytunnel_vis <- read_csv('DS_polytunnel-wide.csv') %>% select(-(col_drop)) %>% dplyr::rename_all(funs(make.names(.))) # %>% # filter(line.i...
/scripts/DS_dataprep.R
no_license
EPLeyne/Data_School_ggplot
R
false
false
3,093
r
library(tidyverse) col_drop <- c('fpNodeId', 'packet_stemid', 'position', 'pot_stemid', 'Photo_20181129.60.1', 'Photo_20181204.32.1', 'Flowering Date_20180524.40.1') DS_polytunnel_vis <- read_csv('DS_polytunnel-wide.csv') %>% select(-(col_drop)) %>% dplyr::rename_all(funs(make.names(.))) # %>% # filter(line.i...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/kmermods.R \docType{package} \name{kmermods} \alias{kmermods} \alias{kmermods-package} \title{\code{kmermods}: Represents Kmers As Integers Along The Genome} \description{ \code{kmermods}: Represents Kmers As Integers Along The Genome }
/man/kmermods.Rd
no_license
TomMayo/kmermods
R
false
true
316
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/kmermods.R \docType{package} \name{kmermods} \alias{kmermods} \alias{kmermods-package} \title{\code{kmermods}: Represents Kmers As Integers Along The Genome} \description{ \code{kmermods}: Represents Kmers As Integers Along The Genome }
mapdeckHeatmapDependency <- function() { list( createHtmlDependency( name = "heatmap", version = "1.0.0", src = system.file("htmlwidgets/lib/heatmap", package = "mapdeck"), script = c("heatmap.js"), all_files = FALSE ) ) } #' Add Heatmap #' #' The Heatmap Layer can be used to visualise spatial di...
/R/map_layer_heatmap.R
no_license
harryprince/mapdeck
R
false
false
4,727
r
mapdeckHeatmapDependency <- function() { list( createHtmlDependency( name = "heatmap", version = "1.0.0", src = system.file("htmlwidgets/lib/heatmap", package = "mapdeck"), script = c("heatmap.js"), all_files = FALSE ) ) } #' Add Heatmap #' #' The Heatmap Layer can be used to visualise spatial di...
library(assist) context("Test describe") test_that("describe cars", { df = assist::describe(ggplot2::diamonds) expect_equal(df$N[1], 53940) expect_equal(df$mean[6], 3932.800) })
/tests/testthat/test_describe.R
no_license
bjornerstedt/assist
R
false
false
186
r
library(assist) context("Test describe") test_that("describe cars", { df = assist::describe(ggplot2::diamonds) expect_equal(df$N[1], 53940) expect_equal(df$mean[6], 3932.800) })