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/miscFunctions.R \name{summarizeTable} \alias{summarizeTable} \title{Summarize SCtkExperiment} \usage{ summarizeTable(inSCE, useAssay = "counts", expressionCutoff = 1700) } \arguments{ \item{inSCE}{Input SCtkExperiment object. Required} \item...
/man/summarizeTable.Rd
permissive
zhangyuqing/singleCellTK
R
false
true
709
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/miscFunctions.R \name{summarizeTable} \alias{summarizeTable} \title{Summarize SCtkExperiment} \usage{ summarizeTable(inSCE, useAssay = "counts", expressionCutoff = 1700) } \arguments{ \item{inSCE}{Input SCtkExperiment object. Required} \item...
#' @title Allowed XML tags #' #' @export allowed_tags <- function() { return( c( "ServiceType", "ArriveTime", "DepartTime", "Platform", "ServiceStatus", "Delay", "Origin1", "Destination1" ) ) }
/R/allowed_tags.R
no_license
ntyndall/translink.bot
R
false
false
257
r
#' @title Allowed XML tags #' #' @export allowed_tags <- function() { return( c( "ServiceType", "ArriveTime", "DepartTime", "Platform", "ServiceStatus", "Delay", "Origin1", "Destination1" ) ) }
library(readr) library(stringr) library(gdata) library(tidyr) library(dplyr) library(dash) library(dashHtmlComponents) library(dashCoreComponents) library(dashTable) library(plotly) #################################################################################################### # INITIATE APP appName <- Sys.geten...
/apps/dashr-lastodash/app.R
permissive
NataliaBeylina/dash-sample-apps
R
false
false
11,758
r
library(readr) library(stringr) library(gdata) library(tidyr) library(dplyr) library(dash) library(dashHtmlComponents) library(dashCoreComponents) library(dashTable) library(plotly) #################################################################################################### # INITIATE APP appName <- Sys.geten...
# Compare Networks via Vertex properties screenOn=TRUE epsOn=TRUE pdfOn=TRUE OSWindows=TRUE inputDir="input/" outputDir="output/FixedR/" rootName=list() testOn=TRUE if (testOn) { rootName[[1]]="circleN10D100.0-C5-J50.0_PPAbeta003_r1"; rootName[[2]]="circleN10D100.0-C5-J50.0_MDND100.000_r0"; parameterVec<-c("Pag...
/R/NetworkComparison/NetworkComparisonnew.r
no_license
xuzhikethinker/PRG
R
false
false
2,307
r
# Compare Networks via Vertex properties screenOn=TRUE epsOn=TRUE pdfOn=TRUE OSWindows=TRUE inputDir="input/" outputDir="output/FixedR/" rootName=list() testOn=TRUE if (testOn) { rootName[[1]]="circleN10D100.0-C5-J50.0_PPAbeta003_r1"; rootName[[2]]="circleN10D100.0-C5-J50.0_MDND100.000_r0"; parameterVec<-c("Pag...
#!/usr/bin/Rscript library(shiny) runApp("app.R", launch.browser = TRUE )
/app/launch.R
no_license
almaan/her2st
R
false
false
91
r
#!/usr/bin/Rscript library(shiny) runApp("app.R", launch.browser = TRUE )
testlist <- list(reference = numeric(0), values = c(NaN, NaN, 3.23785921002061e-319, 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)) result <- do.call(diversityForest:::numSmaller,testlist) str(result)
/diversityForest/inst/testfiles/numSmaller/libFuzzer_numSmaller/numSmaller_valgrind_files/1610037492-test.R
no_license
akhikolla/updated-only-Issues
R
false
false
252
r
testlist <- list(reference = numeric(0), values = c(NaN, NaN, 3.23785921002061e-319, 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)) result <- do.call(diversityForest:::numSmaller,testlist) str(result)
library(CombinS) ### Name: GPBIB5 ### Title: Generalized rectangular right angular (5) design. ### Aliases: GPBIB5 ### ** Examples ## Not run: ##D n<-3 ##D l<-3 ##D s<-3 ##D w<-3 ##D GPBIB5(n, l, s, w) ## End(Not run)
/data/genthat_extracted_code/CombinS/examples/GPBIB5.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
226
r
library(CombinS) ### Name: GPBIB5 ### Title: Generalized rectangular right angular (5) design. ### Aliases: GPBIB5 ### ** Examples ## Not run: ##D n<-3 ##D l<-3 ##D s<-3 ##D w<-3 ##D GPBIB5(n, l, s, w) ## End(Not run)
db15618cdf38fbacbd6c60658186ee01 reachqu_reachqu_1344.qdimacs 6939 42091
/code/dcnf-ankit-optimized/Results/QBFLIB-2018/E1/Database/Jordan-Kaiser/reduction-finding-full-set-params-k1c3n4/reachqu_reachqu_1344/reachqu_reachqu_1344.R
no_license
arey0pushpa/dcnf-autarky
R
false
false
72
r
db15618cdf38fbacbd6c60658186ee01 reachqu_reachqu_1344.qdimacs 6939 42091
# SpatialPlots_Extras # functions for spatial plotting # ACP 21/1/09 # includes: # mergecsData # layout.matrix # landmass.polygons # is.statsq # convert.statsq.lat.lon # convert.icesarea.statsq # convert.icesarea.lat.lon # convert.statsq.icesarea # ices.division.lines # ices.division.names # su...
/COSTeda/R/SpatialPlots_Extras.r
no_license
BackupTheBerlios/cost-project
R
false
false
49,610
r
# SpatialPlots_Extras # functions for spatial plotting # ACP 21/1/09 # includes: # mergecsData # layout.matrix # landmass.polygons # is.statsq # convert.statsq.lat.lon # convert.icesarea.statsq # convert.icesarea.lat.lon # convert.statsq.icesarea # ices.division.lines # ices.division.names # su...
get.reynolds <- function(track, folder = tempdir(), removeland = TRUE) { # Metadata: http://www.esrl.noaa.gov/psd/data/gridded/data.noaa.oisst.v2.html require(date) require(ncdf4) fmtDate <- function(date) { x <- date.mdy(date) paste(x$year, formatC(x$month, digits = 1, flag = "0", ...
/dev/get_reynolds_new.r
no_license
galuardi/analyzepsat
R
false
false
8,623
r
get.reynolds <- function(track, folder = tempdir(), removeland = TRUE) { # Metadata: http://www.esrl.noaa.gov/psd/data/gridded/data.noaa.oisst.v2.html require(date) require(ncdf4) fmtDate <- function(date) { x <- date.mdy(date) paste(x$year, formatC(x$month, digits = 1, flag = "0", ...
UCLN <- function(a, b){ if(b == 0){ return(a) } else { return(UCLN(b, a%%b)) } } UCLN(50,150)
/BT02_UCLN.R
no_license
Huynhngocthanh/CTDL-GT.R
R
false
false
114
r
UCLN <- function(a, b){ if(b == 0){ return(a) } else { return(UCLN(b, a%%b)) } } UCLN(50,150)
library(shiny) library(CrossoverDesign) # Define UI for application that draws a histogram shinyUI( navbarPage( id = 'model', title = 'Crossover Design Generator', selected = 'dropout', # UI for crossover dropout tabPanel( value = 'dropout',title = 'Crossover Dropout', ...
/inst/shiny/ui.R
no_license
shuaih0303/CrossoverDesign
R
false
false
10,639
r
library(shiny) library(CrossoverDesign) # Define UI for application that draws a histogram shinyUI( navbarPage( id = 'model', title = 'Crossover Design Generator', selected = 'dropout', # UI for crossover dropout tabPanel( value = 'dropout',title = 'Crossover Dropout', ...
# # Calculation of partial correlation coefficients. # # Author: Soojin Yi # Source: http://www.yilab.gatech.edu/pcor.html # http://www.yilab.gatech.edu/pcor.R # # References: # Genetica 131(2): 151--156, Oct 2007. DOI: 10.1007/s10709-006-9125-2 # Mol Biol Evol 23(5): 1068--1075, May 2006. DOI: 10.109...
/R/pcor.R
no_license
rma/rma.g92
R
false
false
4,422
r
# # Calculation of partial correlation coefficients. # # Author: Soojin Yi # Source: http://www.yilab.gatech.edu/pcor.html # http://www.yilab.gatech.edu/pcor.R # # References: # Genetica 131(2): 151--156, Oct 2007. DOI: 10.1007/s10709-006-9125-2 # Mol Biol Evol 23(5): 1068--1075, May 2006. DOI: 10.109...
#Ver7 #library(stringr) #library("mclust", lib.loc="~/R/win-library/3.2") #library(ggplot2) #library(MASS) #library("kernlab", lib.loc="~/R/win-library/3.2") #library("numDeriv", lib.loc="~/R/win-library/3.2") #col=rev(rainbow(255)) #col=(heat.colors(20)) #col = terrain.colors(255) #source("tools.R") #Variable------...
/TclAlgorithm1currentfileonmachine17withplotsForBatch.R
no_license
boazgiron/TCL
R
false
false
65,501
r
#Ver7 #library(stringr) #library("mclust", lib.loc="~/R/win-library/3.2") #library(ggplot2) #library(MASS) #library("kernlab", lib.loc="~/R/win-library/3.2") #library("numDeriv", lib.loc="~/R/win-library/3.2") #col=rev(rainbow(255)) #col=(heat.colors(20)) #col = terrain.colors(255) #source("tools.R") #Variable------...
test_that("pack creation api", { pack_name = "samplePack" startPack(pack_name) addKeynameToPack("banana") addKeynameToPack("apple") finishPack(persist = FALSE) expect_setequal(c('banana', 'apple'), listPackKeys(pack_name)) }) test_that("methods get added ok", { startPack('testpack2') get_function...
/tests/testthat/test-packs.R
no_license
djacobs7/remembr
R
false
false
551
r
test_that("pack creation api", { pack_name = "samplePack" startPack(pack_name) addKeynameToPack("banana") addKeynameToPack("apple") finishPack(persist = FALSE) expect_setequal(c('banana', 'apple'), listPackKeys(pack_name)) }) test_that("methods get added ok", { startPack('testpack2') get_function...
testlist <- list(A = structure(c(1.38997190089718e-309, 3.81575932257023e-236, 3.81615289046554e-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/1613127397-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
226
r
testlist <- list(A = structure(c(1.38997190089718e-309, 3.81575932257023e-236, 3.81615289046554e-236), .Dim = c(1L, 3L)), B = structure(0, .Dim = c(1L, 1L))) result <- do.call(multivariance:::match_rows,testlist) str(result)
\name{addLabel} \alias{addLabel} \title{Node Labels} \description{ Add a label or multiple labels to an existing node object. } \usage{ addLabel(node, ...) } \arguments{ \item{node}{A node object to which to add the label(s).} \item{...}{The label(s) to add to the node. Accepts a string or strings separated by comm...
/man/addLabel.Rd
permissive
noelnamai/RNeo4j
R
false
false
656
rd
\name{addLabel} \alias{addLabel} \title{Node Labels} \description{ Add a label or multiple labels to an existing node object. } \usage{ addLabel(node, ...) } \arguments{ \item{node}{A node object to which to add the label(s).} \item{...}{The label(s) to add to the node. Accepts a string or strings separated by comm...
plot1 <- function(){ ## Read data from data frame file NEI <- readRDS("Data/summarySCC_PM25.rds") SCC <- readRDS("Data/Source_Classification_Code.rds") ## Calculate the total emission by year totalPM25 <- with(NEI, tapply(Emissions, year, sum, na.rm=TRUE)) ## Turn result into a data frame dataF...
/Assignment_2/plot1.R
no_license
jachen36/Coursera_4Exploratory
R
false
false
648
r
plot1 <- function(){ ## Read data from data frame file NEI <- readRDS("Data/summarySCC_PM25.rds") SCC <- readRDS("Data/Source_Classification_Code.rds") ## Calculate the total emission by year totalPM25 <- with(NEI, tapply(Emissions, year, sum, na.rm=TRUE)) ## Turn result into a data frame dataF...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/linear.R \name{linear} \alias{linear} \title{Linear "family" for rows.} \usage{ linear(tol = 1e-10) } \arguments{ \item{tol}{Numerical tolerance. Should be small.} } \description{ Allows us to encode a GLM with an extra linear term as a GLM....
/man/linear.Rd
no_license
sampeel/multispeciesPP
R
false
true
351
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/linear.R \name{linear} \alias{linear} \title{Linear "family" for rows.} \usage{ linear(tol = 1e-10) } \arguments{ \item{tol}{Numerical tolerance. Should be small.} } \description{ Allows us to encode a GLM with an extra linear term as a GLM....
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/list_datasets.R \name{list_datasets} \alias{list_datasets} \title{Get a vector of timeseries dataset names} \usage{ list_datasets(site_name, data_type = c("ts", "watershed"), with_ts_version = "rds", with_ts_archived = FALSE, limit = 10000)...
/man/list_datasets.Rd
permissive
berdaniera/mda.streams
R
false
true
1,248
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/list_datasets.R \name{list_datasets} \alias{list_datasets} \title{Get a vector of timeseries dataset names} \usage{ list_datasets(site_name, data_type = c("ts", "watershed"), with_ts_version = "rds", with_ts_archived = FALSE, limit = 10000)...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ife.R, R/imports.R \docType{package} \name{ife} \alias{ife} \title{ife} \usage{ ife( yname, gname, tname, idname, data, nife, xformla = ~1, zformla, ret_ife_regs = TRUE, anticipation = 0, cband = TRUE, alp = 0.05, bo...
/man/ife.Rd
no_license
bcallaway11/ife
R
false
true
2,325
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ife.R, R/imports.R \docType{package} \name{ife} \alias{ife} \title{ife} \usage{ ife( yname, gname, tname, idname, data, nife, xformla = ~1, zformla, ret_ife_regs = TRUE, anticipation = 0, cband = TRUE, alp = 0.05, bo...
#' Ids of @unimi-dse GitHub repositories #' #' A dataset containing the ids for the exam "Coding for Data Science and Data Management", R module (2019/2020). #' Master in Data Science and Economics, University of Milan. #' #' @format character vector of ids #' @source \url{https://github.com/unimi-dse} #' "repo"
/R/data.R
no_license
unimi-dse/15f07018
R
false
false
314
r
#' Ids of @unimi-dse GitHub repositories #' #' A dataset containing the ids for the exam "Coding for Data Science and Data Management", R module (2019/2020). #' Master in Data Science and Economics, University of Milan. #' #' @format character vector of ids #' @source \url{https://github.com/unimi-dse} #' "repo"
# based on: https://www.manning.com/books/deep-learning-with-r library(keras) library(rprojroot) library(tibble) library(readr) library(ggplot2) library(lubridate) library(dplyr) library(purrr) library(tidyr) library(zoo) library(stringr) setwd(file.path(find_root(criterion = is_rstudio_project), "timeseries")) sour...
/timeseries/weather_forecast_10minutely_data.R
no_license
skeydan/deep_learning_workshop
R
false
false
10,264
r
# based on: https://www.manning.com/books/deep-learning-with-r library(keras) library(rprojroot) library(tibble) library(readr) library(ggplot2) library(lubridate) library(dplyr) library(purrr) library(tidyr) library(zoo) library(stringr) setwd(file.path(find_root(criterion = is_rstudio_project), "timeseries")) sour...
#' Pipe #' #' Pipe an object forward into a function or call expression. #' #' @param lhs A value or the magrittr placeholder. #' @param rhs A function call using the magrittr semantics. #' @details #' \subsection{Using `%>%` with unary function calls}{ #' #' When functions require only one argument, `x %>% f` is eq...
/R/pipe.R
permissive
krlmlr/magrittr
R
false
false
10,210
r
#' Pipe #' #' Pipe an object forward into a function or call expression. #' #' @param lhs A value or the magrittr placeholder. #' @param rhs A function call using the magrittr semantics. #' @details #' \subsection{Using `%>%` with unary function calls}{ #' #' When functions require only one argument, `x %>% f` is eq...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/helpers.R \name{next_railroad} \alias{next_railroad} \title{Go to the next railroad} \usage{ next_railroad(current_square) } \arguments{ \item{current_square}{the index of the current square} } \value{ The square of the next railroad } \descr...
/man/next_railroad.Rd
permissive
mrkaye97/euleR
R
false
true
354
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/helpers.R \name{next_railroad} \alias{next_railroad} \title{Go to the next railroad} \usage{ next_railroad(current_square) } \arguments{ \item{current_square}{the index of the current square} } \value{ The square of the next railroad } \descr...
############################################################################## # ADC Data: Northern Permafrost CO2 flux synthesis # # Preliminary data preparation and exploration for October Workshop # # written by: Marguerite Mauritz, October 2018 # # ...
/ADC_data_December_AGU_2019.R
no_license
MargueriteM/ADC_CfluxSynth
R
false
false
18,808
r
############################################################################## # ADC Data: Northern Permafrost CO2 flux synthesis # # Preliminary data preparation and exploration for October Workshop # # written by: Marguerite Mauritz, October 2018 # # ...
# year: 2019 # author: Molo Muli # contact: molo.andrew@gmail.com # title: Prediciting Faultiness of Water Pumps in Tanzania. A competition hosted by DrivenData.org. # More info on this competition can be found here https://www.drivendata.org/competitions/7/pump-it-up-data-mining-the-water-table/page/23/. # libraries ...
/scripts/Functionality_Status.R
no_license
moloscripts/Pump-it-Up
R
false
false
5,627
r
# year: 2019 # author: Molo Muli # contact: molo.andrew@gmail.com # title: Prediciting Faultiness of Water Pumps in Tanzania. A competition hosted by DrivenData.org. # More info on this competition can be found here https://www.drivendata.org/competitions/7/pump-it-up-data-mining-the-water-table/page/23/. # libraries ...
# Split a vector into chunks equal size # x = vector; n = number of chunks chunk <- function(x, n){ split(x, cut(seq_along(x), n, labels = FALSE)) } ## for integer vector # n = 3 # split(x, sort(x%%n))
/R/chunk.R
permissive
vmikk/vmik
R
false
false
205
r
# Split a vector into chunks equal size # x = vector; n = number of chunks chunk <- function(x, n){ split(x, cut(seq_along(x), n, labels = FALSE)) } ## for integer vector # n = 3 # split(x, sort(x%%n))
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/annotations.R \docType{data} \name{anno_double_df} \alias{anno_double_df} \title{Simple annotation data.frame for double precision floating point values} \format{An object of class \code{spec_tbl_df} (inherits from \code{tbl_df}, \code{tbl}, ...
/man/anno_double_df.Rd
permissive
coolbutuseless/exhibitionist
R
false
true
500
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/annotations.R \docType{data} \name{anno_double_df} \alias{anno_double_df} \title{Simple annotation data.frame for double precision floating point values} \format{An object of class \code{spec_tbl_df} (inherits from \code{tbl_df}, \code{tbl}, ...
################################################################################ #' S&P 500: Standard and Poor's 500 stock index, 2007--2010 #' #' Contains the returns of the S&P 500 stock index for the years 2007--2010. #' The returns were computed as \code{(Adjusted.Close-Open)/Open}. #' #' The data was downloa...
/quantspec/R/data.R
no_license
ingted/R-Examples
R
false
false
2,538
r
################################################################################ #' S&P 500: Standard and Poor's 500 stock index, 2007--2010 #' #' Contains the returns of the S&P 500 stock index for the years 2007--2010. #' The returns were computed as \code{(Adjusted.Close-Open)/Open}. #' #' The data was downloa...
#**********************************************Anova 1 arah********************************************** #Pakai dataset chickwts table(chickwts$feed) #apakah rata-rata berat ayam berbeda menurut jenis makan? #apakah pakan ayam yang berbeda memberi efek yang berbeda? #Ho : rata-rata berat ayam yang diberi makan ...
/Hipotesis rata-rata k populasi.R
no_license
diazadha/Analisa-Data
R
false
false
6,309
r
#**********************************************Anova 1 arah********************************************** #Pakai dataset chickwts table(chickwts$feed) #apakah rata-rata berat ayam berbeda menurut jenis makan? #apakah pakan ayam yang berbeda memberi efek yang berbeda? #Ho : rata-rata berat ayam yang diberi makan ...
#A Shiny app for myMapp package #This app shows some functions of myMap package interactively. library(shiny) if("devtools" %in% rownames(installed.packages()) == FALSE) { install.packages("devtools")} if("myMap" %in% rownames(installed.packages()) == FALSE) { devtools::install_github("https://github.com/alieti...
/app.R
no_license
alieti/myMapShiny
R
false
false
1,661
r
#A Shiny app for myMapp package #This app shows some functions of myMap package interactively. library(shiny) if("devtools" %in% rownames(installed.packages()) == FALSE) { install.packages("devtools")} if("myMap" %in% rownames(installed.packages()) == FALSE) { devtools::install_github("https://github.com/alieti...
cacheSolve <- function(x, ...){ ## compute the inverse of the special "matrix" returned by makeCacheMatrix ## If the inverse has already been calculated (and the matrix has not changed) ## then the cachesolve retrieves the inverse from the cache. ## check if inverse is empty m <- x$getmatrix() if(!...
/cacheSolve.R
no_license
ekarakozoglou/PA2
R
false
false
905
r
cacheSolve <- function(x, ...){ ## compute the inverse of the special "matrix" returned by makeCacheMatrix ## If the inverse has already been calculated (and the matrix has not changed) ## then the cachesolve retrieves the inverse from the cache. ## check if inverse is empty m <- x$getmatrix() if(!...
library(httr) library(jsonlite) CREEDS_URL <- 'http://amp.pharm.mssm.edu/CREEDS/' response <- GET(paste0(CREEDS_URL, 'api'), query=list(id ='gene:84')) if (response$status_code == 200){ response <- fromJSON(httr::content(response, 'text')) print(response) }
/creeds/static/api3.R
permissive
MaayanLab/creeds
R
false
false
261
r
library(httr) library(jsonlite) CREEDS_URL <- 'http://amp.pharm.mssm.edu/CREEDS/' response <- GET(paste0(CREEDS_URL, 'api'), query=list(id ='gene:84')) if (response$status_code == 200){ response <- fromJSON(httr::content(response, 'text')) print(response) }
#' Compute Power for Failure Time Comparisons in Correlative Studies #' #' Computes power or difference for the logrank test for a correlative study #' comparing failure time distributions between groups defined by two levels of #' a correlative marker when there is a known amount of information (number of #' events) #...
/R/correl.power.R
no_license
raredd/desmon
R
false
false
5,688
r
#' Compute Power for Failure Time Comparisons in Correlative Studies #' #' Computes power or difference for the logrank test for a correlative study #' comparing failure time distributions between groups defined by two levels of #' a correlative marker when there is a known amount of information (number of #' events) #...
# This R script does the following: # 1. Merges the training and the test sets to create one data set. t1 <- read.table("train/X_train.txt") t2 <- read.table("test/X_test.txt") X <- rbind(t1, t2) t1 <- read.table("train/subject_train.txt") t2 <- read.table("test/subject_test.txt") S <- rbind(t1, t2) t1 <- read.tab...
/run_analysis.R
no_license
cschia87/Getting-and-Cleaning-Data
R
false
false
1,862
r
# This R script does the following: # 1. Merges the training and the test sets to create one data set. t1 <- read.table("train/X_train.txt") t2 <- read.table("test/X_test.txt") X <- rbind(t1, t2) t1 <- read.table("train/subject_train.txt") t2 <- read.table("test/subject_test.txt") S <- rbind(t1, t2) t1 <- read.tab...
library(tidyverse) library(ggplot2) library(expss) library(formattable) #rename the variables so they're more comprehensible names(shark) <- c("Row", "Season", "Number", "Company", "Deal", "Industry", "Gender", "Amount", "Equity", "Valuation", "Corcoran", "Cuban", "Greiner", "Herjavec", "Joh...
/shark tank.R
no_license
pkalkunte18/Shark-Tank
R
false
false
11,909
r
library(tidyverse) library(ggplot2) library(expss) library(formattable) #rename the variables so they're more comprehensible names(shark) <- c("Row", "Season", "Number", "Company", "Deal", "Industry", "Gender", "Amount", "Equity", "Valuation", "Corcoran", "Cuban", "Greiner", "Herjavec", "Joh...
landgenreport <- function(cats, fric.raster, #friction matrix gen.distance = "Gst.Nei", #Gst Hedrick, Gst_Nei, smouse, kosman, D, %allels shared NN=NULL, pathtype="leastcost", plotpat...
/R/landgenreport.r
no_license
tomatebio/PopGenReport
R
false
false
7,951
r
landgenreport <- function(cats, fric.raster, #friction matrix gen.distance = "Gst.Nei", #Gst Hedrick, Gst_Nei, smouse, kosman, D, %allels shared NN=NULL, pathtype="leastcost", plotpat...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bind_shadow.R \name{bind_shadow} \alias{bind_shadow} \title{Bind a shadow matrix to a data frame with NA values.} \usage{ bind_shadow(data, vars = dplyr::everything()) } \arguments{ \item{data}{A data frame with missing values.} \item{vars}{...
/man/bind_shadow.Rd
permissive
dsquire/imptools
R
false
true
509
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bind_shadow.R \name{bind_shadow} \alias{bind_shadow} \title{Bind a shadow matrix to a data frame with NA values.} \usage{ bind_shadow(data, vars = dplyr::everything()) } \arguments{ \item{data}{A data frame with missing values.} \item{vars}{...
library(ape) testtree <- read.tree("11119_0.txt") unrooted_tr <- unroot(testtree) write.tree(unrooted_tr, file="11119_0_unrooted.txt")
/codeml_files/newick_trees_processed_and_cleaned/11119_0/rinput.R
no_license
DaniBoo/cyanobacteria_project
R
false
false
137
r
library(ape) testtree <- read.tree("11119_0.txt") unrooted_tr <- unroot(testtree) write.tree(unrooted_tr, file="11119_0_unrooted.txt")
setup(options(lifecycle_verbosity = "quiet")) test_that("empty count.() returns number of rows", { test_df <- data.table(a = 1:3, b = 4:6, c = c("a", "a", "a"), d = c("a", "a", "b")) summary_df <- test_df %>% count.() expect_named(summary_df, c("N")) expect_equal(summary_df$N, nrow(test_df)) }) test_that...
/tests/testthat/test-count.R
permissive
Techwrekfix/tidytable
R
false
false
1,879
r
setup(options(lifecycle_verbosity = "quiet")) test_that("empty count.() returns number of rows", { test_df <- data.table(a = 1:3, b = 4:6, c = c("a", "a", "a"), d = c("a", "a", "b")) summary_df <- test_df %>% count.() expect_named(summary_df, c("N")) expect_equal(summary_df$N, nrow(test_df)) }) test_that...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/combine.R \name{combine.jags_model} \alias{combine.jags_model} \title{Add JAGS model objects} \usage{ \method{combine}{jags_model}(object, ...) } \arguments{ \item{object}{a \code{jags_model} object.} \item{...}{additional \code{jags_model} ...
/man/combine.jags_model.Rd
permissive
poissonconsulting/jaggernaut
R
false
true
564
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/combine.R \name{combine.jags_model} \alias{combine.jags_model} \title{Add JAGS model objects} \usage{ \method{combine}{jags_model}(object, ...) } \arguments{ \item{object}{a \code{jags_model} object.} \item{...}{additional \code{jags_model} ...
#' @title big.data.table-package #' @description Leverage data.table onto set of Rserve nodes. #' @details #' Use `as.big.data.table` methods to extract/load/assign/populate data to a list of R node connections. #' Methods for `function` and `call` will be evaluated remotely, method for `data.table` will be evaluated l...
/R/big.data.table.R
no_license
jangorecki/big.data.table
R
false
false
21,704
r
#' @title big.data.table-package #' @description Leverage data.table onto set of Rserve nodes. #' @details #' Use `as.big.data.table` methods to extract/load/assign/populate data to a list of R node connections. #' Methods for `function` and `call` will be evaluated remotely, method for `data.table` will be evaluated l...
# function to plot Monte Carlo simulation results plot_multivariate = function(list_in) { N = list_in$N if (list_in$N == 1) stop('Input cannot be a single iteration.') twos = 2^(7:17) ivec = c(twos[twos<N], N) mylen = length(ivec) # Bootstrap Colors: yellow, purple, orange, blue, teal, green, red...
/plot_multivariate.R
no_license
m-schiavoni/MultiplicativeErrorRegression
R
false
false
8,068
r
# function to plot Monte Carlo simulation results plot_multivariate = function(list_in) { N = list_in$N if (list_in$N == 1) stop('Input cannot be a single iteration.') twos = 2^(7:17) ivec = c(twos[twos<N], N) mylen = length(ivec) # Bootstrap Colors: yellow, purple, orange, blue, teal, green, red...
# script to follow for Cramer's lab to construct WGCNA networks for microarray analysis # firt load the necessary libraries - already installed here library(WGCNA) library(cluster) options(stringAsFactors=F) # always a good idea to set your directory # but if you are using R studio and create a new project, the direct...
/WGCNA_R/R/script.R
no_license
thangnx1012/TCGA_METABRIC
R
false
false
24,975
r
# script to follow for Cramer's lab to construct WGCNA networks for microarray analysis # firt load the necessary libraries - already installed here library(WGCNA) library(cluster) options(stringAsFactors=F) # always a good idea to set your directory # but if you are using R studio and create a new project, the direct...
library("EBImage") #i755 = readImage("data/7.55.jpg") #i755 = resize(i755,300) #i755_data = imageData(i755) # iWidth = nrow(i755_data) # iWidth3 = as.integer(iWidth/3) # iHeight = ncol(i755_data) # iHeight3= as.integer(iHeight/3) # # kern = i755_data[iWidth3:(2*iWidth3),iHeight3:(2*iHeight3),] extractRGB <- fun...
/Hackaton/t1.R
no_license
mpricope/kaggle
R
false
false
1,528
r
library("EBImage") #i755 = readImage("data/7.55.jpg") #i755 = resize(i755,300) #i755_data = imageData(i755) # iWidth = nrow(i755_data) # iWidth3 = as.integer(iWidth/3) # iHeight = ncol(i755_data) # iHeight3= as.integer(iHeight/3) # # kern = i755_data[iWidth3:(2*iWidth3),iHeight3:(2*iHeight3),] extractRGB <- fun...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/moran.R \name{moran} \alias{moran} \title{Computes Moran's I correlation index} \usage{ moran(x, w, normalize.w = TRUE) } \arguments{ \item{x}{Numeric vector of size \eqn{n}.} \item{w}{Numeric matrix of size \eqn{n\times n}{n * n}. Weights. ...
/man/moran.Rd
no_license
haanns/netdiffuseR
R
false
true
1,700
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/moran.R \name{moran} \alias{moran} \title{Computes Moran's I correlation index} \usage{ moran(x, w, normalize.w = TRUE) } \arguments{ \item{x}{Numeric vector of size \eqn{n}.} \item{w}{Numeric matrix of size \eqn{n\times n}{n * n}. Weights. ...
# Shiny dashboard with all my apps library(shiny) library(shinydashboard) library(shinyjs) library(ggplot2) library(shinyBS) shinyServer <- function(input, output) { output$summary <- renderText( getSummary() ) }
/old/someapps/server.R
no_license
OldMortality/shinies
R
false
false
228
r
# Shiny dashboard with all my apps library(shiny) library(shinydashboard) library(shinyjs) library(ggplot2) library(shinyBS) shinyServer <- function(input, output) { output$summary <- renderText( getSummary() ) }
################################################################################################### # Author: Enrico Mattea (@unifr.ch) # # Description: this program models the distributed mass balance of a glacier at daily # # re...
/functions/func_load_surftype_grids.R
no_license
pohleric/mass_balance_model
R
false
false
2,366
r
################################################################################################### # Author: Enrico Mattea (@unifr.ch) # # Description: this program models the distributed mass balance of a glacier at daily # # re...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/calc_events_and_duration.R \name{exp_duration} \alias{exp_duration} \title{Expected duration} \usage{ exp_duration(arm0 = NA, arm1 = NA, d, search_start = 10, search_prec = 0.01, max_duration = 1000) } \arguments{ \item{arm0}{obje...
/man/exp_duration.Rd
no_license
cran/npsurvSS
R
false
true
1,358
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/calc_events_and_duration.R \name{exp_duration} \alias{exp_duration} \title{Expected duration} \usage{ exp_duration(arm0 = NA, arm1 = NA, d, search_start = 10, search_prec = 0.01, max_duration = 1000) } \arguments{ \item{arm0}{obje...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/calc.S.R \name{calc.S} \alias{calc.S} \title{Calculate standard deviation} \usage{ calc.S(x) } \arguments{ \item{x}{Vector of indicator values.} } \description{ Calculate standard deviation }
/man/calc.S.Rd
no_license
dataspekt/crodi
R
false
true
270
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/calc.S.R \name{calc.S} \alias{calc.S} \title{Calculate standard deviation} \usage{ calc.S(x) } \arguments{ \item{x}{Vector of indicator values.} } \description{ Calculate standard deviation }
#---------------------------------------------------------------------------- # RSuite # Copyright (c) 2017, WLOG Solutions # # Tools for project management during testing. #---------------------------------------------------------------------------- init_test_project <- function(repo_adapters = c("Dir")) { RSuite::...
/tests/R/project_management.R
permissive
gitter-badger/RSuite-1
R
false
false
4,817
r
#---------------------------------------------------------------------------- # RSuite # Copyright (c) 2017, WLOG Solutions # # Tools for project management during testing. #---------------------------------------------------------------------------- init_test_project <- function(repo_adapters = c("Dir")) { RSuite::...
## Tests for print function library(ranger) context("ranger_print") ## Initialize the random forest rf <- ranger(Species ~ ., iris, num.trees = 5, write.forest = TRUE) ## Test print ranger function expect_that(print(rf), prints_text("Ranger result")) ## Test print forest function expect_that(print(rf$forest), print...
/tests/testthat/test_print.R
no_license
jailGroup/RangerBasediRF
R
false
false
620
r
## Tests for print function library(ranger) context("ranger_print") ## Initialize the random forest rf <- ranger(Species ~ ., iris, num.trees = 5, write.forest = TRUE) ## Test print ranger function expect_that(print(rf), prints_text("Ranger result")) ## Test print forest function expect_that(print(rf$forest), print...
### Descriptive statistics ### # Author: Daniel Vader library(meta) library(tidyr) library(ggplot2) library(ggpubr) ### Import data and setup variables ### hbsdat <- read.csv("data/antihbs_spec_dat.csv") names(hbsdat)[1] <- c("authors") # CSV file saved this column name badly # Combine author and year i...
/2_desc-pub.R
no_license
daniel-vader/hepb-immune-prev-us
R
false
false
10,833
r
### Descriptive statistics ### # Author: Daniel Vader library(meta) library(tidyr) library(ggplot2) library(ggpubr) ### Import data and setup variables ### hbsdat <- read.csv("data/antihbs_spec_dat.csv") names(hbsdat)[1] <- c("authors") # CSV file saved this column name badly # Combine author and year i...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/clean_fread_tibble.R \name{clean_fread_tibble} \alias{clean_fread_tibble} \title{Read, clean and convert} \usage{ clean_fread_tibble(filename, ...) } \arguments{ \item{filename}{The path to the file that should be imported.} \item{...}{Addit...
/man/clean_fread_tibble.Rd
no_license
jpquast/functions.jp
R
false
true
974
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/clean_fread_tibble.R \name{clean_fread_tibble} \alias{clean_fread_tibble} \title{Read, clean and convert} \usage{ clean_fread_tibble(filename, ...) } \arguments{ \item{filename}{The path to the file that should be imported.} \item{...}{Addit...
filepath <- "../Abalone" dataset <- "Abalone" get_eztune_results <- function(filepath, dataset, type) { allF <- list.files(filepath, pattern = type) dat <- NULL for(i in 1:length(allF)) { tmp <- paste(filepath, "/", allF[i], sep = "") tmp_dat <- read.csv(tmp) for(j in 1:5) { dat[,...
/EZtune/Analyze EZtune Test Results/get_eztune_results.R
no_license
jillbo1000/Dissertation-code
R
false
false
692
r
filepath <- "../Abalone" dataset <- "Abalone" get_eztune_results <- function(filepath, dataset, type) { allF <- list.files(filepath, pattern = type) dat <- NULL for(i in 1:length(allF)) { tmp <- paste(filepath, "/", allF[i], sep = "") tmp_dat <- read.csv(tmp) for(j in 1:5) { dat[,...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/suncalculator.R \name{LSTM} \alias{LSTM} \title{Local Standard Time Meridian} \usage{ LSTM(delta) } \arguments{ \item{delta}{The difference of the Local Time (LT) from Greenwich Mean Time (GMT) in hours} } \value{ Local Standard Time Meridian...
/man/LSTM.Rd
permissive
DrRoad/ShinySolarCalculator
R
false
true
459
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/suncalculator.R \name{LSTM} \alias{LSTM} \title{Local Standard Time Meridian} \usage{ LSTM(delta) } \arguments{ \item{delta}{The difference of the Local Time (LT) from Greenwich Mean Time (GMT) in hours} } \value{ Local Standard Time Meridian...
/Practicas_TareasU2/Practica4.r
no_license
manuelorozcotoro/Mineria_De_Datos
R
false
false
4,901
r
#' Iowa Gambling Task (Ahn et al., 2008) #' #' @description #' Hierarchical Bayesian Modeling of the Iowa Gambling Task using the following parameters: "A" (learning rate), "alpha" (outcome sensitivity), "cons" (response consistency), and "lambda" (loss aversion). #' #' \strong{MODEL:} #' Prospect Valence Learning (...
/R/igt_pvl_delta.R
no_license
cogneuro/hBayesDM
R
false
false
16,491
r
#' Iowa Gambling Task (Ahn et al., 2008) #' #' @description #' Hierarchical Bayesian Modeling of the Iowa Gambling Task using the following parameters: "A" (learning rate), "alpha" (outcome sensitivity), "cons" (response consistency), and "lambda" (loss aversion). #' #' \strong{MODEL:} #' Prospect Valence Learning (...
## Send a post or put request to Synapse ## ## Author: Matthew D. Furia <matt.furia@sagebase.org> ############################################################################### .synapsePostPut <- function( uri, entity, endpoint, requestMethod, curlHandle = getCurlHandle(), anonymous =...
/R/synapsePostPut.R
no_license
nishanthmerwin/rSynapseClient
R
false
false
3,275
r
## Send a post or put request to Synapse ## ## Author: Matthew D. Furia <matt.furia@sagebase.org> ############################################################################### .synapsePostPut <- function( uri, entity, endpoint, requestMethod, curlHandle = getCurlHandle(), anonymous =...
## ---- fig.width=4, fig.height=4, fig.align='center', echo=FALSE---------- library(moko) true_ps <- nowacki_beam_tps par(mar=c(3,2.5,0.5,0.5)+0.1, mgp = c(1.75, 0.5, 0)) plot(true_ps$set, pch=20, xlab = expression(paste("Area [mm"^"2"*"]")), ylab='Bending Stress [MPa]', col='blue', cex=0.2) ## -----------------...
/data/genthat_extracted_code/moko/vignettes/nb_vignette.R
no_license
surayaaramli/typeRrh
R
false
false
2,556
r
## ---- fig.width=4, fig.height=4, fig.align='center', echo=FALSE---------- library(moko) true_ps <- nowacki_beam_tps par(mar=c(3,2.5,0.5,0.5)+0.1, mgp = c(1.75, 0.5, 0)) plot(true_ps$set, pch=20, xlab = expression(paste("Area [mm"^"2"*"]")), ylab='Bending Stress [MPa]', col='blue', cex=0.2) ## -----------------...
library(ape) testtree <- read.tree("10506_0.txt") unrooted_tr <- unroot(testtree) write.tree(unrooted_tr, file="10506_0_unrooted.txt")
/codeml_files/newick_trees_processed/10506_0/rinput.R
no_license
DaniBoo/cyanobacteria_project
R
false
false
137
r
library(ape) testtree <- read.tree("10506_0.txt") unrooted_tr <- unroot(testtree) write.tree(unrooted_tr, file="10506_0_unrooted.txt")
source("submitscript1.R") submit()
/Rprogramming/assignment1/mysubmit.R
no_license
carolcoder/datasciencecoursera
R
false
false
35
r
source("submitscript1.R") submit()
setwd("c:\\pending\\work") library("tm") library("SnowballC") library("wordcloud") library("RColorBrewer") library("dplyr") library("KoNLP") useNIADic() filePath <- "issue_2017.txt" text <- readLines(filePath) df <- do.call("rbind", lapply(text, as.data.frame)) df <- rename(df,text=`X[[i]]`) rem...
/excercise_word_relations.R
permissive
KwanghoWoo/TextMining
R
false
false
11,405
r
setwd("c:\\pending\\work") library("tm") library("SnowballC") library("wordcloud") library("RColorBrewer") library("dplyr") library("KoNLP") useNIADic() filePath <- "issue_2017.txt" text <- readLines(filePath) df <- do.call("rbind", lapply(text, as.data.frame)) df <- rename(df,text=`X[[i]]`) rem...
#' Spread a key-value pair across multiple columns #' #' @description #' Development on `spread()` is complete, and for new code we recommend #' switching to `pivot_wider()`, which is easier to use, more featureful, and #' still under active development. #' `df %>% spread(key, value)` is equivalent to #' `df %>% pivot_...
/R/spread.R
permissive
ha0ye/tidyr
R
false
false
5,882
r
#' Spread a key-value pair across multiple columns #' #' @description #' Development on `spread()` is complete, and for new code we recommend #' switching to `pivot_wider()`, which is easier to use, more featureful, and #' still under active development. #' `df %>% spread(key, value)` is equivalent to #' `df %>% pivot_...
typeMap <- list() typeMap[[INTEGER]] <- integer(0) typeMap[[DOUBLE]] <- double(0) typeMap[[BOOLEAN]] <- integer(0) typeMap[[STRING]] <- character(0) .onAttach <- function(libname, pkgname) { }
/r/R/rzeppelin/R/zzz.R
permissive
milooy/zeppelin
R
false
false
195
r
typeMap <- list() typeMap[[INTEGER]] <- integer(0) typeMap[[DOUBLE]] <- double(0) typeMap[[BOOLEAN]] <- integer(0) typeMap[[STRING]] <- character(0) .onAttach <- function(libname, pkgname) { }
#' MODA #' #'A Coexpression based algorithm to identify disease module #' #' @param datExpr1 A dataframe of the microarray matrix of the Control samples #' @param datExpr2 A dataframe of the microarray matrix of the Control samples #' @export moda <- function(datExpr1, datExpr2, CuttingCriterion = "De...
/ModifieR/RCode/R/moda.R
no_license
Zelmina/ModifierProject
R
false
false
4,340
r
#' MODA #' #'A Coexpression based algorithm to identify disease module #' #' @param datExpr1 A dataframe of the microarray matrix of the Control samples #' @param datExpr2 A dataframe of the microarray matrix of the Control samples #' @export moda <- function(datExpr1, datExpr2, CuttingCriterion = "De...
library(benr2) context("Numbers OK") test_that("answers are correct",{ expect_equal(RP(3,2), 9) expect_less_than(roll(1:10), 25) expect_more_than(roll(), 1) #expect_that(roll(dietype = 1:6), gives_warning("standard dice")) #expect_that(roll(dietype = 21:26), gives_warning("non-standard dice")) #expect_mor...
/tests/testthat/testValue.R
no_license
benjones2/benr2
R
false
false
402
r
library(benr2) context("Numbers OK") test_that("answers are correct",{ expect_equal(RP(3,2), 9) expect_less_than(roll(1:10), 25) expect_more_than(roll(), 1) #expect_that(roll(dietype = 1:6), gives_warning("standard dice")) #expect_that(roll(dietype = 21:26), gives_warning("non-standard dice")) #expect_mor...
if (!require("pacman")) install.packages("pacman") pacman::p_load( lhs, gridExtra,stringr, parallel, factoextra, shiny, shinydashboard, DT, robustbase, data.table, htmlwidgets, parallel, lhs, ggplot2, rstudioapi, boot, dplyr, rhandsontable, RColorBrewer,wordcloud,tm,twitteR,ROAuth,plyr,stringr,base64enc, NLP,sy...
/TwitExplorer/data/pcg.R
no_license
tim7en/ShinyTwit-Library-Collector
R
false
false
1,466
r
if (!require("pacman")) install.packages("pacman") pacman::p_load( lhs, gridExtra,stringr, parallel, factoextra, shiny, shinydashboard, DT, robustbase, data.table, htmlwidgets, parallel, lhs, ggplot2, rstudioapi, boot, dplyr, rhandsontable, RColorBrewer,wordcloud,tm,twitteR,ROAuth,plyr,stringr,base64enc, NLP,sy...
###Using data from "FaST-LMM_for_one_locus_effects.R", this code is used to identify one-locus effects with significant effect on fitness. ###For each one-locus effect, the peak position as well as the 95% confidence intervals of the locus were found. ###Written for R ###################################################...
/Supplemental_codes/Calling_peaks_positions_of_one_locus_effects.R
no_license
tmatsui2/Matsui-et-al.-2021-Supplemental-Information
R
false
false
4,931
r
###Using data from "FaST-LMM_for_one_locus_effects.R", this code is used to identify one-locus effects with significant effect on fitness. ###For each one-locus effect, the peak position as well as the 95% confidence intervals of the locus were found. ###Written for R ###################################################...
# repair an SPC by breaking into pieces and re-assembling # likely only used to fix outdated SPC objects that are missing slots #' Rebuild a SoilProfileCollection object #' #' Rebuild a SoilProfileCollection object #' #' Attempt rebuilding a \code{SoilProfileCollection} object by splitting into #' components a...
/R/rebuildSPC.R
no_license
cran/aqp
R
false
false
3,540
r
# repair an SPC by breaking into pieces and re-assembling # likely only used to fix outdated SPC objects that are missing slots #' Rebuild a SoilProfileCollection object #' #' Rebuild a SoilProfileCollection object #' #' Attempt rebuilding a \code{SoilProfileCollection} object by splitting into #' components a...
#' Get CoAgMet Data #' #' @param table A character specifying which data table to get. Can be one of #' \code{"meta", "daily", "hourly", "five_minute", "soilmoisture_daily", "soilmoisture_hourly"}. #' @param stations An optional vector of weather station names to get data for. #' See \url{https://coagmet.colosta...
/R/get-coagmet-data.R
permissive
gacolitti/coagmetr
R
false
false
4,752
r
#' Get CoAgMet Data #' #' @param table A character specifying which data table to get. Can be one of #' \code{"meta", "daily", "hourly", "five_minute", "soilmoisture_daily", "soilmoisture_hourly"}. #' @param stations An optional vector of weather station names to get data for. #' See \url{https://coagmet.colosta...
rm(list=ls(all=T)) library(beepr) setwd("C:/Users/exr0005/Desktop/FAs")##Will have to change to proper directory data14<-read.csv("2014FA.csv", header=TRUE)##Will have to change to proper file data15<-read.csv("2015FA.csv", header=TRUE)##Will have to change to proper file data16<-read.csv("2016FA.csv", header=TRUE...
/MetricPulling.R
no_license
err1668/MetricPulling
R
false
false
53,342
r
rm(list=ls(all=T)) library(beepr) setwd("C:/Users/exr0005/Desktop/FAs")##Will have to change to proper directory data14<-read.csv("2014FA.csv", header=TRUE)##Will have to change to proper file data15<-read.csv("2015FA.csv", header=TRUE)##Will have to change to proper file data16<-read.csv("2016FA.csv", header=TRUE...
library(testthat) test_that("viz_pcacm works", { vdiffr::expect_doppelganger( "viz_pcacm simple", viz_pcacm(mtcars), "viz_pcacm" ) vdiffr::expect_doppelganger( "viz_pcacm components", viz_pcacm(mtcars, n_pca = 4), "viz_pcacm" ) vdiffr::expect_doppelganger( "viz_pcacm loadings", ...
/tests/testthat/test-viz_pcacm.R
permissive
EmilHvitfeldt/horus
R
false
false
511
r
library(testthat) test_that("viz_pcacm works", { vdiffr::expect_doppelganger( "viz_pcacm simple", viz_pcacm(mtcars), "viz_pcacm" ) vdiffr::expect_doppelganger( "viz_pcacm components", viz_pcacm(mtcars, n_pca = 4), "viz_pcacm" ) vdiffr::expect_doppelganger( "viz_pcacm loadings", ...
#!/usr/bin/env Rscript USAGE <- "Usage: $ fitdist2.R families.counts.tsv [outdir]" IMG_WIDTH = 1280 IMG_HEIGHT = 960 FONT_SIZE = 18 # Get arguments. args <- commandArgs(trailingOnly=TRUE) if (length(args) < 1 || args[1] == '-h') { print(paste(USAGE), quote=FALSE) quit() } infile <- args[1] if (length(args) >= 2) { ...
/duplex/fitdist2.R
no_license
makovalab-psu/nick-singletons
R
false
false
956
r
#!/usr/bin/env Rscript USAGE <- "Usage: $ fitdist2.R families.counts.tsv [outdir]" IMG_WIDTH = 1280 IMG_HEIGHT = 960 FONT_SIZE = 18 # Get arguments. args <- commandArgs(trailingOnly=TRUE) if (length(args) < 1 || args[1] == '-h') { print(paste(USAGE), quote=FALSE) quit() } infile <- args[1] if (length(args) >= 2) { ...
prepareFile <- function(filename){ require(sqldf) # install.packages("sqldf") if missing df <- read.csv.sql(file = filename,header = TRUE, sql = "select * from file where Date='1/2/2007' or Date='2/2/2007'",sep=";") df[,1] <- as.Date(df[,1],"%d/%m/%Y") df } generatePlot1 <-function(df){ hist(df$Global_activ...
/plot1.R
no_license
stankiewicz/ExData_Plotting1
R
false
false
513
r
prepareFile <- function(filename){ require(sqldf) # install.packages("sqldf") if missing df <- read.csv.sql(file = filename,header = TRUE, sql = "select * from file where Date='1/2/2007' or Date='2/2/2007'",sep=";") df[,1] <- as.Date(df[,1],"%d/%m/%Y") df } generatePlot1 <-function(df){ hist(df$Global_activ...
################################ #### Spatial median #### Tsagris Michail 10/2014 #### References: Jyrki Mottonen, Klaus Nordhausen and Hannu Oja (2010) #### Asymptotic theory of the spatial median #### In Nonparametrics and Robustness in Modern Statistical Inference and Time Series #### Analysis: A Festschri...
/Compositional/R/spat.med.R
no_license
ingted/R-Examples
R
false
false
1,271
r
################################ #### Spatial median #### Tsagris Michail 10/2014 #### References: Jyrki Mottonen, Klaus Nordhausen and Hannu Oja (2010) #### Asymptotic theory of the spatial median #### In Nonparametrics and Robustness in Modern Statistical Inference and Time Series #### Analysis: A Festschri...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RcppExports.R \name{sample_double} \alias{sample_double} \title{Sample single double from range.} \usage{ sample_double(from, to) } \arguments{ \item{from}{Starting double (inclusive)} \item{to}{End double (inclusive)} } \descri...
/man/sample_double.Rd
no_license
covid19UNGS/siR
R
false
true
365
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RcppExports.R \name{sample_double} \alias{sample_double} \title{Sample single double from range.} \usage{ sample_double(from, to) } \arguments{ \item{from}{Starting double (inclusive)} \item{to}{End double (inclusive)} } \descri...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/simulation-results.R \name{summarizePower} \alias{summarizePower} \title{summerize power.} \usage{ summarizePower(path, setup, showcol, case) } \arguments{ \item{path}{where the simulated p-value matrix locates.} \item{setup}{if it's group I...
/meaca/meaca_for_paper/meaca/man/summarizePower.Rd
no_license
TinyOpen/EnrichmentAnalysis
R
false
true
513
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/simulation-results.R \name{summarizePower} \alias{summarizePower} \title{summerize power.} \usage{ summarizePower(path, setup, showcol, case) } \arguments{ \item{path}{where the simulated p-value matrix locates.} \item{setup}{if it's group I...
library(RODBC) channel=odbcConnect("mysqlodbc", uid="root", pwd="") no2_time_submit=sqlFetch(channel,"no1b") library(zoo) library(xts) ss.data<-as.POSIXct(no2_time_submit$when) ss<-xts(no2_time_submit[1,],ss.data) dygraph(ss, main = "times") %>% dyRangeSelector(dateWindow = c("2000-10-01", "2015-01-01"))
/firsst/r script/no1-time-bug_id.R
no_license
melo078/learngit
R
false
false
307
r
library(RODBC) channel=odbcConnect("mysqlodbc", uid="root", pwd="") no2_time_submit=sqlFetch(channel,"no1b") library(zoo) library(xts) ss.data<-as.POSIXct(no2_time_submit$when) ss<-xts(no2_time_submit[1,],ss.data) dygraph(ss, main = "times") %>% dyRangeSelector(dateWindow = c("2000-10-01", "2015-01-01"))
# Need to iterate throught the clipped up versions of Z* and Z* Uncertainty # Import as a raster, then as a data.frame # Get summary statistics # Median, Mean, s.d., n, Q97.5, 75, 25, 2.5%, min and max # Add all points to a data frame if under a certain number, randomly sample a subset if above. library(raster) libra...
/R/analysis/Sample Z-star and Uncertainty by Watershed.R
no_license
Smithsonian/z-star-mapping
R
false
false
5,755
r
# Need to iterate throught the clipped up versions of Z* and Z* Uncertainty # Import as a raster, then as a data.frame # Get summary statistics # Median, Mean, s.d., n, Q97.5, 75, 25, 2.5%, min and max # Add all points to a data frame if under a certain number, randomly sample a subset if above. library(raster) libra...
corr <- function(directory, threshold = 0) { files_list <- list.files(directory, full.names = TRUE) comp_data <- complete(directory, 1:332) count <- 0 vec_cor <- vector("numeric") for (i in 1:332){ if (comp_data$nobs[i] > threshold) { count <- co...
/R_Programming/Programming_Assignment_1/corr.R
no_license
amine255/Coursera_Data_Science_Specialization
R
false
false
2,514
r
corr <- function(directory, threshold = 0) { files_list <- list.files(directory, full.names = TRUE) comp_data <- complete(directory, 1:332) count <- 0 vec_cor <- vector("numeric") for (i in 1:332){ if (comp_data$nobs[i] > threshold) { count <- co...
#Growth url path to references #Species page http://www.fishbase.org/PopDyn/PopGrowthList.php?ID=22903 #To many trait pages http://www.fishbase.org/PopDyn/FishPopGrowthSummary.php?ID=18177 #To main ref page http://www.fishbase.org/References/FBRefSummary.php?ID=75334 #read in html list species.list <- readLines(file.c...
/Growth.R
no_license
SimonCBrown/FBScrape
R
false
false
587
r
#Growth url path to references #Species page http://www.fishbase.org/PopDyn/PopGrowthList.php?ID=22903 #To many trait pages http://www.fishbase.org/PopDyn/FishPopGrowthSummary.php?ID=18177 #To main ref page http://www.fishbase.org/References/FBRefSummary.php?ID=75334 #read in html list species.list <- readLines(file.c...
/Code.R
no_license
datascience-mobi/project-05-group-01
R
false
false
16,784
r
source("https://bioconductor.org/biocLite.R") bertie = read.csv("~/Dropbox/Work/Cambridge/UCLhack/bertie.csv") bertie[1:5, 1:5] library(devtools) install_github("satijalab/seurat") library(Seurat)
/prep.R
no_license
asazonov/dssc-c1
R
false
false
199
r
source("https://bioconductor.org/biocLite.R") bertie = read.csv("~/Dropbox/Work/Cambridge/UCLhack/bertie.csv") bertie[1:5, 1:5] library(devtools) install_github("satijalab/seurat") library(Seurat)
library(glmnet) mydata = read.table("../../../../TrainingSet/FullSet/ReliefF/stomach.csv",head=T,sep=",") x = as.matrix(mydata[,4:ncol(mydata)]) y = as.matrix(mydata[,1]) set.seed(123) glm = cv.glmnet(x,y,nfolds=10,type.measure="mae",alpha=0.04,family="gaussian",standardize=FALSE) sink('./stomach_020.txt',append=TRUE) ...
/Model/EN/ReliefF/stomach/stomach_020.R
no_license
esbgkannan/QSMART
R
false
false
349
r
library(glmnet) mydata = read.table("../../../../TrainingSet/FullSet/ReliefF/stomach.csv",head=T,sep=",") x = as.matrix(mydata[,4:ncol(mydata)]) y = as.matrix(mydata[,1]) set.seed(123) glm = cv.glmnet(x,y,nfolds=10,type.measure="mae",alpha=0.04,family="gaussian",standardize=FALSE) sink('./stomach_020.txt',append=TRUE) ...
#' Learn graph structure using the independence-based approach #' @param data0 dataframe; the data. #' @param method One of 'random', 'correlation', 'mutual' and 'copula". #' @export learn_graph_by_independence_CD <- function(data0, method) { r_matrix <- data0 %>% compute_distance_matrix(method = method) %>% ...
/R/CD_independence_test.R
no_license
kcf-jackson/glmGraph
R
false
false
1,232
r
#' Learn graph structure using the independence-based approach #' @param data0 dataframe; the data. #' @param method One of 'random', 'correlation', 'mutual' and 'copula". #' @export learn_graph_by_independence_CD <- function(data0, method) { r_matrix <- data0 %>% compute_distance_matrix(method = method) %>% ...
context("pretty") test_that("pretty works with json inputs", { a <- geojson_json(c(-99.74,32.45)) %>% pretty expect_is(a, "json") expect_is(unclass(a), "character") expect_false(identical(a, geojson_json(c(-99.74,32.45), pretty = TRUE))) }) test_that("pretty fails correctly with geo_list inputs", { expect_e...
/tests/testthat/test-pretty.R
permissive
Zwens/geojsonio
R
false
false
420
r
context("pretty") test_that("pretty works with json inputs", { a <- geojson_json(c(-99.74,32.45)) %>% pretty expect_is(a, "json") expect_is(unclass(a), "character") expect_false(identical(a, geojson_json(c(-99.74,32.45), pretty = TRUE))) }) test_that("pretty fails correctly with geo_list inputs", { expect_e...
# Title: Generate Compass Plots # Author: Emma K. Costa # Date: code compiled on 20220822 # Related publication: Andrew McKay, Emma K. Costa, and Jingxun Chen, eLife, 2022 library(ggplot2) library(dplyr) library(ggpubr) library(tidyverse) library(hrbrthemes) library(viridis) library(sf) library(grid) library(dplyr) l...
/Fig6_SuppFig6/Rscripts/3_CompassPlot_SuppFig6.R
permissive
emkcosta/KillifishAutomaticFeederPaper
R
false
false
5,007
r
# Title: Generate Compass Plots # Author: Emma K. Costa # Date: code compiled on 20220822 # Related publication: Andrew McKay, Emma K. Costa, and Jingxun Chen, eLife, 2022 library(ggplot2) library(dplyr) library(ggpubr) library(tidyverse) library(hrbrthemes) library(viridis) library(sf) library(grid) library(dplyr) l...
#========================================================================================= # Script written by Ben Palmer - 03 Aug 2014 # This code performs the following tasks # 1. Call GetData.R script if the source data set does not exist (power.con) # 2. Generate a Historgram displaying Global Active Power by F...
/plot1.R
no_license
Diggler33/ExData_Plotting1
R
false
false
1,677
r
#========================================================================================= # Script written by Ben Palmer - 03 Aug 2014 # This code performs the following tasks # 1. Call GetData.R script if the source data set does not exist (power.con) # 2. Generate a Historgram displaying Global Active Power by F...
############################################################################# ## Run custom read preprocessing functions with systemPipeR infrastructure ## ############################################################################# preprocessReads <- function(args, Fct, batchsize=100000, overwrite=TRUE, ...) { if(cl...
/R/utilities.R
no_license
parthasen/systemPipeR
R
false
false
14,772
r
############################################################################# ## Run custom read preprocessing functions with systemPipeR infrastructure ## ############################################################################# preprocessReads <- function(args, Fct, batchsize=100000, overwrite=TRUE, ...) { if(cl...
test_that("vpt_diff_of_means", { # Difference-of-means, after removing RTs below 200 ms or above 520 ms, on a VPT dataset library(splithalfr) # Example VPT data (in JASMIN1 format) data("ds_vpt", package = "splithalfr") # ds_aat is data.frame of correct row count? expect_is(ds_vpt, "data.frame...
/tests/testthat/test-vpt_diff_of_means.R
no_license
cran/splithalfr
R
false
false
2,129
r
test_that("vpt_diff_of_means", { # Difference-of-means, after removing RTs below 200 ms or above 520 ms, on a VPT dataset library(splithalfr) # Example VPT data (in JASMIN1 format) data("ds_vpt", package = "splithalfr") # ds_aat is data.frame of correct row count? expect_is(ds_vpt, "data.frame...
#' @srrstats {G5.4a} *Testing of leaf assignment implementation is done by comparing results from an initial R implementation to the C++ implementation.* #' @srrstats {G5.5} *Correctness tests are run with a fixed random seed* set.seed(1) formula <- Surv(time, status) ~ . - id aorsf <- orsf( formula = formula, da...
/tests/testthat/test-ostree_pred_leaf.R
permissive
ropensci/aorsf
R
false
false
1,629
r
#' @srrstats {G5.4a} *Testing of leaf assignment implementation is done by comparing results from an initial R implementation to the C++ implementation.* #' @srrstats {G5.5} *Correctness tests are run with a fixed random seed* set.seed(1) formula <- Surv(time, status) ~ . - id aorsf <- orsf( formula = formula, da...
## Bethany Levick, University of Liverpool 2013 ## ## Code to set up environment to run binary model of occupancy ## ## delete duplicate row in main data frame dat <- dat[-2349,] ################################################################################################################################### ## set u...
/occupancy-setup.r
no_license
BethLevick/perfect-burrow
R
false
false
3,965
r
## Bethany Levick, University of Liverpool 2013 ## ## Code to set up environment to run binary model of occupancy ## ## delete duplicate row in main data frame dat <- dat[-2349,] ################################################################################################################################### ## set u...
pollutantmean <- function(directory ,pollutant,id=1:332) { #Form File name filelist <- sprintf("%03d.csv",id) # Get file path combinging directory and the file filedir <- file.path(directory,filelist) # use lapply over the seq to read every thing in to one datastr...
/pollutantmean.R
no_license
mominmr/Assignment_2
R
false
false
627
r
pollutantmean <- function(directory ,pollutant,id=1:332) { #Form File name filelist <- sprintf("%03d.csv",id) # Get file path combinging directory and the file filedir <- file.path(directory,filelist) # use lapply over the seq to read every thing in to one datastr...
c DCNF-Autarky [version 0.0.1]. c Copyright (c) 2018-2019 Swansea University. c c Input Clause Count: 345245 c Performing E1-Autarky iteration. c Remaining clauses count after E-Reduction: 316980 c c Performing E1-Autarky iteration. c Remaining clauses count after E-Reduction: 316980 c c Input Parameter (command lin...
/code/dcnf-ankit-optimized/Results/QBFLIB-2018/E1/Experiments/Kronegger-Pfandler-Pichler/dungeon/dungeon_i25-m12-u3-v0.pddl_planlen=51/dungeon_i25-m12-u3-v0.pddl_planlen=51.R
no_license
arey0pushpa/dcnf-autarky
R
false
false
161,407
r
c DCNF-Autarky [version 0.0.1]. c Copyright (c) 2018-2019 Swansea University. c c Input Clause Count: 345245 c Performing E1-Autarky iteration. c Remaining clauses count after E-Reduction: 316980 c c Performing E1-Autarky iteration. c Remaining clauses count after E-Reduction: 316980 c c Input Parameter (command lin...
#' Plotting summary information - intended for internal use only #' #' Plotting summary information - intended for internal use #' #' \code{bugs.plot.summary} (left hand side of plot) and #' \code{bugs.plot.inferences} (right hand side of plot). #' #' @name bugs.plot #' @aliases bugs.plot.summary bugs.plot.infe...
/R/bugs.plot.summary.R
no_license
MultiBUGS/R2MultiBUGS
R
false
false
5,437
r
#' Plotting summary information - intended for internal use only #' #' Plotting summary information - intended for internal use #' #' \code{bugs.plot.summary} (left hand side of plot) and #' \code{bugs.plot.inferences} (right hand side of plot). #' #' @name bugs.plot #' @aliases bugs.plot.summary bugs.plot.infe...
# For macOS users who have decided to use gcc # (replace 8 with version of gcc installed on your machine) # NOTE: your gcc / g++ from Homebrew is probably in /usr/local/bin #export CXX=/usr/local/bin/g++-8 CC=/usr/local/bin/gcc-8 # Sys.setenv("CXX" = "/usr/local/bin/g++-8") # Sys.setenv("CC" = "/usr/local/bin/gcc-8") ...
/build_r.R
permissive
sxfmol/LightGBM
R
false
false
2,284
r
# For macOS users who have decided to use gcc # (replace 8 with version of gcc installed on your machine) # NOTE: your gcc / g++ from Homebrew is probably in /usr/local/bin #export CXX=/usr/local/bin/g++-8 CC=/usr/local/bin/gcc-8 # Sys.setenv("CXX" = "/usr/local/bin/g++-8") # Sys.setenv("CC" = "/usr/local/bin/gcc-8") ...
#Quiz 1 setwd("C:/Users/carbon/Dropbox/Coursera/R Programming/Quiz 1") D = read.table("hw1_data.csv", header = T, sep=",") #Question 1 head(D,2) #Question 2 tail(D,2) #Question 3 D[47,] #Question 16 dim(D[D$Ozone == NA,]) #Question 17 mean(D$Ozone, na.rm = T) #Question 18 mean(D[(D$Ozone > 31) & (D$Temp > 90),"...
/R Programming/Quiz 1/Quiz1.R
no_license
canyon289/DataScience
R
false
false
447
r
#Quiz 1 setwd("C:/Users/carbon/Dropbox/Coursera/R Programming/Quiz 1") D = read.table("hw1_data.csv", header = T, sep=",") #Question 1 head(D,2) #Question 2 tail(D,2) #Question 3 D[47,] #Question 16 dim(D[D$Ozone == NA,]) #Question 17 mean(D$Ozone, na.rm = T) #Question 18 mean(D[(D$Ozone > 31) & (D$Temp > 90),"...
testlist <- list(A = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 1.22810536108265e+146, 4.12396251261199e-221, 0), .Dim = c(5L, 1L)), 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/1613116233-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
251
r
testlist <- list(A = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 1.22810536108265e+146, 4.12396251261199e-221, 0), .Dim = c(5L, 1L)), B = structure(0, .Dim = c(1L, 1L))) result <- do.call(multivariance:::match_rows,testlist) str(result)