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
"gauss" <- function(kode=1,x) { if (missing(x)) messagena("x") p <- single(1) f.res <- .Fortran("gauss", kode=to.integer(kode), x=to.single(x), p=to.single(p)) list(p=f.res$p) }
/robeth/R/gauss.R
no_license
ingted/R-Examples
R
false
false
190
r
"gauss" <- function(kode=1,x) { if (missing(x)) messagena("x") p <- single(1) f.res <- .Fortran("gauss", kode=to.integer(kode), x=to.single(x), p=to.single(p)) list(p=f.res$p) }
% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/analysis_fourPlot.R \name{analysis_fourPlot} \alias{analysis_fourPlot} \title{Four Plots of Growth Curves and Doubling Times} \usage{ analysis_fourPlot(timeseries, minExpFitHour = 0, maxExpFitHour = 1e+09, title = "Title Goes Here",...
/man/analysis_fourPlot.Rd
no_license
MazamaScience/TBCellGrowth
R
false
false
2,204
rd
% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/analysis_fourPlot.R \name{analysis_fourPlot} \alias{analysis_fourPlot} \title{Four Plots of Growth Curves and Doubling Times} \usage{ analysis_fourPlot(timeseries, minExpFitHour = 0, maxExpFitHour = 1e+09, title = "Title Goes Here",...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/polyline.R \name{SimplifyPolyline} \alias{SimplifyPolyline} \title{Simplify Polyline} \usage{ SimplifyPolyline(polyline, distanceTolerance = 100, type = c("simple", "complex")) } \arguments{ \item{polyline}{encoded string of a polyline} \i...
/man/SimplifyPolyline.Rd
no_license
floswald/spatial.data.table
R
false
true
1,575
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/polyline.R \name{SimplifyPolyline} \alias{SimplifyPolyline} \title{Simplify Polyline} \usage{ SimplifyPolyline(polyline, distanceTolerance = 100, type = c("simple", "complex")) } \arguments{ \item{polyline}{encoded string of a polyline} \i...
## File Name: tam_jml_itempartable.R ## File Version: 0.02 tam_jml_itempartable <- function(resp, maxK, AXsi, B, resp.ind) { ndim <- dim(B)[3] item <- tam_itempartable( resp=resp, maxK=maxK, AXsi=AXsi, B=B, ndim=ndim, resp.ind=resp.ind, rprobs=NULL, n.ik=NULL, pi.k=NULL...
/R/tam_jml_itempartable.R
no_license
alexanderrobitzsch/TAM
R
false
false
355
r
## File Name: tam_jml_itempartable.R ## File Version: 0.02 tam_jml_itempartable <- function(resp, maxK, AXsi, B, resp.ind) { ndim <- dim(B)[3] item <- tam_itempartable( resp=resp, maxK=maxK, AXsi=AXsi, B=B, ndim=ndim, resp.ind=resp.ind, rprobs=NULL, n.ik=NULL, pi.k=NULL...
#' Import Syrinx selections #' #' \code{imp.syrinx} imports Syrinx selection data from many files simultaneously. #' All files must be have the same columns. #' @usage imp.syrinx(path = NULL, all.data = FALSE, recursive = FALSE, exclude = FALSE) #' @param path A character string indicating the path of the directory...
/R/imp.syrinx.R
no_license
FerDoranNie/warbleR
R
false
false
4,806
r
#' Import Syrinx selections #' #' \code{imp.syrinx} imports Syrinx selection data from many files simultaneously. #' All files must be have the same columns. #' @usage imp.syrinx(path = NULL, all.data = FALSE, recursive = FALSE, exclude = FALSE) #' @param path A character string indicating the path of the directory...
binfold <- function(data, lim = 100, pixx = 100, pixy = 100, sam = 0.9, bins = 100, grad = TRUE) { start <- Sys.time() par(mfrow=c(1, 1)) print("Folding all objects with the AAVSO period...") print("Objects without an AAVSO period have been removed.") channel <- odbcConnect("sktobs", ...
/binfold.R
no_license
P-R-McWhirter/skycamT_variable_classification_functions
R
false
false
5,334
r
binfold <- function(data, lim = 100, pixx = 100, pixy = 100, sam = 0.9, bins = 100, grad = TRUE) { start <- Sys.time() par(mfrow=c(1, 1)) print("Folding all objects with the AAVSO period...") print("Objects without an AAVSO period have been removed.") channel <- odbcConnect("sktobs", ...
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function ## This function will get an input matrix, and then will create the cache for the inverse matrix makeCacheMatrix <- function(x = matrix()) { m<-NULL set <- function(y) { x <...
/cachematrix.R
no_license
ericxue77/ProgrammingAssignment2
R
false
false
948
r
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function ## This function will get an input matrix, and then will create the cache for the inverse matrix makeCacheMatrix <- function(x = matrix()) { m<-NULL set <- function(y) { x <...
##################################### ## Chapter04_2. 함수 ##################################### # 사용자 정의함수와 내장함수 # 1. 사용자 정의함수 # 매개변수가 없는 함수 예 f1 <- function(){ cat("매개변수가 없는 함수") } f1() # 함수 호출 #매개변수가 있는 함수 예 f2 <- function(x){ # 가인수 cat("x의 값 = ",x, "\n") # \n 줄바꿈 print(x) # 변수만 사용 } f2(10) # 실인수 # 리...
/R-script/Part-I/chap04_2_Function.R
no_license
LTaeHoon/R_NCS
R
false
false
8,283
r
##################################### ## Chapter04_2. 함수 ##################################### # 사용자 정의함수와 내장함수 # 1. 사용자 정의함수 # 매개변수가 없는 함수 예 f1 <- function(){ cat("매개변수가 없는 함수") } f1() # 함수 호출 #매개변수가 있는 함수 예 f2 <- function(x){ # 가인수 cat("x의 값 = ",x, "\n") # \n 줄바꿈 print(x) # 변수만 사용 } f2(10) # 실인수 # 리...
## ----packages, message = FALSE, warning=FALSE---------------------------- library(readr) library(dplyr) library(janitor) library(ggplot2) library(mattle24utils) library(extrafont) library(ggridges) library(ipumsr) library(sf) ## ------------------------------------------------------------------------ theme_set(them...
/cache/mattle24|tidytuesday|1210_nyc_restaurants.R
permissive
a-rosenberg/github-content-scraper
R
false
false
3,343
r
## ----packages, message = FALSE, warning=FALSE---------------------------- library(readr) library(dplyr) library(janitor) library(ggplot2) library(mattle24utils) library(extrafont) library(ggridges) library(ipumsr) library(sf) ## ------------------------------------------------------------------------ theme_set(them...
#Reading data from source file electricity <- read.table(file="household_power_consumption.txt", sep =";", header = TRUE) # Subsetting and binding data household_cons1 <- subset(electricity, Date == '1/2/2007') household_cons2 <- subset(electricity, Date == '2/2/2007') household_cons <- rbind(household...
/plot4.R
no_license
Maja0108/ExData_Plotting1
R
false
false
2,007
r
#Reading data from source file electricity <- read.table(file="household_power_consumption.txt", sep =";", header = TRUE) # Subsetting and binding data household_cons1 <- subset(electricity, Date == '1/2/2007') household_cons2 <- subset(electricity, Date == '2/2/2007') household_cons <- rbind(household...
#' create_nest_geojson_list <- function(data, geodata, level1, level2, prefix, sep = "_", ...) { lvls <- unique(data[,level1]) purrr::map( lvls, create_geojson_list, data, geodata, level1, level2, prefix, ... ) } #' create_geojson_list <- fu...
/R/create_geojson_list.R
permissive
curso-r/hcdrilldown
R
false
false
1,171
r
#' create_nest_geojson_list <- function(data, geodata, level1, level2, prefix, sep = "_", ...) { lvls <- unique(data[,level1]) purrr::map( lvls, create_geojson_list, data, geodata, level1, level2, prefix, ... ) } #' create_geojson_list <- fu...
\name{LipsetFS} \alias{LipsetFS} \docType{data} \title{Lipset (1959), fuzzy-set} \description{The \code{LipsetFS} data frame has 18 rows and 6 variables} \usage{data(LipsetFS)} \format{ A data frame with 18 observations on the following 6 variables. \describe{ \item{\code{Survived}}{a numeric vector. Outcome, ...
/man/LipsetFS.Rd
no_license
jmedzihorsky/SetMethods
R
false
false
1,770
rd
\name{LipsetFS} \alias{LipsetFS} \docType{data} \title{Lipset (1959), fuzzy-set} \description{The \code{LipsetFS} data frame has 18 rows and 6 variables} \usage{data(LipsetFS)} \format{ A data frame with 18 observations on the following 6 variables. \describe{ \item{\code{Survived}}{a numeric vector. Outcome, ...
#data_name='vol' #data_name='per5k' #data_name='PxL1k' #data_name='per150' #data_name='rbf200' #data_name='airline144' #data_name='solar402' #data_name='COGT7668' #data_name='NO2GT7709' #data_name='NOxGT7712' #data_name='mauna545' #data_name='solar402' #data_name='occ' #data_name='spd' load_data = function(dataset) { ...
/src/R_bks/bks_data.R
no_license
lemelondeau/VBKS
R
false
false
7,562
r
#data_name='vol' #data_name='per5k' #data_name='PxL1k' #data_name='per150' #data_name='rbf200' #data_name='airline144' #data_name='solar402' #data_name='COGT7668' #data_name='NO2GT7709' #data_name='NOxGT7712' #data_name='mauna545' #data_name='solar402' #data_name='occ' #data_name='spd' load_data = function(dataset) { ...
source("best.R") '--Best.R--' '--Good cases:--' best('CA', 'heart attack') best('CA', 'heart failure') best('IL', 'heart attack') best('GA', 'heart failure') '--Negative cases:--' best('ZM', 'heart failure') best('IL', 'heart break') source("rankhospital.R") '--rankhospital.R--' '--Good cases:--' rankhospital("MD"...
/R/Code/Week 4/Assignment/TestingWeek4Assignment.R
no_license
zeyab/DataScience
R
false
false
627
r
source("best.R") '--Best.R--' '--Good cases:--' best('CA', 'heart attack') best('CA', 'heart failure') best('IL', 'heart attack') best('GA', 'heart failure') '--Negative cases:--' best('ZM', 'heart failure') best('IL', 'heart break') source("rankhospital.R") '--rankhospital.R--' '--Good cases:--' rankhospital("MD"...
# Importing libraries library(RCurl) # for downloading the iris CSV file library(randomForest) library(caret) # Importing the Iris data set iris <- read.csv("https://raw.githubusercontent.com/dataprofessor/data/master/iris.csv", stringsAsFactors = T) # Performs stratified random split of the data set TrainingIndex <-...
/app_4/model.R
no_license
kingazaan/shiny-apps
R
false
false
891
r
# Importing libraries library(RCurl) # for downloading the iris CSV file library(randomForest) library(caret) # Importing the Iris data set iris <- read.csv("https://raw.githubusercontent.com/dataprofessor/data/master/iris.csv", stringsAsFactors = T) # Performs stratified random split of the data set TrainingIndex <-...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/302.Expec_Leng_BASE_All_Graph.R \name{PlotexplWD} \alias{PlotexplWD} \title{Plots the expected length for Wald method} \usage{ PlotexplWD(n, alp, a, b) } \arguments{ \item{n}{- Number of trials} \item{alp}{- Alpha value (significance level r...
/man/PlotexplWD.Rd
no_license
ElsevierSoftwareX/SOFTX-D-16-00020
R
false
true
1,396
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/302.Expec_Leng_BASE_All_Graph.R \name{PlotexplWD} \alias{PlotexplWD} \title{Plots the expected length for Wald method} \usage{ PlotexplWD(n, alp, a, b) } \arguments{ \item{n}{- Number of trials} \item{alp}{- Alpha value (significance level r...
library(dplyr) library(tidyr) library(data.table) library(ggcorrplot) # tabulate brain-behavior effects by DAN ROI beta_dir <- "/Volumes/GoogleDrive/My Drive/SCEPTIC_fMRI/wholebrain_betas" setwd(beta_dir) # MNH/AD internal labeling scheme labels <- readxl::read_excel("~/Data_Analysis/clock_analysis/fmri/keuka_brain_be...
/fmri/keuka_brain_behavior_analyses/dan/betas_final/tabulate_brain_behavior.R
no_license
UNCDEPENdLab/clock_analysis
R
false
false
18,296
r
library(dplyr) library(tidyr) library(data.table) library(ggcorrplot) # tabulate brain-behavior effects by DAN ROI beta_dir <- "/Volumes/GoogleDrive/My Drive/SCEPTIC_fMRI/wholebrain_betas" setwd(beta_dir) # MNH/AD internal labeling scheme labels <- readxl::read_excel("~/Data_Analysis/clock_analysis/fmri/keuka_brain_be...
dat =read.csv("210projrates.csv") head(dat) attach(dat) leslie <- function(l,f) { L = matrix(0,10,10) L[1,] = .4886 * l[1]*(f[1:10]+f[2:11]*l[2:11]/l[1:10])/2 # top row diag(L[2:10,1:9]) = l[2:10] / l[1:9] # subdiagonal return(L) } TFR <- function(f) return(5 * sum(f)) GRR <- function(f, ffab=0.48...
/projection-code-snippet.r
no_license
MJAlexander/formal-demog-2015
R
false
false
806
r
dat =read.csv("210projrates.csv") head(dat) attach(dat) leslie <- function(l,f) { L = matrix(0,10,10) L[1,] = .4886 * l[1]*(f[1:10]+f[2:11]*l[2:11]/l[1:10])/2 # top row diag(L[2:10,1:9]) = l[2:10] / l[1:9] # subdiagonal return(L) } TFR <- function(f) return(5 * sum(f)) GRR <- function(f, ffab=0.48...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/raster.cor.plot.R \name{raster.cor.plot} \alias{raster.cor.plot} \title{Takes a raster stack and returns a data frame containing Pearson correlation coefficients between the included rasters} \usage{ raster.cor.plot(env, method = "pearson") }...
/man/raster.cor.plot.Rd
no_license
helixcn/ENMTools
R
false
true
692
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/raster.cor.plot.R \name{raster.cor.plot} \alias{raster.cor.plot} \title{Takes a raster stack and returns a data frame containing Pearson correlation coefficients between the included rasters} \usage{ raster.cor.plot(env, method = "pearson") }...
require(bio.survey) require(bio.lobster) require(bio.groundfish) la() p = bio.lobster::load.environment() p$libs = NULL fp = file.path(project.datadirectory('bio.lobster'),"analysis") load_all('~/git/bio.survey/') if(get.odbc.data){ p = bio.groundfish::load.groundfish.environment(assessment.year = 2016) ...
/inst/Updates/LFA35-38/Previous Updates/RVUpdate35-38.r
no_license
LobsterScience/bio.lobster
R
false
false
3,176
r
require(bio.survey) require(bio.lobster) require(bio.groundfish) la() p = bio.lobster::load.environment() p$libs = NULL fp = file.path(project.datadirectory('bio.lobster'),"analysis") load_all('~/git/bio.survey/') if(get.odbc.data){ p = bio.groundfish::load.groundfish.environment(assessment.year = 2016) ...
# BC1224 Gene Based Intersection library(here) # Directories ------------------------------------------------------------- maindir= here() resdir <- file.path(maindir,"output","scRNAseq","PDX_BC1224") source(file.path(maindir,"Scripts","global_var.R")) source(file.path(maindir,"Scripts","functions.R")) output <- file....
/Scripts/scRNAseq/PDX/6.0_Gene_Based_Multiomics_Intersection_PDX_BC1224.R
no_license
vallotlab/ChemoPersistance
R
false
false
3,257
r
# BC1224 Gene Based Intersection library(here) # Directories ------------------------------------------------------------- maindir= here() resdir <- file.path(maindir,"output","scRNAseq","PDX_BC1224") source(file.path(maindir,"Scripts","global_var.R")) source(file.path(maindir,"Scripts","functions.R")) output <- file....
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mlg.r \name{mlg} \alias{mlg} \alias{mlg.crosspop} \alias{mlg.id} \alias{mlg.table} \alias{mlg.vector} \title{Create counts, vectors, and matrices of multilocus genotypes.} \usage{ mlg(gid, quiet = FALSE) mlg.table(gid, strata = NULL, sublist...
/man/mlg.Rd
no_license
jimhester/poppr
R
false
true
5,785
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mlg.r \name{mlg} \alias{mlg} \alias{mlg.crosspop} \alias{mlg.id} \alias{mlg.table} \alias{mlg.vector} \title{Create counts, vectors, and matrices of multilocus genotypes.} \usage{ mlg(gid, quiet = FALSE) mlg.table(gid, strata = NULL, sublist...
library(quipu) data(potato.quipu) dat = potato.quipu str(dat) rquipu(dat) rquipu(dat, layout="no text", res=c(600,400))
/inst/examples/rquipu.R
permissive
CIP-RIU/quipu
R
false
false
124
r
library(quipu) data(potato.quipu) dat = potato.quipu str(dat) rquipu(dat) rquipu(dat, layout="no text", res=c(600,400))
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/functions_bulk.R \name{add_differential_transcript_abundance_bulk} \alias{add_differential_transcript_abundance_bulk} \title{Add differential transcription information to a tibble using edgeR. At the moment only one covariate is accepted} \us...
/man/add_differential_transcript_abundance_bulk.Rd
no_license
jackieduckie/ttBulk
R
false
true
1,088
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/functions_bulk.R \name{add_differential_transcript_abundance_bulk} \alias{add_differential_transcript_abundance_bulk} \title{Add differential transcription information to a tibble using edgeR. At the moment only one covariate is accepted} \us...
train_GD <- function(theta, datas, num_classes, filter_dim, num_filters, pool_dim, preds,test,test_label, label,...){ option <- list(...) if(is.null(option$epochs)) stop("please fill eopchs argument") if(is.null(option$alph)) stop("please fill all alpha argument") if(is.null(option$minibat...
/train_GD.R
permissive
Lijinsr/Convolution-Neural-Network
R
false
false
5,519
r
train_GD <- function(theta, datas, num_classes, filter_dim, num_filters, pool_dim, preds,test,test_label, label,...){ option <- list(...) if(is.null(option$epochs)) stop("please fill eopchs argument") if(is.null(option$alph)) stop("please fill all alpha argument") if(is.null(option$minibat...
# Clean Environment rm(list=ls(all=TRUE)) start_time.global <- Sys.time() print(paste("Process Started at: ", start_time.global)) # By default java uses 512 Mb of memory on its virtual machines, here we change its value to 16Gb options( java.parameters = "-Xmx16g" ) # Libraries if (!require("tm")) install.packages("...
/getngram.R
no_license
lnevesp/word-prediction
R
false
false
3,964
r
# Clean Environment rm(list=ls(all=TRUE)) start_time.global <- Sys.time() print(paste("Process Started at: ", start_time.global)) # By default java uses 512 Mb of memory on its virtual machines, here we change its value to 16Gb options( java.parameters = "-Xmx16g" ) # Libraries if (!require("tm")) install.packages("...
######################## ### General settings ### ######################## # set seed for the simulation random_seed = 9202017 # set the starting time step or leave NA to use the earliest/highest timestep start_time = NA # set the end time step or leave as NA to use the lates/lowest timestep (0) end_time = NA # ma...
/config/CaseStudy1/high_trait_evolution/config_hte_17.R
no_license
project-gen3sis/Simulations
R
false
false
5,122
r
######################## ### General settings ### ######################## # set seed for the simulation random_seed = 9202017 # set the starting time step or leave NA to use the earliest/highest timestep start_time = NA # set the end time step or leave as NA to use the lates/lowest timestep (0) end_time = NA # ma...
% Auto-generated: do not edit by hand \name{htmlTr} \alias{htmlTr} \title{Tr component} \description{ Tr is a wrapper for the <tr> HTML5 element. For detailed attribute info see: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tr } \usage{ htmlTr(children=NULL, id=NULL, accessKey=NULL, className=NULL, con...
/man/htmlTr.Rd
permissive
TechDesignDuo/dash-html-components
R
false
false
3,859
rd
% Auto-generated: do not edit by hand \name{htmlTr} \alias{htmlTr} \title{Tr component} \description{ Tr is a wrapper for the <tr> HTML5 element. For detailed attribute info see: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tr } \usage{ htmlTr(children=NULL, id=NULL, accessKey=NULL, className=NULL, con...
# ######### # Mixtures # ######### #### Setup #### library(toxEval) library(ToxMixtures) library(dplyr) library(RColorBrewer) library(ggplot2) #Need to run (ToxEval_Passive2016.R and ToxEval_WaterSamples2016.R) # Take maximum EAR for water samples with more than one sample cs_surf <- chemicalSummary_surface %>% #...
/explore_toxmixtures_surface_2016_short.R
no_license
lukeloken/passive_tox
R
false
false
6,146
r
# ######### # Mixtures # ######### #### Setup #### library(toxEval) library(ToxMixtures) library(dplyr) library(RColorBrewer) library(ggplot2) #Need to run (ToxEval_Passive2016.R and ToxEval_WaterSamples2016.R) # Take maximum EAR for water samples with more than one sample cs_surf <- chemicalSummary_surface %>% #...
#' Generate monthly climate timeseries using ARMA model #' #' @param x.reg.yr data.frame with regional average annual climate timeseries (YEAR, PRCP, TMAX, TMIN, TAVG) #' @param x.loc.mon data.frame with annual climate timeseries at selected location (YEAR, MONTH, PRCP, TMAX, TMIN, TAVG) #' @param n.iter number of iter...
/R/gen_month.R
no_license
HydrosystemsGroup/Weather-Generator
R
false
false
6,686
r
#' Generate monthly climate timeseries using ARMA model #' #' @param x.reg.yr data.frame with regional average annual climate timeseries (YEAR, PRCP, TMAX, TMIN, TAVG) #' @param x.loc.mon data.frame with annual climate timeseries at selected location (YEAR, MONTH, PRCP, TMAX, TMIN, TAVG) #' @param n.iter number of iter...
############################################################## #' Simulate a spread process on a landscape. #' #' This can be used to simulated fires or other things. Essentially, it starts from a collection of cells #' (\code{loci}) and spreads to neighbours, according to the \code{directions} and \code{spreadProb} ar...
/SpaDES-master/R/spread-process.R
no_license
B-Ron12/RCodeSK
R
false
false
9,056
r
############################################################## #' Simulate a spread process on a landscape. #' #' This can be used to simulated fires or other things. Essentially, it starts from a collection of cells #' (\code{loci}) and spreads to neighbours, according to the \code{directions} and \code{spreadProb} ar...
plot1 <- function (){ setClass('myDate') setClass('myTime') setAs("character","myDate", function(from) as.Date(from, format="%d/%m/%Y") ) setAs("character","myTime", function(from) strptime(from, format="%H:%M:%S", tz="") ) d=read.table("household_power_consumption.txt", na.strings=c("?"), stringsA...
/plot1.R
no_license
SPadmanabhan67/ExploratoryDataAnalysis
R
false
false
687
r
plot1 <- function (){ setClass('myDate') setClass('myTime') setAs("character","myDate", function(from) as.Date(from, format="%d/%m/%Y") ) setAs("character","myTime", function(from) strptime(from, format="%H:%M:%S", tz="") ) d=read.table("household_power_consumption.txt", na.strings=c("?"), stringsA...
library(ggplot2) library(ggforce) ## Read DEG ## gene.stats <- sapply(list.files(pattern = 'batch2', path = 'results/deg', full.names = TRUE), simplify = FALSE, function(x){ local.data <- r...
/plotVenn.R
no_license
ardadurmaz/ssri-mmu
R
false
false
2,210
r
library(ggplot2) library(ggforce) ## Read DEG ## gene.stats <- sapply(list.files(pattern = 'batch2', path = 'results/deg', full.names = TRUE), simplify = FALSE, function(x){ local.data <- r...
class PagesController < ApplicationController def home end end
/app/controllers/pages_controller.rb
no_license
nitmittal/one_month_stripe_payments
R
false
false
69
rb
class PagesController < ApplicationController def home end end
## functions for Imperial data source("./code/get_next_saturday.R") #' Transform matrix of samples for one location into a quantile-format data_frame #' #' @param sample_mat matrix of samples, columns are horizons, rows are samples #' @param location the FIPS code for the location for this matrix #' @param timezero d...
/code/process_imperial_file.R
permissive
yuorme/covid19-forecast-hub
R
false
false
5,163
r
## functions for Imperial data source("./code/get_next_saturday.R") #' Transform matrix of samples for one location into a quantile-format data_frame #' #' @param sample_mat matrix of samples, columns are horizons, rows are samples #' @param location the FIPS code for the location for this matrix #' @param timezero d...
library(ggplot2) library(dplyr) library(tidyr) # replace_na library(tibble) # column_to_rownames ### DATA_DIR <- 'data/' OUT_DIR <- 'images/' NAMES <- list('H3K27me3_C2C12.ENCFF736SSJ.mm10', 'H3K27me3_C2C12.ENCFF110HRW.mm10') ### for (NAME in NAMES){ bed_df <- read.delim(paste0(DATA_DIR, NAME, '.bed'), as.is =...
/src/rm_outliers.R
no_license
ADmitri42/hse21_H3K27me3_ZDNA_mouse
R
false
false
975
r
library(ggplot2) library(dplyr) library(tidyr) # replace_na library(tibble) # column_to_rownames ### DATA_DIR <- 'data/' OUT_DIR <- 'images/' NAMES <- list('H3K27me3_C2C12.ENCFF736SSJ.mm10', 'H3K27me3_C2C12.ENCFF110HRW.mm10') ### for (NAME in NAMES){ bed_df <- read.delim(paste0(DATA_DIR, NAME, '.bed'), as.is =...
games=read.csv("http://statweb.stanford.edu/~jgorham/games.csv", as.is=TRUE) teams=read.csv("http://statweb.stanford.edu/~jgorham/teams.csv", as.is=TRUE) all.teams=sort(unique(c(teams$team,games$home,games$away)))
/HW2/HW2_1.R
no_license
animohan/s216
R
false
false
215
r
games=read.csv("http://statweb.stanford.edu/~jgorham/games.csv", as.is=TRUE) teams=read.csv("http://statweb.stanford.edu/~jgorham/teams.csv", as.is=TRUE) all.teams=sort(unique(c(teams$team,games$home,games$away)))
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/LD.R \name{LD.dprime_table} \alias{LD.dprime_table} \title{Calculate LD (D')} \usage{ LD.dprime_table(SNP_list, LD_folder, conda_env) } \description{ This appriach computes an LD matrix of D' (instead of r or r2) from a vcf. See \code{\link{L...
/man/LD.dprime_table.Rd
permissive
UKDRI/echolocatoR
R
false
true
1,483
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/LD.R \name{LD.dprime_table} \alias{LD.dprime_table} \title{Calculate LD (D')} \usage{ LD.dprime_table(SNP_list, LD_folder, conda_env) } \description{ This appriach computes an LD matrix of D' (instead of r or r2) from a vcf. See \code{\link{L...
expit = function(x) { return(1/(1+exp(-x))) } # A simple adaptive lasso adalasso = function(..., adawgt, lambda.min) { if(missing(penalty.factor)) { ridgefit = cv.glmnet(alpha = 0, ...) adawgt = 1/abs(coef(ridgefit, s = "lambda.min")[-1]) } if(missing(lambda.min)) { adafit = cv...
/core/marquis_causal.R
no_license
hjmarquis/MS_EHR_paper3
R
false
false
14,724
r
expit = function(x) { return(1/(1+exp(-x))) } # A simple adaptive lasso adalasso = function(..., adawgt, lambda.min) { if(missing(penalty.factor)) { ridgefit = cv.glmnet(alpha = 0, ...) adawgt = 1/abs(coef(ridgefit, s = "lambda.min")[-1]) } if(missing(lambda.min)) { adafit = cv...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/iotdataplane_operations.R \name{iotdataplane_publish} \alias{iotdataplane_publish} \title{Publishes state information} \usage{ iotdataplane_publish(topic, qos, payload) } \arguments{ \item{topic}{[required] The name of the MQTT topic.} \item...
/paws/man/iotdataplane_publish.Rd
permissive
johnnytommy/paws
R
false
true
766
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/iotdataplane_operations.R \name{iotdataplane_publish} \alias{iotdataplane_publish} \title{Publishes state information} \usage{ iotdataplane_publish(topic, qos, payload) } \arguments{ \item{topic}{[required] The name of the MQTT topic.} \item...
context('filter by molecule') test_that('molecule_filter and applyFilt produce the correct output', { # Load data and prepare omicsData objects ------------------------------------ load(system.file('testdata', 'little_pdata.RData', package = 'pmartR' )) # add group and batch to fdata fdata$Conditio...
/tests/testthat/test_filter_molecule.R
permissive
pmartR/pmartR
R
false
false
19,627
r
context('filter by molecule') test_that('molecule_filter and applyFilt produce the correct output', { # Load data and prepare omicsData objects ------------------------------------ load(system.file('testdata', 'little_pdata.RData', package = 'pmartR' )) # add group and batch to fdata fdata$Conditio...
## to do ## needed to win line in the bar graphs ## bar graphs or dot plots with the vote by party and roll call ## create tags for the posts ## store data in mysql ## scrape data from the library(foreign) library(reshape) source("utils.R") source("functionsRC.R") try(source("mergeApprox.R")) try(source("spatial.R")...
/R/download.R
no_license
leoniedu/Brazilian-Roll-Calls
R
false
false
9,265
r
## to do ## needed to win line in the bar graphs ## bar graphs or dot plots with the vote by party and roll call ## create tags for the posts ## store data in mysql ## scrape data from the library(foreign) library(reshape) source("utils.R") source("functionsRC.R") try(source("mergeApprox.R")) try(source("spatial.R")...
rm(list =ls()) library(chron) library(ggplot2) setwd("C:/Users/muson/OneDrive/Documents/Side Projects/Football Analytics/") ##### Manchester Utd ##### data <- read.table(file = "Data/Manchester United/Stats.txt", sep = ",", header = TRUE) head(data) str(data) dat...
/Goals, Expected Goals and Manchester United/Manchester United_xG vs G_2020-21.R
no_license
MusondaSinkala/Football-Analytics
R
false
false
7,456
r
rm(list =ls()) library(chron) library(ggplot2) setwd("C:/Users/muson/OneDrive/Documents/Side Projects/Football Analytics/") ##### Manchester Utd ##### data <- read.table(file = "Data/Manchester United/Stats.txt", sep = ",", header = TRUE) head(data) str(data) dat...
output$expiry_select_ui<-renderUI({ req(is.null(rv$robinhoodUser)!=T) req(input$option_ticker) ### REPLACE ### ops_rv$quote<-robinhood_quotes(isolate(input$option_ticker)) ############### optionsData <- RobinhoodOptions$new(isolate(input$option_ticker),rv$robinhoodUser) currentQuotes <- optionsData$cur...
/R/Options App/server/options_logic.R
permissive
tpopenfoose/robinhoodQF
R
false
false
8,226
r
output$expiry_select_ui<-renderUI({ req(is.null(rv$robinhoodUser)!=T) req(input$option_ticker) ### REPLACE ### ops_rv$quote<-robinhood_quotes(isolate(input$option_ticker)) ############### optionsData <- RobinhoodOptions$new(isolate(input$option_ticker),rv$robinhoodUser) currentQuotes <- optionsData$cur...
#' Compute McNemar's adjusted R2 #' #' The function computes the adjusted R2 between two numeric vectors #' #' @param x numeric vector #' @param y numeric vector #' @param method character, correlation method #' #' @return adjusted R2 of x and y #' #' #' @export adjR2 <- function(x, y, ...
/R/adjR2.R
no_license
bhattacharya-a-bt/MOSTWAS
R
false
false
504
r
#' Compute McNemar's adjusted R2 #' #' The function computes the adjusted R2 between two numeric vectors #' #' @param x numeric vector #' @param y numeric vector #' @param method character, correlation method #' #' @return adjusted R2 of x and y #' #' #' @export adjR2 <- function(x, y, ...
library(class) library(rpart) rm(list = ls()) setwd("/Users/parthxparab/Documents/Fall 2019/CS513/HW3") df = read.csv('breast-cancer-wisconsin.data.csv',header=TRUE, sep=",") head(df, n=5) #Summarizing each column (e.g. min, max, mean ) summary(df) #Here we see that the summary for only column F6 hasn't been calculat...
/HW5/Assignment-5.R
no_license
SylviaHJY/CS513-KDDM
R
false
false
1,437
r
library(class) library(rpart) rm(list = ls()) setwd("/Users/parthxparab/Documents/Fall 2019/CS513/HW3") df = read.csv('breast-cancer-wisconsin.data.csv',header=TRUE, sep=",") head(df, n=5) #Summarizing each column (e.g. min, max, mean ) summary(df) #Here we see that the summary for only column F6 hasn't been calculat...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/print.codebook.R \name{print.codebook} \alias{print.codebook} \alias{codebook} \title{Print an S3 object of class \code{codebook}} \usage{ \method{print}{codebook}(x, extra = FALSE, ...) } \arguments{ \item{x}{object of class \code{codebook}}...
/man/print.codebook.Rd
no_license
tkuehner/codebookr
R
false
true
1,199
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/print.codebook.R \name{print.codebook} \alias{print.codebook} \alias{codebook} \title{Print an S3 object of class \code{codebook}} \usage{ \method{print}{codebook}(x, extra = FALSE, ...) } \arguments{ \item{x}{object of class \code{codebook}}...
## cacheMatrix ## Function to cache matrix Inverse computation ## ## makeCacheMatrix: Creates a modified matrix object to cache it's inverse ## It returns a list containing 4 functiond to ## set the value of the matrix ## get the value of the matrix ## set the value of the inverse ## ge...
/cachematrix.R
no_license
makanig/ProgrammingAssignment2
R
false
false
2,304
r
## cacheMatrix ## Function to cache matrix Inverse computation ## ## makeCacheMatrix: Creates a modified matrix object to cache it's inverse ## It returns a list containing 4 functiond to ## set the value of the matrix ## get the value of the matrix ## set the value of the inverse ## ge...
### In the given data we have to predict the price of computer by using all column # so Y <- price and x <- all column library(readr) c_p<-read.csv(file.choose()) View(c_p) c_p<-c_p[,-1] c_p<-c_p[,-6] c_p<-c_p[,-6] c_p<-c_p[,-6] View(c_p) summary(c_p) pairs(c_p) cor(c_p) library(corpcor) cor2pcor(cor(c_...
/computer price.R
no_license
praveenMadesh/multiple-linear-regression
R
false
false
649
r
### In the given data we have to predict the price of computer by using all column # so Y <- price and x <- all column library(readr) c_p<-read.csv(file.choose()) View(c_p) c_p<-c_p[,-1] c_p<-c_p[,-6] c_p<-c_p[,-6] c_p<-c_p[,-6] View(c_p) summary(c_p) pairs(c_p) cor(c_p) library(corpcor) cor2pcor(cor(c_...
library('testthat') source('cachematrix.R') test_that("makeCacheMatrix function works as expected", { # Make a cached matrix m <- matrix(1:4,2,2) x <- makeCacheMatrix(m) # Make sure it's the expected type expect_that( x, is_a("list") ) # Check the matrix has been stored corre...
/John Hopkins Data Science/ProgrammingAssignment2/test_cachematrix.R
no_license
jamescrosswell/coursera
R
false
false
1,644
r
library('testthat') source('cachematrix.R') test_that("makeCacheMatrix function works as expected", { # Make a cached matrix m <- matrix(1:4,2,2) x <- makeCacheMatrix(m) # Make sure it's the expected type expect_that( x, is_a("list") ) # Check the matrix has been stored corre...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/class-gpuMatrix.R \docType{class} \name{cgpuMatrix-class} \alias{cgpuMatrix-class} \title{cgpuMatrix Class} \description{ An complex float type matrix in the S4 \code{gpuMatrix} representation. } \section{Slots}{ \describe{ \item{\code...
/man/cgpuMatrix-class.Rd
no_license
nnQuynh/gpuR
R
false
true
513
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/class-gpuMatrix.R \docType{class} \name{cgpuMatrix-class} \alias{cgpuMatrix-class} \title{cgpuMatrix Class} \description{ An complex float type matrix in the S4 \code{gpuMatrix} representation. } \section{Slots}{ \describe{ \item{\code...
repeatValue_admin <- TRUE while ( repeatValue_admin ) { adminDecision <- read_line("Would you like to get daily coin datas (1) or investigate the current dataframes (2): " ) if ( adminDecision == "1" ) { print("Dataframes are being updated...") adminProcess <- 'update' repeatValue_admin <- F...
/scripts/interfaces/admin/adminDecision.R
no_license
ozanguldali/coinmarketcapDailyStatistics
R
false
false
549
r
repeatValue_admin <- TRUE while ( repeatValue_admin ) { adminDecision <- read_line("Would you like to get daily coin datas (1) or investigate the current dataframes (2): " ) if ( adminDecision == "1" ) { print("Dataframes are being updated...") adminProcess <- 'update' repeatValue_admin <- F...
#Setting the working directory setwd("C:/Users/RZilan/Documents/R/week1/Exp_Data_Assignment1/") ## Loading the data filename <- "./exdata/household_power_consumption.txt" data <- read.table(filename, header = TRUE, sep = ";", colClasses = c("character", "cha...
/plot2.R
no_license
RUKENZILAN/ExData_Plotting1
R
false
false
916
r
#Setting the working directory setwd("C:/Users/RZilan/Documents/R/week1/Exp_Data_Assignment1/") ## Loading the data filename <- "./exdata/household_power_consumption.txt" data <- read.table(filename, header = TRUE, sep = ";", colClasses = c("character", "cha...
#' @templateVar class pam #' @template title_desc_tidy #' #' @param x An `pam` object returned from [cluster::pam()] #' @param col.names Column names in the input data frame. Defaults to the names of the variables in x. Set to NULL to get names `x1, x2, ...`. #' @template param_unused_dots #' #' @evalRd return_tidy(...
/R/pam-tidiers.R
no_license
abbylsmith/broom
R
false
false
2,554
r
#' @templateVar class pam #' @template title_desc_tidy #' #' @param x An `pam` object returned from [cluster::pam()] #' @param col.names Column names in the input data frame. Defaults to the names of the variables in x. Set to NULL to get names `x1, x2, ...`. #' @template param_unused_dots #' #' @evalRd return_tidy(...
# The MIT License (MIT) # Copyright (c) 2016 University of Applied Sciences Bremen # Permission is hereby granted, free of charge, to any person obtaining a copy of this software # and associated documentation files (the "Software"), to deal in the Software without restriction, # including without limitation the rights...
/processing/code-snippets/translate.R
permissive
simonbogutzky/PsychoPhysioPipeline
R
false
false
1,938
r
# The MIT License (MIT) # Copyright (c) 2016 University of Applied Sciences Bremen # Permission is hereby granted, free of charge, to any person obtaining a copy of this software # and associated documentation files (the "Software"), to deal in the Software without restriction, # including without limitation the rights...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/seqsToAln.R \name{.invertKeepRanges} \alias{.invertKeepRanges} \alias{.checkRelativeLocs} \alias{.adjustRelativeInsLocs} \alias{.offsetIndices} \title{Helper functions for selectAlnRegions} \usage{ .invertKeepRanges(target, keep) .checkRelat...
/man/selectAlnRegionsHelpers.Rd
no_license
HLindsay/CrispRVariants
R
false
true
1,996
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/seqsToAln.R \name{.invertKeepRanges} \alias{.invertKeepRanges} \alias{.checkRelativeLocs} \alias{.adjustRelativeInsLocs} \alias{.offsetIndices} \title{Helper functions for selectAlnRegions} \usage{ .invertKeepRanges(target, keep) .checkRelat...
library(mQTL) ### Name: format_mQTL ### Title: Routine to reformat the data into the required format ### Aliases: format_mQTL ### Keywords: function ### ** Examples ## Not run: ##D ## Clean the raw data to match the genotype and phenotype and create the proper format ##D ##D rawfile<-"MetaboFile.dat" ## Metab...
/data/genthat_extracted_code/mQTL/examples/format_mQTL.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
699
r
library(mQTL) ### Name: format_mQTL ### Title: Routine to reformat the data into the required format ### Aliases: format_mQTL ### Keywords: function ### ** Examples ## Not run: ##D ## Clean the raw data to match the genotype and phenotype and create the proper format ##D ##D rawfile<-"MetaboFile.dat" ## Metab...
library(HDDesign) ### Name: hct_method_corr ### Title: Estimate PCC of HCT Classifiers via implementation of Monte ### Carlo simulations with correlated features. ### Aliases: hct_method_corr ### ** Examples ## Sigma_1 in the paper #first block is pcorr x pcorr of compound symmetry #other diagonal block is Identi...
/data/genthat_extracted_code/HDDesign/examples/hct_method_corr.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
771
r
library(HDDesign) ### Name: hct_method_corr ### Title: Estimate PCC of HCT Classifiers via implementation of Monte ### Carlo simulations with correlated features. ### Aliases: hct_method_corr ### ** Examples ## Sigma_1 in the paper #first block is pcorr x pcorr of compound symmetry #other diagonal block is Identi...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/fit_gam_surface.R \name{fit_gam_surface} \alias{fit_gam_surface} \title{Fits a smooth surface to x, y, z data using generalised additive models} \usage{ fit_gam_surface( data, x, y, z, weights = NULL, k = 100, extrapolate = FALS...
/man/fit_gam_surface.Rd
permissive
Ostluft/rOstluft.plot
R
false
true
1,601
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/fit_gam_surface.R \name{fit_gam_surface} \alias{fit_gam_surface} \title{Fits a smooth surface to x, y, z data using generalised additive models} \usage{ fit_gam_surface( data, x, y, z, weights = NULL, k = 100, extrapolate = FALS...
raw1 <- read_html("Political Sermons of the American Founding Era. Vol. 1 (1730-1788) - Online Library of Liberty.html") raw2 <- read_html("Political Sermons of the American Founding Era. Vol. 2 (1789-1805) - Online Library of Liberty.html") sermons1 <- raw1 %>% xml_find_all("//*[@class='type-sermon']") meta1 <- map_c...
/parse_sermons.R
no_license
kstinso/cli02_final
R
false
false
792
r
raw1 <- read_html("Political Sermons of the American Founding Era. Vol. 1 (1730-1788) - Online Library of Liberty.html") raw2 <- read_html("Political Sermons of the American Founding Era. Vol. 2 (1789-1805) - Online Library of Liberty.html") sermons1 <- raw1 %>% xml_find_all("//*[@class='type-sermon']") meta1 <- map_c...
\encoding{UTF-8} \name{clusterSize} \Rdversion{1.1} \alias{clusterSize} \alias{plotClusterSize} \title{ Optimizing the number of workers } \description{ These functions help in optimizing workload for the workers if problems are of different size. } \usage{ clusterSize(size) plotClusterSize(n, size, balancing = c...
/man/clusterSize.Rd
no_license
cran/dclone
R
false
false
2,195
rd
\encoding{UTF-8} \name{clusterSize} \Rdversion{1.1} \alias{clusterSize} \alias{plotClusterSize} \title{ Optimizing the number of workers } \description{ These functions help in optimizing workload for the workers if problems are of different size. } \usage{ clusterSize(size) plotClusterSize(n, size, balancing = c...
# Helper functions for plotting the fit of the (non-Bayesian) models fit by gamlss # # Author: mjskay ############################################################################### library(dplyr) library(ggplot2) # ggplot, geom_..., etc library(scales) # trans_format library(grid) library(gtable) #m...
/src/plot_model.R
no_license
ethansr/ranking-correlation
R
false
false
4,489
r
# Helper functions for plotting the fit of the (non-Bayesian) models fit by gamlss # # Author: mjskay ############################################################################### library(dplyr) library(ggplot2) # ggplot, geom_..., etc library(scales) # trans_format library(grid) library(gtable) #m...
\name{nonlinearModel-class} \Rdversion{1.1} \docType{class} \alias{nonlinearModel-class} \title{Class \code{"nonlinearModel"}} \description{ Class for moment-based models for which moment conditions are orthogonality conditions between instruments and the residuals from a nonlinear regression. } \section{Object...
/man/nonlinearModel-class.Rd
no_license
cran/momentfit
R
false
false
2,618
rd
\name{nonlinearModel-class} \Rdversion{1.1} \docType{class} \alias{nonlinearModel-class} \title{Class \code{"nonlinearModel"}} \description{ Class for moment-based models for which moment conditions are orthogonality conditions between instruments and the residuals from a nonlinear regression. } \section{Object...
library(tidyverse) # Edit package code <- file("/home/lee/workspace/nephrology/package/estimation_study_146_export/R/Export.R") code_lines <- readLines(code) code_lines <- str_replace(string = code_lines, pattern = "(readChar\\(\\w+, \\w+.\\w+\\(\\w+\\)\\$\\w+)(\\))", replacement = "\\1, useBytes = TRUE\\2") sink("/ho...
/nephrology/r/run.R
no_license
CHUNGGAK/research
R
false
false
2,098
r
library(tidyverse) # Edit package code <- file("/home/lee/workspace/nephrology/package/estimation_study_146_export/R/Export.R") code_lines <- readLines(code) code_lines <- str_replace(string = code_lines, pattern = "(readChar\\(\\w+, \\w+.\\w+\\(\\w+\\)\\$\\w+)(\\))", replacement = "\\1, useBytes = TRUE\\2") sink("/ho...
<html> <head> <meta name="TextLength" content="SENT_NUM:6, WORD_NUM:114"> </head> <body bgcolor="white"> <a href="#0" id="0">The guns are originals dating from the ship's first commissioning at the height of World War II in 1943 as a sister ship of the Missouri, aboard which the Japanese signed the war-ending surrender...
/DUC-Dataset/Summary_m100_R/D084.M.100.html.R
no_license
Angela7126/SLNSumEval
R
false
false
954
r
<html> <head> <meta name="TextLength" content="SENT_NUM:6, WORD_NUM:114"> </head> <body bgcolor="white"> <a href="#0" id="0">The guns are originals dating from the ship's first commissioning at the height of World War II in 1943 as a sister ship of the Missouri, aboard which the Japanese signed the war-ending surrender...
# Getting & Cleaning Data, Final Project # Scriptfile: run_analysis.R # First the script loads the dplyr library library(dplyr) # In the next section, all the input files are read and assigned to appropriate variables. # * activity_labels holds the activity names. # * measurement_labels holds the names of the me...
/run_analysis.R
no_license
DennisTheChimp/CleanDataFinal
R
false
false
2,959
r
# Getting & Cleaning Data, Final Project # Scriptfile: run_analysis.R # First the script loads the dplyr library library(dplyr) # In the next section, all the input files are read and assigned to appropriate variables. # * activity_labels holds the activity names. # * measurement_labels holds the names of the me...
source(here::here("scripts", "libraries.R")) all_countries <- c("BEN", "BFA", "CIV", "CMR", "CPV", "DZA", "ESH", "GHA", "GIN", "GMB", "GNB", "LBR", "MAR", "MLI", "MRT", "NER", "NGA", "SEN", "SLE", "TCD", "TGO") wa_countries <- c("BEN", "BFA", "CIV", "CPV", "ESH", "GHA", ...
/scripts/archived/mapping_traps.R
permissive
DidDrog11/scoping_review
R
false
false
17,003
r
source(here::here("scripts", "libraries.R")) all_countries <- c("BEN", "BFA", "CIV", "CMR", "CPV", "DZA", "ESH", "GHA", "GIN", "GMB", "GNB", "LBR", "MAR", "MLI", "MRT", "NER", "NGA", "SEN", "SLE", "TCD", "TGO") wa_countries <- c("BEN", "BFA", "CIV", "CPV", "ESH", "GHA", ...
# Push ------------------------------------------------------------------- context("box_push") test_that("box_push a dir", { skip_on_cran() boxr:::skip_on_travis() options(boxr.verbose = FALSE) # (Re)create local dir structure boxr:::create_test_dir() # Clear out whatever's already in there boxr:...
/tests/testthat/test_06_push.R
permissive
romainfrancois/boxr
R
false
false
1,827
r
# Push ------------------------------------------------------------------- context("box_push") test_that("box_push a dir", { skip_on_cran() boxr:::skip_on_travis() options(boxr.verbose = FALSE) # (Re)create local dir structure boxr:::create_test_dir() # Clear out whatever's already in there boxr:...
#Ziel dieser App: Studis verstehen, welchen Einfluss die Höhe des Glättungparameters auf die Glättung hat #M kann zwischen 2 une 100 variiert werden library(shiny) library(ggplot2) library(Matrix) #to use bandSparse to create band matrix library(MASS) #to use mvrnorm to create multivar Gaussian vector #library(gra...
/Zeitreihe/Stuetzbereich_Moving_Average/app.R
no_license
Kale14/shiny_apps
R
false
false
1,740
r
#Ziel dieser App: Studis verstehen, welchen Einfluss die Höhe des Glättungparameters auf die Glättung hat #M kann zwischen 2 une 100 variiert werden library(shiny) library(ggplot2) library(Matrix) #to use bandSparse to create band matrix library(MASS) #to use mvrnorm to create multivar Gaussian vector #library(gra...
library(PharmacoGx) context("Checking unionList function.") test_that("union List works as union with arbitrary number of arguments",{ expect_equal(unionList(1,2,3,4,2,2,1), c(1,2,3,4)) expect_equal(unionList(1,2), c(1,2)) expect_equal(unionList(list(c(1,2,3), c(2,3,4), c(1,1,1))), c(1,2,3,4)) expect_equal(unionL...
/tests/testthat/test_unionList.R
no_license
Deepstatsanalysis/PharmacoGx
R
false
false
631
r
library(PharmacoGx) context("Checking unionList function.") test_that("union List works as union with arbitrary number of arguments",{ expect_equal(unionList(1,2,3,4,2,2,1), c(1,2,3,4)) expect_equal(unionList(1,2), c(1,2)) expect_equal(unionList(list(c(1,2,3), c(2,3,4), c(1,1,1))), c(1,2,3,4)) expect_equal(unionL...
library(rsconnect) library(shiny) data(iris) shinyServer(function(input, output) { output$scatter <- renderPlotly({ plot_ly(iris, x = iris[, input$xvar], y = iris[, input$yvar], mode = "markers", marker = list( size = 6, color = "Dee...
/iris/server.R
no_license
pemasherpa/a8-building-applications
R
false
false
658
r
library(rsconnect) library(shiny) data(iris) shinyServer(function(input, output) { output$scatter <- renderPlotly({ plot_ly(iris, x = iris[, input$xvar], y = iris[, input$yvar], mode = "markers", marker = list( size = 6, color = "Dee...
# 상관관계 분석 : 상관계수(밀도를 수치로 표현)의 수치로 변수간의 관계를 파악 hf <- read.csv("testdata/galton.csv", header = T, stringsAsFactors = F) head(hf) hf$sex <- factor(hf$sex, levels = c("M", "F")) hf_son <- subset(hf, sex == "M") # 아들만 뽑음. hf_son <- hf_son[c("father", "height")] head(hf_son) # 아버지와 아들의 키만 추출. # 공분산 cov(hf_son$father, hf_s...
/rsou/pro2/ex15cor.R
no_license
gom4851/hcjeon
R
false
false
679
r
# 상관관계 분석 : 상관계수(밀도를 수치로 표현)의 수치로 변수간의 관계를 파악 hf <- read.csv("testdata/galton.csv", header = T, stringsAsFactors = F) head(hf) hf$sex <- factor(hf$sex, levels = c("M", "F")) hf_son <- subset(hf, sex == "M") # 아들만 뽑음. hf_son <- hf_son[c("father", "height")] head(hf_son) # 아버지와 아들의 키만 추출. # 공분산 cov(hf_son$father, hf_s...
require("RcppStable") require("ggplot2") require("grid") pPareto <- RcppStable:::pPareto source(system.file("test-tools-1.R", package = "Matrix"), keep.source=interactive()) #-> identical3(), showProc.time(),... options(pstable.debug = FALSE) # options(pstable.debug = TRUE)# want to see when uniroot() is called...
/tests/pstab-ex.R
permissive
JoeDunnStable/RcppStable
R
false
false
10,076
r
require("RcppStable") require("ggplot2") require("grid") pPareto <- RcppStable:::pPareto source(system.file("test-tools-1.R", package = "Matrix"), keep.source=interactive()) #-> identical3(), showProc.time(),... options(pstable.debug = FALSE) # options(pstable.debug = TRUE)# want to see when uniroot() is called...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Noptim.r \name{Noptim} \alias{Noptim} \title{Suggested optimal value for N} \usage{ Noptim(object) } \arguments{ \item{object}{object of class \code{\link[=prevR-class]{prevR}}.} } \value{ an integer. } \description{ Based on previous similut...
/man/Noptim.Rd
no_license
mohamedndiaye/prevR
R
false
true
904
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Noptim.r \name{Noptim} \alias{Noptim} \title{Suggested optimal value for N} \usage{ Noptim(object) } \arguments{ \item{object}{object of class \code{\link[=prevR-class]{prevR}}.} } \value{ an integer. } \description{ Based on previous similut...
########### Plotting solar and microgrid projects library(maptools) #Setting the directory setwd('/Users/Diego/Desktop/IBM/Raw_Data/Kenya_Ag_Data') #Kenya Shape File kenya_shapefile <- readShapePoly('county/County.shp') plot(kenya_shapefile) par(new=TRUE) ### equity setwd('/Users/Diego/Desktop/IBM/Raw_Data') equ...
/R/finance.R
no_license
diegoleonbarido/natural_infrastructural_capital
R
false
false
875
r
########### Plotting solar and microgrid projects library(maptools) #Setting the directory setwd('/Users/Diego/Desktop/IBM/Raw_Data/Kenya_Ag_Data') #Kenya Shape File kenya_shapefile <- readShapePoly('county/County.shp') plot(kenya_shapefile) par(new=TRUE) ### equity setwd('/Users/Diego/Desktop/IBM/Raw_Data') equ...
library(secret) ### Name: add_user ### Title: Add a new user to the vault. ### Aliases: add_user ### ** Examples # The `secret` package contains some user keys for demonstration purposes. # In this example, Alice shares a secret with Bob using a vault. keys <- function(x){ file.path(system.file("user_keys", pac...
/data/genthat_extracted_code/secret/examples/add_user.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
1,739
r
library(secret) ### Name: add_user ### Title: Add a new user to the vault. ### Aliases: add_user ### ** Examples # The `secret` package contains some user keys for demonstration purposes. # In this example, Alice shares a secret with Bob using a vault. keys <- function(x){ file.path(system.file("user_keys", pac...
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function makeCacheMatrix <- function(x = matrix()) { ## x represents an invertible matrix ## This function creates a special "matrix" object that can cache its inverse #...
/cachematrix.R
no_license
RuserSM/ProgrammingAssignment2
R
false
false
1,756
r
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function makeCacheMatrix <- function(x = matrix()) { ## x represents an invertible matrix ## This function creates a special "matrix" object that can cache its inverse #...
options(repr.plot.width=7, repr.plot.height=5) x <- seq(-2, 2, 0.01) #plot the prior y1 <- dnorm(x, mean=0, sd=sqrt(0.1)) plot(x, y1, type="l", lwd=1, col="blue", ylim=c(0,3), ylab="Density", xlab=expression(mu)) legend("topleft", legend=c("Prior distribution", "Distribution of mean of y", "Posterior distribution"), ...
/Jupyter_Book/SHDS/_build/jupyter_execute/10.d. Bayesian Statistics II.r
no_license
kath-o-reilly/Content-2021
R
false
false
571
r
options(repr.plot.width=7, repr.plot.height=5) x <- seq(-2, 2, 0.01) #plot the prior y1 <- dnorm(x, mean=0, sd=sqrt(0.1)) plot(x, y1, type="l", lwd=1, col="blue", ylim=c(0,3), ylab="Density", xlab=expression(mu)) legend("topleft", legend=c("Prior distribution", "Distribution of mean of y", "Posterior distribution"), ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/kNNCliques.R \name{kNNCliques} \alias{kNNCliques} \title{Clustering based on kNN and Cliques} \usage{ kNNCliques(dm, MAX_ITER = 5, basename = "iter", format = "graphml", min.size = NULL, saveSz = c("all", "top2", "top3", "top"), verbose = T...
/man/kNNCliques.Rd
no_license
mahdinaser/mstknn
R
false
true
1,743
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/kNNCliques.R \name{kNNCliques} \alias{kNNCliques} \title{Clustering based on kNN and Cliques} \usage{ kNNCliques(dm, MAX_ITER = 5, basename = "iter", format = "graphml", min.size = NULL, saveSz = c("all", "top2", "top3", "top"), verbose = T...
## PMatrix inversion is usually a costly computation and there may be #some benefit to caching the inverse of a matrix rather than computing it repeatedly ## This function creates a special "matrix" object that can cache its inverse. ## These functions are a pair of functions that cache the inverse of a matrix. makeCa...
/cachematrix.R
no_license
chunjinfeng/ProgrammingAssignment2
R
false
false
1,160
r
## PMatrix inversion is usually a costly computation and there may be #some benefit to caching the inverse of a matrix rather than computing it repeatedly ## This function creates a special "matrix" object that can cache its inverse. ## These functions are a pair of functions that cache the inverse of a matrix. makeCa...
# This script reads in the data for the project # and separates them into two objects NEI <- readRDS("summarySCC_PM25.rds") SCC <- readRDS("Source_Classification_Code.rds") head(NEI) head(SCC) dim(NEI) dim(SCC)
/readData.R
no_license
cmahoney34/ExData_Plotting2
R
false
false
213
r
# This script reads in the data for the project # and separates them into two objects NEI <- readRDS("summarySCC_PM25.rds") SCC <- readRDS("Source_Classification_Code.rds") head(NEI) head(SCC) dim(NEI) dim(SCC)
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/recalc_licor.R \name{calc_licor} \alias{calc_licor} \title{Calculate metrics for LI-COR 6400} \usage{ calc_licor(licor) } \arguments{ \item{licor}{licor object} } \description{ Calculate metrics for LI-COR 6400 } \details{ All calculations ar...
/man/calc_licor.Rd
permissive
Plant-Functional-Trait-Course/LICOR6400
R
false
true
622
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/recalc_licor.R \name{calc_licor} \alias{calc_licor} \title{Calculate metrics for LI-COR 6400} \usage{ calc_licor(licor) } \arguments{ \item{licor}{licor object} } \description{ Calculate metrics for LI-COR 6400 } \details{ All calculations ar...
dist_xy<-function(lat1,long1,lat2,long2,unit){ #lat1<-56 #lat2<-57 #long1<-(-174) #long2<-(-171) #unit="m" r<-ifelse(unit == "m", 6371200,6371.2) la1 = lat1 * pi / 180 la2 = lat2 *pi / 180 lo1 = long1 * pi / 180 lo2 = long2 * pi/ 180 rads <- acos((sin(la1) * sin(la2)) + (cos(la1) * cos(la2) * cos(lo2 - lo1))) retu...
/dist_xy.R
no_license
bvhackett/eulachon
R
false
false
335
r
dist_xy<-function(lat1,long1,lat2,long2,unit){ #lat1<-56 #lat2<-57 #long1<-(-174) #long2<-(-171) #unit="m" r<-ifelse(unit == "m", 6371200,6371.2) la1 = lat1 * pi / 180 la2 = lat2 *pi / 180 lo1 = long1 * pi / 180 lo2 = long2 * pi/ 180 rads <- acos((sin(la1) * sin(la2)) + (cos(la1) * cos(la2) * cos(lo2 - lo1))) retu...
library(fitur) ### Name: build_dist ### Title: Build Distribution Functions ### Aliases: build_dist ### ** Examples fittedDists <- build_dist(rpois(100,5), 'pois') dpois(x = 5, lambda = 5) fittedDists$dpois(5) ppois(5, 5) fittedDists$ppois(5) qpois(.5, 5) fittedDists$qpois(.5) set.seed(8257) rpois(100, 5) set.seed(...
/data/genthat_extracted_code/fitur/examples/build_dist.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
375
r
library(fitur) ### Name: build_dist ### Title: Build Distribution Functions ### Aliases: build_dist ### ** Examples fittedDists <- build_dist(rpois(100,5), 'pois') dpois(x = 5, lambda = 5) fittedDists$dpois(5) ppois(5, 5) fittedDists$ppois(5) qpois(.5, 5) fittedDists$qpois(.5) set.seed(8257) rpois(100, 5) set.seed(...
##make supplemental table of significant whole genome sequencing (minikraken and humann) ##associations with metabolite and metadata rm(list=ls()) setwd("") meta = c("metabolon", "metadata") alpha = 0.05 #adjusted sig level ##function to get metadata labels from given variable var md.convert = read.table("me...
/supplementalTables/AssocTableSupp_wgs.R
no_license
mafergomez70/UrbanRuralChina
R
false
false
13,606
r
##make supplemental table of significant whole genome sequencing (minikraken and humann) ##associations with metabolite and metadata rm(list=ls()) setwd("") meta = c("metabolon", "metadata") alpha = 0.05 #adjusted sig level ##function to get metadata labels from given variable var md.convert = read.table("me...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot-double.R \name{plot_compact_double} \alias{plot_compact_double} \title{Plot the individual bits of a double in a compact form} \usage{ plot_compact_double(dbl, base_size = 8, legend.text.multiplier = 3, ...) } \arguments{ \item{dbl}{do...
/man/plot_compact_double.Rd
permissive
coolbutuseless/exhibitionist
R
false
true
552
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot-double.R \name{plot_compact_double} \alias{plot_compact_double} \title{Plot the individual bits of a double in a compact form} \usage{ plot_compact_double(dbl, base_size = 8, legend.text.multiplier = 3, ...) } \arguments{ \item{dbl}{do...
# load normal_list from clean_data scripts -------------------------------- # load("data/normal_list.rda") load("data/normal_list_log.rda") # convert to tidy format -------------------------------------------------- n <- length(normal_list) normal_tidy <- data.frame(index(normal_list[[1]]),rep(names(normal_list...
/R/4_order_parameter.R
no_license
baharAfshari/collective_behavior_SP500
R
false
false
3,142
r
# load normal_list from clean_data scripts -------------------------------- # load("data/normal_list.rda") load("data/normal_list_log.rda") # convert to tidy format -------------------------------------------------- n <- length(normal_list) normal_tidy <- data.frame(index(normal_list[[1]]),rep(names(normal_list...
library(tidyverse) library(tidygraph) library(ggraph) library(magrittr) library(visNetwork) files <- list.files("../data", pattern = '.csv', full.names = T) data_got <- files %>% map_df (read_csv) data<- data_got %>% rename (from = Source, to = Target) %>% select (-Type) # SELECCION DE TEMPORADA season = ...
/src/NetWorkAnalysis.R
no_license
KaLizzyGam/got_network_analysis
R
false
false
11,878
r
library(tidyverse) library(tidygraph) library(ggraph) library(magrittr) library(visNetwork) files <- list.files("../data", pattern = '.csv', full.names = T) data_got <- files %>% map_df (read_csv) data<- data_got %>% rename (from = Source, to = Target) %>% select (-Type) # SELECCION DE TEMPORADA season = ...
source("loadData.R") source("savePlot.R") # load the household data householData <- loadData("household_power_consumption.txt") # plot my histogram hist(householData$Global_active_power, main = "Global active power", xlab = "Global Active Power (kilowatts)", col = "red") # save! savePlot("plot1.png")
/plot1.R
no_license
jonathanglima/ExData_Plotting1
R
false
false
304
r
source("loadData.R") source("savePlot.R") # load the household data householData <- loadData("household_power_consumption.txt") # plot my histogram hist(householData$Global_active_power, main = "Global active power", xlab = "Global Active Power (kilowatts)", col = "red") # save! savePlot("plot1.png")
library(MASS) library(Matrix) library(glasso) library(igraph) library(coda) library(huge) #this method generates a symmetric positive definite matrix of size n generate.psdMat = function(n){ #generate a random n by n matrix m = matrix(runif(n*n),n,n) #make is symmetric m = m + t(m) #make it positive def...
/util.R
no_license
niharikag/MCMCSimulation
R
false
false
2,573
r
library(MASS) library(Matrix) library(glasso) library(igraph) library(coda) library(huge) #this method generates a symmetric positive definite matrix of size n generate.psdMat = function(n){ #generate a random n by n matrix m = matrix(runif(n*n),n,n) #make is symmetric m = m + t(m) #make it positive def...
\name{cran3} \alias{cran3} \docType{data} \title{ %% ~~ data name/kind ... ~~ } \description{ %% ~~ A concise (1-5 lines) description of the dataset. ~~ } \usage{data("cran3")} \format{ A data frame with 225468 observations on the following 3 variables. \describe{ \item{\code{ip_id}}{a numeric vector} \i...
/m2_rp/assignment3/anRpackage/man/cran3.Rd
no_license
bogosai/datasciencecoursera
R
false
false
721
rd
\name{cran3} \alias{cran3} \docType{data} \title{ %% ~~ data name/kind ... ~~ } \description{ %% ~~ A concise (1-5 lines) description of the dataset. ~~ } \usage{data("cran3")} \format{ A data frame with 225468 observations on the following 3 variables. \describe{ \item{\code{ip_id}}{a numeric vector} \i...
# Create a histogram for population library(ggplot2) # Create the graph and axes histPop <- ggplot(merged_data, aes(x=population)) # Add the histogram and specify borders and color histPop <- histPop + geom_histogram(binwidth=5000000, color="black", fill="white") # Add the title histPop <- histPop + ggtitle("State Pop...
/genHists.R
no_license
fall2018-saltz/rnl_hw6
R
false
false
705
r
# Create a histogram for population library(ggplot2) # Create the graph and axes histPop <- ggplot(merged_data, aes(x=population)) # Add the histogram and specify borders and color histPop <- histPop + geom_histogram(binwidth=5000000, color="black", fill="white") # Add the title histPop <- histPop + ggtitle("State Pop...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/uscb_layer_get_layer.R \name{get_layer_group_names} \alias{get_layer_group_names} \alias{get_layer_group_names.uscb_layer} \title{Get layer group names} \usage{ get_layer_group_names(ul) \method{get_layer_group_names}{uscb_layer}(ul) } \argu...
/man/get_layer_group_names.Rd
permissive
josesamos/geogenr
R
false
true
1,228
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/uscb_layer_get_layer.R \name{get_layer_group_names} \alias{get_layer_group_names} \alias{get_layer_group_names.uscb_layer} \title{Get layer group names} \usage{ get_layer_group_names(ul) \method{get_layer_group_names}{uscb_layer}(ul) } \argu...
library(tidyverse) library(raster) library(rgdal) library(leaflet) # Load data to display # ##################### Africa # solution <- raster("data_Africa/solutions/AT_Birds_gf8570_BLP1_noPA.CAZ_EBLP100.rank.compressed_x2.tif") # # Test with different resolutions # solution_2 <- solution %>% # aggregate(...
/global.R
no_license
javierfajnolla/viewerSPARC
R
false
false
7,064
r
library(tidyverse) library(raster) library(rgdal) library(leaflet) # Load data to display # ##################### Africa # solution <- raster("data_Africa/solutions/AT_Birds_gf8570_BLP1_noPA.CAZ_EBLP100.rank.compressed_x2.tif") # # Test with different resolutions # solution_2 <- solution %>% # aggregate(...
data <- read.table("household_power_consumption.txt", sep=';', header=T, colClasses = c('character', 'character', 'numeric', 'numeric', 'numeric', 'numeric', 'numeric', 'numeric', 'numeric'), na.strings='?') data...
/plot1.R
no_license
Arindam-1995/ExData_Plotting1
R
false
false
793
r
data <- read.table("household_power_consumption.txt", sep=';', header=T, colClasses = c('character', 'character', 'numeric', 'numeric', 'numeric', 'numeric', 'numeric', 'numeric', 'numeric'), na.strings='?') data...
#include "src/resource_id.h" // File Menu resource('CSTR', KR_FILE_MENU, "File Menu") { "File" } resource('CSTR', KR_OPEN_ITEM, "Open Item") { "Open" } resource('CSTR', KR_QUIT_ITEM, "Quit Item") { "Quit" } // Control Menu resource('CSTR', KR_CONTROL_MENU, "Control Menu") { "Control" } resource('CSTR', KR_STA...
/src/strings.r
no_license
ktoshihiro/KMidiPlay
R
false
false
664
r
#include "src/resource_id.h" // File Menu resource('CSTR', KR_FILE_MENU, "File Menu") { "File" } resource('CSTR', KR_OPEN_ITEM, "Open Item") { "Open" } resource('CSTR', KR_QUIT_ITEM, "Quit Item") { "Quit" } // Control Menu resource('CSTR', KR_CONTROL_MENU, "Control Menu") { "Control" } resource('CSTR', KR_STA...
library(longitudinalData) ### Name: scale ### Title: ~ Function: scale for LongData ~ ### Aliases: scale scale,LongData scale,LongData3d scale,LongData-method ### scale,LongData3d-method ### Keywords: method ### ** Examples ################## ### Building LongData time=c(1,2,3,4,8,12,16,20) id2=1:12 f <- functio...
/data/genthat_extracted_code/longitudinalData/examples/scale.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
781
r
library(longitudinalData) ### Name: scale ### Title: ~ Function: scale for LongData ~ ### Aliases: scale scale,LongData scale,LongData3d scale,LongData-method ### scale,LongData3d-method ### Keywords: method ### ** Examples ################## ### Building LongData time=c(1,2,3,4,8,12,16,20) id2=1:12 f <- functio...
## catch histories were created in setUpScenario_ts_files_versionC1.R - they are full historic + 50 year future runs ## biol.prm files for eddy_scale are created first thisPath<-paste(DIR$'Base',"ATLANTISmodels\\",sep="") version<-"C" runPath<-paste(thisPath,"eddySens\\",sep="") groupsDF<-read.csv(paste(thi...
/(5)BottomUpVariability/EDDYscaleSens_TESTING.R
no_license
mcgregorv/AtlantisRscripts
R
false
false
19,417
r
## catch histories were created in setUpScenario_ts_files_versionC1.R - they are full historic + 50 year future runs ## biol.prm files for eddy_scale are created first thisPath<-paste(DIR$'Base',"ATLANTISmodels\\",sep="") version<-"C" runPath<-paste(thisPath,"eddySens\\",sep="") groupsDF<-read.csv(paste(thi...
context("id") # use_id ------------------------------------------------------------------ test_that("use_id works", { mtcars_id <- mtcars %>% use_id() expect_true(is_keyed_df(mtcars_id)) expect_identical(names(keys(mtcars_id)), ".id") expect_identical(keys(mtcars_id)[[1]], seq_len(nrow(mtcars))) }) # compu...
/tests/testthat/test-id.R
no_license
echasnovski/keyholder
R
false
false
5,106
r
context("id") # use_id ------------------------------------------------------------------ test_that("use_id works", { mtcars_id <- mtcars %>% use_id() expect_true(is_keyed_df(mtcars_id)) expect_identical(names(keys(mtcars_id)), ".id") expect_identical(keys(mtcars_id)[[1]], seq_len(nrow(mtcars))) }) # compu...
library(dplyr) library(ggplot2) # Bayes rule -------------------------------------------------------------- ## P(Incident | Positive test) = P(Positive test | Incident) * P(Incident) ## / P(Positive) i.e. P(Incident)*P(Positive test | Incident) + P(No Incident)*P(Positive test | No Incident) ## we are weighting by t...
/edx_biostats/3_highthroughput/4a_Bayes.R
no_license
aaronwflee/Courses
R
false
false
4,371
r
library(dplyr) library(ggplot2) # Bayes rule -------------------------------------------------------------- ## P(Incident | Positive test) = P(Positive test | Incident) * P(Incident) ## / P(Positive) i.e. P(Incident)*P(Positive test | Incident) + P(No Incident)*P(Positive test | No Incident) ## we are weighting by t...