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
#' compute annual yield' #' #' Function to compute yeild of different fruits as a function of annual temperature and precipitation #' @param T annual temperature (C) #' @param T optimal temperature (C) #' @param P annual precipitation (mm) #' @param max.water maximum water requirement (mm) #' @param ts slope on temp...
/ecohydrotools/R/compute_yield.R
no_license
naomitague/HebrewU
R
false
false
801
r
#' compute annual yield' #' #' Function to compute yeild of different fruits as a function of annual temperature and precipitation #' @param T annual temperature (C) #' @param T optimal temperature (C) #' @param P annual precipitation (mm) #' @param max.water maximum water requirement (mm) #' @param ts slope on temp...
## BAR PLOT ONLY library(ggplot2) library(reshape2) results <- read.csv("~/results.csv") df <- data.frame(method = results['method'], wrr = results['wrr'], wcr = results['wcr']) data.m <- melt(df, id.vars='method') ggplot(data.m) + geom_bar(aes(method,value,fill = variable), width = 0.4, position = position_dodge(...
/STTeval.R
no_license
yrhvivian/python-speech
R
false
false
1,757
r
## BAR PLOT ONLY library(ggplot2) library(reshape2) results <- read.csv("~/results.csv") df <- data.frame(method = results['method'], wrr = results['wrr'], wcr = results['wcr']) data.m <- melt(df, id.vars='method') ggplot(data.m) + geom_bar(aes(method,value,fill = variable), width = 0.4, position = position_dodge(...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import_Omnipath.R \name{.get_ptms_databases} \alias{.get_ptms_databases} \title{Get Post-translational modification (PTMs) databases} \usage{ .get_ptms_databases() } \value{ character vector with the names of the PTMs databases } \description...
/man/dot-get_ptms_databases.Rd
permissive
alberto-valdeolivas/OmnipathR
R
false
true
508
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import_Omnipath.R \name{.get_ptms_databases} \alias{.get_ptms_databases} \title{Get Post-translational modification (PTMs) databases} \usage{ .get_ptms_databases() } \value{ character vector with the names of the PTMs databases } \description...
## ------------------------------------------------------------------------ data(iris) library(condformat) condformat(iris[c(1:5,70:75, 120:125),]) %>% rule_fill_discrete(Species) %>% rule_fill_discrete(c(Sepal.Width, Sepal.Length), expression = Sepal.Width > Sepal.Length - 2.25, ...
/R/lib/condformat/doc/introduction.R
no_license
BRICOMATA/Bricomata_
R
false
false
673
r
## ------------------------------------------------------------------------ data(iris) library(condformat) condformat(iris[c(1:5,70:75, 120:125),]) %>% rule_fill_discrete(Species) %>% rule_fill_discrete(c(Sepal.Width, Sepal.Length), expression = Sepal.Width > Sepal.Length - 2.25, ...
#' @param start_date string in the form "YYYY-MM-DD" #' @param end_date string in the form "YYYY-MM-DD" #' @return data.frame fred_function <- function(start_date, end_date){ #------- Ensuring dplyr and fredr are loaded ----------------- library(dplyr) library(fredr) #------ Getting several different une...
/Tutorial1/buildingReco/scripts/fred_script.R
no_license
rnorthconference/2021Talks
R
false
false
1,840
r
#' @param start_date string in the form "YYYY-MM-DD" #' @param end_date string in the form "YYYY-MM-DD" #' @return data.frame fred_function <- function(start_date, end_date){ #------- Ensuring dplyr and fredr are loaded ----------------- library(dplyr) library(fredr) #------ Getting several different une...
#' vcov estimators for pim #' #' \code{sandwich.vcov} and \code{score.vcov} are two similar estimators #' for the variance-covariance matrix of a probabilistic index model. #' These functions are meant to be used within a call to \code{\link{pim}} #' as a value for the argument \code{vcov}. #' #' You can create your ...
/R/vcov.estimators.R
no_license
vishalbelsare/pim
R
false
false
2,132
r
#' vcov estimators for pim #' #' \code{sandwich.vcov} and \code{score.vcov} are two similar estimators #' for the variance-covariance matrix of a probabilistic index model. #' These functions are meant to be used within a call to \code{\link{pim}} #' as a value for the argument \code{vcov}. #' #' You can create your ...
#' Estimate Covariance Matrix of Ordinary Least Squares Estimators #' Using Error Variance Estimates from an Auxiliary Variance Model #' #' The function simply calculates #' \deqn{\mathrm{Cov}{\hat{\beta}}=(X'X)^{-1}X'\hat{\Omega}X(X'X)^{-1}}, #' where \eqn{X} is the design matrix of a linear regression model ...
/R/avm.vcov.R
no_license
tjfarrar/skedastic
R
false
false
1,883
r
#' Estimate Covariance Matrix of Ordinary Least Squares Estimators #' Using Error Variance Estimates from an Auxiliary Variance Model #' #' The function simply calculates #' \deqn{\mathrm{Cov}{\hat{\beta}}=(X'X)^{-1}X'\hat{\Omega}X(X'X)^{-1}}, #' where \eqn{X} is the design matrix of a linear regression model ...
# Get relevant data FirstLine <- read.table("household_power_consumption.txt",sep=";",header=FALSE, stringsAsFactors=FALSE,skip=1,nrows=1) FirstDate <- as.Date(FirstLine$V1,format="%d/%m/%Y") StartDate <- as.Date("01/02/2007",format="%d/%m/%Y") Diff <- as.numeric(StartDate-FirstDate) MyNames <- ...
/plot3.R
no_license
aficnar/ExData_Plotting1
R
false
false
1,175
r
# Get relevant data FirstLine <- read.table("household_power_consumption.txt",sep=";",header=FALSE, stringsAsFactors=FALSE,skip=1,nrows=1) FirstDate <- as.Date(FirstLine$V1,format="%d/%m/%Y") StartDate <- as.Date("01/02/2007",format="%d/%m/%Y") Diff <- as.numeric(StartDate-FirstDate) MyNames <- ...
rawdata <-readRDS("rawdata.rds") rawdata[,7:46]<-log(rawdata[,7:46]) mehp<-rawdata[,7:9] mehhp<-rawdata[,11:13] meohp<-rawdata[,15:17] mecpp<-rawdata[,19:21] dehpsum<-rawdata[,23:25] mbzp<-rawdata[,27:29] mbp<-rawdata[,31:33] mibp<-rawdata[,35:37] mep<-rawdata[,39:41] mcpp<-rawdata[,43:45] mean_mehp<-rowMeans(mehp,na.r...
/mean cox.R
no_license
kkttzjy/Phthalate-and-gestational-age-analysis
R
false
false
6,206
r
rawdata <-readRDS("rawdata.rds") rawdata[,7:46]<-log(rawdata[,7:46]) mehp<-rawdata[,7:9] mehhp<-rawdata[,11:13] meohp<-rawdata[,15:17] mecpp<-rawdata[,19:21] dehpsum<-rawdata[,23:25] mbzp<-rawdata[,27:29] mbp<-rawdata[,31:33] mibp<-rawdata[,35:37] mep<-rawdata[,39:41] mcpp<-rawdata[,43:45] mean_mehp<-rowMeans(mehp,na.r...
### LOCATION OF DATA FILES ########################################################################################################################### # -> probe genomic coordinates (hg19): /mnt/pd2/marco/CNS_PNET/CNS_PNET_v2/data/annotation/Methlation_450k/hm450_probe_coordinates.txt # - contains all the 450k probes #...
/prep_crc_methylation.R
no_license
marzuf/TAD_DE_pipeline_v2_coreg
R
false
false
7,829
r
### LOCATION OF DATA FILES ########################################################################################################################### # -> probe genomic coordinates (hg19): /mnt/pd2/marco/CNS_PNET/CNS_PNET_v2/data/annotation/Methlation_450k/hm450_probe_coordinates.txt # - contains all the 450k probes #...
# COVIDMINDER Daily data downloader (2 of 4) # Source: JHU Daily Reports (github): https://bit.ly/3dMWRP6 # FILES CREATED/UPDATED BY THIS SCRIPT: # "data/csv/04-XX-2020.csv" (where 'XX' is the current day) # "data/csv/covid_data_states.csv" # "data/csv/covid_data_states.csv.bak" library(tidyverse) # curl newest data ...
/data_downloaders/jhu_downloader.R
no_license
stjordanis/COVIDMINDER
R
false
false
1,977
r
# COVIDMINDER Daily data downloader (2 of 4) # Source: JHU Daily Reports (github): https://bit.ly/3dMWRP6 # FILES CREATED/UPDATED BY THIS SCRIPT: # "data/csv/04-XX-2020.csv" (where 'XX' is the current day) # "data/csv/covid_data_states.csv" # "data/csv/covid_data_states.csv.bak" library(tidyverse) # curl newest data ...
# Creating a list containing a vector, a matrix and a list. data<-list(c("asha","rekha","kamal"),matrix(c(40,50,60,70,80,90),nrow=2), list("BCA","BCOM","ENGG.")) data #Giving a name to list elements names(data)<-c("Student","Marks","Course") data #Manipulation of list elements #1. to add new eleme...
/list1.R
no_license
meenapandey500/R_Programming-
R
false
false
542
r
# Creating a list containing a vector, a matrix and a list. data<-list(c("asha","rekha","kamal"),matrix(c(40,50,60,70,80,90),nrow=2), list("BCA","BCOM","ENGG.")) data #Giving a name to list elements names(data)<-c("Student","Marks","Course") data #Manipulation of list elements #1. to add new eleme...
context("attributes") test_that("assigning and querying attributes work", { library(igraph) ## Create a small ring graph, assign attributes ring <- graph_from_literal( A-B-C-D-E-F-G-A ) E(ring)$weight <- seq_len(ecount(ring)) ## Query attributes expect_that(V(ring)$name, equals(LETTERS[seq_len(vcount(ri...
/tests/testthat/test_attributes.R
no_license
vishalbelsare/rigraph
R
false
false
6,066
r
context("attributes") test_that("assigning and querying attributes work", { library(igraph) ## Create a small ring graph, assign attributes ring <- graph_from_literal( A-B-C-D-E-F-G-A ) E(ring)$weight <- seq_len(ecount(ring)) ## Query attributes expect_that(V(ring)$name, equals(LETTERS[seq_len(vcount(ri...
#' get_report_date function #' #' To get a report date for a given run_date, adjusted by weekends and holidays. #' #' @param d The report run date or a historical date (report control date), default to current date (Sys.Date). #' @return A date value #' @export get_report_date <- function(d=Sys.Date()){ d = d - 1 w...
/R/get_report_date.R
no_license
victormxr/CTRMPackage
R
false
false
2,870
r
#' get_report_date function #' #' To get a report date for a given run_date, adjusted by weekends and holidays. #' #' @param d The report run date or a historical date (report control date), default to current date (Sys.Date). #' @return A date value #' @export get_report_date <- function(d=Sys.Date()){ d = d - 1 w...
#aridity classes rm(list=ls(all=TRUE)) setwd("/Volumes/P_Harddrive/") library(sp) library(raster) library(SPAr) library(ncdf4) library(RNetCDF) library(segmented) file.ndvi <- list.files("/Volumes/P_Harddrive/Annual_data/ndvi_1982_2011_Australia/",full.names = TRUE) file.precip <- list.files("/Volumes/P_Harddr...
/ccrc/aridity/Aridity_ndvi .R
no_license
patnicolle/GITBANK
R
false
false
6,694
r
#aridity classes rm(list=ls(all=TRUE)) setwd("/Volumes/P_Harddrive/") library(sp) library(raster) library(SPAr) library(ncdf4) library(RNetCDF) library(segmented) file.ndvi <- list.files("/Volumes/P_Harddrive/Annual_data/ndvi_1982_2011_Australia/",full.names = TRUE) file.precip <- list.files("/Volumes/P_Harddr...
#' fishingoverlap: A package for estimating the spatial overlap between #' fishing events #' #' @docType package #' @name fishingoverlap NULL #> NULL
/R/fishingoverlap-package.R
no_license
AustralianAntarcticDivision/fishingoverlap
R
false
false
150
r
#' fishingoverlap: A package for estimating the spatial overlap between #' fishing events #' #' @docType package #' @name fishingoverlap NULL #> NULL
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/extractors.R \name{next_cursor} \alias{cursor_next} \alias{next_cursor} \alias{next_page} \title{next_cursor} \usage{ next_cursor(ids) } \arguments{ \item{ids}{Data frame of Twitter IDs generated via \code{\link{get_followers}} or \code{\link...
/man/next_cursor.Rd
no_license
JohnNay/rtweet
R
false
true
1,362
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/extractors.R \name{next_cursor} \alias{cursor_next} \alias{next_cursor} \alias{next_page} \title{next_cursor} \usage{ next_cursor(ids) } \arguments{ \item{ids}{Data frame of Twitter IDs generated via \code{\link{get_followers}} or \code{\link...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/getBestFeatureParameters.R \name{getBestParameterStats_constraintFDR} \alias{getBestParameterStats_constraintFDR} \title{getBestParameterStats_constraintFDR} \usage{ getBestParameterStats_constraintFDR(complex_feature_grid_filtered, complex...
/man/getBestParameterStats_constraintFDR.Rd
no_license
PedrioliLab/SECprofiler
R
false
true
2,529
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/getBestFeatureParameters.R \name{getBestParameterStats_constraintFDR} \alias{getBestParameterStats_constraintFDR} \title{getBestParameterStats_constraintFDR} \usage{ getBestParameterStats_constraintFDR(complex_feature_grid_filtered, complex...
# EBIO338/358: Analysis and Visualization of Biological Data # Problem Set 2 # 1) Load the stream flow data and call it flow. Examine the structure. # 2) Create a contingency table showing the number of observations per year for each stream # 3 a) Plot maximum flow as a function of elevation. # b) Make the axes l...
/ps2_instructions.R
no_license
Cnp2/ps2
R
false
false
1,534
r
# EBIO338/358: Analysis and Visualization of Biological Data # Problem Set 2 # 1) Load the stream flow data and call it flow. Examine the structure. # 2) Create a contingency table showing the number of observations per year for each stream # 3 a) Plot maximum flow as a function of elevation. # b) Make the axes l...
################################################### ### chunk: load0 ################################################### library("BiocCaseStudies") ################################################### ### chunk: ALLdata ################################################### library("ALL") data("ALL") types = c("ALL1/AF4"...
/assets/help/publications/books/bioconductor-case-studies/web-supplement/chapter_8/annotate.R
no_license
Bioconductor/bioconductor.org
R
false
false
13,295
r
################################################### ### chunk: load0 ################################################### library("BiocCaseStudies") ################################################### ### chunk: ALLdata ################################################### library("ALL") data("ALL") types = c("ALL1/AF4"...
## ---- echo = FALSE------------------------------------------------------- #knitr::opts_chunk$set(collapse = TRUE, comment = "#>") knitr::opts_chunk$set(fig.width = 6, fig.height = 4.5) ## ---- warning = FALSE, message = FALSE----------------------------------- library("SimMultiCorrData") library("printr") ...
/inst/doc/workflow.R
no_license
cran/SimMultiCorrData
R
false
false
12,477
r
## ---- echo = FALSE------------------------------------------------------- #knitr::opts_chunk$set(collapse = TRUE, comment = "#>") knitr::opts_chunk$set(fig.width = 6, fig.height = 4.5) ## ---- warning = FALSE, message = FALSE----------------------------------- library("SimMultiCorrData") library("printr") ...
############################################################ # model for deadtree wangbinzjcc 2014-1-24 9:03:43 ############################################################ setwd("F:\\DataW\\DeadStandingTrees") ## dea.10 <- read.csv("DeadData-10m-abun.csv") topo.10 <- read.csv("LG.topographic 10m poly4 2013-9-...
/旧资料/ModelForDeadTree.R
no_license
wangbinzjcc/DeadStandingTrees
R
false
false
6,302
r
############################################################ # model for deadtree wangbinzjcc 2014-1-24 9:03:43 ############################################################ setwd("F:\\DataW\\DeadStandingTrees") ## dea.10 <- read.csv("DeadData-10m-abun.csv") topo.10 <- read.csv("LG.topographic 10m poly4 2013-9-...
#' Ensure an object is a data frame, with rownames moved into a column #' #' @param x a data.frame or matrix #' @param newnames new column names, not including the rownames #' @param newcol the name of the new rownames column #' #' @return a data.frame, with rownames moved into a column and new column #' names assigned...
/R/utilities.R
no_license
nutterb/broom
R
false
false
9,776
r
#' Ensure an object is a data frame, with rownames moved into a column #' #' @param x a data.frame or matrix #' @param newnames new column names, not including the rownames #' @param newcol the name of the new rownames column #' #' @return a data.frame, with rownames moved into a column and new column #' names assigned...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/calc_sites.R \name{prepare_sites} \alias{prepare_sites} \title{Snap sites to streams and calculate attributes} \usage{ prepare_sites(sites_map, locid_c = NULL, pid_c = NULL, maxdist = NULL) } \arguments{ \item{sites_map}{character; name of si...
/man/prepare_sites.Rd
permissive
MiKatt/openSTARS
R
false
true
997
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/calc_sites.R \name{prepare_sites} \alias{prepare_sites} \title{Snap sites to streams and calculate attributes} \usage{ prepare_sites(sites_map, locid_c = NULL, pid_c = NULL, maxdist = NULL) } \arguments{ \item{sites_map}{character; name of si...
# Clear workspace rm(list = ls()) # Setup ################################################################################ # Packages library(rio) library(ggplot2) library(tidyverse) # Directories inputdir <- "data/nutrient_content/raw" outputdir <- "data/nutrient_content/processed" plotdir <- "data/nutrient_conte...
/data/vaitla_etal_2018/figure_nutrient_star.R
no_license
cfree14/nutrient_endowment
R
false
false
1,911
r
# Clear workspace rm(list = ls()) # Setup ################################################################################ # Packages library(rio) library(ggplot2) library(tidyverse) # Directories inputdir <- "data/nutrient_content/raw" outputdir <- "data/nutrient_content/processed" plotdir <- "data/nutrient_conte...
library(tidyverse) library(psych) #Import data leave.dat = read.csv(file="./Full transformed data (with exclusions).csv") #Subset of reasons leave.dat.sub = select(leave.dat, You.believe.the.stress.of.the.job.is.too.high:You.dislike.the.large.amount.of.effort.required.to.gain.funding) ####Give simpler variable names#...
/leaving academia script.R
no_license
PsychBrief/Why-do-psychologists-leave-academia
R
false
false
7,199
r
library(tidyverse) library(psych) #Import data leave.dat = read.csv(file="./Full transformed data (with exclusions).csv") #Subset of reasons leave.dat.sub = select(leave.dat, You.believe.the.stress.of.the.job.is.too.high:You.dislike.the.large.amount.of.effort.required.to.gain.funding) ####Give simpler variable names#...
first_nums <- 11:13 second_nums <- 1:3 first_nums + second_nums first_nums - second_nums first_nums * second_nums first_nums / second_nums first_nums**second_nums first_nums %/% second_nums first_nums %% second_nums
/r-essentials-gists/ch0213.R
no_license
jtlai0921/AEL023000_-
R
false
false
215
r
first_nums <- 11:13 second_nums <- 1:3 first_nums + second_nums first_nums - second_nums first_nums * second_nums first_nums / second_nums first_nums**second_nums first_nums %/% second_nums first_nums %% second_nums
\name{loadEntity-methods} \docType{methods} \alias{loadEntity-methods} \alias{loadEntity,character-method} \alias{loadEntity,SynapseLocationOwner-method} \alias{loadEntity,numeric-method} \title{ ~~ Methods for Function \code{loadEntity} ~~} \description{ ~~ Methods for function \code{loadEntity} ~~ } \section{Metho...
/man/loadEntity-methods.Rd
no_license
MattNapsAlot/rSynapseClient
R
false
false
618
rd
\name{loadEntity-methods} \docType{methods} \alias{loadEntity-methods} \alias{loadEntity,character-method} \alias{loadEntity,SynapseLocationOwner-method} \alias{loadEntity,numeric-method} \title{ ~~ Methods for Function \code{loadEntity} ~~} \description{ ~~ Methods for function \code{loadEntity} ~~ } \section{Metho...
library(pbdMPI) ### Name: wait ### Title: Wait Functions ### Aliases: wait waitany waitsome waitall ### Keywords: programming ### ** Examples ## Not run: ##D ### Save code in a file "demo.r" and run with 2 processors by ##D ### SHELL> mpiexec -np 2 Rscript demo.r ##D ##D spmd.code <- " ##D ### Initial. ##D suppre...
/data/genthat_extracted_code/pbdMPI/examples/dd_wait.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
755
r
library(pbdMPI) ### Name: wait ### Title: Wait Functions ### Aliases: wait waitany waitsome waitall ### Keywords: programming ### ** Examples ## Not run: ##D ### Save code in a file "demo.r" and run with 2 processors by ##D ### SHELL> mpiexec -np 2 Rscript demo.r ##D ##D spmd.code <- " ##D ### Initial. ##D suppre...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/print.crosstab.R \name{print.crosstab} \alias{print.crosstab} \title{Print crosstab results from crosstab()} \usage{ \method{print}{crosstab}(x, ..., digits = NULL, quote = FALSE, right = FALSE, row.names = FALSE) } \arguments{ \item{x}{The...
/man/print.crosstab.Rd
no_license
elinw/soctable
R
false
true
991
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/print.crosstab.R \name{print.crosstab} \alias{print.crosstab} \title{Print crosstab results from crosstab()} \usage{ \method{print}{crosstab}(x, ..., digits = NULL, quote = FALSE, right = FALSE, row.names = FALSE) } \arguments{ \item{x}{The...
setwd("~/3Fall2016/stat330/Exams") poll <- read.table("PM.txt",header=TRUE) head(poll) # Data Summary # require(ggplot2) data.plot <- ggplot(poll,aes(x=Cars,y=Particles)) data.plot + geom_point() + geom_smooth() + theme_grey() + ggtitle("Particles by Cars") + xlab("Cars") + ylab("Particles") with(poll,{cor(Particl...
/Pollution.R
no_license
josephd8/Pollution
R
false
false
2,594
r
setwd("~/3Fall2016/stat330/Exams") poll <- read.table("PM.txt",header=TRUE) head(poll) # Data Summary # require(ggplot2) data.plot <- ggplot(poll,aes(x=Cars,y=Particles)) data.plot + geom_point() + geom_smooth() + theme_grey() + ggtitle("Particles by Cars") + xlab("Cars") + ylab("Particles") with(poll,{cor(Particl...
# File name: brms_models_xp09.R # Online archive: gitlab # Authors: Brice Beffara & Amélie Bret # Wed Jul 04 14:31:56 2018 ------------------------------ # Contact: brice.beffara@slowpen.science amelie.bret@univ-grenoble-alpes.fr http://slowpen.science # # This R script was used to build and compute brms models # corr...
/xp09/03_lme4_models_xp09.R
permissive
bricebeffara/rwa_evaluative_conditioning_data_analysis
R
false
false
7,188
r
# File name: brms_models_xp09.R # Online archive: gitlab # Authors: Brice Beffara & Amélie Bret # Wed Jul 04 14:31:56 2018 ------------------------------ # Contact: brice.beffara@slowpen.science amelie.bret@univ-grenoble-alpes.fr http://slowpen.science # # This R script was used to build and compute brms models # corr...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hidden.R \name{other} \alias{other} \alias{.prepare} \alias{.simulate} \alias{.predict} \alias{.select} \title{Analysis functions for manuscript} \usage{ .prepare(X, filter = 1, cutoff = "zero", scale = TRUE) .simulate(x, effects) .predict(...
/man/other.Rd
no_license
rauschenberger/palasso
R
false
true
2,699
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hidden.R \name{other} \alias{other} \alias{.prepare} \alias{.simulate} \alias{.predict} \alias{.select} \title{Analysis functions for manuscript} \usage{ .prepare(X, filter = 1, cutoff = "zero", scale = TRUE) .simulate(x, effects) .predict(...
##################### ### SET LIBRARY library(sqldf) library(lubridate) ## Set directory setwd("C:/Users/bmolin/Documents/Coursera/Exploratory Analysis/Week 1/ExData_Plotting1-master") ##################### ### Importing Data --------------------------------------------- # Download Data file <- "https...
/plot3.R
no_license
rivermaster5/ExData_Plotting1
R
false
false
1,970
r
##################### ### SET LIBRARY library(sqldf) library(lubridate) ## Set directory setwd("C:/Users/bmolin/Documents/Coursera/Exploratory Analysis/Week 1/ExData_Plotting1-master") ##################### ### Importing Data --------------------------------------------- # Download Data file <- "https...
###################### ####Lab Session 12#### ###################### #实现 QR 算法 QR_algorithm <- function(A){ # q_0 qq <- qr(A) Q <- qr.Q(qq) # 迭代计算 for (i in 1:100){ qq <- qr(qr.R(qq) %*% qr.Q(qq)) # 计算Qk Q <- Q %*% qr.Q(qq) } qq <- qr(qr.R(qq) %*% qr.Q(qq)) S = qr.Q(qq) %*% qr.R(qq) retur...
/NumericalMatrixComputing/mysvd.R
no_license
AngelPone/SCalgorithm
R
false
false
1,061
r
###################### ####Lab Session 12#### ###################### #实现 QR 算法 QR_algorithm <- function(A){ # q_0 qq <- qr(A) Q <- qr.Q(qq) # 迭代计算 for (i in 1:100){ qq <- qr(qr.R(qq) %*% qr.Q(qq)) # 计算Qk Q <- Q %*% qr.Q(qq) } qq <- qr(qr.R(qq) %*% qr.Q(qq)) S = qr.Q(qq) %*% qr.R(qq) retur...
setwd("C:/Users/chink/Desktop/Data Science Material/R_workingdir") ## Calling the tidyData.R script to load the dataset source("tidyData.R") ## Creating new folder if(!file.exists("graphs")){ dir.create("graphs") } png(filename = "graphs/plot1.png",width = 480 ,height = 480 ,units = "px") hist(pollution_data...
/plot1.R
no_license
Srujeeth7/ExData_Plotting1
R
false
false
407
r
setwd("C:/Users/chink/Desktop/Data Science Material/R_workingdir") ## Calling the tidyData.R script to load the dataset source("tidyData.R") ## Creating new folder if(!file.exists("graphs")){ dir.create("graphs") } png(filename = "graphs/plot1.png",width = 480 ,height = 480 ,units = "px") hist(pollution_data...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/listLabels.R \name{listLabels} \alias{listLabels} \title{List labels} \usage{ listLabels(account.id, token) } \arguments{ \item{account.id}{ID of the account to retrieve labels from.} \item{token}{A valid token as returned by \code{\link{fbA...
/man/listLabels.Rd
no_license
JohnCoene/fbadsinsightsr
R
false
true
805
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/listLabels.R \name{listLabels} \alias{listLabels} \title{List labels} \usage{ listLabels(account.id, token) } \arguments{ \item{account.id}{ID of the account to retrieve labels from.} \item{token}{A valid token as returned by \code{\link{fbA...
gruppen <- c(23,9,10) # wir haben 23 aus gruppe 1, 9 aus gruppe 2 usw. questions <- c(20,10,8) # wir fragen 20 aus g1, 10 aus g2, 9 aus g3 wie wahrscheinlich ist das # die summe könnte man als ziehungen interpretieren dmultinom(gruppen, size = sum(gruppen), questions) x[1,1:3] <- c(3,2,1)...
/multinomial.R
no_license
philipp-gaddi/rscripts
R
false
false
343
r
gruppen <- c(23,9,10) # wir haben 23 aus gruppe 1, 9 aus gruppe 2 usw. questions <- c(20,10,8) # wir fragen 20 aus g1, 10 aus g2, 9 aus g3 wie wahrscheinlich ist das # die summe könnte man als ziehungen interpretieren dmultinom(gruppen, size = sum(gruppen), questions) x[1,1:3] <- c(3,2,1)...
/shiny02.R
no_license
tyosem/jpa2021
R
false
false
411
r
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/Graphics.R \name{plotMSSignalDistributions} \alias{plotMSSignalDistributions} \title{Plot ms.signal distributions} \usage{ plotMSSignalDistributions(d, col = 1:100, cex.axis = 1, cex.lab = 1, ylab = "Frequnecy", xlab = "MS-Signal", ...
/man/plotMSSignalDistributions.Rd
no_license
ealearn/SafeQuant
R
false
false
536
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/Graphics.R \name{plotMSSignalDistributions} \alias{plotMSSignalDistributions} \title{Plot ms.signal distributions} \usage{ plotMSSignalDistributions(d, col = 1:100, cex.axis = 1, cex.lab = 1, ylab = "Frequnecy", xlab = "MS-Signal", ...
testlist <- list(Rs = c(-1.9577272327571e+276, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), atmp = numeric(0), relh = c(7.64681398433536e-304, -4.29227809743625e-307, 2.76241609328029e+82, -2.93112217825115e-158, 9.03412394302482e-46, 7.31195213563656e+256, -1.939255246...
/meteor/inst/testfiles/ET0_Makkink/AFL_ET0_Makkink/ET0_Makkink_valgrind_files/1615862344-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
473
r
testlist <- list(Rs = c(-1.9577272327571e+276, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), atmp = numeric(0), relh = c(7.64681398433536e-304, -4.29227809743625e-307, 2.76241609328029e+82, -2.93112217825115e-158, 9.03412394302482e-46, 7.31195213563656e+256, -1.939255246...
c DCNF-Autarky [version 0.0.1]. c Copyright (c) 2018-2019 Swansea University. c c Input Clause Count: 2 c Performing E1-Autarky iteration. c Input Parameter (command line, file): c input filename QBFLIB/Jordan-Kaiser/reduction-finding-full-set-params-k1c3n4/ntrivil_falsequ_1344n.qdimacs c output filename /tmp/dc...
/code/dcnf-ankit-optimized/Results/QBFLIB-2018/E1/Experiments/Jordan-Kaiser/reduction-finding-full-set-params-k1c3n4/ntrivil_falsequ_1344n/ntrivil_falsequ_1344n.R
no_license
arey0pushpa/dcnf-autarky
R
false
false
644
r
c DCNF-Autarky [version 0.0.1]. c Copyright (c) 2018-2019 Swansea University. c c Input Clause Count: 2 c Performing E1-Autarky iteration. c Input Parameter (command line, file): c input filename QBFLIB/Jordan-Kaiser/reduction-finding-full-set-params-k1c3n4/ntrivil_falsequ_1344n.qdimacs c output filename /tmp/dc...
#' Read an MT3DMS advection package file #' #' \code{read_adv} reads in an MT3DMS advection package file and returns it as an \code{\link{RMT3DMS}} adv object. #' #' @param file filename; typically '*.adv' #' @return object of class adv #' @importFrom readr read_lines #' @export read_adv <- function(file = {cat('Plea...
/R/read_adv.R
no_license
CasillasMX/RMT3DMS
R
false
false
2,054
r
#' Read an MT3DMS advection package file #' #' \code{read_adv} reads in an MT3DMS advection package file and returns it as an \code{\link{RMT3DMS}} adv object. #' #' @param file filename; typically '*.adv' #' @return object of class adv #' @importFrom readr read_lines #' @export read_adv <- function(file = {cat('Plea...
# Created 10.12.2019 # Fit INLA for South Africa #----------------------------------------------------------------------------------------- library(maptools) library(INLA) library(spdep) library(pbapply) library(sf) library(dplyr) # load the data dat <- readRDS("data/data_DataSouthAfri...
/rfiles/R_2_BMA_NoCorrection.R
no_license
wangdafacai/CervixHIVRSA
R
false
false
2,489
r
# Created 10.12.2019 # Fit INLA for South Africa #----------------------------------------------------------------------------------------- library(maptools) library(INLA) library(spdep) library(pbapply) library(sf) library(dplyr) # load the data dat <- readRDS("data/data_DataSouthAfri...
# Install and load packages package_names <- c("survey","dplyr","foreign","devtools") lapply(package_names, function(x) if(!x %in% installed.packages()) install.packages(x)) lapply(package_names, require, character.only=T) install_github("e-mitchell/meps_r_pkg/MEPS") library(MEPS) options(survey.lonely.ps...
/mepstrends/hc_care/json/code/r/pctPOP__agegrps__child_listen__.r
permissive
HHS-AHRQ/MEPS-summary-tables
R
false
false
1,927
r
# Install and load packages package_names <- c("survey","dplyr","foreign","devtools") lapply(package_names, function(x) if(!x %in% installed.packages()) install.packages(x)) lapply(package_names, require, character.only=T) install_github("e-mitchell/meps_r_pkg/MEPS") library(MEPS) options(survey.lonely.ps...
################################################ ## Exercises ################################### ################################################ # c - concatenate # - takes two (or more) vector and joins them together c(1, 2, 3) c(c(1,2,3), c(4,5,6)) # - they need to be of the same type, though! c(1,2, "thre...
/lesson_1.R
no_license
willpearse/r-intro-Wolflab
R
false
false
2,214
r
################################################ ## Exercises ################################### ################################################ # c - concatenate # - takes two (or more) vector and joins them together c(1, 2, 3) c(c(1,2,3), c(4,5,6)) # - they need to be of the same type, though! c(1,2, "thre...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/d_soainew.R \name{d_CohortAdjust} \alias{d_CohortAdjust} \title{d_CohortAdjust a function to adjust the redistributed open age group deaths according to cohort size differences detected in earlier ages} \usage{ d_CohortAdjust(Dnew, OA, ACVVma...
/HMDLexis/HMDLexis/man/d_CohortAdjust.Rd
no_license
timriffe/HMDLexis
R
false
true
1,487
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/d_soainew.R \name{d_CohortAdjust} \alias{d_CohortAdjust} \title{d_CohortAdjust a function to adjust the redistributed open age group deaths according to cohort size differences detected in earlier ages} \usage{ d_CohortAdjust(Dnew, OA, ACVVma...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ecdf_two_stage.R \name{ecdf_two_stage} \alias{ecdf_two_stage} \title{Weighted empirical cumulative distribution function} \usage{ ecdf_two_stage(x, aaa) } \arguments{ \item{x}{A numeric vector whose cumulative distribution you wish to compute...
/man/ecdf_two_stage.Rd
no_license
gailg/rmap
R
false
true
1,319
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ecdf_two_stage.R \name{ecdf_two_stage} \alias{ecdf_two_stage} \title{Weighted empirical cumulative distribution function} \usage{ ecdf_two_stage(x, aaa) } \arguments{ \item{x}{A numeric vector whose cumulative distribution you wish to compute...
#' Probit estimation #' #' Estimates probit parameters and fitted values #' @param Y The outcome variables #' @param X The explanatory variables #' #' NOTE: Add variance later. documentation is funny #' @export probit <- function(Y, X, const=TRUE) { n.X <- as.matrix(X) n.Y <- as.matrix(Y) if (const==TRUE) { ...
/R/probit.R
no_license
samuelhigbee/myRtools
R
false
false
662
r
#' Probit estimation #' #' Estimates probit parameters and fitted values #' @param Y The outcome variables #' @param X The explanatory variables #' #' NOTE: Add variance later. documentation is funny #' @export probit <- function(Y, X, const=TRUE) { n.X <- as.matrix(X) n.Y <- as.matrix(Y) if (const==TRUE) { ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/inputs_placeholders.R \name{ExecutionInput} \alias{ExecutionInput} \title{ExecutionInput Class} \description{ Top-level class for execution input placeholders. } \section{Super class}{ \code{\link[stepfunctions:Placeholder]{stepfunctions::Pla...
/man/ExecutionInput.Rd
permissive
DyfanJones/aws-step-functions-data-science-sdk-r
R
false
true
3,101
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/inputs_placeholders.R \name{ExecutionInput} \alias{ExecutionInput} \title{ExecutionInput Class} \description{ Top-level class for execution input placeholders. } \section{Super class}{ \code{\link[stepfunctions:Placeholder]{stepfunctions::Pla...
##################################################### #Lattice plotting from Coursera Programing in R class # ##################################################### library(lattice) package? lattice library(help=lattice) data(environmental) ?environmental head(environmental) e<-environmental ##XYPLOTS#################...
/Lattice.R
no_license
sdperez/RSampleCode
R
false
false
1,938
r
##################################################### #Lattice plotting from Coursera Programing in R class # ##################################################### library(lattice) package? lattice library(help=lattice) data(environmental) ?environmental head(environmental) e<-environmental ##XYPLOTS#################...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/method-io.R \name{mp_import_metaphlan} \alias{mp_import_metaphlan} \title{Import function to load the output of MetaPhlAn.} \usage{ mp_import_metaphlan( profile, mapfilename = NULL, treefile = NULL, linenum = NULL, ... ) } \argument...
/man/mp_import_metaphlan.Rd
no_license
yezi0721/MicrobiotaProcess
R
false
true
1,746
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/method-io.R \name{mp_import_metaphlan} \alias{mp_import_metaphlan} \title{Import function to load the output of MetaPhlAn.} \usage{ mp_import_metaphlan( profile, mapfilename = NULL, treefile = NULL, linenum = NULL, ... ) } \argument...
plot.C5.0 <- function(x, trial = 0, subtree = NULL, ...) { if(x$rules != "") stop("tree models only") if(trial > x$trials["Actual"]-1) { warning(paste("Only", x$trials["Actual"], "trials are in the model.", "Setting 'trial' to", x$trials["Actual"]-1, "(the plot code is zero-b...
/pkg/C50/R/as.party.C5.0.R
no_license
rakeshnbabu/C5.0
R
false
false
8,869
r
plot.C5.0 <- function(x, trial = 0, subtree = NULL, ...) { if(x$rules != "") stop("tree models only") if(trial > x$trials["Actual"]-1) { warning(paste("Only", x$trials["Actual"], "trials are in the model.", "Setting 'trial' to", x$trials["Actual"]-1, "(the plot code is zero-b...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{\%>\%} \alias{\%>\%} \title{Pipe operator} \usage{ lhs \%>\% rhs } \description{ See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. } \keyword{internal}
/man/pipe.Rd
permissive
Rapporteket/NORIC
R
false
true
256
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{\%>\%} \alias{\%>\%} \title{Pipe operator} \usage{ lhs \%>\% rhs } \description{ See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. } \keyword{internal}
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data_check.R \name{eem_absdil} \alias{eem_absdil} \title{Multiply absorbance data according to the dilution and remove absorbance from samples where undiluted data is used.} \usage{ eem_absdil( abs_data, eem_list = NULL, dilution = NULL...
/man/eem_absdil.Rd
no_license
MatthiasPucher/staRdom
R
false
true
1,080
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data_check.R \name{eem_absdil} \alias{eem_absdil} \title{Multiply absorbance data according to the dilution and remove absorbance from samples where undiluted data is used.} \usage{ eem_absdil( abs_data, eem_list = NULL, dilution = NULL...
superpccox <- function(file1, file2, nstep, prop, nfold, cv.order, sub){ #Split the data file into training and testing data files if (is.null(sub)) { sub <- sample(nrow(file2), floor(nrow(file1) * prop)) #### sample size cannot be too small for choosing threshold } else sub = sub training <- fi...
/superpccox.R
no_license
GenomicsNX/GAC
R
false
false
2,924
r
superpccox <- function(file1, file2, nstep, prop, nfold, cv.order, sub){ #Split the data file into training and testing data files if (is.null(sub)) { sub <- sample(nrow(file2), floor(nrow(file1) * prop)) #### sample size cannot be too small for choosing threshold } else sub = sub training <- fi...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/seurat.R \name{run_diffusion} \alias{run_diffusion} \title{Run t-distributed Stochastic Neighbor Embedding} \usage{ run_diffusion(object, cells.use = NULL, dims.use = 1:5, k.seed = 1, do.fast = FALSE, add.iter = 0, genes.use = NULL, reduc...
/man/run_diffusion.Rd
no_license
paodan/studySeu
R
false
true
1,653
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/seurat.R \name{run_diffusion} \alias{run_diffusion} \title{Run t-distributed Stochastic Neighbor Embedding} \usage{ run_diffusion(object, cells.use = NULL, dims.use = 1:5, k.seed = 1, do.fast = FALSE, add.iter = 0, genes.use = NULL, reduc...
###Note: any changes to this file should be at the END so as to not mess up the seed calls. library(clusterExperiment) # library(devtools) # load_all() data(simData, envir = environment()) if(ncol(simData) != 300) { stop("not current version of simData") #get all kinds of annoyances because using old version. #Ca...
/tests/testthat/helper_create_objects.R
no_license
kevinbenac/clusterExperiment
R
false
false
5,225
r
###Note: any changes to this file should be at the END so as to not mess up the seed calls. library(clusterExperiment) # library(devtools) # load_all() data(simData, envir = environment()) if(ncol(simData) != 300) { stop("not current version of simData") #get all kinds of annoyances because using old version. #Ca...
#' Run child models for stacking #' #' Fits all models specified in the passed stacking object. M*C*K + M models are run where M is the number of initialized models, #' C is the number of columns/iterations for crossfold validation and K is the number of folds. #' #' @param st stacker governer. #' @import data.table #'...
/R/run_stacking_child_models.R
no_license
dahcase/mbgstacking
R
false
false
3,249
r
#' Run child models for stacking #' #' Fits all models specified in the passed stacking object. M*C*K + M models are run where M is the number of initialized models, #' C is the number of columns/iterations for crossfold validation and K is the number of folds. #' #' @param st stacker governer. #' @import data.table #'...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/thinning.R \name{thinning} \alias{thinning} \title{Thinning Algorithm Visualization} \usage{ thinning( maxTime = 24, intensityFcn = function(x) (5 - sin(x/0.955) - (4 * cos(x/3.82)))/0.5, majorizingFcn = NULL, majorizingFcnType = NULL...
/man/thinning.Rd
no_license
cran/simEd
R
false
true
5,823
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/thinning.R \name{thinning} \alias{thinning} \title{Thinning Algorithm Visualization} \usage{ thinning( maxTime = 24, intensityFcn = function(x) (5 - sin(x/0.955) - (4 * cos(x/3.82)))/0.5, majorizingFcn = NULL, majorizingFcnType = NULL...
numPerPatch122000 <- c(2537,2463)
/NatureEE-data-archive/Run203121/JAFSdata/JAFSnumPerPatch122000.R
no_license
flaxmans/NatureEE2017
R
false
false
34
r
numPerPatch122000 <- c(2537,2463)
############################################################# ## name : plot1.R ## ## aim : Read the data from UC Irvine Machine Learning ## ## Repository and plot a histogram of the Global ## ## Active Power ## ## output ...
/plot1.R
no_license
cchapus/ExData_Plotting1
R
false
false
1,341
r
############################################################# ## name : plot1.R ## ## aim : Read the data from UC Irvine Machine Learning ## ## Repository and plot a histogram of the Global ## ## Active Power ## ## output ...
create.poisson.blocks <- function(data0,N,N.blocks) { # block are considered here as NA but they can be outliers as well epsilon.blocks <- -1+length(data0[,1])/N.blocks intervals <- rpois(N.blocks,epsilon.blocks) # the first data points contains data. read_ <- rep(0,N) k <- 1 for(i in 1:length(inter...
/PartII.aggregation/step2_contamination.of.datasets/create.poisson.blocks_v1.R
no_license
fritte2/ctbi_article
R
false
false
558
r
create.poisson.blocks <- function(data0,N,N.blocks) { # block are considered here as NA but they can be outliers as well epsilon.blocks <- -1+length(data0[,1])/N.blocks intervals <- rpois(N.blocks,epsilon.blocks) # the first data points contains data. read_ <- rep(0,N) k <- 1 for(i in 1:length(inter...
model{ # THE 0-1 TRICK for (t in 1:round(T/2)){ zeros[t] ~ dpois(PHI[t]) PHI[t] <- -loglik[t] + C loglik[t] <- log(exp(log(Q_even[t]) + log(sum(G_odd[,t] * Q_odd[,t] * G_even[,t])))) } C <- 1000000 # EVEN IMPUTED, ODD INTEGRATED for (t in 1:round(T/2)){ Q_even[t] <- dnorm(y[2*t],0, 1...
/SV/sv_model_hmm.R
no_license
TANG16/SCDA
R
false
false
2,769
r
model{ # THE 0-1 TRICK for (t in 1:round(T/2)){ zeros[t] ~ dpois(PHI[t]) PHI[t] <- -loglik[t] + C loglik[t] <- log(exp(log(Q_even[t]) + log(sum(G_odd[,t] * Q_odd[,t] * G_even[,t])))) } C <- 1000000 # EVEN IMPUTED, ODD INTEGRATED for (t in 1:round(T/2)){ Q_even[t] <- dnorm(y[2*t],0, 1...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/example_combo2.R \name{example-combo2} \alias{example-combo2} \title{Two-drug combination example} \description{ Example using a combination of two experimental drugs. } \details{ The following example is described in the reference Neuenschwa...
/man/example-combo2.Rd
no_license
cran/OncoBayes2
R
false
true
5,850
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/example_combo2.R \name{example-combo2} \alias{example-combo2} \title{Two-drug combination example} \description{ Example using a combination of two experimental drugs. } \details{ The following example is described in the reference Neuenschwa...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/612.Empirical_x.R \name{empericalBAx} \alias{empericalBAx} \title{The empirical Bayesian approach for Beta-Binomial model given x} \usage{ empericalBAx(x, n, alp, sL, sU) } \arguments{ \item{x}{- Number of successes} \item{n}{- Number of tri...
/man/empericalBAx.Rd
no_license
ElsevierSoftwareX/SOFTX-D-16-00020
R
false
true
1,649
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/612.Empirical_x.R \name{empericalBAx} \alias{empericalBAx} \title{The empirical Bayesian approach for Beta-Binomial model given x} \usage{ empericalBAx(x, n, alp, sL, sU) } \arguments{ \item{x}{- Number of successes} \item{n}{- Number of tri...
\name{post_repro_mortality} \alias{post_repro_mortality} %- Also NEED an '\alias' for EACH other topic documented here. \title{ post_repro_mortality } \description{ %% ~~ A concise (1-5 lines) description of what the function does. ~~ } \usage{ post_repro_mortality() } %- maybe also 'usage' for other objects documente...
/master/man/post_repro_mortality.Rd
no_license
Ibasam/MetaIBASAM
R
false
false
1,261
rd
\name{post_repro_mortality} \alias{post_repro_mortality} %- Also NEED an '\alias' for EACH other topic documented here. \title{ post_repro_mortality } \description{ %% ~~ A concise (1-5 lines) description of what the function does. ~~ } \usage{ post_repro_mortality() } %- maybe also 'usage' for other objects documente...
# Internal utility functions used by the redshift tools #' @importFrom "aws.s3" "put_object" "bucket_exists" #' @importFrom "utils" "write.csv" uploadToS3 = function (data, bucket, split_files){ prefix=paste0(sample(letters,16),collapse = "") if(!bucket_exists(bucket)){ stop("Bucket does not exist") } if(n...
/R/internal.R
permissive
keithabailey/redshiftTools
R
false
false
1,246
r
# Internal utility functions used by the redshift tools #' @importFrom "aws.s3" "put_object" "bucket_exists" #' @importFrom "utils" "write.csv" uploadToS3 = function (data, bucket, split_files){ prefix=paste0(sample(letters,16),collapse = "") if(!bucket_exists(bucket)){ stop("Bucket does not exist") } if(n...
source('R_algs/lrps.R') source('R_algs/fit_lrps_path.R') #!/usr/bin/env Rscript suppressMessages(library(RcppCNPy)) args = commandArgs(trailingOnly=TRUE) samples_filename = args[1] samples_filename = "tmp_samples.npy" samples = npyLoad(samples_filename) Sigma = cor(samples) path = fit.low.rank.plus.sparse.path( Si...
/paper_experiments/code/R_algs/lrps_path.R
no_license
uhlerlab/decamfound
R
false
false
570
r
source('R_algs/lrps.R') source('R_algs/fit_lrps_path.R') #!/usr/bin/env Rscript suppressMessages(library(RcppCNPy)) args = commandArgs(trailingOnly=TRUE) samples_filename = args[1] samples_filename = "tmp_samples.npy" samples = npyLoad(samples_filename) Sigma = cor(samples) path = fit.low.rank.plus.sparse.path( Si...
/R/make.clust.mids.R
no_license
jaroyle/oSCR
R
false
false
381
r
\name{results} \alias{results} \title{ Generic Function -- results } \description{ Generic function } \usage{ results(object) } \arguments{ \item{object}{ Depending on the class of \code{object} depends on the method used (and if one exists) } } \details{ Generic Function } \value{ Depends on the cals...
/man/results.Rd
no_license
taylors2/PeriodCPT
R
false
false
685
rd
\name{results} \alias{results} \title{ Generic Function -- results } \description{ Generic function } \usage{ results(object) } \arguments{ \item{object}{ Depending on the class of \code{object} depends on the method used (and if one exists) } } \details{ Generic Function } \value{ Depends on the cals...
# This file will source all the others and pull together a 'master data set' including: # - Previous data on the cascade (calibration-data.R) # - Assumptions (assumptions.R) # - Marrakech data (as the end target) (marrakech-data.R) # source("server/calibration/calibration-data.R", local = FALSE) # source("server...
/CascadeDashboard/server/calibration/master.R
no_license
jackolney/WhoCascade
R
false
false
11,244
r
# This file will source all the others and pull together a 'master data set' including: # - Previous data on the cascade (calibration-data.R) # - Assumptions (assumptions.R) # - Marrakech data (as the end target) (marrakech-data.R) # source("server/calibration/calibration-data.R", local = FALSE) # source("server...
library(tidyverse) library(data.table) theme_set(theme_bw(12)) #meghan's setwd("C://Users/mavolio2/Dropbox/converge_diverge/datasets/Traits/Try Data Nov 2019") setwd("C://Users/megha/Dropbox/converge_diverge/datasets/Traits/Try Data Nov 2019") #kim's desktop setwd('C:\\Users\\komatsuk\\Dropbox (Smithsonian)\\working ...
/Cleaning and Merging to TRY/cleaning try data_original.R
no_license
mavolio/scorre
R
false
false
68,788
r
library(tidyverse) library(data.table) theme_set(theme_bw(12)) #meghan's setwd("C://Users/mavolio2/Dropbox/converge_diverge/datasets/Traits/Try Data Nov 2019") setwd("C://Users/megha/Dropbox/converge_diverge/datasets/Traits/Try Data Nov 2019") #kim's desktop setwd('C:\\Users\\komatsuk\\Dropbox (Smithsonian)\\working ...
# TESTING OF SETTING UP ETO CALCULATION BY PENMAN-MONTEITH EQUATION setwd('C:\\01.PSU\\02.DataAnalysis\\testing') #("..\testing") for reproducibility library(dplyr) library(data.table) library(lubridate) library(foreach) # Input data SDGridpoints <- fread("SDGrid0125sort.txt") SDCoordElevation <- fread("SDE...
/src/from_windows/ret_testing.R
no_license
htn5098/heidi_master_repo
R
false
false
8,009
r
# TESTING OF SETTING UP ETO CALCULATION BY PENMAN-MONTEITH EQUATION setwd('C:\\01.PSU\\02.DataAnalysis\\testing') #("..\testing") for reproducibility library(dplyr) library(data.table) library(lubridate) library(foreach) # Input data SDGridpoints <- fread("SDGrid0125sort.txt") SDCoordElevation <- fread("SDE...
# Public transportation data # Source: library(tidycensus) library(tidyverse) options(tigris_use_cache = TRUE) census_api_key("9080c0a6748ee902d3ab1f59571efa6416a7e3bf", install = T) # public trans: B08006_009E pub_trans = get_acs(variables = "B08006_008", geography="metropolitan statistical are...
/Data Extract/Code/pub_trans.R
permissive
allisonbertie5/tamu_datathon_2020
R
false
false
707
r
# Public transportation data # Source: library(tidycensus) library(tidyverse) options(tigris_use_cache = TRUE) census_api_key("9080c0a6748ee902d3ab1f59571efa6416a7e3bf", install = T) # public trans: B08006_009E pub_trans = get_acs(variables = "B08006_008", geography="metropolitan statistical are...
# read in data # use only two days data # str(data) datafull <- read.table("household_power_consumption.txt", header=TRUE, sep=";", stringsAsFactors=FALSE, dec=".") data <- datafull[datafull$Date %in% c("1/2/2007","2/2/2007") ,] # str(data) , check data # combine Date and Time can convert to R datetime forma...
/plot4.R
no_license
wayneleung555/ExData_Plotting1
R
false
false
1,393
r
# read in data # use only two days data # str(data) datafull <- read.table("household_power_consumption.txt", header=TRUE, sep=";", stringsAsFactors=FALSE, dec=".") data <- datafull[datafull$Date %in% c("1/2/2007","2/2/2007") ,] # str(data) , check data # combine Date and Time can convert to R datetime forma...
################################################################################# #Code supplement for Appendix A in Payne, Lee, and Federmeier (2015). #Submitted to Psychophysiology #Linear Mixed-Effects Models 1 and 2. ################################################################################# #load required p...
/singleItemEEG.R
no_license
payne12/singleWordEEG
R
false
false
11,919
r
################################################################################# #Code supplement for Appendix A in Payne, Lee, and Federmeier (2015). #Submitted to Psychophysiology #Linear Mixed-Effects Models 1 and 2. ################################################################################# #load required p...
# Project: The fast and the sorrow # Simulated by Timo Roettger # Part 00: Packrat::recover # Date: 12/18/2018 packrat::restore()
/scripts/00_packratRestore copy.R
no_license
troettge/BhamDemo
R
false
false
130
r
# Project: The fast and the sorrow # Simulated by Timo Roettger # Part 00: Packrat::recover # Date: 12/18/2018 packrat::restore()
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/beanbag.R \name{getPreviousNAV} \alias{getPreviousNAV} \title{Gets the previous NAN either using external or internal valuations.} \usage{ getPreviousNAV( portfolio, date, ccy, period, external, session, inception = as.Date("190...
/man/getPreviousNAV.Rd
no_license
beatnaut/remaputils
R
false
true
978
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/beanbag.R \name{getPreviousNAV} \alias{getPreviousNAV} \title{Gets the previous NAN either using external or internal valuations.} \usage{ getPreviousNAV( portfolio, date, ccy, period, external, session, inception = as.Date("190...
library(lubridate) library("depmixS4") countLines <- function(data){ row_num <- nrow(data) Dates<-data.frame(paste0(data[1:row_num, 1])) current_date<-Dates[2,1] lines_count <- list() count<-1 for (i in 2:row_num) { if(Dates[i,1]==current_date) { count = count + 1 } else { ...
/code/Hmm/HMMuniAnamalyDetection4.R
no_license
manavs396/cyber_security
R
false
false
10,752
r
library(lubridate) library("depmixS4") countLines <- function(data){ row_num <- nrow(data) Dates<-data.frame(paste0(data[1:row_num, 1])) current_date<-Dates[2,1] lines_count <- list() count<-1 for (i in 2:row_num) { if(Dates[i,1]==current_date) { count = count + 1 } else { ...
# library(gstat) # library(sp) # library(sf) # library(tidyverse) ## #### gstat classic idw0_W = function (data, newdata, y, idp = 2) { s = sp::coordinates(data) s0 = sp::coordinates(newdata) D = sp::spDists(s0, s) D } dist_mat_any <- function(data_1, data_2) { if(inherits(data_1, c("SpatialPointsDataFra...
/spatial/inter_same_Dmat/idw_dplyr.R
no_license
MatthieuStigler/Misc
R
false
false
10,956
r
# library(gstat) # library(sp) # library(sf) # library(tidyverse) ## #### gstat classic idw0_W = function (data, newdata, y, idp = 2) { s = sp::coordinates(data) s0 = sp::coordinates(newdata) D = sp::spDists(s0, s) D } dist_mat_any <- function(data_1, data_2) { if(inherits(data_1, c("SpatialPointsDataFra...
sampleFile <- "samples.txt" classificationResults <- paste(sampleFile, '.classification', sep = "") outputFile <- paste(classificationResults, '.plot.pdf', sep = "") D <- read.delim(classificationResults, header = T) truthValues <- unique(D[["truth"]]) stopifnot(length(truthValues) > 0) pdf(outputFile) for(tV in...
/plotClassificationResultsWithTruth.R
permissive
SebastianMeyer1989/UltraPlexer
R
false
false
502
r
sampleFile <- "samples.txt" classificationResults <- paste(sampleFile, '.classification', sep = "") outputFile <- paste(classificationResults, '.plot.pdf', sep = "") D <- read.delim(classificationResults, header = T) truthValues <- unique(D[["truth"]]) stopifnot(length(truthValues) > 0) pdf(outputFile) for(tV in...
read.delay_scan<-function(filename, time_max=4, time_offset=0, zero_offset=1:10, quick_plot=T, ...){ data<-read.table(filename)$V1 time<-seq(0,time_max,,length(read.table(filename)...
/R/read.delay_scan.R
no_license
tjconstant/photonMonkey
R
false
false
558
r
read.delay_scan<-function(filename, time_max=4, time_offset=0, zero_offset=1:10, quick_plot=T, ...){ data<-read.table(filename)$V1 time<-seq(0,time_max,,length(read.table(filename)...
######### Titanic Model: Conventional Method # Packages require(caret) require(randomForest) require(readxl) require(e1071) # Loading Data Survival <- read.csv("~/Desktop/Root/Projects/Titanic Competition/gender_submission.csv", header = TRUE) Test <- read.csv("~/Desktop/Root/Projects/Titanic Competition/test.csv", h...
/Conventional Approach.R
no_license
mselias/A-Challenge-of-Titanic-Proportions
R
false
false
7,556
r
######### Titanic Model: Conventional Method # Packages require(caret) require(randomForest) require(readxl) require(e1071) # Loading Data Survival <- read.csv("~/Desktop/Root/Projects/Titanic Competition/gender_submission.csv", header = TRUE) Test <- read.csv("~/Desktop/Root/Projects/Titanic Competition/test.csv", h...
## unit tests will not be done if RUnit is not available if(require("RUnit", quietly=TRUE)) { ## --- Setup --- pkg <- "marginalRisk" # <-- Change to package name! if(Sys.getenv("RCMDCHECK") == "FALSE") { ## Path to unit tests for standalone running under Makefile (not R CMD check) ## PKG/t...
/tests/doRUnit.R
no_license
cran/marginalRisk
R
false
false
2,147
r
## unit tests will not be done if RUnit is not available if(require("RUnit", quietly=TRUE)) { ## --- Setup --- pkg <- "marginalRisk" # <-- Change to package name! if(Sys.getenv("RCMDCHECK") == "FALSE") { ## Path to unit tests for standalone running under Makefile (not R CMD check) ## PKG/t...
# load library library(dkMetExplorer) library(tidyr) library(dplyr) library(lubridate) library(ggplot2) library(ncdf4) # set work directory workDir = 'L:/reanalysis/som_synoptic/daily_obs' setwd(file.path(workDir)) # # set data # set download element element <- c("TEM_Avg","TEM_Max","TEM_Min","PRE_Time_0808","WIN_S...
/demo/tigge_som_data_process.R
permissive
woodsouth/nmcMetExplore
R
false
false
4,781
r
# load library library(dkMetExplorer) library(tidyr) library(dplyr) library(lubridate) library(ggplot2) library(ncdf4) # set work directory workDir = 'L:/reanalysis/som_synoptic/daily_obs' setwd(file.path(workDir)) # # set data # set download element element <- c("TEM_Avg","TEM_Max","TEM_Min","PRE_Time_0808","WIN_S...
library(glmnet) mydata = read.table("./TrainingSet/ReliefF/upper_aerodigestive_tract.csv",head=T,sep=",") x = as.matrix(mydata[,4:ncol(mydata)]) y = as.matrix(mydata[,1]) set.seed(123) glm = cv.glmnet(x,y,nfolds=10,type.measure="mae",alpha=0.35,family="gaussian",standardize=TRUE) sink('./Model/EN/ReliefF/upper_aerodige...
/Model/EN/ReliefF/upper_aerodigestive_tract/upper_aerodigestive_tract_047.R
no_license
leon1003/QSMART
R
false
false
409
r
library(glmnet) mydata = read.table("./TrainingSet/ReliefF/upper_aerodigestive_tract.csv",head=T,sep=",") x = as.matrix(mydata[,4:ncol(mydata)]) y = as.matrix(mydata[,1]) set.seed(123) glm = cv.glmnet(x,y,nfolds=10,type.measure="mae",alpha=0.35,family="gaussian",standardize=TRUE) sink('./Model/EN/ReliefF/upper_aerodige...
########################################## # Generates specieslist # # Compatible with new LIST structure # # Modified to work w/ SAV component # # # # Created by: MJM - March 21, 2014 # # Updated: 07/08/2014 # #################...
/old FUNCTIONS/SPECIES21.R
no_license
mccannecology/model
R
false
false
2,286
r
########################################## # Generates specieslist # # Compatible with new LIST structure # # Modified to work w/ SAV component # # # # Created by: MJM - March 21, 2014 # # Updated: 07/08/2014 # #################...
\name{QA} \alias{QA} \title{ Quality assessment of geographic assignments } \description{ How well does a given isoscape and/or known origin data set constrain the geographic origin of samples? Uses iterative re-sampling of known origin data to evaluate sample assignments and reports a suite of quality metrics. } \...
/man/QA.rd
no_license
SPATIAL-Lab/assignR
R
false
false
5,831
rd
\name{QA} \alias{QA} \title{ Quality assessment of geographic assignments } \description{ How well does a given isoscape and/or known origin data set constrain the geographic origin of samples? Uses iterative re-sampling of known origin data to evaluate sample assignments and reports a suite of quality metrics. } \...
\name{mlegp-parameter-lookup} \alias{paramLookup} \alias{toParamIndexes} \alias{matchIndexes} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Parameter Lookup Functions } \description{ These functions are used to match the name of a parameter with its position in a parameter list } \usage{ toP...
/man/paramLookup.Rd
no_license
cran/mlegp
R
false
false
1,594
rd
\name{mlegp-parameter-lookup} \alias{paramLookup} \alias{toParamIndexes} \alias{matchIndexes} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Parameter Lookup Functions } \description{ These functions are used to match the name of a parameter with its position in a parameter list } \usage{ toP...
#' @export #' @title isValidCachedObject(sig,wd) #' #' @description Internal utility function to determine whether a cached object is stale. #' If its stale, it will be removed. #' #' @param x file path of the cached object #' @return If the file exists and is not stale, returns TRUE, otherwise FALSE. #' isValidCachedO...
/R/internals.R
permissive
gandiwan/datim-validation
R
false
false
2,284
r
#' @export #' @title isValidCachedObject(sig,wd) #' #' @description Internal utility function to determine whether a cached object is stale. #' If its stale, it will be removed. #' #' @param x file path of the cached object #' @return If the file exists and is not stale, returns TRUE, otherwise FALSE. #' isValidCachedO...
# Bagging Regression trees using ipred # Air Quality data library(ipred) #################################################################### ## Default Bagging uses B="nbagg"=25. THIS IS TOO SMALL. ## If your computer can stand it, MAKE IT BIGGER ## (Try rerunning this several times with nbagg=25 and lo...
/sample/Bagging.R
no_license
sfummlab/stat852
R
false
false
3,795
r
# Bagging Regression trees using ipred # Air Quality data library(ipred) #################################################################### ## Default Bagging uses B="nbagg"=25. THIS IS TOO SMALL. ## If your computer can stand it, MAKE IT BIGGER ## (Try rerunning this several times with nbagg=25 and lo...
# Воспользуемся встроенными данными npk, иллюстрирующими влияние применения различных удобрений на урожайность гороха (yield). # Нашей задачей будет выяснить, существенно ли одновременное применение азота (фактор N) и фосфата (фактор P). # Примените дисперсионный анализ, где будет проверяться влияние фактора применени...
/src/an1/15.r
no_license
int28h/RTasks
R
false
false
862
r
# Воспользуемся встроенными данными npk, иллюстрирующими влияние применения различных удобрений на урожайность гороха (yield). # Нашей задачей будет выяснить, существенно ли одновременное применение азота (фактор N) и фосфата (фактор P). # Примените дисперсионный анализ, где будет проверяться влияние фактора применени...
# The goal of this script is to combine and generate the data # to be used for the Austronesian Data Story # Major steps involved # Fetch -> Cleanup -> Parse # install.packages("rapportools") library(tidyverse) library(jsonlite) library(rapportools) library(stringi) source("scripts/utils.R") # ---------------------...
/scripts/api/generate_api.R
no_license
josephricafort/journey-of-words-r-data
R
false
false
10,389
r
# The goal of this script is to combine and generate the data # to be used for the Austronesian Data Story # Major steps involved # Fetch -> Cleanup -> Parse # install.packages("rapportools") library(tidyverse) library(jsonlite) library(rapportools) library(stringi) source("scripts/utils.R") # ---------------------...
context("vegperiod") data(goe) test_that("vegperiod throws erors", { expect_equal(vegperiod(dates=goe$date, Tavg=goe$t, start.method="Menzel", end.method="vonWilpert", species="Picea abies (spaet)", est.prev=0, Tsum.out=FALSE), data.frame( ...
/data/genthat_extracted_code/vegperiod/tests/test_veg_vegperiod.R
no_license
surayaaramli/typeRrh
R
false
false
3,006
r
context("vegperiod") data(goe) test_that("vegperiod throws erors", { expect_equal(vegperiod(dates=goe$date, Tavg=goe$t, start.method="Menzel", end.method="vonWilpert", species="Picea abies (spaet)", est.prev=0, Tsum.out=FALSE), data.frame( ...
\name{interp_policy} \alias{interp_policy} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Computes the best policy } \description{ Given a policy and an initial belief state, returns the action which maximizes the value function, and its corresponding value } \usage{ interp_policy(state_pr...
/man/interp_policy.Rd
no_license
conservation-decisions/smsPOMDP
R
false
false
1,915
rd
\name{interp_policy} \alias{interp_policy} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Computes the best policy } \description{ Given a policy and an initial belief state, returns the action which maximizes the value function, and its corresponding value } \usage{ interp_policy(state_pr...
#Percentage of empty ABCD entries from each district MissingABCD_percent_v2_Dist = table(P_v2_ABCD_na$District)/table(P_v2$District)*100 MissingABCD_percent_v4_Dist = table(P_v4_ABCD_na$District)/table(P_v4$District)*100 #Percentage of empty Etiology entries from each district MissingEtiology_percent_v2_Dist = table(...
/src/Old/Data Analysis.R
no_license
chocochip13/PREM
R
false
false
5,356
r
#Percentage of empty ABCD entries from each district MissingABCD_percent_v2_Dist = table(P_v2_ABCD_na$District)/table(P_v2$District)*100 MissingABCD_percent_v4_Dist = table(P_v4_ABCD_na$District)/table(P_v4$District)*100 #Percentage of empty Etiology entries from each district MissingEtiology_percent_v2_Dist = table(...
# 구조방정식 실습 # Overview # # 인근에 자리잡은 두 학교, Grant-White 와 Pasteur를 두고 학부형들끼리 논쟁을 벌이고 있다. # 두 학교 중에 어느 학교가 학생을 잘 가르치는가에 대한 문제를 두고말이다. 평가영역은 '시각', # '문장','반응성'이다. 이 평가 영역에 관한 9개의 항목이 x1, x2, x3, x4, x5, x6, x7, x8, x9다. rm(list=ls()) setwd("~/R/Structural Equation Modeling") library(lavaan) library(semPlo...
/Overview.R
no_license
Joshuariver/SEM
R
false
false
7,221
r
# 구조방정식 실습 # Overview # # 인근에 자리잡은 두 학교, Grant-White 와 Pasteur를 두고 학부형들끼리 논쟁을 벌이고 있다. # 두 학교 중에 어느 학교가 학생을 잘 가르치는가에 대한 문제를 두고말이다. 평가영역은 '시각', # '문장','반응성'이다. 이 평가 영역에 관한 9개의 항목이 x1, x2, x3, x4, x5, x6, x7, x8, x9다. rm(list=ls()) setwd("~/R/Structural Equation Modeling") library(lavaan) library(semPlo...
library("AppliedPredictiveModeling") # Two-class data data(twoClassData) # The predictors for the example data are stored in a data frame called predictors. # There are two columns for the predictors and 208 samples in rows. # The outcome classes are contained in a factor vector called classes. print('Predictors:')...
/DecisionTrees/DecisionTrees/kuhn/DataSplitting.R
no_license
Alvtron/ImbalancedMachineLearningWithR
R
false
false
1,224
r
library("AppliedPredictiveModeling") # Two-class data data(twoClassData) # The predictors for the example data are stored in a data frame called predictors. # There are two columns for the predictors and 208 samples in rows. # The outcome classes are contained in a factor vector called classes. print('Predictors:')...
######资产组合###### #最小方差求解函数 minvariance <- function(assets, mu = 0.005) { return <- log(tail(assets, -1) / head(assets, -1)) Q <- rbind(cov(return), rep(1, ncol(assets)), colMeans(return)) Q <- cbind(Q, rbind(t(tail(Q, 2)), matrix(0, 2, 2))) b <- c(rep(0, ncol(assets)), 1, mu) solve(Q, b) } #下载数据...
/src/dg/financial/courseware/QF08.R
no_license
xenron/sandbox-da-r
R
false
false
6,296
r
######资产组合###### #最小方差求解函数 minvariance <- function(assets, mu = 0.005) { return <- log(tail(assets, -1) / head(assets, -1)) Q <- rbind(cov(return), rep(1, ncol(assets)), colMeans(return)) Q <- cbind(Q, rbind(t(tail(Q, 2)), matrix(0, 2, 2))) b <- c(rep(0, ncol(assets)), 1, mu) solve(Q, b) } #下载数据...