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
#' simData #' #' Simulation of complex scRNA-seq data #' #' \code{simData} simulates multiple clusters and samples #' across 2 experimental conditions from a real scRNA-seq data set. #' #' @param x a \code{\link[SingleCellExperiment]{SingleCellExperiment}}. #' @param n_genes # of genes to simulate. #' @param n_ce...
/R/simData.R
no_license
jan-glx/muscat
R
false
false
8,575
r
#' simData #' #' Simulation of complex scRNA-seq data #' #' \code{simData} simulates multiple clusters and samples #' across 2 experimental conditions from a real scRNA-seq data set. #' #' @param x a \code{\link[SingleCellExperiment]{SingleCellExperiment}}. #' @param n_genes # of genes to simulate. #' @param n_ce...
/Estatística I/Scripts/Estatistica I - R/1 - Amostragem.R
no_license
rodrigomaria/formacao_cientista_de_dados_com_R_e_Python
R
false
false
1,965
r
#clear all rm(list=ls(all=T)) #First calculate your Pwet term based on actual water loss measurements (either whole body, or head/body compartments) ############################################################# ###Enter your experimental data: if unavailable, enter NA Et.reported<-0.0074 #ml/hr, Total water loss rate...
/example_water_budget_inornata.R
no_license
mrke/global_water_budget
R
false
false
22,490
r
#clear all rm(list=ls(all=T)) #First calculate your Pwet term based on actual water loss measurements (either whole body, or head/body compartments) ############################################################# ###Enter your experimental data: if unavailable, enter NA Et.reported<-0.0074 #ml/hr, Total water loss rate...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bayes.R \name{init_naive_classifer} \alias{init_naive_classifer} \alias{init_naive_classifer.factor} \title{Naive Bayes Classifier} \usage{ init_naive_classifer(labels) \method{init_naive_classifer}{factor}(labels) } \arguments{ \item{labels...
/man/init_naive_classifer.Rd
permissive
news-r/textanalysis
R
false
true
534
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bayes.R \name{init_naive_classifer} \alias{init_naive_classifer} \alias{init_naive_classifer.factor} \title{Naive Bayes Classifier} \usage{ init_naive_classifer(labels) \method{init_naive_classifer}{factor}(labels) } \arguments{ \item{labels...
> epoch <- 0 > class(epoch) <- class(Sys.time()) > format(epoch, "%Y-%m-%d %H:%M:%S %Z") [1] "1970-01-01 00:00:00 UTC"
/Programming Language Detection/Experiment-2/Dataset/Train/R/show-the-epoch.r
no_license
dlaststark/machine-learning-projects
R
false
false
119
r
> epoch <- 0 > class(epoch) <- class(Sys.time()) > format(epoch, "%Y-%m-%d %H:%M:%S %Z") [1] "1970-01-01 00:00:00 UTC"
household <- read.table("household_power_consumption.txt", sep=";", header=TRUE, stringsAsFactors=FALSE) subset1 <- household[household$Date %in% c("1/2/2007", "2/2/2007"),] png(file="plot1.png") hist(as.numeric(subset1$Global_active_power), main="Global Active Power", xlab="Global Active Power (kilowatts)", col="r...
/plot1.R
no_license
M4ry4nn/ExData_Plotting1
R
false
false
337
r
household <- read.table("household_power_consumption.txt", sep=";", header=TRUE, stringsAsFactors=FALSE) subset1 <- household[household$Date %in% c("1/2/2007", "2/2/2007"),] png(file="plot1.png") hist(as.numeric(subset1$Global_active_power), main="Global Active Power", xlab="Global Active Power (kilowatts)", col="r...
source("eudicottree.R") # tree file library("expm") # exponential of the matrix library("nloptr") source("Pruning2.R") # pruning bichrom.dataset<-read.table( "eudicotvals.txt",header=FALSE,sep=",",stringsAsFactors=FALSE) #read dataset last.state=50 # how big is our state p.0<-rep(1,2*(last.state+1))/(2*(last.state+1))...
/Bivariate profile rhoqH/plikerhoqh8.R
no_license
roszenil/Bichromdryad
R
false
false
3,935
r
source("eudicottree.R") # tree file library("expm") # exponential of the matrix library("nloptr") source("Pruning2.R") # pruning bichrom.dataset<-read.table( "eudicotvals.txt",header=FALSE,sep=",",stringsAsFactors=FALSE) #read dataset last.state=50 # how big is our state p.0<-rep(1,2*(last.state+1))/(2*(last.state+1))...
#' Runs hydra model #' #' Function to run the hydra model for a single time step (dt). #' #' 2018-07-06 First version to do simple I/O #' #' @param dem A matrix with elevation values in each cell (m) #' @examples #' wca2d_1t(dem, ppt, wse, 1, 60, 0) dyn.load("./src/rhydra.so") dem_check <- function(dem) { simcf = .F...
/rhydra.R
no_license
simonbrewer/rhydra
R
false
false
463
r
#' Runs hydra model #' #' Function to run the hydra model for a single time step (dt). #' #' 2018-07-06 First version to do simple I/O #' #' @param dem A matrix with elevation values in each cell (m) #' @examples #' wca2d_1t(dem, ppt, wse, 1, 60, 0) dyn.load("./src/rhydra.so") dem_check <- function(dem) { simcf = .F...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hello.R \docType{data} \name{protpepmetashort} \alias{protpepmetashort} \title{Small version of pepprot dataset to speed up computation} \description{ Small version of pepprot dataset to speed up computation } \keyword{data}
/man/protpepmetashort.Rd
no_license
protViz/prozor
R
false
true
303
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hello.R \docType{data} \name{protpepmetashort} \alias{protpepmetashort} \title{Small version of pepprot dataset to speed up computation} \description{ Small version of pepprot dataset to speed up computation } \keyword{data}
# Packeges install.packages("xts") install.packages("psych") require(xts) require(psych) # Input data july = read.csv("D:/July.csv") nrow(july) nrow(july) names(july) str(july) # Prelims july2 = subset(july, start.station.name=="Pershing Square North" | end.station.name=="Pershing Square North" ...
/main.R
no_license
tmulumba/Stochastic
R
false
false
16,171
r
# Packeges install.packages("xts") install.packages("psych") require(xts) require(psych) # Input data july = read.csv("D:/July.csv") nrow(july) nrow(july) names(july) str(july) # Prelims july2 = subset(july, start.station.name=="Pershing Square North" | end.station.name=="Pershing Square North" ...
hess_oprob <- function(Y,X,coeffs,smooth_coeffs,lambda) { # DESCRIPTION # This function calculates the hessian of the log-likelihood for a ordered probit with (partially) smoothed coefficients. # The hessian has the components: # - fitting part, summed over observations # - fitting part, for threshold...
/Replication Codes/hess_oprob.r
no_license
gvschweinitz/ES_18_The-Joint-Dynamics-of-Sovereign-Ratings-and-Government-Bond-Yields
R
false
false
3,326
r
hess_oprob <- function(Y,X,coeffs,smooth_coeffs,lambda) { # DESCRIPTION # This function calculates the hessian of the log-likelihood for a ordered probit with (partially) smoothed coefficients. # The hessian has the components: # - fitting part, summed over observations # - fitting part, for threshold...
\name{portfolio.turnover} \alias{portfolio.turnover} \title{Calculate Sub-Portfolio Turnover } \description{ Calculates sub-portfolio turnover between each rebalancing period. } \usage{ portfolio.turnover(sort.output) } \arguments{ \item{sort.output}{ object returned from either the conditional.sort o...
/man/portfolio.turnover.Rd
no_license
cran/portsort
R
false
false
1,603
rd
\name{portfolio.turnover} \alias{portfolio.turnover} \title{Calculate Sub-Portfolio Turnover } \description{ Calculates sub-portfolio turnover between each rebalancing period. } \usage{ portfolio.turnover(sort.output) } \arguments{ \item{sort.output}{ object returned from either the conditional.sort o...
##' Estimate leave-one-variable-out regressions ##' ##' This is a convenience for analysis of multicollinearity in regression. ##' ##' @param model a fitted regression model ##' @return a list of fitted regressions, one for each omitted variable. ##' @author Paul E. Johnson \email{pauljohn@@ku.edu} ##' @export lmAuxili...
/rockchalk/R/mcDiagnose.R
no_license
pauljohn32/rockchalk
R
false
false
8,202
r
##' Estimate leave-one-variable-out regressions ##' ##' This is a convenience for analysis of multicollinearity in regression. ##' ##' @param model a fitted regression model ##' @return a list of fitted regressions, one for each omitted variable. ##' @author Paul E. Johnson \email{pauljohn@@ku.edu} ##' @export lmAuxili...
library(ggplot2) library(ggrepel) library(gridExtra) library(reshape2) library(scales) options("scipen"=999, "digits"=4) data_db <- read.csv("exercicio.csv", header=T) # SALARIO por ANO-------------------------------------------------------- ggplot(data_db, aes(x=SALARIO, y=FILHOS, ...
/analise-final/custom3.R
no_license
taylor3lewis/exercises-of-data-exploration
R
false
false
638
r
library(ggplot2) library(ggrepel) library(gridExtra) library(reshape2) library(scales) options("scipen"=999, "digits"=4) data_db <- read.csv("exercicio.csv", header=T) # SALARIO por ANO-------------------------------------------------------- ggplot(data_db, aes(x=SALARIO, y=FILHOS, ...
## this is the old version of RevActUser ## this is the function to get revenue accounting matrix ## user level ## column required: user_id, MRR, Effective_Start, Effective_End RevActUser <- function(datall_revenue, dates){ dat <- total_revenue %>% # change this filter to get result for different products ...
/Archive/old_version_RevActUser.R
no_license
isabella232/NetlifyDS
R
false
false
4,014
r
## this is the old version of RevActUser ## this is the function to get revenue accounting matrix ## user level ## column required: user_id, MRR, Effective_Start, Effective_End RevActUser <- function(datall_revenue, dates){ dat <- total_revenue %>% # change this filter to get result for different products ...
default_control <- function() { lme4::lmerControl(optimizer = "nloptwrap", optCtrl = list(maxeval = 1e4, xtol_abs = 1e-8, ftol_abs = 1e-8)) } est_sandwich_se <- function(fit, var_labels) { v <- sandwich::vcovHC(fit)[var_labels, var_labels] if (is.matrix(v)) v <- diag(v) sqrt(v) } get_formu...
/R/aux_functions.R
no_license
JacobBergstedt/mmi
R
false
false
4,401
r
default_control <- function() { lme4::lmerControl(optimizer = "nloptwrap", optCtrl = list(maxeval = 1e4, xtol_abs = 1e-8, ftol_abs = 1e-8)) } est_sandwich_se <- function(fit, var_labels) { v <- sandwich::vcovHC(fit)[var_labels, var_labels] if (is.matrix(v)) v <- diag(v) sqrt(v) } get_formu...
library(circlize) ### Name: circos.polygon ### Title: Draw polygon ### Aliases: circos.polygon ### ** Examples set.seed(123) factors = letters[1:4] circos.initialize(factors, xlim = c(0, 1)) circos.trackPlotRegion(ylim = c(-3, 3), track.height = 0.4, panel.fun = function(x, y) { x1 = runif(20) y1 = x1 + rno...
/data/genthat_extracted_code/circlize/examples/circos.polygon.rd.R
no_license
surayaaramli/typeRrh
R
false
false
751
r
library(circlize) ### Name: circos.polygon ### Title: Draw polygon ### Aliases: circos.polygon ### ** Examples set.seed(123) factors = letters[1:4] circos.initialize(factors, xlim = c(0, 1)) circos.trackPlotRegion(ylim = c(-3, 3), track.height = 0.4, panel.fun = function(x, y) { x1 = runif(20) y1 = x1 + rno...
library(testthat) library(mlflow) library(reticulate) if (identical(Sys.getenv("NOT_CRAN"), "true")) { mlflow:::mlflow_maybe_create_conda_env(python_version = "3.6") message("Current working directory: ", getwd()) mlflow_home <- Sys.getenv("MLFLOW_HOME", "../../../../.") message('MLFLOW_HOME: ', mlflow_home) ...
/mlflow/R/mlflow/tests/testthat.R
permissive
shivp950/mlflow
R
false
false
432
r
library(testthat) library(mlflow) library(reticulate) if (identical(Sys.getenv("NOT_CRAN"), "true")) { mlflow:::mlflow_maybe_create_conda_env(python_version = "3.6") message("Current working directory: ", getwd()) mlflow_home <- Sys.getenv("MLFLOW_HOME", "../../../../.") message('MLFLOW_HOME: ', mlflow_home) ...
\name{cuDeviceGetPCIBusId} \alias{cuDeviceGetPCIBusId} \title{Returns a PCI Bus Id string for the device} \description{ Returns an ASCII string identifying the device \code{dev} in the NULL-terminated string pointed to by \code{pciBusId}. \code{len} specifies the maximum length of the string that may be returned.} \u...
/man/cuDeviceGetPCIBusId.Rd
no_license
xfbingshan/RCUDA
R
false
false
652
rd
\name{cuDeviceGetPCIBusId} \alias{cuDeviceGetPCIBusId} \title{Returns a PCI Bus Id string for the device} \description{ Returns an ASCII string identifying the device \code{dev} in the NULL-terminated string pointed to by \code{pciBusId}. \code{len} specifies the maximum length of the string that may be returned.} \u...
library(SARP.moodle) ### Name: ouverte.moodle ### Title: Créer une question à réponse ouverte (rédactionnelle) ### Aliases: ouverte.moodle question_ouverte.moodle ### ** Examples # Commencer un nouveau questionnaire q <- debuter_xml.moodle( "exemple.ouverte" ) # Catégorie : exemples categorie.moodle( "Exemples SAR...
/data/genthat_extracted_code/SARP.moodle/examples/ouverte.moodle.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
662
r
library(SARP.moodle) ### Name: ouverte.moodle ### Title: Créer une question à réponse ouverte (rédactionnelle) ### Aliases: ouverte.moodle question_ouverte.moodle ### ** Examples # Commencer un nouveau questionnaire q <- debuter_xml.moodle( "exemple.ouverte" ) # Catégorie : exemples categorie.moodle( "Exemples SAR...
#!/mnt/home/msettles/opt/bin/Rscript --vanilla ############################################################################### ### ### Primary functions/main for Amplicon Processing ### ############################################################################### ## setup options(width=120) options("stringsAsFactors...
/R/PreProc_MB.R
no_license
Biryabarema/MicrobialAmplicon
R
false
false
13,307
r
#!/mnt/home/msettles/opt/bin/Rscript --vanilla ############################################################################### ### ### Primary functions/main for Amplicon Processing ### ############################################################################### ## setup options(width=120) options("stringsAsFactors...
\name{btergm} \alias{btergm} \alias{mtergm} \alias{tergm} \title{TERGM by bootstrapped pseudolikelihood or MCMC MLE} \description{TERGM by bootstrapped pseudolikelihood or MCMC MLE.} \usage{ btergm(formula, R = 500, offset = FALSE, returndata = FALSE, parallel = c("no", "multicore", "snow"), ncpus = 1, cl = N...
/man/btergm.Rd
no_license
desmarais-lab/btergm
R
false
false
10,912
rd
\name{btergm} \alias{btergm} \alias{mtergm} \alias{tergm} \title{TERGM by bootstrapped pseudolikelihood or MCMC MLE} \description{TERGM by bootstrapped pseudolikelihood or MCMC MLE.} \usage{ btergm(formula, R = 500, offset = FALSE, returndata = FALSE, parallel = c("no", "multicore", "snow"), ncpus = 1, cl = N...
# This R environment comes with all of CRAN preinstalled, as well as many other helpful packages # The environment is defined by the kaggle/rstats docker image: https://github.com/kaggle/docker-rstats # For example, here's several helpful packages to load in library(ggplot2) # Data visualization library(readr) # CSV...
/r/kernels/zhangyan0623-titanic-analysis/script/titanic-analysis.r
no_license
helenaK/trustworthy-titanic
R
false
false
3,410
r
# This R environment comes with all of CRAN preinstalled, as well as many other helpful packages # The environment is defined by the kaggle/rstats docker image: https://github.com/kaggle/docker-rstats # For example, here's several helpful packages to load in library(ggplot2) # Data visualization library(readr) # CSV...
############################################################################## # # The API is formally specified, but in practice, best results come from experimentation # and following the not-always-consistent examples provided in documentation. # # Accordingly here, testing is based on those examples, which are p...
/tests/tests.R
no_license
braithwaite/MGRASTer
R
false
false
10,009
r
############################################################################## # # The API is formally specified, but in practice, best results come from experimentation # and following the not-always-consistent examples provided in documentation. # # Accordingly here, testing is based on those examples, which are p...
source('setup.R') library(dplyr) if (!exists('NEI')) { NEI <- readRDS("summarySCC_PM25.rds") SCC <- readRDS("Source_Classification_Code.rds") } # When deciding how to filter for fuel combustion, I used a helpful link # provided by the discussion forums: # http://www.epa.gov/ttn/chief/net/2011nei/2011_nei_ts...
/plot4.R
no_license
reckbo/Coursera-ExploratoryDataAnalysis-project2
R
false
false
856
r
source('setup.R') library(dplyr) if (!exists('NEI')) { NEI <- readRDS("summarySCC_PM25.rds") SCC <- readRDS("Source_Classification_Code.rds") } # When deciding how to filter for fuel combustion, I used a helpful link # provided by the discussion forums: # http://www.epa.gov/ttn/chief/net/2011nei/2011_nei_ts...
# Modified the plot5to use a logarithmic scale on the y-axis plt_not_china_trend_lin + scale_y_log10()
/plot5logscale.R
no_license
patelvishwa1999/DataScience
R
false
false
105
r
# Modified the plot5to use a logarithmic scale on the y-axis plt_not_china_trend_lin + scale_y_log10()
#'PDF for the multivariate hypergeometric distribution #'@param k adf #'@param K adf #'@export #' dMVhyper=function(k,K){ n=sum(k) N=sum(K) p=prod(choose(K,k))/choose(N,n) return(p) } #'Random generator for the multivariate hypergeometric distribution #'@param K adf #'@param n ads #'@export #' rMVhyper=functio...
/R/MVHyper.R
no_license
benaug/Mbmisscap
R
false
false
527
r
#'PDF for the multivariate hypergeometric distribution #'@param k adf #'@param K adf #'@export #' dMVhyper=function(k,K){ n=sum(k) N=sum(K) p=prod(choose(K,k))/choose(N,n) return(p) } #'Random generator for the multivariate hypergeometric distribution #'@param K adf #'@param n ads #'@export #' rMVhyper=functio...
#' minepyRcpp #' #' a thin wrapper around minepy. #' use minerva instead #' @name minepyRcpp-package #' @useDynLib minepyRcpp #' @docType package #' @import Rcpp NULL
/R/minepyRcpp-package.R
no_license
nfultz/minepyRcpp
R
false
false
167
r
#' minepyRcpp #' #' a thin wrapper around minepy. #' use minerva instead #' @name minepyRcpp-package #' @useDynLib minepyRcpp #' @docType package #' @import Rcpp NULL
makeCacheMatrix <- function(x = numeric()) { inv <- NULL # intiate the inverse to NULL since we don't know it # allow the user to set the matrix value set <- function(y) { x <<- y inv <<- NULL # we change the value, so erase the old linverse } # impliment simple assignment functions...
/makeCacheMatrix.R
no_license
hpsiepsi/rprog-008
R
false
false
555
r
makeCacheMatrix <- function(x = numeric()) { inv <- NULL # intiate the inverse to NULL since we don't know it # allow the user to set the matrix value set <- function(y) { x <<- y inv <<- NULL # we change the value, so erase the old linverse } # impliment simple assignment functions...
### R code from vignette source 'using-lsmeans.rnw' ################################################### ### code chunk number 1: using-lsmeans.rnw:49-51 ################################################### options(show.signif.stars=FALSE, prompt="R> ", continue=" ", useFancyQuotes=FALSE, width=100, digits=...
/inst/doc/using-lsmeans.R
no_license
derrickkaufman/lsmeans
R
false
false
19,487
r
### R code from vignette source 'using-lsmeans.rnw' ################################################### ### code chunk number 1: using-lsmeans.rnw:49-51 ################################################### options(show.signif.stars=FALSE, prompt="R> ", continue=" ", useFancyQuotes=FALSE, width=100, digits=...
library(testthat) library(two.laws.xml) test_check("two.laws.xml")
/tests/testthat.R
no_license
mikebesso/two.laws.xml
R
false
false
68
r
library(testthat) library(two.laws.xml) test_check("two.laws.xml")
################################################################################################ #'@title Data-Driven Binscatter Quantile Regression with Robust Inference Procedures and Plots #'@description \code{binsqreg} implements binscatter quantile regression with robust inference procedures and plots, following ...
/R/binsreg/R/binsqreg.R
no_license
JH9425/binsreg
R
false
false
57,757
r
################################################################################################ #'@title Data-Driven Binscatter Quantile Regression with Robust Inference Procedures and Plots #'@description \code{binsqreg} implements binscatter quantile regression with robust inference procedures and plots, following ...
% Generated by roxygen2 (4.0.2): do not edit by hand \name{plot_median_effect} \alias{plot_median_effect} \title{generate plot for the fit from median-effect model} \usage{ plot_median_effect(medianEffect, type = c("medianEffect", "doseResponseCurve", "contour"), contour.level = (1:9)/10, logd = FALSE, cex.legend = 1...
/man/plot_median_effect.Rd
no_license
hjanime/drexplorer
R
false
false
1,274
rd
% Generated by roxygen2 (4.0.2): do not edit by hand \name{plot_median_effect} \alias{plot_median_effect} \title{generate plot for the fit from median-effect model} \usage{ plot_median_effect(medianEffect, type = c("medianEffect", "doseResponseCurve", "contour"), contour.level = (1:9)/10, logd = FALSE, cex.legend = 1...
getMSE = function(target, forecast){ se = (target - forecast)^2 mse = mean(se) return(mse) } getMAE = function(target, forecast){ sae = sum(abs(target - forecast)) mae = mean(sae) return(mae) } normalize_2 = function(array, min, max){ #Normalize to [0, 1] #array = r_df$x1 #min = min(array = r_df$x1)...
/Other/auxiliar.R
no_license
jairpaulino/RN_CIn_20211
R
false
false
714
r
getMSE = function(target, forecast){ se = (target - forecast)^2 mse = mean(se) return(mse) } getMAE = function(target, forecast){ sae = sum(abs(target - forecast)) mae = mean(sae) return(mae) } normalize_2 = function(array, min, max){ #Normalize to [0, 1] #array = r_df$x1 #min = min(array = r_df$x1)...
# return a list of functions that can be used to interact with lucid lucidClient <- function(authInfo) { list( status = function() { handleResponse(GET(authInfo, "/internal/status")) }, currentUser = function() { handleResponse(GET(authInfo, "/users/current/")) }, a...
/R/lucid.R
no_license
wch/shinyapps
R
false
false
6,959
r
# return a list of functions that can be used to interact with lucid lucidClient <- function(authInfo) { list( status = function() { handleResponse(GET(authInfo, "/internal/status")) }, currentUser = function() { handleResponse(GET(authInfo, "/users/current/")) }, a...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/f.build.R \name{f.build} \alias{f.build} \title{Convenient Formula Generation} \usage{ f.build(y = NULL, rhs = NULL) } \arguments{ \item{y}{the quoted name of the response (left hand side) variable in the formula. Only one variable is support...
/man/f.build.Rd
no_license
ngreifer/cobalt
R
false
true
1,593
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/f.build.R \name{f.build} \alias{f.build} \title{Convenient Formula Generation} \usage{ f.build(y = NULL, rhs = NULL) } \arguments{ \item{y}{the quoted name of the response (left hand side) variable in the formula. Only one variable is support...
library(shiny) library(shinyjs) library(htmlwidgets) library(igvShiny) targetGene <- list(hugo="PSG1", ensembl="ENSG00000231924", combined="ENSG00000231924|PSG1") footprintDatabases <- c("db one", "db two") createUI <- function() { ui <- fluidPage( useShinyjs(), titlePanel(sprintf("%s Trena Model & Disrup...
/tgapp/ui-examples/sidebar.R
permissive
PriceLab/trenaShinyApps
R
false
false
4,125
r
library(shiny) library(shinyjs) library(htmlwidgets) library(igvShiny) targetGene <- list(hugo="PSG1", ensembl="ENSG00000231924", combined="ENSG00000231924|PSG1") footprintDatabases <- c("db one", "db two") createUI <- function() { ui <- fluidPage( useShinyjs(), titlePanel(sprintf("%s Trena Model & Disrup...
library(fs) ### Name: file_access ### Title: Query for existence and access permissions ### Aliases: file_access file_exists dir_exists link_exists ### ** Examples file_access("/") file_access("/", "read") file_access("/", "write") file_exists("WOMBATS")
/data/genthat_extracted_code/fs/examples/file_access.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
263
r
library(fs) ### Name: file_access ### Title: Query for existence and access permissions ### Aliases: file_access file_exists dir_exists link_exists ### ** Examples file_access("/") file_access("/", "read") file_access("/", "write") file_exists("WOMBATS")
library(grocaptss) source("common.R") peaks.plus = read.table("hg19.gm12878.new_hmm2b.post2.pair_plus.bed") peaks.minus = read.table("hg19.gm12878.new_hmm2b.post2.pair_minus.bed") # remove chrY peaks.plus = peaks.plus[peaks.plus[,1] != "chrY", ] peaks.minus = peaks.minus[peaks.minus[,1] != "chrY", ] bwSet = mainBwSe...
/pipeline/classify.gm12878.R
no_license
andrelmartins/grocap.tsshmm
R
false
false
1,108
r
library(grocaptss) source("common.R") peaks.plus = read.table("hg19.gm12878.new_hmm2b.post2.pair_plus.bed") peaks.minus = read.table("hg19.gm12878.new_hmm2b.post2.pair_minus.bed") # remove chrY peaks.plus = peaks.plus[peaks.plus[,1] != "chrY", ] peaks.minus = peaks.minus[peaks.minus[,1] != "chrY", ] bwSet = mainBwSe...
#download dataset if not exists loadDataset <- function() { datasetFilenameZip <- 'ElectricPowerConsumption.zip'; datasetFilename <- 'household_power_consumption.txt'; if (!file.exists(datasetFilename)) { #download dataset if not exists if (!file.exists(datasetFilenameZip)) { dow...
/plot1.R
no_license
peter-cmw/ExData_Plotting1
R
false
false
1,428
r
#download dataset if not exists loadDataset <- function() { datasetFilenameZip <- 'ElectricPowerConsumption.zip'; datasetFilename <- 'household_power_consumption.txt'; if (!file.exists(datasetFilename)) { #download dataset if not exists if (!file.exists(datasetFilenameZip)) { dow...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/simPoint.R \name{simPoint} \alias{simPoint} \title{simPoint} \usage{ simPoint(p, p2 = NULL, firstServe = NULL) } \arguments{ \item{p}{probability of server winning point on their first serve} \item{p2}{probability of server winning p...
/man/simPoint.Rd
no_license
durtal/servevolleyR
R
false
false
521
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/simPoint.R \name{simPoint} \alias{simPoint} \title{simPoint} \usage{ simPoint(p, p2 = NULL, firstServe = NULL) } \arguments{ \item{p}{probability of server winning point on their first serve} \item{p2}{probability of server winning p...
create.df <- function(data, vars, do.survey.vars = TRUE, add.weight.var = TRUE, add.ballot = FALSE) { g.reg = setupDf(data, do.survey.vars = do.survey.vars, add.weight.var = add.weight.var, add.ballot = add.ballot) g.reg = addVars(g.reg,...
/gss2012_functions.R
no_license
chene5/vote-modeling
R
false
false
26,232
r
create.df <- function(data, vars, do.survey.vars = TRUE, add.weight.var = TRUE, add.ballot = FALSE) { g.reg = setupDf(data, do.survey.vars = do.survey.vars, add.weight.var = add.weight.var, add.ballot = add.ballot) g.reg = addVars(g.reg,...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/deltaCaptureC.R \name{getRunAndLopsidednessStatistics} \alias{getRunAndLopsidednessStatistics} \title{Get the distribution of run and lopsidedness statistics} \usage{ getRunAndLopsidednessStatistics( scrambledDeltas, viewpointRegion, co...
/man/getRunAndLopsidednessStatistics.Rd
permissive
michaeldshapiro/deltaCaptureC
R
false
true
772
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/deltaCaptureC.R \name{getRunAndLopsidednessStatistics} \alias{getRunAndLopsidednessStatistics} \title{Get the distribution of run and lopsidedness statistics} \usage{ getRunAndLopsidednessStatistics( scrambledDeltas, viewpointRegion, co...
library(RobAStBase) ### Name: RobWeight-class ### Title: Robust Weight classes ### Aliases: RobWeight-class name,RobWeight-method name<-,RobWeight-method ### weight weight,RobWeight-method weight<- weight<--methods ### weight<-,RobWeight-method ### Keywords: classes ### ** Examples ## prototype new("RobWeight")...
/data/genthat_extracted_code/RobAStBase/examples/RobWeight-class.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
324
r
library(RobAStBase) ### Name: RobWeight-class ### Title: Robust Weight classes ### Aliases: RobWeight-class name,RobWeight-method name<-,RobWeight-method ### weight weight,RobWeight-method weight<- weight<--methods ### weight<-,RobWeight-method ### Keywords: classes ### ** Examples ## prototype new("RobWeight")...
#Plot 3, creates a line plot of the Sub meterings #Load the data.table. Must have the Library installed, if not run install.packages("data.table") library(data.table); #File Location file_source = "Data/household_power_consumption.txt"; #Read the file with fread, use character as the column classes for faster load. ...
/plot3.R
no_license
ecotte/ExData_Plotting1
R
false
false
1,272
r
#Plot 3, creates a line plot of the Sub meterings #Load the data.table. Must have the Library installed, if not run install.packages("data.table") library(data.table); #File Location file_source = "Data/household_power_consumption.txt"; #Read the file with fread, use character as the column classes for faster load. ...
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function ## The function makeCacheMatrix() encapsulates a matrix, a inverse matrix ## and primitive set and get functions. ## The internal list stores functions. ## Of course in the real life ...
/cachematrix.R
no_license
dr-projectsinfo/ProgrammingAssignment2
R
false
false
2,742
r
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function ## The function makeCacheMatrix() encapsulates a matrix, a inverse matrix ## and primitive set and get functions. ## The internal list stores functions. ## Of course in the real life ...
################################################################### # Data analysis HELPER script for error consistency analysis # All important functions for data analysis should be collected # here (to be used for plotting, presentations, and in the # data-analysis.R script) # ------------------------------...
/error-consistency/data-analysis/data-analysis-helper_new.R
no_license
Sandy4321/cnn_txf_bias
R
false
false
59,188
r
################################################################### # Data analysis HELPER script for error consistency analysis # All important functions for data analysis should be collected # here (to be used for plotting, presentations, and in the # data-analysis.R script) # ------------------------------...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gmm.R \name{gmm_euclidean_method} \alias{gmm_euclidean_method} \title{Method that runs the GMM algorithm using the Euclidean metric to make an external or internal validation of the cluster.} \usage{ gmm_euclidean_method(dt, clusters, columnC...
/man/gmm_euclidean_method.Rd
no_license
minghao2016/Clustering-1
R
false
true
1,148
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gmm.R \name{gmm_euclidean_method} \alias{gmm_euclidean_method} \title{Method that runs the GMM algorithm using the Euclidean metric to make an external or internal validation of the cluster.} \usage{ gmm_euclidean_method(dt, clusters, columnC...
#' Add a protection scenario #' #' @description Adds protection scenarios to the SpatialPolygonsDataFrame grid. Variables in the dataframe of the SpatialPolygonsDataFrame that should otherwise be logical (e.g. scenarios) are converted to numeric since logical variables are incompatible with ESRI shapefiles. #' #' @para...
/R/addscenario.R
no_license
remi-daigle/BESTMPA
R
false
false
5,646
r
#' Add a protection scenario #' #' @description Adds protection scenarios to the SpatialPolygonsDataFrame grid. Variables in the dataframe of the SpatialPolygonsDataFrame that should otherwise be logical (e.g. scenarios) are converted to numeric since logical variables are incompatible with ESRI shapefiles. #' #' @para...
rm(list=ls()) library(data.table) library(rgdal) library(dplyr) library(sp) # library(sf) library(foreign) source_1 = "/Users/hn/Documents/00_GitHub/Ag/remote_sensing/remote_core.R" source(source_1) options(digits=9) options(digit=9) ########## ########## Directories ########## data_dir <- paste0("/Users/hn/Documents...
/remote_sensing/R/weird_shapefile_codes/garbage/003_filter_counties_or_else/004_filter_2015_onward_for_EE/useless/potential_doubles/filter_for_EE_2016.R
permissive
HNoorazar/Ag
R
false
false
5,415
r
rm(list=ls()) library(data.table) library(rgdal) library(dplyr) library(sp) # library(sf) library(foreign) source_1 = "/Users/hn/Documents/00_GitHub/Ag/remote_sensing/remote_core.R" source(source_1) options(digits=9) options(digit=9) ########## ########## Directories ########## data_dir <- paste0("/Users/hn/Documents...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data-movie.R \docType{data} \name{movie_678} \alias{movie_678} \title{Sweet Smell of Success} \format{igraph object} \source{ https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/T4HBA3 https://www.imdb.com/title/tt005103...
/man/movie_678.Rd
permissive
physthoth/networkdata
R
false
true
671
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data-movie.R \docType{data} \name{movie_678} \alias{movie_678} \title{Sweet Smell of Success} \format{igraph object} \source{ https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/T4HBA3 https://www.imdb.com/title/tt005103...
# variables used in various NSE calls utils::globalVariables( c(".", "study", "pred", "se", "pi.lb", "pi.ub", ".fitted", ".pil.fit", ".piu.fit", "meta", "study", "type", "residuals", "rstandard", "resid", "weights", "weight", "type", "hat", ...
/R/utils.R
permissive
ekothe/tidymeta
R
false
false
790
r
# variables used in various NSE calls utils::globalVariables( c(".", "study", "pred", "se", "pi.lb", "pi.ub", ".fitted", ".pil.fit", ".piu.fit", "meta", "study", "type", "residuals", "rstandard", "resid", "weights", "weight", "type", "hat", ...
#' Evaluate multiple statistics with same input data #' #' Calculate the TF activity per sample out of a gene expression matrix by #' coupling a regulon network with a variety of statistics. #' #' @inheritParams .decoupler_mat_format #' @inheritParams .decoupler_network_format #' @param statistics Statistical methods t...
/R/decoupleR-decouple.R
no_license
Eirinits/decoupleR
R
false
false
6,993
r
#' Evaluate multiple statistics with same input data #' #' Calculate the TF activity per sample out of a gene expression matrix by #' coupling a regulon network with a variety of statistics. #' #' @inheritParams .decoupler_mat_format #' @inheritParams .decoupler_network_format #' @param statistics Statistical methods t...
###### the Metabolic-EP algorithm (Braunstein et al. Nat Commun 2017) ###### ### --- prepare data for MEP --- ### rm.fixed.rxns <- function(model, nc=1L) { fva.res <- fva(model, nc=nc) vmin <- pmax(model$lb, fva.res$vmin) vmax <- pmin(model$ub, fva.res$vmax) fixed <- vmin==vmax notfixed <- !fixed if (any...
/R/mep.R
no_license
Bioinformatics-pipelines/gembox
R
false
false
1,928
r
###### the Metabolic-EP algorithm (Braunstein et al. Nat Commun 2017) ###### ### --- prepare data for MEP --- ### rm.fixed.rxns <- function(model, nc=1L) { fva.res <- fva(model, nc=nc) vmin <- pmax(model$lb, fva.res$vmin) vmax <- pmin(model$ub, fva.res$vmax) fixed <- vmin==vmax notfixed <- !fixed if (any...
install.packages("dplyr") install.packages("ggpubr") install.packages("mvShapiroTest") install.packages("janeaustenr") install.packages("tidytext") install.packages("textdata") library("textdata") library("tidytext") library("janeaustenr") library("mvShapiroTest") library("ggpubr") library("dplyr") caps <- ...
/UserAccountAnalysis_Twitter.R
no_license
pallavigoswami23/Twitter-Analysis--Travel-Bloggers-and-the-Travel-Industry
R
false
false
2,679
r
install.packages("dplyr") install.packages("ggpubr") install.packages("mvShapiroTest") install.packages("janeaustenr") install.packages("tidytext") install.packages("textdata") library("textdata") library("tidytext") library("janeaustenr") library("mvShapiroTest") library("ggpubr") library("dplyr") caps <- ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_test_label.R \name{get_pwc_label} \alias{get_pwc_label} \alias{get_test_label} \alias{create_test_label} \alias{get_n} \alias{get_description} \title{Extract Label Information from Statistical Tests} \usage{ get_pwc_label(stat.test, type ...
/man/get_test_label.Rd
no_license
llrs/rstatix
R
false
true
5,189
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_test_label.R \name{get_pwc_label} \alias{get_pwc_label} \alias{get_test_label} \alias{create_test_label} \alias{get_n} \alias{get_description} \title{Extract Label Information from Statistical Tests} \usage{ get_pwc_label(stat.test, type ...
#Combining data from all states library(gdata) data1 <- read.xls("C:/UB Spring Semester 2016/DIC/Project 1/Question 3/data/rollingsales_manhattan.xls", perl = "C:/Strawberry/perl/bin/perl.exe", pattern = "BOROUGH") #data from bronx bronx_data <- read.xls("C:/UB Spring Semester 2016/DIC/Project...
/RDP3Exagamdeep.R
no_license
agamdeep/EDA-using-Rstudio
R
false
false
2,767
r
#Combining data from all states library(gdata) data1 <- read.xls("C:/UB Spring Semester 2016/DIC/Project 1/Question 3/data/rollingsales_manhattan.xls", perl = "C:/Strawberry/perl/bin/perl.exe", pattern = "BOROUGH") #data from bronx bronx_data <- read.xls("C:/UB Spring Semester 2016/DIC/Project...
library(tidyverse) library(gganimate) #### Playing with GGANNIMATE ## plan is to make some animations to add to my app ## i tried making them in app and displaying them using renderImage and ## it worked in rstudio on my local machine ## but it didn't work once deployed ## so here we are making gifs #### The ...
/animations.R
permissive
AmyStringer/SpecialistMathematics
R
false
false
7,580
r
library(tidyverse) library(gganimate) #### Playing with GGANNIMATE ## plan is to make some animations to add to my app ## i tried making them in app and displaying them using renderImage and ## it worked in rstudio on my local machine ## but it didn't work once deployed ## so here we are making gifs #### The ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mapicesrect.R \name{mapicesrect} \alias{mapicesrect} \title{This function map a variable defined on ICES statistical rectangles} \usage{ mapicesrect(data, var, rect) } \arguments{ \item{data:}{a data frame} \item{var:}{the variable position ...
/man/mapicesrect.Rd
permissive
ldbk/fishPifct
R
false
true
1,327
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mapicesrect.R \name{mapicesrect} \alias{mapicesrect} \title{This function map a variable defined on ICES statistical rectangles} \usage{ mapicesrect(data, var, rect) } \arguments{ \item{data:}{a data frame} \item{var:}{the variable position ...
library(panelPomp) vals <- numeric(60) pompExample(panelGompertz) for (i in seq_along(vals)) { set.seed(334388458L) pfilter(panelGompertz,Np = 100) -> m1 vals[i] <- logLik(m1) } print(as.data.frame(table(vals)))
/tests/likrepro.R
no_license
kesimmons/panelPomp
R
false
false
245
r
library(panelPomp) vals <- numeric(60) pompExample(panelGompertz) for (i in seq_along(vals)) { set.seed(334388458L) pfilter(panelGompertz,Np = 100) -> m1 vals[i] <- logLik(m1) } print(as.data.frame(table(vals)))
df <- read.table("household_power_consumption.txt", sep = ";", header = TRUE) df$Date <- as.Date(df$Date, "%d/%m/%Y") df <- df[df$Date == "2007-02-01" | df$Date == "2007-02-02", ] df$datetime <- strptime(paste(df$Date, df$Time), "%Y-%m-%d %H:%M:%S") df$Sub_metering_1 <- as.numeric(df$Sub_metering_1) df$Sub_metering_2 <...
/plot3.R
no_license
0ldmajor/expl_data_analysis_week1_project
R
false
false
885
r
df <- read.table("household_power_consumption.txt", sep = ";", header = TRUE) df$Date <- as.Date(df$Date, "%d/%m/%Y") df <- df[df$Date == "2007-02-01" | df$Date == "2007-02-02", ] df$datetime <- strptime(paste(df$Date, df$Time), "%Y-%m-%d %H:%M:%S") df$Sub_metering_1 <- as.numeric(df$Sub_metering_1) df$Sub_metering_2 <...
test_that("error is propagated, .Last.error is set", { expect_r_process_snapshot( callr::r(function() 1 + "A", error = "error"), .Last.error, transform = redact_srcref ) }) test_that("error is propagated, printed if non-interactive mode", { expect_r_process_snapshot( callr::r(function() 1 + "A",...
/tests/testthat/test-error.R
permissive
r-lib/callr
R
false
false
5,737
r
test_that("error is propagated, .Last.error is set", { expect_r_process_snapshot( callr::r(function() 1 + "A", error = "error"), .Last.error, transform = redact_srcref ) }) test_that("error is propagated, printed if non-interactive mode", { expect_r_process_snapshot( callr::r(function() 1 + "A",...
## Kelsea D. ## Date: 12/12/2019 ## pollutantmean function for Coursera R Programming Week 2 Assignment pollutantmean <- function(directory, pollutant, id = 1:332) { ## 'directory' is a character vector of length 1 indicating ## the location of the CSV files ## 'pollutant' is a character vector of length 1 in...
/R Programming/programming_assignment1/pollutantmean.R
no_license
kdenny25/datasciencecoursera
R
false
false
1,048
r
## Kelsea D. ## Date: 12/12/2019 ## pollutantmean function for Coursera R Programming Week 2 Assignment pollutantmean <- function(directory, pollutant, id = 1:332) { ## 'directory' is a character vector of length 1 indicating ## the location of the CSV files ## 'pollutant' is a character vector of length 1 in...
library(salesperson) library(BBmisc) imputeAngleFeats = function(feats) { problematic.instances = as.character(feats$path[is.na(feats$angle_varcoeff)]) for (pr in problematic.instances) { catf("updating instance %s", pr) inst = importFromTSPlibFormat(filename = sprintf("../instances/evolved2/%s", pr)) ...
/R/ex06_impute_angle_features.R
no_license
yuexiaqianying/PPSN_TSP_DL
R
false
false
890
r
library(salesperson) library(BBmisc) imputeAngleFeats = function(feats) { problematic.instances = as.character(feats$path[is.na(feats$angle_varcoeff)]) for (pr in problematic.instances) { catf("updating instance %s", pr) inst = importFromTSPlibFormat(filename = sprintf("../instances/evolved2/%s", pr)) ...
# function to aggregate long-run system states from deterministic runs, to be used as starting points for stochastic simulations aggregateTimePoints <- function(directoryToAggregate, writeFileName, timeToPull){ directoryPath = file.path(".", "Outputs", "simulations", directoryToAggregate) fileNames = list.files(direc...
/R_scripts/simulation/aggregate_startingPoints.R
no_license
waternk/SpatialBloomIndicators
R
false
false
1,197
r
# function to aggregate long-run system states from deterministic runs, to be used as starting points for stochastic simulations aggregateTimePoints <- function(directoryToAggregate, writeFileName, timeToPull){ directoryPath = file.path(".", "Outputs", "simulations", directoryToAggregate) fileNames = list.files(direc...
#------------------------------------------------------------------------------- # Copyright (c) 2012 University of Illinois, NCSA. # All rights reserved. This program and the accompanying materials # are made available under the terms of the # University of Illinois/NCSA Open Source License # which accompanies this di...
/models/ed/R/model2netcdf.ED2.R
permissive
dlebauer/pecan
R
false
false
60,698
r
#------------------------------------------------------------------------------- # Copyright (c) 2012 University of Illinois, NCSA. # All rights reserved. This program and the accompanying materials # are made available under the terms of the # University of Illinois/NCSA Open Source License # which accompanies this di...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/approximate_discretized_score.R \name{approximate_discretized_score} \alias{approximate_discretized_score} \title{MCMC estimator of score function at a discretization level} \usage{ approximate_discretized_score( model, theta, discretiz...
/man/approximate_discretized_score.Rd
no_license
jeremyhengjm/UnbiasedScore
R
false
true
1,713
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/approximate_discretized_score.R \name{approximate_discretized_score} \alias{approximate_discretized_score} \title{MCMC estimator of score function at a discretization level} \usage{ approximate_discretized_score( model, theta, discretiz...
library(ape) testtree <- read.tree("4026_12.txt") unrooted_tr <- unroot(testtree) write.tree(unrooted_tr, file="4026_12_unrooted.txt")
/codeml_files/newick_trees_processed/4026_12/rinput.R
no_license
DaniBoo/cyanobacteria_project
R
false
false
137
r
library(ape) testtree <- read.tree("4026_12.txt") unrooted_tr <- unroot(testtree) write.tree(unrooted_tr, file="4026_12_unrooted.txt")
41d59e371df2291f0011cfe0aae045c5 query05_eequery_1344.qdimacs 441 1260
/code/dcnf-ankit-optimized/Results/QBFLIB-2018/E1+A1/Database/Jordan-Kaiser/reduction-finding-full-set-params-k1c3n4/query05_eequery_1344/query05_eequery_1344.R
no_license
arey0pushpa/dcnf-autarky
R
false
false
70
r
41d59e371df2291f0011cfe0aae045c5 query05_eequery_1344.qdimacs 441 1260
#' @title Shrink param set towards a point. #' #' @description #' Shrinks a paramset towards the best found point. #' Numeric values are shrinked to an interval around the best obtained value of half of #' the previous length in each iteration, while for discrete variables, a random, #' not best-performing level is dr...
/R/shrinkParSet.R
no_license
pfistfl/focussearch
R
false
false
1,727
r
#' @title Shrink param set towards a point. #' #' @description #' Shrinks a paramset towards the best found point. #' Numeric values are shrinked to an interval around the best obtained value of half of #' the previous length in each iteration, while for discrete variables, a random, #' not best-performing level is dr...
# FORMATTING WASTE TYPES original <- read.csv("~/Downloads/Landfills/NY_raw.csv", stringsAsFactors = FALSE)[1:671,] # waste types are 18:36 # current waste data in "website" [10] names(original) original[,18:36] <- "No" types <- original[,10] for (i in seq_along(types)) { line <- strsplit(types[i], split=";") o...
/states/NY.R
no_license
amhuang/waste-mgmt-research
R
false
false
4,396
r
# FORMATTING WASTE TYPES original <- read.csv("~/Downloads/Landfills/NY_raw.csv", stringsAsFactors = FALSE)[1:671,] # waste types are 18:36 # current waste data in "website" [10] names(original) original[,18:36] <- "No" types <- original[,10] for (i in seq_along(types)) { line <- strsplit(types[i], split=";") o...
## A pair of functions that cache the inverse of a matrix. ## This function creates a special "matrix" object that can cache its inverse. makeCacheMatrix <- function(x = matrix()) { inv <- NULL set <- function(y) { x <<- y inv <<- NULL } get <- functio...
/cachematrix.R
no_license
phaber/ProgrammingAssignment2
R
false
false
981
r
## A pair of functions that cache the inverse of a matrix. ## This function creates a special "matrix" object that can cache its inverse. makeCacheMatrix <- function(x = matrix()) { inv <- NULL set <- function(y) { x <<- y inv <<- NULL } get <- functio...
data <- read.table("household_power_consumption.txt",sep=';',header=TRUE,na.strings = "?") data$timestamp <- strptime(paste(data$Date,data$Time),"%d/%m/%Y %H:%M:%S") data <- subset(data, timestamp >= "2007-02-01 00:00:00" & timestamp <= "2007-02-02 23:59:59") png(filename = "plot3.png", width = 480, height = 480, unit...
/plot3.R
no_license
manazevedof/datasciencecoursera
R
false
false
679
r
data <- read.table("household_power_consumption.txt",sep=';',header=TRUE,na.strings = "?") data$timestamp <- strptime(paste(data$Date,data$Time),"%d/%m/%Y %H:%M:%S") data <- subset(data, timestamp >= "2007-02-01 00:00:00" & timestamp <= "2007-02-02 23:59:59") png(filename = "plot3.png", width = 480, height = 480, unit...
library(OIdata) ### Name: getTables ### Title: Get the tables from a web page ### Aliases: getTables rowScrape stripTags scrapeTable print.htmlTables ### Keywords: web scrape ### ** Examples ## Not run: ##D URL <- "http://en.wikipedia.org/wiki/Poverty_in_the_United_States" ##D Tables <- getTables(URL) ##D thi...
/data/genthat_extracted_code/OIdata/examples/getTables.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
470
r
library(OIdata) ### Name: getTables ### Title: Get the tables from a web page ### Aliases: getTables rowScrape stripTags scrapeTable print.htmlTables ### Keywords: web scrape ### ** Examples ## Not run: ##D URL <- "http://en.wikipedia.org/wiki/Poverty_in_the_United_States" ##D Tables <- getTables(URL) ##D thi...
se clatina pacea sociala promisa prin Acordul Social Tripartit . atunci , in februarie , guvernul Nastase obtinea un respiro pina la sfirsitul anului . daca premierul n - ar fi ajuns la Congresul extraordinar al Cartelului Alfa , documentul intelegerii dintre guvern , patronat si sindicate ar fi devenit nul pe 26 mai...
/data/Newspapers/2001.06.04.editorial.34985.0636.r
no_license
narcis96/decrypting-alpha
R
false
false
3,189
r
se clatina pacea sociala promisa prin Acordul Social Tripartit . atunci , in februarie , guvernul Nastase obtinea un respiro pina la sfirsitul anului . daca premierul n - ar fi ajuns la Congresul extraordinar al Cartelului Alfa , documentul intelegerii dintre guvern , patronat si sindicate ar fi devenit nul pe 26 mai...
#' #' pkgRandomFields.R #' #' Dealing with the Random Fields package #' #' $Revision: 1.3 $ $Date: 2020/11/30 10:14:04 $ kraeverRandomFields <- function() { kraever("RandomFieldsUtils") kraever("RandomFields") # should no longer be needed: # capture.output(RandomFieldsUtils:::.onLoad()) # ca...
/R/pkgRandomFields.R
no_license
cfend/spatstat.core
R
false
false
2,490
r
#' #' pkgRandomFields.R #' #' Dealing with the Random Fields package #' #' $Revision: 1.3 $ $Date: 2020/11/30 10:14:04 $ kraeverRandomFields <- function() { kraever("RandomFieldsUtils") kraever("RandomFields") # should no longer be needed: # capture.output(RandomFieldsUtils:::.onLoad()) # ca...
#' map_receptor #' #' Identifying the source of unknown response data by correlating it agains all #' DoOR responding units. #' #' @param data data frame, containing two columns, one called "odorants" and one #' "responses" providing InChIKeys and odorant responses respectively. #' @param response_matrix output is a ...
/R/map_receptor.R
no_license
jefferis/DoOR.functions
R
false
false
3,017
r
#' map_receptor #' #' Identifying the source of unknown response data by correlating it agains all #' DoOR responding units. #' #' @param data data frame, containing two columns, one called "odorants" and one #' "responses" providing InChIKeys and odorant responses respectively. #' @param response_matrix output is a ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Ebola-data.R \docType{data} \name{Ebola} \alias{Ebola} \title{Ebola model for the epidemic of Ebola Virus Disease} \format{An object of class \code{list} of length 2.} \usage{ Ebola } \description{ The Ebola model is a four-dimensional model ...
/man/Ebola.Rd
no_license
cran/GPoM.FDLyapu
R
false
true
1,149
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Ebola-data.R \docType{data} \name{Ebola} \alias{Ebola} \title{Ebola model for the epidemic of Ebola Virus Disease} \format{An object of class \code{list} of length 2.} \usage{ Ebola } \description{ The Ebola model is a four-dimensional model ...
library(stringr) x <- c() yFrontier <- c() yArea <- c() yDiameter <- c() for (f in list.files('../Data/')) { csvData <- read.csv(paste0("../Data/", f)) # Get the indexes of each _ underscoreIndexes <- str_locate_all(f, "_")[[1]] # The number of steps is inside the 2nd and 3rd _. +1 and -1 to not include the...
/R/analysis.R
no_license
dingelsz/Hausdorff-Dimension-Research
R
false
false
1,634
r
library(stringr) x <- c() yFrontier <- c() yArea <- c() yDiameter <- c() for (f in list.files('../Data/')) { csvData <- read.csv(paste0("../Data/", f)) # Get the indexes of each _ underscoreIndexes <- str_locate_all(f, "_")[[1]] # The number of steps is inside the 2nd and 3rd _. +1 and -1 to not include the...
rint("This file was created within RStudio") print("And now it lives on GitHub")
/ooh.R
no_license
shardasharma2020/testing
R
false
false
81
r
rint("This file was created within RStudio") print("And now it lives on GitHub")
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/player_profile.R \name{players_bios} \alias{players_bios} \title{NBA.com bios} \usage{ players_bios( players = NULL, player_ids = NULL, nest_data = F, return_message = TRUE ) } \arguments{ \item{players}{vector of players} \item{play...
/man/players_bios.Rd
no_license
abresler/nbastatR
R
false
true
784
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/player_profile.R \name{players_bios} \alias{players_bios} \title{NBA.com bios} \usage{ players_bios( players = NULL, player_ids = NULL, nest_data = F, return_message = TRUE ) } \arguments{ \item{players}{vector of players} \item{play...
fixup_calls <- function(x) { cur_pos <- sys.nframe() - 1 x[seq(n+1, length(x))] } fixup_ctxt_depth <- function(x) { x - (sys.nframe() - 1) } fixup_call_depth <- function(x) { x - (call_depth() - 1) } fixup_call_trail <- function(trail) { eval_callers <- ctxt_stack_callers() cur_trail <- trail_make(eval_c...
/packrat/lib/x86_64-w64-mingw32/3.4.3/rlang/tests/testthat/helper-stack.R
permissive
UBC-MDS/Karl
R
false
false
459
r
fixup_calls <- function(x) { cur_pos <- sys.nframe() - 1 x[seq(n+1, length(x))] } fixup_ctxt_depth <- function(x) { x - (sys.nframe() - 1) } fixup_call_depth <- function(x) { x - (call_depth() - 1) } fixup_call_trail <- function(trail) { eval_callers <- ctxt_stack_callers() cur_trail <- trail_make(eval_c...
# Ranking hospitals by outcome in a state rankhospital <- function(state, outcome, num = 'best'){ # read data data = read.csv("A:/coursera-r-programming/Hospital-quality/outcome-of-care-measures.csv", na.strings = "Not Available", stringsAsFactors = FALSE) # Filter unnecessary data ...
/Hospital-quality/rankhospital.R
no_license
santoshsharma21/coursera-r-programming
R
false
false
1,507
r
# Ranking hospitals by outcome in a state rankhospital <- function(state, outcome, num = 'best'){ # read data data = read.csv("A:/coursera-r-programming/Hospital-quality/outcome-of-care-measures.csv", na.strings = "Not Available", stringsAsFactors = FALSE) # Filter unnecessary data ...
clean_name <- function(x) { gsub("-", "_", x) } clean_package_name <- function(x){ gsub("-", ".", x) } clean_slot_name <- function(x) { x <- clean_name(x) sprintf("slot_%s", x) } clean_style_name <- function(x) { x <- gsub("^--", "", x) x <- clean_name(x) sprintf("css_%s", x) } is_shinywc <- function(...
/R/utils.R
no_license
epiviz/shinywc
R
false
false
1,801
r
clean_name <- function(x) { gsub("-", "_", x) } clean_package_name <- function(x){ gsub("-", ".", x) } clean_slot_name <- function(x) { x <- clean_name(x) sprintf("slot_%s", x) } clean_style_name <- function(x) { x <- gsub("^--", "", x) x <- clean_name(x) sprintf("css_%s", x) } is_shinywc <- function(...
\name{hhg.example.datagen} \alias{hhg.example.datagen} \title{ A set of example data generators used to demonstrate the HHG test. } \description{ Six examples (Circle, Diamond, Parabola, 2Parabolas, W, 4indclouds) are taken from Newton's introduction to the discussion of the Energy Test in The Annals of Applied S...
/man/hhg.example.datagen.Rd
no_license
shachark/HHG
R
false
false
1,876
rd
\name{hhg.example.datagen} \alias{hhg.example.datagen} \title{ A set of example data generators used to demonstrate the HHG test. } \description{ Six examples (Circle, Diamond, Parabola, 2Parabolas, W, 4indclouds) are taken from Newton's introduction to the discussion of the Energy Test in The Annals of Applied S...
################################# #least-square solver for regression ################################# LS_Graph <- function (X, Y, G, lam1, lam2, opts){ #------------------------------------------------------ # private functions gradVal_eval <- function (W, C){ r <- lapply(c(1:task_num), function(x) LS...
/R/Graph_penalty.R
no_license
hank9cao/RMTL
R
false
false
5,430
r
################################# #least-square solver for regression ################################# LS_Graph <- function (X, Y, G, lam1, lam2, opts){ #------------------------------------------------------ # private functions gradVal_eval <- function (W, C){ r <- lapply(c(1:task_num), function(x) LS...
### Exclude no long data ### exclude<-function(data){ db.null<-data db.exclude<-data for(i in 1:dim(data)[1]){ for(l in 1:dim(data)[2]){ if(is.na(data[i,l])==T){db.null[i,l]<-0 }else(db.null[i,l]<-1) } } for(i in 1:dim(data)[1]){ if(sum(db.null[i,])==0){db.exclude<-data[-i,]} } re...
/R/exclude.R
permissive
helpstatanalysis/mvls0.1
R
false
false
339
r
### Exclude no long data ### exclude<-function(data){ db.null<-data db.exclude<-data for(i in 1:dim(data)[1]){ for(l in 1:dim(data)[2]){ if(is.na(data[i,l])==T){db.null[i,l]<-0 }else(db.null[i,l]<-1) } } for(i in 1:dim(data)[1]){ if(sum(db.null[i,])==0){db.exclude<-data[-i,]} } re...
testlist <- list(b = numeric(0), p1 = c(8.5728629954997e-312, 1.56898424065867e+82, 8.96970809549085e-158, -1.3258495253834e-113, 2.79620616433656e-119, -6.80033518839696e+41, 2.68298522855314e-211, 1444042902784.06, 6.68889884134308e+51, -4.05003163986346e-308, -3.52601820453991e+43, -1.49815227045093e+197, -2.616...
/metacoder/inst/testfiles/intersect_line_rectangle/AFL_intersect_line_rectangle/intersect_line_rectangle_valgrind_files/1615768953-test.R
permissive
akhikolla/updatedatatype-list3
R
false
false
747
r
testlist <- list(b = numeric(0), p1 = c(8.5728629954997e-312, 1.56898424065867e+82, 8.96970809549085e-158, -1.3258495253834e-113, 2.79620616433656e-119, -6.80033518839696e+41, 2.68298522855314e-211, 1444042902784.06, 6.68889884134308e+51, -4.05003163986346e-308, -3.52601820453991e+43, -1.49815227045093e+197, -2.616...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/helper_functions.r \name{parse.total.popn.size} \alias{parse.total.popn.size} \title{handle the total.popn.size argument in a uniform way across several functions} \usage{ parse.total.popn.size(total.popn.size, survey.data, verbose = FALSE) }...
/man/parse.total.popn.size.Rd
no_license
msalganik/networkreporting
R
false
true
1,197
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/helper_functions.r \name{parse.total.popn.size} \alias{parse.total.popn.size} \title{handle the total.popn.size argument in a uniform way across several functions} \usage{ parse.total.popn.size(total.popn.size, survey.data, verbose = FALSE) }...
## run TAGM require(pRoloc) load(file = "arabidposis_co3.rda") fData(arabidposis_co3)$markers2[fData(arabidposis_co3)$markers2 %in% c("cytosolic ribosomes", "extracellular")] <- "unknown" mcmc_arabidposis_co3_markers2 <- tagmMcmcTrain(object = arabidposis_co3, fcol = "markers2", ...
/hpcscripts/araCO3_markers2.R
no_license
ococrook/2020-Harriet-Arabidopsis
R
false
false
499
r
## run TAGM require(pRoloc) load(file = "arabidposis_co3.rda") fData(arabidposis_co3)$markers2[fData(arabidposis_co3)$markers2 %in% c("cytosolic ribosomes", "extracellular")] <- "unknown" mcmc_arabidposis_co3_markers2 <- tagmMcmcTrain(object = arabidposis_co3, fcol = "markers2", ...
library(simsem) loading.null <- matrix(0, 6, 1) loading.null[1:6, 1] <- NA LY.NULL <- bind(loading.null, 0.7) RPS.NULL <- binds(diag(1)) RTE <- binds(diag(6), misspec=matrix("rnorm(1,0,0.1)", 6, 6)) CFA.NULL <- model(LY = LY.NULL, RPS = RPS.NULL, RTE = RTE, modelType="CFA") Output.NULL <- sim(1000, n=500, CFA.NULL) ...
/SupportingDocs/Examples/Version03/ex11/ex11.R
no_license
simsem/simsem
R
false
false
1,319
r
library(simsem) loading.null <- matrix(0, 6, 1) loading.null[1:6, 1] <- NA LY.NULL <- bind(loading.null, 0.7) RPS.NULL <- binds(diag(1)) RTE <- binds(diag(6), misspec=matrix("rnorm(1,0,0.1)", 6, 6)) CFA.NULL <- model(LY = LY.NULL, RPS = RPS.NULL, RTE = RTE, modelType="CFA") Output.NULL <- sim(1000, n=500, CFA.NULL) ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/show_tdlcrkindiccdf.R \name{show_tdlcrkindiccdf} \alias{show_tdlcrkindiccdf} \title{Plotly empirical CDF plots of tidal creek context indicators} \usage{ show_tdlcrkindiccdf( id, cntdat, yr = 2018, thrsel = FALSE, pal = c("#5C4A42",...
/man/show_tdlcrkindiccdf.Rd
permissive
mikewessel/tbeptools
R
false
true
1,335
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/show_tdlcrkindiccdf.R \name{show_tdlcrkindiccdf} \alias{show_tdlcrkindiccdf} \title{Plotly empirical CDF plots of tidal creek context indicators} \usage{ show_tdlcrkindiccdf( id, cntdat, yr = 2018, thrsel = FALSE, pal = c("#5C4A42",...
################################################################################ ### ### DATE: 2007 ### ### AUTHOR: Mark C. Wheldon (biostatmark@gmail.com) ### ### Some functions based on code from Venables, ### W.N. & Ripley, B.D. (2002). Modern Applied...
/R/t_tests_Section_3.1_Functions_and_Example.R
permissive
markalava/EEGperm
R
false
false
16,361
r
################################################################################ ### ### DATE: 2007 ### ### AUTHOR: Mark C. Wheldon (biostatmark@gmail.com) ### ### Some functions based on code from Venables, ### W.N. & Ripley, B.D. (2002). Modern Applied...
d=10000 dice1 <- sample(6, d, replace=TRUE) dice2 <- sample(6, d, replace=TRUE) dice_roll <- dice1+dice2 # histogram of experiment hist(dice_roll) hist(dice_roll, freq=FALSE) # Cummulative distribituion plot P = ecdf(dice_roll) plot(P) # normal distribution n <- rnorm(10000) hist(n) myheight <- 63 z...
/20150706_inclass/Dice_Simuation.R
no_license
gayanmora/gayan_moraliyage
R
false
false
341
r
d=10000 dice1 <- sample(6, d, replace=TRUE) dice2 <- sample(6, d, replace=TRUE) dice_roll <- dice1+dice2 # histogram of experiment hist(dice_roll) hist(dice_roll, freq=FALSE) # Cummulative distribituion plot P = ecdf(dice_roll) plot(P) # normal distribution n <- rnorm(10000) hist(n) myheight <- 63 z...
fpath <- file.path('..', 'orig', 'LR04', 'ODP929') currwd <- getwd() setwd(fpath) ODP929 <-ODP929 <- read.delim("ODP929.txt",skip=2,header=FALSE,col.names=c("Mcd","d13C.permilPDB","d18O.permilPDB","Species1","Species2"),sep="") ODP929chronos <- read.delim("ODP929chronos.txt",skip=1,header=FALSE,col.names=c("Mcd","Age....
/data/ODP929.R
permissive
mcrucifix/pleistocene
R
false
false
487
r
fpath <- file.path('..', 'orig', 'LR04', 'ODP929') currwd <- getwd() setwd(fpath) ODP929 <-ODP929 <- read.delim("ODP929.txt",skip=2,header=FALSE,col.names=c("Mcd","d13C.permilPDB","d18O.permilPDB","Species1","Species2"),sep="") ODP929chronos <- read.delim("ODP929chronos.txt",skip=1,header=FALSE,col.names=c("Mcd","Age....
#' Get Approval Bar Configuration #' #' @description Given approval bars, return a named list of gsplot elements to #' call. #' @author Andrew Halper #' @param approvals A list of data objects relevant to plotting approval #' bars. Each list item must be named one of appr_approved_uv, appr_analyzed_uv, #' or ap...
/R/utils-approvals.R
permissive
USGS-R/repgen
R
false
false
4,194
r
#' Get Approval Bar Configuration #' #' @description Given approval bars, return a named list of gsplot elements to #' call. #' @author Andrew Halper #' @param approvals A list of data objects relevant to plotting approval #' bars. Each list item must be named one of appr_approved_uv, appr_analyzed_uv, #' or ap...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bin_cumulative.R \name{bin_cumulative} \alias{bin_cumulative} \title{bin_cumulative} \usage{ bin_cumulative(trials, prob) } \arguments{ \item{trials:}{total number of trials} \item{prob:}{probability of success} } \value{ data.frame of succe...
/binomial/man/bin_cumulative.Rd
no_license
stat133-sp19/hw-stat133-arna424
R
false
true
522
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bin_cumulative.R \name{bin_cumulative} \alias{bin_cumulative} \title{bin_cumulative} \usage{ bin_cumulative(trials, prob) } \arguments{ \item{trials:}{total number of trials} \item{prob:}{probability of success} } \value{ data.frame of succe...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/securityhub_operations.R \name{securityhub_update_action_target} \alias{securityhub_update_action_target} \title{Updates the name and description of a custom action target in Security Hub} \usage{ securityhub_update_action_target( ActionTar...
/cran/paws.security.identity/man/securityhub_update_action_target.Rd
permissive
paws-r/paws
R
false
true
811
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/securityhub_operations.R \name{securityhub_update_action_target} \alias{securityhub_update_action_target} \title{Updates the name and description of a custom action target in Security Hub} \usage{ securityhub_update_action_target( ActionTar...
library(RStoolbox) ### Name: unsuperClass ### Title: Unsupervised Classification ### Aliases: unsuperClass ### ** Examples library(raster) input <- brick(system.file("external/rlogo.grd", package="raster")) ## Plot olpar <- par(no.readonly = TRUE) # back-up par par(mfrow=c(1,2)) plotRGB(input) ## Run classificat...
/data/genthat_extracted_code/RStoolbox/examples/unsuperClass.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
645
r
library(RStoolbox) ### Name: unsuperClass ### Title: Unsupervised Classification ### Aliases: unsuperClass ### ** Examples library(raster) input <- brick(system.file("external/rlogo.grd", package="raster")) ## Plot olpar <- par(no.readonly = TRUE) # back-up par par(mfrow=c(1,2)) plotRGB(input) ## Run classificat...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/clustering_functions.R \name{external_validation} \alias{external_validation} \title{external clustering validation} \usage{ external_validation(true_labels, clusters, method = "adjusted_rand_index", summary_stats = FALSE) } \arguments{ \it...
/man/external_validation.Rd
no_license
mutual-ai/ClusterR
R
false
true
1,634
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/clustering_functions.R \name{external_validation} \alias{external_validation} \title{external clustering validation} \usage{ external_validation(true_labels, clusters, method = "adjusted_rand_index", summary_stats = FALSE) } \arguments{ \it...