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
#' SpecHelpers: Spectroscopy Related Utilities #' #' Utility functions for spectroscopy. 1. Functions to simulate spectra for #' use in teaching or testing. 2. Functions to process files created by #' LoggerPro and SpectraSuite software. #' #' @name SpecHelpers-package #' @aliases SpecHelpers-package SpecHelper...
/R/SpecHelpers-package.R
no_license
bryanhanson/SpecHelpers
R
false
false
569
r
#' SpecHelpers: Spectroscopy Related Utilities #' #' Utility functions for spectroscopy. 1. Functions to simulate spectra for #' use in teaching or testing. 2. Functions to process files created by #' LoggerPro and SpectraSuite software. #' #' @name SpecHelpers-package #' @aliases SpecHelpers-package SpecHelper...
#Check rows with at least one NA complete.cases(fin) #Subset the rows with NA, does not take into account empty rows, fin_incomplete <- fin[!complete.cases(fin),] #create new import fin2 <- read.csv("Future-500.csv", na.strings=c("")) #now new subset will have more rows fin2_incomplete <- fin2[!complete.cases(f...
/emptyfields.R
no_license
Paularb3ar/data-analytics
R
false
false
327
r
#Check rows with at least one NA complete.cases(fin) #Subset the rows with NA, does not take into account empty rows, fin_incomplete <- fin[!complete.cases(fin),] #create new import fin2 <- read.csv("Future-500.csv", na.strings=c("")) #now new subset will have more rows fin2_incomplete <- fin2[!complete.cases(f...
require(e1071) plot(eSVM2, sTrain, PC1 ~ PC2, slice = list( PC3=0, PC4=1, PC5 = 3, PC6 = 1, PC7=1, PC8 = 1, PC9 = 1, PC10 = 1, PC11 = 1, PC12 = 1, PC13=1, PC14 = 1, PC15 = 1, PC16=1, PC17=1, PC18=1) )
/ActivityClassification/exploratory/500_esvmModelVis.R
permissive
Polgy/polgy.github.io
R
false
false
210
r
require(e1071) plot(eSVM2, sTrain, PC1 ~ PC2, slice = list( PC3=0, PC4=1, PC5 = 3, PC6 = 1, PC7=1, PC8 = 1, PC9 = 1, PC10 = 1, PC11 = 1, PC12 = 1, PC13=1, PC14 = 1, PC15 = 1, PC16=1, PC17=1, PC18=1) )
#' Synthetic data set for periodic fitting #' #' #' \itemize{ #' \item site. Fluxnet site abbreviation #' \item date. POSIX date. #' \item time. The decimal representation of the date. #' \item product. "GPP" Gross primary productivity #' \item value. value of measurement in previous column #' } #' #' @docTyp...
/R/synthetic_data.R
no_license
jmzobitz/periodicFitting
R
false
false
550
r
#' Synthetic data set for periodic fitting #' #' #' \itemize{ #' \item site. Fluxnet site abbreviation #' \item date. POSIX date. #' \item time. The decimal representation of the date. #' \item product. "GPP" Gross primary productivity #' \item value. value of measurement in previous column #' } #' #' @docTyp...
prep.deaths <- function(){ ## Grab the initial data from the zip. x <- .prepdata(type = "deaths") ## Rename. Note that I worry about them inadvertantly changing the ## format/order in later updates. stopifnot(identical( names(x), c("HH_ID", "GOVERN", "CLUSTER"...
/R/prep.deaths.R
no_license
cran/lancet.iraqmortality
R
false
false
2,960
r
prep.deaths <- function(){ ## Grab the initial data from the zip. x <- .prepdata(type = "deaths") ## Rename. Note that I worry about them inadvertantly changing the ## format/order in later updates. stopifnot(identical( names(x), c("HH_ID", "GOVERN", "CLUSTER"...
library(cowplot) library(tidyverse) library(RColorBrewer) library(plyr) library(ggpubr) library(data.table) setDTthreads(1) library(ggplot2) library(RColorBrewer) library(rstatix) library(Cairo) library(RhpcBLASctl) omp_set_num_threads(1) blas_set_num_threads(1) library(foreach) library(doParallel) library(gdsfmt) libr...
/plotting_scripts/final_plots/validation_trimming_beta_boxplots.R
no_license
phbradley/tcr-gwas
R
false
false
2,242
r
library(cowplot) library(tidyverse) library(RColorBrewer) library(plyr) library(ggpubr) library(data.table) setDTthreads(1) library(ggplot2) library(RColorBrewer) library(rstatix) library(Cairo) library(RhpcBLASctl) omp_set_num_threads(1) blas_set_num_threads(1) library(foreach) library(doParallel) library(gdsfmt) libr...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{sample_data_imports} \alias{sample_data_imports} \title{Non-EU imports data} \format{A data frame with 100 rows and 23 variables: \tabular{lll}{ \strong{Name} \tab \strong{Type} \tab \strong{Description}\cr comcod...
/man/sample_data_imports.Rd
no_license
lee269/tradetools
R
false
true
3,410
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{sample_data_imports} \alias{sample_data_imports} \title{Non-EU imports data} \format{A data frame with 100 rows and 23 variables: \tabular{lll}{ \strong{Name} \tab \strong{Type} \tab \strong{Description}\cr comcod...
# Copyright 2016-18 Seth Wenchel #' @format NULL #' @usage NULL #' @importFrom geohashTools gh_decode #' @export #' @noRd StatGeohash <- ggproto("StatGeohash", Stat, default_aes = aes(xmin = ..xmin.., ymin= ..ymin.., ...
/R/stat_geohash.R
permissive
mitre/aviationgeoms
R
false
false
4,344
r
# Copyright 2016-18 Seth Wenchel #' @format NULL #' @usage NULL #' @importFrom geohashTools gh_decode #' @export #' @noRd StatGeohash <- ggproto("StatGeohash", Stat, default_aes = aes(xmin = ..xmin.., ymin= ..ymin.., ...
## X is raw data, fin_prod is the normalized data ## set.seed(1234) ## iqr_norm_yuhang<-function(ngene,narray,mug,sigmag,mun=0,sigman){ ## X<-matrix(data=NA,ngene,narray) ## Y<-matrix(data=NA,ngene,narray) ## Z<-matrix(data=NA,ngene,narray) ## fin_prod<-matrix(data=NA,ngene,narray) ## ##narray = nu...
/R/normalize_medIQR.R
no_license
fhlsjs/Super-delta
R
false
false
2,571
r
## X is raw data, fin_prod is the normalized data ## set.seed(1234) ## iqr_norm_yuhang<-function(ngene,narray,mug,sigmag,mun=0,sigman){ ## X<-matrix(data=NA,ngene,narray) ## Y<-matrix(data=NA,ngene,narray) ## Z<-matrix(data=NA,ngene,narray) ## fin_prod<-matrix(data=NA,ngene,narray) ## ##narray = nu...
# Convert Grand Canyon shoals electrofish data to access format # and some basic plots for BNT/RBT for trip reports or presentations # NOTE: END_DATETIME is incorrect from SHOALS, it is default 2018-01-01 00:01:00 # but don't really need that for EF data #loads data entered directly into field computers (from shoals pr...
/AGFD_trips/GC_electrofish_shoals_to_access_GC20210403.R
no_license
jkboyer/shoals-database
R
false
false
12,606
r
# Convert Grand Canyon shoals electrofish data to access format # and some basic plots for BNT/RBT for trip reports or presentations # NOTE: END_DATETIME is incorrect from SHOALS, it is default 2018-01-01 00:01:00 # but don't really need that for EF data #loads data entered directly into field computers (from shoals pr...
/data.R
no_license
RobertoTochimani/ProgramcionActuarial_lll_Ot16
R
false
false
183
r
agecount <- function(age = NULL) { ## Check that "cause" is non-NULL; else throw error if (is.null(age)) stop("no age") ## Read "homicides.txt" data file homicides <- readLines("homicides.txt") ## Extract ages of victims; ignore records where no age is given r <- regexec("(<br./>[A|a]ge:|<dd>.*?,) (.*?) yea...
/compdata/week4/agecount.R
no_license
kevinschmidt/coursera
R
false
false
619
r
agecount <- function(age = NULL) { ## Check that "cause" is non-NULL; else throw error if (is.null(age)) stop("no age") ## Read "homicides.txt" data file homicides <- readLines("homicides.txt") ## Extract ages of victims; ignore records where no age is given r <- regexec("(<br./>[A|a]ge:|<dd>.*?,) (.*?) yea...
#' Generate subsamples from indices #' #' Generate subsamples from manually specified indices of observations in each #' subsample. #' #' @param data A data frame #' @param samples A list of integer vectors or an integer vector, with the indices in each subsample. #' @param ... Arguments passed to methods #' @templateV...
/R/resample_df.R
no_license
jrnold/resamplr
R
false
false
1,377
r
#' Generate subsamples from indices #' #' Generate subsamples from manually specified indices of observations in each #' subsample. #' #' @param data A data frame #' @param samples A list of integer vectors or an integer vector, with the indices in each subsample. #' @param ... Arguments passed to methods #' @templateV...
\name{plot.intraannual} \alias{plot.intraannual} \title{set the linear regressions between intra-annual stable isotopes and climate} \description{fit and plot the linear regressions between intra-annual stable isotopes depending on tree-ring or growing season sections and three climate variables} \usage{ plot.intraannu...
/man/plot.intraannual.Rd
permissive
AlexSoudant/isoclim-demonstration
R
false
false
1,150
rd
\name{plot.intraannual} \alias{plot.intraannual} \title{set the linear regressions between intra-annual stable isotopes and climate} \description{fit and plot the linear regressions between intra-annual stable isotopes depending on tree-ring or growing season sections and three climate variables} \usage{ plot.intraannu...
## outf <- "~/Downloads/PolygenicRSS/output/RSSp_snakemake/est_ntr_chr1-22AF0SNP0N0_ntr_EUR_T_ntr_F_RSSp_res_data_0.01_T_0_F_1.txt.gz" ## res_df <- read_delim(outf,delim="\t") %>% slice(1:10) ## varu <- res_df$sigu^2 ## save.image("ws.RData") ## stop() library(RSSp) #library(S...
/code/scripts/confound_RSSp.R
no_license
CreRecombinase/PolygenicRSS
R
false
false
3,416
r
## outf <- "~/Downloads/PolygenicRSS/output/RSSp_snakemake/est_ntr_chr1-22AF0SNP0N0_ntr_EUR_T_ntr_F_RSSp_res_data_0.01_T_0_F_1.txt.gz" ## res_df <- read_delim(outf,delim="\t") %>% slice(1:10) ## varu <- res_df$sigu^2 ## save.image("ws.RData") ## stop() library(RSSp) #library(S...
# Swaggy Jenkins # # Jenkins API clients generated from Swagger / Open API specification # # OpenAPI spec version: 1.1.1 # Contact: blah@cliffano.com # Generated by: https://openapi-generator.tech #' PipelineBranchesitempullRequestlinks Class #' #' @field self #' @field _class #' #' @importFrom R6 R6Class #' @impor...
/clients/r/generated/R/PipelineBranchesitempullRequestlinks.r
permissive
miao1007/swaggy-jenkins
R
false
false
2,243
r
# Swaggy Jenkins # # Jenkins API clients generated from Swagger / Open API specification # # OpenAPI spec version: 1.1.1 # Contact: blah@cliffano.com # Generated by: https://openapi-generator.tech #' PipelineBranchesitempullRequestlinks Class #' #' @field self #' @field _class #' #' @importFrom R6 R6Class #' @impor...
################################################################################ context("PROD_MAT") set.seed(SEED) ################################################################################ # Simulating some data N <- 73 M <- 43 x <- matrix(rnorm(N * M, mean = 100, sd = 5), N) #################...
/fuzzedpackages/bigstatsr/tests/testthat/test-prodMat.R
no_license
akhikolla/testpackages
R
false
false
5,135
r
################################################################################ context("PROD_MAT") set.seed(SEED) ################################################################################ # Simulating some data N <- 73 M <- 43 x <- matrix(rnorm(N * M, mean = 100, sd = 5), N) #################...
## This function returns a list of several functions that can be used to "set()" the ## originally passed matrix as globally defined and "get()" (return) the originally ## passed matrix. It also provides the functionally to calculate the inverse, and ## return the inverse. # The below code has been tested and confir...
/cachematrix.R
no_license
imbuere/ProgrammingAssignment2
R
false
false
1,533
r
## This function returns a list of several functions that can be used to "set()" the ## originally passed matrix as globally defined and "get()" (return) the originally ## passed matrix. It also provides the functionally to calculate the inverse, and ## return the inverse. # The below code has been tested and confir...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data-movie.R \docType{data} \name{movie_283} \alias{movie_283} \title{Funny People} \format{igraph object} \source{ https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/T4HBA3 https://www.imdb.com/title/tt1201167 } \usage...
/man/movie_283.Rd
permissive
kjhealy/networkdata
R
false
true
1,005
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data-movie.R \docType{data} \name{movie_283} \alias{movie_283} \title{Funny People} \format{igraph object} \source{ https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/T4HBA3 https://www.imdb.com/title/tt1201167 } \usage...
# Testing git integration for rstudio # Initial commit using command line
/sampleFile.r
no_license
philhteoma/EMATM0061-Lecture2
R
false
false
73
r
# Testing git integration for rstudio # Initial commit using command line
# Reducción de los Datasets datos_2019_2 = read.csv(file.path("/home/oscarvch03/Desktop/Proyecto_Analisis_Estadistico", "Saber_11__2019-2.csv"), sep = ";") datos_2019_2_clc = na.omit(data.frame(filter(datos_2019_2, ESTU_DEPTO_RESIDE != ""))) head(datos_2019_2_clc) datos_2020_2 = read.csv(file.path("/home/oscarvch03/D...
/reduccion_datasets.r
no_license
Oscarvch03/Proyecto_Analisis_Estadistico
R
false
false
1,034
r
# Reducción de los Datasets datos_2019_2 = read.csv(file.path("/home/oscarvch03/Desktop/Proyecto_Analisis_Estadistico", "Saber_11__2019-2.csv"), sep = ";") datos_2019_2_clc = na.omit(data.frame(filter(datos_2019_2, ESTU_DEPTO_RESIDE != ""))) head(datos_2019_2_clc) datos_2020_2 = read.csv(file.path("/home/oscarvch03/D...
#' @title Compact a data base #' #' @author P. Chevallier - Jan 2019 #' #' @description Compact htsr sqlite data base #' #' @param db.sqlite Full name of the data base #' @return #' New data base or overwritten data base. Note that the created data base is empty. #' d_compact <- function(db.sqlite) { # Creation ...
/R/d_compact.R
no_license
HYDFKI7/htsr
R
false
false
582
r
#' @title Compact a data base #' #' @author P. Chevallier - Jan 2019 #' #' @description Compact htsr sqlite data base #' #' @param db.sqlite Full name of the data base #' @return #' New data base or overwritten data base. Note that the created data base is empty. #' d_compact <- function(db.sqlite) { # Creation ...
#' Evaluate an expression tidily #' #' @description #' #' `eval_tidy()` is a variant of [base::eval()] and [eval_bare()] that #' powers the [tidy evaluation #' framework](http://rlang.tidyverse.org/articles/tidy-evaluation.html). #' It evaluates `expr` in an [overscope][as_overscope] where the #' special definitions en...
/R/eval-tidy.R
no_license
EdwinTh/rlang
R
false
false
12,414
r
#' Evaluate an expression tidily #' #' @description #' #' `eval_tidy()` is a variant of [base::eval()] and [eval_bare()] that #' powers the [tidy evaluation #' framework](http://rlang.tidyverse.org/articles/tidy-evaluation.html). #' It evaluates `expr` in an [overscope][as_overscope] where the #' special definitions en...
# Author: tim ############################################################################### var_rand <- readRDS("Data/vari1000_1e5_05.rds") limits <- readRDS("Data/blockminmax.rds") markov <- readRDS("Data/varbernfixed.rds") var_comp <- sort(c(random = mean(var_rand), min = limits["min"], max = limits["max...
/PREVAR/REVES2019/R/Compare.R
no_license
IvanWilli/PREVAR
R
false
false
599
r
# Author: tim ############################################################################### var_rand <- readRDS("Data/vari1000_1e5_05.rds") limits <- readRDS("Data/blockminmax.rds") markov <- readRDS("Data/varbernfixed.rds") var_comp <- sort(c(random = mean(var_rand), min = limits["min"], max = limits["max...
#' Post-process Well-Known Text from Soil Data Access #' #' This is a helper function commonly used with \code{SDA_query} to extract #' WKT (well-known text) representation of geometry to an `sf` or `sp` object. #' #' The SDA website can be found at \url{https://sdmdataaccess.nrcs.usda.gov}. #' See the [SDA Tutorial](h...
/R/SDA-spatial.R
no_license
ncss-tech/soilDB
R
false
false
18,231
r
#' Post-process Well-Known Text from Soil Data Access #' #' This is a helper function commonly used with \code{SDA_query} to extract #' WKT (well-known text) representation of geometry to an `sf` or `sp` object. #' #' The SDA website can be found at \url{https://sdmdataaccess.nrcs.usda.gov}. #' See the [SDA Tutorial](h...
# https://docs.google.com/presentation/d/1vAFR3Gut5Kc4rS_D6qTZg1oasTEoPTuXBCKgt01BJ68/edit#slide=id.g7e8cc96aa9_0_27
/week01/03_ex_variables.R
no_license
YounJungCho/sat-ADSP
R
false
false
120
r
# https://docs.google.com/presentation/d/1vAFR3Gut5Kc4rS_D6qTZg1oasTEoPTuXBCKgt01BJ68/edit#slide=id.g7e8cc96aa9_0_27
library(fishmethods) ### Name: clus.lf ### Title: Statistical Comparison of Length Frequencies from Simple Random ### Cluster Sampling ### Aliases: clus.lf ### Keywords: misc ### ** Examples data(codcluslen) clus.lf(group=codcluslen$region,haul=c(paste("ST-",codcluslen$tow,sep="")), len=codcluslen$length, number...
/data/genthat_extracted_code/fishmethods/examples/clus.lf.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
370
r
library(fishmethods) ### Name: clus.lf ### Title: Statistical Comparison of Length Frequencies from Simple Random ### Cluster Sampling ### Aliases: clus.lf ### Keywords: misc ### ** Examples data(codcluslen) clus.lf(group=codcluslen$region,haul=c(paste("ST-",codcluslen$tow,sep="")), len=codcluslen$length, number...
# *------------------------------------------------------------------ # | PROGRAM NAME: # | FILE NAME: .R # | DATE: # | CREATED BY: Jim Stagge # *---------------------------------------------------------------- # | PURPOSE: Test the fundamental models, for a single distribution. Use a hurdle model to...
/10-gauge_tensor_output.R
no_license
jstagge/spibayes_paper
R
false
false
18,932
r
# *------------------------------------------------------------------ # | PROGRAM NAME: # | FILE NAME: .R # | DATE: # | CREATED BY: Jim Stagge # *---------------------------------------------------------------- # | PURPOSE: Test the fundamental models, for a single distribution. Use a hurdle model to...
prepareReportData <- function(sampleTable, organism, cachePrefix) { cat("Preparing sample statistics data ...\n") if (!missing(cachePrefix)) { scesFile <- paste0(cachePrefix, "_sces.rdata") if (file.exists(scesFile)) { cat("Loading from cache file", scesFile, " ...\n") load(scesFile) } else ...
/R/prepareReportData.R
permissive
pingjie/scbatchqc
R
false
false
2,405
r
prepareReportData <- function(sampleTable, organism, cachePrefix) { cat("Preparing sample statistics data ...\n") if (!missing(cachePrefix)) { scesFile <- paste0(cachePrefix, "_sces.rdata") if (file.exists(scesFile)) { cat("Loading from cache file", scesFile, " ...\n") load(scesFile) } else ...
testlist <- list(Rext = numeric(0), Rs = numeric(0), Z = numeric(0), alpha = numeric(0), atmp = numeric(0), relh = numeric(0), temp = c(NaN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), u = numeric(0)) result <- do.call(meteor:::E_Penman,testlist) str(result)
/meteor/inst/testfiles/E_Penman/libFuzzer_E_Penman/E_Penman_valgrind_files/1612738650-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
285
r
testlist <- list(Rext = numeric(0), Rs = numeric(0), Z = numeric(0), alpha = numeric(0), atmp = numeric(0), relh = numeric(0), temp = c(NaN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), u = numeric(0)) result <- do.call(meteor:::E_Penman,testlist) str(result)
library(quanteda) NUM_SUGGESTIONS <- 3 getRegex <- function(phrase, n) { # An all-match regex for empty phrases regex <- "^.*" if (n > 0) { phrase <- quanteda::char_tolower(phrase) phrase <- quanteda::tokens( phrase, what = "fasterword", remove_numbers = TRUE, remove_punct = TRUE, remove_u...
/model/R/main.R
no_license
jverce/ds-finalproject
R
false
false
2,121
r
library(quanteda) NUM_SUGGESTIONS <- 3 getRegex <- function(phrase, n) { # An all-match regex for empty phrases regex <- "^.*" if (n > 0) { phrase <- quanteda::char_tolower(phrase) phrase <- quanteda::tokens( phrase, what = "fasterword", remove_numbers = TRUE, remove_punct = TRUE, remove_u...
## Title: DrainModuleFC ## ## Interface/Abstraction: This object follows the "modules" ## interface consisting of the methods;SetUp(), Execute(), Update(), plotGen() ## ## Description: This class is the instantaneous drain module for the 1d soil ## simulation model. The exe method determines if precip available, and...
/modules/DrainModuleFC.R
no_license
paulhegedus/SWSTM-1D
R
false
false
3,760
r
## Title: DrainModuleFC ## ## Interface/Abstraction: This object follows the "modules" ## interface consisting of the methods;SetUp(), Execute(), Update(), plotGen() ## ## Description: This class is the instantaneous drain module for the 1d soil ## simulation model. The exe method determines if precip available, and...
\name{as.data.frame.function} \alias{as.data.frame.function} \title{Make a function return a data frame.} \usage{\method{as.data.frame}{function} (x, row.names, optional, ...)} \description{ Make a function return a data frame. Create a new function that returns the existing function wrapped in a data.frame } \de...
/man/as.data.frame.function.Rd
no_license
genome-vendor/r-cran-plyr
R
false
false
745
rd
\name{as.data.frame.function} \alias{as.data.frame.function} \title{Make a function return a data frame.} \usage{\method{as.data.frame}{function} (x, row.names, optional, ...)} \description{ Make a function return a data frame. Create a new function that returns the existing function wrapped in a data.frame } \de...
#' Generate a simulated data set based on known model parameters #' #' @param mu Baseline mean expression for negative binomial model #' @param fit Fitted relationship between log mean and log size #' @param p0 A vector of the probabilities a count is zero #' @param m Number of genes/transcripts to simulate (not neces...
/R/create_read_numbers.R
no_license
nellore/polyester
R
false
false
2,295
r
#' Generate a simulated data set based on known model parameters #' #' @param mu Baseline mean expression for negative binomial model #' @param fit Fitted relationship between log mean and log size #' @param p0 A vector of the probabilities a count is zero #' @param m Number of genes/transcripts to simulate (not neces...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/MackSecondHyp.R \name{MackSecondHyp} \alias{MackSecondHyp} \title{Verify second Mack hypothesis} \usage{ MackSecondHyp(triangle, weight = NA) } \arguments{ \item{triangle}{Undevelopped triangle as a matrix} \item{weight}{Boolean matrix with ...
/man/MackSecondHyp.Rd
no_license
maricaciram/ReservingLad
R
false
true
632
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/MackSecondHyp.R \name{MackSecondHyp} \alias{MackSecondHyp} \title{Verify second Mack hypothesis} \usage{ MackSecondHyp(triangle, weight = NA) } \arguments{ \item{triangle}{Undevelopped triangle as a matrix} \item{weight}{Boolean matrix with ...
####################################################################### # R script to generate an email report for an alert. # # set the following constants to send email. emailServer <- "emailTest.company.com" recipients <- c("someone@company.com") # list of recipients acctName <- "company\\someone" # ...
/samples/r_alert_handler.R
permissive
slcorp/RTView-R-Analytics
R
false
false
2,224
r
####################################################################### # R script to generate an email report for an alert. # # set the following constants to send email. emailServer <- "emailTest.company.com" recipients <- c("someone@company.com") # list of recipients acctName <- "company\\someone" # ...
# First load gene list definitions. source("../lib/170117_gene_list_definition.R") # function to count the number of novel genes and lost genes after incoporating non-coding mutations. # The input is the output from bayes_factor_for_each_gene_v2 performance_table <- function(tada_table){ snv_novel_q0.1 <- tada_ta...
/lib/170117_gene_validation_functions.R
no_license
liu-genomics/ASD
R
false
false
5,541
r
# First load gene list definitions. source("../lib/170117_gene_list_definition.R") # function to count the number of novel genes and lost genes after incoporating non-coding mutations. # The input is the output from bayes_factor_for_each_gene_v2 performance_table <- function(tada_table){ snv_novel_q0.1 <- tada_ta...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/scale_color_georgetown.R \name{scale_color_georgetown} \alias{scale_color_georgetown} \title{Scale Colors as Georgetown University} \usage{ scale_color_georgetown(palette = c("georgetown"), alpha = 1, ...) } \description{ Scale Color...
/man/scale_color_georgetown.Rd
no_license
McCartneyAC/university
R
false
true
351
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/scale_color_georgetown.R \name{scale_color_georgetown} \alias{scale_color_georgetown} \title{Scale Colors as Georgetown University} \usage{ scale_color_georgetown(palette = c("georgetown"), alpha = 1, ...) } \description{ Scale Color...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/read_year.R \name{read_year} \alias{read_year} \title{Read generation data for a single year} \usage{ read_year(year, cache_dir = NULL) } \arguments{ \item{year}{year to read} \item{cache_dir}{directory in which to cache downloaded files; wi...
/man/read_year.Rd
permissive
isciences/eia923
R
false
true
480
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/read_year.R \name{read_year} \alias{read_year} \title{Read generation data for a single year} \usage{ read_year(year, cache_dir = NULL) } \arguments{ \item{year}{year to read} \item{cache_dir}{directory in which to cache downloaded files; wi...
#' Convert test arg input to function #' #' This function accepts the RHS of the test argument formula, and #' returns a list including the function that will run to calculate #' the p-value. List also includes the description of the test, and #' whether the test accept `test.args()` #' #' @param class string indicatin...
/R/utils-add_p.R
permissive
clara1989/gtsummary
R
false
false
10,969
r
#' Convert test arg input to function #' #' This function accepts the RHS of the test argument formula, and #' returns a list including the function that will run to calculate #' the p-value. List also includes the description of the test, and #' whether the test accept `test.args()` #' #' @param class string indicatin...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/private.R \name{prFpPrintLabels} \alias{prFpPrintLabels} \title{Plots the labels} \usage{ prFpPrintLabels(labels, nc, nr, graph.pos) } \arguments{ \item{labels}{A list to the labels} \item{nc}{Number of columns} \item{nr}{Number of rows} \...
/man/prFpPrintLabels.Rd
no_license
gforge/forestplot
R
false
true
649
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/private.R \name{prFpPrintLabels} \alias{prFpPrintLabels} \title{Plots the labels} \usage{ prFpPrintLabels(labels, nc, nr, graph.pos) } \arguments{ \item{labels}{A list to the labels} \item{nc}{Number of columns} \item{nr}{Number of rows} \...
#### # R script for running phewas. # # Can simply change the name of the gene and the SNP in the script below # and the adjusted and unadjusted analysis with the Table 1 of the covariates and # the distribution of the alleles against the top two phenotypes will be produced. # # Things to change for new Gen...
/Final_Report/phewas1script2v7_SCL9A3_Ch5.R
no_license
FaizanKhalidMohsin/SickKidsHospital_Practicum2019_GeneticsResearch_CF
R
false
false
10,966
r
#### # R script for running phewas. # # Can simply change the name of the gene and the SNP in the script below # and the adjusted and unadjusted analysis with the Table 1 of the covariates and # the distribution of the alleles against the top two phenotypes will be produced. # # Things to change for new Gen...
library(dplyr) NEI <- readRDS("Data/summarySCC_PM25.rds") #SCC <- readRDS("Data/Source_Classification_Code.rds") #not required req <- NEI %>% filter(type == "ON-ROAD",fips == "24510") %>% select(Emissions,year) %>% group_by(year) %>% summarise(tot_em=sum(Emissions)) png("plot5.png") par(bg ="black",fg ="white...
/plot5.R
no_license
rishyanthkondra/ExData_Plotting2
R
false
false
945
r
library(dplyr) NEI <- readRDS("Data/summarySCC_PM25.rds") #SCC <- readRDS("Data/Source_Classification_Code.rds") #not required req <- NEI %>% filter(type == "ON-ROAD",fips == "24510") %>% select(Emissions,year) %>% group_by(year) %>% summarise(tot_em=sum(Emissions)) png("plot5.png") par(bg ="black",fg ="white...
install.packages("Rserve") install.packages("ggplot2") library("ggplot2")
/init.r
permissive
nasebanal/nb-bitcoin
R
false
false
74
r
install.packages("Rserve") install.packages("ggplot2") library("ggplot2")
# Yige Wu @ WashU 2021 Jun ## annotate sample copy number profile (3p, 5q, 14q) ## CNV: https://wustl.box.com/s/vlde6w791k81q1aibvgs0a487zxleij6 # Purity and ploidy: https://wustl.box.com/s/jel5krgvnvlq5z32vdg4itdcq6znuqzn # From UMich # set up libraries and output directory ----------------------------------- ## gett...
/findmarkers/pbrm1_bap1_vs_non_mutants/annotate_degs/map_CNVnex_lr_by_BAP1_vs_NonMutants_prefilteredgenes_by_snRNAbarcode_katmai.R
no_license
ding-lab/ccRCC_snRNA_analysis
R
false
false
4,044
r
# Yige Wu @ WashU 2021 Jun ## annotate sample copy number profile (3p, 5q, 14q) ## CNV: https://wustl.box.com/s/vlde6w791k81q1aibvgs0a487zxleij6 # Purity and ploidy: https://wustl.box.com/s/jel5krgvnvlq5z32vdg4itdcq6znuqzn # From UMich # set up libraries and output directory ----------------------------------- ## gett...
data <- read.csv("household_power_consumption.txt", header = FALSE, sep = ";", skip = 66637, nrows = 2880 ) names(data) <- names( read.csv("household_power_consumption.txt", sep = ";", nrows = 1)) data$Date <- as.Date(data$Date, format = "%d/%m/%Y") time <- strptime(paste(data$Date, data$Time), format = "%Y-%m-%d %H:%M...
/plot4.R
no_license
AliceXu93/ExData_Plotting1
R
false
false
1,346
r
data <- read.csv("household_power_consumption.txt", header = FALSE, sep = ";", skip = 66637, nrows = 2880 ) names(data) <- names( read.csv("household_power_consumption.txt", sep = ";", nrows = 1)) data$Date <- as.Date(data$Date, format = "%d/%m/%Y") time <- strptime(paste(data$Date, data$Time), format = "%Y-%m-%d %H:%M...
## convert4iboxplot ## Karl W Broman # Convert data to JSON format for iboxplot vis # # @param dat Data matrix (individuals x variables) # @param qu Quantiles to plot (All with 0 < qu < 0.5) # @param orderByMedian If TRUE, reorder individuals by their median # @param breaks Number of break points in the histogram # @p...
/R/convert4iboxplot.R
permissive
sens/qtlcharts
R
false
false
2,206
r
## convert4iboxplot ## Karl W Broman # Convert data to JSON format for iboxplot vis # # @param dat Data matrix (individuals x variables) # @param qu Quantiles to plot (All with 0 < qu < 0.5) # @param orderByMedian If TRUE, reorder individuals by their median # @param breaks Number of break points in the histogram # @p...
require(forecastHybrid) # HDFS configs myNameNode <- "wasb://analytics@aapocblob.blob.core.windows.net" myPort <- 0 bigDataDirRoot <- "/forecasts/data" mySparkCluster <- RxSpark(consoleOutput=TRUE, nameNode=myNameNode, port=myPort) rxSetComputeContext(mySparkCluster) hdfsFS <- RxHdfsFileSystem(hostName=myNameNode, ...
/runForecasts_par.R
no_license
dqharris6/NI
R
false
false
13,413
r
require(forecastHybrid) # HDFS configs myNameNode <- "wasb://analytics@aapocblob.blob.core.windows.net" myPort <- 0 bigDataDirRoot <- "/forecasts/data" mySparkCluster <- RxSpark(consoleOutput=TRUE, nameNode=myNameNode, port=myPort) rxSetComputeContext(mySparkCluster) hdfsFS <- RxHdfsFileSystem(hostName=myNameNode, ...
# 19 de octubre 2016 # Volví a correr los análisis de Nuri Agaves para estar segura de los resultados. # Tomé el flujo de trabajo de Pachy cactaceae.crown.whole.R # modelos ajustados a toda la filogenia de Agavaceae setwd("~/Google Drive/GoogleDrive.7nov2014/Analysis/Nuria/2016.10/Revision_Diversificacion_NuriAgave...
/2_Analyses/agavaceae.crown.whole_2016.10.19.R
no_license
LunaSare/agave_bat_diversification
R
false
false
2,522
r
# 19 de octubre 2016 # Volví a correr los análisis de Nuri Agaves para estar segura de los resultados. # Tomé el flujo de trabajo de Pachy cactaceae.crown.whole.R # modelos ajustados a toda la filogenia de Agavaceae setwd("~/Google Drive/GoogleDrive.7nov2014/Analysis/Nuria/2016.10/Revision_Diversificacion_NuriAgave...
#Source Question Master & Other libraries source("C:\\Dino\\Git\\ALS\\ALS\\KD\\QuestionMasterPrep.R") source("C:\\Dino\\NUS\\Sem2\\RS\\Workshop Files\\day1\\CF-demolib-v3.R") source("C:\\Dino\\NUS\\Sem2\\RS\\Workshop Files\\day3\\CF-demolib-implict-v2.R") #Set the directory setwd("C:\\Dino\\NUS\\CapStone\\DataSet") ...
/Recommenders/AssessBasedQuestion&StreamRec.R
no_license
DInoAtGit/ALS
R
false
false
1,986
r
#Source Question Master & Other libraries source("C:\\Dino\\Git\\ALS\\ALS\\KD\\QuestionMasterPrep.R") source("C:\\Dino\\NUS\\Sem2\\RS\\Workshop Files\\day1\\CF-demolib-v3.R") source("C:\\Dino\\NUS\\Sem2\\RS\\Workshop Files\\day3\\CF-demolib-implict-v2.R") #Set the directory setwd("C:\\Dino\\NUS\\CapStone\\DataSet") ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tbl_sum.R \name{tbl_sum} \alias{tbl_sum} \title{Provide a succinct summary of an object} \usage{ tbl_sum(x) } \arguments{ \item{x}{Object to summarise} } \value{ A named character vector, describing the dimensions in the first element and the...
/man/tbl_sum.Rd
permissive
samuelcsng/tibble
R
false
true
889
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tbl_sum.R \name{tbl_sum} \alias{tbl_sum} \title{Provide a succinct summary of an object} \usage{ tbl_sum(x) } \arguments{ \item{x}{Object to summarise} } \value{ A named character vector, describing the dimensions in the first element and the...
\name{isUnivariate} \alias{isUnivariate} \alias{isMultivariate} \title{Checks if a time series is univariate} \description{ Checks if a time series object or any other rectangular object is univariate or multivariate. } \usage{ isUnivariate(x) isMultivariate(x) } \arguments{ \item{x}{ an object of...
/man/timeSeries-isUnivariate.Rd
no_license
cran/timeSeries
R
false
false
946
rd
\name{isUnivariate} \alias{isUnivariate} \alias{isMultivariate} \title{Checks if a time series is univariate} \description{ Checks if a time series object or any other rectangular object is univariate or multivariate. } \usage{ isUnivariate(x) isMultivariate(x) } \arguments{ \item{x}{ an object of...
#!/usr/bin/env Rscript # map jsbach output from tiles to pft (plant functional type) # - this is not straight forward since several pfts can be saved on one tile level # - the mapping table is obtained from the `cover_type` variable nc attributes from the jsbach input file that must be provided # - run `./jsbach_map...
/functions/jsbach_tile2pft.r
no_license
chrisdane/dotfiles
R
false
false
23,700
r
#!/usr/bin/env Rscript # map jsbach output from tiles to pft (plant functional type) # - this is not straight forward since several pfts can be saved on one tile level # - the mapping table is obtained from the `cover_type` variable nc attributes from the jsbach input file that must be provided # - run `./jsbach_map...
library(futile.logger) library(DBI) library(yaml) library(ggplot2) library(plyr)
/Infrastructure/LibraryImports.R
no_license
accomer/Data-Quality-Analysis
R
false
false
81
r
library(futile.logger) library(DBI) library(yaml) library(ggplot2) library(plyr)
library(leaflet) library(ipapi) #devtools::install_github("hrbrmstr/ipapi") library(tidyverse) # Get Top 25,000 Cisco Domains if (file.exists(fn)) file.remove(fn) temp <- tempfile() download.file("http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip",temp) unzip(temp, "top-1m.csv") sites <- read_csv("top-...
/top25k.r
no_license
jgamblin/jgamblin.github.io
R
false
false
897
r
library(leaflet) library(ipapi) #devtools::install_github("hrbrmstr/ipapi") library(tidyverse) # Get Top 25,000 Cisco Domains if (file.exists(fn)) file.remove(fn) temp <- tempfile() download.file("http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip",temp) unzip(temp, "top-1m.csv") sites <- read_csv("top-...
#' Get resident population by age-group, for Hungarian regions and counties #' #' 6.1.2. Resident population by age-group, 1 January (2001–) #' @param directory Defaults to \code{NULL}. #' @param region_level Any of \code{megye}, \code{county}, #' \code{régió}, \code{region}, \code{nagyrégió}, \code{large_region}, #' \...
/R/get_regional_demography_age_group.R
no_license
antaldaniel/openksh
R
false
false
3,405
r
#' Get resident population by age-group, for Hungarian regions and counties #' #' 6.1.2. Resident population by age-group, 1 January (2001–) #' @param directory Defaults to \code{NULL}. #' @param region_level Any of \code{megye}, \code{county}, #' \code{régió}, \code{region}, \code{nagyrégió}, \code{large_region}, #' \...
#' Weighted Box Plot #' #' @param ... Any arguments used will yield same warning message. #' @return Warning message only. #' @description The wtd.boxplot function is no longer being used by the poliscidata package. Please use the svyboxplot function instead. #' See \code{\link[survey]{svyhist}} documentation for...
/R/wtd.boxplot.r
no_license
cran/poliscidata
R
false
false
571
r
#' Weighted Box Plot #' #' @param ... Any arguments used will yield same warning message. #' @return Warning message only. #' @description The wtd.boxplot function is no longer being used by the poliscidata package. Please use the svyboxplot function instead. #' See \code{\link[survey]{svyhist}} documentation for...
############################################# ##First pair Assigment ## Ayra and Ana ## 21 sept 2015 ## Analysis of the Loblolly pine trees' growth ############################################# #1. Set directory: Ana setwd('/Users/AnaCe/Dropbox/Hertie/CollaborativeDataAnalysis/R/Assignment1MontesReyla-') # 2. Data s...
/Assigment1_Loblolly.R
no_license
ARowena/Assignment1MontesReyla-
R
false
false
1,884
r
############################################# ##First pair Assigment ## Ayra and Ana ## 21 sept 2015 ## Analysis of the Loblolly pine trees' growth ############################################# #1. Set directory: Ana setwd('/Users/AnaCe/Dropbox/Hertie/CollaborativeDataAnalysis/R/Assignment1MontesReyla-') # 2. Data s...
library(mcmcplots) ### Name: denoverplot ### Title: Overlaying Densities for Parameters from two MCMC Simulations. ### Aliases: denoverplot ### Keywords: hplot ### ** Examples ## Create fake MCMC output nc <- 10; nr <- 1000 pnames <- c(paste("alpha[", 1:5, "]", sep=""), paste("gamma[", 1:5, "]", sep="")) means <- r...
/data/genthat_extracted_code/mcmcplots/examples/denoverplot.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
1,151
r
library(mcmcplots) ### Name: denoverplot ### Title: Overlaying Densities for Parameters from two MCMC Simulations. ### Aliases: denoverplot ### Keywords: hplot ### ** Examples ## Create fake MCMC output nc <- 10; nr <- 1000 pnames <- c(paste("alpha[", 1:5, "]", sep=""), paste("gamma[", 1:5, "]", sep="")) means <- r...
library(readxl) library(readr) library(dplyr) library(tidyr) library(magrittr) SNAME=Sys.getenv("SNAME") SDIR=Sys.getenv("SDIR") SDIR=ifelse(SDIR=="","seqCNA",SDIR) source(file.path(SDIR,"include/tools.R")) args=commandArgs(trailing=T) if(len(args)!=1) { cat("usage: root of seqCNA output directories\n") quit(...
/selectBestMatch.R
no_license
soccin/seqCNA
R
false
false
1,196
r
library(readxl) library(readr) library(dplyr) library(tidyr) library(magrittr) SNAME=Sys.getenv("SNAME") SDIR=Sys.getenv("SDIR") SDIR=ifelse(SDIR=="","seqCNA",SDIR) source(file.path(SDIR,"include/tools.R")) args=commandArgs(trailing=T) if(len(args)!=1) { cat("usage: root of seqCNA output directories\n") quit(...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ggsurvie.r \name{ggsurvie} \alias{ggsurvie} \title{Do something} \usage{ ggsurvie(x, y, groups = 0, latex = 0, titre = 0) } \description{ Do something } \examples{ status <- rbinom(n=50, size=1, prob = .5) time <- rexp(n=50) * 20 ggsurvie(x=t...
/man/ggsurvie.Rd
no_license
jgodet/gmrcfun
R
false
true
352
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ggsurvie.r \name{ggsurvie} \alias{ggsurvie} \title{Do something} \usage{ ggsurvie(x, y, groups = 0, latex = 0, titre = 0) } \description{ Do something } \examples{ status <- rbinom(n=50, size=1, prob = .5) time <- rexp(n=50) * 20 ggsurvie(x=t...
library(Hmisc) data <- spss.get("19FALL_MERGED_11042019_RECODE.sav")
/getdata.R
no_license
jtkulas/SIOP2021
R
false
false
71
r
library(Hmisc) data <- spss.get("19FALL_MERGED_11042019_RECODE.sav")
# Resource: http://www.bnlearn.com/about/teaching/slides-bnshort.pdf # page: 25 dir_name = "/home/sankarshan/Documents/code/bayesianLearningInR" setwd(dir_name) # clearing variable rm(list = ls ()) # clearing old plots dev.off() library(bnlearn) # setting individual arcs survey.dag = empty.graph(nodes = c("A", "S"...
/code_4m_slide.R
no_license
msank00/bayesianNetworkLearning
R
false
false
2,383
r
# Resource: http://www.bnlearn.com/about/teaching/slides-bnshort.pdf # page: 25 dir_name = "/home/sankarshan/Documents/code/bayesianLearningInR" setwd(dir_name) # clearing variable rm(list = ls ()) # clearing old plots dev.off() library(bnlearn) # setting individual arcs survey.dag = empty.graph(nodes = c("A", "S"...
\name{lociWidth<--methods} \docType{methods} \alias{lociWidth<--methods} \title{ ~~ Methods for Function \code{lociWidth<-} ~~} \description{ Setter method for the \code{loci} slot in \code{\linkS4class{ChIPScore}} } \section{Methods}{ \describe{ \item{\code{lociWidth(Object)<-value}}{ %% ~~describe this method her...
/man/lociWidth_--methods.Rd
no_license
patrickCNMartin/ChIPanalyser
R
false
false
391
rd
\name{lociWidth<--methods} \docType{methods} \alias{lociWidth<--methods} \title{ ~~ Methods for Function \code{lociWidth<-} ~~} \description{ Setter method for the \code{loci} slot in \code{\linkS4class{ChIPScore}} } \section{Methods}{ \describe{ \item{\code{lociWidth(Object)<-value}}{ %% ~~describe this method her...
#' Compute data for a simple seasonal adjustment #' #' Function to compute the data to produce a simple seasonal adjustment dashboard #' #' @inheritParams sa_dashboard #' @param digits number of digits used in the tables. #' #' @examples #' data <- window(RJDemetra::ipi_c_eu[, "FR"], start = 2003) #' sa_model <- RJ...
/R/simple_dashboard.R
no_license
AQLT/rjdqa
R
false
false
9,916
r
#' Compute data for a simple seasonal adjustment #' #' Function to compute the data to produce a simple seasonal adjustment dashboard #' #' @inheritParams sa_dashboard #' @param digits number of digits used in the tables. #' #' @examples #' data <- window(RJDemetra::ipi_c_eu[, "FR"], start = 2003) #' sa_model <- RJ...
library(shiny) library(apexcharter) # data data("economics_long", package = "ggplot2") ui <- fluidPage( tags$h2("Toggle series"), fluidRow( column( width = 3, actionButton("toggle", "Show/hide pop serie") ), column( width = 9, apexchartOutput(outputId = "chart") ) ) )...
/examples/proxy-toggle.R
permissive
dreamRs/apexcharter
R
false
false
757
r
library(shiny) library(apexcharter) # data data("economics_long", package = "ggplot2") ui <- fluidPage( tags$h2("Toggle series"), fluidRow( column( width = 3, actionButton("toggle", "Show/hide pop serie") ), column( width = 9, apexchartOutput(outputId = "chart") ) ) )...
## Two functions that when working togther cache a matrix and its inverse. ## The first function creates a "matrix" object, 'x' that can cache its own inverse. ## In reality it returns a list containing functions to get/set the matrix and its inverse. makeCacheMatrix <- function(x = matrix()) { inverse <- NUL...
/cachematrix.R
no_license
Matiki/ProgrammingAssignment2
R
false
false
1,139
r
## Two functions that when working togther cache a matrix and its inverse. ## The first function creates a "matrix" object, 'x' that can cache its own inverse. ## In reality it returns a list containing functions to get/set the matrix and its inverse. makeCacheMatrix <- function(x = matrix()) { inverse <- NUL...
#Load up the needed packages library(gmodels) library(rpart) library(rpart.plot) library(pROC) #Load the data into the workspace loan_data <- readRDS(file="./data/loan_data.rds") str(loan_data) #Look at the number of defaults, non-defaults, and their proportions #There data contains 11% defaults CrossTable(loan_da...
/CreditRisk.r
permissive
Karagul/CreditRisk-AppliedFinance_Rmarkdown
R
false
false
18,077
r
#Load up the needed packages library(gmodels) library(rpart) library(rpart.plot) library(pROC) #Load the data into the workspace loan_data <- readRDS(file="./data/loan_data.rds") str(loan_data) #Look at the number of defaults, non-defaults, and their proportions #There data contains 11% defaults CrossTable(loan_da...
# # Exercises # ############################## # 1) Load data the academics data from the file academics_data.R or from one of the # text files you created during the previous assignments. ############################## # 2) How could we ask for the summary of all variables for females? # # Hint: Learn to solve th...
/1.2.1_assignments_with_answers.R
no_license
eplehton/kickstartr
R
false
false
1,654
r
# # Exercises # ############################## # 1) Load data the academics data from the file academics_data.R or from one of the # text files you created during the previous assignments. ############################## # 2) How could we ask for the summary of all variables for females? # # Hint: Learn to solve th...
#### Modelling and plotting Hoop Size #### #### Library #### library(brms) library(rstan) library(tidybayes) library(tidyverse) #### Constants #### Hoop_size <- 0.46 #### Functions #### # This function squashes the range of values so as to be used in a beta regression squash <- function(y, max, min, squash){ y <-...
/Analyses/Experiment_1_Hoop_size/4_modelling_plotting.R
no_license
warren-james/Breaking_symmetry
R
false
false
3,828
r
#### Modelling and plotting Hoop Size #### #### Library #### library(brms) library(rstan) library(tidybayes) library(tidyverse) #### Constants #### Hoop_size <- 0.46 #### Functions #### # This function squashes the range of values so as to be used in a beta regression squash <- function(y, max, min, squash){ y <-...
#' A dataset of NEA Nuclear Energy Data 2018 #' #' The structure of this dataset (7 features per observation) #' is the minimal template for calculated results #' to be imported into the sendis package. #' #' @name df22 #' @docType data #' @usage data(df22) #' @format A dataset of submitted results with 60 observations...
/R/df22-data.R
no_license
fmichelsendis/NuclearEnergyData2018
R
false
false
492
r
#' A dataset of NEA Nuclear Energy Data 2018 #' #' The structure of this dataset (7 features per observation) #' is the minimal template for calculated results #' to be imported into the sendis package. #' #' @name df22 #' @docType data #' @usage data(df22) #' @format A dataset of submitted results with 60 observations...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/simpleCache.R \name{downloadCache} \alias{downloadCache} \title{Create or load a cache from the web.} \usage{ downloadCache(object, url, env = NULL, reload = FALSE, recreate = FALSE, noload = FALSE, cacheDir = getOption("RCACHE.DIR"...
/man/downloadCache.Rd
no_license
j-lawson/simpleCache
R
false
false
1,140
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/simpleCache.R \name{downloadCache} \alias{downloadCache} \title{Create or load a cache from the web.} \usage{ downloadCache(object, url, env = NULL, reload = FALSE, recreate = FALSE, noload = FALSE, cacheDir = getOption("RCACHE.DIR"...
library(lenses) ### Name: take_l ### Title: Construct a lens into a prefix of a vector ### Aliases: take_l ### ** Examples x <- 1:10 view(x, take_l(3)) view(x, take_l(-7)) set(x, take_l(2), c(100,200)) set(x, take_l(-8), c(100,200))
/data/genthat_extracted_code/lenses/examples/take_l.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
240
r
library(lenses) ### Name: take_l ### Title: Construct a lens into a prefix of a vector ### Aliases: take_l ### ** Examples x <- 1:10 view(x, take_l(3)) view(x, take_l(-7)) set(x, take_l(2), c(100,200)) set(x, take_l(-8), c(100,200))
## Load the data files into R objects features <- read.table("features.txt") activity_labels <- read.table("activity_labels.txt", stringsAsFactors = FALSE) subject_test <- read.table("subject_test.txt") subject_train <- read.table("subject_train.txt") X_train <- read.table("X_train.txt", col.names=features$V2) X_test <...
/run_analysis.R
no_license
jmjwen/Coursera_GettingAndCleaningData_Project
R
false
false
6,495
r
## Load the data files into R objects features <- read.table("features.txt") activity_labels <- read.table("activity_labels.txt", stringsAsFactors = FALSE) subject_test <- read.table("subject_test.txt") subject_train <- read.table("subject_train.txt") X_train <- read.table("X_train.txt", col.names=features$V2) X_test <...
setwd('/Users/ivanliu/Google Drive/ANZ/Multivariate Time Series/R/') require(data.table) dt <- fread('../NZ Dairy production.csv', data.table=F) dt <- dt[,-which(names(dt) %in% c('Country', 'TARGET', 'Year','Ave precipitation'))] # install.packages('vars') require(vars) data(Canada) dt2 <- ts(dt[,1], start = 1980, fre...
/old/NZ_Dairy_v1.1/R/NZ_dairy_production.R
no_license
ivanliu1989/Time_Series_Forecasting_STL
R
false
false
424
r
setwd('/Users/ivanliu/Google Drive/ANZ/Multivariate Time Series/R/') require(data.table) dt <- fread('../NZ Dairy production.csv', data.table=F) dt <- dt[,-which(names(dt) %in% c('Country', 'TARGET', 'Year','Ave precipitation'))] # install.packages('vars') require(vars) data(Canada) dt2 <- ts(dt[,1], start = 1980, fre...
context("test-content") test_that("content testing works works", { skip_on_cran() options("gu.API.key" = "test") a <- gu_content( from_date = "2018-11-30", to_date = "2018-12-04", tag = "tone/reviews", show_fields = "all", "show-refinements" = "all" ) #expect_equal(length(a), 42) expect_true(...
/tests/testthat/test-content.R
permissive
evanodell/guardianapi
R
false
false
1,221
r
context("test-content") test_that("content testing works works", { skip_on_cran() options("gu.API.key" = "test") a <- gu_content( from_date = "2018-11-30", to_date = "2018-12-04", tag = "tone/reviews", show_fields = "all", "show-refinements" = "all" ) #expect_equal(length(a), 42) expect_true(...
library(binst) ### Name: create_mdlpbreaks ### Title: Create breaks using mdlp ### Aliases: create_mdlpbreaks ### ** Examples entropy_breaks <- create_breaks(1:10, rep(c(1,2), each = 5), method="entropy") create_bins(1:10, entropy_breaks)
/data/genthat_extracted_code/binst/examples/create_mdlpbreaks.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
246
r
library(binst) ### Name: create_mdlpbreaks ### Title: Create breaks using mdlp ### Aliases: create_mdlpbreaks ### ** Examples entropy_breaks <- create_breaks(1:10, rep(c(1,2), each = 5), method="entropy") create_bins(1:10, entropy_breaks)
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/inverse.volatility.weight.R \name{inverse.volatility.weight} \alias{inverse.volatility.weight} \title{Create an inverse volatility weighted portfolio} \usage{ inverse.volatility.weight(R, portfolio, ...) } \arguments{ \item{R}{an xts, vector,...
/man/inverse.volatility.weight.Rd
no_license
cran/PortfolioAnalytics
R
false
true
1,059
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/inverse.volatility.weight.R \name{inverse.volatility.weight} \alias{inverse.volatility.weight} \title{Create an inverse volatility weighted portfolio} \usage{ inverse.volatility.weight(R, portfolio, ...) } \arguments{ \item{R}{an xts, vector,...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/binera.R \name{binera} \alias{binera} \title{Binary rarefaction (curve-fitting)} \usage{ binera(assoc.df, iter, plots = FALSE, subSample = NULL) } \arguments{ \item{assoc.df}{The raw dataset of associations (pairs of names in two columns, hos...
/man/binera.Rd
no_license
taddallas/codependent
R
false
true
719
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/binera.R \name{binera} \alias{binera} \title{Binary rarefaction (curve-fitting)} \usage{ binera(assoc.df, iter, plots = FALSE, subSample = NULL) } \arguments{ \item{assoc.df}{The raw dataset of associations (pairs of names in two columns, hos...
adjfct.herm <- function(distance,scaling=1,adj.order,adj.parm=NULL,adj.exp=FALSE) # # adjfct.herm # # Hermite polynomial adjustment terms # # # Arguments: # # distance - perpendicular distance vector # scaling - scale parameter # adj.order - vector of orders of polynomials to fit # adj.parm - vecto...
/mrds/R/adjfct.herm.R
no_license
jlaake/mrds
R
false
false
762
r
adjfct.herm <- function(distance,scaling=1,adj.order,adj.parm=NULL,adj.exp=FALSE) # # adjfct.herm # # Hermite polynomial adjustment terms # # # Arguments: # # distance - perpendicular distance vector # scaling - scale parameter # adj.order - vector of orders of polynomials to fit # adj.parm - vecto...
# Testing out rcpp library(rbenchmark) f <- function(n) { if (n < 2) return(n) return(f(n-1) + f(n-2)) } # Using it on first 11 arguments sapply(0:10, f) library(Rcpp) cppFunction(" int g(int n) { if (n < 2) return(n); return(g(n-1) + g(n-2)); }") # Using it on first 11 arguments sapply(0:10, g) benchmark(f(10),...
/rcpp-example.R
no_license
RobvanGastel/time-series-analysis-forecasting
R
false
false
410
r
# Testing out rcpp library(rbenchmark) f <- function(n) { if (n < 2) return(n) return(f(n-1) + f(n-2)) } # Using it on first 11 arguments sapply(0:10, f) library(Rcpp) cppFunction(" int g(int n) { if (n < 2) return(n); return(g(n-1) + g(n-2)); }") # Using it on first 11 arguments sapply(0:10, g) benchmark(f(10),...
'data.world-r Copyright 2017 data.world, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
/R/Util.R
permissive
mrhelmus/data.world-r
R
false
false
1,180
r
'data.world-r Copyright 2017 data.world, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
# Esto es un comentario a <- 'Cadena de texto con entrecomillado simple'
/r.core/src/test/resources/com/blogspot/miguelinlas3/r/eclipse/core/compiler/internal/antlr/strings/doubleStringAssign.r
no_license
migue/r-ide
R
false
false
73
r
# Esto es un comentario a <- 'Cadena de texto con entrecomillado simple'
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/crestree.functions.R \name{mppt.tree} \alias{mppt.tree} \title{Sample pptree objects using different seeds} \usage{ mppt.tree(..., n.cores = parallel::detectCores()/2, n.samples = n.cores, seed = NULL, seeds = NULL) } \arguments{ \item{n.sa...
/man/mppt.tree.Rd
no_license
hms-dbmi/crestree
R
false
true
516
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/crestree.functions.R \name{mppt.tree} \alias{mppt.tree} \title{Sample pptree objects using different seeds} \usage{ mppt.tree(..., n.cores = parallel::detectCores()/2, n.samples = n.cores, seed = NULL, seeds = NULL) } \arguments{ \item{n.sa...
#How have emissions from motor vehicle sources changed from #1999-2008 in Baltimore City SCC <- readRDS("Source_Classification_Code.rds") NEI <- readRDS("summarySCC_PM25.rds") ##selecting mototr vehicle cases scc_motor <- SCC[grep("[Vv]ehic", SCC$EI.Sector), ] ##selecting cases from Baltimore nei_motor <- NEI[NEI$...
/course4_Exploratory_Data_Analysis/Assignment 2/Plot_5.R
no_license
SaraRafi/John-Hopkins-Data-Science-Specialization
R
false
false
796
r
#How have emissions from motor vehicle sources changed from #1999-2008 in Baltimore City SCC <- readRDS("Source_Classification_Code.rds") NEI <- readRDS("summarySCC_PM25.rds") ##selecting mototr vehicle cases scc_motor <- SCC[grep("[Vv]ehic", SCC$EI.Sector), ] ##selecting cases from Baltimore nei_motor <- NEI[NEI$...
#~~~~~~~~~~~~~~~~~~~~~~~ # Adam Griffin, 2021-05-04 # # The Empirical Copula functions for simulating new events from given data. # # For aquaCAT, Project 07441. # # Created ABG 2020-06-15 # Pipeline version ABG 2020-09-07 # Version 2 using empirical beta copulas # # OUTPUTS: NewEventPresentEC_***.csv: data...
/OLD/107N_EmpiricalBeta_CopulaB.R
no_license
griffada/AQUACAT_UKCEH
R
false
false
5,599
r
#~~~~~~~~~~~~~~~~~~~~~~~ # Adam Griffin, 2021-05-04 # # The Empirical Copula functions for simulating new events from given data. # # For aquaCAT, Project 07441. # # Created ABG 2020-06-15 # Pipeline version ABG 2020-09-07 # Version 2 using empirical beta copulas # # OUTPUTS: NewEventPresentEC_***.csv: data...
asianOption <- function(S_0, K, T, r, sigma, M, flag_rates, flag_Option) { del_t = T/M; if (flag_rates == 1) { u = exp(sigma*sqrt(del_t) + (r - (sigma^2)/2)*del_t ); d = exp(-sigma*sqrt(del_t) + (r - (sigma^2)/2)*del_t ); } else { u = exp(sigma*sqrt(del_t)); d = exp(-sigma*sqrt(del_t)); } rate = exp(r*del...
/Lab2/R_Implementation/ques2/asianOption.R
no_license
apoddar573/Financial_Engineering_Lab
R
false
false
1,114
r
asianOption <- function(S_0, K, T, r, sigma, M, flag_rates, flag_Option) { del_t = T/M; if (flag_rates == 1) { u = exp(sigma*sqrt(del_t) + (r - (sigma^2)/2)*del_t ); d = exp(-sigma*sqrt(del_t) + (r - (sigma^2)/2)*del_t ); } else { u = exp(sigma*sqrt(del_t)); d = exp(-sigma*sqrt(del_t)); } rate = exp(r*del...
## Exploratory Data Analysis ## Course Project 1 ## Plot 4 # read Electric Power Consumption data data <- read.table("household_power_consumption.txt", header = TRUE, sep = ";", na.strings = "?") # subset data from the dates 2007-02-01 and 2007-02-02 subdata <- data[data$Date %in% c("1/2/2007", "2/2/2007"...
/plot4.R
no_license
scarcilla/ExData_Plotting1
R
false
false
1,445
r
## Exploratory Data Analysis ## Course Project 1 ## Plot 4 # read Electric Power Consumption data data <- read.table("household_power_consumption.txt", header = TRUE, sep = ";", na.strings = "?") # subset data from the dates 2007-02-01 and 2007-02-02 subdata <- data[data$Date %in% c("1/2/2007", "2/2/2007"...
funnelplot <- function(table, binary=TRUE, mean.sd=TRUE, higher.is.better=NA, outlook=NA, vpos=NA, pos=NA, neg=NA, vneg=NA, level=95, binary.measure="RR", continuous.measure="SMD", summary.measure="SMD", method="DL", random.number.seed=NA, sims=1, smd.noise=0.01, title="", pch.pub=19, pch.unpub=0){ ...
/SAMURAI/R/funnelplot.R
no_license
ingted/R-Examples
R
false
false
1,852
r
funnelplot <- function(table, binary=TRUE, mean.sd=TRUE, higher.is.better=NA, outlook=NA, vpos=NA, pos=NA, neg=NA, vneg=NA, level=95, binary.measure="RR", continuous.measure="SMD", summary.measure="SMD", method="DL", random.number.seed=NA, sims=1, smd.noise=0.01, title="", pch.pub=19, pch.unpub=0){ ...
library(glmnet) mydata = read.table("../../../../TrainingSet/FullSet/Lasso/lung_other.csv",head=T,sep=",") x = as.matrix(mydata[,4:ncol(mydata)]) y = as.matrix(mydata[,1]) set.seed(123) glm = cv.glmnet(x,y,nfolds=10,type.measure="mse",alpha=0.4,family="gaussian",standardize=TRUE) sink('./lung_other_049.txt',append=TRUE...
/Model/EN/Lasso/lung_other/lung_other_049.R
no_license
esbgkannan/QSMART
R
false
false
351
r
library(glmnet) mydata = read.table("../../../../TrainingSet/FullSet/Lasso/lung_other.csv",head=T,sep=",") x = as.matrix(mydata[,4:ncol(mydata)]) y = as.matrix(mydata[,1]) set.seed(123) glm = cv.glmnet(x,y,nfolds=10,type.measure="mse",alpha=0.4,family="gaussian",standardize=TRUE) sink('./lung_other_049.txt',append=TRUE...
/impl/02_data_preparation/30_returns&mood/00_History/ret_XBT_1min_v01.R
no_license
yangboyubyron/thesis-google-crypto-trading
R
false
false
2,073
r
# To extract muliple values from a data frame # For example the data frame of Ozone, temperature, UV, Rain in each month # want to find the mean rainfall for june when above 20 degrees and 34 Ozone Junerain = subset(dataset, Ozone>30 & Temp>20) mean(Junerain$rainfall, na.rm = TRUE) #na.rm = TRUE removes any missing v...
/Course notes.R
no_license
WillBolland/datasciencecoursera
R
false
false
1,319
r
# To extract muliple values from a data frame # For example the data frame of Ozone, temperature, UV, Rain in each month # want to find the mean rainfall for june when above 20 degrees and 34 Ozone Junerain = subset(dataset, Ozone>30 & Temp>20) mean(Junerain$rainfall, na.rm = TRUE) #na.rm = TRUE removes any missing v...
#!/usr/bin/env Rscript ### ### Read a directory tree created by a run of cosmosis, and produce a ### standard set of plots, guided by what directories and files are ### found. ### suppressPackageStartupMessages(library("optparse")) suppressPackageStartupMessages(library("lattice")) suppressPackageStartupMessages(libr...
/cosmosis/plotting/cosmology_theory_plots.r
permissive
ktanidis/Modified_CosmoSIS_for_galaxy_number_count_angular_power_spectra
R
false
false
11,025
r
#!/usr/bin/env Rscript ### ### Read a directory tree created by a run of cosmosis, and produce a ### standard set of plots, guided by what directories and files are ### found. ### suppressPackageStartupMessages(library("optparse")) suppressPackageStartupMessages(library("lattice")) suppressPackageStartupMessages(libr...
######################################################################################## # PGC Methylation Meta-Analysis ######################################################################################## rm(list=ls()) setwd("/Users/ar3054/Dropbox/PTSD methylation workgroup Results Files/Gender-Stratified/Non-Sm...
/01_PGC_PTSD_EWAS_loadData_Civilian_Male.R
no_license
PGC-PTSD-EWAS/Cross-Sectional-Civilian
R
false
false
3,008
r
######################################################################################## # PGC Methylation Meta-Analysis ######################################################################################## rm(list=ls()) setwd("/Users/ar3054/Dropbox/PTSD methylation workgroup Results Files/Gender-Stratified/Non-Sm...
setwd("~/Documents/ADII/Lab2-Parte3") install.packages("ISLR") install.packages("dplyr") install.packages("caret") library(readr) library(dplyr) library(ISLR) library(caret) library(readr) library(reshape2) #importando os dados treino_base <- read_csv("~/Documents/ADII/Lab2-Parte3/treino_base.csv") teste_base <- rea...
/Lab2-Parte3/Lab2-preprocessamentoDados (1).R
no_license
brunabarbosa/AD2
R
false
false
5,223
r
setwd("~/Documents/ADII/Lab2-Parte3") install.packages("ISLR") install.packages("dplyr") install.packages("caret") library(readr) library(dplyr) library(ISLR) library(caret) library(readr) library(reshape2) #importando os dados treino_base <- read_csv("~/Documents/ADII/Lab2-Parte3/treino_base.csv") teste_base <- rea...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/allele_genotype_functions.R \name{identifyNoise} \alias{identifyNoise} \title{Idenfities the noise.} \usage{ identifyNoise(stringCoverageListObject, colBelief = "Coverage", thresholdSignal = 0.01) } \arguments{ \item{stringCoverageListObjec...
/man/identifyNoise.Rd
no_license
cran/STRMPS
R
false
true
1,023
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/allele_genotype_functions.R \name{identifyNoise} \alias{identifyNoise} \title{Idenfities the noise.} \usage{ identifyNoise(stringCoverageListObject, colBelief = "Coverage", thresholdSignal = 0.01) } \arguments{ \item{stringCoverageListObjec...
# Cleaning and preprocessing 109th senate data #Load data path <- 'C:/Users/Manuel/Desktop/Southampton/MasterThesis/Data/US109senate/' senate <- read.table(paste0(path,'109senate.txt'), sep = "\t", header = T) senate <- senate[-c(1,2)] #Remove 1st (bills to vote) and 2nd (n missing votes) columns senate[senate==0]...
/Code/109senate_preprocessing.R
no_license
manullamas/Learning-Time-Varying-Networks
R
false
false
728
r
# Cleaning and preprocessing 109th senate data #Load data path <- 'C:/Users/Manuel/Desktop/Southampton/MasterThesis/Data/US109senate/' senate <- read.table(paste0(path,'109senate.txt'), sep = "\t", header = T) senate <- senate[-c(1,2)] #Remove 1st (bills to vote) and 2nd (n missing votes) columns senate[senate==0]...
#!/usr/bin/env Rscript library(dplyr) library(stringr) library(readr) library(ANTsR) dirs = list.dirs(".",recursive=F) fat.dirs = dirs[which(str_detect(dirs, "fat$"))] overlay.dir = "0000000_fat_overlay" dir.create(overlay.dir) for (fdir in fat.dirs) { f0 = list.files(fdir, pattern = "*anatomy.nii.gz") f1 ...
/fat/fat.labelstats.R
no_license
gnayyc/cyy.utils
R
false
false
2,477
r
#!/usr/bin/env Rscript library(dplyr) library(stringr) library(readr) library(ANTsR) dirs = list.dirs(".",recursive=F) fat.dirs = dirs[which(str_detect(dirs, "fat$"))] overlay.dir = "0000000_fat_overlay" dir.create(overlay.dir) for (fdir in fat.dirs) { f0 = list.files(fdir, pattern = "*anatomy.nii.gz") f1 ...
require(rhbase) library(lubridate) library(digest) library(data.table) hostLoc = 'xxx.xxx.xxx.xxx' #Give your server IP port = 9090 #Default port for thrift service #use 8080 when inside KNMI hb.init(hostLoc, port,serialize=c("character")) # Important to have serialization as char otherwise the "raw bytes" are d...
/scripts/HbaseInteraction.R
no_license
kvanbezouw/fogDec
R
false
false
2,946
r
require(rhbase) library(lubridate) library(digest) library(data.table) hostLoc = 'xxx.xxx.xxx.xxx' #Give your server IP port = 9090 #Default port for thrift service #use 8080 when inside KNMI hb.init(hostLoc, port,serialize=c("character")) # Important to have serialization as char otherwise the "raw bytes" are d...
par(mfrow=c(2,2)) ##PLOT A plot(Data1$timestamp,Data1$Global_active_power, type="l" , xlab="", ylab="Global Active Power") ##PLOT B plot(Data1$timestamp,Data1$Voltage, type="l", xlab="datetime", ylab="Voltage") ##PLOT C plot(Data1$timestamp,Data1$Sub_metering_1, type="l" , xlab="", ylab="Energy sub metering...
/plot4.R
no_license
Royalwind/Exploratory-Data-Analysis
R
false
false
775
r
par(mfrow=c(2,2)) ##PLOT A plot(Data1$timestamp,Data1$Global_active_power, type="l" , xlab="", ylab="Global Active Power") ##PLOT B plot(Data1$timestamp,Data1$Voltage, type="l", xlab="datetime", ylab="Voltage") ##PLOT C plot(Data1$timestamp,Data1$Sub_metering_1, type="l" , xlab="", ylab="Energy sub metering...