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
library(powtran) #### Utilities ###################################### read.from.zip <-function(zipfilename,skip=1,n=NA){ if(!file.exists(zipfilename)){ stop("File ",zipfilename,"does not exists!"); } files = subset( unzip(zipfilename,list=TRUE),Length>0) if(dim(files)[1]==1){ n=1 } if(is.na(n))...
/tests/testthat/test-EnergyAnalysis.R
no_license
ElsevierSoftwareX/SOFTX_2020_25
R
false
false
4,896
r
library(powtran) #### Utilities ###################################### read.from.zip <-function(zipfilename,skip=1,n=NA){ if(!file.exists(zipfilename)){ stop("File ",zipfilename,"does not exists!"); } files = subset( unzip(zipfilename,list=TRUE),Length>0) if(dim(files)[1]==1){ n=1 } if(is.na(n))...
### Exercise 2 ### # As you noticed, it often takes multiple queries to retrieve the desired information. # This is a perfect situation in which writing a function will allow you to better structure your # code, and give a name to a repeated task. library(jsonlite) setwd('~/Desktop/Info/m10-apis/exercise-2/') # Writ...
/exercise-2/exercise.R
permissive
MaxwellJKahn/m10-apis
R
false
false
1,196
r
### Exercise 2 ### # As you noticed, it often takes multiple queries to retrieve the desired information. # This is a perfect situation in which writing a function will allow you to better structure your # code, and give a name to a repeated task. library(jsonlite) setwd('~/Desktop/Info/m10-apis/exercise-2/') # Writ...
library(readr) humid_temp_2019 <- read_delim("humidity-pressure-temperature/temperature_20100101_20191231_hist/produkt_zehn_min_tu_20100101_20191231_01766.txt", ";", escape_double = FALSE, col_types = cols(STATIONS_ID = col_skip(), MESS_DATUM = col_datetime(format = "%Y%m%d%H%M"), QN = col_skip(), TM5_10 = col_skip(),...
/data/weather_FMO/DWD_data_preparation.R
no_license
pramitghosh/RS_ET
R
false
false
5,121
r
library(readr) humid_temp_2019 <- read_delim("humidity-pressure-temperature/temperature_20100101_20191231_hist/produkt_zehn_min_tu_20100101_20191231_01766.txt", ";", escape_double = FALSE, col_types = cols(STATIONS_ID = col_skip(), MESS_DATUM = col_datetime(format = "%Y%m%d%H%M"), QN = col_skip(), TM5_10 = col_skip(),...
# show-phyloseqExtend ----------------------------------------------------- #' @title Print a phyloseqExtend object #' #' @export #' @docType methods setMethod("show", "phyloseqExtend", function(object) { # Print usual phyloseq tables signature(object = "phyloseq") callNextMethod() # print spectra summary...
/R/show-methods.R
no_license
krisrs1128/phyloseqExtend
R
false
false
884
r
# show-phyloseqExtend ----------------------------------------------------- #' @title Print a phyloseqExtend object #' #' @export #' @docType methods setMethod("show", "phyloseqExtend", function(object) { # Print usual phyloseq tables signature(object = "phyloseq") callNextMethod() # print spectra summary...
library(fs) setwd(Sys.getenv('PRODUCTOR_HOME')) system('docker-compose -f airflow/docker-compose.yaml down') system('docker-compose -f nginx/docker-compose.yaml down') system('docker-compose -f plumber_api/docker-compose.yaml down') system('docker-compose -f shiny/docker-compose.yaml down') system('docker-compose -f ...
/scripts/stop.R
no_license
Ging3y/productor
R
false
false
356
r
library(fs) setwd(Sys.getenv('PRODUCTOR_HOME')) system('docker-compose -f airflow/docker-compose.yaml down') system('docker-compose -f nginx/docker-compose.yaml down') system('docker-compose -f plumber_api/docker-compose.yaml down') system('docker-compose -f shiny/docker-compose.yaml down') system('docker-compose -f ...
# Copyright (c) 2019 - 2023, Adrian Dusa # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, in whole or in part, are permitted provided that the # following conditions are met: # * Redistributions of source code must retain the above copyright # noti...
/R/brackets.R
no_license
cran/admisc
R
false
false
8,711
r
# Copyright (c) 2019 - 2023, Adrian Dusa # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, in whole or in part, are permitted provided that the # following conditions are met: # * Redistributions of source code must retain the above copyright # noti...
vF <- 1.5 #Progression rate of acute infection per year vL0 <- 0.0014 #Progression rate for reactivation (chronic LTBI) in the USB population per year vL1 <- 0.0010 #Progression rate for reactivation (chronic LTBI) in the FB population per year popConst <- 1000 generateIncidence <- function(dataSet) { ...
/in_progress/models/agentHillModel/cppHill_plusTreatment/plotData.R
no_license
mmcdermott/disease-modeling
R
false
false
3,136
r
vF <- 1.5 #Progression rate of acute infection per year vL0 <- 0.0014 #Progression rate for reactivation (chronic LTBI) in the USB population per year vL1 <- 0.0010 #Progression rate for reactivation (chronic LTBI) in the FB population per year popConst <- 1000 generateIncidence <- function(dataSet) { ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data_ovmRNA_df.R \docType{data} \name{ovmRNA_df} \alias{ovmRNA_df} \title{Ovarian Cancer Gene Expression Data} \format{A data frame containing 23316 gene expression values for 381 samples. The first column is the TCGA sample IDs (\code{Samp...
/man/ovmRNA_df.Rd
no_license
TransBioInfoLab/Bioc2019pathwayPCA
R
false
true
665
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data_ovmRNA_df.R \docType{data} \name{ovmRNA_df} \alias{ovmRNA_df} \title{Ovarian Cancer Gene Expression Data} \format{A data frame containing 23316 gene expression values for 381 samples. The first column is the TCGA sample IDs (\code{Samp...
#' Calculate stationary Gaussian process kernel #' #' Covariance calculations for Gaussian process kernels. #' Currently supports matern, rbf, compact1, periodicMatern, generalMatern, and rationalQuadratic kernels. #' Can also return m_phi and other additional quantities useful for ODE inference. #' #' @param phi the ...
/rmagi/R/kernel.R
no_license
passion4energy/magi
R
false
false
13,739
r
#' Calculate stationary Gaussian process kernel #' #' Covariance calculations for Gaussian process kernels. #' Currently supports matern, rbf, compact1, periodicMatern, generalMatern, and rationalQuadratic kernels. #' Can also return m_phi and other additional quantities useful for ODE inference. #' #' @param phi the ...
\name{positioning.functions} \Rdversion{1.1} \alias{positioning.functions} \alias{positioning.methods} \title{Built-in Positioning Methods for direct label placement} \description{When adding direct labels to a grouped plot, label placement can be specified using a Positioning Method (or a list of them), of the for...
/man/positioning.functions.Rd
no_license
tdhock/directlabels
R
false
false
8,107
rd
\name{positioning.functions} \Rdversion{1.1} \alias{positioning.functions} \alias{positioning.methods} \title{Built-in Positioning Methods for direct label placement} \description{When adding direct labels to a grouped plot, label placement can be specified using a Positioning Method (or a list of them), of the for...
/experience/code6.R
no_license
QuaQuan/compilers
R
false
false
4,780
r
library(MASS); pdf("~/Scripts/R/chromatic_aberr_hists.pdf"); outfile <- file("~/Scripts/R/chromatic_aberr_script_output.txt", open="wt"); sink(outfile, type="output"); x <- Sox2_data_emp_correction; par(mfrow=c(3,2), cex.main=0.8, cex=0.6); batches <- unique(x$Batch); print("Data: Sox2_data_emp_correction"); for (...
/R/Scripts/chrom_aberration_Graphs_120616.R
no_license
JMAlexander/ImageAnalysisTools
R
false
false
1,907
r
library(MASS); pdf("~/Scripts/R/chromatic_aberr_hists.pdf"); outfile <- file("~/Scripts/R/chromatic_aberr_script_output.txt", open="wt"); sink(outfile, type="output"); x <- Sox2_data_emp_correction; par(mfrow=c(3,2), cex.main=0.8, cex=0.6); batches <- unique(x$Batch); print("Data: Sox2_data_emp_correction"); for (...
library(tidyverse) library(plyr) ds <- gcat %>% select( entity_id, FOTOTIPO_OJOS ) %>% mutate( eye_color = ifelse(FOTOTIPO_OJOS == 0, NA, FOTOTIPO_OJOS), eye_color_dark = ifelse(FOTOTIPO_OJOS %in% c(1,2,3), 1, ifelse(FOTOTIPO_OJOS %in% c(4,5), 0, NA)) ) %>% select( entity_id, eye_colo...
/R/check/check-eyes.R
no_license
xdurana/gcat-cleaning-data
R
false
false
592
r
library(tidyverse) library(plyr) ds <- gcat %>% select( entity_id, FOTOTIPO_OJOS ) %>% mutate( eye_color = ifelse(FOTOTIPO_OJOS == 0, NA, FOTOTIPO_OJOS), eye_color_dark = ifelse(FOTOTIPO_OJOS %in% c(1,2,3), 1, ifelse(FOTOTIPO_OJOS %in% c(4,5), 0, NA)) ) %>% select( entity_id, eye_colo...
#' @title Make Haplotypes #' @description Identify haplotypes in data.frame of aligned. #' #' @param x data.frame of base pairs. #' #' @author Eric Archer \email{eric.archer@@noaa.gov} #' #' @export #' uniqueHapBySite <- function(x) { haps <- makeHaps(x) result <- unlist(apply(x[, -1, drop = F], 2, function(b)...
/R/uniqueHapBySite.R
no_license
EricArcher/geneticRF
R
false
false
571
r
#' @title Make Haplotypes #' @description Identify haplotypes in data.frame of aligned. #' #' @param x data.frame of base pairs. #' #' @author Eric Archer \email{eric.archer@@noaa.gov} #' #' @export #' uniqueHapBySite <- function(x) { haps <- makeHaps(x) result <- unlist(apply(x[, -1, drop = F], 2, function(b)...
testlist <- list(n = c(783747850L, 469786039L, 16840192L, 68142L, -1224013129L, 1096614144L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,...
/gdalcubes/inst/testfiles/libgdalcubes_set_threads/libFuzzer_libgdalcubes_set_threads/libgdalcubes_set_threads_valgrind_files/1609875314-test.R
no_license
akhikolla/updated-only-Issues
R
false
false
536
r
testlist <- list(n = c(783747850L, 469786039L, 16840192L, 68142L, -1224013129L, 1096614144L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,...
#author: Almas K. #date : 2020-04-02 'This script is for linear regression in R' ## Libraries library(tidyverse) library(reshape2) library(stringr) library(here) library(lumi) library(limma) library(FDb.InfiniumMethylation.hg19) ## Import Data male_metadata <- read_csv(here("data","processed_data","male_metadata.c...
/src/linear_regression.R
permissive
dy-lin/stat540-project
R
false
false
2,467
r
#author: Almas K. #date : 2020-04-02 'This script is for linear regression in R' ## Libraries library(tidyverse) library(reshape2) library(stringr) library(here) library(lumi) library(limma) library(FDb.InfiniumMethylation.hg19) ## Import Data male_metadata <- read_csv(here("data","processed_data","male_metadata.c...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/neighbor_nms.R \name{neighbor_nms} \alias{neighbor_nms} \title{Get names of nodes' neighbors} \usage{ neighbor_nms(gr, nodes) } \arguments{ \item{gr}{graph object of class \code{igraph}.} \item{nodes}{Node names in the graph} } \description{...
/man/neighbor_nms.Rd
permissive
huipan1973/ezlimmaplot
R
false
true
365
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/neighbor_nms.R \name{neighbor_nms} \alias{neighbor_nms} \title{Get names of nodes' neighbors} \usage{ neighbor_nms(gr, nodes) } \arguments{ \item{gr}{graph object of class \code{igraph}.} \item{nodes}{Node names in the graph} } \description{...
## Put comments here that give an overall description of what your ## functions do ## This is my own original work completed makeCacheMatrix <- function(x = matrix()) { } ## in accordance with the coursera honor code cacheSolve <- function(x, ...) { ## Return a matrix that is the inverse of 'x' }
/cachematrix.R
no_license
DdeJong/ProgrammingAssignment2
R
false
false
312
r
## Put comments here that give an overall description of what your ## functions do ## This is my own original work completed makeCacheMatrix <- function(x = matrix()) { } ## in accordance with the coursera honor code cacheSolve <- function(x, ...) { ## Return a matrix that is the inverse of 'x' }
## process, validate, report, visualize model library(stan) library(shinystan) library(loo) library(data.table) library(rethinking) library(ggplot2) ## load previously fit model (see R/fit-model.R) #### list.files('model/', pattern = 'RDS') load('model/stan-m5c2-2017-04-14.RDS') ## call original data and parameter na...
/R/visualize-model-output.R
no_license
ericlind/soilC-responses
R
false
false
17,124
r
## process, validate, report, visualize model library(stan) library(shinystan) library(loo) library(data.table) library(rethinking) library(ggplot2) ## load previously fit model (see R/fit-model.R) #### list.files('model/', pattern = 'RDS') load('model/stan-m5c2-2017-04-14.RDS') ## call original data and parameter na...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/argument_types.R \name{DateTime} \alias{DateTime} \title{DateTime} \value{ Object of \code{\link[=R6Class]{R6Class()}} representing a date with time component. } \description{ Inheriting from \code{\link[=Argument]{Argument()}} in order to re...
/man/DateTime.Rd
permissive
Open-EO/openeo-r-client
R
false
true
1,607
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/argument_types.R \name{DateTime} \alias{DateTime} \title{DateTime} \value{ Object of \code{\link[=R6Class]{R6Class()}} representing a date with time component. } \description{ Inheriting from \code{\link[=Argument]{Argument()}} in order to re...
#EDA Case Study #reading data loan.data <- read.csv("loan.csv", stringsAsFactors = FALSE, header = TRUE) str(loan.data) library(dplyr) library(stringr) library(ggplot) library(tidyr) library(tidyverse) #this will show that the total number of rows are equal to NA values for some columns, which means they...
/EDA.r
no_license
ashayfanse/MyFiles
R
false
false
10,886
r
#EDA Case Study #reading data loan.data <- read.csv("loan.csv", stringsAsFactors = FALSE, header = TRUE) str(loan.data) library(dplyr) library(stringr) library(ggplot) library(tidyr) library(tidyverse) #this will show that the total number of rows are equal to NA values for some columns, which means they...
gfunction.alp.lam.lm <- function(g.alp, lam){ if(is.null(g.alp)){ return(NULL) } n <- nrow(g.alp[[1]]) nalp <- length(g.alp) g.alp.lam <- matrix(NA, nrow = n, ncol = nalp) k <- 0 for(m in g.alp){ k <- k + 1 g.alp.lam[, k] <- m %*% lam } g.alp.lam }
/R/gfunction.alp.lam.lm.R
no_license
zhangh12/gim
R
false
false
293
r
gfunction.alp.lam.lm <- function(g.alp, lam){ if(is.null(g.alp)){ return(NULL) } n <- nrow(g.alp[[1]]) nalp <- length(g.alp) g.alp.lam <- matrix(NA, nrow = n, ncol = nalp) k <- 0 for(m in g.alp){ k <- k + 1 g.alp.lam[, k] <- m %*% lam } g.alp.lam }
#*********************************************************************************** # Operációkutatás szoftveres példatár # # I. Grafikusan megoldható feladatok # # 10. feladat - Sapka, kardigán # #*********************************************************************************** library(lpSolveAPI) #A célfüggvénye...
/src/assets/sources/files/kodok/r/1 fejezet feladatai/I_10.R
no_license
james9711/Operaciokutatas_peldatar
R
false
false
1,416
r
#*********************************************************************************** # Operációkutatás szoftveres példatár # # I. Grafikusan megoldható feladatok # # 10. feladat - Sapka, kardigán # #*********************************************************************************** library(lpSolveAPI) #A célfüggvénye...
#' Get path to readroper example #' #' readroper comes bundled with a number of sample files in its `inst/extdata` #' directory. This function make them easy to access #' #' @param path Name of file. If `NULL`, the example files will be listed. #' @export #' @examples #' readroper_example() #' readroper_example('testMu...
/R/example.R
permissive
petulla/readroper
R
false
false
604
r
#' Get path to readroper example #' #' readroper comes bundled with a number of sample files in its `inst/extdata` #' directory. This function make them easy to access #' #' @param path Name of file. If `NULL`, the example files will be listed. #' @export #' @examples #' readroper_example() #' readroper_example('testMu...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bin_funcs.R \name{bin_cumulative} \alias{bin_cumulative} \title{bin_cumulative} \usage{ bin_cumulative(trials, prob) } \arguments{ \item{trials:}{number of total trials} \item{prob:}{probability of success} } \value{ a data.frame with two cl...
/binomial/man/bin_cumulative.Rd
no_license
stat133-sp19/hw-stat133-lilybhattacharjee5
R
false
true
624
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bin_funcs.R \name{bin_cumulative} \alias{bin_cumulative} \title{bin_cumulative} \usage{ bin_cumulative(trials, prob) } \arguments{ \item{trials:}{number of total trials} \item{prob:}{probability of success} } \value{ a data.frame with two cl...
# These are drop in replacements for the stringr:: functions used in httr. They # do not retain all functionality from stringr, only that which is used in # httr. Notably they are generally not vectorized. str_trim <- function(x) { gsub("(^\\s+)|(\\s+$)", "", x) } str_split_fixed <- function(string, pattern, n) { ...
/R/str.R
permissive
r-lib/httr
R
false
false
1,734
r
# These are drop in replacements for the stringr:: functions used in httr. They # do not retain all functionality from stringr, only that which is used in # httr. Notably they are generally not vectorized. str_trim <- function(x) { gsub("(^\\s+)|(\\s+$)", "", x) } str_split_fixed <- function(string, pattern, n) { ...
# Inhalt: *** Modell a la Karin, Top 5 Modell, Vergleich Beta_Koeffizienten, Ramseys RESET; #train <- read.csv('.../data/train.csv') #test <- read.csv('.../data/test.csv') library(broom) library(dplyr) library(jtools) # Top *** Modell und Top 5 Modell # *** aus Karins letztem Modell train lm_9 <- lm(formula=scal...
/scripts/Vergleich_beta_koeff_top_fuenf_und_Sternchen.R
no_license
raph333/house_price_regression
R
false
false
2,784
r
# Inhalt: *** Modell a la Karin, Top 5 Modell, Vergleich Beta_Koeffizienten, Ramseys RESET; #train <- read.csv('.../data/train.csv') #test <- read.csv('.../data/test.csv') library(broom) library(dplyr) library(jtools) # Top *** Modell und Top 5 Modell # *** aus Karins letztem Modell train lm_9 <- lm(formula=scal...
#' Find the dimensions of a ggplot2 heatmap. #' #' This works by identifying the number of unique points in the variables mapped #' to the x and y axes. #' #' @param p a ggplot2 heatmap (or any ggplot with x and y mappings) #' @return a list with the number of rows and columns #' @export heatmap_dims <- function(p) { ...
/R/heatmaps.R
no_license
eclarke/eclectic
R
false
false
7,817
r
#' Find the dimensions of a ggplot2 heatmap. #' #' This works by identifying the number of unique points in the variables mapped #' to the x and y axes. #' #' @param p a ggplot2 heatmap (or any ggplot with x and y mappings) #' @return a list with the number of rows and columns #' @export heatmap_dims <- function(p) { ...
#' Computation and plotting of the landmark distances #' #' - Shape alignment (shapes) (intra group subjects -> inter group mean shapes) #' - Compute the landmark distances #' - Group landmarks #' - Semantic distance plot #' #' Author: Maxime Rousseau #' Date: 24/06/2020 library(here) library(tibble) library(dplyr) l...
/R/distances.R
no_license
maxrousseau/oifa-2019
R
false
false
10,485
r
#' Computation and plotting of the landmark distances #' #' - Shape alignment (shapes) (intra group subjects -> inter group mean shapes) #' - Compute the landmark distances #' - Group landmarks #' - Semantic distance plot #' #' Author: Maxime Rousseau #' Date: 24/06/2020 library(here) library(tibble) library(dplyr) l...
mldf <- "/rdsi/PUBLIC/raad/data/sose.ucsd.edu/SO6/ITER122/bsose_i122_2013to2017_monthly_MLD.nc" library(tidync) s55 <- tidync::tidync(mldf) %>% hyper_filter(YC = between(index, 373, 384)) %>% hyper_tibble() s65 <- tidync::tidync(mldf) %>% hyper_filter(YC = between(index, 250, 265)) %>% hyper_tibble() ss <- bind_rows(s...
/prototypes/MLD/MLD.R
no_license
AustralianAntarcticDivision/measo-assess
R
false
false
2,824
r
mldf <- "/rdsi/PUBLIC/raad/data/sose.ucsd.edu/SO6/ITER122/bsose_i122_2013to2017_monthly_MLD.nc" library(tidync) s55 <- tidync::tidync(mldf) %>% hyper_filter(YC = between(index, 373, 384)) %>% hyper_tibble() s65 <- tidync::tidync(mldf) %>% hyper_filter(YC = between(index, 250, 265)) %>% hyper_tibble() ss <- bind_rows(s...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/3D.R \name{Traj3DSmoothSG} \alias{Traj3DSmoothSG} \title{Smooth a 3D trajectory using a Savitzky-Golay filter} \usage{ Traj3DSmoothSG(trj3d, p = 3, n = p + 3 - p\%\%2, ...) } \arguments{ \item{trj3d}{The 3=dimensional trajectory to be smoothe...
/man/Traj3DSmoothSG.Rd
no_license
JimMcL/trajr
R
false
true
1,148
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/3D.R \name{Traj3DSmoothSG} \alias{Traj3DSmoothSG} \title{Smooth a 3D trajectory using a Savitzky-Golay filter} \usage{ Traj3DSmoothSG(trj3d, p = 3, n = p + 3 - p\%\%2, ...) } \arguments{ \item{trj3d}{The 3=dimensional trajectory to be smoothe...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/Rcolombos.R \name{quick_search} \alias{quick_search} \title{This method mimics the quick_search functionality of Colombos. It takes a string containg the nickname for the selected organism and a vector of string representing the genes...
/man/quick_search.Rd
no_license
cran/Rcolombos
R
false
false
1,596
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/Rcolombos.R \name{quick_search} \alias{quick_search} \title{This method mimics the quick_search functionality of Colombos. It takes a string containg the nickname for the selected organism and a vector of string representing the genes...
context("Rcpp function") test_that("Detection of constants", { f <- function(x, type, na.rm) is_constant(as(x, type), na.rm) for(p in 1:4){ x <- as.matrix(do.call(expand.grid, rep(list(c(NA, 0, 1)), p))) is.constant <- c(NA, TRUE, FALSE)[sapply(apply(x, 1, table), length) + 1] is.consta...
/tests/testthat/test-cppfunction.r
no_license
Molmed/emil
R
false
false
691
r
context("Rcpp function") test_that("Detection of constants", { f <- function(x, type, na.rm) is_constant(as(x, type), na.rm) for(p in 1:4){ x <- as.matrix(do.call(expand.grid, rep(list(c(NA, 0, 1)), p))) is.constant <- c(NA, TRUE, FALSE)[sapply(apply(x, 1, table), length) + 1] is.consta...
# Exploratory Data Analysis - Course Project 1 ### Reading the data and formatting Date setwd("C:/Users/Matthew/Documents/Coursera") power <- read.table("household_power_consumption.txt",sep=";" ,header=T) power$Date <- as.character(as.Date(power$Date,"%d/%m/%Y")) power$Time <- as.character(power$Ti...
/plot1.R
no_license
matthewchangkit/ExData_Plotting1
R
false
false
862
r
# Exploratory Data Analysis - Course Project 1 ### Reading the data and formatting Date setwd("C:/Users/Matthew/Documents/Coursera") power <- read.table("household_power_consumption.txt",sep=";" ,header=T) power$Date <- as.character(as.Date(power$Date,"%d/%m/%Y")) power$Time <- as.character(power$Ti...
testlist <- list(hi = 0, lo = 7.36454251690962e-320, mu = 0, sig = 0) result <- do.call(gjam:::tnormRcpp,testlist) str(result)
/gjam/inst/testfiles/tnormRcpp/libFuzzer_tnormRcpp/tnormRcpp_valgrind_files/1610045403-test.R
no_license
akhikolla/updated-only-Issues
R
false
false
126
r
testlist <- list(hi = 0, lo = 7.36454251690962e-320, mu = 0, sig = 0) result <- do.call(gjam:::tnormRcpp,testlist) str(result)
# Run with: # Rscript hw3-plot-edges.r edges.txt tip-labels.txt # or # Rscript hw3-plot-edges.r edges.txt tip-labels.txt bootstrap.txt library('ape') library('RColorBrewer') args <- commandArgs(trailingOnly=TRUE) if(length(args) < 2 || length(args) > 3) stop('Need 2 or 3 args.') make.newick <- function(edge,edge.l...
/scripts/hw3-plot-edges.r
no_license
anicksaha/neighbor_joining
R
false
false
3,449
r
# Run with: # Rscript hw3-plot-edges.r edges.txt tip-labels.txt # or # Rscript hw3-plot-edges.r edges.txt tip-labels.txt bootstrap.txt library('ape') library('RColorBrewer') args <- commandArgs(trailingOnly=TRUE) if(length(args) < 2 || length(args) > 3) stop('Need 2 or 3 args.') make.newick <- function(edge,edge.l...
\name{kspace.plot} \alias{kspace.plot} %- Also NEED an '\alias' for EACH other topic documented here. \title{ k-space map from raw scatterometry image } \description{ produces k-space scattergram from raw IS image } \usage{ kspace.plot(filename, center.correction = NA, radius.correction = NA, phi.correction = 0, lambda...
/man/kspace.plot.Rd
no_license
tjconstant/photonMonkey
R
false
false
1,773
rd
\name{kspace.plot} \alias{kspace.plot} %- Also NEED an '\alias' for EACH other topic documented here. \title{ k-space map from raw scatterometry image } \description{ produces k-space scattergram from raw IS image } \usage{ kspace.plot(filename, center.correction = NA, radius.correction = NA, phi.correction = 0, lambda...
#' Run an imageJ analysis macro on the folder that contains the photograph to be analyzed #' @description \code{IJMacro} is used to run the imageJ analysis component of diskImageR and then load in the acquired output from imageJ into R. #' @param projectName the short name you want use for the project #' @param proje...
/R/IJMacro.R
no_license
acgerstein/diskImageR
R
false
false
9,796
r
#' Run an imageJ analysis macro on the folder that contains the photograph to be analyzed #' @description \code{IJMacro} is used to run the imageJ analysis component of diskImageR and then load in the acquired output from imageJ into R. #' @param projectName the short name you want use for the project #' @param proje...
# analysis_ui.R # Analysis/Preview tab of Shiny app tabItem( tabName = "analysis", uiOutput("previews") )
/analysis_ui.R
permissive
bigmonty12/DAMNation
R
false
false
110
r
# analysis_ui.R # Analysis/Preview tab of Shiny app tabItem( tabName = "analysis", uiOutput("previews") )
# Scratch file for working with the files in data. I load (also known as # "attach") the three libraries that are most useful, I think, for this sort of # work. One of my roles is to point out which packages are useful. Including the # package name (or "tidyverse" or "dplyr") when googling will often lead to # better r...
/scratch.R
no_license
tianan2/class-2018-11-07
R
false
false
2,961
r
# Scratch file for working with the files in data. I load (also known as # "attach") the three libraries that are most useful, I think, for this sort of # work. One of my roles is to point out which packages are useful. Including the # package name (or "tidyverse" or "dplyr") when googling will often lead to # better r...
library(shiny) library(shinydashboard) library(shinyjs) library(shinythemes)
/Shiny App/global.R
no_license
Derek-Funk/Bayesian-Logistic-Regression-with-JAGS
R
false
false
81
r
library(shiny) library(shinydashboard) library(shinyjs) library(shinythemes)
# Author: Sven Reulen # Date: 07-11-2013 # Dependencies: Set working directory, and define path by changing dirdat # Description: First exercise for the course Applied Geoscripting, plotting a map of a country using a function # Variables: dirdat = direction of data getwd() setwd("~/Wageningen/2.2 Geoscripting") #down...
/Exercise1.R
no_license
SvenReulen/Answers_exercises_geoscripting
R
false
false
863
r
# Author: Sven Reulen # Date: 07-11-2013 # Dependencies: Set working directory, and define path by changing dirdat # Description: First exercise for the course Applied Geoscripting, plotting a map of a country using a function # Variables: dirdat = direction of data getwd() setwd("~/Wageningen/2.2 Geoscripting") #down...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trelliscope-package.R \docType{package} \name{trelliscope-package} \alias{trelliscope-package} \alias{trelliscope} \title{Trelliscope: Create and Navigate Large Multi-Panel Visual Displays} \description{ An extension of Trellis Display that e...
/man/trelliscope-package.Rd
permissive
hafen/trelliscope
R
false
true
1,219
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/trelliscope-package.R \docType{package} \name{trelliscope-package} \alias{trelliscope-package} \alias{trelliscope} \title{Trelliscope: Create and Navigate Large Multi-Panel Visual Displays} \description{ An extension of Trellis Display that e...
####################################################################### # # SVM # ####################################################################### require('quadprog') data <- read.table("C:/Users/ka746940/Desktop/UCF/STA 6106 - Statistical Computing/Assignments/Final/pb22.txt") #data <- read.t...
/Kanak_R Code for Problam 4.R
no_license
kstatju/Stat-Computing
R
false
false
11,616
r
####################################################################### # # SVM # ####################################################################### require('quadprog') data <- read.table("C:/Users/ka746940/Desktop/UCF/STA 6106 - Statistical Computing/Assignments/Final/pb22.txt") #data <- read.t...
#set working directory this.dir <- dirname(parent.frame(2)$ofile) setwd(this.dir) db1b_string = 'DB1B_MARKETS_%d_Q%d.csv' related_carriers_dict_string = "/related_carriers_dict_%d.csv" related_carriers_string = "related_carriers_%d.csv" #load libraries library(sqldf) library(data.table) #define function for row select...
/code/related_carriers.R
no_license
reedharder/airline_network_evolution
R
false
false
4,067
r
#set working directory this.dir <- dirname(parent.frame(2)$ofile) setwd(this.dir) db1b_string = 'DB1B_MARKETS_%d_Q%d.csv' related_carriers_dict_string = "/related_carriers_dict_%d.csv" related_carriers_string = "related_carriers_%d.csv" #load libraries library(sqldf) library(data.table) #define function for row select...
# # fryplot.R # # $Revision: 1.14 $ $Date: 2016/02/11 10:17:12 $ # fryplot <- function(X, ..., width=NULL, from=NULL, to=NULL, axes=FALSE) { Xname <- short.deparse(substitute(X)) X <- as.ppp(X) b <- as.rectangle(X) halfspan <- with(b, c(diff(xrange), diff(yrange))) if(!is.null(width)) { halfwidth <- en...
/R/fryplot.R
no_license
mirca/spatstat
R
false
false
2,364
r
# # fryplot.R # # $Revision: 1.14 $ $Date: 2016/02/11 10:17:12 $ # fryplot <- function(X, ..., width=NULL, from=NULL, to=NULL, axes=FALSE) { Xname <- short.deparse(substitute(X)) X <- as.ppp(X) b <- as.rectangle(X) halfspan <- with(b, c(diff(xrange), diff(yrange))) if(!is.null(width)) { halfwidth <- en...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RcppExports.R \name{SimDataO} \alias{SimDataO} \title{Data simulation of ordinal outcomes and competing risks} \usage{ SimDataO( k_val, p1_val, p1a_val, p2_val, g_val, truebeta, truetheta, truegamma, randeffect, yfn, cfn...
/man/SimDataO.Rd
no_license
whcsu/JMcmprsk
R
false
true
2,932
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RcppExports.R \name{SimDataO} \alias{SimDataO} \title{Data simulation of ordinal outcomes and competing risks} \usage{ SimDataO( k_val, p1_val, p1a_val, p2_val, g_val, truebeta, truetheta, truegamma, randeffect, yfn, cfn...
library(matchingR) ### Name: galeShapley.marriageMarket ### Title: Gale-Shapley Algorithm: Stable Marriage Problem ### Aliases: galeShapley.marriageMarket galeShapley ### ** Examples nmen = 5 nwomen = 4 # generate cardinal utilities uM = matrix(runif(nmen*nwomen), nrow = nwomen, ncol = nmen) uW = matrix(runif(nwome...
/data/genthat_extracted_code/matchingR/examples/galeShapley.marriageMarket.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
714
r
library(matchingR) ### Name: galeShapley.marriageMarket ### Title: Gale-Shapley Algorithm: Stable Marriage Problem ### Aliases: galeShapley.marriageMarket galeShapley ### ** Examples nmen = 5 nwomen = 4 # generate cardinal utilities uM = matrix(runif(nmen*nwomen), nrow = nwomen, ncol = nmen) uW = matrix(runif(nwome...
# hppos --- position cursor on HP terminal subroutine hppos (row, col) integer row, col include SE_COMMON integer units, tens if (row == Currow + 1 && col == 1 ) { call t1ou (NEWLINE) # Prime translates to CR followed by LF Curcol = 1 Currow += 1 } elif (row == 1 && ...
/swt/src/spc/se.u/source/hppos.r
no_license
arnoldrobbins/gt-swt
R
false
false
1,762
r
# hppos --- position cursor on HP terminal subroutine hppos (row, col) integer row, col include SE_COMMON integer units, tens if (row == Currow + 1 && col == 1 ) { call t1ou (NEWLINE) # Prime translates to CR followed by LF Curcol = 1 Currow += 1 } elif (row == 1 && ...
## Functions to retrieve a cached matrix if it has already been ## inverted or to invert it and cache it if not ## Creating get and set functions for the matrix ## makeCacheMatrix <- function(x = matrix()) { m <- NULL set<-function(y){ x <<- y m <<- NULL } ...
/cachematrix.R
no_license
bguillaume/ProgrammingAssignment2
R
false
false
1,663
r
## Functions to retrieve a cached matrix if it has already been ## inverted or to invert it and cache it if not ## Creating get and set functions for the matrix ## makeCacheMatrix <- function(x = matrix()) { m <- NULL set<-function(y){ x <<- y m <<- NULL } ...
#' Top-coding values in a vector #' #' @param x numeric vector #' @param probs scalar of the quantile cut-point. #' #' @return \code{vector} top-coded vector. #' #' @details #' This function sets all values larger than the selected quantile to the largest value of the remaining values. #' #' @examples #' #' ...
/R/topcode.R
no_license
sumtxt/datatools
R
false
false
577
r
#' Top-coding values in a vector #' #' @param x numeric vector #' @param probs scalar of the quantile cut-point. #' #' @return \code{vector} top-coded vector. #' #' @details #' This function sets all values larger than the selected quantile to the largest value of the remaining values. #' #' @examples #' #' ...
# download a .zip file of the repository # from the "Clone or download - Download ZIP" button # on the GitHub repository of interest downLoadSkeleton <- function(outputFolder, packageName, skeletonType = 'SkeletonPredictionStudy'){ # check outputFolder exists ...
/inst/shiny/PlpGUIApp/helpers/codeToPopSkeletons.R
no_license
jreps/PatientLevelPredictionGUI
R
false
false
4,323
r
# download a .zip file of the repository # from the "Clone or download - Download ZIP" button # on the GitHub repository of interest downLoadSkeleton <- function(outputFolder, packageName, skeletonType = 'SkeletonPredictionStudy'){ # check outputFolder exists ...
###################################################### ## Functional normalization of the 450k array ## Jean-Philippe Fortin ## Sept 24 2013 ##################################################### ## Return a normalized beta matrix ## ## need stuff from gmodels. Where? preprocessFunnorm <- function(rgSet, nPCs=2, sex ...
/R/preprocessFunnorm.R
no_license
Shicheng-Guo/minfi
R
false
false
16,809
r
###################################################### ## Functional normalization of the 450k array ## Jean-Philippe Fortin ## Sept 24 2013 ##################################################### ## Return a normalized beta matrix ## ## need stuff from gmodels. Where? preprocessFunnorm <- function(rgSet, nPCs=2, sex ...
# Taking the vector as Input set_1 <- c(-4,44.7,-2,40,54,1,-3,4) print('Input vector is :') print(set_1) #We will use Bubble Sort to Sort the elements # BUBBLE SORT CODE : sort_me <- function(arr){ len=length(arr) #Finding length of the array received as argument for(i in 1:(len-1)){ for(j in (i...
/2011MC04_Assignment_2/Question4.R
no_license
Avinash531997/Simulation-with-R-
R
false
false
587
r
# Taking the vector as Input set_1 <- c(-4,44.7,-2,40,54,1,-3,4) print('Input vector is :') print(set_1) #We will use Bubble Sort to Sort the elements # BUBBLE SORT CODE : sort_me <- function(arr){ len=length(arr) #Finding length of the array received as argument for(i in 1:(len-1)){ for(j in (i...
## code to prepare `metadata` dataset goes here # make data/metadata.rda (used by uncode() when NASIS not available) metadata <- soilDB:::.get_NASIS_metadata() usethis::use_data(metadata, overwrite = TRUE, compress = 'xz')
/data-raw/NASIS_metadata.R
no_license
ncss-tech/soilDB
R
false
false
224
r
## code to prepare `metadata` dataset goes here # make data/metadata.rda (used by uncode() when NASIS not available) metadata <- soilDB:::.get_NASIS_metadata() usethis::use_data(metadata, overwrite = TRUE, compress = 'xz')
# exploratory analysis - # regression of EBS SST on northern hemisphere SLP fields library(ggplot2) library(dplyr) library(ncdf4) library(maps) library(maptools) library(mapdata) library(fields) library(oce) library(chron) library(zoo) library(mapproj) library(sinkr) # to load sinkr, use package devtools and unco...
/scripts/88-89 scripts/EBS_lm_SST-SLP.R
no_license
mikelitzow/bold-new-pollock
R
false
false
4,773
r
# exploratory analysis - # regression of EBS SST on northern hemisphere SLP fields library(ggplot2) library(dplyr) library(ncdf4) library(maps) library(maptools) library(mapdata) library(fields) library(oce) library(chron) library(zoo) library(mapproj) library(sinkr) # to load sinkr, use package devtools and unco...
# Define server logic required to draw a histogram server <- function(input, output) { ######################################################## # K8 ranges <- reactiveValues(x=NULL, y=NULL) ranges_comp <- reactiveValues(x=NULL, y=NULL) #first plot output$sawtooth <- renderPlot({ points <- s...
/server.R
no_license
jimmylovestea/DataDash
R
false
false
20,428
r
# Define server logic required to draw a histogram server <- function(input, output) { ######################################################## # K8 ranges <- reactiveValues(x=NULL, y=NULL) ranges_comp <- reactiveValues(x=NULL, y=NULL) #first plot output$sawtooth <- renderPlot({ points <- s...
server <- function(input, output, session) { output$urlText <- renderText({ paste(sep = "", "protocol: ", session$clientData$url_protocol, "\n", "hostname: ", session$clientData$url_hostname, "\n", "pathname: ", session$clientData$url_pathname, "\n", "port: ", ses...
/europarl_app/server.R
no_license
mamprawowiedziec/MEPs-speeches
R
false
false
6,484
r
server <- function(input, output, session) { output$urlText <- renderText({ paste(sep = "", "protocol: ", session$clientData$url_protocol, "\n", "hostname: ", session$clientData$url_hostname, "\n", "pathname: ", session$clientData$url_pathname, "\n", "port: ", ses...
require(fivethirtyeight) data("bechdel") bechdel require(tidyverse) bechdel %>% filter(between(year, 1990, 2013)) require(tidyquant) end <- ymd("2017-01-01") start <- end - weeks(20) AMZN <- tq_get("AMZN", get = "stock.prices", from = "2007-01-01", to = "2017-01-01") AMZN %>% ggplot(aes(x = date, y = close)) + ...
/thisweek_pilot.R
no_license
hkrusers/thisweekinr
R
false
false
953
r
require(fivethirtyeight) data("bechdel") bechdel require(tidyverse) bechdel %>% filter(between(year, 1990, 2013)) require(tidyquant) end <- ymd("2017-01-01") start <- end - weeks(20) AMZN <- tq_get("AMZN", get = "stock.prices", from = "2007-01-01", to = "2017-01-01") AMZN %>% ggplot(aes(x = date, y = close)) + ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/auxilary.R \name{unRateEomData} \alias{unRateEomData} \title{get the end of month UNRATE from FRED} \usage{ unRateEomData() } \value{ xts object } \description{ get the end of month UNRATE from FRED }
/man/unRateEomData.Rd
no_license
AndreMikulec/tradeModel
R
false
true
279
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/auxilary.R \name{unRateEomData} \alias{unRateEomData} \title{get the end of month UNRATE from FRED} \usage{ unRateEomData() } \value{ xts object } \description{ get the end of month UNRATE from FRED }
datagraphs <- read.csv("C:/Users/ediri/Desktop/Curso R/Johns Hopkins University/Exploratory Data Analysis/Week1/ExData_Plotting1/household_power_consumption.txt", sep=";") datagraphs$Datetime <- strptime(paste(datagraphs$Date,datagraphs$Time), format= "%d/%m/%Y %H:%M:%S") sub2 <- subset(datagraphs,datagraphs$Date=="1/2...
/Plot4.R
no_license
ediricardo21/ExData_Plotting1
R
false
false
1,144
r
datagraphs <- read.csv("C:/Users/ediri/Desktop/Curso R/Johns Hopkins University/Exploratory Data Analysis/Week1/ExData_Plotting1/household_power_consumption.txt", sep=";") datagraphs$Datetime <- strptime(paste(datagraphs$Date,datagraphs$Time), format= "%d/%m/%Y %H:%M:%S") sub2 <- subset(datagraphs,datagraphs$Date=="1/2...
#' Pooled Standard Deviation for Size with respect to Sex #' #' The standard deviation of size after removing the difference between the sexes and normalizing the individual size to have a mean of 1. #' #' @param Size A numerical vector giving the size of each individual as a scalar quantity #' @param Sex A character ...
/R/PSDSize.R
no_license
TWilliamBell/angler
R
false
false
792
r
#' Pooled Standard Deviation for Size with respect to Sex #' #' The standard deviation of size after removing the difference between the sexes and normalizing the individual size to have a mean of 1. #' #' @param Size A numerical vector giving the size of each individual as a scalar quantity #' @param Sex A character ...
# Author: Schatz Energy Research Center # Original Version: Andy Harris # Edits: Jerome Carman and/or Daug Saucedo and/or Andy Harris and/or Michah Wright # Version: 2.0 # Date: March 30, 2019 # Description: A function to generate a list of vmt weights to build a fleet with a given distribution of vmts. # # Required Va...
/functions/func_genVmtWeights.R
permissive
nreinicke/EVIPro-Fleet-Gen
R
false
false
2,413
r
# Author: Schatz Energy Research Center # Original Version: Andy Harris # Edits: Jerome Carman and/or Daug Saucedo and/or Andy Harris and/or Michah Wright # Version: 2.0 # Date: March 30, 2019 # Description: A function to generate a list of vmt weights to build a fleet with a given distribution of vmts. # # Required Va...
check.vars(c("epr.missing.bwc")) title -> "EPR missing corresponding BWC by type" ######################################################################################################## ######################################################################################################## missing.bwc.by.signal <- e...
/R/analysis/bwc/missing_bwc_by_type.R
permissive
marvinmarnold/oipm_annual_report_2018
R
false
false
752
r
check.vars(c("epr.missing.bwc")) title -> "EPR missing corresponding BWC by type" ######################################################################################################## ######################################################################################################## missing.bwc.by.signal <- e...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/signal_mean_and_ci.R \name{signal_mean_and_ci} \alias{signal_mean_and_ci} \title{Mean, SD, SEM, and confidence interval} \usage{ signal_mean_and_ci(signal_data, ci = 0.95, rep_bootstrap = 1000, na_rm = TRUE) } \arguments{ \item{signal_data}{I...
/man/signal_mean_and_ci.Rd
permissive
hochwagenlab/hwglabr2
R
false
true
1,784
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/signal_mean_and_ci.R \name{signal_mean_and_ci} \alias{signal_mean_and_ci} \title{Mean, SD, SEM, and confidence interval} \usage{ signal_mean_and_ci(signal_data, ci = 0.95, rep_bootstrap = 1000, na_rm = TRUE) } \arguments{ \item{signal_data}{I...
#******************************************************* # Summary for tam.mml.3pl object * summary.tam.mml.3pl <- function( object , file = NULL , ...){ if ( ! is.null( file ) ){ sink( paste0( file , "__SUMMARY.Rout") , split=TRUE ) } # object <- tamobject cat("------------------------...
/R/summary.tam.mml.3pl.R
no_license
mr-majkel/TAM
R
false
false
8,218
r
#******************************************************* # Summary for tam.mml.3pl object * summary.tam.mml.3pl <- function( object , file = NULL , ...){ if ( ! is.null( file ) ){ sink( paste0( file , "__SUMMARY.Rout") , split=TRUE ) } # object <- tamobject cat("------------------------...
# R_code_pca_remote_sensing.r library(raster) library(RStoolbox) setwd("C:/lab/") p224r63_2011 <- brick("p224r63_2011_masked.grd") # import the images composed by different layers ## Landsat bands # b1 blue # b2 green # b3 red # b4 NIR # b5 SWIR # b6 thermal infrared # b7 SWIR # b8 panchromatic # RGB plotRGB(p...
/R_code_pca_remote_sensing.r
no_license
Eleonora2103/Monitoring
R
false
false
2,307
r
# R_code_pca_remote_sensing.r library(raster) library(RStoolbox) setwd("C:/lab/") p224r63_2011 <- brick("p224r63_2011_masked.grd") # import the images composed by different layers ## Landsat bands # b1 blue # b2 green # b3 red # b4 NIR # b5 SWIR # b6 thermal infrared # b7 SWIR # b8 panchromatic # RGB plotRGB(p...
#Reads in data from file then subsets data for specified dates > power_con <- data.table::fread(input = "household_power_consumption.txt" + , na.strings="?" + ) > > # Making a POSIXct date capable of being filtered and graphed by time of day > power_con[, dateTime := as.POSIXct(paste(Date,...
/4_Exploratory_Data_Analysis/project1/plot3.R
no_license
garynth41/Data-Science-Specialization
R
false
false
1,003
r
#Reads in data from file then subsets data for specified dates > power_con <- data.table::fread(input = "household_power_consumption.txt" + , na.strings="?" + ) > > # Making a POSIXct date capable of being filtered and graphed by time of day > power_con[, dateTime := as.POSIXct(paste(Date,...
# This is where the pQTL and GWAS SS files will be formatted for coloc v2 # Author: Elyse Geoffroy suppressPackageStartupMessages(library(data.table)) suppressPackageStartupMessages(library(dplyr)) suppressPackageStartupMessages(library(R.utils)) #Get input arguments from command line args <- commandArgs(trailingOnl...
/04_prep_files_coloc.R
no_license
annie-novak9/Coloc
R
false
false
4,206
r
# This is where the pQTL and GWAS SS files will be formatted for coloc v2 # Author: Elyse Geoffroy suppressPackageStartupMessages(library(data.table)) suppressPackageStartupMessages(library(dplyr)) suppressPackageStartupMessages(library(R.utils)) #Get input arguments from command line args <- commandArgs(trailingOnl...
# Wrangle ESS Data for South Florida # Gabriel Odom # 2020-07-05 ###### Import Data ########################################################## library(tidyverse) library(lubridate) library(readxl) # From covid19_sfl_website/southFL_covid19_website/ in either the code/ or # reports/ subdirectory. However, while r...
/code/sfl_COVID_report_wrangleESS_20200718.R
no_license
gabrielodom/southFL_covid19_website
R
false
false
9,292
r
# Wrangle ESS Data for South Florida # Gabriel Odom # 2020-07-05 ###### Import Data ########################################################## library(tidyverse) library(lubridate) library(readxl) # From covid19_sfl_website/southFL_covid19_website/ in either the code/ or # reports/ subdirectory. However, while r...
library(DataPackageR) ### Name: project_data_path ### Title: Get DataPackageR data path ### Aliases: project_data_path ### ** Examples if(rmarkdown::pandoc_available()){ project_data_path( file = "data.rda" ) }
/data/genthat_extracted_code/DataPackageR/examples/project_data_path.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
218
r
library(DataPackageR) ### Name: project_data_path ### Title: Get DataPackageR data path ### Aliases: project_data_path ### ** Examples if(rmarkdown::pandoc_available()){ project_data_path( file = "data.rda" ) }
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_context.R \name{get_gdeltnews} \alias{get_gdeltnews} \title{get_gdeltnews} \usage{ get_gdeltnews(period = 14) } \description{ Get last 2 weeks of GDELT COVID news. Deduplicated by DateTime, URL, and DomainCountryCode. } \examples{ \dontru...
/man/get_gdeltnews.Rd
permissive
Nartlada/SaviR
R
false
true
358
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_context.R \name{get_gdeltnews} \alias{get_gdeltnews} \title{get_gdeltnews} \usage{ get_gdeltnews(period = 14) } \description{ Get last 2 weeks of GDELT COVID news. Deduplicated by DateTime, URL, and DomainCountryCode. } \examples{ \dontru...
prepMM = function(formula,data,weights = NULL,other_formulas = NULL, relmat = NULL, normalize_relmat = TRUE, X = NULL, X_ID = 'ID',proximal_markers = NULL,V_setup = NULL, diagonalize = TRUE,svd_K = TRUE,drop0_tol = 1e-10,save_V_folder = NULL, verbose = TRUE) { ...
/R/Utilities.R
permissive
deruncie/GridLMM
R
false
false
36,486
r
prepMM = function(formula,data,weights = NULL,other_formulas = NULL, relmat = NULL, normalize_relmat = TRUE, X = NULL, X_ID = 'ID',proximal_markers = NULL,V_setup = NULL, diagonalize = TRUE,svd_K = TRUE,drop0_tol = 1e-10,save_V_folder = NULL, verbose = TRUE) { ...
#======================================================================================================= # packages.R #======================================================================================================= # This script uploads packages. # Note. Uncomment "install.packages" if the package # has...
/Alessia Paccagnini/packages/packages.R
no_license
eventoseroficial/Data_and_Code_2021
R
false
false
906
r
#======================================================================================================= # packages.R #======================================================================================================= # This script uploads packages. # Note. Uncomment "install.packages" if the package # has...
#' Create MS/MS search POST request body #' #' \code{create_msms_body} returns a string of a POST request body. #' #' @param ion_mass ion_mass #' @param ms_ms_peaks ms_ms_peaks #' @param precursor_ion_tolerance precursor_ion_tolerance #' @param precursor_ion_tolerance_mode precursor_ion_tolerance_mode #' @param precurs...
/R/create_msms_body.R
no_license
MingzhuoTian/cmmr
R
false
false
2,362
r
#' Create MS/MS search POST request body #' #' \code{create_msms_body} returns a string of a POST request body. #' #' @param ion_mass ion_mass #' @param ms_ms_peaks ms_ms_peaks #' @param precursor_ion_tolerance precursor_ion_tolerance #' @param precursor_ion_tolerance_mode precursor_ion_tolerance_mode #' @param precurs...
## Preamble #### rm(list=ls()) require(rstudioapi) require(data.table) require(plot3D) require(plot3Drgl) require(mvnfast) require(mgcv) require(Matrix) require(scoringRules) require(xtable) require(boot) require(progress) require(latex2exp) require(roxygen2) require(devtools) setwd(dirname(getActiveDocumentConte...
/PSCC_2022_Examples.R
no_license
jbrowell/Dynamic-Covariance
R
false
false
26,074
r
## Preamble #### rm(list=ls()) require(rstudioapi) require(data.table) require(plot3D) require(plot3Drgl) require(mvnfast) require(mgcv) require(Matrix) require(scoringRules) require(xtable) require(boot) require(progress) require(latex2exp) require(roxygen2) require(devtools) setwd(dirname(getActiveDocumentConte...
make_overstorey_p_retranslocation <- function(sumDF) { ### Calculate overstorey p retranslocated ### canopy p - litterfall p + wood P increment + fineroot P - fineroot litter P df1 <- sumDF[sumDF$term == "Wood P flux", 2:9] + sumDF[sumDF$term == "Canopy P flux", 2:9] + sumDF[sumDF$term == "Fine...
/programs/summary_variables/make_overstorey_p_retranslocation.R
no_license
SoilTSSM/EucFACE_P_synthesis
R
false
false
550
r
make_overstorey_p_retranslocation <- function(sumDF) { ### Calculate overstorey p retranslocated ### canopy p - litterfall p + wood P increment + fineroot P - fineroot litter P df1 <- sumDF[sumDF$term == "Wood P flux", 2:9] + sumDF[sumDF$term == "Canopy P flux", 2:9] + sumDF[sumDF$term == "Fine...
## ----------------------------------------------------------------- ## IGraph R package ## Copyright (C) 2005-2014 Gabor Csardi <csardi.gabor@gmail.com> ## 334 Harvard street, Cambridge, MA 02139 USA ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the ...
/R/games.R
no_license
Ruchika8/Dgraph
R
false
false
71,068
r
## ----------------------------------------------------------------- ## IGraph R package ## Copyright (C) 2005-2014 Gabor Csardi <csardi.gabor@gmail.com> ## 334 Harvard street, Cambridge, MA 02139 USA ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the ...
library(lubridate) library(magrittr) library(dplyr) library(ggplot2) library(plotly) library(gridExtra) library(rCharts) setwd("H:/Projects/11000/11187/TS/Task 1") scott_read <- read.csv("scott_county_and_supplement.csv",stringsAsFactors = FALSE) ##summaries of each dataset are commented out ##useful to give a brief...
/Speed_Eval.R
no_license
DGallenSRF/Traffic_Analytics
R
false
false
6,164
r
library(lubridate) library(magrittr) library(dplyr) library(ggplot2) library(plotly) library(gridExtra) library(rCharts) setwd("H:/Projects/11000/11187/TS/Task 1") scott_read <- read.csv("scott_county_and_supplement.csv",stringsAsFactors = FALSE) ##summaries of each dataset are commented out ##useful to give a brief...
library(shiny) shinyUI(pageWithSidebar( headerPanel("Shiny Car Select! - Find your Eithies Drearm Car with Shiny"), # Sidebar with a slider input for number of observations sidebarPanel( sliderInput("tmpg", "Miles per Galleon:", min = min(mtcars$mpg), ma...
/dp_shiny/ui.R
permissive
stbaercom/coursera_dataproducts
R
false
false
1,368
r
library(shiny) shinyUI(pageWithSidebar( headerPanel("Shiny Car Select! - Find your Eithies Drearm Car with Shiny"), # Sidebar with a slider input for number of observations sidebarPanel( sliderInput("tmpg", "Miles per Galleon:", min = min(mtcars$mpg), ma...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/StyleDefaults.R \name{setEdgeTargetArrowShapeDefault} \alias{setEdgeTargetArrowShapeDefault} \title{Set Edge Target Arrow Shape Default} \usage{ setEdgeTargetArrowShapeDefault( new.shape, style.name = NULL, base.url = .defaultBaseUrl ) ...
/man/setEdgeTargetArrowShapeDefault.Rd
permissive
cytoscape/RCy3
R
false
true
852
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/StyleDefaults.R \name{setEdgeTargetArrowShapeDefault} \alias{setEdgeTargetArrowShapeDefault} \title{Set Edge Target Arrow Shape Default} \usage{ setEdgeTargetArrowShapeDefault( new.shape, style.name = NULL, base.url = .defaultBaseUrl ) ...
% Auto-generated: do not edit by hand \name{htmlBdi} \alias{htmlBdi} \title{Bdi component} \description{ Bdi is a wrapper for the <bdi> HTML5 element. For detailed attribute info see: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdi } \usage{ htmlBdi(children=NULL, id=NULL, n_clicks=NULL, n_clicks_time...
/man/htmlBdi.Rd
permissive
bonomali/dash-html-components
R
false
false
3,347
rd
% Auto-generated: do not edit by hand \name{htmlBdi} \alias{htmlBdi} \title{Bdi component} \description{ Bdi is a wrapper for the <bdi> HTML5 element. For detailed attribute info see: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdi } \usage{ htmlBdi(children=NULL, id=NULL, n_clicks=NULL, n_clicks_time...
# Figures for N2O Ellipse dual-isotope paper: Snider, Venkiteswaran, Schiff, and Spoelstra # https://github.com/jjvenky/Global-N2O-Ellipses # ### # Load packages library(ggplot2) library(reshape) library(RColorBrewer) library(scales) library(grid) library(siar) library(plyr) ### ### # Load the data DatasetS1 <- re...
/figures for N2O isotopes ellipses.R
permissive
Sibo-Zhang/Global-N2O-Ellipses
R
false
false
33,306
r
# Figures for N2O Ellipse dual-isotope paper: Snider, Venkiteswaran, Schiff, and Spoelstra # https://github.com/jjvenky/Global-N2O-Ellipses # ### # Load packages library(ggplot2) library(reshape) library(RColorBrewer) library(scales) library(grid) library(siar) library(plyr) ### ### # Load the data DatasetS1 <- re...
library(caTools) library(TTR) library(gtools) #Read CSV data readData<-function(inFile){ print("Reading Data") tempFile<-tryCatch({ return(inFile[, c("datetime","open","high","low","close")]) }, error=function(cond){ message("Data column headers do not match [datetime],[open],[high],[low],[close]"...
/old/s1s2_Original.R
no_license
tyzjames/Wolverine-Mean-Reversion
R
false
false
9,690
r
library(caTools) library(TTR) library(gtools) #Read CSV data readData<-function(inFile){ print("Reading Data") tempFile<-tryCatch({ return(inFile[, c("datetime","open","high","low","close")]) }, error=function(cond){ message("Data column headers do not match [datetime],[open],[high],[low],[close]"...
#' Axis #' #' Customise axis. #' #' @inheritParams e_bar #' @param axis Axis to customise. #' @param serie Column name of serie to range the axis. If used the range of the serie is used as, #' \code{min} an \code{max}. #' @param margin Margin to apply to \code{serie}: \eqn{min = serie - margin} and #' \eqn{max = ser...
/R/grid.R
permissive
chenzixi07/echarts4r
R
false
false
13,350
r
#' Axis #' #' Customise axis. #' #' @inheritParams e_bar #' @param axis Axis to customise. #' @param serie Column name of serie to range the axis. If used the range of the serie is used as, #' \code{min} an \code{max}. #' @param margin Margin to apply to \code{serie}: \eqn{min = serie - margin} and #' \eqn{max = ser...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/getmean.R \name{getmean} \alias{getmean} \title{gets mean for overlap measure for simulation dataset} \usage{ getmean(data) } \arguments{ \item{data}{list; first sublevel of simulation data as returned by changingn.(...) or changingvar.(...) ...
/man/getmean.Rd
no_license
biometry/phenologicalOverlap
R
false
true
1,082
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/getmean.R \name{getmean} \alias{getmean} \title{gets mean for overlap measure for simulation dataset} \usage{ getmean(data) } \arguments{ \item{data}{list; first sublevel of simulation data as returned by changingn.(...) or changingvar.(...) ...
library(readxl) library(rcompanion) library(ggplot2) library(car) library(multcompView) library(lsmeans) library(mvoutlier) library(mvnormtest) soybeans <- read_excel("C:/Users/ensxvd/Desktop/Soybean Notebook.xlsx") colnames(soybeans) = c("Strategy", "cropYear", "RawAveragePrice", "PreHarvestAverage", "PostHarvestAve...
/Soybean Strategy Comparisons/statistical testing.R
no_license
enscully/FAPRI
R
false
false
16,885
r
library(readxl) library(rcompanion) library(ggplot2) library(car) library(multcompView) library(lsmeans) library(mvoutlier) library(mvnormtest) soybeans <- read_excel("C:/Users/ensxvd/Desktop/Soybean Notebook.xlsx") colnames(soybeans) = c("Strategy", "cropYear", "RawAveragePrice", "PreHarvestAverage", "PostHarvestAve...
library(doBy) library(sciplot) #read in plot design and TNC data plotsumm <- read.csv("plot_summary.csv") plotsumm$ID <- paste(plotsumm$plot, plotsumm$pot, sep = "-") starch <- read.csv("starch_ps3.csv") #names(starch)[1] <- "ID" starch$ID <- gsub ("'", "", starch$ID) #standard means standard <- starch[1:6,] standar...
/unused scripts/starch_ps3.R
no_license
npp97-field/EucPVE
R
false
false
1,772
r
library(doBy) library(sciplot) #read in plot design and TNC data plotsumm <- read.csv("plot_summary.csv") plotsumm$ID <- paste(plotsumm$plot, plotsumm$pot, sep = "-") starch <- read.csv("starch_ps3.csv") #names(starch)[1] <- "ID" starch$ID <- gsub ("'", "", starch$ID) #standard means standard <- starch[1:6,] standar...
## R Programming Week 3 Assignment ## Caching the Inverse of a Matrix ## makeCacheMatrix creates a special vector to ## set, get, setinverse, and getinverse makeCacheMatrix <- function(x = matrix()) { invrs <- NULL set <- function(y) { x <- y invrs <- NULL } get <- function() x setinverse <- functi...
/cachematrix.R
no_license
jj-personal/ProgrammingAssignment2
R
false
false
794
r
## R Programming Week 3 Assignment ## Caching the Inverse of a Matrix ## makeCacheMatrix creates a special vector to ## set, get, setinverse, and getinverse makeCacheMatrix <- function(x = matrix()) { invrs <- NULL set <- function(y) { x <- y invrs <- NULL } get <- function() x setinverse <- functi...
#' Star Coordinates Gadget #' #' Creates a RShiny Gadget for Star Coordinates #' #' Star Coordinate's (SC) goal is to generate a configuration which reveals the underlying nature of the data for cluster analysis, #' outlier detection, and exploratory data analysis, e.g., by investigating the effect of specific dimensi...
/R/StarCoordinatesGadget.R
permissive
jmatute/RadialShinyGadgets
R
false
false
14,894
r
#' Star Coordinates Gadget #' #' Creates a RShiny Gadget for Star Coordinates #' #' Star Coordinate's (SC) goal is to generate a configuration which reveals the underlying nature of the data for cluster analysis, #' outlier detection, and exploratory data analysis, e.g., by investigating the effect of specific dimensi...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
/r/src/R/ai/h2o/sparkling/H2OContext.R
permissive
neoramon/sparkling-water
R
false
false
3,876
r
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
library(dplyr) library(readr) library(fields) library(lme4) library(ggplot2) library(here) Var = 5
/src/00_load_library.R
no_license
ashleyblawas/myrepo
R
false
false
101
r
library(dplyr) library(readr) library(fields) library(lme4) library(ggplot2) library(here) Var = 5
# Libraries library(BuenColors) library(data.table) library(GenomicRanges) library(reshape2) library(ComplexHeatmap) library(matrixStats) library(gchromVAR) library(SummarizedExperiment) library(Matrix) library(preprocessCore) library(tidyverse) library(qvalue) # Functions colScale = function(x,center = TRUE, scale = ...
/figures/revisions/DevTime_Pleiotropy.R
no_license
fl-yu/singlecell_bloodtraits
R
false
false
27,522
r
# Libraries library(BuenColors) library(data.table) library(GenomicRanges) library(reshape2) library(ComplexHeatmap) library(matrixStats) library(gchromVAR) library(SummarizedExperiment) library(Matrix) library(preprocessCore) library(tidyverse) library(qvalue) # Functions colScale = function(x,center = TRUE, scale = ...
require("jpeg") require("ggplot2") require("argparse") analyzeJpeg <- function (j) { img <- readJPEG(j) median(img[,,2]) } detectEdges <- function(means, n = 8) { print(paste("n: ", n, length(means))) c(rep(0, n-1), vapply(n:length(means), function(i) { sum(means[(i-(n-1)):(i-1)]) == 0.0 && means[i] > 0.0...
/energy/smartmeter/analyze_video.r
no_license
sanzinger/utils
R
false
false
3,601
r
require("jpeg") require("ggplot2") require("argparse") analyzeJpeg <- function (j) { img <- readJPEG(j) median(img[,,2]) } detectEdges <- function(means, n = 8) { print(paste("n: ", n, length(means))) c(rep(0, n-1), vapply(n:length(means), function(i) { sum(means[(i-(n-1)):(i-1)]) == 0.0 && means[i] > 0.0...
# #pagina web con r #tutorial https://www.youtube.com/watch?v=JxsreeFsu8g #https://bookdown.org/yihui/rmarkdown/rmarkdown-site.html #https://bookdown.org/yihui/rmarkdown/html-document.html #git add . #git add -A #git commit -m "primera prueba" #git push origin master #install.packages("esquisse") #data("iris") #esqu...
/notas.R
no_license
rmalvaradom84/rmalvaradom84.github.io
R
false
false
463
r
# #pagina web con r #tutorial https://www.youtube.com/watch?v=JxsreeFsu8g #https://bookdown.org/yihui/rmarkdown/rmarkdown-site.html #https://bookdown.org/yihui/rmarkdown/html-document.html #git add . #git add -A #git commit -m "primera prueba" #git push origin master #install.packages("esquisse") #data("iris") #esqu...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/lib.R \name{get_team_member_info} \alias{get_team_member_info} \title{Load team member info from Synapse} \usage{ get_team_member_info(id) } \description{ Load team member info from Synapse }
/man/get_team_member_info.Rd
permissive
Sage-Bionetworks/agoradataprocessing
R
false
true
270
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/lib.R \name{get_team_member_info} \alias{get_team_member_info} \title{Load team member info from Synapse} \usage{ get_team_member_info(id) } \description{ Load team member info from Synapse }
library(tidyverse) library(here) library(ggplot2) library(rsq)
/scripts/libs.R
no_license
jesscampos9/research_project
R
false
false
62
r
library(tidyverse) library(here) library(ggplot2) library(rsq)
path <- system.file("testScripts/R", package="aroma.affymetrix") pathname <- file.path(path, "installUtils.R") source(pathname) library("R.utils") # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Install # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - verbose && enter(verb...
/inst/testScripts/system/chipTypes/Hs_PromPR_v02/01c.installPackages.R
no_license
HenrikBengtsson/aroma.affymetrix
R
false
false
509
r
path <- system.file("testScripts/R", package="aroma.affymetrix") pathname <- file.path(path, "installUtils.R") source(pathname) library("R.utils") # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Install # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - verbose && enter(verb...
Hurlbert <- function(NorP, k = 2, CheckArguments = TRUE, Ps = NULL, Ns = NULL) { UseMethod("Hurlbert") } Hurlbert.ProbaVector <- function(NorP, k = 2, CheckArguments = TRUE, Ps = NULL, Ns = NULL) { if (missing(NorP)){ if (!missing(Ps)) { NorP <- Ps } else { stop("An argument No...
/R/Hurlbert.R
no_license
thalesshannonwatson/entropart
R
false
false
2,223
r
Hurlbert <- function(NorP, k = 2, CheckArguments = TRUE, Ps = NULL, Ns = NULL) { UseMethod("Hurlbert") } Hurlbert.ProbaVector <- function(NorP, k = 2, CheckArguments = TRUE, Ps = NULL, Ns = NULL) { if (missing(NorP)){ if (!missing(Ps)) { NorP <- Ps } else { stop("An argument No...
library(sva) library(data.table) library(devtools) install_github("wevanjohnson/ASSIGN",ref="adapt_gene_only_ver2") library(ASSIGN) #install_github("mani2012/BatchQC", build_vignettes=TRUE) #library(BatchQC) source("~/Dropbox/bild_signatures//bild_signatures/Rmarkdowns_scripts/Key_ASSIGN_functions.Rmd") #setwd("~/Docu...
/Rmarkdowns_scripts/ICBP/all_7_with_gene_list.R
permissive
mumtahena/bild_signatures
R
false
false
33,932
r
library(sva) library(data.table) library(devtools) install_github("wevanjohnson/ASSIGN",ref="adapt_gene_only_ver2") library(ASSIGN) #install_github("mani2012/BatchQC", build_vignettes=TRUE) #library(BatchQC) source("~/Dropbox/bild_signatures//bild_signatures/Rmarkdowns_scripts/Key_ASSIGN_functions.Rmd") #setwd("~/Docu...