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
testthat::context("Utility functions") testthat::test_that("softmax", { X <- cbind(1, 1) testthat::expect_equivalent(softmax(X, ref=FALSE), cbind(.5, .5)) X <- rnorm(10) testthat::expect_equivalent(softmax(X), lava::expit(X)) X <- cbind(1,2,3) testthat::expect_equivalent(soft...
/R-package/targeted/tests/testthat/test-utils.R
permissive
kkholst/target
R
false
false
391
r
testthat::context("Utility functions") testthat::test_that("softmax", { X <- cbind(1, 1) testthat::expect_equivalent(softmax(X, ref=FALSE), cbind(.5, .5)) X <- rnorm(10) testthat::expect_equivalent(softmax(X), lava::expit(X)) X <- cbind(1,2,3) testthat::expect_equivalent(soft...
source("dlm_sim.r") source("dlm_ar_functions.r") # Set data and graphics path dpath = "../data/" gpath = "../graphs/" # Function to simulate data from dlm for different regression models # For dynamic regression models, assume first 'nd' non-intercept regression coefficients are dynamic (rest are constant) dlm_ar_sim...
/code/dlm_ar_sim.r
no_license
dsheinson/smc
R
false
false
13,627
r
source("dlm_sim.r") source("dlm_ar_functions.r") # Set data and graphics path dpath = "../data/" gpath = "../graphs/" # Function to simulate data from dlm for different regression models # For dynamic regression models, assume first 'nd' non-intercept regression coefficients are dynamic (rest are constant) dlm_ar_sim...
library(MASS) # install.packages("permute") library(permute) library(e1071) library(gbm) library(caret) # clin <- readRDS("C:/Users/Lee/Desktop/Finalterm-Project/clinical.rds") # data load # mut <- readRDS("C:/Users/Lee/Desktop/Finalterm-Project/mutation.rds") # gex <- readRDS("C:/Users/Lee/Desktop/Finalterm-Project/e...
/Dataset/prob2-commented.R
no_license
hy2850/BiS335-Final-Project
R
false
false
12,059
r
library(MASS) # install.packages("permute") library(permute) library(e1071) library(gbm) library(caret) # clin <- readRDS("C:/Users/Lee/Desktop/Finalterm-Project/clinical.rds") # data load # mut <- readRDS("C:/Users/Lee/Desktop/Finalterm-Project/mutation.rds") # gex <- readRDS("C:/Users/Lee/Desktop/Finalterm-Project/e...
% Auto-generated: do not edit by hand \name{htmlS} \alias{htmlS} \title{S component} \description{ S is a wrapper for the <s> HTML5 element. For detailed attribute info see: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/s } \usage{ htmlS(children=NULL, id=NULL, n_clicks=NULL, n_clicks_timestamp=NULL, ke...
/man/htmlS.Rd
permissive
bonomali/dash-html-components
R
false
false
3,233
rd
% Auto-generated: do not edit by hand \name{htmlS} \alias{htmlS} \title{S component} \description{ S is a wrapper for the <s> HTML5 element. For detailed attribute info see: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/s } \usage{ htmlS(children=NULL, id=NULL, n_clicks=NULL, n_clicks_timestamp=NULL, ke...
## Copyright (C) 2013 Marius Hofert, Bernhard Pfaff ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## ...
/QRM/R/Correlations.R
no_license
akhikolla/TestedPackages-NoIssues
R
false
false
1,723
r
## Copyright (C) 2013 Marius Hofert, Bernhard Pfaff ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software ## Foundation; either version 3 of the License, or (at your option) any later ## version. ## ## ...
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 4.31896282283174e+145, 4.12396251261199e-221, 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), .Dim = c(5L, 7L))) result <- do.call(CNull:::communities_individual_...
/CNull/inst/testfiles/communities_individual_based_sampling_alpha/AFL_communities_individual_based_sampling_alpha/communities_individual_based_sampling_alpha_valgrind_files/1615769898-test.R
no_license
akhikolla/updatedatatype-list2
R
false
false
362
r
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 4.31896282283174e+145, 4.12396251261199e-221, 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), .Dim = c(5L, 7L))) result <- do.call(CNull:::communities_individual_...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/AverageAge.R \name{Max} \alias{Max} \title{Maximum value of faculty ages} \usage{ Max() } \value{ Returns the maximum of \code{actualData}. } \description{ \code{Max} returns the maximum value of the data set actualData. }
/man/Max.Rd
no_license
lubyrex/AverageAge
R
false
true
302
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/AverageAge.R \name{Max} \alias{Max} \title{Maximum value of faculty ages} \usage{ Max() } \value{ Returns the maximum of \code{actualData}. } \description{ \code{Max} returns the maximum value of the data set actualData. }
#' Variance penalty due to unknown detection parameters. #' #' Calculates the variance penalty factor due to unknown detection parameters in conventional distance sampling. #' @param detection.function The detection function. Only "halfnormal" and "hazard" (hazard rate) are supported at present. #' @param theta The det...
/distance.sample.size/R/DS.penalty.R
no_license
ingted/R-Examples
R
false
false
3,765
r
#' Variance penalty due to unknown detection parameters. #' #' Calculates the variance penalty factor due to unknown detection parameters in conventional distance sampling. #' @param detection.function The detection function. Only "halfnormal" and "hazard" (hazard rate) are supported at present. #' @param theta The det...
#' Create a system #' #' @param named #' #' @return list #' @export #' create_system <- function(name = "") { reliability_graph <- list() attr(reliability_graph, "name") <- name attr(reliability_graph, "class") <- "reliability_graph" return(reliability_graph) } #' A series of nodes #' #' @param item #' @para...
/R/components.R
no_license
statwonk/reliability
R
false
false
1,096
r
#' Create a system #' #' @param named #' #' @return list #' @export #' create_system <- function(name = "") { reliability_graph <- list() attr(reliability_graph, "name") <- name attr(reliability_graph, "class") <- "reliability_graph" return(reliability_graph) } #' A series of nodes #' #' @param item #' @para...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/materials.R \name{metal} \alias{metal} \title{Metallic Material} \usage{ metal(color = "#ffffff", fuzz = 0, implicit_sample = FALSE) } \arguments{ \item{color}{Default `white`. The color of the sphere. Can be either a hexadecimal code, R colo...
/man/metal.Rd
no_license
hiteck88/rayrender
R
false
true
1,802
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/materials.R \name{metal} \alias{metal} \title{Metallic Material} \usage{ metal(color = "#ffffff", fuzz = 0, implicit_sample = FALSE) } \arguments{ \item{color}{Default `white`. The color of the sphere. Can be either a hexadecimal code, R colo...
## File Name: lmer_pool.R ## File Version: 0.07 lmer_pool <- function( models, level=.95, ...) { lmer_pool_wrapper(models=models, level=level, FUN=lmer_vcov, ...) }
/R/lmer_pool.R
no_license
alexanderrobitzsch/miceadds
R
false
false
171
r
## File Name: lmer_pool.R ## File Version: 0.07 lmer_pool <- function( models, level=.95, ...) { lmer_pool_wrapper(models=models, level=level, FUN=lmer_vcov, ...) }
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/safe.R \name{glue_safe} \alias{glue_safe} \alias{glue_data_safe} \title{Safely interpolate strings} \usage{ glue_safe(..., .envir = parent.frame()) glue_data_safe(.x, ..., .envir = parent.frame()) } \arguments{ \item{...}{[\code{expressions}...
/man/glue_safe.Rd
permissive
tidyverse/glue
R
false
true
1,797
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/safe.R \name{glue_safe} \alias{glue_safe} \alias{glue_data_safe} \title{Safely interpolate strings} \usage{ glue_safe(..., .envir = parent.frame()) glue_data_safe(.x, ..., .envir = parent.frame()) } \arguments{ \item{...}{[\code{expressions}...
#Open the graphics Device png(filename="Plot1.png",width=480, height=480, units="px") #Fetch data Power_data = read.table("household_power_consumption.txt", header=TRUE, sep=";", na.strings="?") #Convert to date class Power_data$Date<-as.Date(Power_data$Date, format="%d/%m/%Y") #subset data Power_data = subset(Power_d...
/Plot1.R
no_license
jainarchie/ExData_Plotting1
R
false
false
554
r
#Open the graphics Device png(filename="Plot1.png",width=480, height=480, units="px") #Fetch data Power_data = read.table("household_power_consumption.txt", header=TRUE, sep=";", na.strings="?") #Convert to date class Power_data$Date<-as.Date(Power_data$Date, format="%d/%m/%Y") #subset data Power_data = subset(Power_d...
# # Result # #--------# # Return a list whose elements are : # - rectangle : a data.frame containing the coordinates to draw the first rectangle ; # - rectangle2 : a data.frame containing the coordinates to draw the second rectangle ; # - legend : a data.frame containing the coordinates of the legend texts, and the ...
/bin/create_scale_bar.R
no_license
cristoichkov/research_stay
R
false
false
2,384
r
# # Result # #--------# # Return a list whose elements are : # - rectangle : a data.frame containing the coordinates to draw the first rectangle ; # - rectangle2 : a data.frame containing the coordinates to draw the second rectangle ; # - legend : a data.frame containing the coordinates of the legend texts, and the ...
### Figure2 mapping_rate ### tianliu@genomics.cn map_rate <- unique(read.table("SupTable4_mapping_rate.txt", header = T, sep = "\t")) library(ggplot2) ### 2a country map_rate$database <- factor(map_rate$database, levels = c("eHOMD", "hSGB_Rep", "oralSGB_Rep", "oralMAG", "oralRef")) p_country <- print(ggplot(subset(...
/figure/figure2_mapping/figure2_mapping_rate.R
no_license
hildaha/oral-assembly
R
false
false
1,941
r
### Figure2 mapping_rate ### tianliu@genomics.cn map_rate <- unique(read.table("SupTable4_mapping_rate.txt", header = T, sep = "\t")) library(ggplot2) ### 2a country map_rate$database <- factor(map_rate$database, levels = c("eHOMD", "hSGB_Rep", "oralSGB_Rep", "oralMAG", "oralRef")) p_country <- print(ggplot(subset(...
\name{gaa} \alias{gaa} \docType{data} \title{Dry matter weights} \description{Dry matter weights (mg/pot) for small plants of Galium aparine} \usage{data("gaa")} \format{ A data frame with 100 observations on the following 6 variables. \describe{ \item{\code{dose}}{a numeric vector} \item{\code{drymatter}}...
/man/gaa.Rd
no_license
YoJimboDurant/SiTuR
R
false
false
965
rd
\name{gaa} \alias{gaa} \docType{data} \title{Dry matter weights} \description{Dry matter weights (mg/pot) for small plants of Galium aparine} \usage{data("gaa")} \format{ A data frame with 100 observations on the following 6 variables. \describe{ \item{\code{dose}}{a numeric vector} \item{\code{drymatter}}...
#SW2 Ex2 Stochastik # # #Aufgabe 1 #aus Folien Seite 9 # #die Klassenbreite ist enorm wichtig geysir<-faithful geysir[,2] colnames(geysir) par(mfrow = c(2,2)) hist(geysir[,"waiting"]) hist(geysir[,"waiting"],breaks=20) hist(geysir[,"waiting"],breaks = seq(41,96, by = 11))# von 41 bis 96 in 11er Schritten #Aufgabe 1b #...
/SW2/ex2.R
no_license
taerisma/stoc
R
false
false
2,211
r
#SW2 Ex2 Stochastik # # #Aufgabe 1 #aus Folien Seite 9 # #die Klassenbreite ist enorm wichtig geysir<-faithful geysir[,2] colnames(geysir) par(mfrow = c(2,2)) hist(geysir[,"waiting"]) hist(geysir[,"waiting"],breaks=20) hist(geysir[,"waiting"],breaks = seq(41,96, by = 11))# von 41 bis 96 in 11er Schritten #Aufgabe 1b #...
source('example_data.R') library(testthat) library(EasyCalibrator) context('Dependency resolution') ######################################################### ## Tests: Target dependency resolution ######################################################### test_that("Generated dependencies are unique", { expect_len...
/tests/testthat/test_dependency_resolution.R
no_license
yaesoubilab/EasyCalibrator
R
false
false
1,015
r
source('example_data.R') library(testthat) library(EasyCalibrator) context('Dependency resolution') ######################################################### ## Tests: Target dependency resolution ######################################################### test_that("Generated dependencies are unique", { expect_len...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/functions.R \name{completest.cases} \alias{completest.cases} \title{completest.cases} \usage{ completest.cases(theDataframe) } \description{ returns rows without NAs } \examples{ # Remove na from stockQuoteBig stocks <- stockQuoteBig(c("AAPL"...
/man/completest.cases.Rd
no_license
fdrennan/fdRen
R
false
true
379
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/functions.R \name{completest.cases} \alias{completest.cases} \title{completest.cases} \usage{ completest.cases(theDataframe) } \description{ returns rows without NAs } \examples{ # Remove na from stockQuoteBig stocks <- stockQuoteBig(c("AAPL"...
testlist <- list(b = c(-1667457875L, -1667457892L, 67964173L, 67964173L, -1835890020L)) result <- do.call(mcga:::ByteVectorToDoubles,testlist) str(result)
/mcga/inst/testfiles/ByteVectorToDoubles/AFL_ByteVectorToDoubles/ByteVectorToDoubles_valgrind_files/1613106259-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
155
r
testlist <- list(b = c(-1667457875L, -1667457892L, 67964173L, 67964173L, -1835890020L)) result <- do.call(mcga:::ByteVectorToDoubles,testlist) str(result)
rm(list=ls()) setwd("C:/MasseyOffice1/Research/R-Script/") #'B4','B3','B2','B5' mainDir_BANDS <- paste("F:/R-Script-DriveF/ML-PROBA-100/BANDS",sep="") mainDir_BAT <- paste("F:/R-Script-DriveF/ML-PROBA-100/",sep="") mainDir_SHP_PADDY <- paste("F:/R-Script-DriveF/ML-PROBA-100/shp/paddy_utm",sep="") regencies <- c("WE...
/A-step2-PROBA_split_paddy1.R
permissive
FadhlullahRamadhani/Remote-sensed-correlation-statistics
R
false
false
2,740
r
rm(list=ls()) setwd("C:/MasseyOffice1/Research/R-Script/") #'B4','B3','B2','B5' mainDir_BANDS <- paste("F:/R-Script-DriveF/ML-PROBA-100/BANDS",sep="") mainDir_BAT <- paste("F:/R-Script-DriveF/ML-PROBA-100/",sep="") mainDir_SHP_PADDY <- paste("F:/R-Script-DriveF/ML-PROBA-100/shp/paddy_utm",sep="") regencies <- c("WE...
library(MASS) library(rdist) library(wesanderson) # Function for computing gaussian covariance between two vectors # Input: v1 - vector of length n # v2 - vector of length m # Retruns: an n+m X n+m matrix of pairwise covariances gp.cov <- function(v1, v2, l = 1, t = 1){ out.rows <- length(v1) cov.mat <- t^2*e...
/gaussian_posterior.R
no_license
terrisbecker/Bayesian-Regression
R
false
false
1,366
r
library(MASS) library(rdist) library(wesanderson) # Function for computing gaussian covariance between two vectors # Input: v1 - vector of length n # v2 - vector of length m # Retruns: an n+m X n+m matrix of pairwise covariances gp.cov <- function(v1, v2, l = 1, t = 1){ out.rows <- length(v1) cov.mat <- t^2*e...
# Escape ring selectivity model # Jane Sullivan # jane.sullivan1@alaska.gov # Last updated 2019-11-26 source("code/helper.r") library(TMB) library(cowplot) # library(nimble) # inverse gamma prior library(broom) # tidy() clean up parameter estimates library(tmbstan) # run mcmc library(shinystan) # awesome diagnostic to...
/code/2_select_mod.R
no_license
commfish/great_escape
R
false
false
18,005
r
# Escape ring selectivity model # Jane Sullivan # jane.sullivan1@alaska.gov # Last updated 2019-11-26 source("code/helper.r") library(TMB) library(cowplot) # library(nimble) # inverse gamma prior library(broom) # tidy() clean up parameter estimates library(tmbstan) # run mcmc library(shinystan) # awesome diagnostic to...
#--- #title: "MovieLens" #author: "Alejandro Greco" #date: "10/10/2019" #--- # 1 - Introduction #This is a MovieLens Project to make a movie recommendation system based on movies data set provided in the Edx course. #The objective of this project is to obtain the lower possible Root Mean Squared Error (RMSE), low...
/MovieLens_AG20191010.R
no_license
AlexGreco1/MovieLens_AG
R
false
false
22,122
r
#--- #title: "MovieLens" #author: "Alejandro Greco" #date: "10/10/2019" #--- # 1 - Introduction #This is a MovieLens Project to make a movie recommendation system based on movies data set provided in the Edx course. #The objective of this project is to obtain the lower possible Root Mean Squared Error (RMSE), low...
#!/usr/bin/env Rscript # Calculate post enzyme-digested oligo sequences library(stringr) library(seqinr) dir <- print(getwd()) setwd(dir) # Automatically set work directory FastaFile <- read.fasta(as.character(read.table("FileDirect.txt")$V1[1])) # FileDirect.txt file path frag.one <- unlist(strsplit(str_flatten(Fast...
/R/RNaseA.R
no_license
napoleontsai/RNADigestCID
R
false
false
2,377
r
#!/usr/bin/env Rscript # Calculate post enzyme-digested oligo sequences library(stringr) library(seqinr) dir <- print(getwd()) setwd(dir) # Automatically set work directory FastaFile <- read.fasta(as.character(read.table("FileDirect.txt")$V1[1])) # FileDirect.txt file path frag.one <- unlist(strsplit(str_flatten(Fast...
# ---- PGMLoadFromDB ----- cx = dbConnect(drv, connURL, usr, pwd) ## Read table sqlcmd = read_file('./SQL/PPMProgram.sql') dta = dbGetQuery(cx, sqlcmd) write_csv(dta, "PPMProgram.csv") colcls = sapply(dta, class) save(list=colcls, file='PPMProgram_colcls.RData') pmp = dta remove(dta) dbDisconnect(cx)
/PPMProgram.R
no_license
FireFighter1017/SAGEMA_SINSTMECA
R
false
false
303
r
# ---- PGMLoadFromDB ----- cx = dbConnect(drv, connURL, usr, pwd) ## Read table sqlcmd = read_file('./SQL/PPMProgram.sql') dta = dbGetQuery(cx, sqlcmd) write_csv(dta, "PPMProgram.csv") colcls = sapply(dta, class) save(list=colcls, file='PPMProgram_colcls.RData') pmp = dta remove(dta) dbDisconnect(cx)
63c55ed837770c87501e48dc7d7a827f stmt22_361_414.qdimacs 5878 20029
/code/dcnf-ankit-optimized/Results/QBFLIB-2018/E1/Database/Basler/terminator/stmt22_361_414/stmt22_361_414.R
no_license
arey0pushpa/dcnf-autarky
R
false
false
66
r
63c55ed837770c87501e48dc7d7a827f stmt22_361_414.qdimacs 5878 20029
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/perform_variation.R \name{perform_variation} \alias{perform_variation} \title{Run variation operators} \usage{ perform_variation(variation, X, iter, ...) } \arguments{ \item{variation}{List vector containing the variation operators to be used...
/man/perform_variation.Rd
no_license
fcampelo/MOEADr
R
false
true
1,681
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/perform_variation.R \name{perform_variation} \alias{perform_variation} \title{Run variation operators} \usage{ perform_variation(variation, X, iter, ...) } \arguments{ \item{variation}{List vector containing the variation operators to be used...
testlist <- list(Rs = numeric(0), atmp = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), relh = -1.72131968218895e+83, temp = c(8.5728629954997e-312, 1.56898424065867e+82, 8.96970809549085e-158, -1.3258495253834e-113, 2.79620616433656e-119, -6.800335188...
/meteor/inst/testfiles/ET0_Makkink/AFL_ET0_Makkink/ET0_Makkink_valgrind_files/1615845882-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
736
r
testlist <- list(Rs = numeric(0), atmp = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), relh = -1.72131968218895e+83, temp = c(8.5728629954997e-312, 1.56898424065867e+82, 8.96970809549085e-158, -1.3258495253834e-113, 2.79620616433656e-119, -6.800335188...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get.bin.ages.R \name{get.bin.ages} \alias{get.bin.ages} \title{Get time bins ages} \usage{ get.bin.ages(tree, what = "End", type = "Age", ICS = 2015) } \arguments{ \item{tree}{A \code{phylo} object with a \code{$root.time} component} \item{w...
/man/get.bin.ages.Rd
no_license
dwbapst/dispRity
R
false
true
1,122
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get.bin.ages.R \name{get.bin.ages} \alias{get.bin.ages} \title{Get time bins ages} \usage{ get.bin.ages(tree, what = "End", type = "Age", ICS = 2015) } \arguments{ \item{tree}{A \code{phylo} object with a \code{$root.time} component} \item{w...
societies <- read.csv("../QMSS2017/groupproject/dplace-societies-2017-05-09.csv", header=T) soc_ids <- societies$Society.id atlas <- read.csv("./dplace-data-master/datasets/EA/data.csv") atlas_sub <- atlas[which(atlas$soc_id %in% soc_ids),] summary(atlas_sub$code)
/presentation/groupproject.R
no_license
hildeschneemann/QMSS2017trance-project
R
false
false
266
r
societies <- read.csv("../QMSS2017/groupproject/dplace-societies-2017-05-09.csv", header=T) soc_ids <- societies$Society.id atlas <- read.csv("./dplace-data-master/datasets/EA/data.csv") atlas_sub <- atlas[which(atlas$soc_id %in% soc_ids),] summary(atlas_sub$code)
\name{HighDissHighSat} \alias{HighDissHighSat} \title{Highly dissatisfied to Highly satisfied } \description{ Gives "highly dissatisfied" to "highly satisfied" response option labels to variables. } \usage{ HighDissHighSat(dat, vars, ros, ord=TRUE) } \arguments{ \item{dat}{ the data frame } \item{vars}{ a single va...
/man/HighDissHighSat.Rd
no_license
saberry/lkrt
R
false
false
1,786
rd
\name{HighDissHighSat} \alias{HighDissHighSat} \title{Highly dissatisfied to Highly satisfied } \description{ Gives "highly dissatisfied" to "highly satisfied" response option labels to variables. } \usage{ HighDissHighSat(dat, vars, ros, ord=TRUE) } \arguments{ \item{dat}{ the data frame } \item{vars}{ a single va...
#################### Series de Tiempo Multivariantes ####### Caso de Estudio: Datos macroeconómicos de Estados Unidos ####### PASOS: #1. Análisis exploratorios de los datos. #2. Dividir la serie en conjuntos de entrenamiento y prueba. #3. Prueba de estacionariedad. #4. Transformar la serie de entrenamiento si es necesa...
/2. Casos de estudio en R/A. Datos macroeconómicos de USA/Datos macroeconómicos de Estados Unidos.R
no_license
creinike/Time_series_python_spanish
R
false
false
5,769
r
#################### Series de Tiempo Multivariantes ####### Caso de Estudio: Datos macroeconómicos de Estados Unidos ####### PASOS: #1. Análisis exploratorios de los datos. #2. Dividir la serie en conjuntos de entrenamiento y prueba. #3. Prueba de estacionariedad. #4. Transformar la serie de entrenamiento si es necesa...
rm(list = ls()); gc() for_tb <- read.csv("~/Documents/jgeotec2020/tables/testes_bhrsj_257_pnts/samples_forest_bhrsj_swir2.csv") # Load for samples ltr_tb <- read.csv("~/Documents/jgeotec2020/tables/testes_bhrsj_257_pnts/ltr_bhrsj_swir2.csv") # Load ltr samples other_tb <- read.csv("~/Documents/jgeotec2020/tables/other...
/code/R/samples_merge.R
no_license
sacridini/Artigo-JGEOTEC-2020
R
false
false
858
r
rm(list = ls()); gc() for_tb <- read.csv("~/Documents/jgeotec2020/tables/testes_bhrsj_257_pnts/samples_forest_bhrsj_swir2.csv") # Load for samples ltr_tb <- read.csv("~/Documents/jgeotec2020/tables/testes_bhrsj_257_pnts/ltr_bhrsj_swir2.csv") # Load ltr samples other_tb <- read.csv("~/Documents/jgeotec2020/tables/other...
#' Check for alias structures in a dataframe, and throw an error when one is found #' @param datFrame the data frame to be checked for alias structure #' @param covariatesNames The names of the variables to be considered #' #' @return Throws an error when an alias structure is detected, #' returns invisible otherwise #...
/R/checkAlias.R
no_license
CenterForStatistics-UGent/combi
R
false
false
990
r
#' Check for alias structures in a dataframe, and throw an error when one is found #' @param datFrame the data frame to be checked for alias structure #' @param covariatesNames The names of the variables to be considered #' #' @return Throws an error when an alias structure is detected, #' returns invisible otherwise #...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/vi-functions.R \name{vi_jeffreys} \alias{vi_jeffreys} \title{The Jeffreys Csiszar-function in log-space} \usage{ vi_jeffreys(logu, name = NULL) } \arguments{ \item{logu}{\code{float}-like \code{Tensor} representing \code{log(u)} from above.} ...
/man/vi_jeffreys.Rd
no_license
cran/tfprobability
R
false
true
1,687
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/vi-functions.R \name{vi_jeffreys} \alias{vi_jeffreys} \title{The Jeffreys Csiszar-function in log-space} \usage{ vi_jeffreys(logu, name = NULL) } \arguments{ \item{logu}{\code{float}-like \code{Tensor} representing \code{log(u)} from above.} ...
/MacOSX10.6.sdk/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/Headers/ASRegistry.r
no_license
alexey-lysiuk/macos-sdk
R
false
false
8,714
r
# ---------------------------------------------------- # Optimisation of sampling units multivariate # allocation with Genetic Algorithm together with strata # determination # Author: Giulio Barcaroli # Date: 25 September 2015 # ---------------------------------------------------- strataGenalg <- function(error...
/SamplingStrata/R/strataGenalg.R
no_license
ingted/R-Examples
R
false
false
8,007
r
# ---------------------------------------------------- # Optimisation of sampling units multivariate # allocation with Genetic Algorithm together with strata # determination # Author: Giulio Barcaroli # Date: 25 September 2015 # ---------------------------------------------------- strataGenalg <- function(error...
# Getting and cleaning data project #Author: Anas Aji MUhammed #Read activity labels from activity_labels.txt activityLabels <- fread(file = './UCI HAR Dataset/activity_labels.txt', col.names = c('classLabels', 'activityNames')) #Read features from features.txt file features <- fread(file = './UCI HAR Dataset/feature...
/3_Getting_and_Cleaning_Data/Project/run_analysis.R
no_license
anas-aji-muhammed/datasciencecoursera
R
false
false
1,996
r
# Getting and cleaning data project #Author: Anas Aji MUhammed #Read activity labels from activity_labels.txt activityLabels <- fread(file = './UCI HAR Dataset/activity_labels.txt', col.names = c('classLabels', 'activityNames')) #Read features from features.txt file features <- fread(file = './UCI HAR Dataset/feature...
library("caret") library(corrplot) library(C50) library(dummies) library(gmodels) library(Metrics) library(neuralnet) library(plyr) library(rpart) library(tree) library(e1071) library(rpart.plot) library(fastDummies) ################################## Load Files ############################################# x <- read...
/0-Implementation/R Files/NN/League/Bundesliga/09-10.R
no_license
Chanter08/Thesis
R
false
false
7,692
r
library("caret") library(corrplot) library(C50) library(dummies) library(gmodels) library(Metrics) library(neuralnet) library(plyr) library(rpart) library(tree) library(e1071) library(rpart.plot) library(fastDummies) ################################## Load Files ############################################# x <- read...
context("brute_force_knapsack") set.seed(42) n <- 2000 knapsack_objects <- data.frame( w=sample(1:4000, size = n, replace = TRUE), v=runif(n = n, 0, 10000) ) test_that("Correct object is returned", { expect_silent(bfk <- brute_force_knapsack(x = knapsack_objects[1:8,], W = 3500)) expect_named(bfk, c("value",...
/Testsuites/test_brute_force_knapsack.R
no_license
nourqweder/AdvRCourse
R
false
false
1,357
r
context("brute_force_knapsack") set.seed(42) n <- 2000 knapsack_objects <- data.frame( w=sample(1:4000, size = n, replace = TRUE), v=runif(n = n, 0, 10000) ) test_that("Correct object is returned", { expect_silent(bfk <- brute_force_knapsack(x = knapsack_objects[1:8,], W = 3500)) expect_named(bfk, c("value",...
\name{plot_fit_env} \alias{plot_fit_env} \title{ Plot speciation, extinction & net diversification rate functions of a fitted environmental model } \description{ Plot estimated speciation, extinction & net diversification rates as a function of the environmental data and time } \usage{ plot_fit_env(fit.env, env_data, ...
/man/plot_fit_env.Rd
no_license
mmanceau/PANDA
R
false
false
1,540
rd
\name{plot_fit_env} \alias{plot_fit_env} \title{ Plot speciation, extinction & net diversification rate functions of a fitted environmental model } \description{ Plot estimated speciation, extinction & net diversification rates as a function of the environmental data and time } \usage{ plot_fit_env(fit.env, env_data, ...
best <- function(state, outcome) { ## Read outcome data outcomeDF <- read.csv("outcome-of-care-measures.csv", colClasses="character") outcomeDF[,11] <- as.numeric(outcomeDF[,11]) ## coerce heart attack feature to numeric outcomeDF[,17] <- as.numeric(outcomeDF[,17]) ## coerce heart failure feature to numeric o...
/best.R
no_license
acheronHades/ProgrammingAssignment3
R
false
false
2,006
r
best <- function(state, outcome) { ## Read outcome data outcomeDF <- read.csv("outcome-of-care-measures.csv", colClasses="character") outcomeDF[,11] <- as.numeric(outcomeDF[,11]) ## coerce heart attack feature to numeric outcomeDF[,17] <- as.numeric(outcomeDF[,17]) ## coerce heart failure feature to numeric o...
# each df in a separate object # for (i in 1:length(files)) assign(files[i], read_excel(files[i])) # creating large list # dfs <- lapply(files, read_excel) importer <- function(given_url) { url = paste(getwd(), given_url, sep = '/') files = list.files(path = url, pattern = '*.xlsx') files = past...
/ks/timesheet/test.r
no_license
red1k/r
R
false
false
931
r
# each df in a separate object # for (i in 1:length(files)) assign(files[i], read_excel(files[i])) # creating large list # dfs <- lapply(files, read_excel) importer <- function(given_url) { url = paste(getwd(), given_url, sep = '/') files = list.files(path = url, pattern = '*.xlsx') files = past...
graph <- function(z){ yz <- dat[Name == z] qplot(year, Occurence, data = yz, color = Sex, main = z) }
/R/randomscripts/plotnames.R
no_license
codyfrisby/mooc
R
false
false
135
r
graph <- function(z){ yz <- dat[Name == z] qplot(year, Occurence, data = yz, color = Sex, main = z) }
context("Equivalence operator") library(DeepOperators) test_that("TRUE and TRUE is TRUE", { expect_true(TRUE %=% TRUE) }) test_that("FALSE and TRUE is FALSE", { expect_false(TRUE %=% FALSE) expect_false(FALSE %=% TRUE) }) test_that("FALSE and FALSE is TRUE", { expect_true(FALSE %=% FALSE) })
/tests/testthat/test_eq.R
permissive
ellisvalentiner/DeepOperators
R
false
false
303
r
context("Equivalence operator") library(DeepOperators) test_that("TRUE and TRUE is TRUE", { expect_true(TRUE %=% TRUE) }) test_that("FALSE and TRUE is FALSE", { expect_false(TRUE %=% FALSE) expect_false(FALSE %=% TRUE) }) test_that("FALSE and FALSE is TRUE", { expect_true(FALSE %=% FALSE) })
# This file is generated by make.paws. Please do not edit here. #' @importFrom paws.common get_config new_operation new_request send_request #' @include snowball_service.R NULL #' Cancels a cluster job #' #' @description #' Cancels a cluster job. You can only cancel a cluster job while it's in #' the `AwaitingQuorum` ...
/cran/paws.migration/R/snowball_operations.R
permissive
sanchezvivi/paws
R
false
false
55,108
r
# This file is generated by make.paws. Please do not edit here. #' @importFrom paws.common get_config new_operation new_request send_request #' @include snowball_service.R NULL #' Cancels a cluster job #' #' @description #' Cancels a cluster job. You can only cancel a cluster job while it's in #' the `AwaitingQuorum` ...
GrangerCausalityTest=function(TimeSeries1,TimeSeries2,Order = 1) { if(length(TimeSeries1)!=length(TimeSeries2)) stop('Length of TimeSeries1 does not equal length of TimeSeries2') DF=data.frame(TimeSeries1,TimeSeries2) Header=c('TimeSeries1','TimeSeries2') colnames(DF)=Header requireNamespace('lm...
/R/GrangerCausalityTest.R
no_license
Mthrun/TSAT
R
false
false
691
r
GrangerCausalityTest=function(TimeSeries1,TimeSeries2,Order = 1) { if(length(TimeSeries1)!=length(TimeSeries2)) stop('Length of TimeSeries1 does not equal length of TimeSeries2') DF=data.frame(TimeSeries1,TimeSeries2) Header=c('TimeSeries1','TimeSeries2') colnames(DF)=Header requireNamespace('lm...
runAnalysis <- function() { dataDir <- "./UCI HAR Dataset" filePath <- function(...) { paste(..., sep = "/") } readData <- function(path) { read.table(filePath(dataDir, path)) } # (1) Merging the training and the test sets to create one data set X_Train <- readData("train/X_train.txt") print("X...
/run_analisys.R
no_license
Yuri-Nefedov/Getting-and_Cleaning-Data
R
false
false
2,612
r
runAnalysis <- function() { dataDir <- "./UCI HAR Dataset" filePath <- function(...) { paste(..., sep = "/") } readData <- function(path) { read.table(filePath(dataDir, path)) } # (1) Merging the training and the test sets to create one data set X_Train <- readData("train/X_train.txt") print("X...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/json.R \name{WriteJsonDataFile} \alias{WriteJsonDataFile} \title{Write a single day's worth of Json Data} \usage{ WriteJsonDataFile(df, path, eventcodes, protocol, conditions) } \arguments{ \item{df}{A processed data file (subject, day, json_...
/TSExperiment/man/WriteJsonDataFile.Rd
permissive
dfreestone/TSLibrary
R
false
true
554
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/json.R \name{WriteJsonDataFile} \alias{WriteJsonDataFile} \title{Write a single day's worth of Json Data} \usage{ WriteJsonDataFile(df, path, eventcodes, protocol, conditions) } \arguments{ \item{df}{A processed data file (subject, day, json_...
#Correlation is scaled to be between -1 and +1 depending on whether there is positive or negative #correlation, and is dimensionless. The covariance however, ranges from zero, in the case of two #independent variables, to Var(X), in the case where the two sets of data are equal. #What is Correlation? #Correlation is ...
/Correlation and Covariance.R
no_license
keshav514/R-Practice
R
false
false
1,094
r
#Correlation is scaled to be between -1 and +1 depending on whether there is positive or negative #correlation, and is dimensionless. The covariance however, ranges from zero, in the case of two #independent variables, to Var(X), in the case where the two sets of data are equal. #What is Correlation? #Correlation is ...
\name{col.norm} \alias{col.norm} \title{ Compute the L2 norm of each column } \description{ The function returns a vector containing the L2 norm of each column for a given matrix. } \usage{ col.norm(X) } \arguments{ \item{X}{ a matrix for which the column norms are computed. } } \value{ A vector containing the L...
/man/col.norm.Rd
no_license
cran/tilting
R
false
false
386
rd
\name{col.norm} \alias{col.norm} \title{ Compute the L2 norm of each column } \description{ The function returns a vector containing the L2 norm of each column for a given matrix. } \usage{ col.norm(X) } \arguments{ \item{X}{ a matrix for which the column norms are computed. } } \value{ A vector containing the L...
f <- pir.compile(rir.compile(function(a) a(b=1, 2))) a <- function(a,b) c(a,b) stopifnot(c(2,1) == pir.compile(rir.compile(function()f(a)))()) # forcing a promise can inspect the whole call stack f <- pir.compile(rir.compile(function(x) sys.frame(x))) g <- pir.compile(rir.compile(function(y) y)) h <- pir.compile(rir.c...
/rir/tests/pir_regression.R
no_license
Jakobeha/rir
R
false
false
3,556
r
f <- pir.compile(rir.compile(function(a) a(b=1, 2))) a <- function(a,b) c(a,b) stopifnot(c(2,1) == pir.compile(rir.compile(function()f(a)))()) # forcing a promise can inspect the whole call stack f <- pir.compile(rir.compile(function(x) sys.frame(x))) g <- pir.compile(rir.compile(function(y) y)) h <- pir.compile(rir.c...
\name{TML.noncensored.control} \alias{TML.noncensored.control} \title{Control Parameters for Truncated Maximum Likelihood Regression Without Censored Observations} \description{ Control parameters for \code{\link{TML.noncensored}}. Typically only used internally by \code{TML.noncensored},...
/man/TML.noncensored.control.rd
no_license
cran/RobustAFT
R
false
false
3,085
rd
\name{TML.noncensored.control} \alias{TML.noncensored.control} \title{Control Parameters for Truncated Maximum Likelihood Regression Without Censored Observations} \description{ Control parameters for \code{\link{TML.noncensored}}. Typically only used internally by \code{TML.noncensored},...
#' Shorcut for data series from a list of data series #' #' @param hc A \code{highchart} \code{htmlwidget} object. #' @param lst A list of data series. #' #' @examples #' #' ds <- lapply(seq(5), function(x){ #' list(data = cumsum(rnorm(100, 2, 5)), name = x) #' }) #' #' highchart() %>% #' hc_plotO...
/R/shortcuts.R
no_license
bestwpw/highcharter
R
false
false
18,282
r
#' Shorcut for data series from a list of data series #' #' @param hc A \code{highchart} \code{htmlwidget} object. #' @param lst A list of data series. #' #' @examples #' #' ds <- lapply(seq(5), function(x){ #' list(data = cumsum(rnorm(100, 2, 5)), name = x) #' }) #' #' highchart() %>% #' hc_plotO...
% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/crop.circular.roi.R \name{crop.circular.roi} \alias{crop.circular.roi} \title{crop.circular.roi} \usage{ crop.circular.roi(dmat, xc.idx, yc.idx, pix.radius, crop.empty.border = TRUE, roi.type = "inner") } \arguments{ \item{XXXX}{} }...
/man/crop.circular.roi.Rd
no_license
npetraco/feature2
R
false
false
553
rd
% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/crop.circular.roi.R \name{crop.circular.roi} \alias{crop.circular.roi} \title{crop.circular.roi} \usage{ crop.circular.roi(dmat, xc.idx, yc.idx, pix.radius, crop.empty.border = TRUE, roi.type = "inner") } \arguments{ \item{XXXX}{} }...
###################################################### ############# Example: Default -- Logistic Regression ####################################################### ## TASK 1 ## # load library ISLR and see what the dataframe Default looks like library(ISLR) View(Default) # check the names of the columns in Default n...
/Code/Default-Logistic-Regression.R
no_license
AchalSuresh/R-coding
R
false
false
4,793
r
###################################################### ############# Example: Default -- Logistic Regression ####################################################### ## TASK 1 ## # load library ISLR and see what the dataframe Default looks like library(ISLR) View(Default) # check the names of the columns in Default n...
################# CLEAN.R ########################
/clean.R
no_license
markocherrie/Reproducible_Research
R
false
false
50
r
################# CLEAN.R ########################
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/settings.R \name{settings} \alias{print.settings} \alias{settings} \alias{settings.corpus} \alias{settings.default} \alias{settings.dfm} \alias{settings<-} \title{Get or set the corpus settings} \usage{ settings(x, ...) \method{setti...
/man/settings.Rd
no_license
pjsio/quanteda
R
false
false
1,517
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/settings.R \name{settings} \alias{print.settings} \alias{settings} \alias{settings.corpus} \alias{settings.default} \alias{settings.dfm} \alias{settings<-} \title{Get or set the corpus settings} \usage{ settings(x, ...) \method{setti...
### Launching all pair spread computations ### Trying to forecast the spread between ?/? bonds futures # library("SIT") library("RPQuantUtils") library("RPToolsDB") require(ggplot2) require("ppcor") require(graphics) require("TTR") require(plyr) # require(reshape) require(reshape2) require(RColorBrewer) re...
/BOND_FOREX_ML/MONTH_UNI/NAR-269_MARKDOWN_CUM_US_WW_HORIZON_ALL_COMPUTATIONS_2007_MONTH.R
no_license
sduprey/ML_NEWS_STRATEGY
R
false
false
24,891
r
### Launching all pair spread computations ### Trying to forecast the spread between ?/? bonds futures # library("SIT") library("RPQuantUtils") library("RPToolsDB") require(ggplot2) require("ppcor") require(graphics) require("TTR") require(plyr) # require(reshape) require(reshape2) require(RColorBrewer) re...
#----------------------------------------------------------------------------------------------- #Typology #----------------------------------------------------------------------------------------------- message("Typology...") #boundaries are based on all Burgerpeilingen of the past 2 years, update 13 april 2023 ...
/R/SRC/typology.R
no_license
VNG-Realisatie/Burgerpeiling
R
false
false
4,112
r
#----------------------------------------------------------------------------------------------- #Typology #----------------------------------------------------------------------------------------------- message("Typology...") #boundaries are based on all Burgerpeilingen of the past 2 years, update 13 april 2023 ...
###Sumulate the game of throwing sixes with five dice library(ggplo2) set.seed(110143) simulate.game <- function(...){ # 1) Simulate one run of the game continue <- TRUE # Dummy to know if we must throw again win <- TRUE # Dummmy that will change to false if one throws no 6 at any point dice.left <- 6 # Dic...
/Rcode/TiraDados.R
no_license
stu-keil/ComputationalStatistics
R
false
false
879
r
###Sumulate the game of throwing sixes with five dice library(ggplo2) set.seed(110143) simulate.game <- function(...){ # 1) Simulate one run of the game continue <- TRUE # Dummy to know if we must throw again win <- TRUE # Dummmy that will change to false if one throws no 6 at any point dice.left <- 6 # Dic...
source('./library.R') # Set number of workers, i.e. number of threads to give to R. # Number of Iterations in generator.R is split up by this. registerDoMC(4) seed <- registerDoRNG(20200218) # Test parameters. # copulaList: Bivariate Copula functions to use to generate simulation data # Change not supported in run.R...
/parameters.R
permissive
Heril/CopulaControl
R
false
false
1,175
r
source('./library.R') # Set number of workers, i.e. number of threads to give to R. # Number of Iterations in generator.R is split up by this. registerDoMC(4) seed <- registerDoRNG(20200218) # Test parameters. # copulaList: Bivariate Copula functions to use to generate simulation data # Change not supported in run.R...
################################################################################################## # program name : PRS_UKB_201711_step15-02_calcu-prevalence-binary-outcomes_summarise-continuous-outcomes.R # modifiied from : PRS_UKB_201711_step15-01_make-input-files-for-1varGREML.R # purpose : Summari...
/scripts/PRS_UKB_201711_step15-02_calcu-prevalence-binary-outcomes_summarise-continuous-outcomes.R
no_license
yanch86/PhD_polygenic_risk_score_analysis
R
false
false
47,514
r
################################################################################################## # program name : PRS_UKB_201711_step15-02_calcu-prevalence-binary-outcomes_summarise-continuous-outcomes.R # modifiied from : PRS_UKB_201711_step15-01_make-input-files-for-1varGREML.R # purpose : Summari...
% Generated by roxygen2 (4.0.0): do not edit by hand \name{cut_number} \alias{cut_number} \title{Cut numeric vector into intervals containing equal number of points.} \usage{ cut_number(x, n = NULL, ...) } \arguments{ \item{x}{numeric vector} \item{n}{number of intervals to create} \item{...}{other arguments passed o...
/man/cut_number.Rd
no_license
richierocks/ggplot2
R
false
false
523
rd
% Generated by roxygen2 (4.0.0): do not edit by hand \name{cut_number} \alias{cut_number} \title{Cut numeric vector into intervals containing equal number of points.} \usage{ cut_number(x, n = NULL, ...) } \arguments{ \item{x}{numeric vector} \item{n}{number of intervals to create} \item{...}{other arguments passed o...
#' Calculating the expected a posteriori value for thetaj (our estimate of thetaj) #' #' Returns the value of thetajhat as specified in Equation (3) #' #' @param raschObj An object of class Rasch #' @param lower The lower limits of integration #' @param upper The upper limits of integration #' #' @return A single nu...
/easyRasch/R/eap.R
no_license
rohan35gupta/Midterm
R
false
false
1,104
r
#' Calculating the expected a posteriori value for thetaj (our estimate of thetaj) #' #' Returns the value of thetajhat as specified in Equation (3) #' #' @param raschObj An object of class Rasch #' @param lower The lower limits of integration #' @param upper The upper limits of integration #' #' @return A single nu...
library(ggplot2) library(magrittr) # data path --------------------------------------------------------------- # Home data_path <- "F:/胡斐斐/我的坚果云/ENCODE-TCGA-LUAD/实验图片/2020-04-01补实验/data_process" result_path <- "F:/胡斐斐/我的坚果云/ENCODE-TCGA-LUAD/实验图片/2020-04-01补实验/Pic_by_R" #+++++++++++++++++++++++++ # Function to calcula...
/experiment_pic/exp_pic_all-subpplement20200401.R
no_license
Huffyphenix/LUAD_pic_code
R
false
false
5,732
r
library(ggplot2) library(magrittr) # data path --------------------------------------------------------------- # Home data_path <- "F:/胡斐斐/我的坚果云/ENCODE-TCGA-LUAD/实验图片/2020-04-01补实验/data_process" result_path <- "F:/胡斐斐/我的坚果云/ENCODE-TCGA-LUAD/实验图片/2020-04-01补实验/Pic_by_R" #+++++++++++++++++++++++++ # Function to calcula...
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function makeCacheMatrix <- function(x = matrix()) { matrix = NULL set = function(y){ x <<- y matrix <<- NULL } get = function() { x } setsolve = function(solve) { ...
/cachematrix.R
no_license
saviv/ProgrammingAssignment2
R
false
false
775
r
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function makeCacheMatrix <- function(x = matrix()) { matrix = NULL set = function(y){ x <<- y matrix <<- NULL } get = function() { x } setsolve = function(solve) { ...
#' at.angle function #' #' This function allows you to obtain the angle of a quaternion in radians and add this as a new #' variable on the input dataset #' @param data Input dataset where we can find the variable #' @param var Variable of the dataset to treat. This variable must be the first component of the quaternio...
/R/at.angle.R
no_license
ceciliasr/armtrack
R
false
false
692
r
#' at.angle function #' #' This function allows you to obtain the angle of a quaternion in radians and add this as a new #' variable on the input dataset #' @param data Input dataset where we can find the variable #' @param var Variable of the dataset to treat. This variable must be the first component of the quaternio...
########################################################################################## # Script to run CellCnn analysis: run CellCnn, calculate summary statistics, calculate # statistical test, generate heatmap, save output files # # Anti-PD-1 melanoma skin cancer data set (collaboration with Carsten Krieg and Mal...
/panel3v3/analysis_CellCnn_PD1_panel3v3_base_combined.R
permissive
zky17715002/PD1_analysis_CellCnn
R
false
false
13,874
r
########################################################################################## # Script to run CellCnn analysis: run CellCnn, calculate summary statistics, calculate # statistical test, generate heatmap, save output files # # Anti-PD-1 melanoma skin cancer data set (collaboration with Carsten Krieg and Mal...
subroutine succ(ksc,i,j,nadj,madj,ntot,nerror) # Find the successor of j in the adjacency list of i. # Called by addpt, initad, trifnd, swap, delout, dirseg, dirout. implicit double precision(a-h,o-z) dimension nadj(-3:ntot,0:madj) nerror = -1 n = nadj(i,0) # If the adjacency list of i is empty, then clearly j ha...
/deldir/SavedRatfor/succ.r
permissive
solgenomics/R_libs
R
false
false
891
r
subroutine succ(ksc,i,j,nadj,madj,ntot,nerror) # Find the successor of j in the adjacency list of i. # Called by addpt, initad, trifnd, swap, delout, dirseg, dirout. implicit double precision(a-h,o-z) dimension nadj(-3:ntot,0:madj) nerror = -1 n = nadj(i,0) # If the adjacency list of i is empty, then clearly j ha...
require(rhdf5) require(sleuth) require(biomaRt) require(tidyr) require(rtracklayer) require(BiocParallel) require(tximport) require(readr) require(RUVSeq) source("~/Development/GeneralPurpose/R/amILocal.R") source("~/Development/GeneralPurpose/R/heatmap.3.R") source("~/Development/GeneralPurpose/R/lsos.R") # defining...
/R/brain_expression_analysis.R
no_license
JCSMR-Tremethick-Lab/TALEN_Mice
R
false
false
20,206
r
require(rhdf5) require(sleuth) require(biomaRt) require(tidyr) require(rtracklayer) require(BiocParallel) require(tximport) require(readr) require(RUVSeq) source("~/Development/GeneralPurpose/R/amILocal.R") source("~/Development/GeneralPurpose/R/heatmap.3.R") source("~/Development/GeneralPurpose/R/lsos.R") # defining...
source("internal_v4.R") foldernames=c("Cell 1") makeplot=TRUE superplot=FALSE skeleton=FALSE sapply(foldernames, function(expname){ nexpname=expname if (skeleton){ nexpname=paste("R_", expname, sep="") dir.create(file.path(nexpname)) file.copy(file.path(paste(expname, "/config.txt", se...
/R code - Bayesian-based cluster analysis/Bayesian cluster analysis of molecular coordinates data for 1 color data/postprocessing_ClusterCentroids_Ch3_v4.R
permissive
Owenlab-UoB/DNA-PAINT-analysis
R
false
false
9,754
r
source("internal_v4.R") foldernames=c("Cell 1") makeplot=TRUE superplot=FALSE skeleton=FALSE sapply(foldernames, function(expname){ nexpname=expname if (skeleton){ nexpname=paste("R_", expname, sep="") dir.create(file.path(nexpname)) file.copy(file.path(paste(expname, "/config.txt", se...
cubist2X <- function(cubistModel , dataFit , zFit = NULL , profIDFit = NULL , allKnotsd = c() , opt_dSpline = 0 , removeColinCols = TRUE , refineCubistModel = FALSE){ ### removeColinCols and refineCubistModel are used in the cubist2XSetup function. if(is.null(opt_dSpline)){ opt_dSpline <- 0 }else{} if(!is...
/cubist2XIAK3D.R
no_license
ortont/iak3d
R
false
false
57,740
r
cubist2X <- function(cubistModel , dataFit , zFit = NULL , profIDFit = NULL , allKnotsd = c() , opt_dSpline = 0 , removeColinCols = TRUE , refineCubistModel = FALSE){ ### removeColinCols and refineCubistModel are used in the cubist2XSetup function. if(is.null(opt_dSpline)){ opt_dSpline <- 0 }else{} if(!is...
#' #' Create example data sets for FraseR #' #' Creates an example data set from a file or simulates a data set based #' on random split read counts following a beta-binomial distribution with #' injected outliers. #' #' @return FraseRDataSet #' #' @examples #' fds <- makeExampleFraseRDataSet() #' fds #' #' @expo...
/R/methods-makeExampleObj.R
permissive
mumichae/FraseR
R
false
false
462
r
#' #' Create example data sets for FraseR #' #' Creates an example data set from a file or simulates a data set based #' on random split read counts following a beta-binomial distribution with #' injected outliers. #' #' @return FraseRDataSet #' #' @examples #' fds <- makeExampleFraseRDataSet() #' fds #' #' @expo...
## File Name: mdmb_exp_overflow.R ## File Version: 0.05 mdmb_exp_overflow <- function(x, M=200) { x <- ifelse( x > M, M, x) y <- exp(x) return(y) }
/R/mdmb_exp_overflow.R
no_license
cran/mdmb
R
false
false
170
r
## File Name: mdmb_exp_overflow.R ## File Version: 0.05 mdmb_exp_overflow <- function(x, M=200) { x <- ifelse( x > M, M, x) y <- exp(x) return(y) }
## ----jags-loadpackages, results='hide', message=FALSE, warnings=FALSE---- library(coda) library(R2jags) ## ----jags-loaddata, echo=TRUE, results='hide', eval=TRUE----------------- data(airquality) Wind = airquality$Wind # wind speed Temp = airquality$Temp # air temperature N = dim(airquality)[1] # number of data poi...
/docs/Rcode/intro-to-jags.R
no_license
ajaynakhawa/atsa-labs
R
false
false
9,249
r
## ----jags-loadpackages, results='hide', message=FALSE, warnings=FALSE---- library(coda) library(R2jags) ## ----jags-loaddata, echo=TRUE, results='hide', eval=TRUE----------------- data(airquality) Wind = airquality$Wind # wind speed Temp = airquality$Temp # air temperature N = dim(airquality)[1] # number of data poi...
#Script to generate summary counts of cloud-free pixels for Paramo, examining different windows of time #Analysis is by Year, StartMonth and WindowLength #Output is counts of pixels with 0,1,2,3,4,5,6+ cloud free images in a given window, for entire images and masked to study area #Output summary data files (csv) is w...
/ClearImages.r
no_license
jamesdamillington/LandTrendr-Paramo
R
false
false
8,261
r
#Script to generate summary counts of cloud-free pixels for Paramo, examining different windows of time #Analysis is by Year, StartMonth and WindowLength #Output is counts of pixels with 0,1,2,3,4,5,6+ cloud free images in a given window, for entire images and masked to study area #Output summary data files (csv) is w...
library(tidyverse) library(janitor) library(ruimtehol) library(ggwordcloud) library(M3C) # T-SNE plot load('cleanData.RData') ############################################################################### # Approach 1: supervised learning ##################################################################...
/R/starspace.R
permissive
StatsGary/pxtextmining
R
false
false
6,544
r
library(tidyverse) library(janitor) library(ruimtehol) library(ggwordcloud) library(M3C) # T-SNE plot load('cleanData.RData') ############################################################################### # Approach 1: supervised learning ##################################################################...
# Functions for Using D3 Graphics ----------------------------------------- #' D3 RadialTree Visual #' #' Function to create a D3 radialtree graphic. #' @param data Data for the radialtree - TODO: give format #' @param width,height Parameters to override the default sizing policy #' #' @export #' @name RadialTree #...
/R/d3_radialtree.R
permissive
cwthom/r2d3wrappers
R
false
false
721
r
# Functions for Using D3 Graphics ----------------------------------------- #' D3 RadialTree Visual #' #' Function to create a D3 radialtree graphic. #' @param data Data for the radialtree - TODO: give format #' @param width,height Parameters to override the default sizing policy #' #' @export #' @name RadialTree #...
avgGroupExpression = function (geneExpr, groups) { avg.expr = tapply(geneExpr, groups, mean) return(avg.expr) }#end def avgGroupExpression calc.gene.cor = function(arr, indep.var) { na.count = length(arr[!is.na(arr)]) if((na.count >= 3) & (sd(arr) != 0)){ gene.cor.coef = cor(arr,indep.var) } else { ...
/Splicing_Workflow/create_stat_table.R
no_license
cwarden45/RNAseq_templates
R
false
false
10,814
r
avgGroupExpression = function (geneExpr, groups) { avg.expr = tapply(geneExpr, groups, mean) return(avg.expr) }#end def avgGroupExpression calc.gene.cor = function(arr, indep.var) { na.count = length(arr[!is.na(arr)]) if((na.count >= 3) & (sd(arr) != 0)){ gene.cor.coef = cor(arr,indep.var) } else { ...
#' @title Helper function for retrieving gff files from ENSEMBL #' @description This function downloads gff #' files of query organisms from ENSEMBL. #' @param organism scientific name of the organism of interest. #' @param type specification type. #' @param id.type id type. #' @param path location where file shall be...
/R/getENSEMBL.gtf.R
no_license
arpankbasak/biomartr
R
false
false
10,389
r
#' @title Helper function for retrieving gff files from ENSEMBL #' @description This function downloads gff #' files of query organisms from ENSEMBL. #' @param organism scientific name of the organism of interest. #' @param type specification type. #' @param id.type id type. #' @param path location where file shall be...
library(shiny) # Define UI for application that draws a histogram and options shinyUI( navbarPage("Distribution Histogram Generator", tabPanel("Application", fluidPage( # Sidebar with input options sidebarLayout( sidebarPanel( ...
/ShinyApp/ui.R
no_license
Asteradum/Developing_Data_Products
R
false
false
2,355
r
library(shiny) # Define UI for application that draws a histogram and options shinyUI( navbarPage("Distribution Histogram Generator", tabPanel("Application", fluidPage( # Sidebar with input options sidebarLayout( sidebarPanel( ...
library(RSQLite) library(dplyr) #Distance default_rating <- 1300 conl <- statskier2::db_xc_local() dst <- statskier2::ss_query(conl, "select raceid,date,season,cat1,start,gender,name,fisid,nation,time,rank from main where type = 'Distance' ...
/create_data.R
no_license
joranE/skier-elo
R
false
false
1,839
r
library(RSQLite) library(dplyr) #Distance default_rating <- 1300 conl <- statskier2::db_xc_local() dst <- statskier2::ss_query(conl, "select raceid,date,season,cat1,start,gender,name,fisid,nation,time,rank from main where type = 'Distance' ...
# producer pt_name = "A,B,C,D,E" pt_amount = "14975,18099,59015,53707,87809" pt_price = "-500,-334.3,-145.7,-105.8,-60.6" format_data(pt_name,pt_amount,pt_price) # user ut_name = "1,2,3,4,5" ut_amount = "67983,39403,64478,38592,19799" ut_price = "-45,-35.8,-26.7,-14.3,-0.1" format_data(ut_name,ut_amount,ut_price)
/tests/test_format_data.R
no_license
YoungGer/PW.GY
R
false
false
317
r
# producer pt_name = "A,B,C,D,E" pt_amount = "14975,18099,59015,53707,87809" pt_price = "-500,-334.3,-145.7,-105.8,-60.6" format_data(pt_name,pt_amount,pt_price) # user ut_name = "1,2,3,4,5" ut_amount = "67983,39403,64478,38592,19799" ut_price = "-45,-35.8,-26.7,-14.3,-0.1" format_data(ut_name,ut_amount,ut_price)
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/misc.R \name{plotMetadata,metadata.binary-method} \alias{plotMetadata,metadata.binary-method} \title{Plot a metadata object} \usage{ \S4method{plotMetadata}{metadata.binary}(m) } \arguments{ \item{m}{A metadata object} } \value{ A...
/man/plotMetadata-metadata.binary-method.Rd
no_license
cran/bdlp
R
false
true
447
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/misc.R \name{plotMetadata,metadata.binary-method} \alias{plotMetadata,metadata.binary-method} \title{Plot a metadata object} \usage{ \S4method{plotMetadata}{metadata.binary}(m) } \arguments{ \item{m}{A metadata object} } \value{ A...
library(testthat) library(methods) library(shinytest) library(scriptgloss) test_check("scriptgloss")
/tests/testthat.R
no_license
dgkf/scriptgloss
R
false
false
102
r
library(testthat) library(methods) library(shinytest) library(scriptgloss) test_check("scriptgloss")
HITStatus <- status <- function (hit = NULL, hit.type = NULL, keypair = credentials(), print = getOption('MTurkR.print'), log.requests = getOption('MTurkR.log'), sandbox = getOption('MTurkR.sandbox')){ if((is.null(hit) & is.null(hit.type)) | (!is.null(hit) & !is.null(hit.type))) stop("Must provide...
/R/HITStatus.R
no_license
imclab/MTurkR
R
false
false
2,658
r
HITStatus <- status <- function (hit = NULL, hit.type = NULL, keypair = credentials(), print = getOption('MTurkR.print'), log.requests = getOption('MTurkR.log'), sandbox = getOption('MTurkR.sandbox')){ if((is.null(hit) & is.null(hit.type)) | (!is.null(hit) & !is.null(hit.type))) stop("Must provide...
test_that("Test suite aaa.R",{ expect_silent(as.clifford(0)) expect_silent(as.clifford(0) + as.clifford(3)) expect_silent(as.clifford(3) + as.clifford(0)) expect_silent(as.clifford(3) + as.clifford(0)) expect_silent(as.clifford(0) + as.clifford(0)) expect_error(as.clifford("o")) expect_true...
/fuzzedpackages/clifford/tests/testthat/test_aaa.R
no_license
akhikolla/testpackages
R
false
false
5,180
r
test_that("Test suite aaa.R",{ expect_silent(as.clifford(0)) expect_silent(as.clifford(0) + as.clifford(3)) expect_silent(as.clifford(3) + as.clifford(0)) expect_silent(as.clifford(3) + as.clifford(0)) expect_silent(as.clifford(0) + as.clifford(0)) expect_error(as.clifford("o")) expect_true...
################################################################ ### Uncomment to load the packages used in this analysis #lab.packages <- c("lattice", "gmodels", "car","ggplot2","extrafont","ggthemes","zoo","reshape2", #"maptools","rgdal","rgeos","ggmap","sp","hexbin",") #install.packages(pkgs=lab.packages) packages ...
/code/packages.R
no_license
yingxuIST/voucher
R
false
false
6,558
r
################################################################ ### Uncomment to load the packages used in this analysis #lab.packages <- c("lattice", "gmodels", "car","ggplot2","extrafont","ggthemes","zoo","reshape2", #"maptools","rgdal","rgeos","ggmap","sp","hexbin",") #install.packages(pkgs=lab.packages) packages ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/jpa_bib_functions.R \name{inLineCite_JPN} \alias{inLineCite_JPN} \title{in-Line Cittion(in Japanese)} \usage{ inLineCite_JPN(df) } \arguments{ \item{df}{Bib.df File from jpa_cite} } \description{ in-Line Cittion(in Japanese) }
/man/inLineCite_JPN.Rd
permissive
ykunisato/jpaRmd
R
false
true
305
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/jpa_bib_functions.R \name{inLineCite_JPN} \alias{inLineCite_JPN} \title{in-Line Cittion(in Japanese)} \usage{ inLineCite_JPN(df) } \arguments{ \item{df}{Bib.df File from jpa_cite} } \description{ in-Line Cittion(in Japanese) }
context("dispersion parameter estimation") data("anorexia", package = "MASS") anorexML <- glm(Postwt ~ Prewt + Treat+ offset(Prewt), family = gaussian, data = anorexia) anorexBR <- update(anorexML, method = "brglmFit") tol <- sqrt(.Machine$double.eps) test_that("dispersion_ML is the usual biased esti...
/tests/testthat/test-dispersion.R
no_license
guhjy/brglm2
R
false
false
1,322
r
context("dispersion parameter estimation") data("anorexia", package = "MASS") anorexML <- glm(Postwt ~ Prewt + Treat+ offset(Prewt), family = gaussian, data = anorexia) anorexBR <- update(anorexML, method = "brglmFit") tol <- sqrt(.Machine$double.eps) test_that("dispersion_ML is the usual biased esti...
#Author: Ruth Keane (ruth.keane19@imperial.ac.uk) #Script: gispractical.R #Desc: gis work #Arguments: none #Input: none #Output: none #Date: Nov 2019 #http://rpubs.com/david_orme/GIS_in_R library(raster) library(sf) library(viridis) library(units) library(rgdal) library(rgeos) library("lwgeom") pop_dens <- data.frame(...
/Week5/Code/gispractical.R
no_license
rbak54/CMEECourseWork
R
false
false
9,053
r
#Author: Ruth Keane (ruth.keane19@imperial.ac.uk) #Script: gispractical.R #Desc: gis work #Arguments: none #Input: none #Output: none #Date: Nov 2019 #http://rpubs.com/david_orme/GIS_in_R library(raster) library(sf) library(viridis) library(units) library(rgdal) library(rgeos) library("lwgeom") pop_dens <- data.frame(...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rprior.R \name{rprior_quant} \alias{rprior_quant} \title{Prior simulation of GEV parameters - prior on quantile scale} \usage{ rprior_quant(n, prob, shape, scale, lb = NULL, lb_prob = 0.001) } \arguments{ \item{n}{A numeric scalar. The size o...
/man/rprior_quant.Rd
no_license
paulnorthrop/revdbayes
R
false
true
2,987
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rprior.R \name{rprior_quant} \alias{rprior_quant} \title{Prior simulation of GEV parameters - prior on quantile scale} \usage{ rprior_quant(n, prob, shape, scale, lb = NULL, lb_prob = 0.001) } \arguments{ \item{n}{A numeric scalar. The size o...
REP=1000 vz4=matrix(0, REP, 1) for(i in 1:REP) { z1=rnorm(5000) z2=rnorm(5000) z3=z1*z2 z4=z3^2 vz4[i,1]=var(z4) } hist(vz4)
/HEQTL/mailman/ScalableMoM/RanMat.R
no_license
gc5k/Notes
R
false
false
135
r
REP=1000 vz4=matrix(0, REP, 1) for(i in 1:REP) { z1=rnorm(5000) z2=rnorm(5000) z3=z1*z2 z4=z3^2 vz4[i,1]=var(z4) } hist(vz4)
\name{display.untb} \alias{display.untb} \title{Animation of neutral ecological drift} \description{ Displays an ongoing simulation of neutral ecological drift using nice colours and a simple animation technique. \strong{Does not work as intended in \proglang{RStudio}: use base \proglang{R}} } \usage{ display.untb(s...
/man/display.untb.Rd
no_license
RobinHankin/untb
R
false
false
2,996
rd
\name{display.untb} \alias{display.untb} \title{Animation of neutral ecological drift} \description{ Displays an ongoing simulation of neutral ecological drift using nice colours and a simple animation technique. \strong{Does not work as intended in \proglang{RStudio}: use base \proglang{R}} } \usage{ display.untb(s...
\name{apc.plot.data.sparsity} \alias{apc.plot.data.sparsity} \title{This plot shows heat map of the sparsity of a data matrix.} \description{The plot shows where the data matrix is sparse.} \usage{apc.plot.data.sparsity(apc.data.list, data.type="a",swap.axes=FALSE, apc.index=NULL, sparsity.limi...
/man/apc.plot.data.sparsity.Rd
no_license
cran/apc
R
false
false
2,710
rd
\name{apc.plot.data.sparsity} \alias{apc.plot.data.sparsity} \title{This plot shows heat map of the sparsity of a data matrix.} \description{The plot shows where the data matrix is sparse.} \usage{apc.plot.data.sparsity(apc.data.list, data.type="a",swap.axes=FALSE, apc.index=NULL, sparsity.limi...
#!/usr/bin/env Rscript # # Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
/scripts/compare_dist.R
permissive
gitanuj/rappor
R
false
false
8,132
r
#!/usr/bin/env Rscript # # Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
# Exercise 3: Working with Data Frames # Load R's "USPersonalExpenditure" dataest using the `data()` function data('USPersonalExpenditure') # The variable USPersonalExpenditure is now accessible to you. Unfortunately, it's not a data.frame # Test this using the is.data.frame function is.data.frame('USPersonalExpendit...
/exercise-3/exercise.R
permissive
ryukiri/m10-dataframes
R
false
false
1,583
r
# Exercise 3: Working with Data Frames # Load R's "USPersonalExpenditure" dataest using the `data()` function data('USPersonalExpenditure') # The variable USPersonalExpenditure is now accessible to you. Unfortunately, it's not a data.frame # Test this using the is.data.frame function is.data.frame('USPersonalExpendit...
########################################################################################## # Script to run methods # # - method: diffcyt-DA-voom # - data set: Anti-PD-1 # # - main results # # Lukas Weber, May 2018 ########################################################################################## library(di...
/Anti_PD_1/run_methods/main/run_Anti_PD_1_diffcyt_DA_voom_main.R
permissive
lmweber/diffcyt-evaluations
R
false
false
7,921
r
########################################################################################## # Script to run methods # # - method: diffcyt-DA-voom # - data set: Anti-PD-1 # # - main results # # Lukas Weber, May 2018 ########################################################################################## library(di...