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
#Formacao Cientista de Dados - Fernando Amaral jogadores = c(40000,18000,12000,250000,30000,140000,300000,40000,800000) mean(jogadores) median(jogadores) quartis = quantile(jogadores) quartis[4] sd(jogadores) summary(jogadores)
/Curso/EstatisticaI/Estatistica I - R/3.3.Medidas de Centralidade e Variabildiade no R.R
no_license
jailtonccruz/dataScience
R
false
false
236
r
#Formacao Cientista de Dados - Fernando Amaral jogadores = c(40000,18000,12000,250000,30000,140000,300000,40000,800000) mean(jogadores) median(jogadores) quartis = quantile(jogadores) quartis[4] sd(jogadores) summary(jogadores)
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gen5helper-package.r \docType{package} \name{gen5helper} \alias{gen5helper} \alias{gen5helper-package} \title{gen5helper: A Collection of Functions for Processing Gen5 2.06 Exported Data} \description{ A collection of functions for processing...
/man/gen5helper.Rd
no_license
ylin00/gen5helper
R
false
true
887
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gen5helper-package.r \docType{package} \name{gen5helper} \alias{gen5helper} \alias{gen5helper-package} \title{gen5helper: A Collection of Functions for Processing Gen5 2.06 Exported Data} \description{ A collection of functions for processing...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/filter_mscore_freqobs.R \name{filter_mscore_freqobs} \alias{filter_mscore_freqobs} \title{Filter openSWATH output table according to mscore.} \usage{ filter_mscore_freqobs(data, mscore, percentage = NULL, rm.decoy = TRUE, mscore.col = "m_sc...
/man/filter_mscore_freqobs.Rd
no_license
abelew/SWATH2stats
R
false
true
1,326
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/filter_mscore_freqobs.R \name{filter_mscore_freqobs} \alias{filter_mscore_freqobs} \title{Filter openSWATH output table according to mscore.} \usage{ filter_mscore_freqobs(data, mscore, percentage = NULL, rm.decoy = TRUE, mscore.col = "m_sc...
rm(list=ls()) library(tidyr) library(dplyr) library(sqldf) library(XML) library(httr) download_file<-function(url,dest){ if( !file.exists(dest)){ download.file(url = url,destfile = dest,quiet = TRUE,method = "curl") return(TRUE) }else{ return(TRUE) } } #Q2,Q3 url<-'https://d396qusza40orc.cloudfront.ne...
/ds/jh/getting-and-cleaning-data/week2/quiz2.R
no_license
pkdatascience/coursera_workspace
R
false
false
1,707
r
rm(list=ls()) library(tidyr) library(dplyr) library(sqldf) library(XML) library(httr) download_file<-function(url,dest){ if( !file.exists(dest)){ download.file(url = url,destfile = dest,quiet = TRUE,method = "curl") return(TRUE) }else{ return(TRUE) } } #Q2,Q3 url<-'https://d396qusza40orc.cloudfront.ne...
# ========================================================================= # Copyright © 2019 T-Mobile USA, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org...
/src/rest_controller.R
permissive
MakuSafe/r-tensorflow-api
R
false
false
1,140
r
# ========================================================================= # Copyright © 2019 T-Mobile USA, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/lm_right.R \name{lm_right} \alias{lm_right} \alias{lm_left} \alias{lm_zero} \title{Extend geom_smooth in a single direction} \usage{ lm_right(formula, data, ...) lm_left(formula, data, ...) lm_zero(formula, data, ...) } \arguments{ \item{fo...
/man/lm_right.Rd
no_license
alouiNouha/JLutils
R
false
true
1,749
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/lm_right.R \name{lm_right} \alias{lm_right} \alias{lm_left} \alias{lm_zero} \title{Extend geom_smooth in a single direction} \usage{ lm_right(formula, data, ...) lm_left(formula, data, ...) lm_zero(formula, data, ...) } \arguments{ \item{fo...
\name{do.aromaticity} \alias{do.aromaticity} \alias{do.typing} \alias{do.isotopes} \title{ Perform Aromaticity Detection, atom typing or isotopic configuration } \description{ These methods can be used to perform aromaticity detection, atom typing or isotopic configuration on a molecule object. In general, when molecul...
/rcdk/man/ops.Rd
no_license
schymane/cdkr
R
false
false
1,082
rd
\name{do.aromaticity} \alias{do.aromaticity} \alias{do.typing} \alias{do.isotopes} \title{ Perform Aromaticity Detection, atom typing or isotopic configuration } \description{ These methods can be used to perform aromaticity detection, atom typing or isotopic configuration on a molecule object. In general, when molecul...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/stworz_test.R \name{stworz_test} \alias{stworz_test} \title{Tworzy nowy test (także jako kompilację wskazanych testów)} \usage{ stworz_test( P, ewd, opis, data, rodzajEgzaminu = NA_character_, czescEgzaminu = NA_character_, idTe...
/man/stworz_test.Rd
permissive
zozlak/ZPDzapis
R
false
true
860
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/stworz_test.R \name{stworz_test} \alias{stworz_test} \title{Tworzy nowy test (także jako kompilację wskazanych testów)} \usage{ stworz_test( P, ewd, opis, data, rodzajEgzaminu = NA_character_, czescEgzaminu = NA_character_, idTe...
globalVariables(c(".", ".x", ".y", ".data")) #' snapprep: R functions for data prep and curation from raw SNAP data. #' #' \code{snapprep} is a developer package for the SNAPverse, used for preparing data sets for SNAPverse data packages. #' #' The \code{snapprep} package contains R functions used to support a wide ra...
/snapprep/R/snapprep.R
permissive
ua-snap/snap-r-tools
R
false
false
3,184
r
globalVariables(c(".", ".x", ".y", ".data")) #' snapprep: R functions for data prep and curation from raw SNAP data. #' #' \code{snapprep} is a developer package for the SNAPverse, used for preparing data sets for SNAPverse data packages. #' #' The \code{snapprep} package contains R functions used to support a wide ra...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/sprs.R \name{sprs} \alias{sprs} \title{Simple Random Sampling} \usage{ sprs( df, Yi, plot_area, total_area, m3ha = FALSE, age = NA, .groups = NA, alpha = 0.05, error = 10, dec_places = 4, pop = "inf", tidy = TRUE ) } \...
/man/sprs.Rd
permissive
sollano/forestmangr
R
false
true
3,875
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/sprs.R \name{sprs} \alias{sprs} \title{Simple Random Sampling} \usage{ sprs( df, Yi, plot_area, total_area, m3ha = FALSE, age = NA, .groups = NA, alpha = 0.05, error = 10, dec_places = 4, pop = "inf", tidy = TRUE ) } \...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/SmoothExport.R \docType{package} \name{SmoothExport} \alias{SmoothExport} \alias{SmoothExport-package} \title{SmoothExport: package to convert R dataframes into flextable objects with capability of further export into Word files} \description...
/man/SmoothExport.Rd
no_license
Gargantua404/SmoothExport
R
false
true
443
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/SmoothExport.R \docType{package} \name{SmoothExport} \alias{SmoothExport} \alias{SmoothExport-package} \title{SmoothExport: package to convert R dataframes into flextable objects with capability of further export into Word files} \description...
fahr_to_celsius <- function(fahr) { celsius <- (fahr-32)*5/9 return(celsius) } # This little snippit would be a function that we can call. celsius_to_fahr <- function(cels) { fahr <- (celsius*9/5)+32 return(fahr) }
/fahr_to_celcius.R
permissive
jagilman/arctic-training
R
false
false
231
r
fahr_to_celsius <- function(fahr) { celsius <- (fahr-32)*5/9 return(celsius) } # This little snippit would be a function that we can call. celsius_to_fahr <- function(cels) { fahr <- (celsius*9/5)+32 return(fahr) }
#ZADANIE 1 kwartyl <- function(dane, q) { pozycjaKwartyla = sum(dane$counts) * q nIsk <- dane$counts #liczebnosc skumulowana for(i in 1:length(dane$counts)) { nIsk[i] = sum(dane$counts[1:i]) } znaleziona = 0 pozycja = 1 while (znaleziona == 0) { if (pozycjaKwartyla < n...
/Funkcje1.R
no_license
arturjaneta/MS-PROJEKT
R
false
false
7,931
r
#ZADANIE 1 kwartyl <- function(dane, q) { pozycjaKwartyla = sum(dane$counts) * q nIsk <- dane$counts #liczebnosc skumulowana for(i in 1:length(dane$counts)) { nIsk[i] = sum(dane$counts[1:i]) } znaleziona = 0 pozycja = 1 while (znaleziona == 0) { if (pozycjaKwartyla < n...
# TODO: Add comment # # Author: igor ############################################################################### library("languageR") library("MASS") ver qqnorm(log(ver$Frequency)) ?ratings #task1 dat_xtabs=xtabs(~AnimacyOfRec+RealizationOfRec, data=verbs[verbs$AnimacyOfTheme!="animate",]) chisq...
/chap4.r
no_license
omelhoro/r-nlp-baayen
R
false
false
1,440
r
# TODO: Add comment # # Author: igor ############################################################################### library("languageR") library("MASS") ver qqnorm(log(ver$Frequency)) ?ratings #task1 dat_xtabs=xtabs(~AnimacyOfRec+RealizationOfRec, data=verbs[verbs$AnimacyOfTheme!="animate",]) chisq...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ghostLayer.R \name{ghostLayer} \alias{ghostLayer} \title{Plot a Ghost Layer} \usage{ ghostLayer(x, bg) } \arguments{ \item{x}{an sf object, a simple feature collection or a Spatial*DataFrame.} \item{bg}{background color.} } \description{ Plo...
/man/ghostLayer.Rd
no_license
dieghernan/cartography
R
false
true
853
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ghostLayer.R \name{ghostLayer} \alias{ghostLayer} \title{Plot a Ghost Layer} \usage{ ghostLayer(x, bg) } \arguments{ \item{x}{an sf object, a simple feature collection or a Spatial*DataFrame.} \item{bg}{background color.} } \description{ Plo...
# Load gapped aligned reads from BAM files # Optionally, annotate reads with exon, transcript and gene LoadGa<-function(bam, gr=NA, paired=TRUE, exons=NA, ex2tx=c(), tx2gn=c(), min.mapq=1, strand.match=0, wht=character(0)) { # bam Full path to bam file # gr GRanges object specifies regions ...
/R/LoadGa.R
no_license
shijianasdf/Rnaseq
R
false
false
8,393
r
# Load gapped aligned reads from BAM files # Optionally, annotate reads with exon, transcript and gene LoadGa<-function(bam, gr=NA, paired=TRUE, exons=NA, ex2tx=c(), tx2gn=c(), min.mapq=1, strand.match=0, wht=character(0)) { # bam Full path to bam file # gr GRanges object specifies regions ...
\name{convertToWideFormat} \alias{convertToWideFormat} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Reshaping microsimulation output into wide format } \description{ The function reshapes the output given by \link{micSim} or by \link{micSimParallel} into wide format. In wide format, the...
/man/convertToWideFormat.Rd
no_license
cran/MicSim
R
false
false
1,993
rd
\name{convertToWideFormat} \alias{convertToWideFormat} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Reshaping microsimulation output into wide format } \description{ The function reshapes the output given by \link{micSim} or by \link{micSimParallel} into wide format. In wide format, the...
################################################################################ # Exploratory Data Analysis # April 2015 # Using the data found here #https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_ ##consumption.zip # The function plot1.r does the following. # 1. Extracts Data regarding Globa...
/plot4,.r
no_license
kattri/ExData_Plotting1
R
false
false
2,824
r
################################################################################ # Exploratory Data Analysis # April 2015 # Using the data found here #https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_ ##consumption.zip # The function plot1.r does the following. # 1. Extracts Data regarding Globa...
dataset = read.csv('Social_Network_Ads.csv') dataset = dataset[3:5] library(caTools) set.seed(123) split = sample.split(dataset$Purchased, SplitRatio = 0.75) training_set = subset(dataset, split == TRUE) test_set = subset(dataset, split == FALSE) training_set[-3] = scale(training_set[, 1:2]) test_set[-3] = ...
/Social_Network_Ads.R
no_license
pareekajay2/KNN
R
false
false
591
r
dataset = read.csv('Social_Network_Ads.csv') dataset = dataset[3:5] library(caTools) set.seed(123) split = sample.split(dataset$Purchased, SplitRatio = 0.75) training_set = subset(dataset, split == TRUE) test_set = subset(dataset, split == FALSE) training_set[-3] = scale(training_set[, 1:2]) test_set[-3] = ...
## import packages library(data.table) library(dplyr) library(stringr) ## set WD setwd('/home/shanedenecke/Dropbox/WP2_omics/Nezara_midgut_atlas/DE_expression_tables/') dir.create('./DE_outputs/') filtered.genes=readLines('./raw_omics/filtered_gene_list.txt') ## add proper row names to each file. First is blank by...
/old/Nv_DE_clean.R
no_license
shanedenecke/Nv_midgut_atlas_2020
R
false
false
3,103
r
## import packages library(data.table) library(dplyr) library(stringr) ## set WD setwd('/home/shanedenecke/Dropbox/WP2_omics/Nezara_midgut_atlas/DE_expression_tables/') dir.create('./DE_outputs/') filtered.genes=readLines('./raw_omics/filtered_gene_list.txt') ## add proper row names to each file. First is blank by...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mapCompoundsToReactions.R \name{mapCompoundsToReactions} \alias{mapCompoundsToReactions} \title{Map compound level data to reactions in MetaCyc} \usage{ mapCompoundsToReactions(compoundObj) } \arguments{ \item{compoundObj}{an object of type c...
/man/mapCompoundsToReactions.Rd
permissive
EMSL-Computing/ftmsRanalysis
R
false
true
445
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mapCompoundsToReactions.R \name{mapCompoundsToReactions} \alias{mapCompoundsToReactions} \title{Map compound level data to reactions in MetaCyc} \usage{ mapCompoundsToReactions(compoundObj) } \arguments{ \item{compoundObj}{an object of type c...
# Compare PCA when only including 2 Caroni Populations library(ggplot2) source("~/Exeter/five_aside/five_aside_functions.R") # Make metadata river_meta <- data.frame(pop=c("LT","UT","GH","GL","APHP","APLP","LO","UQ","LMD","UMD"), river=rep(c("Tacarigua","Guanapo","Aripo","Oropouche","Madamas")...
/pop_structure_analysis/R/remove_caroni_pops_pca.R
permissive
bioCKO/guppy_convergence
R
false
false
2,475
r
# Compare PCA when only including 2 Caroni Populations library(ggplot2) source("~/Exeter/five_aside/five_aside_functions.R") # Make metadata river_meta <- data.frame(pop=c("LT","UT","GH","GL","APHP","APLP","LO","UQ","LMD","UMD"), river=rep(c("Tacarigua","Guanapo","Aripo","Oropouche","Madamas")...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/with_config.R \name{with_config} \alias{with_config} \title{Run code using a temporary config file.} \usage{ with_config( config_yml, code, .active_config = c(R_CONFIG_ACTIVE = "default"), .extra_env_vars = NULL ) } \arguments{ \item{...
/man/with_config.Rd
no_license
rstudio/config
R
false
true
1,729
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/with_config.R \name{with_config} \alias{with_config} \title{Run code using a temporary config file.} \usage{ with_config( config_yml, code, .active_config = c(R_CONFIG_ACTIVE = "default"), .extra_env_vars = NULL ) } \arguments{ \item{...
rm(list=ls()) library(rjags) library(beanplot) load.module('wiener') load('dat.RData') #Make a qp-plot for the data qs=array(unlist(tapply(dat$rt,list(dat$correct,dat$cond,dat$pp),quantile,seq(.1,.9,.2))),dim=c(5,2,2,20)) qs.avg = array(apply(qs,1:3,mean),dim=c(5,4)) pCs=tapply(dat$correct,list(dat$cond,dat$pp),mean...
/Specializations/response_time/correct/fit-wien-correct.R
no_license
danieljwilson/CMMC-2018
R
false
false
4,159
r
rm(list=ls()) library(rjags) library(beanplot) load.module('wiener') load('dat.RData') #Make a qp-plot for the data qs=array(unlist(tapply(dat$rt,list(dat$correct,dat$cond,dat$pp),quantile,seq(.1,.9,.2))),dim=c(5,2,2,20)) qs.avg = array(apply(qs,1:3,mean),dim=c(5,4)) pCs=tapply(dat$correct,list(dat$cond,dat$pp),mean...
############ # Begin simulation study rm(list=ls()) require(devtools) require(doParallel) require(Rcpp) require(elasticnet) source('./SPARSE_PCA_wRandomStart.R') source('./findLasso.R') source('./generateData.R') sourceCpp('./sparseSCA.cpp') ###########################################################...
/Simulation_study_4.1/simulationStudyScript.R
permissive
trbKnl/SCaDS
R
false
false
4,655
r
############ # Begin simulation study rm(list=ls()) require(devtools) require(doParallel) require(Rcpp) require(elasticnet) source('./SPARSE_PCA_wRandomStart.R') source('./findLasso.R') source('./generateData.R') sourceCpp('./sparseSCA.cpp') ###########################################################...
source("code/TT_Moscow_data_collection.R") library(pracma) # for wind interpolation library(zoo) library(tidyquant) #Loading weather data #AllData = BLTNdata[[2]] BLTN = AllData %>% filter(Site=="BOLOTNAYA") BLTN = BLTN %>% BEFadd( verboseFlag = "con") BLTN = BLTN %>% left_join(read_delim("data/Bolotnaya_growth.cs...
/code/TT_es_calc.R
no_license
yaroslavtsevam/TT-
R
false
false
19,369
r
source("code/TT_Moscow_data_collection.R") library(pracma) # for wind interpolation library(zoo) library(tidyquant) #Loading weather data #AllData = BLTNdata[[2]] BLTN = AllData %>% filter(Site=="BOLOTNAYA") BLTN = BLTN %>% BEFadd( verboseFlag = "con") BLTN = BLTN %>% left_join(read_delim("data/Bolotnaya_growth.cs...
library(magrittr) medgen_map <- readRDS(file="data-raw/concept_summary_data.rds") %>% dplyr::filter(main_term == T) %>% dplyr::select(cui,cui_name) %>% dplyr::distinct() datestamp <- '20201208' all_tracks <- list() for(ttype in c('bed','tsv')){ all_tracks[[ttype]] <- list() for(b in c('grch37','grch38')){ ...
/src/pathogenic_cancer_codons.R
permissive
sigven/cacao
R
false
false
34,728
r
library(magrittr) medgen_map <- readRDS(file="data-raw/concept_summary_data.rds") %>% dplyr::filter(main_term == T) %>% dplyr::select(cui,cui_name) %>% dplyr::distinct() datestamp <- '20201208' all_tracks <- list() for(ttype in c('bed','tsv')){ all_tracks[[ttype]] <- list() for(b in c('grch37','grch38')){ ...
context("interactionPlot()") # Some data d <- data.frame(Factor_1 = c(rep("a", 10), rep("b", 10)), Factor_2 = rep(c("c", "d"), each = 5), response = c(rnorm(5, mean = 5), rnorm(5, mean = 8), rnorm(5, mean = 7), ...
/pnlStat/tests/testthat/test_interactionPlot.R
no_license
lhsego/sUtils
R
false
false
5,107
r
context("interactionPlot()") # Some data d <- data.frame(Factor_1 = c(rep("a", 10), rep("b", 10)), Factor_2 = rep(c("c", "d"), each = 5), response = c(rnorm(5, mean = 5), rnorm(5, mean = 8), rnorm(5, mean = 7), ...
43289bf3c13d706e553f7a52e851675acf87eaa5 # Las funciones siguientes se usan para crear una matriz y la inversa en memoria caché. ## La primera función crea una matriz especial: makeCacheMatrix <- function(x = matrix()) { inv <- NULL set <- function(y){ x <<- y inv <<-...
/cachematrix.R
no_license
Bexzho/ProgrammingAssignment2
R
false
false
980
r
43289bf3c13d706e553f7a52e851675acf87eaa5 # Las funciones siguientes se usan para crear una matriz y la inversa en memoria caché. ## La primera función crea una matriz especial: makeCacheMatrix <- function(x = matrix()) { inv <- NULL set <- function(y){ x <<- y inv <<-...
library(MixtureInf) ### Name: emtest.binom ### Title: test the order of a mixture of binomials ### Aliases: emtest.binom ### Keywords: htest ### ** Examples #generate a random sample from a 2 component binomial mixture, #test for order = 2 by the EM-test, #plot the histogram of the observations and the fitted proba...
/data/genthat_extracted_code/MixtureInf/examples/emtest.binom.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
464
r
library(MixtureInf) ### Name: emtest.binom ### Title: test the order of a mixture of binomials ### Aliases: emtest.binom ### Keywords: htest ### ** Examples #generate a random sample from a 2 component binomial mixture, #test for order = 2 by the EM-test, #plot the histogram of the observations and the fitted proba...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/package.R \name{shift_down} \alias{shift_down} \title{shift_downstream from plyranges package} \usage{ shift_down(x, shift = 0L) } \value{ granges } \description{ works on genomicranges } \author{ Stuart Lee Michael Lawrence Dianne Cook }
/man/shift_down.Rd
no_license
kevinmhadi/khtools
R
false
true
319
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/package.R \name{shift_down} \alias{shift_down} \title{shift_downstream from plyranges package} \usage{ shift_down(x, shift = 0L) } \value{ granges } \description{ works on genomicranges } \author{ Stuart Lee Michael Lawrence Dianne Cook }
#' Extracts the lat and long for each address from authors_clean #' #' \code{authors_georef} This function takes the final author list from #' refine_authors, and calculates the lat long of the addresses. #' It does this by feeding the addresses into data science toolkit. #' In order to maximize effectiveness and mi...
/R/authors_georef.R
no_license
bbolker/refsplitr
R
false
false
7,237
r
#' Extracts the lat and long for each address from authors_clean #' #' \code{authors_georef} This function takes the final author list from #' refine_authors, and calculates the lat long of the addresses. #' It does this by feeding the addresses into data science toolkit. #' In order to maximize effectiveness and mi...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/corenlp_blocked.R \name{corenlp_blocked} \alias{corenlp_blocked} \title{Runs Stanford CoreNLP on a collection of .txt files and processes them in blocks of a specified size, saving intermediate results to disk. Designed to function on very la...
/man/corenlp_blocked.Rd
no_license
jixing475/SpeedReader
R
false
true
2,382
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/corenlp_blocked.R \name{corenlp_blocked} \alias{corenlp_blocked} \title{Runs Stanford CoreNLP on a collection of .txt files and processes them in blocks of a specified size, saving intermediate results to disk. Designed to function on very la...
context("capture scenarios") df2 <- data.frame( a = rep(c(NA, 1, 2, 3), each = 4), b = rep(c(0L, NA, 1L, 2L), 4), c = c(NA, NA, NA, NA, letters[10:21]), d = rep(c(T, NA, F, T), each = 4), id = 1:16, stringsAsFactors = FALSE ) na_last <- function(x) { n <- length(x) all(is.na(x[(n - 3):n])) } test...
/tests/testthat/test-capture-scenarios.R
no_license
PRL-PRG/genthat
R
false
false
2,477
r
context("capture scenarios") df2 <- data.frame( a = rep(c(NA, 1, 2, 3), each = 4), b = rep(c(0L, NA, 1L, 2L), 4), c = c(NA, NA, NA, NA, letters[10:21]), d = rep(c(T, NA, F, T), each = 4), id = 1:16, stringsAsFactors = FALSE ) na_last <- function(x) { n <- length(x) all(is.na(x[(n - 3):n])) } test...
with(abd3ff4cfac1947f885552f20afd964a5, {ROOT <- 'D:/SEMOSS_v4.0.0_x64/SEMOSS_v4.0.0_x64/semosshome/db/Atadata2__3b3e4a3b-d382-4e98-9950-9b4e8b308c1c/version/1c4fa71c-191c-4da9-8102-b247ffddc5d3';options(digits.secs=NULL);FRAME950866[,(c('DATA_COLLECTION_TIME')) := lapply(.SD, function(x) as.POSIXct(fast_strptime(x, fo...
/1c4fa71c-191c-4da9-8102-b247ffddc5d3/R/Temp/aQxD6o8NCLC6c.R
no_license
ayanmanna8/test
R
false
false
388
r
with(abd3ff4cfac1947f885552f20afd964a5, {ROOT <- 'D:/SEMOSS_v4.0.0_x64/SEMOSS_v4.0.0_x64/semosshome/db/Atadata2__3b3e4a3b-d382-4e98-9950-9b4e8b308c1c/version/1c4fa71c-191c-4da9-8102-b247ffddc5d3';options(digits.secs=NULL);FRAME950866[,(c('DATA_COLLECTION_TIME')) := lapply(.SD, function(x) as.POSIXct(fast_strptime(x, fo...
library(poppr) ### Name: poppr.msn ### Title: Create a minimum spanning network of selected populations using ### a distance matrix. ### Aliases: poppr.msn msn.poppr ### ** Examples # Load the data set and calculate the distance matrix for all individuals. data(Aeut) A.dist <- diss.dist(Aeut) # Graph it. A.msn ...
/data/genthat_extracted_code/poppr/examples/poppr.msn.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
1,457
r
library(poppr) ### Name: poppr.msn ### Title: Create a minimum spanning network of selected populations using ### a distance matrix. ### Aliases: poppr.msn msn.poppr ### ** Examples # Load the data set and calculate the distance matrix for all individuals. data(Aeut) A.dist <- diss.dist(Aeut) # Graph it. A.msn ...
setwd("D:/GitHub/dc/writing-functions") my_fun <- function(arg1, arg2) { body } df <- data.frame( a = rnorm(10), b = rnorm(10), c = rnorm(10), d = rnorm(10) ) # Initialize output vector output <- vector("double", ncol(df)) # Fill in the body of the for loop for (i in seq_along(df)) { output[...
/write-func/3-functional-programming.R
no_license
bionicturtle/dc
R
false
false
2,405
r
setwd("D:/GitHub/dc/writing-functions") my_fun <- function(arg1, arg2) { body } df <- data.frame( a = rnorm(10), b = rnorm(10), c = rnorm(10), d = rnorm(10) ) # Initialize output vector output <- vector("double", ncol(df)) # Fill in the body of the for loop for (i in seq_along(df)) { output[...
##*********************************************************************** ##' S4 class representing a Tensor Sum (TS) covariance kernel. ##' ##' @title S4 class representing a Tensor Sum (TS) covariance kernel ##' @slots d Object of class \code{"integer"} the spatial ##' dimension or number of inputs of the covariance...
/R/covTS.R
no_license
cran/GPlab
R
false
false
19,287
r
##*********************************************************************** ##' S4 class representing a Tensor Sum (TS) covariance kernel. ##' ##' @title S4 class representing a Tensor Sum (TS) covariance kernel ##' @slots d Object of class \code{"integer"} the spatial ##' dimension or number of inputs of the covariance...
library(sf) library(tmap) library(dplyr) library(dbscan) library(igraph) library(ggplot2) setwd("~/Documents/code/spatial-epi/geo") roads <- st_read("data/SI-roads.shp") pop_places <- st_read("data/south-island-populated-places-points.shp") xy <- st_coordinates(pop_places) pop_places.m <- pop_places %>% mutate(x =...
/geo/pop-places-network.R
no_license
DOSull/spatial-epi
R
false
false
1,366
r
library(sf) library(tmap) library(dplyr) library(dbscan) library(igraph) library(ggplot2) setwd("~/Documents/code/spatial-epi/geo") roads <- st_read("data/SI-roads.shp") pop_places <- st_read("data/south-island-populated-places-points.shp") xy <- st_coordinates(pop_places) pop_places.m <- pop_places %>% mutate(x =...
--- title: "Text MINING!!!" author: "Oraz Dinislam" date: '18 мая 2017 г ' output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` > ## 1. THE TIDY TEXT FORMAT!!! Using tidy data principles is a powerful way to make handling data easier and more effective, and this is no less tru...
/Text1.R
no_license
Dikosh/Text-mining
R
false
false
8,032
r
--- title: "Text MINING!!!" author: "Oraz Dinislam" date: '18 мая 2017 г ' output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` > ## 1. THE TIDY TEXT FORMAT!!! Using tidy data principles is a powerful way to make handling data easier and more effective, and this is no less tru...
expect_equal (last_word ("alpha beta omega"), "omega") expect_equal (last_word (" alpha beta omega"), "omega") expect_equal (last_word ("alpha beta omega "), "omega")
/tests/last-word-tests.R
no_license
EduardoDiezBaez/swiftkey-capstone
R
false
false
180
r
expect_equal (last_word ("alpha beta omega"), "omega") expect_equal (last_word (" alpha beta omega"), "omega") expect_equal (last_word ("alpha beta omega "), "omega")
library(testthat) library(SelfControlledCohort) options(dbms = "oracle") test_check("SelfControlledCohort")
/tests/testOnOracle.R
permissive
OHDSI/SelfControlledCohort
R
false
false
108
r
library(testthat) library(SelfControlledCohort) options(dbms = "oracle") test_check("SelfControlledCohort")
# Clear workspace rm(list = ls()) # Setup ################################################################################ # Packages library(sf) library(raster) library(tidyverse) library(fasterize) library(countrycode) # Directories eezdir <- "data/eezs" datadir <- "data/constraints/masks" tempdir <- "data/templ...
/data/constraints/build_mask.R
no_license
cfree14/aquacast
R
false
false
1,507
r
# Clear workspace rm(list = ls()) # Setup ################################################################################ # Packages library(sf) library(raster) library(tidyverse) library(fasterize) library(countrycode) # Directories eezdir <- "data/eezs" datadir <- "data/constraints/masks" tempdir <- "data/templ...
loadoutcomefile <- function(){vdata <- read.csv("~/DataScience/outcome-of-care-measures.csv",colClasses = "character") #load into a data.frame object } #Plot histogram #outcome[,11] <- as.numeric(outcome[,11]) # coerce to numeric #hist(outcome[,11]) #plot a histogram #End Plot Histogram best <- function(state, outcom...
/best.R
no_license
aamirmoh/DataScience
R
false
false
2,028
r
loadoutcomefile <- function(){vdata <- read.csv("~/DataScience/outcome-of-care-measures.csv",colClasses = "character") #load into a data.frame object } #Plot histogram #outcome[,11] <- as.numeric(outcome[,11]) # coerce to numeric #hist(outcome[,11]) #plot a histogram #End Plot Histogram best <- function(state, outcom...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/minSegDistance.R \name{minSegDistance} \alias{minSegDistance} \title{Metric displacement of binary masks} \usage{ minSegDistance(manual, predict, get = "all", binarize = F, label = 1) } \arguments{ \item{manual}{manual segmentation of class a...
/man/minSegDistance.Rd
permissive
mbowren/LESYMAP
R
false
true
946
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/minSegDistance.R \name{minSegDistance} \alias{minSegDistance} \title{Metric displacement of binary masks} \usage{ minSegDistance(manual, predict, get = "all", binarize = F, label = 1) } \arguments{ \item{manual}{manual segmentation of class a...
#--- #title: "Exercises" #author: "Pedro Ojeda, Birgitte Brydsö, Mirko Myllykoski" #date: "Feb., 2021" #output: html_document #--- ## 0. Exercise #Modify the **job.sh** script in this folder by requesting 2 cores for running the #**HelloWorld.R** example. Although this R script uses 1 core (serial code), sometimes #i...
/Hands-on/3.HPC/RHPC.R
no_license
bbrydsoe/R_for_HPC
R
false
false
5,045
r
#--- #title: "Exercises" #author: "Pedro Ojeda, Birgitte Brydsö, Mirko Myllykoski" #date: "Feb., 2021" #output: html_document #--- ## 0. Exercise #Modify the **job.sh** script in this folder by requesting 2 cores for running the #**HelloWorld.R** example. Although this R script uses 1 core (serial code), sometimes #i...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plotSiberObject.R \name{plotSiberObject} \alias{plotSiberObject} \title{Creates an isotope scatterplot and provides a wrapper to ellipse and hull plotting} \usage{ plotSiberObject( siber, iso.order = c(1, 2), ax.pad = 1, hulls = TRUE,...
/man/plotSiberObject.Rd
no_license
AndrewLJackson/SIBER
R
false
true
3,766
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plotSiberObject.R \name{plotSiberObject} \alias{plotSiberObject} \title{Creates an isotope scatterplot and provides a wrapper to ellipse and hull plotting} \usage{ plotSiberObject( siber, iso.order = c(1, 2), ax.pad = 1, hulls = TRUE,...
# Author: Roger Bukuru rm(list = ls()) #------------------------------------------------ Install Packages --------------------------------------------# list.of.packages <- c( "tidyverse", "Rcpp","RcppArmadillo", "pracma","DescTools","matlab", "doParallel","pacman","viridis","knitr","tictoc") new.packages <- lis...
/TradeDataMain.R
no_license
vishalbelsare/Exploring-The-Epps-Effect-R
R
false
false
7,046
r
# Author: Roger Bukuru rm(list = ls()) #------------------------------------------------ Install Packages --------------------------------------------# list.of.packages <- c( "tidyverse", "Rcpp","RcppArmadillo", "pracma","DescTools","matlab", "doParallel","pacman","viridis","knitr","tictoc") new.packages <- lis...
### remake.R --- ## Filename: remake.R ## Description: Remake datasets for analysis ## Author: Noah Peart ## Created: Thu Aug 13 19:58:42 2015 (-0400) ## Last-Updated: Sat Oct 31 16:43:49 2015 (-0400) ## By: Noah Peart ###################################################################### source("prep/pp_cle...
/inst/app/R/remake.R
no_license
nverno/mooseapp
R
false
false
353
r
### remake.R --- ## Filename: remake.R ## Description: Remake datasets for analysis ## Author: Noah Peart ## Created: Thu Aug 13 19:58:42 2015 (-0400) ## Last-Updated: Sat Oct 31 16:43:49 2015 (-0400) ## By: Noah Peart ###################################################################### source("prep/pp_cle...
#3.4 sequenceLength = 2500000; sampleSize = L*40; time1 = time2 = numeric(sampleSize); # Declare an array for(i in 1:sampleSize){ x = runif(sequenceLength, 0, 100); # Generate the sequence to be sorted time1[i] = system.time(x1 <- sort(x, method = "quick"), gcFirst = TRUE)[1]; } sampleSize2 = L*35; for(i in 1:sa...
/hw2/3.4.R
no_license
famer/MIE-SPI-statistics-for-informatics
R
false
false
603
r
#3.4 sequenceLength = 2500000; sampleSize = L*40; time1 = time2 = numeric(sampleSize); # Declare an array for(i in 1:sampleSize){ x = runif(sequenceLength, 0, 100); # Generate the sequence to be sorted time1[i] = system.time(x1 <- sort(x, method = "quick"), gcFirst = TRUE)[1]; } sampleSize2 = L*35; for(i in 1:sa...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ReplaceAction.R \name{ReplaceAction} \alias{ReplaceAction} \title{ReplaceAction} \usage{ ReplaceAction(id = NULL, target = NULL, startTime = NULL, result = NULL, participant = NULL, object = NULL, location = NULL, instrument = NULL, error...
/man/ReplaceAction.Rd
no_license
cboettig/schemar
R
false
true
5,509
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ReplaceAction.R \name{ReplaceAction} \alias{ReplaceAction} \title{ReplaceAction} \usage{ ReplaceAction(id = NULL, target = NULL, startTime = NULL, result = NULL, participant = NULL, object = NULL, location = NULL, instrument = NULL, error...
context("hotdeck") # some basic tests for hotdeck # # Author: alex ############################################################################### set.seed(104) dfx <- data.frame(unit_id=101:104, state=rep("NSW",4), wages01=c(NA,NA,NA,229305),r=runif(4)) df2 <- data.frame(unit_id=c(NA,101:104), state=rep("NSW",5), wag...
/tests/testthat/test_hotdeck.R
no_license
mcemerden/VIM
R
false
false
3,369
r
context("hotdeck") # some basic tests for hotdeck # # Author: alex ############################################################################### set.seed(104) dfx <- data.frame(unit_id=101:104, state=rep("NSW",4), wages01=c(NA,NA,NA,229305),r=runif(4)) df2 <- data.frame(unit_id=c(NA,101:104), state=rep("NSW",5), wag...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{\%<-\%} \alias{\%<-\%} \title{Destructuring assignment} \description{ See \code{zeallot::\link[zeallot]{\%<-\%}} for details. } \keyword{internal}
/man/unpack-assign.Rd
permissive
jlaffy/scrabble
R
false
true
239
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{\%<-\%} \alias{\%<-\%} \title{Destructuring assignment} \description{ See \code{zeallot::\link[zeallot]{\%<-\%}} for details. } \keyword{internal}
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/extract_summary.R \name{extract_summary} \alias{extract_summary} \title{Extract a summary list from a \pkg{gt} object} \usage{ extract_summary(data) } \arguments{ \item{data}{A table object that is created using the \code{\link[=gt]{gt()}} fu...
/man/extract_summary.Rd
permissive
tomryder9/gt
R
false
true
2,050
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/extract_summary.R \name{extract_summary} \alias{extract_summary} \title{Extract a summary list from a \pkg{gt} object} \usage{ extract_summary(data) } \arguments{ \item{data}{A table object that is created using the \code{\link[=gt]{gt()}} fu...
#unload packages message('This is best run from a fresh R / Rstudio session, with no other R sessions running') go<-readline('Continue? Y/N: ') if(go %in% c('Y','y')){ packs <- c(names(sessionInfo()$otherPkgs), names(sessionInfo()$loadedOnly)) if(length(packs) > 0){ message('Unloading packages -- if any problems occ...
/installctsem.R
no_license
davan690/ctsem
R
false
false
2,428
r
#unload packages message('This is best run from a fresh R / Rstudio session, with no other R sessions running') go<-readline('Continue? Y/N: ') if(go %in% c('Y','y')){ packs <- c(names(sessionInfo()$otherPkgs), names(sessionInfo()$loadedOnly)) if(length(packs) > 0){ message('Unloading packages -- if any problems occ...
############################################################## ##### -- Good surrogacy among biodiversity dimensions -- ##### ############################################################## ################### DATA ANALYSIS (PRESENT) ################## ####################################################################...
/src/6-analysis-phylo-trait-metrics.R
no_license
yangxhcaf/surrogacy-among-biodiversity-dimensions
R
false
false
13,358
r
############################################################## ##### -- Good surrogacy among biodiversity dimensions -- ##### ############################################################## ################### DATA ANALYSIS (PRESENT) ################## ####################################################################...
library(OjaNP) ### Name: ojaSCM ### Title: Oja Sign Convariance Matrix ### Aliases: ojaSCM ### Keywords: multivariate nonparametric ### ** Examples ### ----<< Example 1 >>---- : biochem data data(biochem) X <- biochem[,1:2] ojaSCM(X) # Oja signs are correctly centered # (i.e. they add up to zero) when # compute...
/data/genthat_extracted_code/OjaNP/examples/ojaSCM.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
1,272
r
library(OjaNP) ### Name: ojaSCM ### Title: Oja Sign Convariance Matrix ### Aliases: ojaSCM ### Keywords: multivariate nonparametric ### ** Examples ### ----<< Example 1 >>---- : biochem data data(biochem) X <- biochem[,1:2] ojaSCM(X) # Oja signs are correctly centered # (i.e. they add up to zero) when # compute...
setwd("D:/Users/eberkel/Documents/Trainingen/Data Science Toolbox/Exploratory Data Analysis/Assignment1") readRawData = 0; # set to 1 if the raw data is to be read. # This needs to be done ones in order to run the code # Reads the original dataset and forms a smaller one with only the data that # ...
/plot2.r
no_license
ecrvanberkel/Assignment1
R
false
false
1,111
r
setwd("D:/Users/eberkel/Documents/Trainingen/Data Science Toolbox/Exploratory Data Analysis/Assignment1") readRawData = 0; # set to 1 if the raw data is to be read. # This needs to be done ones in order to run the code # Reads the original dataset and forms a smaller one with only the data that # ...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/mix.R \name{unimix} \alias{unimix} \title{Constructor for unimix class} \usage{ unimix(pi, a, b) } \arguments{ \item{pi}{vector of mixture proportions} \item{a}{vector of left hand ends of uniforms} \item{b}{vector of right hand end...
/man/unimix.Rd
no_license
kkdey/ashr
R
false
false
527
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/mix.R \name{unimix} \alias{unimix} \title{Constructor for unimix class} \usage{ unimix(pi, a, b) } \arguments{ \item{pi}{vector of mixture proportions} \item{a}{vector of left hand ends of uniforms} \item{b}{vector of right hand end...
## This function creates a list that contains functions to set/get a matrix and set/get its inverse. makeCacheMatrix <- function(x = matrix()) { inv <- NULL set <- function(y) { x <<- y inv <<- NULL } get <- function() x setInverse <- function(inverse) inv <<- inverse getInverse <- function() i...
/cachematrix.R
no_license
klkollias/datasciencecoursera
R
false
false
828
r
## This function creates a list that contains functions to set/get a matrix and set/get its inverse. makeCacheMatrix <- function(x = matrix()) { inv <- NULL set <- function(y) { x <<- y inv <<- NULL } get <- function() x setInverse <- function(inverse) inv <<- inverse getInverse <- function() i...
/Practica 2/practica 02.R
no_license
ArelyAnahiA/MateComputacional
R
false
false
921
r
#' Adds the content of www to sF/ #' #' @importFrom shiny addResourcePath #' #' @noRd #' .onLoad <- function(...) { shiny::addResourcePath('sF', system.file('www', package='s3browser')) } #' Get a list of available volumes #' #' This function is intended as an input to the roots parameter in #' \code{\link{fileGett...
/R/shinyFilesSupportFunctions.R
no_license
pantheracorp/s3browser
R
false
false
2,758
r
#' Adds the content of www to sF/ #' #' @importFrom shiny addResourcePath #' #' @noRd #' .onLoad <- function(...) { shiny::addResourcePath('sF', system.file('www', package='s3browser')) } #' Get a list of available volumes #' #' This function is intended as an input to the roots parameter in #' \code{\link{fileGett...
#library(devtools) #install_github("mcfanda/cpower") library(cpower) ### examples ##### d.cont ### cont<-c(-3,-1,1,3) means<-c(10,12,10,12) d.contr(cont,means = means,sd=2,scale = "g") ### different scaling d.contr(cont,means = means,sd=2,scale = "z") ### raw data y<-rep(means,1000)+rnorm(4000,0,2) x<-factor(rep(1:4,1...
/inst/test.R
no_license
mcfanda/cpower
R
false
false
2,373
r
#library(devtools) #install_github("mcfanda/cpower") library(cpower) ### examples ##### d.cont ### cont<-c(-3,-1,1,3) means<-c(10,12,10,12) d.contr(cont,means = means,sd=2,scale = "g") ### different scaling d.contr(cont,means = means,sd=2,scale = "z") ### raw data y<-rep(means,1000)+rnorm(4000,0,2) x<-factor(rep(1:4,1...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/try_several_times.R \name{try_several_times} \alias{try_several_times} \title{Title} \usage{ try_several_times(fun, args, condition, tries = 15, wait = 5) } \arguments{ \item{fun}{function; fun to apply several times} \item{args}{list of nam...
/man/try_several_times.Rd
no_license
adambondarzewskiITF/utilitiesAdamExample
R
false
true
549
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/try_several_times.R \name{try_several_times} \alias{try_several_times} \title{Title} \usage{ try_several_times(fun, args, condition, tries = 15, wait = 5) } \arguments{ \item{fun}{function; fun to apply several times} \item{args}{list of nam...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/quantile_MC_sgdf.R \name{quantile_MC_sgdf} \alias{quantile_MC_sgdf} \title{quantile() function for MC sample saved in a SpatialGridDataFrame} \usage{ quantile_MC_sgdf(realizations, ...) } \arguments{ \item{realizations}{MC sample saved in Spa...
/man/quantile_MC_sgdf.Rd
no_license
GRSEB9S/spup
R
false
true
987
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/quantile_MC_sgdf.R \name{quantile_MC_sgdf} \alias{quantile_MC_sgdf} \title{quantile() function for MC sample saved in a SpatialGridDataFrame} \usage{ quantile_MC_sgdf(realizations, ...) } \arguments{ \item{realizations}{MC sample saved in Spa...
A = as.matrix(read.table("A.txt", skip = 1)) B = as.matrix(read.table("B.txt", skip = 1)) C = as.matrix(read.table("output.txt"))
/PresentationFiles/verify.R
no_license
JKChun/OpenCL-Seminar
R
false
false
132
r
A = as.matrix(read.table("A.txt", skip = 1)) B = as.matrix(read.table("B.txt", skip = 1)) C = as.matrix(read.table("output.txt"))
#' Geoserver REST API Resource #' #' @docType class #' @importFrom R6 R6Class #' @export #' #' @name GSLayer #' @title A GeoServer layer resource #' @description This class models a GeoServer layer. This class is to be #' used for published resource (feature type or coverage). #' @keywords geoserver rest api...
/R/GSLayer.R
no_license
cran/geosapi
R
false
false
5,188
r
#' Geoserver REST API Resource #' #' @docType class #' @importFrom R6 R6Class #' @export #' #' @name GSLayer #' @title A GeoServer layer resource #' @description This class models a GeoServer layer. This class is to be #' used for published resource (feature type or coverage). #' @keywords geoserver rest api...
## @knitr utils library(tidyverse) library(compx) library(sf) library(RColorBrewer) library(ggthemes) # # h_clust <- function(input, data){ # # if('sf' %in% class(input)){ # tract_lookup <- id_lookup(input) # adj <- st_relate(input, pattern = '****1****', sparse = TRUE) # # ...
/R/utils.R
no_license
PhilChodrow/spatial_complexity
R
false
false
8,428
r
## @knitr utils library(tidyverse) library(compx) library(sf) library(RColorBrewer) library(ggthemes) # # h_clust <- function(input, data){ # # if('sf' %in% class(input)){ # tract_lookup <- id_lookup(input) # adj <- st_relate(input, pattern = '****1****', sparse = TRUE) # # ...
#' Create skeleton for RCE readme #' #' @param name the author of the readme file #' @param description #' @param file_list Boolean, should the directory's files be #' listed in the readme? #' @param path the path to the directory that the readme is for #' #' @return #' @export #' #' @examples make_readme <- f...
/R/rcehelp.R
no_license
NSAPH/rcehelp
R
false
false
3,279
r
#' Create skeleton for RCE readme #' #' @param name the author of the readme file #' @param description #' @param file_list Boolean, should the directory's files be #' listed in the readme? #' @param path the path to the directory that the readme is for #' #' @return #' @export #' #' @examples make_readme <- f...
## For CySubNetworksAspects: ## prepare some aspects: cySubNetworks1 = createCySubNetworks( id = c(0,1), nodes = list("all", c(1,2,3)), edges = list("all", c(0,2)) ) cySubNetworks2 = createCySubNetworks( nodes = c(0,3), edges = c(1) ) ## subnetwork ids will...
/man-roxygen-examples/cy-subnetworks-update.R
permissive
frankkramer-lab/RCX
R
false
false
1,764
r
## For CySubNetworksAspects: ## prepare some aspects: cySubNetworks1 = createCySubNetworks( id = c(0,1), nodes = list("all", c(1,2,3)), edges = list("all", c(0,2)) ) cySubNetworks2 = createCySubNetworks( nodes = c(0,3), edges = c(1) ) ## subnetwork ids will...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RHDF5Array.R \docType{class} \name{HSDSMatrix} \alias{HSDSMatrix} \alias{HSDSMatrix-class} \title{DelayedMatrix subclass for a two-dimensional HSDSArray} \description{ DelayedMatrix subclass for a two-dimensional HSDSArray } \seealso{ Other H...
/man/HSDSMatrix.Rd
no_license
vjcitn/rhdf5client
R
false
true
397
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RHDF5Array.R \docType{class} \name{HSDSMatrix} \alias{HSDSMatrix} \alias{HSDSMatrix-class} \title{DelayedMatrix subclass for a two-dimensional HSDSArray} \description{ DelayedMatrix subclass for a two-dimensional HSDSArray } \seealso{ Other H...
## Creates the basic plots for supplemental figure S5b (laterality of ROIs) # Note that .mat files are organized such that 1st col is ROI, 2nd col is subject # All of EVC is included here so ROI indices are: 1 = V1, 2 = V2, 3 = V3, # 4 = IOG, 5 = pFus, 6 = mFus, 7 = pSTS, 8 = mSTS, 9 = CoS rm(list=ls()) library(R.mat...
/R_code/code/figS5b.R
no_license
VPNL/fibeRFs
R
false
false
4,612
r
## Creates the basic plots for supplemental figure S5b (laterality of ROIs) # Note that .mat files are organized such that 1st col is ROI, 2nd col is subject # All of EVC is included here so ROI indices are: 1 = V1, 2 = V2, 3 = V3, # 4 = IOG, 5 = pFus, 6 = mFus, 7 = pSTS, 8 = mSTS, 9 = CoS rm(list=ls()) library(R.mat...
### Peer-graded Assignment: Plot 1 ### # Download data and unzip file url <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" download.file(url, destfile = "household_power_consumption.zip", method = "curl") unzip("household_power_consumption.zip", exdir = getwd()) # Estimate t...
/plot 1.R
no_license
thuyngh08/ExData_Plotting1
R
false
false
1,454
r
### Peer-graded Assignment: Plot 1 ### # Download data and unzip file url <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" download.file(url, destfile = "household_power_consumption.zip", method = "curl") unzip("household_power_consumption.zip", exdir = getwd()) # Estimate t...
### # pull census data for the counties of interest and attached values to the # carverd@colostate.edu # 20210104 ### install.packages("tidycensus") library(tidycensus) library(tidyverse) options(tigris_use_cache = TRUE) census_api_key("YOUR API KEY GOES HERE") #counties of interest counties <- c("Harris", "Fort Be...
/dailyData/censusData.R
no_license
dcarver1/covidNightLights
R
false
false
1,866
r
### # pull census data for the counties of interest and attached values to the # carverd@colostate.edu # 20210104 ### install.packages("tidycensus") library(tidycensus) library(tidyverse) options(tigris_use_cache = TRUE) census_api_key("YOUR API KEY GOES HERE") #counties of interest counties <- c("Harris", "Fort Be...
# Bootrstapped IPW Difference-in-Differences with Panel Data # 2 periods and 2 groups wboot.ipw.panel <- function(nn, n, deltaY, D, int.cov, i.weights){ #----------------------------------------------------------------------------- v <- stats::rexp(n) #v <- v / mean(v) #weights for the bootstrap b.we...
/R/wboot.ipw.panel.R
no_license
pedrohcgs/DRDID
R
false
false
759
r
# Bootrstapped IPW Difference-in-Differences with Panel Data # 2 periods and 2 groups wboot.ipw.panel <- function(nn, n, deltaY, D, int.cov, i.weights){ #----------------------------------------------------------------------------- v <- stats::rexp(n) #v <- v / mean(v) #weights for the bootstrap b.we...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/adorn_title.R \name{adorn_title} \alias{adorn_title} \title{Add column name to the top of a two-way tabyl.} \usage{ adorn_title(dat, placement = "top", row_name, col_name) } \arguments{ \item{dat}{a data.frame of class \code{tabyl} or other d...
/man/adorn_title.Rd
permissive
baifengbai/janitor
R
false
true
2,148
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/adorn_title.R \name{adorn_title} \alias{adorn_title} \title{Add column name to the top of a two-way tabyl.} \usage{ adorn_title(dat, placement = "top", row_name, col_name) } \arguments{ \item{dat}{a data.frame of class \code{tabyl} or other d...
#http://stackoverflow.com/questions/24414700/amazon-water-collected-between-towers #alright pretty naive/brute force solution but whatever it works #You are given an input array whose each element represents the height of a line towers. #The width of every tower is 1. It starts raining. How much water is collected bet...
/water_blocks.R
no_license
andymckenzie/R-plots
R
false
false
1,774
r
#http://stackoverflow.com/questions/24414700/amazon-water-collected-between-towers #alright pretty naive/brute force solution but whatever it works #You are given an input array whose each element represents the height of a line towers. #The width of every tower is 1. It starts raining. How much water is collected bet...
library(sprsmdl) ### Name: SlrArd ### Title: Sparse Logistic Regression ### Aliases: SlrArd ### Keywords: models regression ### ** Examples data(iris) tmp <- iris[iris$Species != 'versicolor',] T <- tmp$Species == 'setosa' X <- as.matrix(tmp[,1:4]) res <- SlrArd(T, X, bias=TRUE, method="VB", control = list(maxit=...
/data/genthat_extracted_code/sprsmdl/examples/SlrArd.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
535
r
library(sprsmdl) ### Name: SlrArd ### Title: Sparse Logistic Regression ### Aliases: SlrArd ### Keywords: models regression ### ** Examples data(iris) tmp <- iris[iris$Species != 'versicolor',] T <- tmp$Species == 'setosa' X <- as.matrix(tmp[,1:4]) res <- SlrArd(T, X, bias=TRUE, method="VB", control = list(maxit=...
library(assertive.reflection) ### Name: assert_is_batch_mode ### Title: How is R running? ### Aliases: assert_is_batch_mode assert_is_interactive assert_is_r_slave ### assert_is_slave_r is_batch_mode is_interactive is_r_slave is_slave_r ### ** Examples is_batch_mode() is_interactive() is_r_slave()
/data/genthat_extracted_code/assertive.reflection/examples/is_batch_mode.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
308
r
library(assertive.reflection) ### Name: assert_is_batch_mode ### Title: How is R running? ### Aliases: assert_is_batch_mode assert_is_interactive assert_is_r_slave ### assert_is_slave_r is_batch_mode is_interactive is_r_slave is_slave_r ### ** Examples is_batch_mode() is_interactive() is_r_slave()
# # This is a Shiny web application. You can run the application by clicking # the 'Run App' button above. # # Find out more about building applications with Shiny here: # # http://shiny.rstudio.com/ # library(shiny) library(ggplot2) library(Cairo) # For nicer ggplot2 output when deployed on Linux lib...
/Assignment7/Assignment7/app.R
no_license
MarkMadness/DataScience
R
false
false
3,689
r
# # This is a Shiny web application. You can run the application by clicking # the 'Run App' button above. # # Find out more about building applications with Shiny here: # # http://shiny.rstudio.com/ # library(shiny) library(ggplot2) library(Cairo) # For nicer ggplot2 output when deployed on Linux lib...
context("Utilities") test_that("covmat works", { lapply(res, function (x) { expect_warning(covmat(x), NA) %>% expect_is("array") }) }) test_that("cormat works", { lapply(res, function (x) { expect_warning(cormat(x), NA) %>% expect_is("array") }) }) test_that("p...
/fuzzedpackages/factorstochvol/tests/testthat/test-utilities.R
no_license
akhikolla/testpackages
R
false
false
2,720
r
context("Utilities") test_that("covmat works", { lapply(res, function (x) { expect_warning(covmat(x), NA) %>% expect_is("array") }) }) test_that("cormat works", { lapply(res, function (x) { expect_warning(cormat(x), NA) %>% expect_is("array") }) }) test_that("p...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rename-Spat.R \name{rename.Spat} \alias{rename.Spat} \alias{rename.SpatRaster} \alias{rename_with.SpatRaster} \alias{rename.SpatVector} \alias{rename_with.SpatVector} \title{Rename layers/attributes} \usage{ \method{rename}{SpatRaster}(.data,...
/man/rename.Spat.Rd
permissive
dieghernan/tidyterra
R
false
true
3,105
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rename-Spat.R \name{rename.Spat} \alias{rename.Spat} \alias{rename.SpatRaster} \alias{rename_with.SpatRaster} \alias{rename.SpatVector} \alias{rename_with.SpatVector} \title{Rename layers/attributes} \usage{ \method{rename}{SpatRaster}(.data,...
#' Capitalize first or all words in string #' #' @param string character vector #' @param words which words to capitalize in string: \code{all} or \code{first} only? #' @export #' @examples #' Cap(c("adam d. smith", "northern parula", "title Caps please")) #' Cap("this is a sentence.", "first") Cap <- function(string,...
/R/Cap.R
no_license
adamdsmith/nrsmisc
R
false
false
758
r
#' Capitalize first or all words in string #' #' @param string character vector #' @param words which words to capitalize in string: \code{all} or \code{first} only? #' @export #' @examples #' Cap(c("adam d. smith", "northern parula", "title Caps please")) #' Cap("this is a sentence.", "first") Cap <- function(string,...
% Generated by roxygen2 (4.0.0): do not edit by hand \name{make_bar} \alias{make_bar} \title{Convenience function for an interactive bar that might otherwise be created using stat_summary(geom="bar").} \usage{ make_bar(data, x.name, alpha = 1) } \arguments{ \item{data}{data.frame to analyze for unique x.name values...
/man/make_bar.Rd
no_license
johndharrison/animint
R
false
false
625
rd
% Generated by roxygen2 (4.0.0): do not edit by hand \name{make_bar} \alias{make_bar} \title{Convenience function for an interactive bar that might otherwise be created using stat_summary(geom="bar").} \usage{ make_bar(data, x.name, alpha = 1) } \arguments{ \item{data}{data.frame to analyze for unique x.name values...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ggsave2.R \name{ggsave2} \alias{ggsave2} \title{Export ggplot object to file} \usage{ ggsave2(filename, plot = ggplot2::last_plot(), ...) } \arguments{ \item{filename}{[\code{character(1)}]\cr Path to file.} \item{plot}{[\code{ggplot}]\cr gg...
/man/ggsave2.Rd
no_license
jakobbossek/re
R
false
true
599
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ggsave2.R \name{ggsave2} \alias{ggsave2} \title{Export ggplot object to file} \usage{ ggsave2(filename, plot = ggplot2::last_plot(), ...) } \arguments{ \item{filename}{[\code{character(1)}]\cr Path to file.} \item{plot}{[\code{ggplot}]\cr gg...
library("readr") library(stringr) #Extraction of data args=commandArgs(trailingOnly=TRUE) Data <- read_tsv(args[1],skip=, col_names=FALSE) NData=Data[Data[["X9"]]<0.5,] Name <- str_replace(args[1],".cnv","_q0.cnv") write_tsv(NData,Name,col_names=FALSE)
/Complementary/q0Filter.R
no_license
pabloati/Workflow_for_CNV_Calling
R
false
false
257
r
library("readr") library(stringr) #Extraction of data args=commandArgs(trailingOnly=TRUE) Data <- read_tsv(args[1],skip=, col_names=FALSE) NData=Data[Data[["X9"]]<0.5,] Name <- str_replace(args[1],".cnv","_q0.cnv") write_tsv(NData,Name,col_names=FALSE)
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{pdxe} \alias{pdxe} \title{Example dataset with 1x1x1 experiment design} \format{A Xeva object with 1x1x1 experiment design and molecular data.} \usage{ data(pdxe) } \description{ This is the PDXE dataset without mi...
/man/pdxe.Rd
no_license
RNA-Ninja/Xeva
R
false
true
356
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{pdxe} \alias{pdxe} \title{Example dataset with 1x1x1 experiment design} \format{A Xeva object with 1x1x1 experiment design and molecular data.} \usage{ data(pdxe) } \description{ This is the PDXE dataset without mi...
###################################################################### ###################################################################### ###################################################################### # - Thermal limit studies and sample size # - Script 002: One-sample simulations - confidence interval co...
/scripts/02_ctmin_coverage.R
permissive
guysutton/owen_et_al_sample_size_paper
R
false
false
6,757
r
###################################################################### ###################################################################### ###################################################################### # - Thermal limit studies and sample size # - Script 002: One-sample simulations - confidence interval co...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rekognition_operations.R \name{rekognition_update_dataset_entries} \alias{rekognition_update_dataset_entries} \title{Adds or updates one or more entries (images) in a dataset} \usage{ rekognition_update_dataset_entries(DatasetArn, Changes) } ...
/cran/paws.machine.learning/man/rekognition_update_dataset_entries.Rd
permissive
paws-r/paws
R
false
true
1,037
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rekognition_operations.R \name{rekognition_update_dataset_entries} \alias{rekognition_update_dataset_entries} \title{Adds or updates one or more entries (images) in a dataset} \usage{ rekognition_update_dataset_entries(DatasetArn, Changes) } ...
## Load some libraries library(magrittr) library(data.table) library(mergeutils) ## Load the data data <- read.csv("FinalCompendium_22022016.csv") extradata <- read.csv("StudyPatientsDataHP_22022016.csv") ## Convert to datatables for easier manipulation data <- as.data.table(data) extradata <- as.data.table(extradata) ...
/electrocardiography/electrocardiography.R
no_license
vapniks/statistics_projects
R
false
false
2,723
r
## Load some libraries library(magrittr) library(data.table) library(mergeutils) ## Load the data data <- read.csv("FinalCompendium_22022016.csv") extradata <- read.csv("StudyPatientsDataHP_22022016.csv") ## Convert to datatables for easier manipulation data <- as.data.table(data) extradata <- as.data.table(extradata) ...
## Functions to generate plots match_signatures <- function(mod_test, mod_ref){ ## Match signatures from model to a reference model ## Input: ## mod0: HDmutsig output that you wish to align ## mod_ref: reference model that you wish to align to ## Output: ## indexing of the model. ...
/R/plotting_utils.R
permissive
emauryg/STRAND_R
R
false
false
10,736
r
## Functions to generate plots match_signatures <- function(mod_test, mod_ref){ ## Match signatures from model to a reference model ## Input: ## mod0: HDmutsig output that you wish to align ## mod_ref: reference model that you wish to align to ## Output: ## indexing of the model. ...
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(7.63017925670453e-306, 1.50384466654321e-270, 9.37602117095352e+235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(3L, 7L))) result <- do.call(CNull:::communities_individual_based_sampling_alpha,testlist) str(result)
/CNull/inst/testfiles/communities_individual_based_sampling_alpha/AFL_communities_individual_based_sampling_alpha/communities_individual_based_sampling_alpha_valgrind_files/1615773177-test.R
no_license
akhikolla/updatedatatype-list2
R
false
false
300
r
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(7.63017925670453e-306, 1.50384466654321e-270, 9.37602117095352e+235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(3L, 7L))) result <- do.call(CNull:::communities_individual_based_sampling_alpha,testlist) str(result)
## This program reads the data file, constructs the second plot ## and saves it in the file plot2.png in the working directory ## Initialize the URL as per the assignment url="https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" ## Download the file and then unzip into the working ...
/plot2.R
no_license
arupmi/EDA-Assign1
R
false
false
1,255
r
## This program reads the data file, constructs the second plot ## and saves it in the file plot2.png in the working directory ## Initialize the URL as per the assignment url="https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" ## Download the file and then unzip into the working ...
######################################## ### GCT class and method definitions ### ######################################## #' An S4 class to represent a GCT object #' #' @slot mat a numeric matrix #' @slot rid a character vector of row ids #' @slot cid a character vector of column ids #' @slot rdesc a \code{data.fram...
/io_new.R
no_license
yduan004/lincs_data_analysis
R
false
false
33,247
r
######################################## ### GCT class and method definitions ### ######################################## #' An S4 class to represent a GCT object #' #' @slot mat a numeric matrix #' @slot rid a character vector of row ids #' @slot cid a character vector of column ids #' @slot rdesc a \code{data.fram...
#! /usr/bin/env Rscript commute_time_kernel <- function(matrix){ #' Apply Commute-Time kernel opertaion to obtain a given matrix kernel #' @param matrix to be transformed #' @return Conmmute-Time kernel of the given matrix #' @import MASS package(s) #' @see Commute time kernel (active). J.-K. Heriche 2014 | doi: 10.1...
/scripts/kernels_functions.R
no_license
seoanezonjic/kernels_testing
R
false
false
3,785
r
#! /usr/bin/env Rscript commute_time_kernel <- function(matrix){ #' Apply Commute-Time kernel opertaion to obtain a given matrix kernel #' @param matrix to be transformed #' @return Conmmute-Time kernel of the given matrix #' @import MASS package(s) #' @see Commute time kernel (active). J.-K. Heriche 2014 | doi: 10.1...
## This file contains code to evaluate the performance ## of the time series regression on California milk ## production Azure = FALSE if(Azure){ ## Read the input data table into a data frame. frame3 <- maml.mapInputPort(1) ## Source the .R file from the zip. source("src/milkutilities.R") ## Ensure the d...
/milkevaluate.R
no_license
anthreddy/DataScience
R
false
false
2,245
r
## This file contains code to evaluate the performance ## of the time series regression on California milk ## production Azure = FALSE if(Azure){ ## Read the input data table into a data frame. frame3 <- maml.mapInputPort(1) ## Source the .R file from the zip. source("src/milkutilities.R") ## Ensure the d...
test_that("adds src class", { tb <- tbl_lazy(mtcars, con = simulate_sqlite()) expect_s3_class(tb, "tbl_SQLiteConnection") }) test_that("argument src is deprecated", { expect_snapshot(error = TRUE, tbl_lazy(mtcars, src = simulate_sqlite())) }) test_that("cannot convert tbl_lazy to data.frame", { expect_snapsho...
/tests/testthat/test-tbl-lazy.R
permissive
tidyverse/dbplyr
R
false
false
1,383
r
test_that("adds src class", { tb <- tbl_lazy(mtcars, con = simulate_sqlite()) expect_s3_class(tb, "tbl_SQLiteConnection") }) test_that("argument src is deprecated", { expect_snapshot(error = TRUE, tbl_lazy(mtcars, src = simulate_sqlite())) }) test_that("cannot convert tbl_lazy to data.frame", { expect_snapsho...
#' Census API URL assembler. #' #' \code{get_census_api_2} assembles URL components for \code{get_census_api}. #' #' This function assembles the URL components and sends the request to the Census server. #' It is used by the \code{get_census_api} function. The user should not need to call this #' function directly. ...
/R/get_census_api_2.R
no_license
kosukeimai/wru
R
false
false
3,121
r
#' Census API URL assembler. #' #' \code{get_census_api_2} assembles URL components for \code{get_census_api}. #' #' This function assembles the URL components and sends the request to the Census server. #' It is used by the \code{get_census_api} function. The user should not need to call this #' function directly. ...
library(scales) library(readr) library(tidyverse) setwd("C:/MSR-DS3/coursework/week1") # set plot theme theme_set(theme_bw()) # read ratings from csv file #ratings <- read_csv('ratings.csv') # for reference: same thing, using base R functions and explicitly setting column information ratings <- read.de...
/week1/movielens.R
no_license
IlanaRadinsky/coursework
R
false
false
6,958
r
library(scales) library(readr) library(tidyverse) setwd("C:/MSR-DS3/coursework/week1") # set plot theme theme_set(theme_bw()) # read ratings from csv file #ratings <- read_csv('ratings.csv') # for reference: same thing, using base R functions and explicitly setting column information ratings <- read.de...
library(ipumsr) library(dbplyr) library(tidyverse) library(factoextra) library(data.table) library(splitstackshape) library(ggplot2) library(gridExtra) getwd() setwd("C:/") ###########################################calculating for Argentina ###########################################import IPUMS ...
/STEP_3/index.R
no_license
fred-r-ramos/DUIA
R
false
false
15,480
r
library(ipumsr) library(dbplyr) library(tidyverse) library(factoextra) library(data.table) library(splitstackshape) library(ggplot2) library(gridExtra) getwd() setwd("C:/") ###########################################calculating for Argentina ###########################################import IPUMS ...