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
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hostname.R \name{ip_to_hostname} \alias{ip_to_hostname} \alias{hostname_to_ip} \title{Translate address to/from hostname} \usage{ ip_to_hostname(x, multiple = FALSE) hostname_to_ip(x, multiple = FALSE) } \arguments{ \item{x}{\itemize{ \item ...
/man/ip_to_hostname.Rd
permissive
DavisVaughan/ipaddress
R
false
true
1,996
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hostname.R \name{ip_to_hostname} \alias{ip_to_hostname} \alias{hostname_to_ip} \title{Translate address to/from hostname} \usage{ ip_to_hostname(x, multiple = FALSE) hostname_to_ip(x, multiple = FALSE) } \arguments{ \item{x}{\itemize{ \item ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/functions.R \name{clust_all} \alias{clust_all} \title{Build mclust models for multiple fragments} \usage{ clust_all( data, fragnames, contrib_col_name = "Contribution", mol_col_name = "MolID" ) } \arguments{ \item{data}{input data.fra...
/man/clust_all.Rd
no_license
DrrDom/rspci
R
false
true
1,062
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/functions.R \name{clust_all} \alias{clust_all} \title{Build mclust models for multiple fragments} \usage{ clust_all( data, fragnames, contrib_col_name = "Contribution", mol_col_name = "MolID" ) } \arguments{ \item{data}{input data.fra...
##------------------------------------------------------------------------------- ## Copyright (c) 2012 University of Illinois, NCSA. ## All rights reserved. This program and the accompanying materials ## are made available under the terms of the ## University of Illinois/NCSA Open Source License ## which accompanies ...
/utils/R/sensitivity.R
permissive
kemball/pecan
R
false
false
10,711
r
##------------------------------------------------------------------------------- ## Copyright (c) 2012 University of Illinois, NCSA. ## All rights reserved. This program and the accompanying materials ## are made available under the terms of the ## University of Illinois/NCSA Open Source License ## which accompanies ...
library(censorcopula) ### Name: Newloglik2 ### Title: likelihood function ### Aliases: Newloglik2 ### Keywords: copula likelihood ### ** Examples library(copula) ## generate sample data <- rCopula(50, claytonCopula(2)) ## return the value of log-likelihood funcion for selected params Newloglik2(param=2, data, cla...
/data/genthat_extracted_code/censorcopula/examples/Newloglik2.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
339
r
library(censorcopula) ### Name: Newloglik2 ### Title: likelihood function ### Aliases: Newloglik2 ### Keywords: copula likelihood ### ** Examples library(copula) ## generate sample data <- rCopula(50, claytonCopula(2)) ## return the value of log-likelihood funcion for selected params Newloglik2(param=2, data, cla...
setwd("~/DataVisualization/DV_RProject3/01 Data/CSVs") file_path <- "statesAbbr.csv" df <- read.csv(file_path, stringsAsFactors = FALSE) # Replace "." (i.e., period) with "_" in the column names. names(df) <- gsub("\\.+", "_", names(df)) str(df) for(n in names(df)) { df[n] <- data.frame(lapply(df[n], gsub, patte...
/01 Data/Set_Up_StateAbbr.R
no_license
amurga1/DV_RProject3
R
false
false
969
r
setwd("~/DataVisualization/DV_RProject3/01 Data/CSVs") file_path <- "statesAbbr.csv" df <- read.csv(file_path, stringsAsFactors = FALSE) # Replace "." (i.e., period) with "_" in the column names. names(df) <- gsub("\\.+", "_", names(df)) str(df) for(n in names(df)) { df[n] <- data.frame(lapply(df[n], gsub, patte...
# generic methods for "BinData" class setGeneric( "chrID", function( object, ... ) standardGeneric("chrID") ) setGeneric( "coord", function( object, ... ) standardGeneric("coord") ) setGeneric( "tagCount", function( object, ... ) standardGeneric("tagCount") ) setGeneric( "...
/R/AllGenerics.R
no_license
duydnguyen/mosaics
R
false
false
1,564
r
# generic methods for "BinData" class setGeneric( "chrID", function( object, ... ) standardGeneric("chrID") ) setGeneric( "coord", function( object, ... ) standardGeneric("coord") ) setGeneric( "tagCount", function( object, ... ) standardGeneric("tagCount") ) setGeneric( "...
testlist <- list(x = numeric(0), y = 1.00508743500389e+180) result <- do.call(blorr:::blr_pairs_cpp,testlist) str(result)
/blorr/inst/testfiles/blr_pairs_cpp/libFuzzer_blr_pairs_cpp/blr_pairs_cpp_valgrind_files/1609956595-test.R
no_license
akhikolla/updated-only-Issues
R
false
false
121
r
testlist <- list(x = numeric(0), y = 1.00508743500389e+180) result <- do.call(blorr:::blr_pairs_cpp,testlist) str(result)
load(file="mortality.model.RData") for (i in 1:5){ load(file=paste0("/home/cheunglc/lyg/nhis2002_09/nhis_imputed_", i,".RData")) for (j in 2002:2009) { eval(parse(text=paste0("x <- subset(nhis,year==",j,")"))) #create directory and save subsetted file dirname <- paste0("/home/cheunglc/lyg/nhis2002...
/old/est_lyg.R
no_license
liccheung/life-years-gained
R
false
false
1,044
r
load(file="mortality.model.RData") for (i in 1:5){ load(file=paste0("/home/cheunglc/lyg/nhis2002_09/nhis_imputed_", i,".RData")) for (j in 2002:2009) { eval(parse(text=paste0("x <- subset(nhis,year==",j,")"))) #create directory and save subsetted file dirname <- paste0("/home/cheunglc/lyg/nhis2002...
# Hello, world! # # This is an example function named 'hello' # which prints 'Hello, world!'. # # You can learn more about package authoring with RStudio at: # # http://r-pkgs.had.co.nz/ # # Some useful keyboard shortcuts for package authoring: # # Build and Reload Package: 'Cmd + Shift + B' # Check Package: ...
/R/hello.R
no_license
mages/PSRWP
R
false
false
455
r
# Hello, world! # # This is an example function named 'hello' # which prints 'Hello, world!'. # # You can learn more about package authoring with RStudio at: # # http://r-pkgs.had.co.nz/ # # Some useful keyboard shortcuts for package authoring: # # Build and Reload Package: 'Cmd + Shift + B' # Check Package: ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/checkAtomic.R \name{checkAtomic} \alias{assertAtomic} \alias{assert_atomic} \alias{checkAtomic} \alias{expect_atomic} \alias{testAtomic} \alias{test_atomic} \title{Check that an argument is an atomic vector} \usage{ checkAtomic(x, any.missing...
/man/checkAtomic.Rd
no_license
jackwasey/checkmate
R
false
true
3,726
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/checkAtomic.R \name{checkAtomic} \alias{assertAtomic} \alias{assert_atomic} \alias{checkAtomic} \alias{expect_atomic} \alias{testAtomic} \alias{test_atomic} \title{Check that an argument is an atomic vector} \usage{ checkAtomic(x, any.missing...
# hacked by Gareth Wilson - original function genomeVector forms part of MEDIPS package by Lukas Chavez genomeVectorStrand <- function (data = NULL, extend = 400, bin_size = 50,strandSpec = NULL) { if (class(data) != "MEDIPSset") stop("Must specify a MEDIPSset object.") chr = regions_chr(data) st...
/useq_pipe/v0_4/R_scripts/medips_strand_function.R
no_license
xflicsu/shared_scripts
R
false
false
2,654
r
# hacked by Gareth Wilson - original function genomeVector forms part of MEDIPS package by Lukas Chavez genomeVectorStrand <- function (data = NULL, extend = 400, bin_size = 50,strandSpec = NULL) { if (class(data) != "MEDIPSset") stop("Must specify a MEDIPSset object.") chr = regions_chr(data) st...
# Reading the Database power <- read.table("household_power_consumption.txt", sep =";", header = TRUE, na.strings = "?", nrows = 72000, colClasses = c("character", "character","numeric","numeric","numeric","numeric","numeric", "numeric","numeric")) # It is ...
/plot4.R
no_license
DanielCabello/datasciencecoursera
R
false
false
2,508
r
# Reading the Database power <- read.table("household_power_consumption.txt", sep =";", header = TRUE, na.strings = "?", nrows = 72000, colClasses = c("character", "character","numeric","numeric","numeric","numeric","numeric", "numeric","numeric")) # It is ...
#' @title Create networks from social media data #' #' @description This function creates networks from social media data as produced from \code{\link{Collect}}. #' \code{Create} is the final step of the \code{\link{Authenticate}}, \code{\link{Collect}} and \code{Create} #' workflow. #' #' There are four ty...
/R/Create.R
no_license
cran/vosonSML
R
false
false
4,284
r
#' @title Create networks from social media data #' #' @description This function creates networks from social media data as produced from \code{\link{Collect}}. #' \code{Create} is the final step of the \code{\link{Authenticate}}, \code{\link{Collect}} and \code{Create} #' workflow. #' #' There are four ty...
set.seed(0) ### Test soft_threshold verify_constraints <- function(x, s, tol = 1e-12) { expect_lte(norm(x, type = "2"), 1 + tol) expect_lte(sum(abs(x)), s + tol) } test_that("soft_threshold returns a vector that satisfies the constraints", { verify_constraints(soft_threshold(rep(0, 12), 1), 1) verif...
/tests/testthat/test_soft_threshold.r
no_license
cran/RGCCA
R
false
false
435
r
set.seed(0) ### Test soft_threshold verify_constraints <- function(x, s, tol = 1e-12) { expect_lte(norm(x, type = "2"), 1 + tol) expect_lte(sum(abs(x)), s + tol) } test_that("soft_threshold returns a vector that satisfies the constraints", { verify_constraints(soft_threshold(rep(0, 12), 1), 1) verif...
## ----setup, message=FALSE, echo = FALSE------------------------------------------------- library(BiocStyle) library(knitr) library(clusterProfiler) options(digits=3) options(width=90) setwd('//DATA2/work/lbyybl/coorlaborate/YB/cutadapt/output/rna_graph') ## ----setup2, message=FALSE, eval=TRUE------------------------...
/coorlabate/RNA-seq.r
no_license
Wenxue-PKU/script
R
false
false
12,897
r
## ----setup, message=FALSE, echo = FALSE------------------------------------------------- library(BiocStyle) library(knitr) library(clusterProfiler) options(digits=3) options(width=90) setwd('//DATA2/work/lbyybl/coorlaborate/YB/cutadapt/output/rna_graph') ## ----setup2, message=FALSE, eval=TRUE------------------------...
plot1 <- function() { ## Load data corresponding to Feb. 1-2, 2007. Row ranges were ## determined by manually looking at the data. col_class = c("character","character","numeric","numeric","numeric", "numeric","numeric","numeric","numeric") data <- read.table("../household_...
/plot1.R
no_license
tprestegard/ExData_Plotting1
R
false
false
1,057
r
plot1 <- function() { ## Load data corresponding to Feb. 1-2, 2007. Row ranges were ## determined by manually looking at the data. col_class = c("character","character","numeric","numeric","numeric", "numeric","numeric","numeric","numeric") data <- read.table("../household_...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mediastore_operations.R \name{mediastore_describe_container} \alias{mediastore_describe_container} \title{Retrieves the properties of the requested container} \usage{ mediastore_describe_container(ContainerName) } \arguments{ \item{ContainerN...
/cran/paws.media.services/man/mediastore_describe_container.Rd
permissive
johnnytommy/paws
R
false
true
987
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mediastore_operations.R \name{mediastore_describe_container} \alias{mediastore_describe_container} \title{Retrieves the properties of the requested container} \usage{ mediastore_describe_container(ContainerName) } \arguments{ \item{ContainerN...
# This file is generated by make.paws. Please do not edit here. #' @importFrom paws.common get_config new_operation new_request send_request #' @include lexmodelbuildingservice_service.R NULL #' Creates a new version of the bot based on the $LATEST version #' #' Creates a new version of the bot based on the `$LATEST` ...
/paws/R/lexmodelbuildingservice_operations.R
permissive
ryanb8/paws
R
false
false
99,372
r
# This file is generated by make.paws. Please do not edit here. #' @importFrom paws.common get_config new_operation new_request send_request #' @include lexmodelbuildingservice_service.R NULL #' Creates a new version of the bot based on the $LATEST version #' #' Creates a new version of the bot based on the `$LATEST` ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/event_list.R \name{event_list} \alias{event_list} \alias{as_event_list} \alias{as_event_list.list} \alias{as_event_list.LogEvent} \alias{as_event_list.data.frame} \alias{as.data.table.event_list} \alias{as.data.frame.event_list} \title{A List...
/man/event_list.Rd
permissive
s-fleck/lgr
R
false
true
2,787
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/event_list.R \name{event_list} \alias{event_list} \alias{as_event_list} \alias{as_event_list.list} \alias{as_event_list.LogEvent} \alias{as_event_list.data.frame} \alias{as.data.table.event_list} \alias{as.data.frame.event_list} \title{A List...
parse_arg <- function(x){ #special for json obj if(inherits(x, "AsIs")){ class(x) <- utils::tail(class(x), -1); return(x); } #cast (e.g. for NULL) x <- as.character(x); #empty vector causes issues if(!length(x)){ x <- " "; } #some special cases for json compatibility switch(x, "t...
/R/parse_arg.R
permissive
opencpu/opencpu
R
false
false
1,699
r
parse_arg <- function(x){ #special for json obj if(inherits(x, "AsIs")){ class(x) <- utils::tail(class(x), -1); return(x); } #cast (e.g. for NULL) x <- as.character(x); #empty vector causes issues if(!length(x)){ x <- " "; } #some special cases for json compatibility switch(x, "t...
# Tidying the data from databases # Natalie Cooper # Dec 2018 #--------------------------------- # Load libraries library(tidyverse) library(lubridate) library(purrr) library(taxize) # Short function to get decades floor_decade <- function(x){ if(!is.na(x)){ x - x %% 10 }else{NA_character_} } #------------------...
/data-wrangling/03-revision-extract-genus-level-data.R
permissive
nhcooper123/sex-bias-museums
R
false
false
5,298
r
# Tidying the data from databases # Natalie Cooper # Dec 2018 #--------------------------------- # Load libraries library(tidyverse) library(lubridate) library(purrr) library(taxize) # Short function to get decades floor_decade <- function(x){ if(!is.na(x)){ x - x %% 10 }else{NA_character_} } #------------------...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/qtn_partially_pleiotropic.R \name{qtn_partially_pleiotropic} \alias{qtn_partially_pleiotropic} \title{Select SNPs to be assigned as QTNs} \usage{ qtn_partially_pleiotropic( genotypes = NULL, seed = NULL, pleio_a = NULL, pleio_d = NULL...
/man/QTN_partially_pleiotropic.Rd
permissive
samuelbfernandes/simplePHENOTYPES
R
false
true
1,553
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/qtn_partially_pleiotropic.R \name{qtn_partially_pleiotropic} \alias{qtn_partially_pleiotropic} \title{Select SNPs to be assigned as QTNs} \usage{ qtn_partially_pleiotropic( genotypes = NULL, seed = NULL, pleio_a = NULL, pleio_d = NULL...
library(shiny) library(dplyr) library(shinybusy) library(shinythemes) shinyUI(fluidPage(theme = shinytheme("flatly"), titlePanel( h1("Madden Injury Simulator", align = "center") ), sidebarLayout( sidebarPanel(width...
/Old App/ui.R
no_license
lqual/Madden_Injury_Simulator
R
false
false
2,616
r
library(shiny) library(dplyr) library(shinybusy) library(shinythemes) shinyUI(fluidPage(theme = shinytheme("flatly"), titlePanel( h1("Madden Injury Simulator", align = "center") ), sidebarLayout( sidebarPanel(width...
#' @import officer #' @title Define flextable displayed values #' @description Modify flextable displayed values by specifying a #' string expression. Function is handling complex formatting as well as #' image insertion. #' @param x a flextable object #' @param i rows selection #' @param col_key column to modify, a si...
/R/display.R
no_license
maislind/flextable
R
false
false
2,724
r
#' @import officer #' @title Define flextable displayed values #' @description Modify flextable displayed values by specifying a #' string expression. Function is handling complex formatting as well as #' image insertion. #' @param x a flextable object #' @param i rows selection #' @param col_key column to modify, a si...
library(skater) library(testthat) test_that("Degree tibble", { expect_equal(3:9 %>% purrr::map(dibble) %>% purrr::map_int(nrow), (3:9)+2) expect_error(dibble(12)) expect_warning(dibble(10)) expect_error(dibble(0)) expect_warning(dibble(2)) }) test_that("Degree inference from kinship coefficient", { expect...
/tests/testthat/test-skater.R
permissive
signaturescience/skater
R
false
false
954
r
library(skater) library(testthat) test_that("Degree tibble", { expect_equal(3:9 %>% purrr::map(dibble) %>% purrr::map_int(nrow), (3:9)+2) expect_error(dibble(12)) expect_warning(dibble(10)) expect_error(dibble(0)) expect_warning(dibble(2)) }) test_that("Degree inference from kinship coefficient", { expect...
### adding historical timeseries to the dashboard ### # Progress: deploy # Dependencies library(reshape2) # ScraperWiki helper function onSw <- function(p = NULL, d = TRUE, l = 'tool/ckan/') { if(d) return(paste0(l,p)) else return(p) } # config PATH = onSw('data/temp.csv') db_table_name = 'ckan_dataset_data' # ...
/ckan/code/dataset_data_historical.R
no_license
luiscape/hdx_management_dashboard
R
false
false
1,638
r
### adding historical timeseries to the dashboard ### # Progress: deploy # Dependencies library(reshape2) # ScraperWiki helper function onSw <- function(p = NULL, d = TRUE, l = 'tool/ckan/') { if(d) return(paste0(l,p)) else return(p) } # config PATH = onSw('data/temp.csv') db_table_name = 'ckan_dataset_data' # ...
library(MASS) library(recipes) library(rsample) library(car) library(DataExplorer) library(polycor) library(tidyverse) library(ROCR) library(caret) library(glmnet) data_raw = HR_Churn glimpse(data_raw) plot_missing(data_raw) plot_density(data_raw) set.seed(993) train_test_split = initial_split(data...
/HW 6 - Final - group.R
no_license
hamzaktk18/R-classwork
R
false
false
2,847
r
library(MASS) library(recipes) library(rsample) library(car) library(DataExplorer) library(polycor) library(tidyverse) library(ROCR) library(caret) library(glmnet) data_raw = HR_Churn glimpse(data_raw) plot_missing(data_raw) plot_density(data_raw) set.seed(993) train_test_split = initial_split(data...
# Please build your own test file from test-Template.R, and place it in tests folder # please specify the package you need to run the sim function in the test files. # to test all the test files in the tests folder: test_dir("/Users/kaitlynschyrmann/Desktop/SpaDES GM Module 2018/trapsRepo/modules/loadTreeCover/tests/...
/modules/loadLcc2015/tests/unitTests.R
no_license
ianmseddy/GMRiskMapSpaDES
R
false
false
535
r
# Please build your own test file from test-Template.R, and place it in tests folder # please specify the package you need to run the sim function in the test files. # to test all the test files in the tests folder: test_dir("/Users/kaitlynschyrmann/Desktop/SpaDES GM Module 2018/trapsRepo/modules/loadTreeCover/tests/...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/temp_converter.R \name{F_to_K} \alias{F_to_K} \title{Converts temperature from one unit to another} \usage{ F_to_K(temp) } \arguments{ \item{temp}{Temperature in Fahrenheit} } \value{ R object or list to be converted to Kelvin } \description{...
/man/F_to_K.Rd
no_license
SherryLi1234/awapi
R
false
true
369
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/temp_converter.R \name{F_to_K} \alias{F_to_K} \title{Converts temperature from one unit to another} \usage{ F_to_K(temp) } \arguments{ \item{temp}{Temperature in Fahrenheit} } \value{ R object or list to be converted to Kelvin } \description{...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/table-utils.R \name{oneOfEach} \alias{oneOfEach} \title{Sampler of first observation of a particular table column.} \usage{ oneOfEach(...) } \arguments{ \item{...:}{Arguments to \code{nOfEach}.} } \value{ Data table with first occurrence of e...
/man/oneOfEach.Rd
no_license
vreuter/SwissR
R
false
true
552
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/table-utils.R \name{oneOfEach} \alias{oneOfEach} \title{Sampler of first observation of a particular table column.} \usage{ oneOfEach(...) } \arguments{ \item{...:}{Arguments to \code{nOfEach}.} } \value{ Data table with first occurrence of e...
# Os dados de mortalidade foram obtidos através do Tabnet do DATASUS. # A base de dados é o Sistema de Informacões de Mortalidade (SIM). # O link abaixo leva direto para os dados de São Paulo # http://tabnet.datasus.gov.br/cgi/deftohtm.exe?sim/cnv/obt10SP.def # Escolhi na linha: 'Causa CID-BR-10' # Coluna: '...
/scripts/preprocess_mortalidade.R
no_license
mribeirodantas/covid19gif
R
false
false
3,129
r
# Os dados de mortalidade foram obtidos através do Tabnet do DATASUS. # A base de dados é o Sistema de Informacões de Mortalidade (SIM). # O link abaixo leva direto para os dados de São Paulo # http://tabnet.datasus.gov.br/cgi/deftohtm.exe?sim/cnv/obt10SP.def # Escolhi na linha: 'Causa CID-BR-10' # Coluna: '...
## ## You should create one R script called run_analysis.R that does the following: ## 1) Merges the training and the test sets to create one data set. ## 2) Extracts only the measurements on the mean and standard deviation for each measurement. ## 3) Uses descriptive activity names to name the activities in the data ...
/run_Analysis.R
no_license
alanfarkas/GCD-CourseProject
R
false
false
2,152
r
## ## You should create one R script called run_analysis.R that does the following: ## 1) Merges the training and the test sets to create one data set. ## 2) Extracts only the measurements on the mean and standard deviation for each measurement. ## 3) Uses descriptive activity names to name the activities in the data ...
test_that("display and print method works - markdown", { skip_on_cran() skip_if(getRversion() < "4.0.0") skip_if_not_or_load_if_installed("gt") expect_snapshot(print(correlation(iris))) expect_snapshot(display(correlation(iris))) }) # display and print method works - HTML ------------------------...
/tests/testthat/test-display_print_dataframe.R
no_license
cran/correlation
R
false
false
690
r
test_that("display and print method works - markdown", { skip_on_cran() skip_if(getRversion() < "4.0.0") skip_if_not_or_load_if_installed("gt") expect_snapshot(print(correlation(iris))) expect_snapshot(display(correlation(iris))) }) # display and print method works - HTML ------------------------...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/geom_timeline.R \name{new_theme} \alias{new_theme} \title{new_theme} \usage{ new_theme(...) } \arguments{ \item{...}{Extra Params.} } \value{ This function adds the lineGrobs and pointGrob into the current graphics device. } \description{ Cre...
/man/new_theme.Rd
no_license
marcelamu95/earthquakeGeoms
R
false
true
987
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/geom_timeline.R \name{new_theme} \alias{new_theme} \title{new_theme} \usage{ new_theme(...) } \arguments{ \item{...}{Extra Params.} } \value{ This function adds the lineGrobs and pointGrob into the current graphics device. } \description{ Cre...
#!/usr/bin/env Rscript source("../.Rprofile", chdir = TRUE) suppressPackageStartupMessages({ library(jsonlite) library(ggplot2) library(ggsci) library(reshape2) library(dplyr) library(extrafont) }) source("../Utilities/utils.R") # Read data df <- read.csv(snakemake@input[["data"]], check.names...
/Evaluation/dimension_reduction_plot.R
permissive
JiahuaQu/Cell_BLAST
R
false
false
4,735
r
#!/usr/bin/env Rscript source("../.Rprofile", chdir = TRUE) suppressPackageStartupMessages({ library(jsonlite) library(ggplot2) library(ggsci) library(reshape2) library(dplyr) library(extrafont) }) source("../Utilities/utils.R") # Read data df <- read.csv(snakemake@input[["data"]], check.names...
library(scales) library(sqldf) library(rstudioapi) library(RODBC) library(dplyr) library(reshape2) library(ggplot2) library(data.table) library(stringr) #library(wesanderson) #library(RColorBrewer) install.packages("reshape2") library(sqldf) setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) #read in files...
/Unfiled/SR14Forecast/SubRegional/old scripts/HH_Househol_family_type (HHT).R
no_license
SANDAG/QA
R
false
false
7,758
r
library(scales) library(sqldf) library(rstudioapi) library(RODBC) library(dplyr) library(reshape2) library(ggplot2) library(data.table) library(stringr) #library(wesanderson) #library(RColorBrewer) install.packages("reshape2") library(sqldf) setwd(dirname(rstudioapi::getActiveDocumentContext()$path)) #read in files...
#' Compute the Average Variance (AVariance) of an estimator #' #' Computes the Average Variance (AVariance) of an estimator #' in a Monte Carlo simulations study. #' @param modelFit A matrix of fitted probabilities of dimensions (number of observations x #' number of simulations). #' @return A numeric scalar value. #' ...
/PredictingBlackSwans/R/AVar_fun.R
permissive
PabloRMira/PredictingBlackSwans
R
false
false
641
r
#' Compute the Average Variance (AVariance) of an estimator #' #' Computes the Average Variance (AVariance) of an estimator #' in a Monte Carlo simulations study. #' @param modelFit A matrix of fitted probabilities of dimensions (number of observations x #' number of simulations). #' @return A numeric scalar value. #' ...
args = commandArgs(trailingOnly = T) #i represent ethnic group #j represent chromosome #l represent the causal SNPs proportion #m represent the training sample size #i_rep represent simulation replication #i1 represent the genetic architecture i = as.numeric(args[[1]]) l = as.numeric(args[[2]]) # for(i in 2:3){ # f...
/code/AOU/PRSCSx/7_compute_prs_r2_all.R
no_license
andrewhaoyu/multi_ethnic
R
false
false
5,661
r
args = commandArgs(trailingOnly = T) #i represent ethnic group #j represent chromosome #l represent the causal SNPs proportion #m represent the training sample size #i_rep represent simulation replication #i1 represent the genetic architecture i = as.numeric(args[[1]]) l = as.numeric(args[[2]]) # for(i in 2:3){ # f...
# Plain R Script (can't do this in a notebook that # loops through a designated region classification) # [state, county, country, watershed] # and extracts data from NCDC. Saves Data as # CSV and netCDF. library("rnoaa") library("isdparser") library("lubridate") library("ncdf4") library("dplyr") # ...
/rnoaa_GHCN_csv_netcdf_loop.R
no_license
wjcapehart/NCDC_rnoaa_ISD
R
false
false
58,042
r
# Plain R Script (can't do this in a notebook that # loops through a designated region classification) # [state, county, country, watershed] # and extracts data from NCDC. Saves Data as # CSV and netCDF. library("rnoaa") library("isdparser") library("lubridate") library("ncdf4") library("dplyr") # ...
/VectorManipulation/Vdecode/Vdecode.r
no_license
selectedacre/Max_Objects
R
false
false
505
r
# Libraries Used library(dplyr) # Read supporting Metadata if(!file.exists("./data")) {dir.create("./data")} fileUrl <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip" download.file(fileUrl, destfile = "./data/Dataset.zip", method = "curl") unzip(zipfile = "./data/Datase...
/run_analysis.R
no_license
Ifiri800/Getting_and_Cleaning_Data
R
false
false
2,435
r
# Libraries Used library(dplyr) # Read supporting Metadata if(!file.exists("./data")) {dir.create("./data")} fileUrl <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip" download.file(fileUrl, destfile = "./data/Dataset.zip", method = "curl") unzip(zipfile = "./data/Datase...
plot3 <- function() { raw.data<-read.table("./household_power_consumption.txt",header=TRUE,sep=";",na.strings = c("?")) raw.data$Date<-strptime(raw.data$Date,format="%d/%m/%Y") data<-raw.data[raw.data$Date == "2007-02-01" | raw.data$Date == "2007-02-02",] data<-data[!is...
/plot3.R
no_license
ZhannaYurchuk/ExData_Plotting1
R
false
false
893
r
plot3 <- function() { raw.data<-read.table("./household_power_consumption.txt",header=TRUE,sep=";",na.strings = c("?")) raw.data$Date<-strptime(raw.data$Date,format="%d/%m/%Y") data<-raw.data[raw.data$Date == "2007-02-01" | raw.data$Date == "2007-02-02",] data<-data[!is...
library(odds.converter) ### Name: odds.prob2dec ### Title: Convert Probabilities to Decimal odds ### Aliases: odds.prob2dec ### ** Examples odds.prob2dec(c(0.5,0.6))
/data/genthat_extracted_code/odds.converter/examples/odds.prob2dec.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
173
r
library(odds.converter) ### Name: odds.prob2dec ### Title: Convert Probabilities to Decimal odds ### Aliases: odds.prob2dec ### ** Examples odds.prob2dec(c(0.5,0.6))
# hw4_oop4 #' # In this exercise, we will create a class `shakeshack_order`. #' # 1. Create a constructor `new_shakeshack_order(names, prices)` that: # - takes in a vector of `names` # - a vector of `price` attribute whose type is double. # - instanciates an object of class `shakeshack_order` using `structu...
/Lecture 4/hw4_oop5.R
no_license
Zijie-Xia/GR5206-Introduction-to-Data-Science
R
false
false
3,480
r
# hw4_oop4 #' # In this exercise, we will create a class `shakeshack_order`. #' # 1. Create a constructor `new_shakeshack_order(names, prices)` that: # - takes in a vector of `names` # - a vector of `price` attribute whose type is double. # - instanciates an object of class `shakeshack_order` using `structu...
\name{pnmtrem} \alias{pnmtrem} \alias{pnmtrem} \docType{package} \title{ Probit-Normal Marginalized Transition Random Effects Models } \description{ Fits Probit-Normal Marginalized Transition Random Effects Models which is proposed for modeling multivariate longitudinal binary data by Asar, O., Ilk, O., Sez...
/man/pnmtrem.Rd
no_license
cran/pnmtrem
R
false
false
595
rd
\name{pnmtrem} \alias{pnmtrem} \alias{pnmtrem} \docType{package} \title{ Probit-Normal Marginalized Transition Random Effects Models } \description{ Fits Probit-Normal Marginalized Transition Random Effects Models which is proposed for modeling multivariate longitudinal binary data by Asar, O., Ilk, O., Sez...
#' Remove null elements from a list #' @param x Input list #' @export #' @keywords internal suncompact <- function(x){ Filter(Negate(is.null), x) }
/R/zzz.R
permissive
seankross/rsunlight
R
false
false
151
r
#' Remove null elements from a list #' @param x Input list #' @export #' @keywords internal suncompact <- function(x){ Filter(Negate(is.null), x) }
# Data simulation for genome dating ## Tree topology ### use library(phangorn) trees_topo <- read.tree('simtree1.tre') for(i in 1:length(trees_topo)){ trees_topo[[i]] <- chronopl(trees_topo[[i]], lambda = 5, age.min = 100) print(max(branching.times(trees_topo[[i]]))) } write.tree(trees_topo, file = 'sim_ch...
/gdata_1/generate_data.R
no_license
sebastianduchene/genome_dating
R
false
false
7,828
r
# Data simulation for genome dating ## Tree topology ### use library(phangorn) trees_topo <- read.tree('simtree1.tre') for(i in 1:length(trees_topo)){ trees_topo[[i]] <- chronopl(trees_topo[[i]], lambda = 5, age.min = 100) print(max(branching.times(trees_topo[[i]]))) } write.tree(trees_topo, file = 'sim_ch...
getEstimatorsVector <- function (g,simv,Y,C,alpha) { y2d<-list() neighborsInGraph(g,simv)->ng ent<-0 probv<-list() t(apply(ng,1,function(x) (x*Y)))->ngvy t(apply(ng,1,function(x) (x*C)))->ngvc for (i in 1:nrow(ngvc)) { ngvc[i,]->line line[line > 0]->line ent[i]<-entropy2d(line) probv[[...
/KiNN/R/getEstimatorsVector.R
no_license
jossiekat/KiNN
R
false
false
1,239
r
getEstimatorsVector <- function (g,simv,Y,C,alpha) { y2d<-list() neighborsInGraph(g,simv)->ng ent<-0 probv<-list() t(apply(ng,1,function(x) (x*Y)))->ngvy t(apply(ng,1,function(x) (x*C)))->ngvc for (i in 1:nrow(ngvc)) { ngvc[i,]->line line[line > 0]->line ent[i]<-entropy2d(line) probv[[...
####################################################### # DOWNLOADS ################################################ # Download GDP long series download.gdp <- function() { # urls url1 <- "https://sidra.ibge.gov.br/geratabela?format=us.csv&name=tabela1846.csv&terr=N&rank=-&query=t/1846/n1/all/v/all/p/all/c11255/907...
/funs/download.R
no_license
pfnaibert/macro-report
R
false
false
14,284
r
####################################################### # DOWNLOADS ################################################ # Download GDP long series download.gdp <- function() { # urls url1 <- "https://sidra.ibge.gov.br/geratabela?format=us.csv&name=tabela1846.csv&terr=N&rank=-&query=t/1846/n1/all/v/all/p/all/c11255/907...
context("ptOwen") test_that("ptOwen = pt", { ncp <- 1 expect_equal(ptOwen(2, nu=3, delta=ncp), pt(2, df=3, ncp=ncp), tolerance=1e-13) expect_equal(ptOwen(2, nu=4, delta=ncp), pt(2, df=4, ncp=ncp), tolerance=1e-12) expect_equal(ptOwen(2, nu=5, delta=ncp), pt(2, df=5, ncp=ncp), tolerance=1e-12) ncp <- 10 exp...
/issuestests/OwenQ/tests/testthat/test-ptOwen.R
no_license
akhikolla/RcppDeepStateTest
R
false
false
1,008
r
context("ptOwen") test_that("ptOwen = pt", { ncp <- 1 expect_equal(ptOwen(2, nu=3, delta=ncp), pt(2, df=3, ncp=ncp), tolerance=1e-13) expect_equal(ptOwen(2, nu=4, delta=ncp), pt(2, df=4, ncp=ncp), tolerance=1e-12) expect_equal(ptOwen(2, nu=5, delta=ncp), pt(2, df=5, ncp=ncp), tolerance=1e-12) ncp <- 10 exp...
# context("rivr") # test_that("Streaming", { # skip_if_no_rivr() # ## TODO: need rivr-style json streams or something here? # writeLines(jsonlite::toJSON(iris, collapse=FALSE), # tmp <- tempfile()) # ## Start by building a file iterator: # it_f <- rivr::file_iterator(tmp) # it_j <- jq_iterat...
/RLib/jqr/ignore/test-rivr.R
permissive
robkemp/RPackageUpdates
R
false
false
633
r
# context("rivr") # test_that("Streaming", { # skip_if_no_rivr() # ## TODO: need rivr-style json streams or something here? # writeLines(jsonlite::toJSON(iris, collapse=FALSE), # tmp <- tempfile()) # ## Start by building a file iterator: # it_f <- rivr::file_iterator(tmp) # it_j <- jq_iterat...
testlist <- list(A = structure(c(1.38997190089718e-309, 3.81575932257168e-236, 3.81571422914747e-236), .Dim = c(1L, 3L)), B = structure(0, .Dim = c(1L, 1L))) result <- do.call(multivariance:::match_rows,testlist) str(result)
/multivariance/inst/testfiles/match_rows/AFL_match_rows/match_rows_valgrind_files/1613127267-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
226
r
testlist <- list(A = structure(c(1.38997190089718e-309, 3.81575932257168e-236, 3.81571422914747e-236), .Dim = c(1L, 3L)), B = structure(0, .Dim = c(1L, 1L))) result <- do.call(multivariance:::match_rows,testlist) str(result)
#21/04/2021 #R_code_classification.r #il processo di classificazione è un processo che accorpa i pixel con valori simili e una volta accoprti questi rappresentano una "classe" setwd("C:/lab/") # Windows #salviamo l'immagine "Solar_Orbiter_s_first_views_of_the_Sun_pillars" nella cartella lab #l'immagine rappresenta ...
/R_code_classification.r
no_license
Gp9610/telerilevamento_2021
R
false
false
4,681
r
#21/04/2021 #R_code_classification.r #il processo di classificazione è un processo che accorpa i pixel con valori simili e una volta accoprti questi rappresentano una "classe" setwd("C:/lab/") # Windows #salviamo l'immagine "Solar_Orbiter_s_first_views_of_the_Sun_pillars" nella cartella lab #l'immagine rappresenta ...
test_GetPSI_FromTranRef <- function() { obs <- tryCatch(GetPSI_FromTranRef(Samples="", PathsxTranscript=NULL, Bootstrap = FALSE, Filter = TRUE, Qn = 0.25), error=condi...
/inst/unitTests/test_GetPSI_FromTranRef.R
no_license
jpromeror/EventPointer
R
false
false
1,373
r
test_GetPSI_FromTranRef <- function() { obs <- tryCatch(GetPSI_FromTranRef(Samples="", PathsxTranscript=NULL, Bootstrap = FALSE, Filter = TRUE, Qn = 0.25), error=condi...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/qfars.R \name{make_filename} \alias{make_filename} \title{Build the filename for a specific year} \usage{ make_filename(year) } \arguments{ \item{year}{The year, expressed in four digit, for which the filename string needs to be returned} } \...
/man/make_filename.Rd
no_license
ricrossi/qfars
R
false
true
636
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/qfars.R \name{make_filename} \alias{make_filename} \title{Build the filename for a specific year} \usage{ make_filename(year) } \arguments{ \item{year}{The year, expressed in four digit, for which the filename string needs to be returned} } \...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/leaveoneout.R \name{mr_leaveoneout} \alias{mr_leaveoneout} \title{Leave one out sensitivity analysis} \usage{ mr_leaveoneout(dat, parameters = default_parameters(), method = mr_ivw) } \arguments{ \item{dat}{Output from \code{harmonise_exposur...
/man/mr_leaveoneout.Rd
permissive
jonellevillar/TwoSampleMR
R
false
true
465
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/leaveoneout.R \name{mr_leaveoneout} \alias{mr_leaveoneout} \title{Leave one out sensitivity analysis} \usage{ mr_leaveoneout(dat, parameters = default_parameters(), method = mr_ivw) } \arguments{ \item{dat}{Output from \code{harmonise_exposur...
setwd('F:/Miaozhi/Academic/Data_Science/Bootcamp/Project_Capstone/nycdsa-capstone') data = read.csv('./data/cs-training-outlier-f10.csv', header =T) AgeRisk=1:150000 for(i in 1:150000){ if(data$age[i]<29){ AgeRisk[i]= 1-637/850 }else{ if(data$age[i]<39){ AgeRisk[i]=1-654/850 }else{ ...
/feature-eng-combine.R
no_license
MiaozhiYu/Project_Capstone
R
false
false
2,975
r
setwd('F:/Miaozhi/Academic/Data_Science/Bootcamp/Project_Capstone/nycdsa-capstone') data = read.csv('./data/cs-training-outlier-f10.csv', header =T) AgeRisk=1:150000 for(i in 1:150000){ if(data$age[i]<29){ AgeRisk[i]= 1-637/850 }else{ if(data$age[i]<39){ AgeRisk[i]=1-654/850 }else{ ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/qtl_postProcess.R \name{extractQTLsFromList} \alias{extractQTLsFromList} \title{Extract all QTLs at a specific FDR level from a list of min pvalues by condition} \usage{ extractQTLsFromList(min_pvalue_list, fdr_cutoff = 0.1) } \arguments{ \it...
/seqUtils/man/extractQTLsFromList.Rd
permissive
kauralasoo/macrophage-tuQTLs
R
false
true
485
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/qtl_postProcess.R \name{extractQTLsFromList} \alias{extractQTLsFromList} \title{Extract all QTLs at a specific FDR level from a list of min pvalues by condition} \usage{ extractQTLsFromList(min_pvalue_list, fdr_cutoff = 0.1) } \arguments{ \it...
#Robert Dinterman print(paste0("Started 0-IRS_Pop at ", Sys.time())) options(scipen=999) #Turn off scientific notation for write.csv() library(dplyr) library(readr) source("0-Data/0-functions.R") # Create a directory for the data localDir <- "0-Data/IRS" data_source <- paste0(localDir, "/Raw") if (!file.exists(loca...
/0-Data/0-IRS_Pop.R
no_license
yalunsu/test-counties
R
false
false
7,089
r
#Robert Dinterman print(paste0("Started 0-IRS_Pop at ", Sys.time())) options(scipen=999) #Turn off scientific notation for write.csv() library(dplyr) library(readr) source("0-Data/0-functions.R") # Create a directory for the data localDir <- "0-Data/IRS" data_source <- paste0(localDir, "/Raw") if (!file.exists(loca...
buckets <- read.table("data/buckets.tsv", sep = "\t", header = T) priors <- list(0.8, 0.1, 0.1) names(priors) <- c("feedback", "editing", "share") buckets$date <- as.POSIXct(buckets$date, tz="UTC") buckets <- buckets[buckets$date < as.POSIXct("2011-12-01", tz="UTC") & buckets$date > as.POSIXct("201...
/reports/buckets/odds.R
no_license
glciampaglia/MoodBar
R
false
false
941
r
buckets <- read.table("data/buckets.tsv", sep = "\t", header = T) priors <- list(0.8, 0.1, 0.1) names(priors) <- c("feedback", "editing", "share") buckets$date <- as.POSIXct(buckets$date, tz="UTC") buckets <- buckets[buckets$date < as.POSIXct("2011-12-01", tz="UTC") & buckets$date > as.POSIXct("201...
############################################################################## # title : function to generate input data to fragstat and fractal analyses; # purpose : create separated grids by unit of analysis for fragstat and # fractal analyses; # producer : prepared by A. Coca; # l...
/functions/2b_GenUniGrid.R
permissive
Alowis/postloss-Spattern
R
false
false
3,833
r
############################################################################## # title : function to generate input data to fragstat and fractal analyses; # purpose : create separated grids by unit of analysis for fragstat and # fractal analyses; # producer : prepared by A. Coca; # l...
#' 处理问题泛化业务 #' #' @param faq 问题 #' #' @return 返回值 #' @export #' #' @examples #' generator() generator <- function(faq){ #faq <- read_excel(file,skip = skip); # View(faq) #提取标准问题------ ques <- faq$标准问 ques_count <- length(ques); #提取模板------ busi_Obj <- faq$`业务对象(近义词)`; oper_Node <- faq$`操作节点(近义词)`; #提...
/R/utility.R
no_license
takewiki/nsgenpkg
R
false
false
2,651
r
#' 处理问题泛化业务 #' #' @param faq 问题 #' #' @return 返回值 #' @export #' #' @examples #' generator() generator <- function(faq){ #faq <- read_excel(file,skip = skip); # View(faq) #提取标准问题------ ques <- faq$标准问 ques_count <- length(ques); #提取模板------ busi_Obj <- faq$`业务对象(近义词)`; oper_Node <- faq$`操作节点(近义词)`; #提...
library(jsonlite) library(dplyr) library(readr) url104<-"http://ipgod.nchc.org.tw/dataset/b6f36b72-0c4a-4b60-9254-1904e180ddb1/resource/98d5094d-7481-44b5-876a-715a496f922c/download/a17000000j-020066-mah.csv" url107<-"C:/Users/SAMUEL/Desktop/4133da254dbcdba28a2097de48d8d606_csv/job107.csv" job104 <- read_csv(url104) jo...
/DataAnalysis.R
no_license
CGUIM-BigDataAnalysis/108bigdatacguim-hw1-940223
R
false
false
3,622
r
library(jsonlite) library(dplyr) library(readr) url104<-"http://ipgod.nchc.org.tw/dataset/b6f36b72-0c4a-4b60-9254-1904e180ddb1/resource/98d5094d-7481-44b5-876a-715a496f922c/download/a17000000j-020066-mah.csv" url107<-"C:/Users/SAMUEL/Desktop/4133da254dbcdba28a2097de48d8d606_csv/job107.csv" job104 <- read_csv(url104) jo...
original_data <-iris set.seed(104) ####### Set initial parameters portion <-0.2 # percent of missing values to occupy the data. 0.02 = 2 % training_size <-0.7 # percent of data for training data_length <-nrow(original_data) missing_data <-original_data id <-portion*data_length missing_data[1:id,'Petal.Length'] <-NA ...
/LinearRegressionNonRandom.R
no_license
Alex-Nguyen/CS5331R
R
false
false
1,951
r
original_data <-iris set.seed(104) ####### Set initial parameters portion <-0.2 # percent of missing values to occupy the data. 0.02 = 2 % training_size <-0.7 # percent of data for training data_length <-nrow(original_data) missing_data <-original_data id <-portion*data_length missing_data[1:id,'Petal.Length'] <-NA ...
# Intrinio API # # Welcome to the Intrinio API! Through our Financial Data Marketplace, we offer a wide selection of financial data feed APIs sourced by our own proprietary processes as well as from many data vendors. For a complete API request / response reference please view the [Intrinio API documentation](https://d...
/R/ApiResponseSecurityRelativeStrengthIndex.r
no_license
intrinio/r-sdk
R
false
false
6,747
r
# Intrinio API # # Welcome to the Intrinio API! Through our Financial Data Marketplace, we offer a wide selection of financial data feed APIs sourced by our own proprietary processes as well as from many data vendors. For a complete API request / response reference please view the [Intrinio API documentation](https://d...
# # THESE LOOKUP TABLES ARE CREATED IN THE SCRIPT: # GENERATE_LOOKUPS.R minute_lookup <- fread("lookups/minute_lookup.csv") minute_lookup$V1 <- NULL prev_minute_lookup <- copy(minute_lookup) names(minute_lookup) <- c('min_label', 'min_count') names(prev_minute_lookup) <- c...
/AppDownloads/LOAD_LOOKUPS.R
no_license
john-hawkins/Experiments
R
false
false
10,941
r
# # THESE LOOKUP TABLES ARE CREATED IN THE SCRIPT: # GENERATE_LOOKUPS.R minute_lookup <- fread("lookups/minute_lookup.csv") minute_lookup$V1 <- NULL prev_minute_lookup <- copy(minute_lookup) names(minute_lookup) <- c('min_label', 'min_count') names(prev_minute_lookup) <- c...
#install.packages("dlnm") library(dlnm) head(drug,3) #make the matrix of exposure histories Qdrug<-as.matrix(drug[,rep(7:4,each=7)]) colnames(Qdrug)<-paste("lag",0:27,sep="") head(Qdrug) #define a cross-basis function: argvar deines the exposure-response function, and arglag deine the lag-response function #"lin": l...
/DLM.R
no_license
benhhu/DLM
R
false
false
1,119
r
#install.packages("dlnm") library(dlnm) head(drug,3) #make the matrix of exposure histories Qdrug<-as.matrix(drug[,rep(7:4,each=7)]) colnames(Qdrug)<-paste("lag",0:27,sep="") head(Qdrug) #define a cross-basis function: argvar deines the exposure-response function, and arglag deine the lag-response function #"lin": l...
#-----FunMap----- library(mvtnorm) salttable <- read.csv("./path/saltstable.csv",header = T,row.names = 1) cktable <- read.csv("./path/ckstable.csv",header = T,row.names = 1) genotable <- read.csv("./path/genostable.csv",header = T,row.names = 1) get_miu = function(miu_par,t){ miu = miu_par[1]/(1 + miu_par[2]...
/EuphratesGWEISNetwork.R
no_license
LiboJiang/EuphratesGWEISNetwork
R
false
false
20,408
r
#-----FunMap----- library(mvtnorm) salttable <- read.csv("./path/saltstable.csv",header = T,row.names = 1) cktable <- read.csv("./path/ckstable.csv",header = T,row.names = 1) genotable <- read.csv("./path/genostable.csv",header = T,row.names = 1) get_miu = function(miu_par,t){ miu = miu_par[1]/(1 + miu_par[2]...
library(RSAGA) ### Name: rsaga.target ### Title: Define target grid for interpolation ### Aliases: rsaga.target ### Keywords: interface spatial ### ** Examples ## Not run: ##D # IDW interpolation of attribute "z" from the point shapefile ##D # 'points.shp' to a grid with the same extent and resolution ##D # as the...
/data/genthat_extracted_code/RSAGA/examples/rsaga.target.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
528
r
library(RSAGA) ### Name: rsaga.target ### Title: Define target grid for interpolation ### Aliases: rsaga.target ### Keywords: interface spatial ### ** Examples ## Not run: ##D # IDW interpolation of attribute "z" from the point shapefile ##D # 'points.shp' to a grid with the same extent and resolution ##D # as the...
library("rvest") library(dplyr) main.table <- data.frame(Minutes=integer(), FG=integer(), FGA=integer(), FGP=double(), ThreePoint=integer(), ThreePointA=integer(), ThreePointP=double(), FT=integer(), FTA=integer(), FTP=double(), ORB = integer(), DRB=integer(), TRB=int...
/basketball_win_prediction/basketball_scrape.R
no_license
thpossidente/COGS-298-Project
R
false
false
11,514
r
library("rvest") library(dplyr) main.table <- data.frame(Minutes=integer(), FG=integer(), FGA=integer(), FGP=double(), ThreePoint=integer(), ThreePointA=integer(), ThreePointP=double(), FT=integer(), FTA=integer(), FTP=double(), ORB = integer(), DRB=integer(), TRB=int...
\name{pdsoft.cv} \alias{pdsoft.cv} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Tuning parameter selection and computation for the positive definite and sparse covariance matrix estimator } \description{ Computes and selects the tuning parameter for the sparse and positive definite covariance ...
/man/pdsoft.cv.Rd
no_license
cran/PDSCE
R
false
false
4,344
rd
\name{pdsoft.cv} \alias{pdsoft.cv} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Tuning parameter selection and computation for the positive definite and sparse covariance matrix estimator } \description{ Computes and selects the tuning parameter for the sparse and positive definite covariance ...
################################################# ############ gamlss.dist ############# ############ Distribution tests ############# # Zero inflated beta negative binomial: ZIBNB() # ################################################# ## Context testthat::context("ZIBNB 2") ## Seed set.seed(619) ## Fa...
/tests/testthat/test_01_ZIBNB.R
no_license
JENScoding/gamlss.dist
R
false
false
774
r
################################################# ############ gamlss.dist ############# ############ Distribution tests ############# # Zero inflated beta negative binomial: ZIBNB() # ################################################# ## Context testthat::context("ZIBNB 2") ## Seed set.seed(619) ## Fa...
plot4 <- function() { filename <- "household_power_consumption.txt" # Read data d <- read.table(file=filename, header=T, sep=";", na.strings="?", comment.char="", nrows=2100000, colClasses=c("character", "character", "numeric", "numeric", "numeric", ...
/plot4.R
no_license
andrabuca/ExData_Plotting1
R
false
false
1,671
r
plot4 <- function() { filename <- "household_power_consumption.txt" # Read data d <- read.table(file=filename, header=T, sep=";", na.strings="?", comment.char="", nrows=2100000, colClasses=c("character", "character", "numeric", "numeric", "numeric", ...
\name{stimuli} \alias{stimuli} \title{ Stimulus extraction function } \description{ \code{stimuli} is a convenience function to extract the stimulus parameters from an \code{aldmck}, \code{blackbox}, or \code{blackbt} object. } \usage{ stimuli(object) } \arguments{ \item{object}{ an \code{aldmck}, \...
/man/stimuli.Rd
no_license
cran/basicspace
R
false
false
1,324
rd
\name{stimuli} \alias{stimuli} \title{ Stimulus extraction function } \description{ \code{stimuli} is a convenience function to extract the stimulus parameters from an \code{aldmck}, \code{blackbox}, or \code{blackbt} object. } \usage{ stimuli(object) } \arguments{ \item{object}{ an \code{aldmck}, \...
### ========================================================================= ### Some low-level S4 classes and utilities ### ------------------------------------------------------------------------- ### ### Not really a S4-related utility but I don't have a better place to put ### this at the moment. drop_AsIs <- fu...
/R/S4-utils.R
no_license
gong-yuan/S4Vectors
R
false
false
12,915
r
### ========================================================================= ### Some low-level S4 classes and utilities ### ------------------------------------------------------------------------- ### ### Not really a S4-related utility but I don't have a better place to put ### this at the moment. drop_AsIs <- fu...
rm(list = ls()) library(Daniel) library(dplyr) library(nnet) CalcCImultinom <- function(fit) { s <- summary(fit) coef <- s$coefficients ses <- s$standard.errors ci.1 <- coef[1,2] + c(-1, 1)*1.96*ses[1, 2] ci.2 <- coef[2,2] + c(-1, 1)*1.96*ses[2, 2] return(rbind(ci.1,ci.2)) } #key # A, B,C,D,E,F - betaE[2] =...
/Simulations/Scripts/R/Rare/Scenario 14/CMPEn50KrareScen14CA.R
no_license
yadevi/CausalMPE
R
false
false
4,221
r
rm(list = ls()) library(Daniel) library(dplyr) library(nnet) CalcCImultinom <- function(fit) { s <- summary(fit) coef <- s$coefficients ses <- s$standard.errors ci.1 <- coef[1,2] + c(-1, 1)*1.96*ses[1, 2] ci.2 <- coef[2,2] + c(-1, 1)*1.96*ses[2, 2] return(rbind(ci.1,ci.2)) } #key # A, B,C,D,E,F - betaE[2] =...
library(readr) mtp_params_data <- read_tsv('data-raw/plate-params.tsv', col_types = 'iiidddddd') # no longer use these data for computing graphical elements # usethis::use_data(mtp_params_data, internal = TRUE, overwrite = TRUE)
/data-raw/save-plate-params.R
no_license
npjc/mtpview1
R
false
false
229
r
library(readr) mtp_params_data <- read_tsv('data-raw/plate-params.tsv', col_types = 'iiidddddd') # no longer use these data for computing graphical elements # usethis::use_data(mtp_params_data, internal = TRUE, overwrite = TRUE)
##the wording dir is set to default, so need redirect to where raw data located plot1 <- function(){ data <- read.csv("~/myR/data/household_power_consumption.txt",sep=";", stringsAsFactors = FALSE) data2<- tbl_df(data) data3<-data2[data2["Date"] == "1/2/2007" | data2["Date"] == "2/2/2007",] data3<-data3[data3["...
/plot1.R
no_license
TerryDuan/ExData_Plotting1
R
false
false
550
r
##the wording dir is set to default, so need redirect to where raw data located plot1 <- function(){ data <- read.csv("~/myR/data/household_power_consumption.txt",sep=";", stringsAsFactors = FALSE) data2<- tbl_df(data) data3<-data2[data2["Date"] == "1/2/2007" | data2["Date"] == "2/2/2007",] data3<-data3[data3["...
testlist <- list(G = numeric(0), Rn = numeric(0), atmp = c(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, 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, 0, 0, 0, 0, 0), ra = numeric(0), relh = 1.26179021194602e-307, rs = numeric(0), temp = c(8.572862...
/meteor/inst/testfiles/ET0_PenmanMonteith/AFL_ET0_PenmanMonteith/ET0_PenmanMonteith_valgrind_files/1615841244-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
890
r
testlist <- list(G = numeric(0), Rn = numeric(0), atmp = c(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, 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, 0, 0, 0, 0, 0), ra = numeric(0), relh = 1.26179021194602e-307, rs = numeric(0), temp = c(8.572862...
######################## ####### Quiz Two ####### ######################## # import organics data # organics<-read.csv("organics.csv", header=TRUE, na.strings=c(".", "NA", "", "?")) # fix measurement levels organics$ID<-as.factor(organics$ID) organics$DemCluster<-as.factor(organics$DemCluster) organics$Targ...
/quiz2.R
no_license
amykelly36/MAT8480
R
false
false
2,028
r
######################## ####### Quiz Two ####### ######################## # import organics data # organics<-read.csv("organics.csv", header=TRUE, na.strings=c(".", "NA", "", "?")) # fix measurement levels organics$ID<-as.factor(organics$ID) organics$DemCluster<-as.factor(organics$DemCluster) organics$Targ...
library(plotly) library(quantmod) library(dplyr) setwd("C:/Users/Aeint Thet Ngon/Documents/Georgetown University/Data Viz/Takehome") Sys.setenv("plotly_username"="aeint31") Sys.setenv("plotly_api_key"="64YagDOY29TsffYihgol") write.csv(ds, "ds1_plotly.csv") #ds <- read.csv("plotly_rangesliderdata.csv") ds <-...
/plotly_rangeslider.R
no_license
aeintngon/TerrorismViz
R
false
false
1,511
r
library(plotly) library(quantmod) library(dplyr) setwd("C:/Users/Aeint Thet Ngon/Documents/Georgetown University/Data Viz/Takehome") Sys.setenv("plotly_username"="aeint31") Sys.setenv("plotly_api_key"="64YagDOY29TsffYihgol") write.csv(ds, "ds1_plotly.csv") #ds <- read.csv("plotly_rangesliderdata.csv") ds <-...
## Auto formatting page numbers ---- #' Return RTF encoding for current page number #' #' @param properties Properties for displaying page number information #' #' @return String of RTF encoding that will display the current page #' @noRd page_num <- function(properties='') { # TODO: Add style and font support pag...
/R/rtf-code-generators.R
permissive
elisa-young/pharmaRTF
R
false
false
8,965
r
## Auto formatting page numbers ---- #' Return RTF encoding for current page number #' #' @param properties Properties for displaying page number information #' #' @return String of RTF encoding that will display the current page #' @noRd page_num <- function(properties='') { # TODO: Add style and font support pag...
testlist <- list(ends = c(-1125300777L, 765849512L, -1760774663L, 791623263L, 1358782356L, -128659642L, -14914341L, 1092032927L, 1837701012L, 1632068659L), pts = c(1758370433L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,...
/IntervalSurgeon/inst/testfiles/rcpp_pile/AFL_rcpp_pile/rcpp_pile_valgrind_files/1609860007-test.R
no_license
akhikolla/updated-only-Issues
R
false
false
729
r
testlist <- list(ends = c(-1125300777L, 765849512L, -1760774663L, 791623263L, 1358782356L, -128659642L, -14914341L, 1092032927L, 1837701012L, 1632068659L), pts = c(1758370433L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,...
# Apr/12/2016 anova.mpt() now works with stats::print.anova() # # Mar/18/2016 better fix using eval(..., as.list(spec$par)); this renders more # expressions fittable via EM including base functions # # Aug/27/2015 BUG FIX: mpt(..., method = "EM") could fail when a symbol in the # model was also ...
/mpt/R/mpt.R
no_license
ingted/R-Examples
R
false
false
18,784
r
# Apr/12/2016 anova.mpt() now works with stats::print.anova() # # Mar/18/2016 better fix using eval(..., as.list(spec$par)); this renders more # expressions fittable via EM including base functions # # Aug/27/2015 BUG FIX: mpt(..., method = "EM") could fail when a symbol in the # model was also ...
library(tidyverse) coffee_ratings <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-07-07/coffee_ratings.csv')
/coffee/coffee.R
no_license
rhi-batstone/tidy_tuesday
R
false
false
165
r
library(tidyverse) coffee_ratings <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-07-07/coffee_ratings.csv')
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/auxiliary.R \name{samplecovs} \alias{samplecovs} \title{Generate Sample Covariances of 2 groups} \usage{ samplecovs(ncopy, size) } \arguments{ \item{ncopy}{the total number of sample covariances to be generated.} \item{size}{dimension \eqn{p...
/CovTools/man/samplecovs.Rd
no_license
akhikolla/TestedPackages-NoIssues
R
false
true
884
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/auxiliary.R \name{samplecovs} \alias{samplecovs} \title{Generate Sample Covariances of 2 groups} \usage{ samplecovs(ncopy, size) } \arguments{ \item{ncopy}{the total number of sample covariances to be generated.} \item{size}{dimension \eqn{p...
/地图可视化/ggmap包.R
no_license
LC-R-learing/sharing-data-DataScientists
R
false
false
2,335
r
setwd('~/Documentos/academic/agregador_exercicios/') library(rstan) library(tidyverse) library(lubridate) # Actual results for Brazilian elections resultados <- read.csv('Resultados - Presidente.csv', stringsAsFactors = F) # Poll results for 2014 - Presidential elections (2º round) polls <- read.csv('polls_2014_Pre...
/analise_agregador.R
no_license
gijocr/agregador_exercicios
R
false
false
11,542
r
setwd('~/Documentos/academic/agregador_exercicios/') library(rstan) library(tidyverse) library(lubridate) # Actual results for Brazilian elections resultados <- read.csv('Resultados - Presidente.csv', stringsAsFactors = F) # Poll results for 2014 - Presidential elections (2º round) polls <- read.csv('polls_2014_Pre...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ggcorrplot.R \name{ggcorrplot} \alias{ggcorrplot} \alias{cor_pmat} \title{Visualization of a correlation matrix using ggplot2} \usage{ ggcorrplot( corr, method = c("square", "circle"), type = c("full", "lower", "upper"), ggtheme = ggp...
/man/ggcorrplot.Rd
no_license
mdedonno1337/ggcorrplot
R
false
true
5,584
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ggcorrplot.R \name{ggcorrplot} \alias{ggcorrplot} \alias{cor_pmat} \title{Visualization of a correlation matrix using ggplot2} \usage{ ggcorrplot( corr, method = c("square", "circle"), type = c("full", "lower", "upper"), ggtheme = ggp...
"domain" <- function(kasc, pts, type=c("value", "potential"), thresh=0.95) { ## Verifications if (!inherits(kasc, "kasc")) stop("should be an object of class \"kasc\"") if (ncol(pts)!=2) stop("pts should have 2 columns") typ<-"" for (i in 1:length(kasc)) { ...
/R/domain.r
no_license
ClementCalenge/adehabitat
R
false
false
2,211
r
"domain" <- function(kasc, pts, type=c("value", "potential"), thresh=0.95) { ## Verifications if (!inherits(kasc, "kasc")) stop("should be an object of class \"kasc\"") if (ncol(pts)!=2) stop("pts should have 2 columns") typ<-"" for (i in 1:length(kasc)) { ...
library(qqman) library(ggplot2) #qq plot bayes factors with multiple window sizes: manhatplot_fst_lfmm_xtx_bf <- function(inpath_fst,inpath_xtx,inpath_bf,inpref_lfmm,insuf_lfmm,outpref,npops,wins,zs,bfs,fsts, xtx_thresh = NA, bf_thresh = NA, lfmm_thresh = NA, fst_thresh = NA, ...
/Baldwin-Brown_2017_Scripts/main_scripts/downstream_analysis_dir/manhat_plot_all_stats_for_paper_withlabels_withlines_agnostic.R
no_license
jgbaldwinbrown/jgbutils
R
false
false
7,414
r
library(qqman) library(ggplot2) #qq plot bayes factors with multiple window sizes: manhatplot_fst_lfmm_xtx_bf <- function(inpath_fst,inpath_xtx,inpath_bf,inpref_lfmm,insuf_lfmm,outpref,npops,wins,zs,bfs,fsts, xtx_thresh = NA, bf_thresh = NA, lfmm_thresh = NA, fst_thresh = NA, ...
#' Begin constructing a ggghost cache #' #' The data and initial \code{ggpot()} call are stored as a list (call) with #' attribute (data). #' #' @details The data must be passed into the \code{ggplot} call directly. #' Passing this in via a magrittr pipe remains as a future improvement. The #' newly created \co...
/R/ghost.R
no_license
cran/ggghost
R
false
false
14,681
r
#' Begin constructing a ggghost cache #' #' The data and initial \code{ggpot()} call are stored as a list (call) with #' attribute (data). #' #' @details The data must be passed into the \code{ggplot} call directly. #' Passing this in via a magrittr pipe remains as a future improvement. The #' newly created \co...
plot2 <- function () { #import data into table (only the data we need!) pwr_cns <- read.table("household_power_consumption.txt",header=FALSE, sep=";",colClasses="character",na.strings="?", nrow=2880,skip=66637) #due to skips on...
/plot2.R
no_license
timsturges/ExData_Plotting1
R
false
false
1,077
r
plot2 <- function () { #import data into table (only the data we need!) pwr_cns <- read.table("household_power_consumption.txt",header=FALSE, sep=";",colClasses="character",na.strings="?", nrow=2880,skip=66637) #due to skips on...
# Fetch soil moisture data in order to create example data # Hydrologic Response Units = HRUs library(data.table) #library(sbtools) ### Example modeled data from Blodgett's code # Get soil moisture csv # Downloaded from the following link because using sbtools was taking wayyyyyyyyyy # too long. Took over an hour an...
/rscripts/create_soilmoisture_example_data/1_fetch_soilmoisture_data.R
no_license
abriggs-usgs/wbeep-sandboxr
R
false
false
1,535
r
# Fetch soil moisture data in order to create example data # Hydrologic Response Units = HRUs library(data.table) #library(sbtools) ### Example modeled data from Blodgett's code # Get soil moisture csv # Downloaded from the following link because using sbtools was taking wayyyyyyyyyy # too long. Took over an hour an...
library(tidyverse) Gap <- readxl::read_excel("//INHS-Bison/ResearchData/Groups/Kaskaskia_CREP/Analysis/GL_AQ_GAP_Data_2010/VIEW_WATERSHED_TOTAL_minus_ny.xlsx", sheet = 2, col_types = c("text","text","text","text", "text", "numeric","numeric"...
/landuse_geology_metrics/WT_landuse_geology_metric_tibble.R
permissive
lehostert/Fish_Analysis
R
false
false
8,408
r
library(tidyverse) Gap <- readxl::read_excel("//INHS-Bison/ResearchData/Groups/Kaskaskia_CREP/Analysis/GL_AQ_GAP_Data_2010/VIEW_WATERSHED_TOTAL_minus_ny.xlsx", sheet = 2, col_types = c("text","text","text","text", "text", "numeric","numeric"...
# formatting utility functions #' convert factor to numeric as.Num = function(x){ x %>% as.character %>% as.numeric } #' adding quotes to string add_quotes = function(x){ paste0('"', x, '"') } #' making plate well index #' Output: named vector (Well --> location); column-wise location well96_index = function(){...
/utils/format.R
permissive
nick-youngblut/MicrobeMeter
R
false
false
4,755
r
# formatting utility functions #' convert factor to numeric as.Num = function(x){ x %>% as.character %>% as.numeric } #' adding quotes to string add_quotes = function(x){ paste0('"', x, '"') } #' making plate well index #' Output: named vector (Well --> location); column-wise location well96_index = function(){...
library(rTensor) ### Name: matvec-methods ### Title: Tensor Matvec Unfolding ### Aliases: matvec matvec,Tensor-method matvec-methods ### ** Examples tnsr <- rand_tensor(c(2,3,4)) matT1<- matvec(tnsr)
/data/genthat_extracted_code/rTensor/examples/matvec-methods.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
207
r
library(rTensor) ### Name: matvec-methods ### Title: Tensor Matvec Unfolding ### Aliases: matvec matvec,Tensor-method matvec-methods ### ** Examples tnsr <- rand_tensor(c(2,3,4)) matT1<- matvec(tnsr)
/R/wordcloud/wordcloud.R
no_license
teresa-huangt/BNU_Project
R
false
false
2,764
r
\name{sim.table} \alias{sim.table} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Table of simulations for the health economic model } \description{ Using the input in the form of MCMC simulations and after having run the health economic model, produces a summary table of the simulations from t...
/man/sim.table.Rd
no_license
PAREXEL-PAC/BCEA
R
false
false
2,765
rd
\name{sim.table} \alias{sim.table} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Table of simulations for the health economic model } \description{ Using the input in the form of MCMC simulations and after having run the health economic model, produces a summary table of the simulations from t...
# Load Data Data <- read.csv("~/Desktop/Data_PS2a_S15.csv", header=FALSE, sep=",") # Import Data y <- Data[[1]] x1 <- Data[[2]] x2 <- Data[[3]] x3 <- Data[[4]] x <- cbind(x1, x2, x3) # create x matrix # Load packages # library("mvtnorm", lib.loc="~/R/win-library/3.2") # library("mnormt", lib.loc="~/R/win-library/3.2")...
/R/Old/problem1.R
no_license
dillon4287/CodeProjects
R
false
false
4,616
r
# Load Data Data <- read.csv("~/Desktop/Data_PS2a_S15.csv", header=FALSE, sep=",") # Import Data y <- Data[[1]] x1 <- Data[[2]] x2 <- Data[[3]] x3 <- Data[[4]] x <- cbind(x1, x2, x3) # create x matrix # Load packages # library("mvtnorm", lib.loc="~/R/win-library/3.2") # library("mnormt", lib.loc="~/R/win-library/3.2")...