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
\name{spotter} \alias{spotter} \title{Make a spotting function} \usage{ spotter(...) } \arguments{ \item{...}{The items for which the new function should return \code{TRUE}} } \value{ A function } \description{ Hands back a function to spot the items it was given in (\code{...}) } \details{ This is a conv...
/man/spotter.Rd
no_license
cran/events
R
false
false
442
rd
\name{spotter} \alias{spotter} \title{Make a spotting function} \usage{ spotter(...) } \arguments{ \item{...}{The items for which the new function should return \code{TRUE}} } \value{ A function } \description{ Hands back a function to spot the items it was given in (\code{...}) } \details{ This is a conv...
head(iris) summary(iris) sepal_length <- iris["Sepal.Length"] sepal_length length(sepal_length)
/R/version-control-session.R
no_license
vanjakosjerina/learning.r
R
false
false
103
r
head(iris) summary(iris) sepal_length <- iris["Sepal.Length"] sepal_length length(sepal_length)
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/estFixEffSSNbd_orig.R \name{estFixEffSSNbd_orig} \alias{estFixEffSSNbd_orig} \title{estimates fixed effects with fast methods for big data with SSN} \usage{ estFixEffSSNbd_orig(estCovParSSN) } \arguments{ \item{estCovParSSN}{an object of clas...
/man/estFixEffSSNbd_orig.Rd
no_license
jayverhoef/SSNbd
R
false
true
514
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/estFixEffSSNbd_orig.R \name{estFixEffSSNbd_orig} \alias{estFixEffSSNbd_orig} \title{estimates fixed effects with fast methods for big data with SSN} \usage{ estFixEffSSNbd_orig(estCovParSSN) } \arguments{ \item{estCovParSSN}{an object of clas...
testlist <- list(G = numeric(0), Rn = numeric(0), atmp = numeric(0), ra = numeric(0), relh = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), rs = numeric(0), temp = c(8.57286331802081e-312, 1.56898424065867e+82, NaN, -1.3258495253834e-113, 2.79620616433656e-119, -...
/meteor/inst/testfiles/ET0_PenmanMonteith/AFL_ET0_PenmanMonteith/ET0_PenmanMonteith_valgrind_files/1615840487-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
697
r
testlist <- list(G = numeric(0), Rn = numeric(0), atmp = numeric(0), ra = numeric(0), relh = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), rs = numeric(0), temp = c(8.57286331802081e-312, 1.56898424065867e+82, NaN, -1.3258495253834e-113, 2.79620616433656e-119, -...
test_format <- function(name, os_skip = NULL) { # don't run on CRAN due to complicated dependencies (Pandoc/LaTeX packages) if (!identical(Sys.getenv("NOT_CRAN"), "true")) return() # skip on OS if requested if (!is.null(os_skip)) return() # work in a temp directory dir <- tempfile() dir.create(dir) ol...
/tests/testit/test-formats.R
no_license
3zn/rticles
R
false
false
1,339
r
test_format <- function(name, os_skip = NULL) { # don't run on CRAN due to complicated dependencies (Pandoc/LaTeX packages) if (!identical(Sys.getenv("NOT_CRAN"), "true")) return() # skip on OS if requested if (!is.null(os_skip)) return() # work in a temp directory dir <- tempfile() dir.create(dir) ol...
AddSpecialPaths = function(position_table, ls){ return(add_special_paths(position_table = position_table, ls = ls)) } SavePlot = function(plt, name){ save_plot(plt, name) } MakeCircle = function(center = c(0,0), radius = 1, precision = 100){ return(make_circle(center = center, radius = radius, precision = preci...
/R/Graphing/GraphingHelpers.R
no_license
hejtmy/iEEG-unity
R
false
false
410
r
AddSpecialPaths = function(position_table, ls){ return(add_special_paths(position_table = position_table, ls = ls)) } SavePlot = function(plt, name){ save_plot(plt, name) } MakeCircle = function(center = c(0,0), radius = 1, precision = 100){ return(make_circle(center = center, radius = radius, precision = preci...
# --- # SCRIPT DA AULA 3 - Nome Sobrenome, Data # --- # Primeiro, carregamos o tidyverse library(tidyverse)
/1_aulas/aula_3/script_aula_3.R
no_license
jonatasvarella/introducao_ao_r_modus
R
false
false
109
r
# --- # SCRIPT DA AULA 3 - Nome Sobrenome, Data # --- # Primeiro, carregamos o tidyverse library(tidyverse)
c DCNF-Autarky [version 0.0.1]. c Copyright (c) 2018-2019 Swansea University. c c Input Clause Count: 21166 c Performing E1-Autarky iteration. c Remaining clauses count after E-Reduction: 21166 c c Input Parameter (command line, file): c input filename QBFLIB/Amendola-Ricca-Truszczynski/selection-hard/ctrl.e#1.a#...
/code/dcnf-ankit-optimized/Results/QBFLIB-2018/E1/Experiments/Amendola-Ricca-Truszczynski/selection-hard/ctrl.e#1.a#3.E#126.A#48.c#.w#7.s#56.asp/ctrl.e#1.a#3.E#126.A#48.c#.w#7.s#56.asp.R
no_license
arey0pushpa/dcnf-autarky
R
false
false
732
r
c DCNF-Autarky [version 0.0.1]. c Copyright (c) 2018-2019 Swansea University. c c Input Clause Count: 21166 c Performing E1-Autarky iteration. c Remaining clauses count after E-Reduction: 21166 c c Input Parameter (command line, file): c input filename QBFLIB/Amendola-Ricca-Truszczynski/selection-hard/ctrl.e#1.a#...
library(tidyverse) library(srvyr) dta <- read_rds("pums_final.rds") %>% mutate(statefip = as_factor(lbl_clean(statefip))) income$ownershp pums_weighted <- income %>% as_survey_design(ids = 1,weight = perwt) pums_weighted %>% group_by(aapi_alone) %>% summarize(median_income = survey_median(income_2017,na.rm =...
/example code/example median.R
no_license
UCRCSI/blog_housing
R
false
false
561
r
library(tidyverse) library(srvyr) dta <- read_rds("pums_final.rds") %>% mutate(statefip = as_factor(lbl_clean(statefip))) income$ownershp pums_weighted <- income %>% as_survey_design(ids = 1,weight = perwt) pums_weighted %>% group_by(aapi_alone) %>% summarize(median_income = survey_median(income_2017,na.rm =...
## session summary of actions count library(tidyverse) library(firatheme) theme_set(theme_fira()) grotetabelzonderoutliers <- read.csv("grotetabelzonderoutliers.csv") names(grotetabelzonderoutliers) ## dit is nog met slechte duur voor focus (en weggefilterde mouseevents daarbinnen) sessionsumActions <- grotetabelz...
/scripts/sessionSumActionsCount.R
no_license
FloorBuschenhenke/GraphsNonlinearity
R
false
false
1,540
r
## session summary of actions count library(tidyverse) library(firatheme) theme_set(theme_fira()) grotetabelzonderoutliers <- read.csv("grotetabelzonderoutliers.csv") names(grotetabelzonderoutliers) ## dit is nog met slechte duur voor focus (en weggefilterde mouseevents daarbinnen) sessionsumActions <- grotetabelz...
# ============================================== # Making figures for DiffBind young vs. aged # Quiescent and activated NSCs # Code tested from markdown # 2 replicates each, with batch correction # Fig 5 for Aging Cell submission # December 2020 # ============================================== setwd("~/Dropbox/Brown_...
/Fig.5A.diffbind.age.corr.figs.R
no_license
Webb-Laboratory/Maybury-Lewis_et_al_2021
R
false
false
2,039
r
# ============================================== # Making figures for DiffBind young vs. aged # Quiescent and activated NSCs # Code tested from markdown # 2 replicates each, with batch correction # Fig 5 for Aging Cell submission # December 2020 # ============================================== setwd("~/Dropbox/Brown_...
############################################ # Setup # ############################################ # Load/Install required packages load_install<-function(lib){ if(! require(lib, character.only=TRUE)) install.packages(lib, character.only=TRUE) library(lib, character.only=TRUE...
/rollup_function.R
no_license
ibrahim85/Cohen-McCreight
R
false
false
10,412
r
############################################ # Setup # ############################################ # Load/Install required packages load_install<-function(lib){ if(! require(lib, character.only=TRUE)) install.packages(lib, character.only=TRUE) library(lib, character.only=TRUE...
rm(list = ls()) ### Cleaning of all Golbal env variables ########## ############### Loadig of required Libraries ########### library(lattice) library(data.table) library(plyr) library(dplyr) ################ Setting work directory setwd("C:\\Eday\\Doc\\R\\download\\exp_analysis") ################ Reading input file ...
/plot4.R
no_license
edayaa/ExData_Plotting1
R
false
false
2,107
r
rm(list = ls()) ### Cleaning of all Golbal env variables ########## ############### Loadig of required Libraries ########### library(lattice) library(data.table) library(plyr) library(dplyr) ################ Setting work directory setwd("C:\\Eday\\Doc\\R\\download\\exp_analysis") ################ Reading input file ...
########################### Likelihood by IS ############################# #' Log-likelihood using Importance Sampling #' #' Estimate the log-likelihood using Importance Sampling #' #' The likelihood of the observations is estimated without any approximation #' using a Monte-Carlo approach (see documentation). #' #...
/R/compute_LL.R
no_license
saemixdevelopment/saemix
R
false
false
23,067
r
########################### Likelihood by IS ############################# #' Log-likelihood using Importance Sampling #' #' Estimate the log-likelihood using Importance Sampling #' #' The likelihood of the observations is estimated without any approximation #' using a Monte-Carlo approach (see documentation). #' #...
# The MIT License (MIT) # # Copyright (c) 2015 Brandon Gavett # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, ...
/server.R
no_license
begavett/UDS_RCI
R
false
false
34,524
r
# The MIT License (MIT) # # Copyright (c) 2015 Brandon Gavett # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, ...
context("broom-decision_tree") skip_databricks_connect() test_that("decision_tree.tidy() works", { sc <- testthat_spark_connection() test_requires_version("2.0.0") iris_tbl <- testthat_tbl("iris") # for classification td1 <- iris_tbl %>% ml_decision_tree(Species ~ Sepal_Length + Petal_Length, seed = 123...
/tests/testthat/test-broom-decision_tree.R
permissive
XingfuXu/sparklyr
R
false
false
2,204
r
context("broom-decision_tree") skip_databricks_connect() test_that("decision_tree.tidy() works", { sc <- testthat_spark_connection() test_requires_version("2.0.0") iris_tbl <- testthat_tbl("iris") # for classification td1 <- iris_tbl %>% ml_decision_tree(Species ~ Sepal_Length + Petal_Length, seed = 123...
#setando parametros do selftrain #classes da base de dados form <- as.formula(paste(classe,'~', '.')) # if (i==1) form <- Species~. #para base IRIS #OU form <- basetreinoselftraining$Species #if (i==2) form <- class~. #para base ECOLI # if(i==3) form <- selector~. #para base puma # if(i==4)form <- T...
/treinamento.R
no_license
alanIF/SelfTraining
R
false
false
4,032
r
#setando parametros do selftrain #classes da base de dados form <- as.formula(paste(classe,'~', '.')) # if (i==1) form <- Species~. #para base IRIS #OU form <- basetreinoselftraining$Species #if (i==2) form <- class~. #para base ECOLI # if(i==3) form <- selector~. #para base puma # if(i==4)form <- T...
#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< estimate8nbn <- function(nbn,data) #TITLE estimating the /nbn/ parameters #DESCRIPTION # From a /nbn/ to describe the DAG, and a data.frame # containing the necessary observations, returns the /nbn/ with # all its parameters newly estimated. #DETAILS # No constraints are p...
/R/f06.nbnst.code.r
no_license
cran/rbmn
R
false
false
8,841
r
#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< estimate8nbn <- function(nbn,data) #TITLE estimating the /nbn/ parameters #DESCRIPTION # From a /nbn/ to describe the DAG, and a data.frame # containing the necessary observations, returns the /nbn/ with # all its parameters newly estimated. #DETAILS # No constraints are p...
# Read in necessary packages # a collection of great packages, check it out by just googling the tidyverse library(tidyverse) # package to handle date data types, which are allways hell library(lubridate) # this package has some nice themes for graphics which I find appealing library(see) # allows for great annotai...
/covidAnalysis.R
no_license
mrozgic/CovidAnalysis
R
false
false
11,773
r
# Read in necessary packages # a collection of great packages, check it out by just googling the tidyverse library(tidyverse) # package to handle date data types, which are allways hell library(lubridate) # this package has some nice themes for graphics which I find appealing library(see) # allows for great annotai...
# MIT License # # Copyright (c) 2019 Shane Zabel # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merg...
/decision_trees_wrapper.R
permissive
shoeloh/decision-trees-R
R
false
false
1,807
r
# MIT License # # Copyright (c) 2019 Shane Zabel # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merg...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/unitHydrograph.R \name{unitHydrograph} \alias{unitHydrograph} \title{Unit Hydrograph} \usage{ unitHydrograph(n, k, t, force = FALSE) } \arguments{ \item{n}{Numeric. Number of storages in cascade.} \item{k}{Numeric. Storage coefficient [1/s] ...
/man/unitHydrograph.Rd
no_license
maxdschneider/golmtutorial
R
false
true
1,473
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/unitHydrograph.R \name{unitHydrograph} \alias{unitHydrograph} \title{Unit Hydrograph} \usage{ unitHydrograph(n, k, t, force = FALSE) } \arguments{ \item{n}{Numeric. Number of storages in cascade.} \item{k}{Numeric. Storage coefficient [1/s] ...
\name{oatvar} \alias{oatvar} \title{Yields of oat varieties planted in blocks} \description{Data from an experiment to compare 8 varieties of oats. The growing area was heterogeneous and so was grouped into 5 blocks. Each variety was sown once within each block and the yield in grams per 16ft row was recorded. } \usag...
/man/oatvar.Rd
no_license
3shmawei/faraway
R
false
false
668
rd
\name{oatvar} \alias{oatvar} \title{Yields of oat varieties planted in blocks} \description{Data from an experiment to compare 8 varieties of oats. The growing area was heterogeneous and so was grouped into 5 blocks. Each variety was sown once within each block and the yield in grams per 16ft row was recorded. } \usag...
#Clean up the data and load the data rm(list = ls()) data <- read.table("household_power_consumption.txt", header = T, sep = ";", na.strings = "?") # convert the date variable to Date class data$Date <- as.Date(data$Date, format = "%d/%m/%Y") # Subset the data data <- subset(data, subset = (Date >...
/plot4.R
no_license
frankyeung0422/ExData_Plotting1
R
false
false
1,157
r
#Clean up the data and load the data rm(list = ls()) data <- read.table("household_power_consumption.txt", header = T, sep = ";", na.strings = "?") # convert the date variable to Date class data$Date <- as.Date(data$Date, format = "%d/%m/%Y") # Subset the data data <- subset(data, subset = (Date >...
#Create individual dataframes based on unique values of a single column in a dataframe SplitDFIntoDFListByCol <- function(df, uniqueColName) { #get list of unique ids unique_names <- unique(df[[uniqueColName]]) new_list <- lapply(unique_names, function(x, df) {df[df[[uniqueColName]] %in% c(x),]}, df) names...
/R_scripts/UtilityFunctions.R
no_license
iancj88/emr_v2
R
false
false
3,838
r
#Create individual dataframes based on unique values of a single column in a dataframe SplitDFIntoDFListByCol <- function(df, uniqueColName) { #get list of unique ids unique_names <- unique(df[[uniqueColName]]) new_list <- lapply(unique_names, function(x, df) {df[df[[uniqueColName]] %in% c(x),]}, df) names...
% Generated by roxygen2 (4.0.0): do not edit by hand \name{center} \alias{center} \title{Center a numeric vector by subtracting off its mean.} \usage{ center(x) } \arguments{ \item{x}{numeric vector} } \description{ Center a numeric vector by subtracting off its mean. }
/man/center.Rd
no_license
keithcallenberg/tourr
R
false
false
272
rd
% Generated by roxygen2 (4.0.0): do not edit by hand \name{center} \alias{center} \title{Center a numeric vector by subtracting off its mean.} \usage{ center(x) } \arguments{ \item{x}{numeric vector} } \description{ Center a numeric vector by subtracting off its mean. }
\name{renderLogs} \alias{renderLogs} \title{ Render RMarkdown Logs Report } \description{ Render the logs report file to the specified output format using pandoc. } \usage{ renderLogs(sysargs, type = c("html_document", "pdf_document"), fileName = "default", silent = FALSE, open_file = TRUE) } ...
/man/renderLogs.Rd
no_license
JulongWei/systemPipeR
R
false
false
1,955
rd
\name{renderLogs} \alias{renderLogs} \title{ Render RMarkdown Logs Report } \description{ Render the logs report file to the specified output format using pandoc. } \usage{ renderLogs(sysargs, type = c("html_document", "pdf_document"), fileName = "default", silent = FALSE, open_file = TRUE) } ...
# Fichier GTF Saccharomyces_cerevisiae.R64-1-1.90.gtf récupéré sur : # https://www.ensembl.org/info/data/ftp/index.html # 1 # Copier le fichier Saccharomyces_cerevisiae.R64-1-1.90.gtf disponible dans # /projet/sbr/ggb/intro_R/ vers votre espace de travail. file.copy(from="/projet/sbr/ggb/intro_R/Saccharomyces_cerevis...
/correction_exo_GTF.r
no_license
schlogl2017/BioinfoCourse
R
false
false
2,037
r
# Fichier GTF Saccharomyces_cerevisiae.R64-1-1.90.gtf récupéré sur : # https://www.ensembl.org/info/data/ftp/index.html # 1 # Copier le fichier Saccharomyces_cerevisiae.R64-1-1.90.gtf disponible dans # /projet/sbr/ggb/intro_R/ vers votre espace de travail. file.copy(from="/projet/sbr/ggb/intro_R/Saccharomyces_cerevis...
library(shiny) fluidPage( sidebarPanel( sliderInput(inputId ="Year", label = "Year", min = 1900, max = 2019, animate = animationOptions(interval = 1000, loop = FALSE) ), selectInput(inputId = "Sex", label ...
/1-ui.R
no_license
WL-Biol185-ShinyProjects/US-Inequality
R
false
false
900
r
library(shiny) fluidPage( sidebarPanel( sliderInput(inputId ="Year", label = "Year", min = 1900, max = 2019, animate = animationOptions(interval = 1000, loop = FALSE) ), selectInput(inputId = "Sex", label ...
# *************************************************************************************************************************************** # *************************************************************************************************************************************** # Project: Oryx # Description: Script t...
/Oryx_GPS_Import.R
no_license
jstabach/Scimitar
R
false
false
48,173
r
# *************************************************************************************************************************************** # *************************************************************************************************************************************** # Project: Oryx # Description: Script t...
#' Create map of trophic state probabilities #' #' This function takes the predicted class probabilites and maps them for each trophic #' state. #' #' @param states data for states, as data.frame #' @param lakes point locations for lake samples as data.frame with NLA ID #' @param probs class probabilites with NLA ID...
/R/ts_prob_map.R
no_license
srravula1/LakeTrophicModelling
R
false
false
3,296
r
#' Create map of trophic state probabilities #' #' This function takes the predicted class probabilites and maps them for each trophic #' state. #' #' @param states data for states, as data.frame #' @param lakes point locations for lake samples as data.frame with NLA ID #' @param probs class probabilites with NLA ID...
library( shiny ) library( markdown ) source( "tabPanels.R", local=TRUE ) shinyUI( navbarPage( "Feral Cat Problem Case", tabPanel( "Introduction", withMathJax(), includeMarkdown( "introduction.md" ), value = "tP0" ), tabPanel( "Model", tP1, value = "tP1" ), # en...
/ui.R
permissive
irhoppe/M3-P1
R
false
false
602
r
library( shiny ) library( markdown ) source( "tabPanels.R", local=TRUE ) shinyUI( navbarPage( "Feral Cat Problem Case", tabPanel( "Introduction", withMathJax(), includeMarkdown( "introduction.md" ), value = "tP0" ), tabPanel( "Model", tP1, value = "tP1" ), # en...
## FURTHER CHARACTERIZE KIDNEY SAMPLES ----------- library(tidyverse) library(survival) library(survminer) kidney_class <- read_csv("/media/deboraholi/Data/LUND/9 THESIS/data/kidney_clams_taxonomy.csv") kidney_class <- kidney_class %>% mutate(cancer.type = substr(sample_id, 1, 4)) kidney_class$cancer.type <- factor(k...
/kidney_samples_charac.R
no_license
deborahfnoliveira/masters_thesis_scripts
R
false
false
11,923
r
## FURTHER CHARACTERIZE KIDNEY SAMPLES ----------- library(tidyverse) library(survival) library(survminer) kidney_class <- read_csv("/media/deboraholi/Data/LUND/9 THESIS/data/kidney_clams_taxonomy.csv") kidney_class <- kidney_class %>% mutate(cancer.type = substr(sample_id, 1, 4)) kidney_class$cancer.type <- factor(k...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bootNonParametric.R \name{bootNonParametric} \alias{bootNonParametric} \title{Non-Parametric Restricted Residual Resampling Bootstrap} \usage{ bootNonParametric( dependent, independents, repetitions, hypothesisColumn, hypothesisValu...
/man/bootNonParametric.Rd
permissive
everettstamm/myMetrics
R
false
true
1,949
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bootNonParametric.R \name{bootNonParametric} \alias{bootNonParametric} \title{Non-Parametric Restricted Residual Resampling Bootstrap} \usage{ bootNonParametric( dependent, independents, repetitions, hypothesisColumn, hypothesisValu...
library(aod) #Modelling interactions for the sample of 83 participants #Reading data mydata <- read.csv("C:/Users/Nicole/Documents/Work/Study 4 - Trust Survey/Analysis in R/sample83.csv") #Running main effects model with each possible interaction separately model4 = glm(Outcome ~ SurveyMode + Advisor + Appoint...
/chapter-6-modelling-interactions.R
no_license
nandelic/thesis-stats
R
false
false
4,500
r
library(aod) #Modelling interactions for the sample of 83 participants #Reading data mydata <- read.csv("C:/Users/Nicole/Documents/Work/Study 4 - Trust Survey/Analysis in R/sample83.csv") #Running main effects model with each possible interaction separately model4 = glm(Outcome ~ SurveyMode + Advisor + Appoint...
#' Network bootstrapping #' #' Bootstraps a network and returns output containing three network statistics: #' Average Path Length, Transitivity, Mean Betweenness. #' #' @param g iGraph graph. #' @param n Number of bootstraps to run. (500 default) #' @param left_ci Confidence interval left limit. (0.005 default) #' @pa...
/R/bootnet.R
permissive
guoyu07/skynet-4
R
false
false
1,733
r
#' Network bootstrapping #' #' Bootstraps a network and returns output containing three network statistics: #' Average Path Length, Transitivity, Mean Betweenness. #' #' @param g iGraph graph. #' @param n Number of bootstraps to run. (500 default) #' @param left_ci Confidence interval left limit. (0.005 default) #' @pa...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/assoc_graph.R \name{assoc_graph} \alias{assoc_graph} \title{Association graphs} \usage{ assoc_graph(dat, cutoff = 0) } \arguments{ \item{dat}{Dataframe with rows as observations and columns as variables. Variables must all be observed or tran...
/man/assoc_graph.Rd
permissive
remsanjiv/netropy
R
false
true
827
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/assoc_graph.R \name{assoc_graph} \alias{assoc_graph} \title{Association graphs} \usage{ assoc_graph(dat, cutoff = 0) } \arguments{ \item{dat}{Dataframe with rows as observations and columns as variables. Variables must all be observed or tran...
context("Medical") source("utils.R") test_succeeds('download URLs_SIIM_SMALL', { if(!dir.exists('siim_small')) { URLs_SIIM_SMALL() } }) test_succeeds('read dcm URLs_SIIM_SMALL', { items = get_dicom_files("siim_small/train/") gn = RandomSplitter()(items) trn = gn[[1]] val = gn[[2]] patient = 7 ...
/tests/testthat/test-medical.R
permissive
Cdk29/fastai
R
false
false
1,508
r
context("Medical") source("utils.R") test_succeeds('download URLs_SIIM_SMALL', { if(!dir.exists('siim_small')) { URLs_SIIM_SMALL() } }) test_succeeds('read dcm URLs_SIIM_SMALL', { items = get_dicom_files("siim_small/train/") gn = RandomSplitter()(items) trn = gn[[1]] val = gn[[2]] patient = 7 ...
# == title # Draw legends for All Heatmaps # # == param # -object A `HeatmapList-class` object. # -legend_list A list of self-defined legends, should be wrapped into `grid::grob` objects. It is # normally constructed by `Legend`. # -... Other arguments. # # == details # Actually we call the "heatmap legends" ...
/R/HeatmapList-legends.R
permissive
KarolineHoller/ComplexHeatmap
R
false
false
45,780
r
# == title # Draw legends for All Heatmaps # # == param # -object A `HeatmapList-class` object. # -legend_list A list of self-defined legends, should be wrapped into `grid::grob` objects. It is # normally constructed by `Legend`. # -... Other arguments. # # == details # Actually we call the "heatmap legends" ...
# Function to calculate Z50 knowing Z95 and the cumulated root proportion V at a given depth Z .root.ldrZ50 <- function(V,Z,Z95){ if(sum(V >= 0.9497887)>0) {stop("The function is not defined for V >= 0.9497887")} if(sum(Z == Z95)>0) {stop("The function is not defined for Z = Z95")} a <- log(V/(1-V))/2.94 Z50 <-...
/R/spwb.ldrOptimization.R
no_license
NicoINRA/medfate
R
false
false
11,265
r
# Function to calculate Z50 knowing Z95 and the cumulated root proportion V at a given depth Z .root.ldrZ50 <- function(V,Z,Z95){ if(sum(V >= 0.9497887)>0) {stop("The function is not defined for V >= 0.9497887")} if(sum(Z == Z95)>0) {stop("The function is not defined for Z = Z95")} a <- log(V/(1-V))/2.94 Z50 <-...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/optimal_span.R \name{optimal_span} \alias{optimal_span} \title{Get optimal span value} \usage{ optimal_span(qc_data, lam = c(1, 2)) } \arguments{ \item{qc_data}{data.frame of only the QC samples from one block/batch, where the first column gi...
/man/optimal_span.Rd
no_license
pmartR/qcrlsc
R
false
true
737
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/optimal_span.R \name{optimal_span} \alias{optimal_span} \title{Get optimal span value} \usage{ optimal_span(qc_data, lam = c(1, 2)) } \arguments{ \item{qc_data}{data.frame of only the QC samples from one block/batch, where the first column gi...
library("minpack.lm") source("functions.R") supergausfit <- function(input,bereich,weighted=FALSE,mu=0,sig0=0,N0=0,N01=2000000,sig01=80,mu01=750){ #--- Fitten der Exponentialfunktion thegaussian <- y ~ C + N/(sqrt(2*pi)*sig)*exp(-(x-mu)^2/(2*sig^2))+ N1/(sqrt(2*pi)*sig1)*exp(-(x-mu1)^2/(2*sig1^2)) daten=subs...
/scripts/supergaus.R
no_license
ss743/test
R
false
false
3,108
r
library("minpack.lm") source("functions.R") supergausfit <- function(input,bereich,weighted=FALSE,mu=0,sig0=0,N0=0,N01=2000000,sig01=80,mu01=750){ #--- Fitten der Exponentialfunktion thegaussian <- y ~ C + N/(sqrt(2*pi)*sig)*exp(-(x-mu)^2/(2*sig^2))+ N1/(sqrt(2*pi)*sig1)*exp(-(x-mu1)^2/(2*sig1^2)) daten=subs...
#' @title Simulated Distribution of \eqn{D_n}{D[n]} (Kolmogorov-Smirnov) #' #' @description Function to visualize the sampling distribution of \eqn{D_n}{D[n]} (the Kolmogorov-Smirnov one sample statistic) and to find simulated critical values. #' #' @param n sample size #' @param sims number of simulations to perform...
/R/ksdist.R
no_license
alanarnholt/PASWR
R
false
false
1,088
r
#' @title Simulated Distribution of \eqn{D_n}{D[n]} (Kolmogorov-Smirnov) #' #' @description Function to visualize the sampling distribution of \eqn{D_n}{D[n]} (the Kolmogorov-Smirnov one sample statistic) and to find simulated critical values. #' #' @param n sample size #' @param sims number of simulations to perform...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ioHelpers.R \name{writeMethylationData} \alias{writeMethylationData} \title{Writing methylation data matrices} \usage{ writeMethylationData(dat, filepath, ...) } \arguments{ \item{dat}{A methylation data matrix, output from the \code{runAlign...
/man/writeMethylationData.Rd
no_license
pknight24/methylscaper
R
false
true
495
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ioHelpers.R \name{writeMethylationData} \alias{writeMethylationData} \title{Writing methylation data matrices} \usage{ writeMethylationData(dat, filepath, ...) } \arguments{ \item{dat}{A methylation data matrix, output from the \code{runAlign...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/misc_and_utility.R \name{umx_set_plot_file_suffix} \alias{umx_set_plot_file_suffix} \title{Set output suffix used in umx plot (structural diagrams) files to disk} \usage{ umx_set_plot_file_suffix(umx.plot.suffix = NULL, silent = FALSE) } \arg...
/man/umx_set_plot_file_suffix.Rd
no_license
bwiernik/umx
R
false
true
1,725
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/misc_and_utility.R \name{umx_set_plot_file_suffix} \alias{umx_set_plot_file_suffix} \title{Set output suffix used in umx plot (structural diagrams) files to disk} \usage{ umx_set_plot_file_suffix(umx.plot.suffix = NULL, silent = FALSE) } \arg...
#Select matching expression pattern ecdf_fun <- function(x, perc){ return(ecdf(x)(perc)) } PreprocessExpression <- function(ExpressionData){ all_quant <- c() for (i in names(ExpressionData)) { all_quant <- c(all_quant, seq(5, 95, 10)[data.table::between( x = ecdf_fun(ExpressionData, Expression...
/generate_matched_random_genes_upd.r
permissive
na89/NetworkAnalyses
R
false
false
3,414
r
#Select matching expression pattern ecdf_fun <- function(x, perc){ return(ecdf(x)(perc)) } PreprocessExpression <- function(ExpressionData){ all_quant <- c() for (i in names(ExpressionData)) { all_quant <- c(all_quant, seq(5, 95, 10)[data.table::between( x = ecdf_fun(ExpressionData, Expression...
#' @title fun_name #' #' @description kolejna funkcja podmieniona #' #' @param param fun_name #' #' #' #' @export provideDimnames<- function(params){ rap <- c("Czesc czesc tu Sebol nawija, Mordo nie ma gandy a ja wbijam klina", "Tutaj start, mega bujanka. Zaczynamy tutaj strefe jaranka", ...
/R/provideDimnames.R
no_license
granatb/RapeR
R
false
false
685
r
#' @title fun_name #' #' @description kolejna funkcja podmieniona #' #' @param param fun_name #' #' #' #' @export provideDimnames<- function(params){ rap <- c("Czesc czesc tu Sebol nawija, Mordo nie ma gandy a ja wbijam klina", "Tutaj start, mega bujanka. Zaczynamy tutaj strefe jaranka", ...
##' Create an object that is specific to retinal datasets. This ##' contains methods that return datapoint and landmark coordinates ##' that have been transformed according to the values of ##' \code{DVflip} and \code{side}. ##' ##' @title RetinalReconstructedOutline constructor ##' @param r Object that inherits \code{...
/pkg/retistruct/R/RetinalReconstructedOutline.R
no_license
bala5411/retistruct
R
false
false
1,888
r
##' Create an object that is specific to retinal datasets. This ##' contains methods that return datapoint and landmark coordinates ##' that have been transformed according to the values of ##' \code{DVflip} and \code{side}. ##' ##' @title RetinalReconstructedOutline constructor ##' @param r Object that inherits \code{...
dev.off() rm(list=ls()) cat("\014") #----Artificial Neural Networks---- #Train neural networkss and evaluate their accuracy accross all floors #BEWARE IF YOU RUN THIS SCRIPT, YOUR COMPUTER WILL BE RUNNING CALCULATIONS FOR OVER THREE HOURS #Author(s): Brodie W. Hobson #Set working directory setwd("C:\\...
/chpt_2/ANN Predictions.R
no_license
HobsonB/MASc-Thesis
R
false
false
6,158
r
dev.off() rm(list=ls()) cat("\014") #----Artificial Neural Networks---- #Train neural networkss and evaluate their accuracy accross all floors #BEWARE IF YOU RUN THIS SCRIPT, YOUR COMPUTER WILL BE RUNNING CALCULATIONS FOR OVER THREE HOURS #Author(s): Brodie W. Hobson #Set working directory setwd("C:\\...
Guess <- function(max) { secret.number <- sample(1:max, 1) total.guesses <- 1 finished <- FALSE message(sprintf("I'm thinking of a number from 1 to %d.", max)) self.list <- list( get.info = function() { message( sprintf( "You %s guess...
/guess.R
no_license
bxs6198/ProgrammingAssignment2
R
false
false
1,241
r
Guess <- function(max) { secret.number <- sample(1:max, 1) total.guesses <- 1 finished <- FALSE message(sprintf("I'm thinking of a number from 1 to %d.", max)) self.list <- list( get.info = function() { message( sprintf( "You %s guess...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/assim-data.R \docType{data} \name{otto_graph} \alias{otto_graph} \title{A graph of the class \code{igraph} containing flow direction for the HydroSHEDS subbasin dataset in Ceará.} \format{An object of class \code{igraph} of length 10.} \sourc...
/man/otto_graph.Rd
no_license
jmigueldelgado/assimReservoirs
R
false
true
689
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/assim-data.R \docType{data} \name{otto_graph} \alias{otto_graph} \title{A graph of the class \code{igraph} containing flow direction for the HydroSHEDS subbasin dataset in Ceará.} \format{An object of class \code{igraph} of length 10.} \sourc...
library(data.table) saveDir <- "data" #Rather than a database dataFile <- "Participants.rds" # Name of data file importedDataFile <- "Data.csv" # Name of imported data file data <- fread(paste0(saveDir, '/', importedDataFile)) readRDS(paste0(saveDir, '/', dataFile)) saveRDS(object = data, file = file.pa...
/manual.R
no_license
Harriette/RandomCoffeeTrials
R
false
false
399
r
library(data.table) saveDir <- "data" #Rather than a database dataFile <- "Participants.rds" # Name of data file importedDataFile <- "Data.csv" # Name of imported data file data <- fread(paste0(saveDir, '/', importedDataFile)) readRDS(paste0(saveDir, '/', dataFile)) saveRDS(object = data, file = file.pa...
#' @title Split Large Vector or DataFrame #' #' @description #' Split large vector or dataframe to list class, which contian subset vectors #' or dataframe of origin vector or dataframe. #' #' @param x vector class or data.frame class. #' @param nums integer. #' @param chunks integer. use chunks if nums is missing. #'...
/R/splitData.R
no_license
king8w/MicrobiotaProcess
R
false
false
1,899
r
#' @title Split Large Vector or DataFrame #' #' @description #' Split large vector or dataframe to list class, which contian subset vectors #' or dataframe of origin vector or dataframe. #' #' @param x vector class or data.frame class. #' @param nums integer. #' @param chunks integer. use chunks if nums is missing. #'...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/copy_data.R \name{copy_data.zoo} \alias{copy_data.zoo} \title{Copy data from R - zoo/xts} \usage{ \method{copy_data}{zoo}(obj, row_names = FALSE, max_size = 2^20) } \arguments{ \item{obj}{data of type \code{data.frame}, \code{zoo}, \code{xts}...
/man/copy_data.zoo.Rd
no_license
ces0491/clipR
R
false
true
501
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/copy_data.R \name{copy_data.zoo} \alias{copy_data.zoo} \title{Copy data from R - zoo/xts} \usage{ \method{copy_data}{zoo}(obj, row_names = FALSE, max_size = 2^20) } \arguments{ \item{obj}{data of type \code{data.frame}, \code{zoo}, \code{xts}...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/varEWS.R \docType{methods} \name{varEWS} \alias{varEWS} \title{Asymptotic Variance of the mvEWS Estimate} \description{ Calculates the asymptotic variance of a multivariate evolutionary wavelet spectrum estimate. } \usage{ varEWS(objec...
/man/varEWS.Rd
no_license
cran/mvLSW
R
false
true
4,946
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/varEWS.R \docType{methods} \name{varEWS} \alias{varEWS} \title{Asymptotic Variance of the mvEWS Estimate} \description{ Calculates the asymptotic variance of a multivariate evolutionary wavelet spectrum estimate. } \usage{ varEWS(objec...
library(rprojroot) library(tidyverse) getCurrentFileLocation <- function() { this_file <- commandArgs() %>% tibble::enframe(name = NULL) %>% tidyr::separate(col=value, into=c("key", "value"), sep="=", fill='right') %>% dplyr::filter(key == "--file") %>% dplyr::pull(value) if (length(th...
/gender_differences/run_basemodel_bootstraps.R
no_license
DashaZhernakova/umcg_scripts
R
false
false
6,961
r
library(rprojroot) library(tidyverse) getCurrentFileLocation <- function() { this_file <- commandArgs() %>% tibble::enframe(name = NULL) %>% tidyr::separate(col=value, into=c("key", "value"), sep="=", fill='right') %>% dplyr::filter(key == "--file") %>% dplyr::pull(value) if (length(th...
#' Internal function used to fit roots of a polynomial made up of the product of #' bias factors. #' #' @param x A number. The variable to solve for. #' @param y A number. The observed risk ratio. #' @param n A number. Degree of polynomial in the numerator. #' @param d A number. Degree of polynomial in the denominator....
/EValue/R/utils.R
no_license
justinhylee/evalue_package
R
false
false
1,125
r
#' Internal function used to fit roots of a polynomial made up of the product of #' bias factors. #' #' @param x A number. The variable to solve for. #' @param y A number. The observed risk ratio. #' @param n A number. Degree of polynomial in the numerator. #' @param d A number. Degree of polynomial in the denominator....
function (dist, src) { e <- get("data.env", .GlobalEnv) e[["dijkstra_inf"]][[length(e[["dijkstra_inf"]]) + 1]] <- list(dist = dist, src = src) .Call("_gretel_dijkstra_inf", dist, src) }
/valgrind_test_dir/dijkstra_inf-test.R
no_license
akhikolla/RcppDeepStateTest
R
false
false
208
r
function (dist, src) { e <- get("data.env", .GlobalEnv) e[["dijkstra_inf"]][[length(e[["dijkstra_inf"]]) + 1]] <- list(dist = dist, src = src) .Call("_gretel_dijkstra_inf", dist, src) }
#R args <- commandArgs() less_activity_file <- args[3] more_activity_file <- args[4] unchanged_activity_file <- args[5] out <- args[6] less_activity <- read.csv(file=less_activity_file, header=FALSE,sep="\t") more_activity <- read.csv(file=more_activity_file, header=FALSE,sep="\t") unchanged_activity <- read.csv(fil...
/code/code.hicseq-standard/hicseq-domains-diff-scripts/plot_boxes.r
no_license
wyim-pgl/hic-bench
R
false
false
4,417
r
#R args <- commandArgs() less_activity_file <- args[3] more_activity_file <- args[4] unchanged_activity_file <- args[5] out <- args[6] less_activity <- read.csv(file=less_activity_file, header=FALSE,sep="\t") more_activity <- read.csv(file=more_activity_file, header=FALSE,sep="\t") unchanged_activity <- read.csv(fil...
#### Design optimisation with MINK data ## Part 1: Makes up a discrete state-space for the SCR model and some potential # design points that exist as clusters. The matrix "clusters" is a cluster # identity matrix that maps EACH potential design point to a cluster # [note: points can be i...
/Ch10-Design/figs/scrDesignCHRIS/scrDesignMink.R
no_license
jaroyle/scrbook
R
false
false
12,682
r
#### Design optimisation with MINK data ## Part 1: Makes up a discrete state-space for the SCR model and some potential # design points that exist as clusters. The matrix "clusters" is a cluster # identity matrix that maps EACH potential design point to a cluster # [note: points can be i...
pb.inv.sqrt.n <- function(y, s2 = NA, n, n00 = NA, n01 = NA, n10 = NA, n11 = NA){ x.reg <- 1/sqrt(n) y.reg <- y w.reg <- n if(all(abs(diff(x.reg[!is.na(x.reg)])) < 1e-5) | all(abs(diff(y.reg[!is.na(y.reg)])) < 1e-5)){ out <- list(pval = 1, stat = 0, coef = c(0, 0)) }else{ out <- lm(y.reg ~ x.re...
/R/pb.inv.sqrt.n.R
no_license
cran/altmeta
R
false
false
558
r
pb.inv.sqrt.n <- function(y, s2 = NA, n, n00 = NA, n01 = NA, n10 = NA, n11 = NA){ x.reg <- 1/sqrt(n) y.reg <- y w.reg <- n if(all(abs(diff(x.reg[!is.na(x.reg)])) < 1e-5) | all(abs(diff(y.reg[!is.na(y.reg)])) < 1e-5)){ out <- list(pval = 1, stat = 0, coef = c(0, 0)) }else{ out <- lm(y.reg ~ x.re...
# Intentionally Blank
/modules/__init__.py
no_license
csheahan/PostureReminder
R
false
false
21
py
# Intentionally Blank
# Code placed in this file fill be executed every time the # lesson is started. Any variables created here will show up in # the user's working directory and thus be accessible to them # throughout the lesson. mtcars$cyl_am <- paste(mtcars$cyl, mtcars$am, sep = "_") myCol <- rbind(brewer.pal(9, "Blues...
/Coordinates_and_Facets/initLesson.R
no_license
pkussdatanalysis/C9_GGplot_02
R
false
false
467
r
# Code placed in this file fill be executed every time the # lesson is started. Any variables created here will show up in # the user's working directory and thus be accessible to them # throughout the lesson. mtcars$cyl_am <- paste(mtcars$cyl, mtcars$am, sep = "_") myCol <- rbind(brewer.pal(9, "Blues...
library(openintro) ### Name: countyComplete ### Title: United States Counties ### Aliases: countyComplete ### Keywords: datasets ### ** Examples data(countyComplete)
/data/genthat_extracted_code/openintro/examples/countyComplete.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
174
r
library(openintro) ### Name: countyComplete ### Title: United States Counties ### Aliases: countyComplete ### Keywords: datasets ### ** Examples data(countyComplete)
\name{plot_Probe_Meth450} \alias{plot_Probe_Meth450} %- Also NEED an '\alias' for EACH other topic documented here. \title{ plot_Probe_Meth450 } \description{ Plots stripcharts and replicate diagrams for the given arguments. } \usage{ plot_Probe_Meth450(theGeneEq, theOutputDir, theZipFile="/rsrch1/bcb/batchef...
/man/plot_Probe_Meth450.Rd
no_license
yanch86/TCGAGeneReport
R
false
false
3,218
rd
\name{plot_Probe_Meth450} \alias{plot_Probe_Meth450} %- Also NEED an '\alias' for EACH other topic documented here. \title{ plot_Probe_Meth450 } \description{ Plots stripcharts and replicate diagrams for the given arguments. } \usage{ plot_Probe_Meth450(theGeneEq, theOutputDir, theZipFile="/rsrch1/bcb/batchef...
# Panel Principal de la Aplicacion BTT - Beyond The Tweet library(shiny) shinyUI(fluidPage( headerPanel('BTT - Beyond The Tweet'), sidebarLayout( sidebarPanel( textInput("searchTerm", label = "Termino de Busqueda", value = "twitter"), numericInput('cant', 'Numero de Tweets',50,0,1500), ...
/ui.R
no_license
raulrms/ShinyAnalisisSentimientos
R
false
false
871
r
# Panel Principal de la Aplicacion BTT - Beyond The Tweet library(shiny) shinyUI(fluidPage( headerPanel('BTT - Beyond The Tweet'), sidebarLayout( sidebarPanel( textInput("searchTerm", label = "Termino de Busqueda", value = "twitter"), numericInput('cant', 'Numero de Tweets',50,0,1500), ...
bruin = Bruin bruin value = bruin[,3] value tsbruin = ts(value,start = 2005, frequency = 4) autoplot(tsbruin) entropy(tsbruin) ndiffs(tsbruin) nsdiffs(tsbruin) BoxCox.lambda(tsbruin) lambda(bruin) #Check outliers tsoutliers(tsbruin, lambda = "auto") #Check non-linearity nonlinearityTest(tsbruin) #Create a heatmap...
/Josh and Ray/R Code Final Project .R
no_license
joshuazhang-ma/NHL-TS-Contracts-and-Team-Performance
R
false
false
4,401
r
bruin = Bruin bruin value = bruin[,3] value tsbruin = ts(value,start = 2005, frequency = 4) autoplot(tsbruin) entropy(tsbruin) ndiffs(tsbruin) nsdiffs(tsbruin) BoxCox.lambda(tsbruin) lambda(bruin) #Check outliers tsoutliers(tsbruin, lambda = "auto") #Check non-linearity nonlinearityTest(tsbruin) #Create a heatmap...
projectdir=Sys.getenv("PROJECTDIR") dir=paste0(PROJECTDIR,"/data/PRS") ukbdir=Sys.getenv("UKBBDIR") # info on data used in this qc is here - http://www.ukbiobank.ac.uk/wp-content/uploads/2017/07/ukb_genetic_file_description.txt shareddir=paste(ukbdir,"/_latest/UKBIOBANK_Array_Genotypes_500k_HRC_Imputation/dat...
/2-Confounder_Exposure_Files/1-Exclusion/1-processUKBQCFile_B.R
no_license
MRCIEU/Psychiatric-disorder-pheWAS-UKBB
R
false
false
3,089
r
projectdir=Sys.getenv("PROJECTDIR") dir=paste0(PROJECTDIR,"/data/PRS") ukbdir=Sys.getenv("UKBBDIR") # info on data used in this qc is here - http://www.ukbiobank.ac.uk/wp-content/uploads/2017/07/ukb_genetic_file_description.txt shareddir=paste(ukbdir,"/_latest/UKBIOBANK_Array_Genotypes_500k_HRC_Imputation/dat...
v1<-rep(3,5) v1 sapply(v1, log) f1<-c("Man", "Woman") f1 x<-c(1,3) y<-c("M", "F") z<-data.frame(x,y) z df = read.csv() myfun<-function(x) { return(1) } myfun(5)
/Lab1/practice1.R
no_license
davidnyberg/Machine_Learning
R
false
false
167
r
v1<-rep(3,5) v1 sapply(v1, log) f1<-c("Man", "Woman") f1 x<-c(1,3) y<-c("M", "F") z<-data.frame(x,y) z df = read.csv() myfun<-function(x) { return(1) } myfun(5)
install.packages("RColorBrewer") # coloring the plot library("RColorBrewer") euclideanDist <- function (x1, x2) { return (sqrt( sum((x1 - x2) ^ 2 ))) } kMeanPlusInit <- function (X, k = 3) { # Implementation follows the paper at # http://ilpubs.stanford.edu:8090/778/1/2006-13.pdf # Choose one ...
/kmeans.R
no_license
anhquancao/M2-DK-machine-learning-tp2
R
false
false
5,612
r
install.packages("RColorBrewer") # coloring the plot library("RColorBrewer") euclideanDist <- function (x1, x2) { return (sqrt( sum((x1 - x2) ^ 2 ))) } kMeanPlusInit <- function (X, k = 3) { # Implementation follows the paper at # http://ilpubs.stanford.edu:8090/778/1/2006-13.pdf # Choose one ...
library(plyr) library(plotly) load("~/Gits/senior-capstone-fall-2018/Data/R/data.Rda") people_vs_year <- count(data[1:14770,], c("Year")) f <- list( family = "Courier New, monospace", size = 18 ) x <- list( title = "Year", titlefont = f ) y <- list( title = "Missing People", titlefont = f ) people_per_y...
/Data/R/peoplePerYear.R
permissive
balswyan/senior-capstone-fall-2018
R
false
false
539
r
library(plyr) library(plotly) load("~/Gits/senior-capstone-fall-2018/Data/R/data.Rda") people_vs_year <- count(data[1:14770,], c("Year")) f <- list( family = "Courier New, monospace", size = 18 ) x <- list( title = "Year", titlefont = f ) y <- list( title = "Missing People", titlefont = f ) people_per_y...
setwd("~/Coursera/gcd_project") data_dir <- "getdata_projectfiles_UCI HAR Dataset" if (file.exists(data_dir)){ ## Get Training Data set train_data <- read.table("./getdata_projectfiles_UCI HAR Dataset/UCI HAR Dataset/train/X_train.txt", stringsAsFactors = FALSE) train_activity <- re...
/run_analysis.R
no_license
adyall/gcd_project
R
false
false
3,791
r
setwd("~/Coursera/gcd_project") data_dir <- "getdata_projectfiles_UCI HAR Dataset" if (file.exists(data_dir)){ ## Get Training Data set train_data <- read.table("./getdata_projectfiles_UCI HAR Dataset/UCI HAR Dataset/train/X_train.txt", stringsAsFactors = FALSE) train_activity <- re...
KPC <- function(dataset, nCluster, maxIter =100, p.max=0.2, p.min=0.05){ #library(TSP) gene.specific.null<-function(array, B=200) { null.mat<-matrix(0, nrow=nrow(array), ncol=B) l<-ncol(array) d.array<-array[,1:(l-1)] for(i in 1:B) { this.order<-...
/R/KPC.R
no_license
cran/nlnet
R
false
false
2,849
r
KPC <- function(dataset, nCluster, maxIter =100, p.max=0.2, p.min=0.05){ #library(TSP) gene.specific.null<-function(array, B=200) { null.mat<-matrix(0, nrow=nrow(array), ncol=B) l<-ncol(array) d.array<-array[,1:(l-1)] for(i in 1:B) { this.order<-...
library(data.table) library(dtangle) library(doParallel) get_marker_list <- function(value){ typ <- typeof(value[[1]]) if (typ == "list") return(value$L) return(value) } multi_core_function <- function(samples_no){ library(data.table) library(dtangle) input_file <- paste0('~/IndependentStudy/Data/Sign...
/Code/marker_genes/Analysis_marker_gene_finding_05.r
no_license
yujias424/RNA-seq_deconvolution_project
R
false
false
1,948
r
library(data.table) library(dtangle) library(doParallel) get_marker_list <- function(value){ typ <- typeof(value[[1]]) if (typ == "list") return(value$L) return(value) } multi_core_function <- function(samples_no){ library(data.table) library(dtangle) input_file <- paste0('~/IndependentStudy/Data/Sign...
################ #0start_+.R ################ #Get runtime arguments argv <- commandArgs(TRUE) #Specify file name in_f <- paste(argv[1],"_piRNA_shojibase.bed",sep="") out_f <- paste(argv[1],"_piRNAdist.table",sep="") reads1 <- readDNAStringSet("piRNA_shojibase.fas", format="fasta") #Loading package library(Biostrin...
/Bombyx_mori_analysis/0start_+.R
no_license
mywanuo/BmZuc_cleavage
R
false
false
1,012
r
################ #0start_+.R ################ #Get runtime arguments argv <- commandArgs(TRUE) #Specify file name in_f <- paste(argv[1],"_piRNA_shojibase.bed",sep="") out_f <- paste(argv[1],"_piRNAdist.table",sep="") reads1 <- readDNAStringSet("piRNA_shojibase.fas", format="fasta") #Loading package library(Biostrin...
########################################################################################## # Output Directory ########################################################################################## #' Get outputDirectory from an ArchRProject #' #' This function gets the outputDirectory from a given ArchRProject. I...
/R/ProjectMethods.R
permissive
scfurl/ArchR
R
false
false
37,273
r
########################################################################################## # Output Directory ########################################################################################## #' Get outputDirectory from an ArchRProject #' #' This function gets the outputDirectory from a given ArchRProject. I...
## Import Data power <- fread("data/household_power_consumption.txt", stringsAsFactors = FALSE, na.strings = "?", sep = ";") ## Convert to new date format variable power$date2 <- as.Date( as.character(power$Date), "%d/%m/%Y") ## Subset by date power_set <- subset(power_set, date2 <= "2007-02-02" & date2 >= "2007-02-0...
/plot1.R
no_license
dccooper/ExData_Plotting1
R
false
false
660
r
## Import Data power <- fread("data/household_power_consumption.txt", stringsAsFactors = FALSE, na.strings = "?", sep = ";") ## Convert to new date format variable power$date2 <- as.Date( as.character(power$Date), "%d/%m/%Y") ## Subset by date power_set <- subset(power_set, date2 <= "2007-02-02" & date2 >= "2007-02-0...
#' @S3method print mpqtl print.mpqtl <- function(x, ...) { cat(" This is an object of class \"mpqtl\".\n") cat(" It is too complex to print, so we provide the following summary.\n") print(summary(x)) }
/R/print.mpqtl.R
no_license
lmw40/mpMap
R
false
false
218
r
#' @S3method print mpqtl print.mpqtl <- function(x, ...) { cat(" This is an object of class \"mpqtl\".\n") cat(" It is too complex to print, so we provide the following summary.\n") print(summary(x)) }
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/QDuels_Bob_payoffs.R \name{QDuels_Bob_payoffs} \alias{QDuels_Bob_payoffs} \title{Quantum Two Person Duel game} \usage{ QDuels_Bob_payoffs(Psi, n, a, b, alpha1, alpha2, beta1, beta2) } \arguments{ \item{Psi}{a vector representing the initial q...
/man/QDuels_Bob_payoffs.Rd
permissive
indrag49/QGameTheory
R
false
true
1,977
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/QDuels_Bob_payoffs.R \name{QDuels_Bob_payoffs} \alias{QDuels_Bob_payoffs} \title{Quantum Two Person Duel game} \usage{ QDuels_Bob_payoffs(Psi, n, a, b, alpha1, alpha2, beta1, beta2) } \arguments{ \item{Psi}{a vector representing the initial q...
ilr <- function(xx, ifclose = FALSE, ifwarn = TRUE) { # Function to compute an isometric log-ratio transformation to 'open' # a n x p 'closed' matrix, the result is a n x (p-1) matrix. Based # on a script by P. Filzmoser & K. Hron, Math. Geosci. 40(3):234-248. # # NOTE: Prior to using t...
/rgr/R/ilr.R
no_license
ingted/R-Examples
R
false
false
1,392
r
ilr <- function(xx, ifclose = FALSE, ifwarn = TRUE) { # Function to compute an isometric log-ratio transformation to 'open' # a n x p 'closed' matrix, the result is a n x (p-1) matrix. Based # on a script by P. Filzmoser & K. Hron, Math. Geosci. 40(3):234-248. # # NOTE: Prior to using t...
library(plyr); library(reshape); # Load in scrobble data scrobbles <- read.delim("~/Dropbox/R/lastfmdata/2015-01-26/scrobbles.tsv") # Retain only the variables of interest t1 <- scrobbles[ , c(1, 3, 5, 11 )] # Put time in the correct format t1$ISO.time <- as.POSIXct(t1$ISO.time) t1$month.and.year <- format(t1$ISO.t...
/lastfm.R
no_license
stuartcoggins/last-fm-correlation
R
false
false
1,678
r
library(plyr); library(reshape); # Load in scrobble data scrobbles <- read.delim("~/Dropbox/R/lastfmdata/2015-01-26/scrobbles.tsv") # Retain only the variables of interest t1 <- scrobbles[ , c(1, 3, 5, 11 )] # Put time in the correct format t1$ISO.time <- as.POSIXct(t1$ISO.time) t1$month.and.year <- format(t1$ISO.t...
#' @title Summarizing Bayesian SAR Model #' @description Summary and print methods for the class `mcmcSAR`. #' @param object an object of class "mcmcSAR", output of the function \code{\link{mcmcSAR}}. #' @param x an object of class "summary.mcmcSAR" or "mcmcSAR, output of thes functions \code{\link{summary.mcmcSAR}} a...
/R/summaryMCMC.R
no_license
xinyuelin/PartialNetwork
R
false
false
12,838
r
#' @title Summarizing Bayesian SAR Model #' @description Summary and print methods for the class `mcmcSAR`. #' @param object an object of class "mcmcSAR", output of the function \code{\link{mcmcSAR}}. #' @param x an object of class "summary.mcmcSAR" or "mcmcSAR, output of thes functions \code{\link{summary.mcmcSAR}} a...
#as a suggestion perform these items #x <- rbind(c(1,4), c(4,1)) #then take the results of x and call the makecachematrix function makeCacheMatrix <- function(x = matrix()){ m <- NULL setf <- function(y){ x <<- y m <<- NULL } getf <- function () x ...
/cachematrix.R
no_license
dfihn/ProgrammingAssignment2
R
false
false
715
r
#as a suggestion perform these items #x <- rbind(c(1,4), c(4,1)) #then take the results of x and call the makecachematrix function makeCacheMatrix <- function(x = matrix()){ m <- NULL setf <- function(y){ x <<- y m <<- NULL } getf <- function () x ...
### This is to test three special MRA settings. The first one si the independent blocks case. ### The second one corresponds to the full scale approximation. The third one is the modified predictive process rm(list=ls()) set.seed(1988) spatial.dim=1 # number of spatial dimensions n=200 # number of observed locs # sim...
/tests/testthat/test-mra-special-cases.r
no_license
LMNonlinear/GPvecchia
R
false
false
2,054
r
### This is to test three special MRA settings. The first one si the independent blocks case. ### The second one corresponds to the full scale approximation. The third one is the modified predictive process rm(list=ls()) set.seed(1988) spatial.dim=1 # number of spatial dimensions n=200 # number of observed locs # sim...
data <- iris data$Species <- NULL kc <- kmeans(data,3) plot(data[c("Sepal.Length","Sepal.Width")],col=kc$cluster) points(kc$centers[,c("Sepal.Length","Sepal.Width")],col=1:3,pch=8,cex = 2)
/k-means.r
no_license
LoveClouder/RTest
R
false
false
188
r
data <- iris data$Species <- NULL kc <- kmeans(data,3) plot(data[c("Sepal.Length","Sepal.Width")],col=kc$cluster) points(kc$centers[,c("Sepal.Length","Sepal.Width")],col=1:3,pch=8,cex = 2)
#' Facet #' #' Create facets for multiple plots. #' #' @inheritParams e_bar #' @param rows,cols Number of rows and columns. If both are `NULL` the number of rows and columns #' will be determined automatically. #' @param legend_pos Position of the legend. One of "top", "right", "bottom", "left". Determines #' ...
/R/facets.R
permissive
JohnCoene/echarts4r
R
false
false
7,105
r
#' Facet #' #' Create facets for multiple plots. #' #' @inheritParams e_bar #' @param rows,cols Number of rows and columns. If both are `NULL` the number of rows and columns #' will be determined automatically. #' @param legend_pos Position of the legend. One of "top", "right", "bottom", "left". Determines #' ...
testlist <- list(f = structure(c(2.29157327002727e+103, 1.71090868935708e-32, 5.31232893578367e+184, 6147.55175587533, 6.93103357665744e+279, 5.92871189432898e+180), .Dim = c(6L, 1L)), origin = c(1.10232556674988e-152, -5.77226490664983e-192, 5.85921155585348e+57, 8.25400423504468e-84, 5.37185806047134e+86, -7.1065...
/issuestests/icosa/inst/testfiles/spherTriSurfs/spherTriSurfs_output/log_2d94c1ebd2140bf48a287cfb062a08e2686295d6/spherTriSurfs-test.R
no_license
akhikolla/RcppDeepStateTest
R
false
false
3,965
r
testlist <- list(f = structure(c(2.29157327002727e+103, 1.71090868935708e-32, 5.31232893578367e+184, 6147.55175587533, 6.93103357665744e+279, 5.92871189432898e+180), .Dim = c(6L, 1L)), origin = c(1.10232556674988e-152, -5.77226490664983e-192, 5.85921155585348e+57, 8.25400423504468e-84, 5.37185806047134e+86, -7.1065...
#' Model Lift #' #' Calculate lift estimates from observed and predicted responses. #' #' @rdname lift #' #' @param x observed responses or \code{Resamples} object of observed and #' predicted responses. #' @param y predicted responses. #' #' @return \code{Lift} class object that inherits from \code{data.frame}. #'...
/R/lift.R
no_license
zhaoxiaohe/MachineShop
R
false
false
1,599
r
#' Model Lift #' #' Calculate lift estimates from observed and predicted responses. #' #' @rdname lift #' #' @param x observed responses or \code{Resamples} object of observed and #' predicted responses. #' @param y predicted responses. #' #' @return \code{Lift} class object that inherits from \code{data.frame}. #'...
Diffogram = function(Formula, Data, Term, conf.level=0.95, adj="lsd", Title, ...) { if (!attr(terms(Formula, data = Data), "response")) stop("Dependent variable should be provided!") x = ModelMatrix(Formula, Data) y = model.frame(Formula, Data)[, 1] if (!is.numeric(y)) stop("Dependent variable should be n...
/R/Diffogram.R
no_license
asancpt/sasLM
R
false
false
1,580
r
Diffogram = function(Formula, Data, Term, conf.level=0.95, adj="lsd", Title, ...) { if (!attr(terms(Formula, data = Data), "response")) stop("Dependent variable should be provided!") x = ModelMatrix(Formula, Data) y = model.frame(Formula, Data)[, 1] if (!is.numeric(y)) stop("Dependent variable should be n...
# Euisoon Hwang, Roshun Jones, Viet Thanh Nguyen hdata <- read.csv(file = "kc_house_data.csv", sep = ",") price <- hdata[,3] hdata.new <- hdata[ ,-(1:3)] lmFit1 <- lm(price ~ ., data = hdata.new ) summary(lmFit1)$r.squared # 0.6997472 hdata.new <- hdata.new[, -11] corr.vec <- NULL get.corr<- function(x){ c(corr.ve...
/TCSS551/FinalProject.R
no_license
eshwang6/Projects
R
false
false
2,568
r
# Euisoon Hwang, Roshun Jones, Viet Thanh Nguyen hdata <- read.csv(file = "kc_house_data.csv", sep = ",") price <- hdata[,3] hdata.new <- hdata[ ,-(1:3)] lmFit1 <- lm(price ~ ., data = hdata.new ) summary(lmFit1)$r.squared # 0.6997472 hdata.new <- hdata.new[, -11] corr.vec <- NULL get.corr<- function(x){ c(corr.ve...
require(glmnet) require(R.matlab) soft_threshhold <- function(innerprod, lambda) { return(sign(innerprod)*max(0, abs(innerprod)- lambda)) } update_beta <- function(y, X, beta_new, lambda, alpha){ beta_new_2 =c() n = length(y) a = colSums(X^2) p = length(beta_new) for(j in 1:p){ beta_new[j] = soft_thr...
/ElasticNet.R
permissive
xw547/methodologies
R
false
false
1,016
r
require(glmnet) require(R.matlab) soft_threshhold <- function(innerprod, lambda) { return(sign(innerprod)*max(0, abs(innerprod)- lambda)) } update_beta <- function(y, X, beta_new, lambda, alpha){ beta_new_2 =c() n = length(y) a = colSums(X^2) p = length(beta_new) for(j in 1:p){ beta_new[j] = soft_thr...
context("github") test_that("github", { skip_on_travis() skip_if_not_installed("kitten") owd <- prepare_didehpc("github") on.exit(setwd(owd)) path <- "context" src <- provisionr::package_sources(github = "richfitz/kitten") ctx <- context::context_save(path = path, packages = "kitten", ...
/tests/testthat/test-2-github.R
no_license
jeffeaton/didehpc
R
false
false
2,578
r
context("github") test_that("github", { skip_on_travis() skip_if_not_installed("kitten") owd <- prepare_didehpc("github") on.exit(setwd(owd)) path <- "context" src <- provisionr::package_sources(github = "richfitz/kitten") ctx <- context::context_save(path = path, packages = "kitten", ...
" This R program has three functions: a) one reads in a text file and converts it into a vector of words b) second one takes the vector and prints out n-most frequent words in it. c) third one plots the dispersion plot for a word in a text " library(stringr) "This function takes in a text file, and returns all words ...
/Lectures/Week5/TextAnalFunctions.R
permissive
nishkalavallabhi/LING410X-Spring18
R
false
false
1,934
r
" This R program has three functions: a) one reads in a text file and converts it into a vector of words b) second one takes the vector and prints out n-most frequent words in it. c) third one plots the dispersion plot for a word in a text " library(stringr) "This function takes in a text file, and returns all words ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{keji_lakes} \alias{keji_lakes} \alias{keji_lakes_plottable} \title{Keji lakes core diatom counts} \format{ An object of class \code{mudata} (inherits from \code{list}) of length 5. An object of class \code{tbl_df}...
/man/keji_lakes.Rd
no_license
han-tun/tidypaleo
R
false
true
1,407
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{keji_lakes} \alias{keji_lakes} \alias{keji_lakes_plottable} \title{Keji lakes core diatom counts} \format{ An object of class \code{mudata} (inherits from \code{list}) of length 5. An object of class \code{tbl_df}...
# Chapter 2 # Example 2.22 page no. 50 from the pdf.. # Combination Problem.. # number of ways to select 3 arcade and 2 sports games from 10 arcade and 5 sports game cat("The number of ways to select 3 arcade from 10 is",choose(10,3)) a <- choose(10,3) cat("The number of ways of selecting 2 catridges from...
/Probability_And_Statistics_For_Engineers_And_Scientists_by_Ronald_E._Walpole,_Raymond_H._Myers,_Sharon_L._Myers,_Keying_Ye/CH2/EX2.22/Ex2_22.R
permissive
FOSSEE/R_TBC_Uploads
R
false
false
544
r
# Chapter 2 # Example 2.22 page no. 50 from the pdf.. # Combination Problem.. # number of ways to select 3 arcade and 2 sports games from 10 arcade and 5 sports game cat("The number of ways to select 3 arcade from 10 is",choose(10,3)) a <- choose(10,3) cat("The number of ways of selecting 2 catridges from...
# # This is the server logic of a Shiny web application. You can run the # application by clicking 'Run App' above. # # Find out more about building applications with Shiny here: # # http://shiny.rstudio.com/ # library(shiny) # Define server logic required to draw a histogram shinyServer(function(input...
/Shiny Application/server.R
no_license
packliu/Developing-Data-Products---Project
R
false
false
1,820
r
# # This is the server logic of a Shiny web application. You can run the # application by clicking 'Run App' above. # # Find out more about building applications with Shiny here: # # http://shiny.rstudio.com/ # library(shiny) # Define server logic required to draw a histogram shinyServer(function(input...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/glm.R \name{h2o.getGLMFullRegularizationPath} \alias{h2o.getGLMFullRegularizationPath} \title{Extract full regularization path from a GLM model} \usage{ h2o.getGLMFullRegularizationPath(model) } \arguments{ \item{model}{an \linkS4class{H2OMod...
/man/h2o.getGLMFullRegularizationPath.Rd
no_license
cran/h2o
R
false
true
492
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/glm.R \name{h2o.getGLMFullRegularizationPath} \alias{h2o.getGLMFullRegularizationPath} \title{Extract full regularization path from a GLM model} \usage{ h2o.getGLMFullRegularizationPath(model) } \arguments{ \item{model}{an \linkS4class{H2OMod...
library(shiny) library(ggplot2) library(plotly) library(reshape2) library(shinythemes) df = read.csv('countries-aggregated.csv', header = TRUE, na.strings=c("","NA"), sep = ",") df$Active = df$Confirmed - df$Recovered - df$Deaths cases = aggregate(list(cases=df$Confirmed), by=list(Date=as.Date(df$Dat...
/global.R
no_license
marc254/Covid19App
R
false
false
1,346
r
library(shiny) library(ggplot2) library(plotly) library(reshape2) library(shinythemes) df = read.csv('countries-aggregated.csv', header = TRUE, na.strings=c("","NA"), sep = ",") df$Active = df$Confirmed - df$Recovered - df$Deaths cases = aggregate(list(cases=df$Confirmed), by=list(Date=as.Date(df$Dat...
install.packages('dplyr') library('dplyr') vignette('dplyr') slice() starwars head(starwars) ?starwars df %>% group_by(species) %>% summarise( n = n(), mass = mean(mass, na.rm = TRUE) ) %>% filter(n > 1)
/dplyr.R
no_license
kanikatiwari/Data-Analytics-R-
R
false
false
221
r
install.packages('dplyr') library('dplyr') vignette('dplyr') slice() starwars head(starwars) ?starwars df %>% group_by(species) %>% summarise( n = n(), mass = mean(mass, na.rm = TRUE) ) %>% filter(n > 1)
# Работа | Содержание работы | Предшествующая работа | Время # -------|-------------------|----------------------------|----------- # A | Подготовить архитектурный проект | - | 5 # B | Определить будущих арендаторов | - | 6 # C | Подготовить проспект для арендатор...
/07/scripts/project.R
no_license
dkhramov/mmm_2019
R
false
false
1,798
r
# Работа | Содержание работы | Предшествующая работа | Время # -------|-------------------|----------------------------|----------- # A | Подготовить архитектурный проект | - | 5 # B | Определить будущих арендаторов | - | 6 # C | Подготовить проспект для арендатор...
library(ggdendro) library(reshape) library(gplots) library(ggplot2) library(NMF) library(pheatmap) pr<-read.table("gene_presence_absence.Rtab",header=T,row.names=1) nonzero<-pr[rowSums(pr)!="0",] pr_formatted<-nonzero[rowSums(nonzero)!=ncol(nonzero),] mat<-as.matrix(pr_formatted) hm<-heatmap.2(mat,main = "Differen...
/plots/annotated_HM.R
no_license
webste01/CDI_genome_analysis
R
false
false
1,620
r
library(ggdendro) library(reshape) library(gplots) library(ggplot2) library(NMF) library(pheatmap) pr<-read.table("gene_presence_absence.Rtab",header=T,row.names=1) nonzero<-pr[rowSums(pr)!="0",] pr_formatted<-nonzero[rowSums(nonzero)!=ncol(nonzero),] mat<-as.matrix(pr_formatted) hm<-heatmap.2(mat,main = "Differen...