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
## plot1.R ## ## Author: Ted Randall ## Date: 2/5/2015 ## Setup filename constants data_source_url <- "https://d396qusza40orc.cloudfront.net/exdata/data/" data_zip_filename <- "household_power_consumption.zip" data_filename <- "household_power_consumption.txt" output_filename <- "plot1.png" ## Check if the data file ...
/plot1.R
no_license
theoco/ExData_Plotting1
R
false
false
1,438
r
## plot1.R ## ## Author: Ted Randall ## Date: 2/5/2015 ## Setup filename constants data_source_url <- "https://d396qusza40orc.cloudfront.net/exdata/data/" data_zip_filename <- "household_power_consumption.zip" data_filename <- "household_power_consumption.txt" output_filename <- "plot1.png" ## Check if the data file ...
#' Framework7 preloader #' #' \code{showF7Preloader} shows a preloader. #' #' @param target Element where preloader overlay will be added. #' @param color Preloader color. #' @param session Shiny session object. #' @export #' @rdname preloader #' @examples #' if (interactive()) { #' library(shiny) #' library(shinyMob...
/R/f7Preloader.R
no_license
RinteRface/shinyMobile
R
false
false
4,203
r
#' Framework7 preloader #' #' \code{showF7Preloader} shows a preloader. #' #' @param target Element where preloader overlay will be added. #' @param color Preloader color. #' @param session Shiny session object. #' @export #' @rdname preloader #' @examples #' if (interactive()) { #' library(shiny) #' library(shinyMob...
\name{acryl} \alias{acryl} \docType{data} \title{NTP raw data - organ weight} \description{ National Toxicology Program 13 Weeks Gavage Study on Female B6C3F1 Mice administered with Acrylonitrile (107-13-1, C50215B,5021501)} \usage{data("acryl")} \format{ A data frame with 47 observations on the following 2 variable...
/man/acryl.Rd
no_license
YoJimboDurant/SiTuR
R
false
false
523
rd
\name{acryl} \alias{acryl} \docType{data} \title{NTP raw data - organ weight} \description{ National Toxicology Program 13 Weeks Gavage Study on Female B6C3F1 Mice administered with Acrylonitrile (107-13-1, C50215B,5021501)} \usage{data("acryl")} \format{ A data frame with 47 observations on the following 2 variable...
\name{p_rsize_Weibull} \alias{p_rsize_Weibull} \title{Weibull size biased c.d.f. of order \eqn{r}.} \description{Calculates the cumulative distribution of the \eqn{r-}size biased Weibull distribution.} \usage{p_rsize_Weibull(q,TRpar,r) } \arguments{ \item{q }{Points where the functional is being calcu...
/man/p_rsize_Weibull.Rd
no_license
cran/RSizeBiased
R
false
false
1,643
rd
\name{p_rsize_Weibull} \alias{p_rsize_Weibull} \title{Weibull size biased c.d.f. of order \eqn{r}.} \description{Calculates the cumulative distribution of the \eqn{r-}size biased Weibull distribution.} \usage{p_rsize_Weibull(q,TRpar,r) } \arguments{ \item{q }{Points where the functional is being calcu...
#' Code to compare species richness on quadrats between 1928 (before shrub encroachment) and 2006-2016 (after shrub encroachment) #' Darren suggested subtracting 1928 richness form 2016 for each quadrat then one t-test #' EMC 4/5/21 library(dplyr) library(ggplot2) # colors for figures cbPalette <- c("#999999", "#E69F...
/communitychange/species_richness_difference.R
no_license
emchristensen/JRN_quadrat_timeseries
R
false
false
5,664
r
#' Code to compare species richness on quadrats between 1928 (before shrub encroachment) and 2006-2016 (after shrub encroachment) #' Darren suggested subtracting 1928 richness form 2016 for each quadrat then one t-test #' EMC 4/5/21 library(dplyr) library(ggplot2) # colors for figures cbPalette <- c("#999999", "#E69F...
library(rtweet) library(dplyr) rtweet::auth_setup_default() user <- "your_username" timeline <- get_timeline(user, n = 2000) dt <- dplyr::filter(timeline, created_at < "2020-11-01") invisible(sapply(dt[1:nrow(dt),]$status_id, function(x){ Sys.sleep(0.5) rtweet::post_destroy(x) }))
/scripts/curate_tweets.R
no_license
jsta/twitter-likes_dashboard
R
false
false
292
r
library(rtweet) library(dplyr) rtweet::auth_setup_default() user <- "your_username" timeline <- get_timeline(user, n = 2000) dt <- dplyr::filter(timeline, created_at < "2020-11-01") invisible(sapply(dt[1:nrow(dt),]$status_id, function(x){ Sys.sleep(0.5) rtweet::post_destroy(x) }))
# percent matching genotypes between pairs library(qtl2) file <- "_cache/compare_geno.rds" if(file.exists(file)) { cg <- readRDS(file) } else { cg <- compare_geno(do, cores=0) saveRDS(cg, file) } prop_match_fig <- function(label=FALSE) { par(mar=c(6.1, 1.1, 1.1, 1.1), cex=1.7, cex.lab=1.3, cex.axis=1....
/13_datadiag/R/percent_matching_geno.R
permissive
kbroman/AdvData
R
false
false
1,067
r
# percent matching genotypes between pairs library(qtl2) file <- "_cache/compare_geno.rds" if(file.exists(file)) { cg <- readRDS(file) } else { cg <- compare_geno(do, cores=0) saveRDS(cg, file) } prop_match_fig <- function(label=FALSE) { par(mar=c(6.1, 1.1, 1.1, 1.1), cex=1.7, cex.lab=1.3, cex.axis=1....
source("src/generalFunctions.R") source("src/allocationFunction.R") source("src/coreAlgo.R") source("src/callLpSolve.R") library("testthat") library("XLConnect") filePath <- "test/testObjectives/objectivesPerformance.xlsx" pref1 <- c(10,0) pref2 <- c(8,2) pref3 <- c(5,5) pref4 <- c(2,8) pref5 <- c(0,10) testCallNum...
/test/v0.0.2/testObjectives/objectivesTests3.R
no_license
AcuoFS/acuo-allocation
R
false
false
4,753
r
source("src/generalFunctions.R") source("src/allocationFunction.R") source("src/coreAlgo.R") source("src/callLpSolve.R") library("testthat") library("XLConnect") filePath <- "test/testObjectives/objectivesPerformance.xlsx" pref1 <- c(10,0) pref2 <- c(8,2) pref3 <- c(5,5) pref4 <- c(2,8) pref5 <- c(0,10) testCallNum...
# print("tic") # Sys.sleep(3) # print("tic") ## Function to know the given time and value catch <- function(LC, Boundary, Condition, LCname){ # Look at superior or inferior values depending on the variable of Condition if (Condition == 1){ Rows <- which(LC >= Boundary, arr.in=TRUE); } else if (Cond...
/UserFunction/catch.R
no_license
pmlefeuvre/NVE_work
R
false
false
1,063
r
# print("tic") # Sys.sleep(3) # print("tic") ## Function to know the given time and value catch <- function(LC, Boundary, Condition, LCname){ # Look at superior or inferior values depending on the variable of Condition if (Condition == 1){ Rows <- which(LC >= Boundary, arr.in=TRUE); } else if (Cond...
library(plumber) r <- plumb("~/cmsc150-project-api/router.r") r$run(port=8000)
/run.r
no_license
raintomista/CMSC150-Project-API
R
false
false
84
r
library(plumber) r <- plumb("~/cmsc150-project-api/router.r") r$run(port=8000)
\name{xyplot.mvna} \alias{xyplot.mvna} \title{ Panel plots for object of class 'mvna' } \description{ xyplot function for objects of class \code{mvna}. Estimates of the cumulative hazards are plotted as a function of time for all the transitions specified by the user. The function can also plot several types o...
/man/xyplot.mvna.Rd
no_license
cran/mvna
R
false
false
2,628
rd
\name{xyplot.mvna} \alias{xyplot.mvna} \title{ Panel plots for object of class 'mvna' } \description{ xyplot function for objects of class \code{mvna}. Estimates of the cumulative hazards are plotted as a function of time for all the transitions specified by the user. The function can also plot several types o...
library(ggsci) ### Name: scale_color_rickandmorty ### Title: Rick and Morty Color Scales ### Aliases: scale_color_rickandmorty scale_colour_rickandmorty ### scale_fill_rickandmorty ### ** Examples library("ggplot2") data("diamonds") ggplot(subset(diamonds, carat >= 2.2), aes(x = table, y = price, colour =...
/data/genthat_extracted_code/ggsci/examples/scale_rickandmorty.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
683
r
library(ggsci) ### Name: scale_color_rickandmorty ### Title: Rick and Morty Color Scales ### Aliases: scale_color_rickandmorty scale_colour_rickandmorty ### scale_fill_rickandmorty ### ** Examples library("ggplot2") data("diamonds") ggplot(subset(diamonds, carat >= 2.2), aes(x = table, y = price, colour =...
library(readxl) library(plyr) library(readr) library("writexl") library(lubridate) library(reshape2) print("TurbineAnalysis") ### Open Excel File and Extract Relevant Data ### ## read_excel reads .xlsx files, read_csv reads .csv files. ## ## If using csv file directly from the website, include the skip argument to ...
/Processing Scripts/TurbineAnalysis.R
no_license
ischerr/ScottishEnergyStatsProcessing
R
false
false
4,434
r
library(readxl) library(plyr) library(readr) library("writexl") library(lubridate) library(reshape2) print("TurbineAnalysis") ### Open Excel File and Extract Relevant Data ### ## read_excel reads .xlsx files, read_csv reads .csv files. ## ## If using csv file directly from the website, include the skip argument to ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/MixtureTest.R \name{SimulationTest} \alias{SimulationTest} \title{SimulationTest} \usage{ SimulationTest(signatureMatrix, maxCoefs, maxSamples, noisy = TRUE, useCores) } \arguments{ \item{signatureMatrix}{the NxK molecular signature matrix} ...
/man/SimulationTest.Rd
permissive
elmerfer/MIXTURE
R
false
true
712
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/MixtureTest.R \name{SimulationTest} \alias{SimulationTest} \title{SimulationTest} \usage{ SimulationTest(signatureMatrix, maxCoefs, maxSamples, noisy = TRUE, useCores) } \arguments{ \item{signatureMatrix}{the NxK molecular signature matrix} ...
x=seq(1, 10, len=1) y=40*2 + rnorm(10,0,5) plot(x,y) summary (x) mean(x) mean (y)
/analysis.R
no_license
AC1986/Test-_ARC-_R-Course
R
false
false
82
r
x=seq(1, 10, len=1) y=40*2 + rnorm(10,0,5) plot(x,y) summary (x) mean(x) mean (y)
\name{manip} \alias{arrange} \alias{filter} \alias{manip} \alias{mutate} \alias{select} \alias{summarise} \title{Data manipulation functions.} \usage{ filter(.data, ...) summarise(.data, ...) mutate(.data, ...) arrange(.data, ...) select(.data, ...) } \arguments{ \item{.data}{a tbl} \item{...}{variables interp...
/dplyr/man/manip.Rd
no_license
radfordneal/R-package-mods
R
false
false
2,256
rd
\name{manip} \alias{arrange} \alias{filter} \alias{manip} \alias{mutate} \alias{select} \alias{summarise} \title{Data manipulation functions.} \usage{ filter(.data, ...) summarise(.data, ...) mutate(.data, ...) arrange(.data, ...) select(.data, ...) } \arguments{ \item{.data}{a tbl} \item{...}{variables interp...
### Function to run PGEE #'Inputs #'@param y (n_subj x n_visits)-vector of binary values for the response. #'@param X ((n_subj x n_visits) x P) design matrix containing all covariates P included in the model (incl intercept) #'@param n_subj Number of subjects #'@param n_visits Number of time points per subject. As...
/src/pgee_logPoisson_dispersion_fn.R
no_license
NISOx-BDI/PGEE_Illustration
R
false
false
10,708
r
### Function to run PGEE #'Inputs #'@param y (n_subj x n_visits)-vector of binary values for the response. #'@param X ((n_subj x n_visits) x P) design matrix containing all covariates P included in the model (incl intercept) #'@param n_subj Number of subjects #'@param n_visits Number of time points per subject. As...
testlist <- list(A = structure(c(3.63645450877148e+255, 9.53818252170339e+295, 1.22810536108214e+146, 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)), B = structure(0, .Dim = c(1L, 1L))) result <- do.call(multivariance:::match_ro...
/multivariance/inst/testfiles/match_rows/AFL_match_rows/match_rows_valgrind_files/1613105440-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
344
r
testlist <- list(A = structure(c(3.63645450877148e+255, 9.53818252170339e+295, 1.22810536108214e+146, 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)), B = structure(0, .Dim = c(1L, 1L))) result <- do.call(multivariance:::match_ro...
#! /usr/bin/env Rscript ## MI flow cytometry processing ############################################## ### Panel 1 - Naive & Memory T cell subsets ## ############################################## library(flowCore) library(flowWorkspace) library(flowStats) library(openCyto) library(flowViz) library(ggcyto) library(ggp...
/Rscript/FlowCytometry_Processing/MI_FlowProcess_Panel1B.R
permissive
AmrR101/VariabilityGenetics2019
R
false
false
16,206
r
#! /usr/bin/env Rscript ## MI flow cytometry processing ############################################## ### Panel 1 - Naive & Memory T cell subsets ## ############################################## library(flowCore) library(flowWorkspace) library(flowStats) library(openCyto) library(flowViz) library(ggcyto) library(ggp...
#this is the ggplot2 tutorial code #load in the tidyverse package library(tidyverse) #look at the example data str(mpg) #use qplot() qplot(displ,cty,data=mpg) qplot(displ,hwy,data=mpg,facets = .~drv) #use ggplot mpg %>% ggplot(aes(x=manufacturer,y="",fill=model)) #what happens in this line? mpg %>% ggpl...
/weekly_code/week5_ggplot2.R
no_license
williamsbenjamin/Introduction-to-Text-Mining-with-R
R
false
false
871
r
#this is the ggplot2 tutorial code #load in the tidyverse package library(tidyverse) #look at the example data str(mpg) #use qplot() qplot(displ,cty,data=mpg) qplot(displ,hwy,data=mpg,facets = .~drv) #use ggplot mpg %>% ggplot(aes(x=manufacturer,y="",fill=model)) #what happens in this line? mpg %>% ggpl...
#Loading Data data <- read.table("exdata_data_household_power_consumption/household_power_consumption.txt", sep = ";", header = TRUE, na.strings = "?") head(data) str(data) #Subsetting Data sub <- subset(data, Date == "1/2/2007" | Date =="2/2/2007") #Joining Data and Time coloum and adding FullTimeDate <- strptime...
/plot4.R
no_license
shradheyagupta/ExData_Plotting1
R
false
false
1,291
r
#Loading Data data <- read.table("exdata_data_household_power_consumption/household_power_consumption.txt", sep = ";", header = TRUE, na.strings = "?") head(data) str(data) #Subsetting Data sub <- subset(data, Date == "1/2/2007" | Date =="2/2/2007") #Joining Data and Time coloum and adding FullTimeDate <- strptime...
#' Scales for eye separation #' #' \code{scale_eyes} lets you customise how eye separation is determined from your data. #' It also lets you tweak the appearance of legends and so on. #' #' Use \code{range} to vary how happily/sadly your maximum/minimum values are represented. #' Minima smaller than -1 and maxima great...
/R/scale_eyes.R
no_license
Selbosh/ggChernoff
R
false
false
1,997
r
#' Scales for eye separation #' #' \code{scale_eyes} lets you customise how eye separation is determined from your data. #' It also lets you tweak the appearance of legends and so on. #' #' Use \code{range} to vary how happily/sadly your maximum/minimum values are represented. #' Minima smaller than -1 and maxima great...
library(tidyr) library(dplyr) library(magrittr) # Define functions ============================================================= ## Define the function for ID extracting extract_prefix_before_point <- function(raw_id, which_point = 2) { cut_position <- raw_id %>% gregexpr(pattern = "[.]") %>% ...
/Part2/scripts/get_protein2gene.R
permissive
Woodformation1136/SingleCell
R
false
false
3,766
r
library(tidyr) library(dplyr) library(magrittr) # Define functions ============================================================= ## Define the function for ID extracting extract_prefix_before_point <- function(raw_id, which_point = 2) { cut_position <- raw_id %>% gregexpr(pattern = "[.]") %>% ...
## Stat 133 Midterm 2 ## Thursday April 2nd present <- "yes" ## General R commands # [1 pt] # Create [x], a numeric vector of length 1000 with # entries: 6, 12, 18, etc. x <- seq(from = 6, by = 6, length.out = 1000) # [1 pt] # Create [y], a logical vector of length 2000 # with y[i]=T if x[i] is divisible by 10,...
/midterm2/midterm2.r
no_license
Chenyb/stat133
R
false
false
4,553
r
## Stat 133 Midterm 2 ## Thursday April 2nd present <- "yes" ## General R commands # [1 pt] # Create [x], a numeric vector of length 1000 with # entries: 6, 12, 18, etc. x <- seq(from = 6, by = 6, length.out = 1000) # [1 pt] # Create [y], a logical vector of length 2000 # with y[i]=T if x[i] is divisible by 10,...
#' @export length.R6 <- function(x) { if (is.function(.subset2(x, ".__length__"))) { .subset2(x, ".__length__")() } else { NextMethod("length", x) } } #' @export names.R6 <- function(x) { if (is.function(.subset2(x, ".__names__"))) { .subset2(x, ".__names__")() } else { NextMethod("names", x...
/R/misc.R
permissive
mattwarkentin/R6methods
R
false
false
532
r
#' @export length.R6 <- function(x) { if (is.function(.subset2(x, ".__length__"))) { .subset2(x, ".__length__")() } else { NextMethod("length", x) } } #' @export names.R6 <- function(x) { if (is.function(.subset2(x, ".__names__"))) { .subset2(x, ".__names__")() } else { NextMethod("names", x...
# Build a model from data
/src/model.R
no_license
rlads2019/project-template
R
false
false
26
r
# Build a model from data
############################################################################################## ############################################################################################## ##### CREATED 1/28/2018 ##### #install.packages("lqa") ###predictors correlation of 0.2 rm(list=ls()) library("lqa") # version 1.0...
/simulation/case2/sampleSize200/lassoStepwiseY_high_start_401.R
no_license
TingtingKayla/Stats_Robust_Causal_Estimation
R
false
false
8,510
r
############################################################################################## ############################################################################################## ##### CREATED 1/28/2018 ##### #install.packages("lqa") ###predictors correlation of 0.2 rm(list=ls()) library("lqa") # version 1.0...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/multinom_TS.R \name{check_changepoints} \alias{check_changepoints} \title{Check that a set of change point locations is proper} \usage{ check_changepoints(changepoints = NULL) } \arguments{ \item{changepoints}{Change point locations to evalua...
/man/check_changepoints.Rd
permissive
jongjin-kim-ucf/LDATS
R
false
true
581
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/multinom_TS.R \name{check_changepoints} \alias{check_changepoints} \title{Check that a set of change point locations is proper} \usage{ check_changepoints(changepoints = NULL) } \arguments{ \item{changepoints}{Change point locations to evalua...
library(RMySQL) # Define the functions # find the analytes' ramp ids that have pathway associated finderPathways <- function(SourceId,rampIdHasPathway){ hmdbSourceId <- unique(SourceId$V1) hmdbSourceId <- sapply(hmdbSourceId,shQuote) hmdbSourceId <- paste(hmdbSourceId,collapse = ",") query <- paste0("select *...
/paperHeatMap/Compiled Code for figure in paper/Barplot.R
no_license
bofei5675/mathelab
R
false
false
9,126
r
library(RMySQL) # Define the functions # find the analytes' ramp ids that have pathway associated finderPathways <- function(SourceId,rampIdHasPathway){ hmdbSourceId <- unique(SourceId$V1) hmdbSourceId <- sapply(hmdbSourceId,shQuote) hmdbSourceId <- paste(hmdbSourceId,collapse = ",") query <- paste0("select *...
# build the misclassified cohort...this function implements all the steps # described in misclass_fdr_setup.R draw_misclass_cohort <- function(n_miss){ # Draw misclassified cases from the cf population sim_mis <- cf_cases %>% sample_n(n_miss) %>% select(strata,id) # Draw a control cohort (i.e., no...
/R/cftr_functions.R
no_license
aarmiller/epi2_simulation_examples
R
false
false
4,038
r
# build the misclassified cohort...this function implements all the steps # described in misclass_fdr_setup.R draw_misclass_cohort <- function(n_miss){ # Draw misclassified cases from the cf population sim_mis <- cf_cases %>% sample_n(n_miss) %>% select(strata,id) # Draw a control cohort (i.e., no...
data <- read.csv("household_power_consumption.txt", skip=66637, nrows=2880, na.strings = "?", header=F, sep=";") names(data) <- names(read.csv("household_power_consumption.txt", nrows=1,sep=";")) data$DateTime <- as.POSIXct(paste(data$...
/plot4.R
no_license
suryaraj/ExData_Plotting1
R
false
false
1,331
r
data <- read.csv("household_power_consumption.txt", skip=66637, nrows=2880, na.strings = "?", header=F, sep=";") names(data) <- names(read.csv("household_power_consumption.txt", nrows=1,sep=";")) data$DateTime <- as.POSIXct(paste(data$...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/epiBox.R \name{epiBox} \alias{epiBox} \title{Make Boxplot from Comparison Matrix} \usage{ epiBox(compare.matrix, value, type, box.colors = NULL, add.points = FALSE, points.colors = NULL, pdf.height = 10, pdf.width = 10, sve = FALSE) } \argu...
/man/epiBox.Rd
no_license
xiaowenchenjax/epihet
R
false
true
2,800
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/epiBox.R \name{epiBox} \alias{epiBox} \title{Make Boxplot from Comparison Matrix} \usage{ epiBox(compare.matrix, value, type, box.colors = NULL, add.points = FALSE, points.colors = NULL, pdf.height = 10, pdf.width = 10, sve = FALSE) } \argu...
library(glmnet) mydata = read.table("./TrainingSet/LassoBIC/autonomic_ganglia.csv",head=T,sep=",") x = as.matrix(mydata[,4:ncol(mydata)]) y = as.matrix(mydata[,1]) set.seed(123) glm = cv.glmnet(x,y,nfolds=10,type.measure="mse",alpha=0.35,family="gaussian",standardize=FALSE) sink('./Model/EN/Lasso/autonomic_ganglia/auto...
/Model/EN/Lasso/autonomic_ganglia/autonomic_ganglia_046.R
no_license
leon1003/QSMART
R
false
false
385
r
library(glmnet) mydata = read.table("./TrainingSet/LassoBIC/autonomic_ganglia.csv",head=T,sep=",") x = as.matrix(mydata[,4:ncol(mydata)]) y = as.matrix(mydata[,1]) set.seed(123) glm = cv.glmnet(x,y,nfolds=10,type.measure="mse",alpha=0.35,family="gaussian",standardize=FALSE) sink('./Model/EN/Lasso/autonomic_ganglia/auto...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/sp.env.functions.R \name{betaFun} \alias{betaFun} \title{Beta response function} \usage{ betaFun(x, p1, p2, alpha, gamma) } \arguments{ \item{x}{a numeric value or vector. The input environmental variable.} \item{p1}{a numeric value ...
/man/betaFun.Rd
no_license
samuelbosch/virtualspecies
R
false
false
2,064
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/sp.env.functions.R \name{betaFun} \alias{betaFun} \title{Beta response function} \usage{ betaFun(x, p1, p2, alpha, gamma) } \arguments{ \item{x}{a numeric value or vector. The input environmental variable.} \item{p1}{a numeric value ...
context("print.dust") test_that("printing to console succeeds with defaults", { fit <- lm(mpg ~ qsec + factor(am) + wt + factor(gear), data = mtcars) x <- dust(fit) expect_silent(x) }) test_that("printing to console succeeds with sprinkles", { fit <- lm(mpg ~ qsec + factor(am) + wt + factor(gear), data = m...
/tests/testthat/test-print.dust.R
no_license
rpietro/pixiedust
R
false
false
3,085
r
context("print.dust") test_that("printing to console succeeds with defaults", { fit <- lm(mpg ~ qsec + factor(am) + wt + factor(gear), data = mtcars) x <- dust(fit) expect_silent(x) }) test_that("printing to console succeeds with sprinkles", { fit <- lm(mpg ~ qsec + factor(am) + wt + factor(gear), data = m...
# Lecture021: Identification and Processing of Missing Values(2) library(mlbench) data("BostonHousing") original_data <- BostonHousing View(BostonHousing) set.seed(2019) BostonHousing[sample(1:nrow(BostonHousing), 80), 'rad'] <- NA BostonHousing[sample(1:nrow(BostonHousing), 80), 'ptratio'] <- NA library(mice) md.pat...
/R Programming/Lecture021.R
no_license
YuqingDuan/R-Programming
R
false
false
3,674
r
# Lecture021: Identification and Processing of Missing Values(2) library(mlbench) data("BostonHousing") original_data <- BostonHousing View(BostonHousing) set.seed(2019) BostonHousing[sample(1:nrow(BostonHousing), 80), 'rad'] <- NA BostonHousing[sample(1:nrow(BostonHousing), 80), 'ptratio'] <- NA library(mice) md.pat...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/fast_bi_graph.R \name{fast_bi_igraph} \alias{fast_bi_igraph} \title{Fastly create igraph object from bipartite data using data.table} \usage{ fast_bi_igraph(data, edge_threshold = 1300, skip_make_unique = FALSE) } \arguments{ \item{data}{`dat...
/man/fast_bi_igraph.Rd
no_license
tilltnet/rdimensions
R
false
true
607
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/fast_bi_graph.R \name{fast_bi_igraph} \alias{fast_bi_igraph} \title{Fastly create igraph object from bipartite data using data.table} \usage{ fast_bi_igraph(data, edge_threshold = 1300, skip_make_unique = FALSE) } \arguments{ \item{data}{`dat...
#' @title Cnn_learner #' #' @description Build a convnet style learner from `dls` and `arch` #' #' #' @param dls data loader object #' @param arch a model architecture #' @param loss_func loss function #' @param pretrained pre-trained or not #' @param cut cut #' @param splitter It is a function that takes self.model an...
/R/cnn_learner.R
permissive
Cdk29/fastai
R
false
false
7,390
r
#' @title Cnn_learner #' #' @description Build a convnet style learner from `dls` and `arch` #' #' #' @param dls data loader object #' @param arch a model architecture #' @param loss_func loss function #' @param pretrained pre-trained or not #' @param cut cut #' @param splitter It is a function that takes self.model an...
#' Function aiming to choose the best k values based on RSS from a NMF estimation such as: #' estimate <- nmf(mut96_mat, rank=2:14, method="brunet", nrun=100, seed=123456,.options="kvp2") #' Previous one uses two cores in case they are available. It saves all runs results #' #' @param nmf_measures the measures fro...
/deNovo_Signatures/custom_workflow/kSelectionRSS.R
no_license
MMaqueda/MutSig_WGSvsWES
R
false
false
1,034
r
#' Function aiming to choose the best k values based on RSS from a NMF estimation such as: #' estimate <- nmf(mut96_mat, rank=2:14, method="brunet", nrun=100, seed=123456,.options="kvp2") #' Previous one uses two cores in case they are available. It saves all runs results #' #' @param nmf_measures the measures fro...
test_tbl <- yelp_search("thai", "Charlottesville") test_tbl %>% leaflet() %>% addTiles() %>% addMarkers(lng = test_tbl$lon, lat = test_tbl$lat, popup = test_tbl$name) empty_table <- yelpr:::create_empty_business_tbl() dplyr::bind_rows(test_tbl, empty_table)
/test/manual_tests/leaflet.R
permissive
SamanthaToet/yelpr
R
false
false
280
r
test_tbl <- yelp_search("thai", "Charlottesville") test_tbl %>% leaflet() %>% addTiles() %>% addMarkers(lng = test_tbl$lon, lat = test_tbl$lat, popup = test_tbl$name) empty_table <- yelpr:::create_empty_business_tbl() dplyr::bind_rows(test_tbl, empty_table)
##################################### # Automated model selection # Author : Joris Meys # version : 0.2 # date : 12/01/09 ##################################### #CHANGE LOG # 0.2 : check for empty scopevar vector ##################################### # Function has.interaction checks whether x is par...
/ModelSelectionFunctionByJoris.R
no_license
xiaosongz/aim-analytics
R
false
false
3,217
r
##################################### # Automated model selection # Author : Joris Meys # version : 0.2 # date : 12/01/09 ##################################### #CHANGE LOG # 0.2 : check for empty scopevar vector ##################################### # Function has.interaction checks whether x is par...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Proportions.R \name{propConfInt} \alias{propConfInt} \title{Proportion confidence interval} \usage{ propConfInt(x, n, alpha = 0.05) } \arguments{ \item{x}{Number of observations in a category} \item{n}{Number of observations in total} \item...
/man/propConfInt.Rd
no_license
DanielEverland/smartstats
R
false
true
440
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Proportions.R \name{propConfInt} \alias{propConfInt} \title{Proportion confidence interval} \usage{ propConfInt(x, n, alpha = 0.05) } \arguments{ \item{x}{Number of observations in a category} \item{n}{Number of observations in total} \item...
test_that("use_r_hub()", { withr::local_options(usethis.quiet = TRUE) local_temp_dir() local_proj_set() with_mock( check_installed = function(...) TRUE, { use_r_hub(open = FALSE) use_r_hub("boop", open = FALSE) } ) expect_snapshot_file("rhub.R") expect_snapshot_file("boop.R") })
/tests/testthat/test-use_r_hub.R
permissive
emptyfield-ds/opensky
R
false
false
316
r
test_that("use_r_hub()", { withr::local_options(usethis.quiet = TRUE) local_temp_dir() local_proj_set() with_mock( check_installed = function(...) TRUE, { use_r_hub(open = FALSE) use_r_hub("boop", open = FALSE) } ) expect_snapshot_file("rhub.R") expect_snapshot_file("boop.R") })
l <- 21 d1 <- 10-6 d2 <- 10-9 h <- 23-21 czuber <- l + (d1/(d1+d2))*h print(czuber) # Moda = 22.6
/question1F.r
no_license
JohnQ00/Statistics-2019.2
R
false
false
99
r
l <- 21 d1 <- 10-6 d2 <- 10-9 h <- 23-21 czuber <- l + (d1/(d1+d2))*h print(czuber) # Moda = 22.6
# Test Issue # Gabriel Odom and Fernanda Veitzman # 2021-04-27 # We received an issue on GitHub: # https://github.com/lissettegomez/coMethDMR/issues/6 # We met with the issue author, and we will attempt to replicate her issue in # order that we can identify and correct the errors in our code. library(tidyverse) b...
/inst/bug_fixes/issue6_20210427.R
no_license
TransBioInfoLab/coMethDMR
R
false
false
7,288
r
# Test Issue # Gabriel Odom and Fernanda Veitzman # 2021-04-27 # We received an issue on GitHub: # https://github.com/lissettegomez/coMethDMR/issues/6 # We met with the issue author, and we will attempt to replicate her issue in # order that we can identify and correct the errors in our code. library(tidyverse) b...
#This script plots line graph for different parameters vs dates 1/2/2007 and 2/2/2007 fullData<-read.table("household_power_consumption.txt",header=TRUE,sep=";",stringsAsFactors=FALSE); reqData<-subset(fullData,Date=="1/2/2007" | Date == "2/2/2007") png(filename="plot3.png",width=480,height=480) reqData<-transform(reqD...
/plot3.R
no_license
ssjamthe/ExData_Plotting1
R
false
false
840
r
#This script plots line graph for different parameters vs dates 1/2/2007 and 2/2/2007 fullData<-read.table("household_power_consumption.txt",header=TRUE,sep=";",stringsAsFactors=FALSE); reqData<-subset(fullData,Date=="1/2/2007" | Date == "2/2/2007") png(filename="plot3.png",width=480,height=480) reqData<-transform(reqD...
read_multiscango_table_output <- function(file, time_interval = NULL) { check_time_interval(time_interval) input_file_is_multiscango(file) processed_file <- get_raw_file_clean_multiscango(file) df_tmp <- generate_df(processed_file) df_intermediate <- add_col_names(df_tmp) df_final_tmp <- generate_df_result...
/R/read_multiscan_table_output.R
no_license
MartinBanchero/mpxtractor
R
false
false
5,898
r
read_multiscango_table_output <- function(file, time_interval = NULL) { check_time_interval(time_interval) input_file_is_multiscango(file) processed_file <- get_raw_file_clean_multiscango(file) df_tmp <- generate_df(processed_file) df_intermediate <- add_col_names(df_tmp) df_final_tmp <- generate_df_result...
#File to Recode 1988 CES Data #load data data("ces88") #recode Gender (rsex) look_for(ces88, "sex") ces88$male<-Recode(ces88$rsex, "1=1; 5=0") val_labels(ces88$male)<-c(Female=0, Male=1) #checks val_labels(ces88$male) table(ces88$male) #recode Union Respondent (n9) look_for(ces88, "union") ces88$union<-Recode(ces88...
/R_Scripts/2_8_ces88_recode.R
no_license
sjkiss/class_voting_canada_2019
R
false
false
4,164
r
#File to Recode 1988 CES Data #load data data("ces88") #recode Gender (rsex) look_for(ces88, "sex") ces88$male<-Recode(ces88$rsex, "1=1; 5=0") val_labels(ces88$male)<-c(Female=0, Male=1) #checks val_labels(ces88$male) table(ces88$male) #recode Union Respondent (n9) look_for(ces88, "union") ces88$union<-Recode(ces88...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tests.R \name{compare_n_numvars} \alias{compare_n_numvars} \title{Comparison for columns of Gaussian or ordinal measures for n groups} \usage{ compare_n_numvars( .data = rawdata, dep_vars, indep_var, gaussian, round_desc = 2, rang...
/man/compare_n_numvars.Rd
no_license
abusjahn/wrappedtools
R
false
true
1,890
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tests.R \name{compare_n_numvars} \alias{compare_n_numvars} \title{Comparison for columns of Gaussian or ordinal measures for n groups} \usage{ compare_n_numvars( .data = rawdata, dep_vars, indep_var, gaussian, round_desc = 2, rang...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data_handling.R \name{aggregatePrice} \alias{aggregatePrice} \title{Aggregate a time series but keep first and last observation} \usage{ aggregatePrice( pdata, on = "minutes", k = 1, marketopen = "09:30:00", marketclose = "16:00:00"...
/man/aggregatePrice.Rd
no_license
junfanz1/highfrequency
R
false
true
2,384
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data_handling.R \name{aggregatePrice} \alias{aggregatePrice} \title{Aggregate a time series but keep first and last observation} \usage{ aggregatePrice( pdata, on = "minutes", k = 1, marketopen = "09:30:00", marketclose = "16:00:00"...
#Tests for merge-duplicates library("readr") library(logging) library(logger) library(pander) test_that("Merge_duplicates creates hybrid id's for merged rows", { df <- read_csv("test-data/test_merge_two_rows_no_conflicts_input.csv") sfp <- read_csv("../data_prep_scripts/source_field_prioritization_sample_data...
/tests/test-merge-duplicates.R
permissive
CodeForPittsburgh/food-access-map-data
R
false
false
956
r
#Tests for merge-duplicates library("readr") library(logging) library(logger) library(pander) test_that("Merge_duplicates creates hybrid id's for merged rows", { df <- read_csv("test-data/test_merge_two_rows_no_conflicts_input.csv") sfp <- read_csv("../data_prep_scripts/source_field_prioritization_sample_data...
# Load category similarity matrix. # This script is not meant to be used directly, but is called by other scripts. catSim = as.matrix(read.table(paste0(dataDir, "/category_similarity_matrix.txt"), stringsAsFactors = FALSE)) # Verify that the matrix has the right properties if (!(all(abs(diag(catSim) - 1) < 1E-1...
/R_scripts/load_similarity_matrix.R
permissive
turckheim/interdisciplinarity
R
false
false
792
r
# Load category similarity matrix. # This script is not meant to be used directly, but is called by other scripts. catSim = as.matrix(read.table(paste0(dataDir, "/category_similarity_matrix.txt"), stringsAsFactors = FALSE)) # Verify that the matrix has the right properties if (!(all(abs(diag(catSim) - 1) < 1E-1...
library(recipes) ### Name: step_downsample ### Title: Down-Sample a Data Set Based on a Factor Variable ### Aliases: step_downsample tidy.step_downsample ### Keywords: datagen ### ** Examples data(okc) sort(table(okc$diet, useNA = "always")) ds_rec <- recipe( ~ ., data = okc) %>% step_downsample(diet) %>% pre...
/data/genthat_extracted_code/recipes/examples/step_downsample.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
547
r
library(recipes) ### Name: step_downsample ### Title: Down-Sample a Data Set Based on a Factor Variable ### Aliases: step_downsample tidy.step_downsample ### Keywords: datagen ### ** Examples data(okc) sort(table(okc$diet, useNA = "always")) ds_rec <- recipe( ~ ., data = okc) %>% step_downsample(diet) %>% pre...
#Plot 1 #Change language for plotting dates to english Sys.setlocale("LC_TIME", "English") #Read and Subset the file filename = "household_power_consumption.txt" household_power_consumption <- read.csv(file = paste0("./", filename), sep=";",header = TRUE, quote = ";", stringsAsFactors = FALSE) sample = hous...
/Plot 1.R
no_license
joaomiguelrcf/ExData_Plotting1
R
false
false
635
r
#Plot 1 #Change language for plotting dates to english Sys.setlocale("LC_TIME", "English") #Read and Subset the file filename = "household_power_consumption.txt" household_power_consumption <- read.csv(file = paste0("./", filename), sep=";",header = TRUE, quote = ";", stringsAsFactors = FALSE) sample = hous...
"fitfclust" <- function(x=NULL,curve=NULL,timeindex=NULL,data=NULL, q = 5, h = 1, p = 5, K = 2, tol = 0.001, maxit = 20, pert = 0.01, grid = seq(0, 1, length = 100), hard = F, plot= F,trace=F) { # This is the main function to implement the FClust procedure. library(splines) if ...
/fclust.R
no_license
wangx23/FDA_subgroup_sparse
R
false
false
17,555
r
"fitfclust" <- function(x=NULL,curve=NULL,timeindex=NULL,data=NULL, q = 5, h = 1, p = 5, K = 2, tol = 0.001, maxit = 20, pert = 0.01, grid = seq(0, 1, length = 100), hard = F, plot= F,trace=F) { # This is the main function to implement the FClust procedure. library(splines) if ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gen-namespace-docs.R, % R/gen-namespace-examples.R \name{torch_cummax} \alias{torch_cummax} \title{Cummax} \arguments{ \item{input}{(Tensor) the input tensor.} \item{dim}{(int) the dimension to do the operation over} \item{out}{(tuple, op...
/man/torch_cummax.Rd
permissive
minghao2016/torch
R
false
true
871
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gen-namespace-docs.R, % R/gen-namespace-examples.R \name{torch_cummax} \alias{torch_cummax} \title{Cummax} \arguments{ \item{input}{(Tensor) the input tensor.} \item{dim}{(int) the dimension to do the operation over} \item{out}{(tuple, op...
setwd("D:/Edrive/Cow/HERDE/Salma") barcodes <- read.table("barcodes.txt", sep = "\t", header=TRUE) plate_384 <- read.table("plate_chr6_384.txt",sep = "\t", row.names = 1, header = TRUE, check.names = FALSE) genotypes_384 <- read.table("genotypes_chr6_384.txt", sep = "\t", header = TRUE) phenotypes <- read.table("pheno...
/Cows/salma/genotyping_chr6.R
no_license
DannyArends/HU-Berlin
R
false
false
3,586
r
setwd("D:/Edrive/Cow/HERDE/Salma") barcodes <- read.table("barcodes.txt", sep = "\t", header=TRUE) plate_384 <- read.table("plate_chr6_384.txt",sep = "\t", row.names = 1, header = TRUE, check.names = FALSE) genotypes_384 <- read.table("genotypes_chr6_384.txt", sep = "\t", header = TRUE) phenotypes <- read.table("pheno...
# Solutions of adventofcode 2020 https://adventofcode.com/2020
/aoc2020/README.rd
no_license
alex-1q84/learn-racket
R
false
false
64
rd
# Solutions of adventofcode 2020 https://adventofcode.com/2020
##instalation #install.packages("shinydashboard") #install.packages("shinyjs") ## app.R ## library(shinydashboard) library(rsconnect) library(shiny) library(shinyjs) ui <- dashboardPage( dashboardHeader(title = "Manager Files"), dashboardSidebar( sidebarMenu( #menuItem("Dashboard", tabName = "dash...
/app.R
no_license
vitorcirilo3/manager_files
R
false
false
2,402
r
##instalation #install.packages("shinydashboard") #install.packages("shinyjs") ## app.R ## library(shinydashboard) library(rsconnect) library(shiny) library(shinyjs) ui <- dashboardPage( dashboardHeader(title = "Manager Files"), dashboardSidebar( sidebarMenu( #menuItem("Dashboard", tabName = "dash...
gamobs.11 <- function (x, mu = 0, sig = 1, eta = 0, kappa = 1, alf = 2, bet = 2) { r <- (x - mu)/sig 1/sig^2 * (s.3.m.singly.censored(r, alf, bet) - s.2.m.singly.censored(r, alf, bet)^2) * dnorm(x, mean = eta, sd = kappa) }
/R/gamobs.11.R
no_license
alexkowa/EnvStats
R
false
false
249
r
gamobs.11 <- function (x, mu = 0, sig = 1, eta = 0, kappa = 1, alf = 2, bet = 2) { r <- (x - mu)/sig 1/sig^2 * (s.3.m.singly.censored(r, alf, bet) - s.2.m.singly.censored(r, alf, bet)^2) * dnorm(x, mean = eta, sd = kappa) }
require(tidyquant) homeUI <- function(id) { ns <- NS(id) uiOutput(ns("home_ui")) } home <- function(input, output, session, login_info) { output$home_ui <- renderUI({ tagList( div( fluidRow( column(8, div(style = 'padding-left: 15px; padding-right: 15px;', ...
/base/home/home.R
no_license
dlotto/flagship
R
false
false
26,717
r
require(tidyquant) homeUI <- function(id) { ns <- NS(id) uiOutput(ns("home_ui")) } home <- function(input, output, session, login_info) { output$home_ui <- renderUI({ tagList( div( fluidRow( column(8, div(style = 'padding-left: 15px; padding-right: 15px;', ...
#' Functions implemented by any \code{streamMetabolizer}-compatible metabolism #' model. #' #' Metabolism models in the \code{streamMetabolizer} package all implement a #' common set of core functions. These functions are conceptually packaged as #' the \code{metab_model_interface} defined here. #' #' @section Fun...
/R/metab_model_interface.R
permissive
lawinslow/streamMetabolizer
R
false
false
4,588
r
#' Functions implemented by any \code{streamMetabolizer}-compatible metabolism #' model. #' #' Metabolism models in the \code{streamMetabolizer} package all implement a #' common set of core functions. These functions are conceptually packaged as #' the \code{metab_model_interface} defined here. #' #' @section Fun...
## set working directory setwd("C:/Users/lenovo/Desktop/New folder") library(dplyr) ## download file fileurl <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip" download.file(fileurl, destfile = "C:/Users/lenovo/Desktop/New folder/run.zip", method = "curl") ## zip file ...
/run_analysis.R
no_license
Ajithkumar75987/getting-cleaning
R
false
false
2,492
r
## set working directory setwd("C:/Users/lenovo/Desktop/New folder") library(dplyr) ## download file fileurl <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip" download.file(fileurl, destfile = "C:/Users/lenovo/Desktop/New folder/run.zip", method = "curl") ## zip file ...
# Exercise 5: DPLYR Grouped Operations # Install the nycflights13 package and read it in. Require the dplyr package. # install.packages("nycflights13") library(nycflights13) library(dplyr) # In which month was the average departure delay the greatest? # Hint: you'll have to perform a grouping operation before summari...
/exercise-5/exercise.R
permissive
francmit/ch10-dplyr
R
false
false
1,466
r
# Exercise 5: DPLYR Grouped Operations # Install the nycflights13 package and read it in. Require the dplyr package. # install.packages("nycflights13") library(nycflights13) library(dplyr) # In which month was the average departure delay the greatest? # Hint: you'll have to perform a grouping operation before summari...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/keras_deep_lstm.R \name{keras_deep_lstm} \alias{keras_deep_lstm} \title{keras deep lstm} \usage{ keras_deep_lstm(input_dim, embed_dim = 128, seq_len = 50, hidden_dims = c(128, 64, 32), bidirectional = F, output_fun = "softmax", output_dim...
/man/keras_deep_lstm.Rd
no_license
systats/textlearnR
R
false
true
864
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/keras_deep_lstm.R \name{keras_deep_lstm} \alias{keras_deep_lstm} \title{keras deep lstm} \usage{ keras_deep_lstm(input_dim, embed_dim = 128, seq_len = 50, hidden_dims = c(128, 64, 32), bidirectional = F, output_fun = "softmax", output_dim...
#' #' @title Methylation datasets from TCGA project #' #' @description #' Package provides methylation (humanmethylation27) datasets from The Cancer Genome Atlas Project for #' all cohorts types from \url{http://gdac.broadinstitute.org/}. #' Data were downloaded using \link{RTCGA-package} and contain snapshots for #' ...
/R/methylation_datasets.R
no_license
RTCGA/RTCGA.methylation
R
false
false
2,789
r
#' #' @title Methylation datasets from TCGA project #' #' @description #' Package provides methylation (humanmethylation27) datasets from The Cancer Genome Atlas Project for #' all cohorts types from \url{http://gdac.broadinstitute.org/}. #' Data were downloaded using \link{RTCGA-package} and contain snapshots for #' ...
argh <- new.env(parent = emptyenv()) #' Initialize argh #' #' @param lang Language of the error to parse. Default #' is English. Now support "en", "fr", "ko". #' @return an initialized session with argh #' @export #' @importFrom utils read.csv #' @rdname init #' #' @examples #' init_argh() init_argh <- function( ...
/R/catcher.R
permissive
kant/argh
R
false
false
1,002
r
argh <- new.env(parent = emptyenv()) #' Initialize argh #' #' @param lang Language of the error to parse. Default #' is English. Now support "en", "fr", "ko". #' @return an initialized session with argh #' @export #' @importFrom utils read.csv #' @rdname init #' #' @examples #' init_argh() init_argh <- function( ...
# clear variables and close windows rm(list = ls(all = TRUE)) graphics.off() fx = read.table("fx_eur_gbp_usd.txt") # Convert FX-rates to return series fx = log(fx) x = diag(-1, length(fx[, 1]), length(fx[, 1])) x[row(x) == (col(x) + 1)] = 1 dem_usd = t(fx[, 1]) %*% x gbp_usd = t(fx[, 2]) %*% x retur...
/QID-3507-SFSmvol01/SFSmvol01.R
no_license
b2q/SFS-Ready
R
false
false
1,166
r
# clear variables and close windows rm(list = ls(all = TRUE)) graphics.off() fx = read.table("fx_eur_gbp_usd.txt") # Convert FX-rates to return series fx = log(fx) x = diag(-1, length(fx[, 1]), length(fx[, 1])) x[row(x) == (col(x) + 1)] = 1 dem_usd = t(fx[, 1]) %*% x gbp_usd = t(fx[, 2]) %*% x retur...
hcp<- function(temp,rh) { # verificar ifelse(temp >= 15 && temp < 27 && rh > 93, 1/(14.35-0.25*temp), ifelse(temp >= 27 && temp < 35 && rh > 93,1/(-8.5+0.59*temp),0)) } diasFavInfe2<-function(tMax,rhMax,rain){ ifelse(rhMax >=93,ifelse(tMax>23,ifelse(rain<=5,1,0),0),0) } diasFavInfe<-function(te...
/wheat blast model.R
no_license
felipedevargas/weather-based-model
R
false
false
5,032
r
hcp<- function(temp,rh) { # verificar ifelse(temp >= 15 && temp < 27 && rh > 93, 1/(14.35-0.25*temp), ifelse(temp >= 27 && temp < 35 && rh > 93,1/(-8.5+0.59*temp),0)) } diasFavInfe2<-function(tMax,rhMax,rain){ ifelse(rhMax >=93,ifelse(tMax>23,ifelse(rain<=5,1,0),0),0) } diasFavInfe<-function(te...
library(RODBC) library(TSA) library(forecast) library(tseries) ch <- odbcConnect("mysql", uid="root", pwd="root") testData <- sqlQuery(ch, "select b_date, b_open, b_high, b_close, b_low, b_change from 000011_深物业a_org order by b_date asc") #print (testData) plot(testData$b_date, testData$b_op...
/EfficientMarketsHypothesis-R/TimeSerise1.R
no_license
saberxxy/R-Quant
R
false
false
340
r
library(RODBC) library(TSA) library(forecast) library(tseries) ch <- odbcConnect("mysql", uid="root", pwd="root") testData <- sqlQuery(ch, "select b_date, b_open, b_high, b_close, b_low, b_change from 000011_深物业a_org order by b_date asc") #print (testData) plot(testData$b_date, testData$b_op...
# Load required libraries require(ggplot2) require(vegan) require(corrplot) require(ggpubr) compute_rda = function(data, m){ # This function computes the Redundancy Analysis. # It requires the following parameters: # - data: data where trait matching and network descriptor data is stored # - m : levels ...
/Code/plots/figure_3.R
no_license
fp3draza/coevo_in_networks
R
false
false
5,644
r
# Load required libraries require(ggplot2) require(vegan) require(corrplot) require(ggpubr) compute_rda = function(data, m){ # This function computes the Redundancy Analysis. # It requires the following parameters: # - data: data where trait matching and network descriptor data is stored # - m : levels ...
args <-commandArgs(trailingOnly = TRUE) print(args) day <- as.integer(args[1]) month<-as.integer(args[2]) year<-as.integer(args[3] ) print(paste(day,"/",month,"/",year,sep="")) print("Calling set up...") source("/home/ISAD/jm622/rscripts/setup_v4_carson.R") # loads & runs setup file ##################################...
/R/Analysis/map_24h.R
no_license
jrmosedale/microclimates
R
false
false
2,198
r
args <-commandArgs(trailingOnly = TRUE) print(args) day <- as.integer(args[1]) month<-as.integer(args[2]) year<-as.integer(args[3] ) print(paste(day,"/",month,"/",year,sep="")) print("Calling set up...") source("/home/ISAD/jm622/rscripts/setup_v4_carson.R") # loads & runs setup file ##################################...
\name{FinancialCrisisFiles} \docType{data} \alias{FinancialCrisisFiles} \title{ Files containing financial crisis data } \description{ \code{FinancialCrisisFiles} is an object of class \code{financialCrisisFiles} created by the \code{financialCrisisFiles} function in \code{Ecfun}. It describes files containi...
/man/FinancialCrisisFiles.Rd
no_license
sbgraves237/Ecdat
R
false
false
3,000
rd
\name{FinancialCrisisFiles} \docType{data} \alias{FinancialCrisisFiles} \title{ Files containing financial crisis data } \description{ \code{FinancialCrisisFiles} is an object of class \code{financialCrisisFiles} created by the \code{financialCrisisFiles} function in \code{Ecfun}. It describes files containi...
\name{MLANP-package} \alias{MLANP-package} \docType{package} \title{Miscellaneous functions by Marcello Chiodi} \description{Simple functions for my lectures on linear models and on non parametric statical methods} \details{ \tabular{ll}{ Package: MLANP Type: \tab Package\cr Version: \tab 1.4.1\cr Date: \tab 2020-04-19...
/man/MLANP-package.Rd
no_license
marcellochiodi/packages
R
false
false
606
rd
\name{MLANP-package} \alias{MLANP-package} \docType{package} \title{Miscellaneous functions by Marcello Chiodi} \description{Simple functions for my lectures on linear models and on non parametric statical methods} \details{ \tabular{ll}{ Package: MLANP Type: \tab Package\cr Version: \tab 1.4.1\cr Date: \tab 2020-04-19...
# Hello, world! # # This is an example function named 'hello' # which prints 'Hello, world!'. # # You can learn more about package authoring with RStudio at: # # http://r-pkgs.had.co.nz/ # # Some useful keyboard shortcuts for package authoring: # # Build and Reload Package: 'Ctrl + Shift + B' # Check Package: ...
/R/fitDistribution.R
no_license
hagarciag/Proyecto1ST
R
false
false
35,329
r
# Hello, world! # # This is an example function named 'hello' # which prints 'Hello, world!'. # # You can learn more about package authoring with RStudio at: # # http://r-pkgs.had.co.nz/ # # Some useful keyboard shortcuts for package authoring: # # Build and Reload Package: 'Ctrl + Shift + B' # Check Package: ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/yeast.R \docType{data} \name{yeast} \alias{yeast} \title{real data for yeast genes} \format{A matrix of hypergeometric p-values, where rows and columns correspond to GO terms and genes.} \usage{ yeast } \description{ real data for yeast genes...
/man/yeast.Rd
no_license
dongjunchung/bayesGO
R
false
true
367
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/yeast.R \docType{data} \name{yeast} \alias{yeast} \title{real data for yeast genes} \format{A matrix of hypergeometric p-values, where rows and columns correspond to GO terms and genes.} \usage{ yeast } \description{ real data for yeast genes...
testlist <- list(ends = c(-1125300777L, 765849512L, -1760774663L, 791623263L, 1358782356L, -128659642L, -14914341L, 1092032927L, 1837701012L, 1632068659L), pts = c(1758370433L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,...
/IntervalSurgeon/inst/testfiles/rcpp_pile/AFL_rcpp_pile/rcpp_pile_valgrind_files/1609874822-test.R
no_license
akhikolla/updated-only-Issues
R
false
false
728
r
testlist <- list(ends = c(-1125300777L, 765849512L, -1760774663L, 791623263L, 1358782356L, -128659642L, -14914341L, 1092032927L, 1837701012L, 1632068659L), pts = c(1758370433L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,...
library(dplyr) library(seqinr) library(doParallel) library(parallel) # Isoform functional annotation # 3. Test change of localization (DeepLoc) comparing PacBio ORF and UniProt by splice variants # ***** RUN on cluster using 2.4-BRCA_isoforms.pbs # INPUTS local # input_Pacbio_to_ORF <- "./transdecoder/Transdecoder_ma...
/2_ORF_annotation/2.4-BRCA_isoforms.R
permissive
Alex-Nesta/BRCA-LRseq-pipeline
R
false
false
2,869
r
library(dplyr) library(seqinr) library(doParallel) library(parallel) # Isoform functional annotation # 3. Test change of localization (DeepLoc) comparing PacBio ORF and UniProt by splice variants # ***** RUN on cluster using 2.4-BRCA_isoforms.pbs # INPUTS local # input_Pacbio_to_ORF <- "./transdecoder/Transdecoder_ma...
dice <- function(){ rand <- sample(1:6,1) if(rand >= 5){ return("W") }else{ return("L") } } game <- function(n){ winAlice<-0 for(i in 1:n){ if(i%%5 == 0){ profit <- 300 }else{ profit <- 100 } Alice<-6000 Bob<-4000 while(Alice>0 && Bob>0)...
/week10Homework.R
no_license
INYEONGKIM/computer-statistics-practice
R
false
false
652
r
dice <- function(){ rand <- sample(1:6,1) if(rand >= 5){ return("W") }else{ return("L") } } game <- function(n){ winAlice<-0 for(i in 1:n){ if(i%%5 == 0){ profit <- 300 }else{ profit <- 100 } Alice<-6000 Bob<-4000 while(Alice>0 && Bob>0)...
nsim_nscs_version_step1(); brand ='JBLH' #获取版本号 var_version <- tsda::nsim_version_getNextVersion(brand,'nscs'); print('1') #1.更新问题分类 ques_category_byDictSegment_underline(brand,var_version); #检查问题; ques_category_byDictSegment_underline print('2') #2.更新答案分类 answ_category_by_ques_category_via_qalist(brand...
/data-raw/test3.R
no_license
takewiki/nscspkg
R
false
false
1,271
r
nsim_nscs_version_step1(); brand ='JBLH' #获取版本号 var_version <- tsda::nsim_version_getNextVersion(brand,'nscs'); print('1') #1.更新问题分类 ques_category_byDictSegment_underline(brand,var_version); #检查问题; ques_category_byDictSegment_underline print('2') #2.更新答案分类 answ_category_by_ques_category_via_qalist(brand...
if(!exists("NEI")){ NEI <- readRDS("./data/summarySCC_PM25.rds") } if(!exists("SCC")){ SCC <- readRDS("./data/Source_Classification_Code.rds") } library(ggplot2) sub_NEI <- NEI[(NEI$fips=="24510"|NEI$fips=="06037") & NEI$type=="ON-ROAD", ] aggregatedTotalByYearAndFips <- aggregate(Emissions ~ year + fips, sub_N...
/plot6.R
no_license
AniketDogra/EDA-Project2
R
false
false
905
r
if(!exists("NEI")){ NEI <- readRDS("./data/summarySCC_PM25.rds") } if(!exists("SCC")){ SCC <- readRDS("./data/Source_Classification_Code.rds") } library(ggplot2) sub_NEI <- NEI[(NEI$fips=="24510"|NEI$fips=="06037") & NEI$type=="ON-ROAD", ] aggregatedTotalByYearAndFips <- aggregate(Emissions ~ year + fips, sub_N...
# ##gen al health states # # df <- expand.grid(MO=1:5,SC=1:5,UA=1:5,PD=1:5,AD=1:5) # # ##apply EQ tariff # # library(eq5d) # # NLutil <- eq5d(scores=df, country = "Netherlands", version = "5L", type ="VT") # # UKvanHout <- eq5d(scores=df, country = "UK", version = "5L", type ="CW") # # UKdevlin <- eq5d(scores=df,...
/input/utilities.R
no_license
icorroramos/COMPAR-EU_diabetes_model
R
false
false
9,505
r
# ##gen al health states # # df <- expand.grid(MO=1:5,SC=1:5,UA=1:5,PD=1:5,AD=1:5) # # ##apply EQ tariff # # library(eq5d) # # NLutil <- eq5d(scores=df, country = "Netherlands", version = "5L", type ="VT") # # UKvanHout <- eq5d(scores=df, country = "UK", version = "5L", type ="CW") # # UKdevlin <- eq5d(scores=df,...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ProbitSpatial.R \docType{class} \name{ProbitSpatial-class} \alias{ProbitSpatial-class} \title{Class of Spatial Probit Model.} \description{ Class of Spatial Probit Model. } \section{Slots}{ \describe{ \item{\code{beta}}{numeric, the estimate...
/man/ProbitSpatial-class.Rd
no_license
cran/ProbitSpatial
R
false
true
2,070
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ProbitSpatial.R \docType{class} \name{ProbitSpatial-class} \alias{ProbitSpatial-class} \title{Class of Spatial Probit Model.} \description{ Class of Spatial Probit Model. } \section{Slots}{ \describe{ \item{\code{beta}}{numeric, the estimate...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/evaluate_functions.R \name{eval_function.rbf} \alias{eval_function.rbf} \title{Evaluate rbf function} \usage{ \method{eval_function}{rbf}(x, obs, w, ...) } \arguments{ \item{x}{The basis function object.} \item{obs}{Input / observation data....
/man/eval_function.rbf.Rd
no_license
andreaskapou/mpgex
R
false
true
730
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/evaluate_functions.R \name{eval_function.rbf} \alias{eval_function.rbf} \title{Evaluate rbf function} \usage{ \method{eval_function}{rbf}(x, obs, w, ...) } \arguments{ \item{x}{The basis function object.} \item{obs}{Input / observation data....
report.expr <- function(expr){ expr.substituted <- substitute(expr) cat(gsub(pattern="[ \t]{2,}", replacement=" ", x=paste0(collapse="", capture.output(print(expr.substituted)))), "\n") ## remove newlines and replace all successive whitespaces with a single whitespace eval(expr.substituted) }
/scripts/common/logger.R
no_license
shunsunsun/HERE
R
false
false
306
r
report.expr <- function(expr){ expr.substituted <- substitute(expr) cat(gsub(pattern="[ \t]{2,}", replacement=" ", x=paste0(collapse="", capture.output(print(expr.substituted)))), "\n") ## remove newlines and replace all successive whitespaces with a single whitespace eval(expr.substituted) }
######### Selection of Health Facilities ######### ### Function to cluster facilities using dbscan poi_cent_dbscan = function(data, Type){ data$long = as.numeric(unlist(map(data$geometry,1))) data$lat = as.numeric(unlist(map(data$geometry,2))) st_geometry(data) <- NULL dat = data[c(83,82)] #eps...
/1. store_criteria.R
no_license
huyenle1/Access-covid
R
false
false
7,773
r
######### Selection of Health Facilities ######### ### Function to cluster facilities using dbscan poi_cent_dbscan = function(data, Type){ data$long = as.numeric(unlist(map(data$geometry,1))) data$lat = as.numeric(unlist(map(data$geometry,2))) st_geometry(data) <- NULL dat = data[c(83,82)] #eps...
/man/sequential_normal_dp.Rd
no_license
cran/bdpopt
R
false
false
2,914
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/measures_for_incidence_matrices.R \name{C_pears} \alias{C_pears} \title{Pearson tetrachoric correaltions for binary data} \usage{ C_pears(m, clean = TRUE) } \arguments{ \item{m}{Community data matrix with species as rows and sites as columns....
/man/C_pears.Rd
no_license
petrkeil/spasm
R
false
true
1,005
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/measures_for_incidence_matrices.R \name{C_pears} \alias{C_pears} \title{Pearson tetrachoric correaltions for binary data} \usage{ C_pears(m, clean = TRUE) } \arguments{ \item{m}{Community data matrix with species as rows and sites as columns....
dS2_nlin2_test<-function(dS2, thetaN, alpha, y, exact = FALSE) { if (missing(dS2)) { dS2 <- rexpar::dS2_nlin2(theta=thetaN, y=y) } NdS2 <- sqrt(floor((length(y) - 1) / 4) - 1) * (dS2 - 1/8) / sqrt(7/64) if (exact == TRUE) { deci <- ((dS2 * (floor((length(y) - 1) / 4) - 1)) < qbinom(alpha,...
/R/dS2_nlin2_test.R
no_license
SimoneHermann/rexpar
R
false
false
455
r
dS2_nlin2_test<-function(dS2, thetaN, alpha, y, exact = FALSE) { if (missing(dS2)) { dS2 <- rexpar::dS2_nlin2(theta=thetaN, y=y) } NdS2 <- sqrt(floor((length(y) - 1) / 4) - 1) * (dS2 - 1/8) / sqrt(7/64) if (exact == TRUE) { deci <- ((dS2 * (floor((length(y) - 1) / 4) - 1)) < qbinom(alpha,...
library(testthat) library(recipes) context("harmonic parameters") x_year <- seq(0, 86400*365*4, by = 31556926) x_month_sidereal <- seq(0, 86400*7, by = 2360592) x_month_synodic <- seq(0, 86400*7, by = 2551443) x_month_average <- seq(0, 86400*365, by = 2629744) x_week <- seq(0, 86400*365, by = 864...
/tests/testthat/test_harmonic.R
permissive
JaeDukSeo/recipes
R
false
false
11,061
r
library(testthat) library(recipes) context("harmonic parameters") x_year <- seq(0, 86400*365*4, by = 31556926) x_month_sidereal <- seq(0, 86400*7, by = 2360592) x_month_synodic <- seq(0, 86400*7, by = 2551443) x_month_average <- seq(0, 86400*365, by = 2629744) x_week <- seq(0, 86400*365, by = 864...
### analyses spatiales avec R # 15/04/2019 # major read for using package "sf": https://geocompr.robinlovelace.net/ ### packages library(rgdal) # import / export de fichiers spatiaux library(sp) # classes 'sp' library(mapview) # visualisation rapide dynamique library(raster) # travail avec les...
/SpatialR_2019.r
no_license
PinaudDavid/cebcscripts
R
false
false
14,372
r
### analyses spatiales avec R # 15/04/2019 # major read for using package "sf": https://geocompr.robinlovelace.net/ ### packages library(rgdal) # import / export de fichiers spatiaux library(sp) # classes 'sp' library(mapview) # visualisation rapide dynamique library(raster) # travail avec les...
#source("fastHag.R") #source("simseir.R") require(epinet) require(plyr) require(ggplot2) #Create Hagellopolis n_pop <- 100 #Total population n_hags <- 1 # number of villages hagopolis_size = 100 # size of landscape (square sides) hag_size = 10 # size of a single village # get covariates for each village ndcv = sim_...
/hagopolis_sim_AB_0224.R
no_license
adbecker/Hagellopolis
R
false
false
2,248
r
#source("fastHag.R") #source("simseir.R") require(epinet) require(plyr) require(ggplot2) #Create Hagellopolis n_pop <- 100 #Total population n_hags <- 1 # number of villages hagopolis_size = 100 # size of landscape (square sides) hag_size = 10 # size of a single village # get covariates for each village ndcv = sim_...
#' Run Sensitivity Analysis #' #' @param model An evaluated Markov model #' @param sensitivity An object returned by #' \code{\link{define_sensitivity}}. #' #' @return A \code{data.frame} with one row per model and #' parameter value. #' @export #' #' @example inst/examples/example_run_sensitivity.R...
/heemod/R/sensitivity_eval.R
no_license
ingted/R-Examples
R
false
false
1,082
r
#' Run Sensitivity Analysis #' #' @param model An evaluated Markov model #' @param sensitivity An object returned by #' \code{\link{define_sensitivity}}. #' #' @return A \code{data.frame} with one row per model and #' parameter value. #' @export #' #' @example inst/examples/example_run_sensitivity.R...
library(shiny) library(googleVis) library(rgdal) library(leaflet) library(dplyr) library(plotly) library(htmltools) library(ggthemes) library(waffle) #setwd("C:/Users/cmlim/Desktop/Data Vis Shiny App/Airbnb") load('airbnb_map_df.Rda') load('subway_df.Rda') load('crime_df.Rda') load('airbnb_nbhood_map.Rda') #Crime Den...
/global.R
no_license
chun9men9/airbnb_rshiny
R
false
false
3,583
r
library(shiny) library(googleVis) library(rgdal) library(leaflet) library(dplyr) library(plotly) library(htmltools) library(ggthemes) library(waffle) #setwd("C:/Users/cmlim/Desktop/Data Vis Shiny App/Airbnb") load('airbnb_map_df.Rda') load('subway_df.Rda') load('crime_df.Rda') load('airbnb_nbhood_map.Rda') #Crime Den...
library(shiny) shinyUI( bootstrapPage( tags$head( tags$meta(`http-equiv`="pragma", content="no-cache"), tags$meta(`http-equiv`="Cache-control", content="no-cache, no-store") ), tags$head(tags$script(src="extra.js")), tags$head(tags$link(rel="stylesheet", type="text/css", href="extra.css")...
/ui.R
no_license
moggces/CurveVisualizationGUI4Tox21
R
false
false
3,169
r
library(shiny) shinyUI( bootstrapPage( tags$head( tags$meta(`http-equiv`="pragma", content="no-cache"), tags$meta(`http-equiv`="Cache-control", content="no-cache, no-store") ), tags$head(tags$script(src="extra.js")), tags$head(tags$link(rel="stylesheet", type="text/css", href="extra.css")...
#' Create a new CatAllOf #' #' @description #' CatAllOf Class #' #' @docType class #' @title CatAllOf #' @description CatAllOf Class #' @format An \code{R6Class} generator object #' @field declawed character [optional] #' @field _field_list a list of fields list(character) #' @field additional_properties additional pr...
/samples/client/petstore/R/R/cat_all_of.R
permissive
padamstx/openapi-generator
R
false
false
5,750
r
#' Create a new CatAllOf #' #' @description #' CatAllOf Class #' #' @docType class #' @title CatAllOf #' @description CatAllOf Class #' @format An \code{R6Class} generator object #' @field declawed character [optional] #' @field _field_list a list of fields list(character) #' @field additional_properties additional pr...
#' @export write_tsv <- function(input_table) { write.table( input_table, file = paste0(deparse(substitute(input_table)), ".tsv"), col.name = T, row.name = F, sep = "\t", quote = F ) }
/R/Writer.R
no_license
ProteomicsTools/PIN
R
false
false
221
r
#' @export write_tsv <- function(input_table) { write.table( input_table, file = paste0(deparse(substitute(input_table)), ".tsv"), col.name = T, row.name = F, sep = "\t", quote = F ) }
##Downloading the data, setting the working directory, getting necessary packages URL <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" download.file(URL, destfile ="./electricpower.zip") unzip("./electricpower.zip", exdir = "electric") setwd("./electric") require(sqldf) require...
/Plot1.R
no_license
abbarias/ExData_Plotting1
R
false
false
1,196
r
##Downloading the data, setting the working directory, getting necessary packages URL <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" download.file(URL, destfile ="./electricpower.zip") unzip("./electricpower.zip", exdir = "electric") setwd("./electric") require(sqldf) require...
stl.fit <- function(y,rob,k){ nextodd <- function(x){ x <- round(x) if (x%%2 == 0) x <- x + 1 as.integer(x) } aux <- c() fit <- stl(y, s.window = "periodic", robust = rob) fit2 <- fit$time.series[,"seasonal"] + fit$time.series[,"trend"] m1 <- accuracy(fit2,y)[k] aux$measure ...
/stlfit.R
no_license
ClaraCordeiro/stl.fit
R
false
false
1,085
r
stl.fit <- function(y,rob,k){ nextodd <- function(x){ x <- round(x) if (x%%2 == 0) x <- x + 1 as.integer(x) } aux <- c() fit <- stl(y, s.window = "periodic", robust = rob) fit2 <- fit$time.series[,"seasonal"] + fit$time.series[,"trend"] m1 <- accuracy(fit2,y)[k] aux$measure ...
library(tidyverse) raw_inst <- readLines("data/day_08.txt") acc <- 0 i <- 1 i_vec <- rep(0,length(raw_inst)) i_vec[i] <- 1 while(!any(i_vec == 2)){ print(i) instr_vec <- str_match_all(raw_inst[i],"(?<commandtype>(?:[a-z]+)) (?<valu>(?:.[0-9]+))")[[1]] command_type = instr_vec[2] argu = as.integer(instr_vec[...
/src/R/day_08.R
no_license
BenoitFayolle/advent-of-code2020
R
false
false
1,649
r
library(tidyverse) raw_inst <- readLines("data/day_08.txt") acc <- 0 i <- 1 i_vec <- rep(0,length(raw_inst)) i_vec[i] <- 1 while(!any(i_vec == 2)){ print(i) instr_vec <- str_match_all(raw_inst[i],"(?<commandtype>(?:[a-z]+)) (?<valu>(?:.[0-9]+))")[[1]] command_type = instr_vec[2] argu = as.integer(instr_vec[...