content
large_stringlengths
0
6.46M
path
large_stringlengths
3
331
license_type
large_stringclasses
2 values
repo_name
large_stringlengths
5
125
language
large_stringclasses
1 value
is_vendor
bool
2 classes
is_generated
bool
2 classes
length_bytes
int64
4
6.46M
extension
large_stringclasses
75 values
text
stringlengths
0
6.46M
library(raster) library(sf) library(sp) # library(rdgal) library(rgeos) library(dplyr) library(ggplot2) library(spdplyr) library(gstat) library(geoR) library(spatstat) library(viridis) library(rangemap) library(e1071) library(evd) gis_dir <- "C:/Users/lloken/OneDrive - DOI/GIS" onedrive_dir <- 'C:/Users/lloken/On...
/interpolate_tonlesap.R
no_license
lukeloken/SuperFlamer
R
false
false
12,257
r
library(raster) library(sf) library(sp) # library(rdgal) library(rgeos) library(dplyr) library(ggplot2) library(spdplyr) library(gstat) library(geoR) library(spatstat) library(viridis) library(rangemap) library(e1071) library(evd) gis_dir <- "C:/Users/lloken/OneDrive - DOI/GIS" onedrive_dir <- 'C:/Users/lloken/On...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Path-class.R \name{Path$.} \alias{Path$.} \title{Get the elements in the directory} \description{ Returns a named list of Path elements in a directory } \seealso{ Other Path: \code{\link{Path$..}}, \code{\link{Path$J}}, \code{\link{Path$dir}...
/man/Path-cash-..Rd
permissive
strazto/pathlibr
R
false
true
509
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Path-class.R \name{Path$.} \alias{Path$.} \title{Get the elements in the directory} \description{ Returns a named list of Path elements in a directory } \seealso{ Other Path: \code{\link{Path$..}}, \code{\link{Path$J}}, \code{\link{Path$dir}...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/censoring_estimate.R \name{estimateCensoring} \alias{estimateCensoring} \title{Estimate Censoring Mechanisms} \usage{ estimateCensoring( dataList, adjustVars, t0, SL.ctime = NULL, glm.ctime = NULL, glm.family, cvControl, retur...
/man/estimateCensoring.Rd
permissive
benkeser/survtmle
R
false
true
4,577
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/censoring_estimate.R \name{estimateCensoring} \alias{estimateCensoring} \title{Estimate Censoring Mechanisms} \usage{ estimateCensoring( dataList, adjustVars, t0, SL.ctime = NULL, glm.ctime = NULL, glm.family, cvControl, retur...
Uses <- function(MP=NA, data=NULL) { options(warn=-1) if (class(MP) != 'character' && !is.na(MP)) stop("MP must be class 'character'", call.=FALSE) options(warn=1) if (all(is.na(MP))) MP <- c(avail("Output"), avail("Input")) if (!is.null(data)) MP <- c(avail("Output"), avail("Input")) val <- MP %in% c(av...
/Uses.R
no_license
DLMtool/DLMDev
R
false
false
2,839
r
Uses <- function(MP=NA, data=NULL) { options(warn=-1) if (class(MP) != 'character' && !is.na(MP)) stop("MP must be class 'character'", call.=FALSE) options(warn=1) if (all(is.na(MP))) MP <- c(avail("Output"), avail("Input")) if (!is.null(data)) MP <- c(avail("Output"), avail("Input")) val <- MP %in% c(av...
test_that("base parse query string for user ID works", { query <- shiny::parseQueryString("?user_id=hadley&other_parameter=other/") base_val <- base_extract_user_id(query) expect_equal(base_val, "hadley") })
/tests/testthat/test-helpers-survey-code.R
permissive
nklepeis/shinysurveys
R
false
false
218
r
test_that("base parse query string for user ID works", { query <- shiny::parseQueryString("?user_id=hadley&other_parameter=other/") base_val <- base_extract_user_id(query) expect_equal(base_val, "hadley") })
vignette("Tutorial", package="mstate") library(mstate) library("colorspace") data(aidssi) si <- aidssi # Just a shorter name table(si$status) tmat <- trans.comprisk(2, names = c("event-free", "AIDS", "SI")) tmat ?msfit si$stat1 <- as.numeric(si$status == 1) si$stat2 <- as.numeric(si$status == 2) dim(aidssi)[1] #add a ...
/competing_risk.R
no_license
bnuzyc91/mstate
R
false
false
4,623
r
vignette("Tutorial", package="mstate") library(mstate) library("colorspace") data(aidssi) si <- aidssi # Just a shorter name table(si$status) tmat <- trans.comprisk(2, names = c("event-free", "AIDS", "SI")) tmat ?msfit si$stat1 <- as.numeric(si$status == 1) si$stat2 <- as.numeric(si$status == 2) dim(aidssi)[1] #add a ...
#' calculate p-value for accuracy using binomial test #' #' Calcualte p-value for the null accuracy = chance level #' @param predictions predicted values #' @param labels true values #' @param p proportion against which we are testing #' @keywords p values, statisticall signifficance, accuracy #' @export #' @examples #...
/helpers/significance_functions.R
no_license
Nian-Jingqing/beyond-acc
R
false
false
7,320
r
#' calculate p-value for accuracy using binomial test #' #' Calcualte p-value for the null accuracy = chance level #' @param predictions predicted values #' @param labels true values #' @param p proportion against which we are testing #' @keywords p values, statisticall signifficance, accuracy #' @export #' @examples #...
#' @include unitedSimOne.R #' @include unitedSimResults.R NULL ############################################### # --------------------------------------------# # unitedSim # # --------------------------------------------# ############################################### # ---...
/R/unitedSim.R
no_license
cran/unitedR
R
false
false
4,074
r
#' @include unitedSimOne.R #' @include unitedSimResults.R NULL ############################################### # --------------------------------------------# # unitedSim # # --------------------------------------------# ############################################### # ---...
tabPanel(title = "Daten im Kontext", id = "contextualizeTab", value = "contextualizeTab", icon = icon("globe"), # election map start ############################################################' fluidRow(column(3, # links: ---...
/R/tab-contextualize.R
permissive
prototypefund/rightwatching-shiny-app
R
false
false
5,970
r
tabPanel(title = "Daten im Kontext", id = "contextualizeTab", value = "contextualizeTab", icon = icon("globe"), # election map start ############################################################' fluidRow(column(3, # links: ---...
source("prepData.R") plot2 <- function() { powerData_subset <- prepData() png("plot2.png", width=480, height=480) plot(powerData_subset$Time, powerData_subset$Global_active_power, type="l", xlab="", ylab="Global Active Power (kilowatts)") dev.off() } plot2()
/plot2.R
no_license
jkewnani/ExData_Plotting1
R
false
false
279
r
source("prepData.R") plot2 <- function() { powerData_subset <- prepData() png("plot2.png", width=480, height=480) plot(powerData_subset$Time, powerData_subset$Global_active_power, type="l", xlab="", ylab="Global Active Power (kilowatts)") dev.off() } plot2()
# CAMPUS information ------------------------------------------------------ # importing campus-level data # corresponding key: Reference - Campus Name, District Name, Country Name, Region Number campus_data_raw <- read_csv("CREF.csv") campus_data <- campus_data_raw head(campus_data) # CAMPUS information: ## character...
/data_import.R
no_license
jrosen48/tapr_FY2018
R
false
false
2,648
r
# CAMPUS information ------------------------------------------------------ # importing campus-level data # corresponding key: Reference - Campus Name, District Name, Country Name, Region Number campus_data_raw <- read_csv("CREF.csv") campus_data <- campus_data_raw head(campus_data) # CAMPUS information: ## character...
Data=c(0.163, 0.153, 0.136, NA, 0.141, 0.145, 0.13, 0.206, 0.186, 0.184, NA, 0.178, 0.185, 0.185, 0.237, 0.22, 0.218, NA, 0.223, 0.235, 0.229, 0.199, 0.194, 0.183, NA, 0.182, 0.185, 0.182, NA, NA, NA, 0.148, 0.159, 0.149, 0.138, NA, NA, NA, 0.168, 0.169, 0.17, 0.167, NA, NA, NA, 0.144, 0...
/Simple/Simple_Model1_Drive.r
no_license
ISUCyclone/Pipelines
R
false
false
4,705
r
Data=c(0.163, 0.153, 0.136, NA, 0.141, 0.145, 0.13, 0.206, 0.186, 0.184, NA, 0.178, 0.185, 0.185, 0.237, 0.22, 0.218, NA, 0.223, 0.235, 0.229, 0.199, 0.194, 0.183, NA, 0.182, 0.185, 0.182, NA, NA, NA, 0.148, 0.159, 0.149, 0.138, NA, NA, NA, 0.168, 0.169, 0.17, 0.167, NA, NA, NA, 0.144, 0...
#' @title backSample #' #' @description Background sample selection. #' @param x Object of class \emph{SpatialPoints} of \emph{SpatialPointsDataFrame}. #' @param z Vector of region identifiers for each sample. #' @param sampling.method One of \emph{random} or \emph{pca}. Default is \emph{random}. #' @param y Object of ...
/R/backSample.R
no_license
sonthuybacha/rsMove
R
false
false
6,689
r
#' @title backSample #' #' @description Background sample selection. #' @param x Object of class \emph{SpatialPoints} of \emph{SpatialPointsDataFrame}. #' @param z Vector of region identifiers for each sample. #' @param sampling.method One of \emph{random} or \emph{pca}. Default is \emph{random}. #' @param y Object of ...
install.packages(c("FactoMineR", "factoextra")) library("FactoMineR") library("factoextra") install.packages('corrplot') library("corrplot") library(gplots) library(tidyverse) library(lme4) library(lmerTest) library(wesanderson) library(reshape) install.packages('ggmap') library(ggmap) install.packages('CRAN') library(...
/Data_organization_classification/Traits, PCA and classification.R
no_license
EllaKatz1/GSLs_seeds
R
false
false
33,745
r
install.packages(c("FactoMineR", "factoextra")) library("FactoMineR") library("factoextra") install.packages('corrplot') library("corrplot") library(gplots) library(tidyverse) library(lme4) library(lmerTest) library(wesanderson) library(reshape) install.packages('ggmap') library(ggmap) install.packages('CRAN') library(...
# R script for programtic access to Revigo. Run it with (last output file name is optional): # Rscript revigo-r.R example-data.csv output.csv library(httr) library(stringi) args = commandArgs(trailingOnly=TRUE) # Read user data from a file fileName <- args[1] semsim <- args[2] meas <- args[3] random_num = args[4] ...
/AnnotateMe/BIN/parseREVIGO_new.R
no_license
Gray-Tu/snpXplorer
R
false
false
1,615
r
# R script for programtic access to Revigo. Run it with (last output file name is optional): # Rscript revigo-r.R example-data.csv output.csv library(httr) library(stringi) args = commandArgs(trailingOnly=TRUE) # Read user data from a file fileName <- args[1] semsim <- args[2] meas <- args[3] random_num = args[4] ...
fpca.nonscore <- function(A, maxsteps = 100, tol = 1e-3, normalised = T, K = 2, ridge = T, approx = FALSE){ # we need the diagonal elements equal to 0 diag(A) = 0 # get the iso and non-iso lists iso.A = isolate(A) iso.seq = iso.A$isolate noniso.seq = iso.A$nonisolate # work on the non-iso part from now on...
/FusedPCA/R/fpca.nonscore.R
no_license
ingted/R-Examples
R
false
false
1,601
r
fpca.nonscore <- function(A, maxsteps = 100, tol = 1e-3, normalised = T, K = 2, ridge = T, approx = FALSE){ # we need the diagonal elements equal to 0 diag(A) = 0 # get the iso and non-iso lists iso.A = isolate(A) iso.seq = iso.A$isolate noniso.seq = iso.A$nonisolate # work on the non-iso part from now on...
best<-function(state,outcome){ ## Read outcome data #------------------- outcomeOrig_df<-read.csv("outcome-of-care-measures.csv",colClasses="character") myvars<-c(2,7,11,17,23) # numbers of the columns of the variables that we need data<-outcomeOrig_df[,myvars] # subsets...
/best.R
no_license
tsimonso/ProgrammingAssignment3
R
false
false
1,845
r
best<-function(state,outcome){ ## Read outcome data #------------------- outcomeOrig_df<-read.csv("outcome-of-care-measures.csv",colClasses="character") myvars<-c(2,7,11,17,23) # numbers of the columns of the variables that we need data<-outcomeOrig_df[,myvars] # subsets...
context("Using graph actions") test_that("actions can be added to a graph object", { # Create an empty graph object graph <- create_graph() # Add a graph action that sets a node # attr column with a function; the # main function `set_node_attr_w_fcn()` # uses the `get_betweenness()` function # to provi...
/tests/testthat/test-graph_actions.R
no_license
ekstroem/DiagrammeR
R
false
false
6,508
r
context("Using graph actions") test_that("actions can be added to a graph object", { # Create an empty graph object graph <- create_graph() # Add a graph action that sets a node # attr column with a function; the # main function `set_node_attr_w_fcn()` # uses the `get_betweenness()` function # to provi...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data-covert.R \docType{data} \name{covert_46} \alias{covert_46} \title{Kenya Tanzania Gerdes} \format{ igraph object } \source{ Available from Center for Computational Analysis of Social and Organizational Systems (CASOS). (2008). Tanzania-Ke...
/man/covert_46.Rd
permissive
schochastics/networkdata
R
false
true
1,186
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data-covert.R \docType{data} \name{covert_46} \alias{covert_46} \title{Kenya Tanzania Gerdes} \format{ igraph object } \source{ Available from Center for Computational Analysis of Social and Organizational Systems (CASOS). (2008). Tanzania-Ke...
# Run analysis_transcriptome.R and next extract_data_chipseq1.sh before running this script # ############################################### # # making plot with peaks promoters for all TF # # ############################################### # svglite(file = "~/ifpan-chipseq-timecourse/PLOTS/lineplot_promotores.svg...
/SCRIPTS/visualization_promoters.R
no_license
ippas/ifpan-chipseq-timecourse
R
false
false
9,913
r
# Run analysis_transcriptome.R and next extract_data_chipseq1.sh before running this script # ############################################### # # making plot with peaks promoters for all TF # # ############################################### # svglite(file = "~/ifpan-chipseq-timecourse/PLOTS/lineplot_promotores.svg...
#################################################################### ## dfm class definition and methods for primitives, ops, etc. ## ## Ken Benoit #################################################################### #' Virtual class "dfm" for a document-feature matrix #' #' @description The dfm class of object is a...
/R/dfm-classes.R
no_license
saldaihani/quanteda
R
false
false
16,871
r
#################################################################### ## dfm class definition and methods for primitives, ops, etc. ## ## Ken Benoit #################################################################### #' Virtual class "dfm" for a document-feature matrix #' #' @description The dfm class of object is a...
# Setting working directory setwd("C:/Users/Mansi/Documents/Assignments/Analytics Edge/Analytics edge (GitHub)/Unit5_Twitter") # Read in the data tweets = read.csv("tweets.csv", stringsAsFactors=FALSE) str(tweets) # Create dependent variable tweets$Negative = as.factor(tweets$Avg <= -1) table(tweets$Negative) ...
/Turning Tweets into Knowledge/Code.R
no_license
wesenu/Analytics-edge-MITx-
R
false
false
2,368
r
# Setting working directory setwd("C:/Users/Mansi/Documents/Assignments/Analytics Edge/Analytics edge (GitHub)/Unit5_Twitter") # Read in the data tweets = read.csv("tweets.csv", stringsAsFactors=FALSE) str(tweets) # Create dependent variable tweets$Negative = as.factor(tweets$Avg <= -1) table(tweets$Negative) ...
library(plot3D) ### Name: Perspective box ### Title: Creates an empty perspective box, ready for adding objects ### Aliases: perspbox ### Keywords: hplot ### ** Examples # save plotting parameters pm <- par("mfrow") pmar <- par("mar") ## =============================================...
/data/genthat_extracted_code/plot3D/examples/perspbox.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
1,463
r
library(plot3D) ### Name: Perspective box ### Title: Creates an empty perspective box, ready for adding objects ### Aliases: perspbox ### Keywords: hplot ### ** Examples # save plotting parameters pm <- par("mfrow") pmar <- par("mar") ## =============================================...
pt(2.5, 15, lower.tail = FALSE) choose(8, 7)*0.5^8 + choose(8, 8)*0.5^8 pbinom(6, size = 8, prob = 0.5, lower.tail = FALSE) ppois(9, 5, lower.tail = FALSE)
/StatisticalInference/Semana3/pValue.R
no_license
jspaz/DataScience
R
false
false
158
r
pt(2.5, 15, lower.tail = FALSE) choose(8, 7)*0.5^8 + choose(8, 8)*0.5^8 pbinom(6, size = 8, prob = 0.5, lower.tail = FALSE) ppois(9, 5, lower.tail = FALSE)
library(frailtypack) ### Name: summary.trivPenal ### Title: Short summary of fixed covariates estimates of a joint model for ### longitudinal data, recurrent events and a terminal event ### Aliases: summary.trivPenal print.summary.trivPenal ### Keywords: methods ### ** Examples ## Not run: ##D ##D ###--- Triv...
/data/genthat_extracted_code/frailtypack/examples/summary.trivPenal.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
1,175
r
library(frailtypack) ### Name: summary.trivPenal ### Title: Short summary of fixed covariates estimates of a joint model for ### longitudinal data, recurrent events and a terminal event ### Aliases: summary.trivPenal print.summary.trivPenal ### Keywords: methods ### ** Examples ## Not run: ##D ##D ###--- Triv...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/help_laus_areacodes.R \name{help_laus_areacodes} \alias{help_laus_areacodes} \title{Prints a list of area names associated to an area code for the LAUS data} \usage{ help_laus_areacodes() } \value{ prints a list in the console } \description{...
/man/help_laus_areacodes.Rd
no_license
mikeasilva/blsAPI
R
false
true
464
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/help_laus_areacodes.R \name{help_laus_areacodes} \alias{help_laus_areacodes} \title{Prints a list of area names associated to an area code for the LAUS data} \usage{ help_laus_areacodes() } \value{ prints a list in the console } \description{...
Eggs<-read.csv2("http://jolej.linuxpl.info/Eggs.csv", header=TRUE) Eggs ls(Eggs) library(ggplot2) Eggs$First.Week <- as.factor(Eggs$First.Week) Eggs %>% gather(Egg.Pr:Cereal.Pr, key = "column", value = "value") # 1 plot <- ggplot(Eggs, aes(x = Cases, fill = Month)) histogram <- plot + geom_histogram(binwidth = 50...
/SGH/R/h2/homework2.R
no_license
Valkoiset/myrepo
R
false
false
1,443
r
Eggs<-read.csv2("http://jolej.linuxpl.info/Eggs.csv", header=TRUE) Eggs ls(Eggs) library(ggplot2) Eggs$First.Week <- as.factor(Eggs$First.Week) Eggs %>% gather(Egg.Pr:Cereal.Pr, key = "column", value = "value") # 1 plot <- ggplot(Eggs, aes(x = Cases, fill = Month)) histogram <- plot + geom_histogram(binwidth = 50...
\name{w.wsd} \alias{w.wsd} \title{ Retrieve Wind daily data } \description{ WSD is used to retrieve the history daily data of a security, such as intraday k-line.\cr To show the guide dialog, please input w.menu("wsd").\cr data<- w.wsd(windcodes,windfields,starttime,endtime,option)\cr \cr Description:\cr...
/WAPIWrapper/WAPIWrapperR/WindR/man/w.wsd.Rd
no_license
WindQuant/ThirdParty
R
false
false
944
rd
\name{w.wsd} \alias{w.wsd} \title{ Retrieve Wind daily data } \description{ WSD is used to retrieve the history daily data of a security, such as intraday k-line.\cr To show the guide dialog, please input w.menu("wsd").\cr data<- w.wsd(windcodes,windfields,starttime,endtime,option)\cr \cr Description:\cr...
# Cai, Jian-Feng, Emmanuel J. Candès, and Zuowei Shen. "A singular value thresholding algorithm for matrix completion." SIAM Journal on Optimization 20.4 (2010): 1956-1982. ## WARNING sketchy prototype ahead... library(Matrix) library(irlba) svt = function(M, delta=1.2, epsilon=1e-3, tau=5 * nrow(M), kmax=200) { F...
/svt.r
no_license
bwlewis/rfinance-2017
R
false
false
1,511
r
# Cai, Jian-Feng, Emmanuel J. Candès, and Zuowei Shen. "A singular value thresholding algorithm for matrix completion." SIAM Journal on Optimization 20.4 (2010): 1956-1982. ## WARNING sketchy prototype ahead... library(Matrix) library(irlba) svt = function(M, delta=1.2, epsilon=1e-3, tau=5 * nrow(M), kmax=200) { F...
# Define my own color pallet drsimonj_colors <- c( 'red' = "#d11141", 'green' = "#00b159", 'blue' = "#00aedb", 'orange' = "#f37735", 'yellow' = "#ffc425", 'light grey' = "#cccccc", 'dark grey' = "#8c8c8c", 'light blue' = "#03A9F4", 'purple' = "#9C27B0", 'teal' =...
/predictive_data_science/color_pallet.R
no_license
italo-batista/data-science-R
R
false
false
1,898
r
# Define my own color pallet drsimonj_colors <- c( 'red' = "#d11141", 'green' = "#00b159", 'blue' = "#00aedb", 'orange' = "#f37735", 'yellow' = "#ffc425", 'light grey' = "#cccccc", 'dark grey' = "#8c8c8c", 'light blue' = "#03A9F4", 'purple' = "#9C27B0", 'teal' =...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/cache-memory.R \name{cache_mem} \alias{cache_mem} \title{Create a memory cache object} \usage{ cache_mem( max_size = 512 * 1024^2, max_age = Inf, max_n = Inf, evict = c("lru", "fifo"), missing = key_missing(), logfile = NULL ) } \...
/man/cache_mem.Rd
permissive
jimsforks/cachem
R
false
true
6,588
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/cache-memory.R \name{cache_mem} \alias{cache_mem} \title{Create a memory cache object} \usage{ cache_mem( max_size = 512 * 1024^2, max_age = Inf, max_n = Inf, evict = c("lru", "fifo"), missing = key_missing(), logfile = NULL ) } \...
# # plot2.R - Written for the Coursera Exploratory Data Analysis Week 1 # Project Assignment. # # Assignment - Given a picture of plot 2, construct a plot to look like the # given plot and save it to a PNG file with a width of 480 pixels and a # height of 480 pixels. Name the plot plot1.png. # # Goal: Using th...
/plot2.R
no_license
TammyWikner/ExData_Plotting1
R
false
false
4,355
r
# # plot2.R - Written for the Coursera Exploratory Data Analysis Week 1 # Project Assignment. # # Assignment - Given a picture of plot 2, construct a plot to look like the # given plot and save it to a PNG file with a width of 480 pixels and a # height of 480 pixels. Name the plot plot1.png. # # Goal: Using th...
library("neuralnet") #Going to create a neural network to perform prediction #Type ?neuralnet for more information on the neuralnet library #Generate training data #And store them as a dataframe traininginput <- as.data.frame(matrix(c(7.9 , 32 , 2 , 7.9 , 32 , 2 , ...
/smpd/lab 6/lab 6.R
no_license
Rukashu/systemy-i-metody-podejmowania-decyzji
R
false
false
2,274
r
library("neuralnet") #Going to create a neural network to perform prediction #Type ?neuralnet for more information on the neuralnet library #Generate training data #And store them as a dataframe traininginput <- as.data.frame(matrix(c(7.9 , 32 , 2 , 7.9 , 32 , 2 , ...
# Leaflet for R # November 29 2018 # EAS # easily make interactive maps within R # used by many to publish maps # easily render spatial objects from the sp and sf packages or dataframes with lat/long column library(leaflet) library(maps) # basic example m <- leaflet(options = leafletOptions(minZoom = 12, maxZoom = ...
/mapping.R
no_license
eshore863/Bio381
R
false
false
1,861
r
# Leaflet for R # November 29 2018 # EAS # easily make interactive maps within R # used by many to publish maps # easily render spatial objects from the sp and sf packages or dataframes with lat/long column library(leaflet) library(maps) # basic example m <- leaflet(options = leafletOptions(minZoom = 12, maxZoom = ...
data_avg <- economics_long %>% mutate(year = as.integer(format(date, "%Y"))) %>% group_by(year, variable) %>% summarize(value_avg = mean(value)) %>% ungroup() data_avg_line <- data_avg %>% filter(variable %in% c("psavert", "uempmed")) divfactor = 6 * 10^2 data_avg_bar <- data_avg %>% filter(variable...
/R/ggplot_detailed_features_preparePlot.R
permissive
bowerth/Intro-to-R-Bootcamp
R
false
false
1,985
r
data_avg <- economics_long %>% mutate(year = as.integer(format(date, "%Y"))) %>% group_by(year, variable) %>% summarize(value_avg = mean(value)) %>% ungroup() data_avg_line <- data_avg %>% filter(variable %in% c("psavert", "uempmed")) divfactor = 6 * 10^2 data_avg_bar <- data_avg %>% filter(variable...
library(PKI) ### Name: BIGNUMint ### Title: Functions for BIGNUM representation of arbitrarily precise ### integers ### Aliases: BIGNUMint as.BIGNUMint ### Keywords: manip ### ** Examples as.BIGNUMint(65537)
/data/genthat_extracted_code/PKI/examples/BIGNUMint.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
217
r
library(PKI) ### Name: BIGNUMint ### Title: Functions for BIGNUM representation of arbitrarily precise ### integers ### Aliases: BIGNUMint as.BIGNUMint ### Keywords: manip ### ** Examples as.BIGNUMint(65537)
## Creates a special "matrix" object that can cache its inverse. makeCacheMatrix <- function(x = matrix()) { i <- NULL set <- function(y){ x <<- y i <<- NULL } get <- function() x setinverse <- function(inverse) i <<- inverse getinverse <- function() i list(set= set, get = get, set...
/cachematrix.R
no_license
rajatharlalka/ProgrammingAssignment2
R
false
false
746
r
## Creates a special "matrix" object that can cache its inverse. makeCacheMatrix <- function(x = matrix()) { i <- NULL set <- function(y){ x <<- y i <<- NULL } get <- function() x setinverse <- function(inverse) i <<- inverse getinverse <- function() i list(set= set, get = get, set...
fetch_facts <- function(x, nchar = 20) { GET(x) %>% content() %>% .[["all"]] %>% lapply("[[", "text") %>% .[nchar(.) > nchar] } enable_mini_sidebar <- function() { tags$script(HTML("$('body').addClass('sidebar-mini');")) } mini_sidebar_title <- function(full = "catfacts!", mini = ":)") { tagLis...
/R/utils.R
no_license
han-tun/catfacts
R
false
false
816
r
fetch_facts <- function(x, nchar = 20) { GET(x) %>% content() %>% .[["all"]] %>% lapply("[[", "text") %>% .[nchar(.) > nchar] } enable_mini_sidebar <- function() { tags$script(HTML("$('body').addClass('sidebar-mini');")) } mini_sidebar_title <- function(full = "catfacts!", mini = ":)") { tagLis...
# This file contains functions to process # wiki-survey data suppressPackageStartupMessages(library(ggplot2)) get.active.ideas <- function(ideas) # This function gets the active ideas in the idea data frame # (Mostly for internal use) { ideas = ideas[ideas$Active,] return(ideas) } rename.ideas <- function(ideas...
/wiki_utils.R
no_license
Weichen-Wu-CMU/wiki_survey_analysis
R
false
false
9,324
r
# This file contains functions to process # wiki-survey data suppressPackageStartupMessages(library(ggplot2)) get.active.ideas <- function(ideas) # This function gets the active ideas in the idea data frame # (Mostly for internal use) { ideas = ideas[ideas$Active,] return(ideas) } rename.ideas <- function(ideas...
require(parallel) ENV_CONCERTO_R_APP_URL = Sys.getenv("CONCERTO_R_APP_URL") ENV_CONCERTO_R_DB_CONNECTION = Sys.getenv("CONCERTO_R_DB_CONNECTION") ENV_CONCERTO_R_SESSION_FIFO_PATH = Sys.getenv("CONCERTO_R_SESSION_FIFO_PATH") ENV_CONCERTO_R_SERVICE_FIFO_PATH = Sys.getenv("CONCERTO_R_SERVICE_FIFO_PATH") ENV_CONCERTO_R_MA...
/src/Concerto/TestBundle/Resources/R/forker.R
permissive
campsych/concerto-platform
R
false
false
4,315
r
require(parallel) ENV_CONCERTO_R_APP_URL = Sys.getenv("CONCERTO_R_APP_URL") ENV_CONCERTO_R_DB_CONNECTION = Sys.getenv("CONCERTO_R_DB_CONNECTION") ENV_CONCERTO_R_SESSION_FIFO_PATH = Sys.getenv("CONCERTO_R_SESSION_FIFO_PATH") ENV_CONCERTO_R_SERVICE_FIFO_PATH = Sys.getenv("CONCERTO_R_SERVICE_FIFO_PATH") ENV_CONCERTO_R_MA...
suppressPackageStartupMessages(library(argparse)) suppressPackageStartupMessages(library(epiRepeatR)) suppressPackageStartupMessages(library(ggplot2)) ap <- ArgumentParser() ap$add_argument("-i", "--in", action="store", dest="inFileTable", help="Input file table (tab-separated).") ap$add_argument("-o", "--out", action=...
/inst/extdata/exec/repeatAlignmentStats.R
no_license
MPIIComputationalEpigenetics/epiRepeatR
R
false
false
1,771
r
suppressPackageStartupMessages(library(argparse)) suppressPackageStartupMessages(library(epiRepeatR)) suppressPackageStartupMessages(library(ggplot2)) ap <- ArgumentParser() ap$add_argument("-i", "--in", action="store", dest="inFileTable", help="Input file table (tab-separated).") ap$add_argument("-o", "--out", action=...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/calc_effort.R \name{calc_fishing_days_trip} \alias{calc_fishing_days_trip} \title{Calculate fishing days for a fishing trip.} \usage{ calc_fishing_days_trip(trip) } \arguments{ \item{trip}{Data.frame of the trip data} } \value{ A data.frame w...
/man/calc_fishing_days_trip.Rd
no_license
cran/fecR
R
false
true
2,113
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/calc_effort.R \name{calc_fishing_days_trip} \alias{calc_fishing_days_trip} \title{Calculate fishing days for a fishing trip.} \usage{ calc_fishing_days_trip(trip) } \arguments{ \item{trip}{Data.frame of the trip data} } \value{ A data.frame w...
#Examine lambda values with a Leslie matrix #set so R doesn't use scientific notation options("scipen"=100, "digits"=4) library(tidyverse) library(popbio) #devtools::install_github("BruceKendall/mpmtools") #In case you don't have mpmtools library(mpmtools) #-------------Age and survival settings----------------------...
/01_Data.generating.model/functions/Leslie_matrix_MAIN.R
no_license
JDSwenson/LemonSharkCKMR
R
false
false
2,602
r
#Examine lambda values with a Leslie matrix #set so R doesn't use scientific notation options("scipen"=100, "digits"=4) library(tidyverse) library(popbio) #devtools::install_github("BruceKendall/mpmtools") #In case you don't have mpmtools library(mpmtools) #-------------Age and survival settings----------------------...
# Using library(marelac) # ... as well as constants from # http://www.ices.dk/marine-data/tools/Pages/Unit-conversions.aspx x <- gas_O2sat(t = 15) # Saturation of O2 at 8 degrees C (given as mg/L) x # Saturation concentration in mg/L (9.43) x*1000/molweight("O2") # Saturatio...
/81 Oxygen concentration conversion.R
no_license
NIVANorge/Okokyst_oceanography
R
false
false
712
r
# Using library(marelac) # ... as well as constants from # http://www.ices.dk/marine-data/tools/Pages/Unit-conversions.aspx x <- gas_O2sat(t = 15) # Saturation of O2 at 8 degrees C (given as mg/L) x # Saturation concentration in mg/L (9.43) x*1000/molweight("O2") # Saturatio...
# Nested Repeated Measures Example # Guinea Pig Weights and Vitamin E # Packages packages <- c("tidyverse", "hasseDiagram", "car", "ggplot2", "afex", "emmeans") lapply(packages, library, character.only = TRUE) # Load Helper Functions source("https://raw.github.com/neilhatfield/STAT461/master/ANOVATools....
/oldExampleRFiles/repeatedMeasures-Nested.R
no_license
neilhatfield/STAT461
R
false
false
3,888
r
# Nested Repeated Measures Example # Guinea Pig Weights and Vitamin E # Packages packages <- c("tidyverse", "hasseDiagram", "car", "ggplot2", "afex", "emmeans") lapply(packages, library, character.only = TRUE) # Load Helper Functions source("https://raw.github.com/neilhatfield/STAT461/master/ANOVATools....
\name{family.glmmNPML} \alias{family.glmmNPML} \alias{family.glmmGQ} \alias{model.matrix.glmmNPML} \alias{model.matrix.glmmGQ} %- Also NEED an '\alias' for EACH other topic documented here. \title{Methods for objects of class glmmNPML or glmmGQ} \description{ Methods for the generic \code{family} and \code{mo...
/man/family.glmmNPML.Rd
no_license
cran/npmlreg
R
false
false
2,227
rd
\name{family.glmmNPML} \alias{family.glmmNPML} \alias{family.glmmGQ} \alias{model.matrix.glmmNPML} \alias{model.matrix.glmmGQ} %- Also NEED an '\alias' for EACH other topic documented here. \title{Methods for objects of class glmmNPML or glmmGQ} \description{ Methods for the generic \code{family} and \code{mo...
/TP Regularización Big Data UdeSA - AGUIAR_OVIEDO_PECORARI.r
no_license
nioviedo/Big-Data
R
false
false
9,447
r
source('http://bioconductor.org/biocLite.R') biocLite('DESeq2') biocLite("edgeR") biocLite("limma") biocLite("statmod") biocLite("affycoretools") biocLite("ReportingTools") library("edgeR") library("statmod") library('DESeq2') countdata_1 <- read.delim("Orthoblast_RSEM_merged_matrix", header=TRUE, row.names="library")...
/DEG Analysis/DeSeq2.R
no_license
JoannaGriffiths/Coral-population-responses-to-acidification
R
false
false
3,086
r
source('http://bioconductor.org/biocLite.R') biocLite('DESeq2') biocLite("edgeR") biocLite("limma") biocLite("statmod") biocLite("affycoretools") biocLite("ReportingTools") library("edgeR") library("statmod") library('DESeq2') countdata_1 <- read.delim("Orthoblast_RSEM_merged_matrix", header=TRUE, row.names="library")...
#' Sort rows using dplyr #' #' `step_arrange` creates a *specification* of a recipe step #' that will sort rows using [dplyr::arrange()]. #' #' @inheritParams step_center #' @param ... Comma separated list of unquoted variable names. #' Use `desc()`` to sort a variable in descending order. See #' [dplyr::arrange()] ...
/R/arrange.R
permissive
labouz/recipes
R
false
false
3,722
r
#' Sort rows using dplyr #' #' `step_arrange` creates a *specification* of a recipe step #' that will sort rows using [dplyr::arrange()]. #' #' @inheritParams step_center #' @param ... Comma separated list of unquoted variable names. #' Use `desc()`` to sort a variable in descending order. See #' [dplyr::arrange()] ...
#################################################### # # # IOWA MODEL # # # # Author: Ana Valdivia # # Date: April 2017 ...
/code/INFFUS/IOWA_ProNeutrality_Repetaed.R
no_license
llord1/phd
R
false
false
11,826
r
#################################################### # # # IOWA MODEL # # # # Author: Ana Valdivia # # Date: April 2017 ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/maketikz.R \name{maketikz} \alias{maketikz} \title{Generate Latex tikz code for plotting a temporal DAG or PDAG.} \usage{ maketikz( model, xjit = 2, yjit = 2, markperiods = TRUE, xpgap = 4, annotateEdges = NULL, addAxis = TRUE, ...
/man/maketikz.Rd
no_license
annennenne/causalDisco
R
false
true
2,910
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/maketikz.R \name{maketikz} \alias{maketikz} \title{Generate Latex tikz code for plotting a temporal DAG or PDAG.} \usage{ maketikz( model, xjit = 2, yjit = 2, markperiods = TRUE, xpgap = 4, annotateEdges = NULL, addAxis = TRUE, ...
control.flexrsurv.additive <- function (epsilon = 1e-08, maxit = 25, trace = FALSE, ...){ # controls for flexrsurv additive models are glm.controls return(glm.control(epsilon = epsilon, maxit = maxit, trace = trace)) } control.flexrsurv.multiplicative <- function (epsilon = 1e-8, maxit = 100, trace = FALSE, epsilo...
/R/make.control.flexrsurv.R
no_license
cran/flexrsurv
R
false
false
1,296
r
control.flexrsurv.additive <- function (epsilon = 1e-08, maxit = 25, trace = FALSE, ...){ # controls for flexrsurv additive models are glm.controls return(glm.control(epsilon = epsilon, maxit = maxit, trace = trace)) } control.flexrsurv.multiplicative <- function (epsilon = 1e-8, maxit = 100, trace = FALSE, epsilo...
interbatt = function(X,Y){ Vxy = var(X,Y) rank = qr(Vxy)$rank print(paste("Rank of CoVar Matrix ",rank)) aib = eigen(t(Vxy)%*%Vxy) A = Vxy %*% aib$vectors %*% diag(aib$values^(-0.5)) TIB = as.matrix(X) %*% A rl = list(TIB, A) return(rl) } eval_func = function(y, yhat, cm_show = FALSE){ metrics = c() ...
/A3 IBA/Util.R
no_license
krishnakalyan3/KernelMachineLearning
R
false
false
913
r
interbatt = function(X,Y){ Vxy = var(X,Y) rank = qr(Vxy)$rank print(paste("Rank of CoVar Matrix ",rank)) aib = eigen(t(Vxy)%*%Vxy) A = Vxy %*% aib$vectors %*% diag(aib$values^(-0.5)) TIB = as.matrix(X) %*% A rl = list(TIB, A) return(rl) } eval_func = function(y, yhat, cm_show = FALSE){ metrics = c() ...
#' Convert g_c (\eqn{\mu}mol CO2/m^2/s/Pa) to g_w (\eqn{\mu}mol H2O /m^2/s/Pa) #' #' @param g_w conductance to water vapor in units #' (\eqn{\mu}mol H2O / (m^2 s Pa)) of class \code{units}. #' @param D_c diffusion coefficient for CO2 in air in units of m^2/s of class #' \code{units} #' @param D_w diffusion coefficient ...
/R/convert-species.R
permissive
cdmuir/gunit
R
false
false
2,919
r
#' Convert g_c (\eqn{\mu}mol CO2/m^2/s/Pa) to g_w (\eqn{\mu}mol H2O /m^2/s/Pa) #' #' @param g_w conductance to water vapor in units #' (\eqn{\mu}mol H2O / (m^2 s Pa)) of class \code{units}. #' @param D_c diffusion coefficient for CO2 in air in units of m^2/s of class #' \code{units} #' @param D_w diffusion coefficient ...
\name{SO2} \alias{SO2} \title{Sulphur dioxide measurements over Europe} \description{ The data document values of SO2, on a log scale, from monitoring stations across Europe from 1990 to 2001. The data were collected through the 'European monitoring and evaluation programme' (EMEP) and they are available at \url{htt...
/man/SO2.Rd
no_license
cran/rpanel
R
false
false
1,449
rd
\name{SO2} \alias{SO2} \title{Sulphur dioxide measurements over Europe} \description{ The data document values of SO2, on a log scale, from monitoring stations across Europe from 1990 to 2001. The data were collected through the 'European monitoring and evaluation programme' (EMEP) and they are available at \url{htt...
args <- commandArgs(trailingOnly=TRUE) # test if there is at least one argument: if not, return an error if (length(args)!= 2) { stop("Two arguments must be supplied. The First argument is CSV File. The second argument is PNG File.\n", call.=FALSE) } else { # default output file inFile <- args[1] ...
/old_files_not_used/sampleqc/script.1.r
no_license
GW-HIVE/bioxpress
R
false
false
4,862
r
args <- commandArgs(trailingOnly=TRUE) # test if there is at least one argument: if not, return an error if (length(args)!= 2) { stop("Two arguments must be supplied. The First argument is CSV File. The second argument is PNG File.\n", call.=FALSE) } else { # default output file inFile <- args[1] ...
/new_scripts/PRSset_rename_output_SDA.R
no_license
leosplasc/datasharing
R
false
false
4,389
r
## ----knitr_init, echo=FALSE, cache=FALSE---------------------------------------------------------- knitr::opts_chunk$set(echo = TRUE) options(width=100) ## ---- messages=TRUE, warnings=TRUE, errors=TRUE--------------------------------------------------- library(streamMetabolizer) ## --------------------------------...
/inst/doc/ode_methods.R
permissive
weisoon/streamMetabolizer
R
false
false
1,671
r
## ----knitr_init, echo=FALSE, cache=FALSE---------------------------------------------------------- knitr::opts_chunk$set(echo = TRUE) options(width=100) ## ---- messages=TRUE, warnings=TRUE, errors=TRUE--------------------------------------------------- library(streamMetabolizer) ## --------------------------------...
#' @title Log-likelihood function of a CUB model without covariates #' @description Compute the log-likelihood function of a CUB model without covariates for a given #' absolute frequency distribution. #' @aliases loglikcub00 #' @usage loglikcub00(m, freq, beta0, gama0) #' @param m Number of ordinal categories #...
/R/loglikcub00.R
no_license
CristianPachacama/FastCUB
R
false
false
685
r
#' @title Log-likelihood function of a CUB model without covariates #' @description Compute the log-likelihood function of a CUB model without covariates for a given #' absolute frequency distribution. #' @aliases loglikcub00 #' @usage loglikcub00(m, freq, beta0, gama0) #' @param m Number of ordinal categories #...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/exportReportsTyped.R \name{exportReportsTyped} \alias{exportReportsTyped} \alias{exportReportsTyped.redcapApiConnection} \title{Export a Report from a REDCap Project} \usage{ exportReportsTyped(rcon, report_id, ...) \method{exportReportsType...
/man/exportReportsTyped.Rd
no_license
nutterb/redcapAPI
R
false
true
3,879
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/exportReportsTyped.R \name{exportReportsTyped} \alias{exportReportsTyped} \alias{exportReportsTyped.redcapApiConnection} \title{Export a Report from a REDCap Project} \usage{ exportReportsTyped(rcon, report_id, ...) \method{exportReportsType...
# # Copyright (C) 1997-2010 Friedrich Leisch # $Id: mlbench-class.R 4612 2010-10-08 09:51:20Z leisch $ # mlbench.xor <- function(n, d=2){ x <- matrix(runif(n*d,-1,1),ncol=d,nrow=n) if((d != as.integer(d)) || (d<2)) stop("d must be an integer >=2") z <- rep(0, length=n) for(k in 1:n){ if(x[k,1]>=0){...
/mlbench/R/mlbench-class.R
no_license
ingted/R-Examples
R
false
false
12,968
r
# # Copyright (C) 1997-2010 Friedrich Leisch # $Id: mlbench-class.R 4612 2010-10-08 09:51:20Z leisch $ # mlbench.xor <- function(n, d=2){ x <- matrix(runif(n*d,-1,1),ncol=d,nrow=n) if((d != as.integer(d)) || (d<2)) stop("d must be an integer >=2") z <- rep(0, length=n) for(k in 1:n){ if(x[k,1]>=0){...
#!/applications/R/R-3.5.0/bin/Rscript # For all three wheat subgenomes, load and plot as bargraphs results from # hypergeometric tests to determine whether each # NLR-encoding gene quantile is over-represented or under-represented for # NLRs that are not part of an NLR cluster # (e.g., is the proportion of NLR genes w...
/ASY1_CS/snakemake_ChIPseq/mapped/geneProfiles_subgenomes/NLR_quantiles/proportion_not_clustered_in_NLR_quantiles_hypergeometricTest_bargraph_only.R
no_license
ajtock/wheat
R
false
false
8,805
r
#!/applications/R/R-3.5.0/bin/Rscript # For all three wheat subgenomes, load and plot as bargraphs results from # hypergeometric tests to determine whether each # NLR-encoding gene quantile is over-represented or under-represented for # NLRs that are not part of an NLR cluster # (e.g., is the proportion of NLR genes w...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/data.R \name{fcl} \alias{fcl} \title{FCL items description.} \format{A data frame with 776 observations of 6 variables. \describe{ \item{fcl}{FCL-code of item, numeric.} }} \description{ FCL items description. }
/man/fcl.Rd
no_license
malexan/fclhs
R
false
false
302
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/data.R \name{fcl} \alias{fcl} \title{FCL items description.} \format{A data frame with 776 observations of 6 variables. \describe{ \item{fcl}{FCL-code of item, numeric.} }} \description{ FCL items description. }
unzip("data/exdata-data-NEI_data.zip", exdir = "data" ) NEI <- readRDS("data//summarySCC_PM25.rds") SCC <- readRDS("data//Source_Classification_Code.rds") motorRowsFilter <- grep("motor", SCC$Short.Name, ignore.case = TRUE) motorRowsinSCC <- SCC[motorRowsFilter, ] motorRowsIds <- as.character(motorRowsinSCC$SCC) N...
/Course Project 2/Plot6.R
no_license
element824/Exploratory-Data-Analysis-on-Coursera
R
false
false
1,133
r
unzip("data/exdata-data-NEI_data.zip", exdir = "data" ) NEI <- readRDS("data//summarySCC_PM25.rds") SCC <- readRDS("data//Source_Classification_Code.rds") motorRowsFilter <- grep("motor", SCC$Short.Name, ignore.case = TRUE) motorRowsinSCC <- SCC[motorRowsFilter, ] motorRowsIds <- as.character(motorRowsinSCC$SCC) N...
# getdateplot.R # short script to extract and write data to build the location plot setwd("/Users/vjdorazio/Desktop/github/TwoRavens/R") library(countrycode) library(stringi) ## this is a good option to set... options(stringsAsFactors = FALSE) #read the data data <- read.delim("../data/samplePhox.csv",s...
/R/getlocationdata.R
no_license
TwoRavens/EventData
R
false
false
1,070
r
# getdateplot.R # short script to extract and write data to build the location plot setwd("/Users/vjdorazio/Desktop/github/TwoRavens/R") library(countrycode) library(stringi) ## this is a good option to set... options(stringsAsFactors = FALSE) #read the data data <- read.delim("../data/samplePhox.csv",s...
library(tidyverse) library(stringi) sequence_data = read.table("mm10_promoters_sequences_500up_2500down.txt", stringsAsFactors = F) colnames(sequence_data) = c("Gene", "sequence") sequence_data$class = "ICP" for (i in 1:length(sequence_data$sequence)) { seqtxt = sequence_data$sequence[i] seqlen = nchar(seqtxt) ...
/sequence_cpg_analysis.R
no_license
shah-rohan/bivalency
R
false
false
1,042
r
library(tidyverse) library(stringi) sequence_data = read.table("mm10_promoters_sequences_500up_2500down.txt", stringsAsFactors = F) colnames(sequence_data) = c("Gene", "sequence") sequence_data$class = "ICP" for (i in 1:length(sequence_data$sequence)) { seqtxt = sequence_data$sequence[i] seqlen = nchar(seqtxt) ...
## function makeCacheMatrix ## ## input : an invertible matrix ## output : a list of function-type objects ## ## processing : the function sets a memory location (m) with the matrix (x) received in input ## and creates a list of function objects that can be called from solveMatrix. ## ## function objects '...
/cachematrix.R
no_license
espillier/ProgrammingAssignment2
R
false
false
1,903
r
## function makeCacheMatrix ## ## input : an invertible matrix ## output : a list of function-type objects ## ## processing : the function sets a memory location (m) with the matrix (x) received in input ## and creates a list of function objects that can be called from solveMatrix. ## ## function objects '...
#' Example Data #' #' A dataset containing true values and predictions of an unknown #' quantity in March an April 2020 on #' the two planets Tatooine and Coruscant. Predictions were generated using #' different models. The data on Coruscant is just a simple modulation #' of the values observed on Tatooine. #' #' ...
/R/data.R
permissive
FelipeJColon/stackr
R
false
false
897
r
#' Example Data #' #' A dataset containing true values and predictions of an unknown #' quantity in March an April 2020 on #' the two planets Tatooine and Coruscant. Predictions were generated using #' different models. The data on Coruscant is just a simple modulation #' of the values observed on Tatooine. #' #' ...
##---------------------------------------------------------------------------- ## Title: Choropleth tematic map ## Author: Armando Enriquez Z. ## Date: October 28th, 2014 ## Purpose: Create a choropleth tematic map with ggplot tools ##---------------------------------------------------------------------------- ## R li...
/lifeChoropleth.R
no_license
elabuel-o/choropleth-map1
R
false
false
2,673
r
##---------------------------------------------------------------------------- ## Title: Choropleth tematic map ## Author: Armando Enriquez Z. ## Date: October 28th, 2014 ## Purpose: Create a choropleth tematic map with ggplot tools ##---------------------------------------------------------------------------- ## R li...
library(cheddar) ### Name: PlotNPSDistribution ### Title: Plot distributions of node properties ### Aliases: PlotNPSDistribution PlotBDistribution PlotMDistribution ### PlotNDistribution PlotDegreeDistribution ### Keywords: hplot ### ** Examples data(TL84) PlotMDistribution(TL84) # A bandwidth of 3 PlotMDistrib...
/data/genthat_extracted_code/cheddar/examples/PlotNPSDistribution.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
390
r
library(cheddar) ### Name: PlotNPSDistribution ### Title: Plot distributions of node properties ### Aliases: PlotNPSDistribution PlotBDistribution PlotMDistribution ### PlotNDistribution PlotDegreeDistribution ### Keywords: hplot ### ** Examples data(TL84) PlotMDistribution(TL84) # A bandwidth of 3 PlotMDistrib...
# MSM ----------------------------------------------------------------- #' @title Network Resimulation Module #' #' @description Module function for resimulating the main, casual, and one-off #' networks for one time step. #' #' @inheritParams aging_msm #' #' @keywords module msm #' #' @export #' simnet_...
/tempR/mod.simnet.R
no_license
dth2/EpiModelHIV_SHAMP
R
false
false
17,211
r
# MSM ----------------------------------------------------------------- #' @title Network Resimulation Module #' #' @description Module function for resimulating the main, casual, and one-off #' networks for one time step. #' #' @inheritParams aging_msm #' #' @keywords module msm #' #' @export #' simnet_...
library(tidyverse) library(shiny) ui <-fluidPage( h2("BoxPlot and Histogram", style = "color:red"), h4("by Mahima Palamanda", style ="color:blue"), numericInput(inputId = "n", label = "Sample size", value = 25), plotOutput(outputId = "boxplot"), plotOutput(outputId = "histogramplot") ) server <- function(inp...
/Shiny-HW-11.R
no_license
mahima229/Shiny11
R
false
false
544
r
library(tidyverse) library(shiny) ui <-fluidPage( h2("BoxPlot and Histogram", style = "color:red"), h4("by Mahima Palamanda", style ="color:blue"), numericInput(inputId = "n", label = "Sample size", value = 25), plotOutput(outputId = "boxplot"), plotOutput(outputId = "histogramplot") ) server <- function(inp...
# Reading, naming and subsetting power consumption data power <- read.table("household_power_consumption.txt",skip=1,sep=";") names(power) <- c("Date","Time","Global_active_power","Global_reactive_power","Voltage","Global_intensity","Sub_metering_1","Sub_metering_2","Sub_metering_3") subpower <- subset(power,power$Date...
/Plot2.R
no_license
akashggupta/Exporatory-Data-Analysis-Project-1
R
false
false
1,032
r
# Reading, naming and subsetting power consumption data power <- read.table("household_power_consumption.txt",skip=1,sep=";") names(power) <- c("Date","Time","Global_active_power","Global_reactive_power","Voltage","Global_intensity","Sub_metering_1","Sub_metering_2","Sub_metering_3") subpower <- subset(power,power$Date...
cvolumbag<-function(component,AtomlistAtom,AtomlistNext,low,upp,steppi) { d<-dim(low)[2] componum<-length(component) volume<-matrix(0,componum,1) for (i in 1:componum){ curvolu<-0 pointer<-component[i] while (pointer>0){ atto<-AtomlistAtom[pointer] vol<-1 for (j in 1:d){ ...
/R/cvolumbag.R
no_license
cran/denpro
R
false
false
490
r
cvolumbag<-function(component,AtomlistAtom,AtomlistNext,low,upp,steppi) { d<-dim(low)[2] componum<-length(component) volume<-matrix(0,componum,1) for (i in 1:componum){ curvolu<-0 pointer<-component[i] while (pointer>0){ atto<-AtomlistAtom[pointer] vol<-1 for (j in 1:d){ ...
#' Keep track of the active scenarios name and give a clojure to check them later #' #' @param ... #' a list of scenarios (probably their names) #' #' @return #' a clojure function that gets a list of scenarios (probably their names) and return TRUE/FALSE if they are in the set #' @export #' #' @examples #' is_there <-...
/R/scenario.R
no_license
shahryareiv/singleverbr
R
false
false
624
r
#' Keep track of the active scenarios name and give a clojure to check them later #' #' @param ... #' a list of scenarios (probably their names) #' #' @return #' a clojure function that gets a list of scenarios (probably their names) and return TRUE/FALSE if they are in the set #' @export #' #' @examples #' is_there <-...
library("quanteda") library("dplyr") library("readr") library("purrr") library("stringr") library("readtext") library("reshape2") library("magrittr") library("ggplot2") library("gridExtra") masterIndex <- read_csv("master_index_10Q_withFile.csv") tickers <- unique(masterIndex$ticker) # use unique(masterIndex) if we wi...
/Documentation/Text-Distance-Algo-10Q.R
no_license
EricHe98/Financial-Statements-Text-Analysis
R
false
false
3,926
r
library("quanteda") library("dplyr") library("readr") library("purrr") library("stringr") library("readtext") library("reshape2") library("magrittr") library("ggplot2") library("gridExtra") masterIndex <- read_csv("master_index_10Q_withFile.csv") tickers <- unique(masterIndex$ticker) # use unique(masterIndex) if we wi...
library(bold) ### Name: bold_seqspec ### Title: Get BOLD specimen + sequence data. ### Aliases: bold_seqspec ### ** Examples ## Not run: ##D bold_seqspec(taxon='Osmia') ##D bold_seqspec(taxon='Osmia', format='xml') ##D bold_seqspec(taxon='Osmia', response=TRUE) ##D res <- bold_seqspec(taxon='Osmia', sepfasta=TRUE)...
/data/genthat_extracted_code/bold/examples/bold_seqspec.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
888
r
library(bold) ### Name: bold_seqspec ### Title: Get BOLD specimen + sequence data. ### Aliases: bold_seqspec ### ** Examples ## Not run: ##D bold_seqspec(taxon='Osmia') ##D bold_seqspec(taxon='Osmia', format='xml') ##D bold_seqspec(taxon='Osmia', response=TRUE) ##D res <- bold_seqspec(taxon='Osmia', sepfasta=TRUE)...
round2 = function(x, n) { #this function ensures that values ending in 0.5 are round up to the next integer - not down to zero (R's default) posneg = sign(x) z = abs(x)*10^n z = z + 0.5 + sqrt(.Machine$double.eps) z = trunc(z) z = z/10^n z*posneg } addLenMeasInfo <- function(df = NULL){ #set LENMEASTYP...
/R/Mar_utilities.R
permissive
Maritimes/CanaDatras
R
false
false
1,219
r
round2 = function(x, n) { #this function ensures that values ending in 0.5 are round up to the next integer - not down to zero (R's default) posneg = sign(x) z = abs(x)*10^n z = z + 0.5 + sqrt(.Machine$double.eps) z = trunc(z) z = z/10^n z*posneg } addLenMeasInfo <- function(df = NULL){ #set LENMEASTYP...
plots <- function(){ # It's assumed that the required file is already contained in the working directory # Each plot is saved in a .PNG file # Read data file, but only the rows with date='2/2/2007' or date='1/2/2007 # Convert the column named "Date" to type Date require(sqldf) testdata <- read.csv.s...
/week1_plots.R
no_license
Laik2/ExData_Plotting1
R
false
false
2,289
r
plots <- function(){ # It's assumed that the required file is already contained in the working directory # Each plot is saved in a .PNG file # Read data file, but only the rows with date='2/2/2007' or date='1/2/2007 # Convert the column named "Date" to type Date require(sqldf) testdata <- read.csv.s...
# Module UI function notification_module_output <- function(id){ ns <- NS(id) dropdownMenuOutput("notification") } # Module server function notification_module <- function(input, output, session){ output$notification <- renderMenu({ dropdownMenu(type = "notifications", badgeStatus = "warni...
/real_time_reporting/modules/notification_module.R
no_license
marton-balazs-kovacs/going_real_time
R
false
false
622
r
# Module UI function notification_module_output <- function(id){ ns <- NS(id) dropdownMenuOutput("notification") } # Module server function notification_module <- function(input, output, session){ output$notification <- renderMenu({ dropdownMenu(type = "notifications", badgeStatus = "warni...
unitize_1 <- function(z) { # min-max normalization - 0 -1 min.z <- min(z) max.z <- max(z) if ((max.z-min.z)==0) return(z) (z - min.z )/(max.z-min.z) } unitize_2 <- function(z) { # Mean and SD normalization mean.z <- mean(z) sd.z <- sd(z) #print(sd.z) if (sd.z==0) return(z) (z - mean.z )/...
/R/utils.R
permissive
sevvandi/dobin
R
false
false
487
r
unitize_1 <- function(z) { # min-max normalization - 0 -1 min.z <- min(z) max.z <- max(z) if ((max.z-min.z)==0) return(z) (z - min.z )/(max.z-min.z) } unitize_2 <- function(z) { # Mean and SD normalization mean.z <- mean(z) sd.z <- sd(z) #print(sd.z) if (sd.z==0) return(z) (z - mean.z )/...
auc <- function(sens, spec) { .tab.res <- data.frame(se=sens, sp=spec) .tab.res <- .tab.res[!is.na(.tab.res$sp + .tab.res$se),] .tab.res$sp1 <- 1-.tab.res$sp .tab.res <- .tab.res[order(.tab.res$sp1, .tab.res$se),] .tab.res <- rbind(c(0,1,0), .tab.res, c(1,0,1)) return( sum((.tab.res$sp1[2:length(.tab.res$sp1...
/R/auc.R
no_license
cran/RISCA
R
false
false
467
r
auc <- function(sens, spec) { .tab.res <- data.frame(se=sens, sp=spec) .tab.res <- .tab.res[!is.na(.tab.res$sp + .tab.res$se),] .tab.res$sp1 <- 1-.tab.res$sp .tab.res <- .tab.res[order(.tab.res$sp1, .tab.res$se),] .tab.res <- rbind(c(0,1,0), .tab.res, c(1,0,1)) return( sum((.tab.res$sp1[2:length(.tab.res$sp1...
flower <- read.csv("https://storage.googleapis.com/dimensionl ess/Analytics/flower.csv",header = FALSE) flower str(flower) dim(flower) flowermatrix <- as.matrix(flower) flowervector <- as.vector(flowermatrix) dim(flowermatrix) distance1<- dist(flowervector,method = "euclidean") distance1 clusterintensity<-hcl...
/Image segmentation.R
no_license
Deva-Vid/R-github
R
false
false
4,011
r
flower <- read.csv("https://storage.googleapis.com/dimensionl ess/Analytics/flower.csv",header = FALSE) flower str(flower) dim(flower) flowermatrix <- as.matrix(flower) flowervector <- as.vector(flowermatrix) dim(flowermatrix) distance1<- dist(flowervector,method = "euclidean") distance1 clusterintensity<-hcl...
########################################################### ############## VIP_NPLSDADietBiom.R ############### ########################################################### # Author: Leandro Balzano-Nogueira # Genetics Institute, University of Florida (Gainesville) # This script is to create the Dietary Biomark...
/VIP_NPLSDADietBiom.R
no_license
ConesaLab/TEDDY_Multi-Omics_Integration
R
false
false
6,508
r
########################################################### ############## VIP_NPLSDADietBiom.R ############### ########################################################### # Author: Leandro Balzano-Nogueira # Genetics Institute, University of Florida (Gainesville) # This script is to create the Dietary Biomark...
context("knob") test_that("default", { tagkb <- knobInput( inputId = "myKnob", label = "Display previous:", value = 50, min = -100, displayPrevious = TRUE, fgColor = "#428BCA", inputColor = "#428BCA" ) expect_is(tagkb, "shiny.tag") expect_length(htmltools::findDependencies(tagkb)...
/tests/testthat/test-knob.R
permissive
micahwilhelm/shinyWidgets
R
false
false
1,475
r
context("knob") test_that("default", { tagkb <- knobInput( inputId = "myKnob", label = "Display previous:", value = 50, min = -100, displayPrevious = TRUE, fgColor = "#428BCA", inputColor = "#428BCA" ) expect_is(tagkb, "shiny.tag") expect_length(htmltools::findDependencies(tagkb)...
#reading the data, assume that the data file is in the folder up from the code data <- read.table("../household_power_consumption.txt", sep=";") #taking out the feb data febdata <- data[data$V1== "1/2/2007" | data$V1 == "2/2/2007",] #naming the columns namesdata <- c("Date", "Time", "Global_active_power", "Global_rea...
/plot2.R
no_license
vivekdarera/ExData_Plotting1
R
false
false
845
r
#reading the data, assume that the data file is in the folder up from the code data <- read.table("../household_power_consumption.txt", sep=";") #taking out the feb data febdata <- data[data$V1== "1/2/2007" | data$V1 == "2/2/2007",] #naming the columns namesdata <- c("Date", "Time", "Global_active_power", "Global_rea...
## Matrix inversion is usually a costly computation and there may be some benefit ## to caching the inverse of a matrix rather than computing it repeatedly. This is ## implemented in this program. ## makeCacheMatrix function takes in a default matrix data structure and creates ## a special "matrix" object that can ...
/cachematrix.R
no_license
npatta01/ProgrammingAssignment2
R
false
false
1,917
r
## Matrix inversion is usually a costly computation and there may be some benefit ## to caching the inverse of a matrix rather than computing it repeatedly. This is ## implemented in this program. ## makeCacheMatrix function takes in a default matrix data structure and creates ## a special "matrix" object that can ...
## server.R library(shiny) shinyServer(function(input, output) { output$selectSeason <- renderUI({ selectInput('selectSeason', 'Season:', season.values(input$selectCountry), selected = input$selectSeaso...
/server.R
permissive
maxmax65/footy-visualization
R
false
false
2,590
r
## server.R library(shiny) shinyServer(function(input, output) { output$selectSeason <- renderUI({ selectInput('selectSeason', 'Season:', season.values(input$selectCountry), selected = input$selectSeaso...
setwd("/data/gaos2/tmp/mousehuman/FigureS6") rm(list=ls()) library(Seurat) load("../analysis/humanmouse.RData") human <- NormalizeData(human) mouse <- NormalizeData(mouse) # Gene selection for input to CCA human <- FindVariableGenes(human, do.plot = F) mouse <- FindVariableGenes(mouse, do.plot = F) g.1 <- head(rowname...
/jeerthiliza/mousehuman/FigureS6/analysisCorrelation.R
no_license
shouguog/hematopoiesis
R
false
false
1,504
r
setwd("/data/gaos2/tmp/mousehuman/FigureS6") rm(list=ls()) library(Seurat) load("../analysis/humanmouse.RData") human <- NormalizeData(human) mouse <- NormalizeData(mouse) # Gene selection for input to CCA human <- FindVariableGenes(human, do.plot = F) mouse <- FindVariableGenes(mouse, do.plot = F) g.1 <- head(rowname...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/json.R \name{read_json_arrow} \alias{read_json_arrow} \title{Read a JSON file} \usage{ read_json_arrow( file, col_select = NULL, as_data_frame = TRUE, schema = NULL, ... ) } \arguments{ \item{file}{A character file name or URI, \cod...
/r/man/read_json_arrow.Rd
permissive
andygrove/arrow
R
false
true
2,798
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/json.R \name{read_json_arrow} \alias{read_json_arrow} \title{Read a JSON file} \usage{ read_json_arrow( file, col_select = NULL, as_data_frame = TRUE, schema = NULL, ... ) } \arguments{ \item{file}{A character file name or URI, \cod...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/de.R \name{de} \alias{de} \title{Finds all decendants of a particular node in a tree.} \usage{ de(x, tree) } \arguments{ \item{x}{node} \item{tree}{interaction tree} } \value{ Returns all the descendant nodes from the node `x` ...
/man/de.Rd
no_license
menghaomiao/ITR.Forest
R
false
true
596
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/de.R \name{de} \alias{de} \title{Finds all decendants of a particular node in a tree.} \usage{ de(x, tree) } \arguments{ \item{x}{node} \item{tree}{interaction tree} } \value{ Returns all the descendant nodes from the node `x` ...
## PR 1271 detach("package:base") crashes R. tools::assertError(detach("package:base")) ## invalid 'lib.loc' stopifnot(length(installed.packages("mgcv")) == 0) ## gave a low-level error message ## package.skeleton() with metadata-only code ## work in current (= ./tests/ directory): tmp <- tempfile() writeLines(c('...
/source/macOS/R-Portable-Mac/tests/reg-packages.R
permissive
romanhaa/Cerebro
R
false
false
8,537
r
## PR 1271 detach("package:base") crashes R. tools::assertError(detach("package:base")) ## invalid 'lib.loc' stopifnot(length(installed.packages("mgcv")) == 0) ## gave a low-level error message ## package.skeleton() with metadata-only code ## work in current (= ./tests/ directory): tmp <- tempfile() writeLines(c('...
/man/MVA.corplot.Rd
no_license
SeptiawanAjiP/RVAideMemoire
R
false
false
10,948
rd
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 1.22809678694366e+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), .Dim = c(10L, 3L))) result <- do.call(CNull:::communities_individual_based_sampling...
/CNull/inst/testfiles/communities_individual_based_sampling_alpha/AFL_communities_individual_based_sampling_alpha/communities_individual_based_sampling_alpha_valgrind_files/1615778939-test.R
no_license
akhikolla/updatedatatype-list2
R
false
false
348
r
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 1.22809678694366e+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), .Dim = c(10L, 3L))) result <- do.call(CNull:::communities_individual_based_sampling...
library( magrittr ) ## reading raw tsv StandardCurrencyTypeList <- data.table::fread( file = "data-raw/StandardCurrencyTypeList.tsv", encoding = "UTF-8" ) ## trimming character columns lapply( X = names( x = StandardCurrencyTypeList ), FUN = function( col ) { if( is.character( StandardCurrencyT...
/data-raw/StandardCurrencyTypeList.R
no_license
krose/entsoeapi
R
false
false
1,040
r
library( magrittr ) ## reading raw tsv StandardCurrencyTypeList <- data.table::fread( file = "data-raw/StandardCurrencyTypeList.tsv", encoding = "UTF-8" ) ## trimming character columns lapply( X = names( x = StandardCurrencyTypeList ), FUN = function( col ) { if( is.character( StandardCurrencyT...
## Working Directory with the zip file. library(dplyr) unzip("exdata-data-household_power_consumption.zip", exdir =".", unzip = "internal", setTimes = TRUE) dir() bigfile <- read.table("household_power_consumption.txt", na.strings = c("?", ""), sep = ";", header = T) tblbigfile <- tbl_df(bigfile) str(tblbigfil...
/plot3.R
no_license
Mahidur/ExData_Plotting1
R
false
false
1,415
r
## Working Directory with the zip file. library(dplyr) unzip("exdata-data-household_power_consumption.zip", exdir =".", unzip = "internal", setTimes = TRUE) dir() bigfile <- read.table("household_power_consumption.txt", na.strings = c("?", ""), sep = ";", header = T) tblbigfile <- tbl_df(bigfile) str(tblbigfil...
#' Compute Spans for Ticks on Custom Axes #' #' @param breaks Vector of breaks for a ggplot object #' @param span Proportion of the range of the breaks the ticks should span in each direction #' #' @return Value representing the distance left or right the tick should span from the drawn axis #' #' #' size_ticks <- fun...
/R/size_ticks.R
permissive
ryan-heslin/matador
R
false
false
414
r
#' Compute Spans for Ticks on Custom Axes #' #' @param breaks Vector of breaks for a ggplot object #' @param span Proportion of the range of the breaks the ticks should span in each direction #' #' @return Value representing the distance left or right the tick should span from the drawn axis #' #' #' size_ticks <- fun...
#! /usr/bin/env R library(tidyverse) library(TCGAbiolinks) tcga_ids <- as_tibble(getGDCprojects()) %>% dplyr::select(id) %>% dplyr::filter(grepl("TCGA", id)) %>% dplyr::mutate(id = gsub("TCGA-", "", id)) %>% unlist() %>% unname() ##each time run, some disease types were...
/bin/TCGAbiolinks.maf_dl.R
no_license
brucemoran/TCGA_MAF_GeneList-vs-Random
R
false
false
490
r
#! /usr/bin/env R library(tidyverse) library(TCGAbiolinks) tcga_ids <- as_tibble(getGDCprojects()) %>% dplyr::select(id) %>% dplyr::filter(grepl("TCGA", id)) %>% dplyr::mutate(id = gsub("TCGA-", "", id)) %>% unlist() %>% unname() ##each time run, some disease types were...
closeAllConnections() rm(list = ls(all = TRUE)) library(stringr) source("C://users/John/Google Drive/R libraries/Libraries.R") source("C://users/John/Google Drive/Mind games/Investment strategies/functions3.R") #Run the analysis monte_carlo_investment()
/main.R
no_license
johnbrussell/investment_strategies
R
false
false
256
r
closeAllConnections() rm(list = ls(all = TRUE)) library(stringr) source("C://users/John/Google Drive/R libraries/Libraries.R") source("C://users/John/Google Drive/Mind games/Investment strategies/functions3.R") #Run the analysis monte_carlo_investment()
library(raster) # Package to handle raster-formatted spatial data library(rasterVis) # The rasterVis package complements the raster package, providing a set of methods for enhanced visualization and interaction # Defines visualisation methods with 'levelplot' library(dismo) # Dismo has the SDM analyses for maxent and s...
/Future Code Iteration Cockle.R
no_license
laxmack21/Severn-Estuary-SDMS
R
false
false
11,321
r
library(raster) # Package to handle raster-formatted spatial data library(rasterVis) # The rasterVis package complements the raster package, providing a set of methods for enhanced visualization and interaction # Defines visualisation methods with 'levelplot' library(dismo) # Dismo has the SDM analyses for maxent and s...