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
sourceDir("methods") addMethod(dsc_znull,name="ash.hu",fn =ash.wrapper,args=list(mixcompdist="halfunif"),outputtype = "ash_output") addMethod(dsc_znull,name="ash.u",fn =ash.wrapper,args=list(mixcompdist="unif"),outputtype = "ash_output") addMethod(dsc_znull,name="ash.n",fn =ash.wrapper,args=list(mixcompdist="normal"),...
/dsc-shrink/addMethods.null.R
no_license
mengyin/ash
R
false
false
1,553
r
sourceDir("methods") addMethod(dsc_znull,name="ash.hu",fn =ash.wrapper,args=list(mixcompdist="halfunif"),outputtype = "ash_output") addMethod(dsc_znull,name="ash.u",fn =ash.wrapper,args=list(mixcompdist="unif"),outputtype = "ash_output") addMethod(dsc_znull,name="ash.n",fn =ash.wrapper,args=list(mixcompdist="normal"),...
concerto.event.add = function(name, fun){ concerto$events[[name]] <<- c(concerto$events[[name]], fun) }
/src/Concerto/TestBundle/Resources/R/concerto5/R/concerto.event.add.R
permissive
campsych/concerto-platform
R
false
false
108
r
concerto.event.add = function(name, fun){ concerto$events[[name]] <<- c(concerto$events[[name]], fun) }
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/multiCDM.R \name{multiCDM} \alias{multiCDM} \title{Wrapper for deriving CDMs from the results of multiple spatial simulations} \usage{ multiCDM(simulations.result, no.plots, plot.length) } \arguments{ \item{simulations.result}{List of data fr...
/man/multiCDM.Rd
no_license
eliotmiller/metricTester
R
false
true
1,863
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/multiCDM.R \name{multiCDM} \alias{multiCDM} \title{Wrapper for deriving CDMs from the results of multiple spatial simulations} \usage{ multiCDM(simulations.result, no.plots, plot.length) } \arguments{ \item{simulations.result}{List of data fr...
library(mclust) ### Name: hcE ### Title: Model-based Hierarchical Clustering ### Aliases: hcE hcV hcEII hcVII hcEEE hcVVV ### Keywords: cluster ### ** Examples hcTree <- hcEII(data = iris[,-5]) cl <- hclass(hcTree,c(2,3)) ## Not run: ##D par(pty = "s", mfrow = c(1,1)) ##D clPairs(iris[,-5],cl=cl[,"2"]) ##D clPair...
/data/genthat_extracted_code/mclust/examples/hcE.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
544
r
library(mclust) ### Name: hcE ### Title: Model-based Hierarchical Clustering ### Aliases: hcE hcV hcEII hcVII hcEEE hcVVV ### Keywords: cluster ### ** Examples hcTree <- hcEII(data = iris[,-5]) cl <- hclass(hcTree,c(2,3)) ## Not run: ##D par(pty = "s", mfrow = c(1,1)) ##D clPairs(iris[,-5],cl=cl[,"2"]) ##D clPair...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{party_people} \alias{party_people} \title{Resampled Party Pleasure Data} \format{ A data frame with 442 rows and 16 variables. \describe{ \item{\code{id}}{Participant's ID} \item{\code{item_1}}{Participant...
/man/party_people.Rd
permissive
benediktclaus/costatcompanion
R
false
true
1,698
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{party_people} \alias{party_people} \title{Resampled Party Pleasure Data} \format{ A data frame with 442 rows and 16 variables. \describe{ \item{\code{id}}{Participant's ID} \item{\code{item_1}}{Participant...
### ----------------------------- ### simon munzert ### intro to web scraping with R ### ----------------------------- ## preparations ----------------------- source("packages.r") ## case study 1: map breweries in Germany ------- ## goal # get list of breweries in Germany # import list in R # geolocate breweries #...
/00-intro.r
no_license
vaishalisvp/rscraping-hertie-2018
R
false
false
4,322
r
### ----------------------------- ### simon munzert ### intro to web scraping with R ### ----------------------------- ## preparations ----------------------- source("packages.r") ## case study 1: map breweries in Germany ------- ## goal # get list of breweries in Germany # import list in R # geolocate breweries #...
myString <- "Hello" print(myString)
/Intro-to-R/variable.R
no_license
nazaninsbr/Introduction-to-Selection
R
false
false
35
r
myString <- "Hello" print(myString)
# #function for recursive forecasting by a model that uses the standard R predict() function # forec_recursive_ar_model = function(model, x, lag, h) { # pred = t(tail(x, lag)) # for (i in 1:h) { # cp = predict(model, t(rev(tail(as.vector(pred),lag))) ) # pred = t(c(pred, cp)) # } # tail(as.vector(pred),...
/src/nl_models.R
no_license
valeman/paper-global-forec-princip
R
false
false
6,083
r
# #function for recursive forecasting by a model that uses the standard R predict() function # forec_recursive_ar_model = function(model, x, lag, h) { # pred = t(tail(x, lag)) # for (i in 1:h) { # cp = predict(model, t(rev(tail(as.vector(pred),lag))) ) # pred = t(c(pred, cp)) # } # tail(as.vector(pred),...
source("main.R") par(mfrow=c(2,2)) with(dataFeb, {plot(strptime(paste(Date,Time), "%d/%m/%Y %H:%M:%S"), as.numeric(Global_active_power), type = "l", xlab="", ylab="Global Active Power"); plot(strptime(paste(Date,Time), "%d/%m/%Y %H:%M:%S"), as.numeric(Voltage), type = "l", xlab="datetime", ylab="Voltage"); ...
/plot4.R
no_license
pjporrino/ExData_Plotting1
R
false
false
1,027
r
source("main.R") par(mfrow=c(2,2)) with(dataFeb, {plot(strptime(paste(Date,Time), "%d/%m/%Y %H:%M:%S"), as.numeric(Global_active_power), type = "l", xlab="", ylab="Global Active Power"); plot(strptime(paste(Date,Time), "%d/%m/%Y %H:%M:%S"), as.numeric(Voltage), type = "l", xlab="datetime", ylab="Voltage"); ...
##-------------------------------------------- ## ## Lecture 9 R methods ## ## Class: PCE Data Science Methods Class ## ## Subject: Natural Langauge Processing ## ##-------------------------------------------- setwd('/home/nick/Documents/teaching/DataScience350/8_NLP') ##-----Load Libraries----- library(tm) library(...
/8_NLP/R_Examples_Lecture8.R
no_license
iswaryam/DataScience350
R
false
false
13,481
r
##-------------------------------------------- ## ## Lecture 9 R methods ## ## Class: PCE Data Science Methods Class ## ## Subject: Natural Langauge Processing ## ##-------------------------------------------- setwd('/home/nick/Documents/teaching/DataScience350/8_NLP') ##-----Load Libraries----- library(tm) library(...
#' @title Title #' #' @description Description #' #' @param x A number. #' @param y A number. #' @return return value here. #' @details #' Additional details here #' @examples #' example function call here #' @export vital_births_calculate_new<-function(dat,at){ #Description: calculate number of new births/additions ...
/pkg/R/vital_births_calculate_new.R
no_license
RodrigoAnderle/EvoNetHIV
R
false
false
4,585
r
#' @title Title #' #' @description Description #' #' @param x A number. #' @param y A number. #' @return return value here. #' @details #' Additional details here #' @examples #' example function call here #' @export vital_births_calculate_new<-function(dat,at){ #Description: calculate number of new births/additions ...
## Only run examples in interactive R sessions if (interactive()) { ui <- fluidPage( p("The checkbox group controls the select input"), checkboxGroupInput("inCheckboxGroup", "Input checkbox", c("Item A", "Item B", "Item C")), selectInput("inSelect", "Select input", ...
/trial/testSelectInputDynamic.R
no_license
ybkamaleri/traume
R
false
false
864
r
## Only run examples in interactive R sessions if (interactive()) { ui <- fluidPage( p("The checkbox group controls the select input"), checkboxGroupInput("inCheckboxGroup", "Input checkbox", c("Item A", "Item B", "Item C")), selectInput("inSelect", "Select input", ...
#' Creates a configuration file for the user's cluster setup. #' #' @param fileName Cluster settings file name #' @return The request to the Batch service was successful. #' @examples { #' generateClusterConfig("test_config.json") #' generateClusterConfig("test_config.json") #' } #' #' @export generateClusterConfig <- ...
/R/cluster.R
permissive
zerweck/doAzureParallel
R
false
false
17,669
r
#' Creates a configuration file for the user's cluster setup. #' #' @param fileName Cluster settings file name #' @return The request to the Batch service was successful. #' @examples { #' generateClusterConfig("test_config.json") #' generateClusterConfig("test_config.json") #' } #' #' @export generateClusterConfig <- ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{Geno} \alias{Geno} \title{Genotype matrix of 78 individuals and 100 SNP markers} \format{ A character matrix. Each row represents an individual and columns contain the genotypes for individuals in a "two-column" fo...
/man/Geno.Rd
permissive
eriqande/gscramble
R
false
true
1,304
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{Geno} \alias{Geno} \title{Genotype matrix of 78 individuals and 100 SNP markers} \format{ A character matrix. Each row represents an individual and columns contain the genotypes for individuals in a "two-column" fo...
# BEMTOOL - Bio-Economic Model TOOLs # Authors: G. Lembo, I. Bitetto, M.T. Facchini, M.T. Spedicato 2013 # COISPA Tecnologia & Ricerca, Via dei Trulli 18/20 - (Bari), Italy # In case of use of the model, the Authors should be cited. # If you have any comments or suggestions please contact the following e-mail address:...
/BEMTOOL-ver2.5-2018_0901/off-line Stock Assessment tools/XSA/XSA_BEMTOOL/scripts/Ref_points_BEMTOOL.r
no_license
gresci/BEMTOOL2.5
R
false
false
2,383
r
# BEMTOOL - Bio-Economic Model TOOLs # Authors: G. Lembo, I. Bitetto, M.T. Facchini, M.T. Spedicato 2013 # COISPA Tecnologia & Ricerca, Via dei Trulli 18/20 - (Bari), Italy # In case of use of the model, the Authors should be cited. # If you have any comments or suggestions please contact the following e-mail address:...
rm(list=ls()) library(phytools) setwd("~/Dropbox/FCU/Teaching/Mentoring/2017Spring/YiWeiHsu/Rcode/main.code/micezhangdataset/") load("realtree.RData") y5<-list(phy3=phy3, phy4=phy4) class(y5) <- "multiPhylo" contree5<-ls.consensus(y5,tol=1e-3) save.image("contree5.RData")
/micezhangdataset/contree5.r
no_license
djhwueng/OUsnp
R
false
false
274
r
rm(list=ls()) library(phytools) setwd("~/Dropbox/FCU/Teaching/Mentoring/2017Spring/YiWeiHsu/Rcode/main.code/micezhangdataset/") load("realtree.RData") y5<-list(phy3=phy3, phy4=phy4) class(y5) <- "multiPhylo" contree5<-ls.consensus(y5,tol=1e-3) save.image("contree5.RData")
\name{m6Aexpress} \alias{m6Aexpress} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Predicting context-specific m6A regulation of gene expression } \description{ The package is designed to predict genes whose expressions are regulaed by m6A methylation based on a negative binomial regress...
/man/m6A_express.Rd
no_license
Yufei-Huang-Lab/m6Aexpress
R
false
false
12,802
rd
\name{m6Aexpress} \alias{m6Aexpress} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Predicting context-specific m6A regulation of gene expression } \description{ The package is designed to predict genes whose expressions are regulaed by m6A methylation based on a negative binomial regress...
cat("Goodbye, World!\n")
/Task/Hello-world-Text/R/hello-world-text.r
no_license
vmakovsky/RosettaCodeData
R
false
false
26
r
cat("Goodbye, World!\n")
testlist <- list(mu = 1.38553270466618e-134, var = 1.38553270466618e-134) result <- do.call(metafolio:::est_beta_params,testlist) str(result)
/metafolio/inst/testfiles/est_beta_params/libFuzzer_est_beta_params/est_beta_params_valgrind_files/1612988323-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
141
r
testlist <- list(mu = 1.38553270466618e-134, var = 1.38553270466618e-134) result <- do.call(metafolio:::est_beta_params,testlist) str(result)
library(testthat) library(keyrateduration) test_check("keyrateduration")
/tests/testthat.R
no_license
wkapga/keyrateduration
R
false
false
74
r
library(testthat) library(keyrateduration) test_check("keyrateduration")
######################################################################### SUBCLUSTERING #Download the processed Seurat R object, "Processed_invitro_seurat.Rdata" from GEO, #obtainable from here: https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE134174 #Then load the object it contains ("T15_int") into the session....
/3_PopulationSubsetAnalyses/4_RareCellAnalysis/1_ClusteringAndDifferentialExpression.r
no_license
seiboldlab/SingleCell_smoking
R
false
false
13,330
r
######################################################################### SUBCLUSTERING #Download the processed Seurat R object, "Processed_invitro_seurat.Rdata" from GEO, #obtainable from here: https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE134174 #Then load the object it contains ("T15_int") into the session....
#' @include internal.R Constraint-proto.R intersecting_units.R NULL #' Add locked in constraints #' #' Add constraints to ensure that they are prioritized in the solution. #' For example, it may be desirable to lock in planning units that are #' inside existing protected areas so that the solution fills in the gaps in...
/R/add_locked_in_constraints.R
no_license
l5d1l5/prioritizr
R
false
false
7,758
r
#' @include internal.R Constraint-proto.R intersecting_units.R NULL #' Add locked in constraints #' #' Add constraints to ensure that they are prioritized in the solution. #' For example, it may be desirable to lock in planning units that are #' inside existing protected areas so that the solution fills in the gaps in...
#' Sum the sequences that belong to the same taxon. #' #' @param count.table The count table containing the quantification for each sequence. #' @param taxonomy The taxonomic assignment produced by TAG.ME. #' @param level The The taxon level to be summarized. Values are: "Domain", "Phylum", "Class", "Order", "Family", ...
/R/summarizebylevel.R
no_license
gabrielrfernandes/tagme
R
false
false
1,957
r
#' Sum the sequences that belong to the same taxon. #' #' @param count.table The count table containing the quantification for each sequence. #' @param taxonomy The taxonomic assignment produced by TAG.ME. #' @param level The The taxon level to be summarized. Values are: "Domain", "Phylum", "Class", "Order", "Family", ...
#' Setup your api token, incoming webhook, channels #' #' @param upload_api_token file:upload token #' @param upload_image_channel alternative channel for uploading plot, default #random #' @param incoming_webhook_url incoming webhook for posting notification #' @param sent_channel will post notification to this channe...
/R/slackeonnier_setup.R
no_license
HongYanHuang/slackeonnier
R
false
false
1,029
r
#' Setup your api token, incoming webhook, channels #' #' @param upload_api_token file:upload token #' @param upload_image_channel alternative channel for uploading plot, default #random #' @param incoming_webhook_url incoming webhook for posting notification #' @param sent_channel will post notification to this channe...
#Spearman footrule spearman_footrule <- function(ranks_i, ranks_j) { distance = sum(abs(ranks_i - ranks_j)) return(distance) } #takes a ranked matrix, returns spearman footrule distance between columns spearman_footrule_matrix <- function(matrix){ return(apply(X = matrix,...
/libraries/functions_spearman.R
permissive
saisaitian/AntiInflammation_Drugs
R
false
false
425
r
#Spearman footrule spearman_footrule <- function(ranks_i, ranks_j) { distance = sum(abs(ranks_i - ranks_j)) return(distance) } #takes a ranked matrix, returns spearman footrule distance between columns spearman_footrule_matrix <- function(matrix){ return(apply(X = matrix,...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/createDynamicLayersRSF.R, % R/createStaticLayersRSF.R \name{createDynamicLayersRSF} \alias{createDynamicLayersRSF} \alias{createStaticLayersRSF} \title{createDynamicLayerRSF creates the necessary layers for predictive caribou RSF module. It...
/man/createDynamicLayersRSF.Rd
no_license
eliotmcintire/usefun
R
false
true
2,705
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/createDynamicLayersRSF.R, % R/createStaticLayersRSF.R \name{createDynamicLayersRSF} \alias{createDynamicLayersRSF} \alias{createStaticLayersRSF} \title{createDynamicLayerRSF creates the necessary layers for predictive caribou RSF module. It...
#' Draws lollipop plot of amino acid changes on to Protein structure. #' #' @description Draws lollipop plot of amino acid changes. #' @details This function by default looks for fields 'HGVSp_Short', 'AAChange' or 'Protein_Change' in maf file. One can also manually specify field name containing amino acid changes. #' ...
/R/lollipopPlot.R
permissive
lybird300/maftools
R
false
false
17,473
r
#' Draws lollipop plot of amino acid changes on to Protein structure. #' #' @description Draws lollipop plot of amino acid changes. #' @details This function by default looks for fields 'HGVSp_Short', 'AAChange' or 'Protein_Change' in maf file. One can also manually specify field name containing amino acid changes. #' ...
# Principle Component Analysis of 2012 Participant Attitudes and Behavior study # Working with cleaned up original data in 2012 Research folder saved as CSV for easier importing ##### BEGIN DATA MUNGING ##### # This data is trimmed to exclude all non-questions; the original file is PAB2012_orig.csv pab.orig <- read...
/PartAttitudeBehavior2012.R
no_license
lenexajayhawk/R-Scripts
R
false
false
9,795
r
# Principle Component Analysis of 2012 Participant Attitudes and Behavior study # Working with cleaned up original data in 2012 Research folder saved as CSV for easier importing ##### BEGIN DATA MUNGING ##### # This data is trimmed to exclude all non-questions; the original file is PAB2012_orig.csv pab.orig <- read...
#___________________________________________________________________________________________________________________________________ # 1.) This is an example workflow that retrieves addresses from OpenAddresses.io, and plots housing density in Portland, Oregon. # 2.) This is an example workflow that retrieves addresse...
/Geospatial_Analysis/Mapping.R
no_license
jbowers85/Data-Scientist-Tool-Belt
R
false
false
7,659
r
#___________________________________________________________________________________________________________________________________ # 1.) This is an example workflow that retrieves addresses from OpenAddresses.io, and plots housing density in Portland, Oregon. # 2.) This is an example workflow that retrieves addresse...
##' .. content for \description{} (no empty lines) .. ##' ##' .. content for \details{} .. ##' ##' @title ##' @param stachelek_loh ##' @return ##' @author whtns ##' @export tabulate_stachelek_loh <- function(stachelek_loh) { stachelek_loh %>% plyranges::bind_ranges() %>% tibble::as_tibble() %>% ...
/R/tabulate_stachelek_loh.R
no_license
cobriniklab/rb_exome
R
false
false
413
r
##' .. content for \description{} (no empty lines) .. ##' ##' .. content for \details{} .. ##' ##' @title ##' @param stachelek_loh ##' @return ##' @author whtns ##' @export tabulate_stachelek_loh <- function(stachelek_loh) { stachelek_loh %>% plyranges::bind_ranges() %>% tibble::as_tibble() %>% ...
#### 1. Named vector of hex codes for the corporate colors -------------------------------- # Create a named vector of corporate colors # wom colors wom_colors <- c( `blue` = "#007bff", `indigo` = "#6610f2", `purple` = "#6f42c1", `pink` = "#e83e8c", `red` = "#dc3545", `orange` = ...
/R/wom_palettes.R
no_license
emilelatour/laviz
R
false
false
7,662
r
#### 1. Named vector of hex codes for the corporate colors -------------------------------- # Create a named vector of corporate colors # wom colors wom_colors <- c( `blue` = "#007bff", `indigo` = "#6610f2", `purple` = "#6f42c1", `pink` = "#e83e8c", `red` = "#dc3545", `orange` = ...
# Define vaccine characteristics vaccine_names <- c("pf", "az", "none") # key sources from July 2021 # EU: https://www.ecdc.europa.eu/sites/default/files/documents/Partial%20COVID%20vaccination%20and%20heterologous%20vacc%20schedule%20-%2022%20July%202021.pdf # NEJM: https://www.nejm.org/doi/full/10.1056/NEJMoa210889...
/data-raw/define-vaccine-characteristics.R
permissive
grattan/covidReff
R
false
false
962
r
# Define vaccine characteristics vaccine_names <- c("pf", "az", "none") # key sources from July 2021 # EU: https://www.ecdc.europa.eu/sites/default/files/documents/Partial%20COVID%20vaccination%20and%20heterologous%20vacc%20schedule%20-%2022%20July%202021.pdf # NEJM: https://www.nejm.org/doi/full/10.1056/NEJMoa210889...
library(psych) # setting up a population in which gre.q is positively related to gpa population.N <- 10000 #smallish so my laptop can do this sample.size.in.each.simulated.study <- 20 r.AC.gre.v <- 0.8 r.AC.gre.q <- 0.5 # true.slope <- 0 # AC below stands for "academic competence" AC <- rnorm(n=population.N,mean=0,sd=1...
/Creating a Data Set (02:05).R
no_license
tejepo/R-Workshop
R
false
false
5,803
r
library(psych) # setting up a population in which gre.q is positively related to gpa population.N <- 10000 #smallish so my laptop can do this sample.size.in.each.simulated.study <- 20 r.AC.gre.v <- 0.8 r.AC.gre.q <- 0.5 # true.slope <- 0 # AC below stands for "academic competence" AC <- rnorm(n=population.N,mean=0,sd=1...
# create dendogram # using hierarchical clustering and Euclidean distance x <- matrix(with(CD.data, c( parent.mean.income, beta.slope, beta.intercept, rank.slope, rank.intercept, rank.shar...
/Analysis/Text-Figure-Dendrogram.R
no_license
milescorak/The-Canadian-Geography-of-Intergenerational-Income-Mobility
R
false
false
1,582
r
# create dendogram # using hierarchical clustering and Euclidean distance x <- matrix(with(CD.data, c( parent.mean.income, beta.slope, beta.intercept, rank.slope, rank.intercept, rank.shar...
#PUNTO 1 hist ( x = COVID_19$'Age of Subject' , main = "Histograma Age of Subject - COVID-19" , xlab = "Edad", ylab = "Cantidad de Personas", col = "red") #PUNTO 2 data.frame(COVID_19) COVIDFiltrada= filter(COVID_19, `Region of residence`== "Delhi-NCR") View(COVIDFiltra...
/Quiz 1 Tatiana Castro.R
no_license
tcastrop/Practica-1-Tatiana-Castro
R
false
false
847
r
#PUNTO 1 hist ( x = COVID_19$'Age of Subject' , main = "Histograma Age of Subject - COVID-19" , xlab = "Edad", ylab = "Cantidad de Personas", col = "red") #PUNTO 2 data.frame(COVID_19) COVIDFiltrada= filter(COVID_19, `Region of residence`== "Delhi-NCR") View(COVIDFiltra...
library(randomForest) a <- 10 #b <- 20 result <- a + b print(result) .1<-109 a-b<-10 x <- c(1,2,3) #1차원 행렬 x_r <- mean(x <- c(1,2,3)) #'=' 표시 사용 시 변수 값 인식이 되지 않음 y_r <- mean(y=c(1,2,3)) af <- function(a1, a2, a3, a4){ v1 <- a1; v2 <- a2; v3 <- a3; v4 <- a4; result <- v1+v2+v3+v4; return(result); }
/R source/day01/r1.R
no_license
nanayunn/R
R
false
false
351
r
library(randomForest) a <- 10 #b <- 20 result <- a + b print(result) .1<-109 a-b<-10 x <- c(1,2,3) #1차원 행렬 x_r <- mean(x <- c(1,2,3)) #'=' 표시 사용 시 변수 값 인식이 되지 않음 y_r <- mean(y=c(1,2,3)) af <- function(a1, a2, a3, a4){ v1 <- a1; v2 <- a2; v3 <- a3; v4 <- a4; result <- v1+v2+v3+v4; return(result); }
## Reads a data set from a file and combines subjects and activities, and names the variables readAndCombineDataSet <- function(dataFile, subjectFile, activityFile, featuresFile) { data <- read.table(dataFile) subjects <- read.table(subjectFile) activities <- read.table(activityFile) features <- read.ta...
/run_analysis.R
no_license
ccinf/GettingCleaningData
R
false
false
4,409
r
## Reads a data set from a file and combines subjects and activities, and names the variables readAndCombineDataSet <- function(dataFile, subjectFile, activityFile, featuresFile) { data <- read.table(dataFile) subjects <- read.table(subjectFile) activities <- read.table(activityFile) features <- read.ta...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rutils.R \name{linept} \alias{linept} \title{linept adds a line and a series of points to a plot} \usage{ linept(x, y, lwd = 1, pch = 16, ...) } \arguments{ \item{x}{the x series of points} \item{y}{the corresponding y series of points} \it...
/man/linept.Rd
no_license
haddonm/rutilsMH
R
false
true
846
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rutils.R \name{linept} \alias{linept} \title{linept adds a line and a series of points to a plot} \usage{ linept(x, y, lwd = 1, pch = 16, ...) } \arguments{ \item{x}{the x series of points} \item{y}{the corresponding y series of points} \it...
## downloading and unpacking zipFileUrl <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" download.file(zipFileUrl, destfile="Dataset.zip", mode="wb") unzip(zipfile = "Dataset.zip") ## reading into R and subsetting probadata <- read.table("./household_power_consumption.txt", he...
/plot4.R
no_license
nravinskaya/ExData_Plotting1
R
false
false
1,343
r
## downloading and unpacking zipFileUrl <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" download.file(zipFileUrl, destfile="Dataset.zip", mode="wb") unzip(zipfile = "Dataset.zip") ## reading into R and subsetting probadata <- read.table("./household_power_consumption.txt", he...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/findintercorr_cont_nb.R \name{findintercorr_cont_nb} \alias{findintercorr_cont_nb} \title{Calculate Intermediate MVN Correlation for Continuous - Negative Binomial Variables: Correlation Method 1} \usage{ findintercorr_cont_nb(method, constan...
/man/findintercorr_cont_nb.Rd
no_license
shaoyoucheng/SimMultiCorrData
R
false
true
3,541
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/findintercorr_cont_nb.R \name{findintercorr_cont_nb} \alias{findintercorr_cont_nb} \title{Calculate Intermediate MVN Correlation for Continuous - Negative Binomial Variables: Correlation Method 1} \usage{ findintercorr_cont_nb(method, constan...
library(formattable) reduced_indicators_year <- read.csv("indicator_list_agg_year.csv", stringsAsFactors = FALSE) # Efficiency Efficiency_year_district <- reduced_indicators_year %>% filter(KPI == "Average days taken for bid evaluation" | KPI == "Number of tenders concluded after validity days") %>% gr...
/comparators_years_grouped.R
permissive
preethical/Procurements_exploratory
R
false
false
2,436
r
library(formattable) reduced_indicators_year <- read.csv("indicator_list_agg_year.csv", stringsAsFactors = FALSE) # Efficiency Efficiency_year_district <- reduced_indicators_year %>% filter(KPI == "Average days taken for bid evaluation" | KPI == "Number of tenders concluded after validity days") %>% gr...
################################################################ ### THIS FILE CONTAINS CODE TO DRAW A CUSTOMIZED SCATTER PLOT. ################################################################ amet_base <- Sys.getenv("AMETBASE") dbase <- Sys.getenv("AMET_DATABASE") out_dir <- Sys.getenv("AMET_OUT")...
/R_analysis_code/batch_scripts/Run_Time_Plots_All_Batch.R
permissive
CEMPD/AMET
R
false
false
20,914
r
################################################################ ### THIS FILE CONTAINS CODE TO DRAW A CUSTOMIZED SCATTER PLOT. ################################################################ amet_base <- Sys.getenv("AMETBASE") dbase <- Sys.getenv("AMET_DATABASE") out_dir <- Sys.getenv("AMET_OUT")...
# best() best <- function(state, outcome) { library(dplyr) library(magrittr) file_path <- "~/hospital_data/outcome-of-care-measures.csv" outcome_of_care_measures <- read.csv(file_path, stringsAsFactors = FALSE) outcome_col_idx <- c(11, 17, 23) for (i in outcome_col_idx) { outcome_of_care_measures[, i...
/jhu_rprg_week4/best.R
no_license
yychuang/datainpoint
R
false
false
1,001
r
# best() best <- function(state, outcome) { library(dplyr) library(magrittr) file_path <- "~/hospital_data/outcome-of-care-measures.csv" outcome_of_care_measures <- read.csv(file_path, stringsAsFactors = FALSE) outcome_col_idx <- c(11, 17, 23) for (i in outcome_col_idx) { outcome_of_care_measures[, i...
\name{race} \alias{race} \docType{data} \title{ Scottish Hill Racing data} \description{ The record-winning times for 35 hill races in Scotland, as reported by Atkinson (1986). } \usage{data(race)} \format{ data.frame } \details{ The distance travelled and the height climbed in each race is also give...
/man/race.Rd
no_license
hanase/BMA
R
false
false
960
rd
\name{race} \alias{race} \docType{data} \title{ Scottish Hill Racing data} \description{ The record-winning times for 35 hill races in Scotland, as reported by Atkinson (1986). } \usage{data(race)} \format{ data.frame } \details{ The distance travelled and the height climbed in each race is also give...
context("convert_motifs()") test_that("motif conversion works", { m <- matrix(rep(0.25, 16), nrow = 4) rownames(m) <- c("A", "C", "G", "T") mm <- convert_motifs(m) expect_equal(mm@alphabet, "DNA") })
/tests/testthat/test_convert_motifs.R
no_license
bjmt/universalmotif
R
false
false
212
r
context("convert_motifs()") test_that("motif conversion works", { m <- matrix(rep(0.25, 16), nrow = 4) rownames(m) <- c("A", "C", "G", "T") mm <- convert_motifs(m) expect_equal(mm@alphabet, "DNA") })
allowed_files = c("HW3.Rmd", "HW3.pdf", "nes5200_processed_voters_realideo.dta", "README.md", "HW3_whitelist.R", "wercker.yml") files = dir() disallowed_files = files[!(files %in% allowed_files)] if (length(disallowed_files != 0...
/HW3_whitelist.R
no_license
STA521-S17/HW3
R
false
false
506
r
allowed_files = c("HW3.Rmd", "HW3.pdf", "nes5200_processed_voters_realideo.dta", "README.md", "HW3_whitelist.R", "wercker.yml") files = dir() disallowed_files = files[!(files %in% allowed_files)] if (length(disallowed_files != 0...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{county_typology_codes} \alias{county_typology_codes} \title{SC County Typology Codes} \format{ A data frame with 46 rows and 21 columns \describe{ \item{fip_stxt}{5-Digit FIPS Code} \item{state}{State} \item{county...
/man/county_typology_codes.Rd
permissive
tamilyn/dhomer
R
false
true
2,097
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{county_typology_codes} \alias{county_typology_codes} \title{SC County Typology Codes} \format{ A data frame with 46 rows and 21 columns \describe{ \item{fip_stxt}{5-Digit FIPS Code} \item{state}{State} \item{county...
### ### $Id: AllSCProgressMonitorGenerics.R 833 2014-06-27 16:17:07Z proebuck $ ### ## ## Accessors ## if (!isGeneric("progressStage")) { setGeneric("progressStage", function(object, ...) standardGeneric("progressStage")) } if (!isGeneric("progressMarquee")) { setGeneric("progressMarquee", ...
/R/AllSCProgressMonitorGenerics.R
no_license
rmylonas/SuperCurvePAF
R
false
false
723
r
### ### $Id: AllSCProgressMonitorGenerics.R 833 2014-06-27 16:17:07Z proebuck $ ### ## ## Accessors ## if (!isGeneric("progressStage")) { setGeneric("progressStage", function(object, ...) standardGeneric("progressStage")) } if (!isGeneric("progressMarquee")) { setGeneric("progressMarquee", ...
# wine data wine = read.csv("wine.csv") # to view structure of data str(wine) # to view summary of data summary(wine) # linear regression model by one dependent-variable/predictor/regressor AGST model1 = lm(Price ~ AGST, data=wine) # summary of linear model1 summary(model1) # linear model residuals m...
/Predict Wine Prices/R code.R
no_license
gbajsingh/Predictive-analysis-in-R
R
false
false
2,080
r
# wine data wine = read.csv("wine.csv") # to view structure of data str(wine) # to view summary of data summary(wine) # linear regression model by one dependent-variable/predictor/regressor AGST model1 = lm(Price ~ AGST, data=wine) # summary of linear model1 summary(model1) # linear model residuals m...
setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f"))) source('../../h2o-runit.R') # Test PCA on prostate.csv test.pca.prostate <- function(conn) { Log.info("Importing prostate.csv data...\n") prostate.hex <- h2o.uploadFile(conn, locate("smalldata/logreg/prostate.csv")) Log.info("Converting CA...
/h2o-r/tests/testdir_algos/pca/runit_pca_prostate.R
permissive
herberteuler/h2o-3
R
false
false
1,249
r
setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f"))) source('../../h2o-runit.R') # Test PCA on prostate.csv test.pca.prostate <- function(conn) { Log.info("Importing prostate.csv data...\n") prostate.hex <- h2o.uploadFile(conn, locate("smalldata/logreg/prostate.csv")) Log.info("Converting CA...
la.simu.gen <- function(n, p, n.grp,n.noise.gene, rho, pwr) { la.simu.one.group<-function(n, p, rho=0.5, pwr=0.5, sub.grps=10) { p<-p/sub.grps #z<-rnorm(n) #z<-sort(z) #z<-(z-min(z))/((max(z)-min(z))) #z<-(z-0.5)*1.98 z<-runif(n,min=-1, max=1) ...
/R/la.simu.gen.R
no_license
cran/DCA
R
false
false
1,390
r
la.simu.gen <- function(n, p, n.grp,n.noise.gene, rho, pwr) { la.simu.one.group<-function(n, p, rho=0.5, pwr=0.5, sub.grps=10) { p<-p/sub.grps #z<-rnorm(n) #z<-sort(z) #z<-(z-min(z))/((max(z)-min(z))) #z<-(z-0.5)*1.98 z<-runif(n,min=-1, max=1) ...
#' Estimate cell type proportions using first PC of expression matrix #' #' @param x A sample by gene bulk expression matrix. Genes should be marker #' genes #' @param weighted Boolean. If weighted=TRUE, multiply scaled gene expression by #' gene weights #' @param w Numeric vector. Weights of genes #' @return ret...
/R/marker_based.R
no_license
marcalva/bisque
R
false
false
16,238
r
#' Estimate cell type proportions using first PC of expression matrix #' #' @param x A sample by gene bulk expression matrix. Genes should be marker #' genes #' @param weighted Boolean. If weighted=TRUE, multiply scaled gene expression by #' gene weights #' @param w Numeric vector. Weights of genes #' @return ret...
# ---------------------------------------------------------------------------- # # errorCheckObsFiles.R # Date Created: 2011-09-06 # Author: JBL # edited by: KColeman # # Description: This program checks the pilot and observer observation files # for errors and outputs them to a .csv file. # --------------------------...
/_Rfunctions/errorCheckObsFiles.R
no_license
robgf/AMAPPS
R
false
false
14,299
r
# ---------------------------------------------------------------------------- # # errorCheckObsFiles.R # Date Created: 2011-09-06 # Author: JBL # edited by: KColeman # # Description: This program checks the pilot and observer observation files # for errors and outputs them to a .csv file. # --------------------------...
myfunc = function(){ return(c(1,2,3,4,5,6,7,8,9,10)) } myfunc()
/estagio/estagio/base/teste.r
permissive
Dturati/projetoUFMT
R
false
false
66
r
myfunc = function(){ return(c(1,2,3,4,5,6,7,8,9,10)) } myfunc()
# freeze 4 field lists (freeze 5 uses config file - see config-tools.R)--------- #' define lists of fields in one place, and return based on argument #' @noRd .get_list <- function(which_list) { # fr_4_snv_desired------------------------------------------------------------ if (which_list == "fr_4_snv_desired"){ ...
/R/field-lists.R
no_license
zhouhufeng/wgsaparsr
R
false
false
25,328
r
# freeze 4 field lists (freeze 5 uses config file - see config-tools.R)--------- #' define lists of fields in one place, and return based on argument #' @noRd .get_list <- function(which_list) { # fr_4_snv_desired------------------------------------------------------------ if (which_list == "fr_4_snv_desired"){ ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/explorer.R \name{explorer} \alias{explorer} \title{Create an interactive codebook} \usage{ explorer(data = NULL, addEnv = TRUE, demo = FALSE) } \arguments{ \item{data}{A list of (optionally named) data frames. Also accepts a character vector ...
/man/explorer.Rd
permissive
radovankavicky/codebook
R
false
true
883
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/explorer.R \name{explorer} \alias{explorer} \title{Create an interactive codebook} \usage{ explorer(data = NULL, addEnv = TRUE, demo = FALSE) } \arguments{ \item{data}{A list of (optionally named) data frames. Also accepts a character vector ...
# Clean the System & Console Variable -------------------- rm(list = ls()) cat("\014") options(warn = -1) # Just to make it reproducible # set.seed(10147153) # Set the System Path & Variable & Output Directory Name if (require('here') == FALSE){ install.packages('here') library(here) } #Install & Use Library i...
/RegressionQuestion.R
no_license
metinuslu/QuantileRegressionModels
R
false
false
4,243
r
# Clean the System & Console Variable -------------------- rm(list = ls()) cat("\014") options(warn = -1) # Just to make it reproducible # set.seed(10147153) # Set the System Path & Variable & Output Directory Name if (require('here') == FALSE){ install.packages('here') library(here) } #Install & Use Library i...
#' Export DArT genlight object \{adegenet\} to faststructure format (to run faststructure elsewhere) #' #' Recodes in the quite specific faststructure format (e.g first six columns need to be there, but are ignored...check faststructure documentation (if you find any :-( ))) #' #' The script writes out the a file in f...
/R/gl2faststructure.r
no_license
hakancengiz1/dartR
R
false
false
1,636
r
#' Export DArT genlight object \{adegenet\} to faststructure format (to run faststructure elsewhere) #' #' Recodes in the quite specific faststructure format (e.g first six columns need to be there, but are ignored...check faststructure documentation (if you find any :-( ))) #' #' The script writes out the a file in f...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Hpo_test.r \name{thr.test} \alias{thr.test} \title{Threshold Nonlinearity Test} \usage{ thr.test(y, p = 1, d = 1, thrV = NULL, ini = 40, include.mean = T) } \arguments{ \item{y}{a time seris.} \item{p}{AR order.} \item{d}{delay...
/man/thr.test.Rd
no_license
ConvFuncTimeSeries/test3
R
false
true
1,103
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Hpo_test.r \name{thr.test} \alias{thr.test} \title{Threshold Nonlinearity Test} \usage{ thr.test(y, p = 1, d = 1, thrV = NULL, ini = 40, include.mean = T) } \arguments{ \item{y}{a time seris.} \item{p}{AR order.} \item{d}{delay...
##### Simulation study for evaluating the LD effects on LSMM ##### # Figure S44 in Supplementary Document ####### prepare ########## # quality control system("plink --bfile ctrl --geno 0.01 --mind 0.05 --hwe 0.001 --maf 0.05 --make-bed --out ctrlqc") # use only SNPs in CHR 1 system("plink --bfile ctrlqc --c...
/LD.R
no_license
mingjingsi/sim-LSMM
R
false
false
7,244
r
##### Simulation study for evaluating the LD effects on LSMM ##### # Figure S44 in Supplementary Document ####### prepare ########## # quality control system("plink --bfile ctrl --geno 0.01 --mind 0.05 --hwe 0.001 --maf 0.05 --make-bed --out ctrlqc") # use only SNPs in CHR 1 system("plink --bfile ctrlqc --c...
## quadeAllPairsTest.R ## ## Copyright (C) 2015-2019 Thorsten Pohlert ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 3 of the License, or ## (at your option) any late...
/R/quadeAllPairsTest.R
no_license
pociuteagne/PMCMRplus
R
false
false
8,310
r
## quadeAllPairsTest.R ## ## Copyright (C) 2015-2019 Thorsten Pohlert ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 3 of the License, or ## (at your option) any late...
#' Flatten and unflatten BibEntry objects #' #' \code{RelistBibEntry} unflattens a BibEntry object that has been #' flattened with \code{unlist}. #' @param flesh list; an \code{unlist}ed BibEntry object #' @param skeleton currently ignored #' @details \code{RelistBibEntry} is only intended for use with #' \code{...
/R/relist.R
no_license
cran/RefManageR
R
false
false
1,671
r
#' Flatten and unflatten BibEntry objects #' #' \code{RelistBibEntry} unflattens a BibEntry object that has been #' flattened with \code{unlist}. #' @param flesh list; an \code{unlist}ed BibEntry object #' @param skeleton currently ignored #' @details \code{RelistBibEntry} is only intended for use with #' \code{...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/data.R \name{download_dietswap} \alias{download_dietswap} \title{Download Diet Swap Study} \usage{ download_dietswap(...) } \arguments{ \item{...}{Arguments to be passed} } \value{ Data set } \description{ Download Diet Swap Study } \...
/man/download_dietswap.Rd
no_license
hjanime/microbiome
R
false
false
583
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/data.R \name{download_dietswap} \alias{download_dietswap} \title{Download Diet Swap Study} \usage{ download_dietswap(...) } \arguments{ \item{...}{Arguments to be passed} } \value{ Data set } \description{ Download Diet Swap Study } \...
## Coursera ## Exploratory Data Analysis ## Course Project 1 - plot2.R ## set working directory setwd("~/Data Science/Assignments/electric_power") ## creating a data directory if (!file.exists("data")) { dir.create("data") } ## download a file and place in "data" directory if (!file.exists("data/UCIML")) { ...
/plot2.R
no_license
ealmand/ExplDataAnalysis
R
false
false
1,479
r
## Coursera ## Exploratory Data Analysis ## Course Project 1 - plot2.R ## set working directory setwd("~/Data Science/Assignments/electric_power") ## creating a data directory if (!file.exists("data")) { dir.create("data") } ## download a file and place in "data" directory if (!file.exists("data/UCIML")) { ...
# This function extract Argo profiles based on user input criterium # # Arguments (in) : # # Value (out) : # * A dataframe with columns : # - value # - qc # - alevel : the index of the Argo Level # - depth : the depth [m] # - aprofile : the index of the profile # ...
/Cases/OMI/ArgoSelect_CMEMS.R
no_license
MAST-ULiege/ArgoDiva
R
false
false
4,260
r
# This function extract Argo profiles based on user input criterium # # Arguments (in) : # # Value (out) : # * A dataframe with columns : # - value # - qc # - alevel : the index of the Argo Level # - depth : the depth [m] # - aprofile : the index of the profile # ...
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function makeCacheMatrix <- function(x = matrix()) { } set <- function(y) { x <<- y inv <<- NULL } get <- function() x ## Write a short comment describing this function cache...
/cachematrix.R
no_license
LRCARNEIRO/ProgrammingAssignment2
R
false
false
404
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()) { } set <- function(y) { x <<- y inv <<- NULL } get <- function() x ## Write a short comment describing this function cache...
# Tom Alig # Nov 26, 2019 # Predictions # This file helped determine which model is best # DO NOT use this file in production library(tidyverse) library(lubridate) library(scales) library(hms) #library(lm) source("RunningProjectR/scripts/my_track_scripts.R") # Read in the data train99.df <- read.csv("RunningProjectR/...
/RunningProjectR/run-all.R/linear_reg.R
no_license
gilaum/Running_HS_Track_Guide
R
false
false
11,823
r
# Tom Alig # Nov 26, 2019 # Predictions # This file helped determine which model is best # DO NOT use this file in production library(tidyverse) library(lubridate) library(scales) library(hms) #library(lm) source("RunningProjectR/scripts/my_track_scripts.R") # Read in the data train99.df <- read.csv("RunningProjectR/...
library("data.table") setwd("C:/Users/Administrator/Desktop/CourseraRWorkingDirectory/data") #Reads in data from file then subsets data for specified dates powerDT <- data.table::fread(input = "household_power_consumption.txt" , na.strings="?" ) # Prevents Scientific Notation powerDT[, G...
/plot_2.R
no_license
ranvir81chauhan/Exploratory-Data-Analysis
R
false
false
885
r
library("data.table") setwd("C:/Users/Administrator/Desktop/CourseraRWorkingDirectory/data") #Reads in data from file then subsets data for specified dates powerDT <- data.table::fread(input = "household_power_consumption.txt" , na.strings="?" ) # Prevents Scientific Notation powerDT[, G...
context("utility functions") test_that("parallel.melt produces the expected data frame", { data(pocmajsum) # melt automatically pocmajlong <- parallel.melt(pocmajsum, id.vars=c("core", "depth"), value=c("Ca", "Ti", "V"), sd=c("Ca_sd", "Ti_sd", "V_sd"))...
/tests/testthat/test_utils.R
no_license
cran/mudata
R
false
false
1,475
r
context("utility functions") test_that("parallel.melt produces the expected data frame", { data(pocmajsum) # melt automatically pocmajlong <- parallel.melt(pocmajsum, id.vars=c("core", "depth"), value=c("Ca", "Ti", "V"), sd=c("Ca_sd", "Ti_sd", "V_sd"))...
rm(list=ls()) #install.packages("VGAM") #install.packages("mvtnorm") #install.packages("LaplacesDemon") #install.packages("cubature") #install.packages("rmutil") #library(VGAM) library(mvtnorm) library(LaplacesDemon) library(cubature) #library(rmutil) m_iteration = 1000 # number of random samples to obtain the optim...
/sim_pareto_stratify_08_v2.R
no_license
uuuujisu/UOS_Credit_Risk_code
R
false
false
9,363
r
rm(list=ls()) #install.packages("VGAM") #install.packages("mvtnorm") #install.packages("LaplacesDemon") #install.packages("cubature") #install.packages("rmutil") #library(VGAM) library(mvtnorm) library(LaplacesDemon) library(cubature) #library(rmutil) m_iteration = 1000 # number of random samples to obtain the optim...
library(ggplot2) zipFile <- "exdata%2Fdata%2FNEI_data.zip" unzip(zipFile, exdir="data") ## This first line will likely take a few seconds. Be patient! NEI <- readRDS("data\\summarySCC_PM25.rds") SCC <- readRDS("data\\Source_Classification_Code.rds") # Get coal related sources coalRelatedSources <- SCC[grep("Coal", S...
/plot4.R
no_license
NickUK/exploratory-data-analysis-2
R
false
false
789
r
library(ggplot2) zipFile <- "exdata%2Fdata%2FNEI_data.zip" unzip(zipFile, exdir="data") ## This first line will likely take a few seconds. Be patient! NEI <- readRDS("data\\summarySCC_PM25.rds") SCC <- readRDS("data\\Source_Classification_Code.rds") # Get coal related sources coalRelatedSources <- SCC[grep("Coal", S...
\name{minicaret-package} \alias{minicaret-package} \alias{minicaret} \docType{package} \title{ What the package does (short line) ~~ package title ~~ } \description{ More about what it does (maybe more than one line) ~~ A concise (1-5 lines) description of the package ~~ } \details{ \tabular{ll}{ Package: \tab minicare...
/man/minicaret-package.Rd
no_license
iben-mickrick/minicaret
R
false
false
1,041
rd
\name{minicaret-package} \alias{minicaret-package} \alias{minicaret} \docType{package} \title{ What the package does (short line) ~~ package title ~~ } \description{ More about what it does (maybe more than one line) ~~ A concise (1-5 lines) description of the package ~~ } \details{ \tabular{ll}{ Package: \tab minicare...
library(fastnet) ### Name: from.edgelist ### Title: Edgelist to 'fastnet' ### Aliases: from.edgelist ### ** Examples edgelist <- data.frame(from=c(1, 3, 2, 3, 3), to=c(4, 5, 6, 5, 7)) g <- from.edgelist(edgelist)
/data/genthat_extracted_code/fastnet/examples/from.edgelist.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
220
r
library(fastnet) ### Name: from.edgelist ### Title: Edgelist to 'fastnet' ### Aliases: from.edgelist ### ** Examples edgelist <- data.frame(from=c(1, 3, 2, 3, 3), to=c(4, 5, 6, 5, 7)) g <- from.edgelist(edgelist)
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/expressions.R \docType{methods} \name{expressions} \alias{!,CrunchExpr-method} \alias{\%in\%,CategoricalVariable,character-method} \alias{\%in\%,CategoricalVariable,factor-method} \alias{\%in\%,CategoricalVariable,numeric-method} \alias{\%in\...
/man/expressions.Rd
no_license
digideskio/rcrunch
R
false
true
2,067
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/expressions.R \docType{methods} \name{expressions} \alias{!,CrunchExpr-method} \alias{\%in\%,CategoricalVariable,character-method} \alias{\%in\%,CategoricalVariable,factor-method} \alias{\%in\%,CategoricalVariable,numeric-method} \alias{\%in\...
ch <- cotahist_get(Sys.Date() - 1, "daily") ch$HistoricalPrices |> filter(tipo_mercado %in% c(70, 80)) |> distinct(nome_empresa) |> mutate(FM = str_detect(nome_empresa, "\\bFM\\b")) ch$HistoricalPrices |> filter(tipo_mercado %in% c(70, 80)) |> head() f <- download_marketdata("COTAHIST_DAILY", refdate = Sy...
/examples/formador-mercado.R
permissive
ropensci/rb3
R
false
false
397
r
ch <- cotahist_get(Sys.Date() - 1, "daily") ch$HistoricalPrices |> filter(tipo_mercado %in% c(70, 80)) |> distinct(nome_empresa) |> mutate(FM = str_detect(nome_empresa, "\\bFM\\b")) ch$HistoricalPrices |> filter(tipo_mercado %in% c(70, 80)) |> head() f <- download_marketdata("COTAHIST_DAILY", refdate = Sy...
#' Run GW-Degree Shiny Application #' #' @return NULL Called for side-effect of launching shiny application #' @export #' #' @import ergm sna ggplot2 scales dplyr shiny shinydashboard #' @importFrom grDevices topo.colors #' @importFrom graphics plot #' #' @examples #' \dontrun{ #' gwdegree() #' } gwdegree <- function()...
/R/functions.R
no_license
xtmgah/gwdegree
R
false
false
2,942
r
#' Run GW-Degree Shiny Application #' #' @return NULL Called for side-effect of launching shiny application #' @export #' #' @import ergm sna ggplot2 scales dplyr shiny shinydashboard #' @importFrom grDevices topo.colors #' @importFrom graphics plot #' #' @examples #' \dontrun{ #' gwdegree() #' } gwdegree <- function()...
testlist <- list(b = 65791L) result <- do.call(mcga:::ByteVectorToDoubles,testlist) str(result)
/mcga/inst/testfiles/ByteVectorToDoubles/AFL_ByteVectorToDoubles/ByteVectorToDoubles_valgrind_files/1613105840-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
95
r
testlist <- list(b = 65791L) result <- do.call(mcga:::ByteVectorToDoubles,testlist) str(result)
# Start by installing and loading 'devtools' package, which is needed to instal the 'rlpi' package from GitHub install.packages("devtools") library(devtools) # Install from main ZSL repository online #install_github("Zoological-Society-of-London/rlpi", dependencies=TRUE) # Load the 'rlpi' package library(rlpi) # Open...
/Cloud Simulations/RandomDrift.R
permissive
falko-buschke/LPI
R
false
false
41,343
r
# Start by installing and loading 'devtools' package, which is needed to instal the 'rlpi' package from GitHub install.packages("devtools") library(devtools) # Install from main ZSL repository online #install_github("Zoological-Society-of-London/rlpi", dependencies=TRUE) # Load the 'rlpi' package library(rlpi) # Open...
# Public debt over time # Last update: 2018 04 par(mar=c(5,5,2,2),las=1,bty='n',cex.lab=2,cex.axis=2,cex.main=2) library(plyr) x<-read.csv('data/eurostat_public_debt.csv',stringsAsFactors=F) geo<-sort(unique(x$GEO)) eur<-geo[c(1,2,11,12,13,14,16,17,20,22,24,28)] x<-x[x$GEO %in% eur,] # probably quiker way to do this...
/european_economy/code/public_debt_eurozone.R
no_license
IanMadlenya/teaching
R
false
false
1,089
r
# Public debt over time # Last update: 2018 04 par(mar=c(5,5,2,2),las=1,bty='n',cex.lab=2,cex.axis=2,cex.main=2) library(plyr) x<-read.csv('data/eurostat_public_debt.csv',stringsAsFactors=F) geo<-sort(unique(x$GEO)) eur<-geo[c(1,2,11,12,13,14,16,17,20,22,24,28)] x<-x[x$GEO %in% eur,] # probably quiker way to do this...
# Parallel Utilities setup_parallel <- function(parallel_type = NULL, n_cores = NULL, cl = NULL, ...){ available_cores <- parallel::detectCores(logical = FALSE) - 1L if(is.null(n_cores)){ n_cores <- available_cores } else { n_cores <- min(n_cores, available_cores) } have_mc...
/R/utils_parallel.R
no_license
jashu/beset
R
false
false
939
r
# Parallel Utilities setup_parallel <- function(parallel_type = NULL, n_cores = NULL, cl = NULL, ...){ available_cores <- parallel::detectCores(logical = FALSE) - 1L if(is.null(n_cores)){ n_cores <- available_cores } else { n_cores <- min(n_cores, available_cores) } have_mc...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/clusterTree.R \name{combineClusterings} \alias{combineClusterings} \title{An ensemble method for combining multiple clustering outcomes based on monotonic graph families of Zhou and Oldford} \usage{ combineClusterings(clustering1, clustering2...
/man/combineClusterings.Rd
no_license
rwoldford/trec
R
false
true
1,572
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/clusterTree.R \name{combineClusterings} \alias{combineClusterings} \title{An ensemble method for combining multiple clustering outcomes based on monotonic graph families of Zhou and Oldford} \usage{ combineClusterings(clustering1, clustering2...
# (thetaA,thetaB) -> (theta, freqB) # theta = thetaA+thetaB # freqB = thetaB/theta # # (thetaA,thetaB) -> (theta, freqB) # thetaB = freqB*theta # thetaA = theta - thetaB = (1 - freqB)*theta # # (thetaA, thetaB) => (theta, freqB) # ---------------------------------- # (0,0) => (0, NA) => (NA,NA)*** # (0,eps) => ...
/R/SnpChipEffectFile.extractTotalAndFracB.R
no_license
HenrikBengtsson/aroma.affymetrix
R
false
false
7,501
r
# (thetaA,thetaB) -> (theta, freqB) # theta = thetaA+thetaB # freqB = thetaB/theta # # (thetaA,thetaB) -> (theta, freqB) # thetaB = freqB*theta # thetaA = theta - thetaB = (1 - freqB)*theta # # (thetaA, thetaB) => (theta, freqB) # ---------------------------------- # (0,0) => (0, NA) => (NA,NA)*** # (0,eps) => ...
context("Backwards compatible") rm_trailing_empty <- function(x) { while (!nzchar(x[length(x)])) { x <- x[-length(x)] } x } createDigestSha1Tbl <- function(version = c("1.0.0", "1.1.0", "1.2.0", "1.3.0"), return_DT = FALSE) { version <- match.arg(version) libr...
/tests/testthat/test-backwards-compatibility.R
no_license
cran/hutils
R
false
false
2,059
r
context("Backwards compatible") rm_trailing_empty <- function(x) { while (!nzchar(x[length(x)])) { x <- x[-length(x)] } x } createDigestSha1Tbl <- function(version = c("1.0.0", "1.1.0", "1.2.0", "1.3.0"), return_DT = FALSE) { version <- match.arg(version) libr...
## Matrix inversion is usually a costly computation and there may be some ## benefit to caching the inverse of a matrix rather than computing it repeatedly. ## This function creates a special "matrix" object that can cache its inverse. makeCacheMatrix <- function(x = matrix()) { inv <- NULL set <- function(y) { ...
/cachematrix.R
no_license
mrjoaquincastillo/ProgrammingAssignment2
R
false
false
944
r
## Matrix inversion is usually a costly computation and there may be some ## benefit to caching the inverse of a matrix rather than computing it repeatedly. ## This function creates a special "matrix" object that can cache its inverse. makeCacheMatrix <- function(x = matrix()) { inv <- NULL set <- function(y) { ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/spectral_indices.r \name{PRI_CI} \alias{PRI_CI} \title{Carotenoid/chlorophyll Ratio Index} \usage{ PRI_CI(df, outp_fname = NULL, ...) } \arguments{ \item{df}{A data frame where columns represent measurements in a single wavelength, and column...
/man/PRI_CI.Rd
no_license
MartinezLaura/CanHeMonR
R
false
true
711
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/spectral_indices.r \name{PRI_CI} \alias{PRI_CI} \title{Carotenoid/chlorophyll Ratio Index} \usage{ PRI_CI(df, outp_fname = NULL, ...) } \arguments{ \item{df}{A data frame where columns represent measurements in a single wavelength, and column...
# Copyright (C) 2017 Institute for Defense Analyses # # This file is part of ciTools. # # ciTools is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) a...
/R/add_ci_survreg.R
no_license
cran/ciTools
R
false
false
11,220
r
# Copyright (C) 2017 Institute for Defense Analyses # # This file is part of ciTools. # # ciTools is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) a...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/report.R \docType{methods} \name{report} \alias{report} \title{Generate an Html-report from an sdcMicroObj} \usage{ report(obj, outdir = getwd(), filename = "SDC-Report", title = "SDC-Report", internal = FALSE, verbose = FALSE) } \arguments...
/man/report.Rd
no_license
lstmemery/sdcMicro
R
false
true
1,219
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/report.R \docType{methods} \name{report} \alias{report} \title{Generate an Html-report from an sdcMicroObj} \usage{ report(obj, outdir = getwd(), filename = "SDC-Report", title = "SDC-Report", internal = FALSE, verbose = FALSE) } \arguments...
# used for calculating the log likelihood sd_residuals <- function(b_est, m_est, xvar, yvar){ y_preds <- xvar*m_est + b_est resids <- yvar - y_preds return(sd(resids)) } # compare to: `logLik(lm(yvar~xvar))` loglik <- function(b_est, m_est, xvar, yvar){ y_preds <- xvar*m_est + b_est likhood <- log(dnor...
/fiddles/fiddle_bayes/mcmc_from_scratch/mh-mcmc_from_scratch_functions.r
no_license
lefft/boosh
R
false
false
5,676
r
# used for calculating the log likelihood sd_residuals <- function(b_est, m_est, xvar, yvar){ y_preds <- xvar*m_est + b_est resids <- yvar - y_preds return(sd(resids)) } # compare to: `logLik(lm(yvar~xvar))` loglik <- function(b_est, m_est, xvar, yvar){ y_preds <- xvar*m_est + b_est likhood <- log(dnor...
% Generated by roxygen2 (4.0.1): do not edit by hand \name{plotDist} \alias{plotDist} \title{Plots of Discrete and Continuous Distributions} \usage{ plotDist(dist, ..., add, under = FALSE, packets = NULL, rows = NULL, columns = NULL, kind = c("density", "cdf", "qq", "histogram"), xlab = "", ylab = "", breaks = NULL...
/man/plotDist.Rd
no_license
fboehm/mosaic
R
false
false
3,712
rd
% Generated by roxygen2 (4.0.1): do not edit by hand \name{plotDist} \alias{plotDist} \title{Plots of Discrete and Continuous Distributions} \usage{ plotDist(dist, ..., add, under = FALSE, packets = NULL, rows = NULL, columns = NULL, kind = c("density", "cdf", "qq", "histogram"), xlab = "", ylab = "", breaks = NULL...
hosdata <- read.table("Hospital-data.csv",header = TRUE,sep=",",stringsAsFactors = FALSE) outdata <- read.table("outcome-of-care-measures.csv",header= TRUE,sep=",",stringsAsFactors = FALSE) best <- function(state, outcome) { ## Read outcome data ##done ## Check that state and outcome are valid if ((state ...
/projfile1.R
no_license
Ujwal1993/HospitalCoursera
R
false
false
973
r
hosdata <- read.table("Hospital-data.csv",header = TRUE,sep=",",stringsAsFactors = FALSE) outdata <- read.table("outcome-of-care-measures.csv",header= TRUE,sep=",",stringsAsFactors = FALSE) best <- function(state, outcome) { ## Read outcome data ##done ## Check that state and outcome are valid if ((state ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Level.r \docType{data} \name{Level} \alias{Level} \title{Level Class} \format{An object of class \code{R6ClassGenerator} of length 24.} \usage{ Level } \description{ Level Class } \section{Fields}{ \describe{ \item{\code{levelInt}}{} \item{...
/man/Level.Rd
no_license
OpenSILEX/opensilexClientToolsR
R
false
true
362
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Level.r \docType{data} \name{Level} \alias{Level} \title{Level Class} \format{An object of class \code{R6ClassGenerator} of length 24.} \usage{ Level } \description{ Level Class } \section{Fields}{ \describe{ \item{\code{levelInt}}{} \item{...
# --------------- # pgrid # --------------- # # Constructor # pgrid <- function(mass, boundary, gridtriple, generator, structure) { stopifnot(is.array(mass)) # matrices and 2-dim arrays seem to be exactly the same (incl. classes) dimension <- length(dim(mass)) n <- dim(mass) N <- prod(n) if (missing(stru...
/transport/R/lilhelpers.R
no_license
ingted/R-Examples
R
false
false
12,569
r
# --------------- # pgrid # --------------- # # Constructor # pgrid <- function(mass, boundary, gridtriple, generator, structure) { stopifnot(is.array(mass)) # matrices and 2-dim arrays seem to be exactly the same (incl. classes) dimension <- length(dim(mass)) n <- dim(mass) N <- prod(n) if (missing(stru...
# Fit WHAM models with time-varying selectivity # Brian Stock # Jan 2019 # source("/home/bstock/Documents/wg_MGWG/time-varying/GBhaddock/WHAM/fit_wham_models.R") # Phase 1: Fit each stock with 1) time-constant (no blocks) and 2) time-varying selectivity # NAA model: Full state-space # Time-varying selectivity mo...
/time-varying/GBhaddock/WHAM/fit_wham_models.R
no_license
ices-eg/wg_MGWG
R
false
false
10,747
r
# Fit WHAM models with time-varying selectivity # Brian Stock # Jan 2019 # source("/home/bstock/Documents/wg_MGWG/time-varying/GBhaddock/WHAM/fit_wham_models.R") # Phase 1: Fit each stock with 1) time-constant (no blocks) and 2) time-varying selectivity # NAA model: Full state-space # Time-varying selectivity mo...
exclude <- function(a_df) { filter( a_df, !grepl("^Small Cell Carcinoma, Nos$", histo) & !grepl("^8", age_cut) & dx_year >= 2010 & seq_num %in% c("00", "01") & !grepl("situ", d_ssg00) ) }
/mabsr/R/exclude.R
permissive
mustafaascha/seerm-bevacizumab
R
false
false
233
r
exclude <- function(a_df) { filter( a_df, !grepl("^Small Cell Carcinoma, Nos$", histo) & !grepl("^8", age_cut) & dx_year >= 2010 & seq_num %in% c("00", "01") & !grepl("situ", d_ssg00) ) }
## These functions cache the inverse of a matrix to save computing ## time and resources. ## ## makeCacheMatrix creates a matrix and contains funcitons to: ## 1. set the value of the matrix ## 2. get the value of the matrix ## 3. set the value of the inverse of the matrix ## 4. get the value of the inverse...
/cachematrix.R
no_license
amitberry/ProgrammingAssignment2
R
false
false
1,838
r
## These functions cache the inverse of a matrix to save computing ## time and resources. ## ## makeCacheMatrix creates a matrix and contains funcitons to: ## 1. set the value of the matrix ## 2. get the value of the matrix ## 3. set the value of the inverse of the matrix ## 4. get the value of the inverse...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/satacprocess.R \name{satacprocess} \alias{satacprocess} \title{Preprocess scATAC-seq} \usage{ satacprocess(input, type = "bam", pairsingle = "paired", plibsizefilter = 1000) } \arguments{ \item{input}{Either a character vector of locations to...
/man/satacprocess.Rd
permissive
ZixiaoWang17/SCATE
R
false
true
1,349
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/satacprocess.R \name{satacprocess} \alias{satacprocess} \title{Preprocess scATAC-seq} \usage{ satacprocess(input, type = "bam", pairsingle = "paired", plibsizefilter = 1000) } \arguments{ \item{input}{Either a character vector of locations to...
## US Food Fish Production ## ## Data Source # USDA Quick Stats Census # Source: https://quickstats.nass.usda.gov/ # Downloaded: Nov. 15, 2018 # Timeseries: 2013 # Format: CSV # Metadata: https://quickstats.nass.usda.gov/src/glossary.pdf # Notes: Queried for Census, Aquaculture, Food Fish, Sales (clicking the Get Dat...
/dataprep/us-fish.R
no_license
iwensu0313/us-aquaculture
R
false
false
16,297
r
## US Food Fish Production ## ## Data Source # USDA Quick Stats Census # Source: https://quickstats.nass.usda.gov/ # Downloaded: Nov. 15, 2018 # Timeseries: 2013 # Format: CSV # Metadata: https://quickstats.nass.usda.gov/src/glossary.pdf # Notes: Queried for Census, Aquaculture, Food Fish, Sales (clicking the Get Dat...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/grabPointAuto.R \name{grabPointAuto} \alias{grabPointAuto} \title{grabPointAuto} \usage{ grabPointAuto(img, ref_set, d_x = 20, d_y = 20, tuner = 2.5) } \arguments{ \item{img}{The image to be scaned for corners.} \item{ref_set}{the reference ...
/man/grabPointAuto.Rd
no_license
ctross/DieTryin
R
false
true
686
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/grabPointAuto.R \name{grabPointAuto} \alias{grabPointAuto} \title{grabPointAuto} \usage{ grabPointAuto(img, ref_set, d_x = 20, d_y = 20, tuner = 2.5) } \arguments{ \item{img}{The image to be scaned for corners.} \item{ref_set}{the reference ...
context('test kwic.R') test_that("test attr(kwic, 'ntoken') with un-named texts", { testkwic <- kwic(c( 'The quick brown fox jumped over the lazy dog', 'The quick brown fox', 'The quick brown dog jumped over the lazy dog', NA ), 'fox') testntokens <- c(9, 4, 9, 1) n...
/tests/testthat/test-kwic.R
no_license
chmue/quanteda
R
false
false
11,934
r
context('test kwic.R') test_that("test attr(kwic, 'ntoken') with un-named texts", { testkwic <- kwic(c( 'The quick brown fox jumped over the lazy dog', 'The quick brown fox', 'The quick brown dog jumped over the lazy dog', NA ), 'fox') testntokens <- c(9, 4, 9, 1) n...
############################################ ## Tim Thurman ## ## Code for analysis of ## ## H. erato hybrid zone in eastern Panama ## ## Calculating allele frequencies for ## ## the three alleles ## ############################################ #...
/src/three_allele_freqs.R
no_license
tjthurman/hz_jeb
R
false
false
4,128
r
############################################ ## Tim Thurman ## ## Code for analysis of ## ## H. erato hybrid zone in eastern Panama ## ## Calculating allele frequencies for ## ## the three alleles ## ############################################ #...