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
# solution of exercise 3 # question 1 secondMinSquared <- function (x) { # check the input is vector or not if (!is.vector(x)) { stop('input is not a vector!') # return error and quit } if (!is.numeric(x)){ stop('input vector contains non-numeric element(s)') } # squared the vector # find ...
/Exercise3/solution.r
no_license
bailin7134/slm_fs2017
R
false
false
1,378
r
# solution of exercise 3 # question 1 secondMinSquared <- function (x) { # check the input is vector or not if (!is.vector(x)) { stop('input is not a vector!') # return error and quit } if (!is.numeric(x)){ stop('input vector contains non-numeric element(s)') } # squared the vector # find ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/dexr_hl_figure_costs.R \name{hl_figure_energycosts_requests_giniByStartT} \alias{hl_figure_energycosts_requests_giniByStartT} \title{Retrieves requests data from DB and creates figure of gini coefficient of cost per KWh by delivery start time...
/man/hl_figure_energycosts_requests_giniByStartT.Rd
no_license
UniK-INES/dexR
R
false
true
675
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/dexr_hl_figure_costs.R \name{hl_figure_energycosts_requests_giniByStartT} \alias{hl_figure_energycosts_requests_giniByStartT} \title{Retrieves requests data from DB and creates figure of gini coefficient of cost per KWh by delivery start time...
# Take the state name (state), outcome (outcome), and ranking of the hospital for that outcome (num). # From out-of-care measures.csv file # Returns a vector with the name of the hospital - ranking by 'num' # rankhospital <- function(state, illness , num = "best") { if (num == "best") num <- 1 ...
/rankhospital.R
no_license
CushingDavid/ProgrammingAssignment3
R
false
false
2,770
r
# Take the state name (state), outcome (outcome), and ranking of the hospital for that outcome (num). # From out-of-care measures.csv file # Returns a vector with the name of the hospital - ranking by 'num' # rankhospital <- function(state, illness , num = "best") { if (num == "best") num <- 1 ...
#' GMLSphericalCS #' #' @docType class #' @importFrom R6 R6Class #' @export #' @keywords ISO GML spherical coordinate system #' @return Object of \code{\link{R6Class}} for modelling an GMLSphericalCS #' @format \code{\link{R6Class}} object. #' #' @section Inherited Methods: #' \describe{ #' \item{\code{new(xml, defaul...
/R/GMLShericalCS.R
no_license
65MO/geometa
R
false
false
1,145
r
#' GMLSphericalCS #' #' @docType class #' @importFrom R6 R6Class #' @export #' @keywords ISO GML spherical coordinate system #' @return Object of \code{\link{R6Class}} for modelling an GMLSphericalCS #' @format \code{\link{R6Class}} object. #' #' @section Inherited Methods: #' \describe{ #' \item{\code{new(xml, defaul...
##' The gradient for the mean function in the GLM framework. ##' ##' <details> ##' @param par "vector" ##' @param linkArgs "list" ##' @return "matrix" of the same dimension as the linear predictor ##' @references Li 2012 ##' @author Feng Li, Department of Statistics, Stockholm University, Sweden. ##' @note Created: Thu...
/R/parMeanFunGrad.R
no_license
kl-lab/fformpp
R
false
false
3,103
r
##' The gradient for the mean function in the GLM framework. ##' ##' <details> ##' @param par "vector" ##' @param linkArgs "list" ##' @return "matrix" of the same dimension as the linear predictor ##' @references Li 2012 ##' @author Feng Li, Department of Statistics, Stockholm University, Sweden. ##' @note Created: Thu...
#' seminr estimate_cbsem() function #' #' The \code{seminr} package provides a natural syntax for researchers to describe #' structural equation models. #' #' @usage #' estimate_cbsem(data, measurement_model = NULL, #' structural_model = NULL, item_associations = NULL, #' model = NULL, lav...
/R/estimate_cbsem.R
no_license
sem-in-r/seminr
R
false
false
12,705
r
#' seminr estimate_cbsem() function #' #' The \code{seminr} package provides a natural syntax for researchers to describe #' structural equation models. #' #' @usage #' estimate_cbsem(data, measurement_model = NULL, #' structural_model = NULL, item_associations = NULL, #' model = NULL, lav...
#'======================================================================================================================================== #' Project: ISWEL #' Subject: Code to process CEEPA and extract relevant data for target countries #' Author: Michiel van Dijk #' Contact: michiel.vandijk@wur.nl #'============...
/Code/ZWE/Household_surveys/Process_CEEPA_ZWE.R
no_license
shaohuizhang/Global-to-local-GLOBIOM
R
false
false
3,933
r
#'======================================================================================================================================== #' Project: ISWEL #' Subject: Code to process CEEPA and extract relevant data for target countries #' Author: Michiel van Dijk #' Contact: michiel.vandijk@wur.nl #'============...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/calcChromArmPloidies.R \name{calcChromArmPloidies} \alias{calcChromArmPloidies} \title{Calculate overall chrom arm copy numbers} \usage{ calcChromArmPloidies( purple.cnv.file, out.file = NULL, min.rel.cum.segment.size = 0.5, max.rel.c...
/man/calcChromArmPloidies.Rd
no_license
UMCUGenetics/hmfGeneAnnotation
R
false
true
2,689
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/calcChromArmPloidies.R \name{calcChromArmPloidies} \alias{calcChromArmPloidies} \title{Calculate overall chrom arm copy numbers} \usage{ calcChromArmPloidies( purple.cnv.file, out.file = NULL, min.rel.cum.segment.size = 0.5, max.rel.c...
#' A plot function for nonlinear relationship #' #' This function allows you to plot a graph on the nonlinear relationship of two variables. #' @param #' @keywords plot_nonlinear #' @export plot_nonlinear <- function(y, x, data, k = 10, family = "binomial"){ name_x <- deparse(substitute(x)) name_y <- deparse...
/R/plot_nonlinear.R
no_license
ghowoo/Wu
R
false
false
1,465
r
#' A plot function for nonlinear relationship #' #' This function allows you to plot a graph on the nonlinear relationship of two variables. #' @param #' @keywords plot_nonlinear #' @export plot_nonlinear <- function(y, x, data, k = 10, family = "binomial"){ name_x <- deparse(substitute(x)) name_y <- deparse...
# # This is the server logic of a Shiny web application. You can run the # application by clicking 'Run App' above. # # Find out more about building applications with Shiny here: # # http://shiny.rstudio.com/ # library(shiny) # Define server logic required to draw a histogram shinyServer( fu...
/WebApp/DataImputation/server.R
no_license
bassantNabeh/Imputation-Data
R
false
false
2,214
r
# # This is the server logic of a Shiny web application. You can run the # application by clicking 'Run App' above. # # Find out more about building applications with Shiny here: # # http://shiny.rstudio.com/ # library(shiny) # Define server logic required to draw a histogram shinyServer( fu...
input_unit_ui <- function() { radioButtons( "unit", "Select data unit", choices = c("Count", "Rate (per 100K)"), selected = "Count" ) } input_category_ui <- function() { radioButtons( "category", "Select crime category", choices = c("All", "Person", "Property"), selected = "All" ...
/app/modules/inputs_ui.R
permissive
ICJIA/ucr-index-offense-explorer
R
false
false
1,914
r
input_unit_ui <- function() { radioButtons( "unit", "Select data unit", choices = c("Count", "Rate (per 100K)"), selected = "Count" ) } input_category_ui <- function() { radioButtons( "category", "Select crime category", choices = c("All", "Person", "Property"), selected = "All" ...
TermFrequency <- function(x) { if (sum(class(x)%in%c("VCorpus", "Corpus")) > 0) { dtm <- tm::DocumentTermMatrix(x, control = list(weighting = tm::weightBin)) } else if (sum(class(x) %in% c("DocumentTermMatrix", "simple_triplet_matrix")) > 0) { dtm <- tm::weightBin( x ) } dtm <- as.matrix(dtm) ...
/R/TermFrequency.R
no_license
cran/KDViz
R
false
false
537
r
TermFrequency <- function(x) { if (sum(class(x)%in%c("VCorpus", "Corpus")) > 0) { dtm <- tm::DocumentTermMatrix(x, control = list(weighting = tm::weightBin)) } else if (sum(class(x) %in% c("DocumentTermMatrix", "simple_triplet_matrix")) > 0) { dtm <- tm::weightBin( x ) } dtm <- as.matrix(dtm) ...
#!/usr/bin/env Rscript # ================================================================================ # # Coursera - Exploratory Data Analysis - Course Project 1 # # Generate plot4.png ## downloadAndUnpackData() # # Download and unpack the source data. # # Note: will not update/overwrite existing copies...
/plot4.R
no_license
hpmcwill/ExData_Plotting1
R
false
false
3,715
r
#!/usr/bin/env Rscript # ================================================================================ # # Coursera - Exploratory Data Analysis - Course Project 1 # # Generate plot4.png ## downloadAndUnpackData() # # Download and unpack the source data. # # Note: will not update/overwrite existing copies...
% Generated by roxygen2 (4.0.2): do not edit by hand \name{initialize-ASEset} \alias{ASEsetFromArrays} \alias{ASEsetFromCountList} \alias{initialize-ASEset} \title{Initialize ASEset} \usage{ ASEsetFromCountList(rowData, countListUnknown = NULL, countListPlus = NULL, countListMinus = NULL, colData = NULL, mapBiasExpMe...
/man/initialize-ASEset.Rd
no_license
jimhester/AllelicImbalance
R
false
false
3,724
rd
% Generated by roxygen2 (4.0.2): do not edit by hand \name{initialize-ASEset} \alias{ASEsetFromArrays} \alias{ASEsetFromCountList} \alias{initialize-ASEset} \title{Initialize ASEset} \usage{ ASEsetFromCountList(rowData, countListUnknown = NULL, countListPlus = NULL, countListMinus = NULL, colData = NULL, mapBiasExpMe...
# TODO: Add comment # # Author: furia ############################################################################### ##### ## SynapseEntity "show" method ##### setMethod( f = "show", signature = signature("SynapseEntity"), definition = function(object){ cat('An object of class "', class(object), '"\n', sep...
/R/SynapseEntity.R
no_license
hoffma23/rSynapseClient
R
false
false
8,318
r
# TODO: Add comment # # Author: furia ############################################################################### ##### ## SynapseEntity "show" method ##### setMethod( f = "show", signature = signature("SynapseEntity"), definition = function(object){ cat('An object of class "', class(object), '"\n', sep...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/optimisers.R \name{optimisers} \alias{optimisers} \alias{nelder_mead} \alias{powell} \alias{cg} \alias{bfgs} \alias{newton_cg} \alias{l_bfgs_b} \alias{tnc} \alias{cobyla} \alias{slsqp} \alias{gradient_descent} \alias{adadelta} \alias{adagrad}...
/man/optimisers.Rd
permissive
jeffreypullin/greta
R
false
true
4,455
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/optimisers.R \name{optimisers} \alias{optimisers} \alias{nelder_mead} \alias{powell} \alias{cg} \alias{bfgs} \alias{newton_cg} \alias{l_bfgs_b} \alias{tnc} \alias{cobyla} \alias{slsqp} \alias{gradient_descent} \alias{adadelta} \alias{adagrad}...
# postdlnre.lnre <- function (model, x, m, N, ...) { # if (! inherits(model, "lnre")) stop("first argument must be object of class 'lnre'") # if (!(is.numeric(N) && all(N >= 0))) stop("argument 'N' must be non-negative integer") # if (!(is.numeric(m) && all(m >= 1))) stop("argument 'm' must be positive integer") ...
/zipfR/R/posterior_lnre.R
no_license
ingted/R-Examples
R
false
false
804
r
# postdlnre.lnre <- function (model, x, m, N, ...) { # if (! inherits(model, "lnre")) stop("first argument must be object of class 'lnre'") # if (!(is.numeric(N) && all(N >= 0))) stop("argument 'N' must be non-negative integer") # if (!(is.numeric(m) && all(m >= 1))) stop("argument 'm' must be positive integer") ...
% Generated by roxygen2 (4.0.2): do not edit by hand \name{shinyalert} \alias{shinyalert} \title{shinyalert} \usage{ shinyalert(id, click.hide = TRUE, auto.close.after = NULL) } \arguments{ \item{id}{Specifies the alert id that will be used to access the} \item{click.hide}{If TRUE then clicking on the alert will hide ...
/man/shinyalert.Rd
permissive
edwinacu/ShinySky
R
false
false
659
rd
% Generated by roxygen2 (4.0.2): do not edit by hand \name{shinyalert} \alias{shinyalert} \title{shinyalert} \usage{ shinyalert(id, click.hide = TRUE, auto.close.after = NULL) } \arguments{ \item{id}{Specifies the alert id that will be used to access the} \item{click.hide}{If TRUE then clicking on the alert will hide ...
\name{air} \alias{air} \docType{data} \title{ dataset from an environmental study. } \description{ This dataset contains four variables: The concentration of the air pollutant ozone, wind speed, temperature and radiation. All of them are daily measurements for 111 days. Usually the concentration of the air pollu...
/man/air.Rd
no_license
zzz1990771/gplsim
R
false
false
1,208
rd
\name{air} \alias{air} \docType{data} \title{ dataset from an environmental study. } \description{ This dataset contains four variables: The concentration of the air pollutant ozone, wind speed, temperature and radiation. All of them are daily measurements for 111 days. Usually the concentration of the air pollu...
# 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/meanEXP__poverty__agegrps__.r
permissive
HHS-AHRQ/MEPS-summary-tables
R
false
false
2,050
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...
\name{NEWS} \title{News for Package 'biwavelet'} \encoding{UTF-8} \section{Changes in biwavelet version 0.20.15 (2017-03-01)}{ \subsection{fixed}{ \itemize{ \item Fixed return NULL issues with Windows platforms } } } \section{Changes in biwavelet version 0.20.14 (2017-02-24)}{ \subsection{fixed}{...
/inst/NEWS.Rd
no_license
mabelsfatalfable/biwavelet
R
false
false
9,325
rd
\name{NEWS} \title{News for Package 'biwavelet'} \encoding{UTF-8} \section{Changes in biwavelet version 0.20.15 (2017-03-01)}{ \subsection{fixed}{ \itemize{ \item Fixed return NULL issues with Windows platforms } } } \section{Changes in biwavelet version 0.20.14 (2017-02-24)}{ \subsection{fixed}{...
graphics.off() #Load Hmisc library library(Hmisc) #Read Data data=read.csv('S:/Shared Projects/Laura/BDC/Projects/Sonalee Ravi/ASKED-IT/Data/ASKEDIT_DATA_2018-12-05_1420.csv') #Setting Labels label(data$pid)="Participant ID" label(data$redcap_event_name)="Event Name" label(data$age)="Age" label(data$nih_sex)="Gender" ...
/Sonalee Ravi/ASKEDIT/ASKEDIT_R_2018-12-05_1420.r
no_license
childhealthbiostatscore/BDC-Code
R
false
false
4,890
r
graphics.off() #Load Hmisc library library(Hmisc) #Read Data data=read.csv('S:/Shared Projects/Laura/BDC/Projects/Sonalee Ravi/ASKED-IT/Data/ASKEDIT_DATA_2018-12-05_1420.csv') #Setting Labels label(data$pid)="Participant ID" label(data$redcap_event_name)="Event Name" label(data$age)="Age" label(data$nih_sex)="Gender" ...
## http://r.789695.n4.nabble.com/Converting-data-frame-into-multidimensional-array-td3926705.html
/pla/R/as.array.R
no_license
ingted/R-Examples
R
false
false
101
r
## http://r.789695.n4.nabble.com/Converting-data-frame-into-multidimensional-array-td3926705.html
testlist <- list(id = NULL, score = NULL, id = NULL, booklet_id = c(-101058055L, -101058055L, -101058055L, -101058055L, -101058055L, -101058055L, -101058055L, -101058055L, -101058055L, -101058055L, -101058055L, -4193537L, 268435456L, 0L, 353173504L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L...
/dexterMST/inst/testfiles/mutate_booklet_score/libFuzzer_mutate_booklet_score/mutate_booklet_score_valgrind_files/1612727298-test.R
no_license
akhikolla/updatedatatype-list1
R
false
false
648
r
testlist <- list(id = NULL, score = NULL, id = NULL, booklet_id = c(-101058055L, -101058055L, -101058055L, -101058055L, -101058055L, -101058055L, -101058055L, -101058055L, -101058055L, -101058055L, -101058055L, -4193537L, 268435456L, 0L, 353173504L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L...
library(samr) library(reticulate) use_python("/usr/bin/python3") source_python("gastricData.py") # MSI_reshaped_R <- MSI_reshaped MassSpec_R <- MassSpec tsne3_R <- tsne3 plot(tsne3_R) # set.seed(100) # samfit <- SAM(MassSpec_R, tsne3_R, resp.type = "Two class unpaired") # # examine significant gene li...
/Code/gastricData/gastricR.R
no_license
mostafa20223/GP
R
false
false
375
r
library(samr) library(reticulate) use_python("/usr/bin/python3") source_python("gastricData.py") # MSI_reshaped_R <- MSI_reshaped MassSpec_R <- MassSpec tsne3_R <- tsne3 plot(tsne3_R) # set.seed(100) # samfit <- SAM(MassSpec_R, tsne3_R, resp.type = "Two class unpaired") # # examine significant gene li...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/barplot_errbar.R \name{barplot_errbar} \alias{barplot_errbar} \title{Plot a barplot graph with error bar on y} \usage{ barplot_errbar( ..., errbar.y = NULL, errbar.y.plus = NULL, errbar.y.minus = NULL, y.plus = NULL, y.minus = NUL...
/man/barplot_errbar.Rd
no_license
cran/HelpersMG
R
false
true
2,528
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/barplot_errbar.R \name{barplot_errbar} \alias{barplot_errbar} \title{Plot a barplot graph with error bar on y} \usage{ barplot_errbar( ..., errbar.y = NULL, errbar.y.plus = NULL, errbar.y.minus = NULL, y.plus = NULL, y.minus = NUL...
print("Hello from Binder!") system("freebayes --help") #check if freebayes work library(vcfR)
/hello.R
no_license
Jigyasa3/binder-test
R
false
false
96
r
print("Hello from Binder!") system("freebayes --help") #check if freebayes work library(vcfR)
# Create posts automatically # Author: Shixiang Wang # License: MIT new_post <- function(post_name = NULL, dir = file.path(getwd(), "content/cn/post"), type = c("rmd", "md"), template_path = getwd(), add_prefix = TRUE, edit_file = TRUE, force = FALSE) { i...
/new.R
no_license
ShixiangWang/home
R
false
false
1,803
r
# Create posts automatically # Author: Shixiang Wang # License: MIT new_post <- function(post_name = NULL, dir = file.path(getwd(), "content/cn/post"), type = c("rmd", "md"), template_path = getwd(), add_prefix = TRUE, edit_file = TRUE, force = FALSE) { i...
# "rankall" takes as input a state and the outcome name # "rankall" returns a data fram with hospital name and state with given rank # according to num and outcome name rankhospital <- function(outcome, num="best") { #1. read outcome data #2. check state and outcome are valid #3. sort, data checks etcss...
/rankall.R
no_license
paolinoroscia/ProgrammingAssignment3
R
false
false
455
r
# "rankall" takes as input a state and the outcome name # "rankall" returns a data fram with hospital name and state with given rank # according to num and outcome name rankhospital <- function(outcome, num="best") { #1. read outcome data #2. check state and outcome are valid #3. sort, data checks etcss...
## Challenge Assignment ## # Deliverable 1: Linear regression to predict MPG # Data: MechaCar MPG dataset library(dplyr) setwd("~/Desktop/DATA_ANALYTICS/challenges/module_15_R_analysis/MechaCar_Statistical_Analysis") dev1_table <- read.csv(file='MechaCar_mpg.csv',check.names=F,stringsAsFactors = F) #linear regressi...
/MechaCarChallenge.R
no_license
cgurbatri/MechaCar_Statistical_Analysis
R
false
false
1,292
r
## Challenge Assignment ## # Deliverable 1: Linear regression to predict MPG # Data: MechaCar MPG dataset library(dplyr) setwd("~/Desktop/DATA_ANALYTICS/challenges/module_15_R_analysis/MechaCar_Statistical_Analysis") dev1_table <- read.csv(file='MechaCar_mpg.csv',check.names=F,stringsAsFactors = F) #linear regressi...
testlist <- list(a = 0L, b = 0L, x = c(-21589L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L)) result <- do.call(grattan:::anyOutside,testlist) str(result)
/grattan/inst/testfiles/anyOutside/libFuzzer_anyOutside/anyOutside_valgrind_files/1610387040-test.R
no_license
akhikolla/updated-only-Issues
R
false
false
170
r
testlist <- list(a = 0L, b = 0L, x = c(-21589L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L)) result <- do.call(grattan:::anyOutside,testlist) str(result)
############################################################################ ## File Name: user_options.R ## File Purpose: Specify inputs for run_file.R ## Author: Jeanette Birnbaum ## Date: 10/14/2014 ## Edited on: ## Additional Comments: ############################################################################...
/examples/tza_3_chemo1cages30-49/input/user_options.R
no_license
netterie/screentreatGlobal
R
false
false
4,831
r
############################################################################ ## File Name: user_options.R ## File Purpose: Specify inputs for run_file.R ## Author: Jeanette Birnbaum ## Date: 10/14/2014 ## Edited on: ## Additional Comments: ############################################################################...
#' Computes the posterior hazard values for a vector x for the Piecewise Exponential Hazard model (PEH) #' @param x Vector of times to compute the hazard. #' @param G1 List of posterior samples from the BayesPiecewiseHazard function. #' @return Matrix containing the posterior distribution of hazard values h(x) #'@...
/BayesReversePLLH/R/GetALLHazPiece.R
no_license
akhikolla/ClusterTests
R
false
false
918
r
#' Computes the posterior hazard values for a vector x for the Piecewise Exponential Hazard model (PEH) #' @param x Vector of times to compute the hazard. #' @param G1 List of posterior samples from the BayesPiecewiseHazard function. #' @return Matrix containing the posterior distribution of hazard values h(x) #'@...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{rc_geoms_2018} \alias{rc_geoms_2018} \title{Boundaries for Regional Council 2018} \format{ A data frame with 17 rows and 3 variables: \describe{ \item{code}{Code of the RC} \item{name}{Name of the RC} \item{geom}{m...
/man/rc_geoms_2018.Rd
permissive
harmonic-analytics/db-geonz
R
false
true
580
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{rc_geoms_2018} \alias{rc_geoms_2018} \title{Boundaries for Regional Council 2018} \format{ A data frame with 17 rows and 3 variables: \describe{ \item{code}{Code of the RC} \item{name}{Name of the RC} \item{geom}{m...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mysan.R \name{mysan} \alias{mysan} \title{Sanitizer function for xtable that converts scientific notation to latex style} \usage{ mysan(x) } \arguments{ \item{x}{character or numeric vector} } \value{ sanitized character } \description{ Sanit...
/man/mysan.Rd
no_license
andy3nieto/random-functions
R
false
true
695
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mysan.R \name{mysan} \alias{mysan} \title{Sanitizer function for xtable that converts scientific notation to latex style} \usage{ mysan(x) } \arguments{ \item{x}{character or numeric vector} } \value{ sanitized character } \description{ Sanit...
% Generated by roxygen2 (4.0.2): do not edit by hand \name{sju.groupString} \alias{sju.groupString} \title{Group near elements of string vectors} \usage{ sju.groupString(strings, maxdist = 3, method = "lv", strict = FALSE, trim.whitespace = TRUE, remove.empty = TRUE, showProgressBar = FALSE) } \arguments{ \item{strin...
/man/sju.groupString.Rd
no_license
harshagn/devel
R
false
false
1,890
rd
% Generated by roxygen2 (4.0.2): do not edit by hand \name{sju.groupString} \alias{sju.groupString} \title{Group near elements of string vectors} \usage{ sju.groupString(strings, maxdist = 3, method = "lv", strict = FALSE, trim.whitespace = TRUE, remove.empty = TRUE, showProgressBar = FALSE) } \arguments{ \item{strin...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/extract_tree.R \name{extract_tree} \alias{extract_tree} \title{Extract sub result from the result of the wavelet_screening} \usage{ extract_tree(res, lev_res, thresh) } \arguments{ \item{res}{Output of Wavelet_screening.} \item{lev_res}{the ...
/man/extract_tree.Rd
no_license
william-denault/WaveletScreening
R
false
true
970
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/extract_tree.R \name{extract_tree} \alias{extract_tree} \title{Extract sub result from the result of the wavelet_screening} \usage{ extract_tree(res, lev_res, thresh) } \arguments{ \item{res}{Output of Wavelet_screening.} \item{lev_res}{the ...
library(MSnbase) ### Name: plotMzDelta-methods ### Title: The delta m/z plot ### Aliases: plotMzDelta-methods plotMzDelta,MSnExp-method ### plotMzDelta,mzRramp-method plotMzDelta ### Keywords: methods ### ** Examples mzdplot <- plotMzDelta(itraqdata, subset = 0.5, rep...
/data/genthat_extracted_code/MSnbase/examples/plotMzDelta-methods.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
621
r
library(MSnbase) ### Name: plotMzDelta-methods ### Title: The delta m/z plot ### Aliases: plotMzDelta-methods plotMzDelta,MSnExp-method ### plotMzDelta,mzRramp-method plotMzDelta ### Keywords: methods ### ** Examples mzdplot <- plotMzDelta(itraqdata, subset = 0.5, rep...
#kNN Machine learning algorithm 1 # 100daysofMLcode # loading packages library(pacman) p_load(class, tibble, gmodels, dplyr, gganimate, ggplot2, plotly) # working directory setwd("C:/Users/stanley/Desktop/MISCELLANEOUS R/ml projects/Knn/breast cancer") # loading dataset wbcd<-read.csv(file.choose(), as.is...
/breast cancer/breast cancer original knn algo.R
no_license
stanleyrazor/Practices-on-Classification-training-Knn
R
false
false
7,326
r
#kNN Machine learning algorithm 1 # 100daysofMLcode # loading packages library(pacman) p_load(class, tibble, gmodels, dplyr, gganimate, ggplot2, plotly) # working directory setwd("C:/Users/stanley/Desktop/MISCELLANEOUS R/ml projects/Knn/breast cancer") # loading dataset wbcd<-read.csv(file.choose(), as.is...
testlist <- list(obs_to_nodes_temp = structure(c(3.60908643865453e+224, 1.11742128101669e+83, 1.97870122171185e+143, NaN, 9.37480792170664e+280, 3.07504141416437e-136, 1.01645313737868e-124, 1.00679150745081e-73, 1.27047634996911e-62, 2.13409614918679e-145, 2.01768927817267e+47, NaN, 4.713762584588e-48, 1.750615959...
/issuestests/bartBMA/inst/testfiles/J/J_output/log_d88529322dcf14546d0075ec66599396b1bdbffd/J-test.R
no_license
akhikolla/RcppDeepStateTest
R
false
false
2,323
r
testlist <- list(obs_to_nodes_temp = structure(c(3.60908643865453e+224, 1.11742128101669e+83, 1.97870122171185e+143, NaN, 9.37480792170664e+280, 3.07504141416437e-136, 1.01645313737868e-124, 1.00679150745081e-73, 1.27047634996911e-62, 2.13409614918679e-145, 2.01768927817267e+47, NaN, 4.713762584588e-48, 1.750615959...
gs <- read.csv("ncis_bystate_bymonth_bytype.csv") saveRDS(gs, file="/tmp/NYTimesGunSalesData.rds") newgs <- readRDS("/tmp/NYTimesGunSalesData.rds") identical(newgs, gs) object.size(gs) file.info("/tmp/NYTimesGunSalesData.rds")$size ### old URL has changed ##webgs <- read.csv(paste0("https://raw.githubuserconte...
/lesson02/data.R
no_license
anhnguyendepocen/samples-intermediate-r
R
false
false
842
r
gs <- read.csv("ncis_bystate_bymonth_bytype.csv") saveRDS(gs, file="/tmp/NYTimesGunSalesData.rds") newgs <- readRDS("/tmp/NYTimesGunSalesData.rds") identical(newgs, gs) object.size(gs) file.info("/tmp/NYTimesGunSalesData.rds")$size ### old URL has changed ##webgs <- read.csv(paste0("https://raw.githubuserconte...
# Example based on Chris Paciorek's tutorial: # https://github.com/berkeley-scf/tutorial-parallel-basics/blob/master/parallel-basics.html # # Note: there is a conflict between openBLAS, the multi-threaded linear # algebra package, and foreach. It can cause linear algebra operations # within a foreach loop to hang # If...
/week7/scf_example/parallel_scf.R
no_license
jpdunc23/stat-215a-fall-2020
R
false
false
1,488
r
# Example based on Chris Paciorek's tutorial: # https://github.com/berkeley-scf/tutorial-parallel-basics/blob/master/parallel-basics.html # # Note: there is a conflict between openBLAS, the multi-threaded linear # algebra package, and foreach. It can cause linear algebra operations # within a foreach loop to hang # If...
## Cahing the Inverse of a Matrix ## The function makeCacheMatrix creates a special matrix object that caches its inverse. makeCacheMatrix <- function(x = matrix()) { invcache <- NULL set <- function(y) { x <<- y invcache <<- NULL } get <- function() x setinv <- function(inverse) i...
/cachematrix.R
no_license
Laurels1/ProgrammingAssignment2
R
false
false
1,104
r
## Cahing the Inverse of a Matrix ## The function makeCacheMatrix creates a special matrix object that caches its inverse. makeCacheMatrix <- function(x = matrix()) { invcache <- NULL set <- function(y) { x <<- y invcache <<- NULL } get <- function() x setinv <- function(inverse) i...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/teamBowlersVsBatsmenMatch.R \name{teamBowlersVsBatsmenMatch} \alias{teamBowlersVsBatsmenMatch} \title{Team bowlers vs batsmen in a match} \usage{ teamBowlersVsBatsmenMatch(match,theTeam,opposition, plot=1) } \arguments{ \item{match}{The data ...
/man/teamBowlersVsBatsmenMatch.Rd
no_license
tvganesh/yorkr
R
false
true
1,659
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/teamBowlersVsBatsmenMatch.R \name{teamBowlersVsBatsmenMatch} \alias{teamBowlersVsBatsmenMatch} \title{Team bowlers vs batsmen in a match} \usage{ teamBowlersVsBatsmenMatch(match,theTeam,opposition, plot=1) } \arguments{ \item{match}{The data ...
testlist <- list(latLongs = structure(c(NaN, Inf, -Inf), .Dim = c(3L, 1L)), r = 2.2519576149808e-310) result <- do.call(MGDrivE::calcCos,testlist) str(result)
/MGDrivE/inst/testfiles/calcCos/libFuzzer_calcCos/calcCos_valgrind_files/1612727334-test.R
no_license
akhikolla/updatedatatype-list2
R
false
false
163
r
testlist <- list(latLongs = structure(c(NaN, Inf, -Inf), .Dim = c(3L, 1L)), r = 2.2519576149808e-310) result <- do.call(MGDrivE::calcCos,testlist) str(result)
# Rattle is Copyright (c) 2006-2014 Togaware Pty Ltd. #============================================================ # Rattle timestamp: 2014-12-06 21:02:42 x86_64-pc-linux-gnu # Rattle version 3.3.1 user 'kanashiro' # Export this log textview to a file using the Export button or the Tools # menu to save a log of a...
/analysis/C++/model_tree/cp=0.7/metrics.R
no_license
lucaskanashiro/ML_metrics
R
false
false
17,051
r
# Rattle is Copyright (c) 2006-2014 Togaware Pty Ltd. #============================================================ # Rattle timestamp: 2014-12-06 21:02:42 x86_64-pc-linux-gnu # Rattle version 3.3.1 user 'kanashiro' # Export this log textview to a file using the Export button or the Tools # menu to save a log of a...
library(parallel) simRep <- 5000 # Replication times in one simulation pvalue.true <- .05 # Testing type I error b.var <- c(0.0049) # The set of varaince of random covariates b as random slope smooth <- 0 # measurement error is added to M if smooth = 0; no measurement error is added if sooth = 1 cores <- 8 r.sim <- b....
/full simulation/summer/hetero_power/variance0.0049/seed2/heter_power_0.0049_pca_u_seed2_200_20.R
no_license
wma9/FMRI-project
R
false
false
9,199
r
library(parallel) simRep <- 5000 # Replication times in one simulation pvalue.true <- .05 # Testing type I error b.var <- c(0.0049) # The set of varaince of random covariates b as random slope smooth <- 0 # measurement error is added to M if smooth = 0; no measurement error is added if sooth = 1 cores <- 8 r.sim <- b....
for(i in 5:10){ print("Hello R") } for(i in 1:5){ print("Hello R") }
/forloop.R
no_license
khyati124/Rstudio
R
false
false
73
r
for(i in 5:10){ print("Hello R") } for(i in 1:5){ print("Hello R") }
#' Canopy and Stem Interception Model #' #' This model calculates the precipitation necessery to fill canopy and stem storage, based on Gash et al. 1995, and Valente et al. 1977. #' The defults represent values of Mediterranean Quercus ilex (evergreen oak) ecosystem acording to the reference below. #' #' @usage c...
/ET_functions/R/interception.R
no_license
eladante/Conductance
R
false
false
2,566
r
#' Canopy and Stem Interception Model #' #' This model calculates the precipitation necessery to fill canopy and stem storage, based on Gash et al. 1995, and Valente et al. 1977. #' The defults represent values of Mediterranean Quercus ilex (evergreen oak) ecosystem acording to the reference below. #' #' @usage c...
library(OutbreakTools) ### Name: plotggMST ### Title: Function to plot a minimum spanning tree of the class 'obkData' ### Aliases: plotggMST ### ** Examples ## Not run: ##D ## load data ##D data(HorseFlu) ##D x <- HorseFlu ##D ##D ## plot minimum spanning tree for individual 42 ##D plotggMST(x,individualID=42) ##...
/data/genthat_extracted_code/OutbreakTools/examples/plotggMST.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
499
r
library(OutbreakTools) ### Name: plotggMST ### Title: Function to plot a minimum spanning tree of the class 'obkData' ### Aliases: plotggMST ### ** Examples ## Not run: ##D ## load data ##D data(HorseFlu) ##D x <- HorseFlu ##D ##D ## plot minimum spanning tree for individual 42 ##D plotggMST(x,individualID=42) ##...
#' Ngram Collocations #' #' Find a important ngram (2-3) collocations. Wraps \code{\link[quanteda]{collocations}} #' to provide stopword, min/max characters, and stemming with a generic \code{plot} #' function. #' #' @param x A vector of character strings. #' @param n The number of rows to include. #' @param gram.leng...
/R/ngram_collocations.R
no_license
data-steve/termco
R
false
false
7,249
r
#' Ngram Collocations #' #' Find a important ngram (2-3) collocations. Wraps \code{\link[quanteda]{collocations}} #' to provide stopword, min/max characters, and stemming with a generic \code{plot} #' function. #' #' @param x A vector of character strings. #' @param n The number of rows to include. #' @param gram.leng...
#budburst expgdd_bbd$ecosystem<-"forest" expgdd_bbd$ecosystem[expgdd_bbd$site2=="exp01"]<-"grassland" expgdd_bbd$sp.eco<-paste(expgdd_bbd$sp.name,expgdd_bbd$ecosystem) bbecos<- expgdd_bbd %>% # start with the data frame distinct(sp.eco, .keep_all = TRUE) %>% # establishing grouping variables dplyr::select(sp.name,g...
/Analyses/source/get_ecosystem.R
no_license
AileneKane/radcliffe
R
false
false
1,360
r
#budburst expgdd_bbd$ecosystem<-"forest" expgdd_bbd$ecosystem[expgdd_bbd$site2=="exp01"]<-"grassland" expgdd_bbd$sp.eco<-paste(expgdd_bbd$sp.name,expgdd_bbd$ecosystem) bbecos<- expgdd_bbd %>% # start with the data frame distinct(sp.eco, .keep_all = TRUE) %>% # establishing grouping variables dplyr::select(sp.name,g...
\name{GLognormal} \alias{GLognormal} \docType{data} \title{ %% ~~ data name/kind ... ~~ Class definition to control lognormal distribution } \description{ %% ~~ A concise (1-5 lines) description of the dataset. ~~ } \usage{lnorm<-GLognormal$new(mu=350.25,sigmma=105.075)} \format{ SetParam(lambda=lambda,zeta=zeta) ...
/man/GLognormal.Rd
no_license
ShinsukeSakai0321/LimitState
R
false
false
1,331
rd
\name{GLognormal} \alias{GLognormal} \docType{data} \title{ %% ~~ data name/kind ... ~~ Class definition to control lognormal distribution } \description{ %% ~~ A concise (1-5 lines) description of the dataset. ~~ } \usage{lnorm<-GLognormal$new(mu=350.25,sigmma=105.075)} \format{ SetParam(lambda=lambda,zeta=zeta) ...
#' Map your prepared data with SurvMapper2 #' #' Later version of SurvMapper. Creates surveillance chloropleth maps for data prepared with PrepMap. Note that due to the use of grid for legend and the small inlets for non-visible #' countries, mapping is not superswift and elements appear one by one to the graph. #' Cu...
/R/SurvMapper2.R
no_license
TommiKarki/SurvMaps
R
false
false
16,920
r
#' Map your prepared data with SurvMapper2 #' #' Later version of SurvMapper. Creates surveillance chloropleth maps for data prepared with PrepMap. Note that due to the use of grid for legend and the small inlets for non-visible #' countries, mapping is not superswift and elements appear one by one to the graph. #' Cu...
test_that("eglm returns the same broom output as glm", { m1 <- lm(mpg ~ wt, data = mtcars) m2 <- eflm::elm(mpg ~ wt, data = mtcars, reduce = F) m3 <- eflm::elm(mpg ~ wt, data = mtcars, reduce = T) bm1 <- broom::tidy(m1) bm2 <- broom::tidy(m2) bm3 <- broom::tidy(m3) expect_equal(bm2$term, bm1$term) exp...
/tests-extra/test-elm-broom.R
permissive
saxenism/eflm
R
false
false
1,428
r
test_that("eglm returns the same broom output as glm", { m1 <- lm(mpg ~ wt, data = mtcars) m2 <- eflm::elm(mpg ~ wt, data = mtcars, reduce = F) m3 <- eflm::elm(mpg ~ wt, data = mtcars, reduce = T) bm1 <- broom::tidy(m1) bm2 <- broom::tidy(m2) bm3 <- broom::tidy(m3) expect_equal(bm2$term, bm1$term) exp...
library(dplyr) # if data are not present already, download and unzip data if (!file.exists("household_power_consumption.zip")) { download.file("https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip", destfile = "household_power_consumption.zip") unzip(zipfile = "household_power_...
/plot2.R
no_license
Lemdat/ExplDatWeek1
R
false
false
1,306
r
library(dplyr) # if data are not present already, download and unzip data if (!file.exists("household_power_consumption.zip")) { download.file("https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip", destfile = "household_power_consumption.zip") unzip(zipfile = "household_power_...
#' @importFrom plyr count ## Counts the frequency of each intersection being looked at and sets up data for main bar plot. ## Also orders the data for the bar plot and matrix plot Counter <- function(data, num_sets, start_col, name_of_sets, nintersections, mbar_color, order_mat, aggregate, cut, emp...
/R/MainBar.R
no_license
mariobecerra/UpSetR2
R
false
false
8,686
r
#' @importFrom plyr count ## Counts the frequency of each intersection being looked at and sets up data for main bar plot. ## Also orders the data for the bar plot and matrix plot Counter <- function(data, num_sets, start_col, name_of_sets, nintersections, mbar_color, order_mat, aggregate, cut, emp...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/clean.df.R \name{clean.df} \alias{clean.df} \title{Clean the names of a data frame} \usage{ clean.df(df, keep.underscore = TRUE, pidmpattern = "bannerid|banner_id") } \arguments{ \item{df}{a data frame} \item{keep.underscore}{a logical value...
/man/clean.df.Rd
no_license
crazybilly/muadc
R
false
true
776
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/clean.df.R \name{clean.df} \alias{clean.df} \title{Clean the names of a data frame} \usage{ clean.df(df, keep.underscore = TRUE, pidmpattern = "bannerid|banner_id") } \arguments{ \item{df}{a data frame} \item{keep.underscore}{a logical value...
#!/usr/bin/Rscript ## #!/usr/local/bin/Rscript ### ### run.deconv.rl.ls.S.R ### ### 2018.03.29 M.Morii ### R-L method with line search ### mitooldir = "/home/morii/work/github/moriiism/mitool" srtdir = "/home/morii/work/github/moriiism/srt" ### source( paste(mitooldir, "script/mirlib/iolib.R", sep="/") ) source...
/script/run.deconv.rl.ls.S.R
no_license
moriiism/srt
R
false
false
1,342
r
#!/usr/bin/Rscript ## #!/usr/local/bin/Rscript ### ### run.deconv.rl.ls.S.R ### ### 2018.03.29 M.Morii ### R-L method with line search ### mitooldir = "/home/morii/work/github/moriiism/mitool" srtdir = "/home/morii/work/github/moriiism/srt" ### source( paste(mitooldir, "script/mirlib/iolib.R", sep="/") ) source...
#' @title Statistical test for Detrended Fluctuation Analysis. #' #' @description This function performs the statistical test for the long-range correlation exponents obtained by the Detrended Fluctuation Analysis method. #' #' @details This function include following measures alpha_dfa, se_alpha_dfa, r2_alpha_dfa,...
/R/DFA_test.r
no_license
cran/GMZTests
R
false
false
6,149
r
#' @title Statistical test for Detrended Fluctuation Analysis. #' #' @description This function performs the statistical test for the long-range correlation exponents obtained by the Detrended Fluctuation Analysis method. #' #' @details This function include following measures alpha_dfa, se_alpha_dfa, r2_alpha_dfa,...
\name{plotAdens} \alias{plotAdens} \title{ Plot Age Density Curves } \description{ Plot density of field (e.g. length) by age as waveforms (density curves) or bars. } \usage{ plotAdens(dat, xfld="len", yfld="age", type="dens", sd=3, strSpp="417", bysex=TRUE, stype=c(1,2,6:8), xlim=NULL, yspan=2, yrel=TRUE, nmin=1, ...
/PBStools/man/plotAdens.Rd
no_license
pbs-software/pbs-tools
R
false
false
3,215
rd
\name{plotAdens} \alias{plotAdens} \title{ Plot Age Density Curves } \description{ Plot density of field (e.g. length) by age as waveforms (density curves) or bars. } \usage{ plotAdens(dat, xfld="len", yfld="age", type="dens", sd=3, strSpp="417", bysex=TRUE, stype=c(1,2,6:8), xlim=NULL, yspan=2, yrel=TRUE, nmin=1, ...
newton <- function(f, tol = 1e-7, x0 = 1, N = 100){ h <- 1e-7 i <- 1; x1 = x0 p <- numeric(N) while (i <= N) { df.dx <- (f(x0 + h) - f(x0)) / h x1 <- (x0 - (f(x0) / df.dx)) p[i] <- x1 i <- i + 1 if (abs(x1 - x0) < tol) break x0 <- x1 } return(p[1 : (i-1)]) }
/newton.r
no_license
basaksilasanli/NumericalAnalysisUsingR
R
false
false
297
r
newton <- function(f, tol = 1e-7, x0 = 1, N = 100){ h <- 1e-7 i <- 1; x1 = x0 p <- numeric(N) while (i <= N) { df.dx <- (f(x0 + h) - f(x0)) / h x1 <- (x0 - (f(x0) / df.dx)) p[i] <- x1 i <- i + 1 if (abs(x1 - x0) < tol) break x0 <- x1 } return(p[1 : (i-1)]) }
#' Spectral Angle Mapper #' #' Calculates the angle in spectral space between pixels and a set of reference spectra (endmembers) for image classification based on spectral similarity. #' #' @param img RasterBrick or RasterStack. Remote sensing imagery (usually hyperspectral) #' @param em Matrix or data.frame with end...
/RStoolbox/R/sam.R
no_license
akhikolla/InformationHouse
R
false
false
3,129
r
#' Spectral Angle Mapper #' #' Calculates the angle in spectral space between pixels and a set of reference spectra (endmembers) for image classification based on spectral similarity. #' #' @param img RasterBrick or RasterStack. Remote sensing imagery (usually hyperspectral) #' @param em Matrix or data.frame with end...
#' search column names based on regex #' #' @description search column names based on a regex, possibly exclude some elements based on another regex, and include some other elements (not regex but identical). For selection of columns for use in various situations #' #' @param DT a character vector. if a data.frame, use...
/R/colc.R
no_license
emilBeBri/dttools
R
false
false
2,625
r
#' search column names based on regex #' #' @description search column names based on a regex, possibly exclude some elements based on another regex, and include some other elements (not regex but identical). For selection of columns for use in various situations #' #' @param DT a character vector. if a data.frame, use...
#################################################################### #' ARIMA Forecast #' #' This function automates the ARIMA iterations and modeling for #' time forecasting. For the moment, units can only be days. #' #' The ARIMA method is appropriate only for a time series that is #' stationary (i.e., its mean, vari...
/R/forecasting.R
no_license
romainfrancois/lares
R
false
false
13,868
r
#################################################################### #' ARIMA Forecast #' #' This function automates the ARIMA iterations and modeling for #' time forecasting. For the moment, units can only be days. #' #' The ARIMA method is appropriate only for a time series that is #' stationary (i.e., its mean, vari...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/semmsFuncs.R \docType{data} \name{NKI70} \alias{NKI70} \title{NKI70 data} \format{ The NKI70 data has 144 observations and 72 predictors. } \description{ The NKI70 data is available from the “penalized” package in R (Goeman, 2010) } \examples...
/man/NKI70.Rd
no_license
haimbar/SEMMS
R
false
true
842
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/semmsFuncs.R \docType{data} \name{NKI70} \alias{NKI70} \title{NKI70 data} \format{ The NKI70 data has 144 observations and 72 predictors. } \description{ The NKI70 data is available from the “penalized” package in R (Goeman, 2010) } \examples...
library(tm) library(twitteR) library(proxy) library(wordcloud) library(fpc) library(topicmodels) library(png) #clusteringFun(30,0.99,0.9,FALSE,FALSE,0) clusteringFun <- function(numCluster,sparsity,factor,flag,flag_topic,numTopic){ # change this file location to suit your machine file_loc <- "trdata.csv" # chan...
/clusterFun.R
no_license
yinghaoh/TestDir1
R
false
false
6,832
r
library(tm) library(twitteR) library(proxy) library(wordcloud) library(fpc) library(topicmodels) library(png) #clusteringFun(30,0.99,0.9,FALSE,FALSE,0) clusteringFun <- function(numCluster,sparsity,factor,flag,flag_topic,numTopic){ # change this file location to suit your machine file_loc <- "trdata.csv" # chan...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/asca_results.R \name{asca_results} \alias{asca_results} \alias{print.asca} \alias{summary.asca} \alias{projections} \alias{projections.asca} \alias{print.summary.asca} \alias{loadings.asca} \alias{scores.asca} \title{ASCA Result Methods} \usa...
/man/asca_results.Rd
no_license
minghao2016/multiblock
R
false
true
2,692
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/asca_results.R \name{asca_results} \alias{asca_results} \alias{print.asca} \alias{summary.asca} \alias{projections} \alias{projections.asca} \alias{print.summary.asca} \alias{loadings.asca} \alias{scores.asca} \title{ASCA Result Methods} \usa...
source("packages.R") # source("usefulFunctions.R") options(digits = 20) day11 <- read_table2("day11.txt", col_names = FALSE) rawData<-day11$X1 rawData %>% sapply(function(x) str_replace_all(string = x, pattern = "#", replacement = "B")) %>% unname() -> rawData mazeInfo<-buildMaze(rawData) directions<-list(c(1,0),...
/Day11.R
no_license
Evargalo/AdventOfCode2020
R
false
false
3,222
r
source("packages.R") # source("usefulFunctions.R") options(digits = 20) day11 <- read_table2("day11.txt", col_names = FALSE) rawData<-day11$X1 rawData %>% sapply(function(x) str_replace_all(string = x, pattern = "#", replacement = "B")) %>% unname() -> rawData mazeInfo<-buildMaze(rawData) directions<-list(c(1,0),...
#' read_transducer #' #' @param x #' @param ... #' #' @return #' @export #' #' @examples read_transducer <- function(x, n_cores = 1, ...) { # check for valid input .check_files(x) cl <- parallel::makePSOCKcluster(n_cores) on.exit(parallel::stopCluster(cl)) dat <- rbindlist(parallel::parLapply(cl, x, switc...
/R/read_transducer.R
no_license
jkennel/transducer
R
false
false
921
r
#' read_transducer #' #' @param x #' @param ... #' #' @return #' @export #' #' @examples read_transducer <- function(x, n_cores = 1, ...) { # check for valid input .check_files(x) cl <- parallel::makePSOCKcluster(n_cores) on.exit(parallel::stopCluster(cl)) dat <- rbindlist(parallel::parLapply(cl, x, switc...
library(shiny) library(dplyr) library(stringr) library(leaflet) x1 <- stops %>% filter(str_detect(stop_name, 'Vargas C/B')) %>% inner_join(stop_times, 'stop_id') %>% select(stop_name, stop_id, trip_id, stop_lon, stop_lat) %>% inner_join(trips, 'trip_id') x2 <- stops %>% filter(stop_id %in% c(340015459, 3400...
/inst/shiny/trabalho/server.R
no_license
jtrecenti/sptrans
R
false
false
1,174
r
library(shiny) library(dplyr) library(stringr) library(leaflet) x1 <- stops %>% filter(str_detect(stop_name, 'Vargas C/B')) %>% inner_join(stop_times, 'stop_id') %>% select(stop_name, stop_id, trip_id, stop_lon, stop_lat) %>% inner_join(trips, 'trip_id') x2 <- stops %>% filter(stop_id %in% c(340015459, 3400...
setwd("C:/Users/Hayden/Documents/GitHub/bootcamp-2016-example") rm(list=ls()) #assuming that height normal distribution mean 69, sd of 10 #1 #need a function called get_heights #that will use rnorm to get a sample of heihgts #storing it in variable "Heights" #make it so that can be used for both 100 and 1000 get_hei...
/R-Plotting-Exercise1.R
no_license
hspeck/bootcamp-2016-example
R
false
false
2,739
r
setwd("C:/Users/Hayden/Documents/GitHub/bootcamp-2016-example") rm(list=ls()) #assuming that height normal distribution mean 69, sd of 10 #1 #need a function called get_heights #that will use rnorm to get a sample of heihgts #storing it in variable "Heights" #make it so that can be used for both 100 and 1000 get_hei...
#!/usr/bin/Rscript ################WORKING DIRECTORY MAGIC########## ##################DO NOT ALTER################### initial.options <- commandArgs(trailingOnly = FALSE) file.arg.name <- "--file=" script.name <- sub(file.arg.name, "", initial.options[grep(file.arg.name, initial.options)]) script.basename <- dirname...
/prediction_analysis/MSE_vs_t_smoothed.R
no_license
algo74/predictsim
R
false
false
4,425
r
#!/usr/bin/Rscript ################WORKING DIRECTORY MAGIC########## ##################DO NOT ALTER################### initial.options <- commandArgs(trailingOnly = FALSE) file.arg.name <- "--file=" script.name <- sub(file.arg.name, "", initial.options[grep(file.arg.name, initial.options)]) script.basename <- dirname...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/signal.R \name{signal_experimental} \alias{signal_experimental} \alias{signal_superseded} \title{Deprecated funtions for signalling experimental and lifecycle stages} \usage{ signal_experimental(when, what, env = caller_env()) signal_superse...
/man/signal_experimental.Rd
permissive
isabella232/lifecycle
R
false
true
638
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/signal.R \name{signal_experimental} \alias{signal_experimental} \alias{signal_superseded} \title{Deprecated funtions for signalling experimental and lifecycle stages} \usage{ signal_experimental(when, what, env = caller_env()) signal_superse...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/configservice_operations.R \name{configservice_describe_configuration_aggregators} \alias{configservice_describe_configuration_aggregators} \title{Returns the details of one or more configuration aggregators} \usage{ configservice_describe_co...
/cran/paws.management/man/configservice_describe_configuration_aggregators.Rd
permissive
johnnytommy/paws
R
false
true
1,221
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/configservice_operations.R \name{configservice_describe_configuration_aggregators} \alias{configservice_describe_configuration_aggregators} \title{Returns the details of one or more configuration aggregators} \usage{ configservice_describe_co...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ec2_operations.R \name{ec2_attach_volume} \alias{ec2_attach_volume} \title{Attaches an EBS volume to a running or stopped instance and exposes it to the instance with the specified device name} \usage{ ec2_attach_volume(Device, InstanceId, Vo...
/paws/man/ec2_attach_volume.Rd
permissive
johnnytommy/paws
R
false
true
2,591
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ec2_operations.R \name{ec2_attach_volume} \alias{ec2_attach_volume} \title{Attaches an EBS volume to a running or stopped instance and exposes it to the instance with the specified device name} \usage{ ec2_attach_volume(Device, InstanceId, Vo...
context("Filter") df <- expand.grid(a = 1:10, b = letters[1:10], KEEP.OUT.ATTRS = FALSE, stringsAsFactors = FALSE) tbls <- test_load(df) test_that("filter results independent of data tbl (simple)", { skip_if_no_sqlite() expected <- df[df$a > 6, , drop = FALSE] compare_tbls(tbls[c("df","sqlite")], function...
/tests/testthat/test-filter.r
no_license
ravinpoudel/dplyr
R
false
false
9,728
r
context("Filter") df <- expand.grid(a = 1:10, b = letters[1:10], KEEP.OUT.ATTRS = FALSE, stringsAsFactors = FALSE) tbls <- test_load(df) test_that("filter results independent of data tbl (simple)", { skip_if_no_sqlite() expected <- df[df$a > 6, , drop = FALSE] compare_tbls(tbls[c("df","sqlite")], function...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/caching.R \name{rhdx_cache_delete} \alias{rhdx_cache_delete} \title{Delete file from cache} \usage{ rhdx_cache_delete(file) } \arguments{ \item{file}{Character, the file to delete} } \description{ Delete file from cache }
/man/rhdx_cache_delete.Rd
permissive
bmpacifique/rhdx
R
false
true
300
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/caching.R \name{rhdx_cache_delete} \alias{rhdx_cache_delete} \title{Delete file from cache} \usage{ rhdx_cache_delete(file) } \arguments{ \item{file}{Character, the file to delete} } \description{ Delete file from cache }
## Purpose: control parameters for modelsum function ## Authors: P Votruba, Jason Sinnwell, Beth Atkinson ## Created: 9/3/2015 #' Control settings for \code{modelsum} function #' #' Control test and summary settings for \code{\link{modelsum}} function. #' #' @param digits Numeric, denoting the number of digits after t...
/R/modelsum.control.R
no_license
bzkrouse/arsenal
R
false
false
10,734
r
## Purpose: control parameters for modelsum function ## Authors: P Votruba, Jason Sinnwell, Beth Atkinson ## Created: 9/3/2015 #' Control settings for \code{modelsum} function #' #' Control test and summary settings for \code{\link{modelsum}} function. #' #' @param digits Numeric, denoting the number of digits after t...
# challenge C ########################### rm(list = ls()) graphics.off() challenge_C =function() { # define vector to store abundance sum_size1 = array(0,4000) sum_size2 = array(0,8000) sum_size3 = array(0,20000) sum_size4 = array(0,40000) #read results throughly for (i in 1:100) { load(paste("../Data/result_rda/HP...
/Week9/HPC_exercises/Code/chanllegeC.R
no_license
tisssu/CMEECourseWork
R
false
false
1,786
r
# challenge C ########################### rm(list = ls()) graphics.off() challenge_C =function() { # define vector to store abundance sum_size1 = array(0,4000) sum_size2 = array(0,8000) sum_size3 = array(0,20000) sum_size4 = array(0,40000) #read results throughly for (i in 1:100) { load(paste("../Data/result_rda/HP...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/io.R \docType{data} \name{data_err} \alias{data_err} \title{Test} \description{ Test } \keyword{data}
/rjacks/jacks/man/data_err.Rd
permissive
goedel-gang/JACKS
R
false
true
180
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/io.R \docType{data} \name{data_err} \alias{data_err} \title{Test} \description{ Test } \keyword{data}
#require(rCharts) #options(RCHART_WIDTH=800) shinyServer( function(input,output){ output$text1 <- renderText({input$text1}) output$text2 <- renderText({input$text2}) output$text3 <- renderText({ if (input$goButton ==0) "You have not pressed the...
/server.R
no_license
bouloude/julien-shiny-test
R
false
false
739
r
#require(rCharts) #options(RCHART_WIDTH=800) shinyServer( function(input,output){ output$text1 <- renderText({input$text1}) output$text2 <- renderText({input$text2}) output$text3 <- renderText({ if (input$goButton ==0) "You have not pressed the...
# Author: Sifan Liu # Date: Thu Dec 27 10:46:17 2018 # -------------- pkgs <- c('tidyverse','officer') check <- sapply(pkgs,require,warn.conflicts = TRUE,character.only = TRUE) if(any(!check)){ pkgs.missing <- pkgs[!check] install.packages(pkgs.missing) check <- sapply(pkgs.missing,require,warn.conflicts = TRUE...
/deck_output.R
no_license
fansi-sifan/County-Cluster
R
false
false
3,378
r
# Author: Sifan Liu # Date: Thu Dec 27 10:46:17 2018 # -------------- pkgs <- c('tidyverse','officer') check <- sapply(pkgs,require,warn.conflicts = TRUE,character.only = TRUE) if(any(!check)){ pkgs.missing <- pkgs[!check] install.packages(pkgs.missing) check <- sapply(pkgs.missing,require,warn.conflicts = TRUE...
#Setting locale to English because my default locale isn't english Sys.setlocale("LC_ALL","English") #Loading raw data filePath <- "./Data/RawData/household_power_consumption.txt" expDataSet <- read.csv(filePath, header = TRUE, sep = ";", as.is = TRUE) #Converting data (Date) to necessary format for filtering rows...
/Plot2.R
no_license
aktru/ExData_Plotting1
R
false
false
1,349
r
#Setting locale to English because my default locale isn't english Sys.setlocale("LC_ALL","English") #Loading raw data filePath <- "./Data/RawData/household_power_consumption.txt" expDataSet <- read.csv(filePath, header = TRUE, sep = ";", as.is = TRUE) #Converting data (Date) to necessary format for filtering rows...
print_header <- function(round) { cat("#################\n\n") cat("#### Round", round, "####\n\n") cat("#################\n\n") } print_board <- function() { # Prints the current state of the board cat("Current board:\n") cat("~~~~~~~~~~~~~~\n\n") cat(" ") for (i in c(1, 2, 3)) { cat(i, " ") ...
/print_functions.R
no_license
ballaneypranav/brn_r_programming
R
false
false
486
r
print_header <- function(round) { cat("#################\n\n") cat("#### Round", round, "####\n\n") cat("#################\n\n") } print_board <- function() { # Prints the current state of the board cat("Current board:\n") cat("~~~~~~~~~~~~~~\n\n") cat(" ") for (i in c(1, 2, 3)) { cat(i, " ") ...
get_fp_proj = function(tolx=NULL,sstable,params,target=NULL) { # Project the data and create a transformed sstable and target if(!is.null(tolx))target = as.numeric(target) nss = dim(sstable)[2] niter = dim(sstable)[1] if(!is.null(tolx)){ scaling = numeric(nss) for(j in 1:nss){ v1 = sstable[,j] v1 = abs...
/fp_proj.R
no_license
johowardmcc/wildcat_abc
R
false
false
2,163
r
get_fp_proj = function(tolx=NULL,sstable,params,target=NULL) { # Project the data and create a transformed sstable and target if(!is.null(tolx))target = as.numeric(target) nss = dim(sstable)[2] niter = dim(sstable)[1] if(!is.null(tolx)){ scaling = numeric(nss) for(j in 1:nss){ v1 = sstable[,j] v1 = abs...
# 1. Read data into R xtest <- read.table("test/X_test.txt") ytest <- read.table("test/Y_test.txt") xtrain <- read.table("train/X_train.txt") ytrain <- read.table("train/Y_train.txt") subject_test <- read.table("test/subject_test.txt") subject_train <- read.table("train/subject_train.txt") # 2. Merge data data <- rbind...
/run_analysis.R
no_license
Micky-angela/datasciencecoursera
R
false
false
1,286
r
# 1. Read data into R xtest <- read.table("test/X_test.txt") ytest <- read.table("test/Y_test.txt") xtrain <- read.table("train/X_train.txt") ytrain <- read.table("train/Y_train.txt") subject_test <- read.table("test/subject_test.txt") subject_train <- read.table("train/subject_train.txt") # 2. Merge data data <- rbind...
tabItem( tabName = "drug", align = "center", fluidRow(style = "width:80%;", shiny::uiOutput(outputId = "ui_drug_welcome")), fluidRow(style = "width:80%", shiny::uiOutput(outputId = "ui_drug_help")), fluidRow(style = "width:80%", shiny::tags$hr(style = "width:80%")), fluidRow(style = "width:80%",...
/ui/drug_ui.R
permissive
COMODr/GSCALite
R
false
false
480
r
tabItem( tabName = "drug", align = "center", fluidRow(style = "width:80%;", shiny::uiOutput(outputId = "ui_drug_welcome")), fluidRow(style = "width:80%", shiny::uiOutput(outputId = "ui_drug_help")), fluidRow(style = "width:80%", shiny::tags$hr(style = "width:80%")), fluidRow(style = "width:80%",...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hierarchie.R \name{hier_departement_academie} \alias{hier_departement_academie} \title{Renvoie les codes academie a partir des codes de departement} \usage{ hier_departement_academie(code_departement) } \arguments{ \item{code_departement}{Un ...
/man/hier_departement_academie.Rd
permissive
ove-ut3/apogee
R
false
true
705
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hierarchie.R \name{hier_departement_academie} \alias{hier_departement_academie} \title{Renvoie les codes academie a partir des codes de departement} \usage{ hier_departement_academie(code_departement) } \arguments{ \item{code_departement}{Un ...
#' Fit a ridge regression model #' #' @description This function fits the ridge regression model. #' @param form a formula #' @import stats #' @param lambda a number #' @param d a data.frame #' @return An list of rigde regression information #' @examples #' ridge_fit <- ridge_reg(Sepal.Length ~. , lambda = 1.2, iris) #...
/R/ridge-regression.R
no_license
daiw3/bis557
R
false
false
834
r
#' Fit a ridge regression model #' #' @description This function fits the ridge regression model. #' @param form a formula #' @import stats #' @param lambda a number #' @param d a data.frame #' @return An list of rigde regression information #' @examples #' ridge_fit <- ridge_reg(Sepal.Length ~. , lambda = 1.2, iris) #...
#' Reading the NOAA earthquake data file #' #' @param The filename of the NOAA earthquake data file #' @return tbl_df object (earthquake data) #' @note Stop if the filename does not exist (error message) #' @import dplyr #' @import tibble #' @importFrom readr read_delim #' @examples #' \dontrun{ #' filename<-system.fil...
/R/1capstoneproject2.R
no_license
jianweilu/mycapstone
R
false
false
14,601
r
#' Reading the NOAA earthquake data file #' #' @param The filename of the NOAA earthquake data file #' @return tbl_df object (earthquake data) #' @note Stop if the filename does not exist (error message) #' @import dplyr #' @import tibble #' @importFrom readr read_delim #' @examples #' \dontrun{ #' filename<-system.fil...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/summary.R \name{summary.landscape_list} \alias{summary.landscape_list} \title{Summary method for landscape lists.} \usage{ \method{summary}{landscape_list}(L, parms = livestock$parms) } \arguments{ \item{L}{A list of landscape objects (may be...
/man/summary.landscape_list.Rd
permissive
skefi/socialecological
R
false
true
699
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/summary.R \name{summary.landscape_list} \alias{summary.landscape_list} \title{Summary method for landscape lists.} \usage{ \method{summary}{landscape_list}(L, parms = livestock$parms) } \arguments{ \item{L}{A list of landscape objects (may be...
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function makeCacheMatrix <- function(x = matrix()) { m<-NULL set<-function(y){ x <<- y m <<- NULL }...
/cachematrix.R
no_license
sreenila/ProgrammingAssignment2
R
false
false
837
r
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function makeCacheMatrix <- function(x = matrix()) { m<-NULL set<-function(y){ x <<- y m <<- NULL }...
# R Script # Author: Adam W Hansen # Date Created: Jan 26, 2018 # Date Last Modified: Aug 17, 2018 library(getPass) library(RJDBC) #USERNAME = readline(prompt = "Username: ") USERNAME = getPass(msg = "Username: ") USERNAME PASSWORD = getPass(msg = "Password: ") query = "select count(distinct(sname)) as n_sa...
/2018/aug/lof/pli/filter/aug_17_pli1_filter_bgl.R
no_license
BCM-HGSC/HARLEE_analysis
R
false
false
4,053
r
# R Script # Author: Adam W Hansen # Date Created: Jan 26, 2018 # Date Last Modified: Aug 17, 2018 library(getPass) library(RJDBC) #USERNAME = readline(prompt = "Username: ") USERNAME = getPass(msg = "Username: ") USERNAME PASSWORD = getPass(msg = "Password: ") query = "select count(distinct(sname)) as n_sa...
### CMC: new version with hierarchical IW nextDhIW = function(a, b, env, lambda) { S = (b - t(matrix(a,nrow=env$gNIV,ncol=env$gNP))) Vnew = t(S)%*%S + 2*env$degreesOfFreedom*lambda Sigmanew = riwish(env$degreesOfFreedom+env$gNP+env$gNIV-1,Vnew) return(Sigmanew) }
/R/nextDhIW.R
no_license
cran/RSGHB
R
false
false
295
r
### CMC: new version with hierarchical IW nextDhIW = function(a, b, env, lambda) { S = (b - t(matrix(a,nrow=env$gNIV,ncol=env$gNP))) Vnew = t(S)%*%S + 2*env$degreesOfFreedom*lambda Sigmanew = riwish(env$degreesOfFreedom+env$gNP+env$gNIV-1,Vnew) return(Sigmanew) }
context("test-check-all.R") library("tibble") syn <- attempt_instantiate() tryCatch( attempt_login(syn), error = function(e) { print(glue::glue("Did not log into Synapse: {e$message}")) } ) annots <- tribble( ~key, ~value, ~columnType, "assay", "rnaSeq", "STRING", "fileFormat", "fastq", "STRING", "fi...
/tests/testthat/test-check-all.R
permissive
Sage-Bionetworks/dccvalidator
R
false
false
13,526
r
context("test-check-all.R") library("tibble") syn <- attempt_instantiate() tryCatch( attempt_login(syn), error = function(e) { print(glue::glue("Did not log into Synapse: {e$message}")) } ) annots <- tribble( ~key, ~value, ~columnType, "assay", "rnaSeq", "STRING", "fileFormat", "fastq", "STRING", "fi...
# Pacotes utilizados library(cepespR) library(tidyverse) library(abjutils) # Objetivos #' - Agregar os dados em funcao do numero de habitantes e de eleitores aptos; #' - Sao 7 faixas de agregacao em funcao do numero eleitores aptos: #' #' 1. Até 5 mil eleitores; #' ...
/scripts/06_agregmunicipio.R
no_license
rebecacarvalho/cepespIndicadores
R
false
false
13,431
r
# Pacotes utilizados library(cepespR) library(tidyverse) library(abjutils) # Objetivos #' - Agregar os dados em funcao do numero de habitantes e de eleitores aptos; #' - Sao 7 faixas de agregacao em funcao do numero eleitores aptos: #' #' 1. Até 5 mil eleitores; #' ...
\name{create.commit} \alias{create.commit} \title{create a commit} \usage{ create.commit(owner, repo, content, ctx = get.github.context()) } \arguments{ \item{owner}{the repo owner} \item{repo}{the name of the repo} \item{content}{the JSON object describing the content. See} \item{ctx}{the github con...
/man/create.commit.Rd
permissive
prateek05/rgithub
R
false
false
393
rd
\name{create.commit} \alias{create.commit} \title{create a commit} \usage{ create.commit(owner, repo, content, ctx = get.github.context()) } \arguments{ \item{owner}{the repo owner} \item{repo}{the name of the repo} \item{content}{the JSON object describing the content. See} \item{ctx}{the github con...
#' @export #' @importFrom zip zip #' @title compress a folder #' @description compress a folder to a target file. The #' function returns the complete path to target file. #' @param folder folder to compress #' @param target path of the archive to create pack_folder <- function( folder, target ){ target <- absolute_...
/R/pack_folder.R
no_license
AshesITR/officer
R
false
false
2,885
r
#' @export #' @importFrom zip zip #' @title compress a folder #' @description compress a folder to a target file. The #' function returns the complete path to target file. #' @param folder folder to compress #' @param target path of the archive to create pack_folder <- function( folder, target ){ target <- absolute_...
ui <- dashboardPage(skin = "red", dashboardHeader(title = "ICHEM"), dashboardSidebar( sidebarMenu( br(), br(), br(), # menuItem("MAX & MI...
/myapp/ui.R
no_license
David-Munoz-B/Shiny_1
R
false
false
1,675
r
ui <- dashboardPage(skin = "red", dashboardHeader(title = "ICHEM"), dashboardSidebar( sidebarMenu( br(), br(), br(), # menuItem("MAX & MI...