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
#### Task 1 #### install.packages("haven") # if you haven't install yet library(haven) survey2021 = read_sav("C:/Users/User/Downloads/survey2021.sav") View(survey2021) ## What kind of variables do we have? # use 'class' to know the data type class(survey2021$nl_wtp) class(survey2021$car_wtp) #### Task 2 #### ## Summ...
/Econ-ana-SPSS-in-R/pratical1/Descriptive statistics - Practical.R
permissive
minifeng45/ERM-RM-with-R-Python
R
false
false
3,985
r
#### Task 1 #### install.packages("haven") # if you haven't install yet library(haven) survey2021 = read_sav("C:/Users/User/Downloads/survey2021.sav") View(survey2021) ## What kind of variables do we have? # use 'class' to know the data type class(survey2021$nl_wtp) class(survey2021$car_wtp) #### Task 2 #### ## Summ...
# calculates forward models of Mg/Ca and d18O and then bins. Also bin AMOC, NAO and NAM setwd("/Users/Casey_JISAO/Google Drive/R_documents/PSR"); #constants R18SMOW<-0.0020052 #18R for VSMOW MgCaTdep<-0.087 #MgCa T dependence width<-50 #bin width ...
/PSR_scripts/sim_PSMbin.R
no_license
stephpenn1/PSR_paleo
R
false
false
27,166
r
# calculates forward models of Mg/Ca and d18O and then bins. Also bin AMOC, NAO and NAM setwd("/Users/Casey_JISAO/Google Drive/R_documents/PSR"); #constants R18SMOW<-0.0020052 #18R for VSMOW MgCaTdep<-0.087 #MgCa T dependence width<-50 #bin width ...
#' BALESTRIVOL2CAP7EXEM4 #' #' NUMERACAO DO CALCADO DOS FUNCIONARIOS DE CERTA EMPRESA #' #' @format A data frame with 7 rows and 2 variables: #' \describe{ #' \item{NUMERO}{NUMERO QUE O FUNCIONARIO CALCA} #' \item{FREQUENCIA}{QUANTIDADE DE FUNCIONARIOS QUE CALCAM AQUELE NUMERO} #' } "BALESTRIVOL2CAP7EXEM4"
/R/BALESTRIVOL2CAP7EXEM4.R
no_license
alexandrenovo/stats4eb
R
false
false
312
r
#' BALESTRIVOL2CAP7EXEM4 #' #' NUMERACAO DO CALCADO DOS FUNCIONARIOS DE CERTA EMPRESA #' #' @format A data frame with 7 rows and 2 variables: #' \describe{ #' \item{NUMERO}{NUMERO QUE O FUNCIONARIO CALCA} #' \item{FREQUENCIA}{QUANTIDADE DE FUNCIONARIOS QUE CALCAM AQUELE NUMERO} #' } "BALESTRIVOL2CAP7EXEM4"
# usage: # R --slave --vanilla --file=MRSortLPDCLI_XMCDAv2.R --args "[inDirectory]" "[outDirectory]" rm(list=ls()) # tell R to use the rJava package and the RXMCDA3 package library(rJava) library(XMCDA3) # cf. http://stackoverflow.com/questions/1815606/rscript-determine-path-of-the-executing-script script.dir <- f...
/MRSortLPD/src/MRSortLPDCLI_XMCDAv2.R
no_license
aolteanu/ws-RMCDA
R
false
false
8,986
r
# usage: # R --slave --vanilla --file=MRSortLPDCLI_XMCDAv2.R --args "[inDirectory]" "[outDirectory]" rm(list=ls()) # tell R to use the rJava package and the RXMCDA3 package library(rJava) library(XMCDA3) # cf. http://stackoverflow.com/questions/1815606/rscript-determine-path-of-the-executing-script script.dir <- f...
#' Get Example of markdown #' #' This function shows three frequently used markdown and related built function. #' #' @return Text. #' @author Jiaxiang Li #' #' @import glue #' @import cli #' @export #' #' @examples #' m() m <- function(){ cat( sep = "\n" ,glue::glue('This is the helper for R users...
/R/m.R
permissive
slsongge/add2md
R
false
false
1,323
r
#' Get Example of markdown #' #' This function shows three frequently used markdown and related built function. #' #' @return Text. #' @author Jiaxiang Li #' #' @import glue #' @import cli #' @export #' #' @examples #' m() m <- function(){ cat( sep = "\n" ,glue::glue('This is the helper for R users...
\name{Tune} \alias{Tune} %- Also NEED an '\alias' for EACH other topic documented here. \title{Tuning Function for Ecological Inference for Sets of R x C Contingency Tables} \description{ This function tunes the markov chain monte carlo algorithm used to fit a hierarchical model to ecological data in which the und...
/man/Tune.Rd
no_license
cran/RxCEcolInf
R
false
false
10,885
rd
\name{Tune} \alias{Tune} %- Also NEED an '\alias' for EACH other topic documented here. \title{Tuning Function for Ecological Inference for Sets of R x C Contingency Tables} \description{ This function tunes the markov chain monte carlo algorithm used to fit a hierarchical model to ecological data in which the und...
#aggador <- aggregate(fullcast, by = list("chimp"), FUN=mean, na.action=na.omit) aggador <- aggregate(fullcast, by = list(fullcast$chimp), FUN=mean, na.rm=TRUE) warnings() attach(aggador) # agtest <- fullcast[1:30,c(1,2,3)] # agout <- aggregate(agtest, by = list(agtest$chimp), FUN=mean) # # agout <- mean(agte...
/Yerkes/Drew version/comp_models.R
no_license
Diapadion/R
R
false
false
1,380
r
#aggador <- aggregate(fullcast, by = list("chimp"), FUN=mean, na.action=na.omit) aggador <- aggregate(fullcast, by = list(fullcast$chimp), FUN=mean, na.rm=TRUE) warnings() attach(aggador) # agtest <- fullcast[1:30,c(1,2,3)] # agout <- aggregate(agtest, by = list(agtest$chimp), FUN=mean) # # agout <- mean(agte...
#' Player IDs on websites #' #' @param year NBA season for which you want player IDs (e.g. 2008 for the 2007-08 season) #' @return data frame of names and IDs #' @keywords player IDs #' @importFrom httr GET content add_headers #' @export #' @examples #' GetPlayerIDs(2008) GetPlayerIDs <- function(year = CurrentYear()...
/R/GetPlayerIDs.R
no_license
angelldogg/sportsTools
R
false
false
726
r
#' Player IDs on websites #' #' @param year NBA season for which you want player IDs (e.g. 2008 for the 2007-08 season) #' @return data frame of names and IDs #' @keywords player IDs #' @importFrom httr GET content add_headers #' @export #' @examples #' GetPlayerIDs(2008) GetPlayerIDs <- function(year = CurrentYear()...
intersectSphereLine <- function(c, r, x, l, point.compare=NULL){ # http://en.wikipedia.org/wiki/Line%E2%80%93sphere_intersection # MAKE SURE l IS A UNIT VECTOR l <- uvector(l) # FIND A AND B a <- -sum(l*(x - c)) b <- sum(l*(x - c))^2 - sum((x - c)^2) + r^2 if(b < 0 && abs(b) > 10^-10) stop("No solution poss...
/R/intersectSphereLine.R
no_license
cran/linkR
R
false
false
818
r
intersectSphereLine <- function(c, r, x, l, point.compare=NULL){ # http://en.wikipedia.org/wiki/Line%E2%80%93sphere_intersection # MAKE SURE l IS A UNIT VECTOR l <- uvector(l) # FIND A AND B a <- -sum(l*(x - c)) b <- sum(l*(x - c))^2 - sum((x - c)^2) + r^2 if(b < 0 && abs(b) > 10^-10) stop("No solution poss...
# plot time series correlation correlations = stack(paste0(envrmt$timeseries_correlation, "/time_series_correlations.tif")) chunks = split(seq(1,60), ceiling(seq_along(seq(1,60))/10)) cors = purrr::map(chunks, function(x){ sum(correlations[[x]] > 0.95) }) ggCors = purrr::map(cors, function(x){ ggR(x, geom_ra...
/src/008_plot_time_series_reprodcibility.R
no_license
gisma/UASreproducibility
R
false
false
1,378
r
# plot time series correlation correlations = stack(paste0(envrmt$timeseries_correlation, "/time_series_correlations.tif")) chunks = split(seq(1,60), ceiling(seq_along(seq(1,60))/10)) cors = purrr::map(chunks, function(x){ sum(correlations[[x]] > 0.95) }) ggCors = purrr::map(cors, function(x){ ggR(x, geom_ra...
#' Perform GO enrichment comparing clusters #' #' Automatically perform the comparison at 3 levels #' @keywords chibi,GO,ggplot #' @export #' @examples #' chibi.comparecluster() chibi.comparecluster <- function(melted = NULL,paleta = "viridis::plasma", showCategory = 20,cutoff_redundanc...
/R/chibi.comparecluster.R
no_license
isaisg/ohchibi
R
false
false
1,826
r
#' Perform GO enrichment comparing clusters #' #' Automatically perform the comparison at 3 levels #' @keywords chibi,GO,ggplot #' @export #' @examples #' chibi.comparecluster() chibi.comparecluster <- function(melted = NULL,paleta = "viridis::plasma", showCategory = 20,cutoff_redundanc...
library(tidyverse) install.packages("ggthemes") library(ggthemes) emp = read.csv("D:/R/Data_Files/employee_data.csv", skip = 23, stringsAsFactors = FALSE) emp = as.tibble(emp) emp$gender = as.factor(emp$gender) emp$title = as.factor(emp$title) emp.a = filter(emp, salary > 45000) hist = ggplot(emp.a, aes(salary)) his...
/R/Histogram.R
no_license
lukianchikov/programming-and-finance
R
false
false
647
r
library(tidyverse) install.packages("ggthemes") library(ggthemes) emp = read.csv("D:/R/Data_Files/employee_data.csv", skip = 23, stringsAsFactors = FALSE) emp = as.tibble(emp) emp$gender = as.factor(emp$gender) emp$title = as.factor(emp$title) emp.a = filter(emp, salary > 45000) hist = ggplot(emp.a, aes(salary)) his...
# Objective: for each locus/gene, plot altogether PCs vs repeat-sizes between different ancestries date () Sys.info ()[c("nodename", "user")] commandArgs () rm (list = ls ()) R.version.string ## "R version 3.6.2 (2019-12-12)" # libraries library(dplyr); packageDescription ("dplyr", fields = "Version") #"0.8.3" library...
/population_research/plotting_PC_vs_disease_STR_size_across_populations.R
no_license
kibanez/analysing_STRs
R
false
false
6,830
r
# Objective: for each locus/gene, plot altogether PCs vs repeat-sizes between different ancestries date () Sys.info ()[c("nodename", "user")] commandArgs () rm (list = ls ()) R.version.string ## "R version 3.6.2 (2019-12-12)" # libraries library(dplyr); packageDescription ("dplyr", fields = "Version") #"0.8.3" library...
#Nyholt -> forstimlocked 98.96 library("tidyverse") tbl <- read.table('100bcstimlockedmyData.csv', header = TRUE, sep = ",") head(tbl) tbl$dir = factor(tbl$dir) tbl$cond = factor(tbl$cond) tbl$age= factor(tbl$age) A = data.matrix(tbl, rownames.force = NA) A = A[,-1] A = A[,-603] A = A[,-602] A = A[,-601] cor_mat...
/nyholtstimlock.R
no_license
MartynaPlomecka/EEGdeconv
R
false
false
717
r
#Nyholt -> forstimlocked 98.96 library("tidyverse") tbl <- read.table('100bcstimlockedmyData.csv', header = TRUE, sep = ",") head(tbl) tbl$dir = factor(tbl$dir) tbl$cond = factor(tbl$cond) tbl$age= factor(tbl$age) A = data.matrix(tbl, rownames.force = NA) A = A[,-1] A = A[,-603] A = A[,-602] A = A[,-601] cor_mat...
#fig4, plot models of miRNA library(ggplot2) library(data.table) options("scipen"=10) source("ggplot_theme.R") library(extrafont) mirdata<-fread("/lab/solexa_bartel/teisen/Tail-seq/miR-155_final_analyses/miR_analysis/fc_simulation/rateComparisonsSsFitV3_1/sims/RateDataV7.txt",head=TRUE,sep="\t") mirdata$Time_point = ...
/KinetTlnFigures/Fig4miRNA.R
no_license
timeisen/DynamicsOfCytoplasmicMrnaMetabolism
R
false
false
19,080
r
#fig4, plot models of miRNA library(ggplot2) library(data.table) options("scipen"=10) source("ggplot_theme.R") library(extrafont) mirdata<-fread("/lab/solexa_bartel/teisen/Tail-seq/miR-155_final_analyses/miR_analysis/fc_simulation/rateComparisonsSsFitV3_1/sims/RateDataV7.txt",head=TRUE,sep="\t") mirdata$Time_point = ...
% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/dfm-main.R \name{dfm} \alias{as.dfm} \alias{dfm} \alias{dfm.character} \alias{dfm.corpus} \alias{is.dfm} \title{create a document-feature matrix} \usage{ dfm(x, ...) \method{dfm}{character}(x, verbose = TRUE, clean = TRUE, stem = FAL...
/man/dfm.Rd
no_license
parthasen/quanteda
R
false
false
8,506
rd
% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/dfm-main.R \name{dfm} \alias{as.dfm} \alias{dfm} \alias{dfm.character} \alias{dfm.corpus} \alias{is.dfm} \title{create a document-feature matrix} \usage{ dfm(x, ...) \method{dfm}{character}(x, verbose = TRUE, clean = TRUE, stem = FAL...
library(tidyverse) library(dplyr) library(ggplot2) library(forcats) censo_2010 censo_2010_s <- censo_2010 %>% transmute(provincia, total_poblacion = total_poblacion / 1000000, mujeres = mujeres / 1000000, porcentaje) %>% arrange(porcentaje) arrange(censo_2010_s, desc(porcentaje)) ggplot(censo_2010_s, aes(x = ...
/base-code.R
no_license
sofiscaiano/dyss-fuentes
R
false
false
2,019
r
library(tidyverse) library(dplyr) library(ggplot2) library(forcats) censo_2010 censo_2010_s <- censo_2010 %>% transmute(provincia, total_poblacion = total_poblacion / 1000000, mujeres = mujeres / 1000000, porcentaje) %>% arrange(porcentaje) arrange(censo_2010_s, desc(porcentaje)) ggplot(censo_2010_s, aes(x = ...
Libraries library(ggplot2) library(dplyr) library(modeest)
/Libraries.R
no_license
JAOscoy/RStudio_Prototype
R
false
false
60
r
Libraries library(ggplot2) library(dplyr) library(modeest)
# ============================================= # Modifying a data frame in place # ============================================= library(ggplot2) str(diamonds) # Modify data frame in place, in loop # This is super, super slow system.time({ d <- diamonds for (i in 1:length(d$carat)) d$carat[i] <- i }) ...
/Random R scripts/2018-04-21_speed-comparisons.R
no_license
nayefahmad/R-vocab-and-experiments
R
false
false
2,982
r
# ============================================= # Modifying a data frame in place # ============================================= library(ggplot2) str(diamonds) # Modify data frame in place, in loop # This is super, super slow system.time({ d <- diamonds for (i in 1:length(d$carat)) d$carat[i] <- i }) ...
/PlotOutNC_NandRNandNums_V3_SpinUp.R
permissive
hmorzaria/Atlantis_tuning
R
false
false
27,080
r
# BARRA RISK FACTORS # to do ... # sample fitlering within the GR func ??? # trading frequency minimum requirement # fill in methodology ??? get_rf <- function(rebDates, type = c("fake","real")){ type <- match.arg(type) if(type == "fake"){ result <- data.frame('date' = rebDates, 'Rf' = 0, stringsAsFactor...
/R/risk03_BARRA_FACTORS.R
no_license
raphael210/QDataGet
R
false
false
22,900
r
# BARRA RISK FACTORS # to do ... # sample fitlering within the GR func ??? # trading frequency minimum requirement # fill in methodology ??? get_rf <- function(rebDates, type = c("fake","real")){ type <- match.arg(type) if(type == "fake"){ result <- data.frame('date' = rebDates, 'Rf' = 0, stringsAsFactor...
#' wetbulb_stull #' #' Compute natural wetbulb temperature by using Stull empirical formulation #' #' @param t numeric Air temperature in degC. #' @param rh numeric Relative humidity in percentage. #' @return Wet bulb temperature in degC #' #' #' @author Istituto per la Bioeconomia CNR Firenze Italy Alfonso ...
/R/wetbulb_stull.r
permissive
alfcrisci/rBiometeo
R
false
false
884
r
#' wetbulb_stull #' #' Compute natural wetbulb temperature by using Stull empirical formulation #' #' @param t numeric Air temperature in degC. #' @param rh numeric Relative humidity in percentage. #' @return Wet bulb temperature in degC #' #' #' @author Istituto per la Bioeconomia CNR Firenze Italy Alfonso ...
#------------------------------------------------------------------------------- # Stock assessment script for 2019 Black Sea Turbot benchmark by Niels Hintzen (niels.hintzen@wur.nl) # # Last modified: 26/06/2020. vanja # #------------------------------------------------------------------------------- library(FLCore) l...
/ANEPIL bechmkt 2020/PIL/Sar_assessment all surveys states age 2.r
no_license
brune001/MSE-Adriatic
R
false
false
7,813
r
#------------------------------------------------------------------------------- # Stock assessment script for 2019 Black Sea Turbot benchmark by Niels Hintzen (niels.hintzen@wur.nl) # # Last modified: 26/06/2020. vanja # #------------------------------------------------------------------------------- library(FLCore) l...
Remember 1) Open a terminal window and keep executed mongod (MongoDB server running): $ mongod 2) For test on your localhost db connect using the mongo client: $ mongo Files - install.js > create collection and insert data - reset.js > delete all collections and data - app.js > methods - config.js > config vars
/README.rd
no_license
federicobucchi/nodejs-tests
R
false
false
316
rd
Remember 1) Open a terminal window and keep executed mongod (MongoDB server running): $ mongod 2) For test on your localhost db connect using the mongo client: $ mongo Files - install.js > create collection and insert data - reset.js > delete all collections and data - app.js > methods - config.js > config vars
df2 <- data.frame(dplyr::bind_cols(florida, sample_n(baltimore, 9100))) df2 %>% select(DEPARTMENT, GENDER) %>% filter(DEPARTMENT %in% c("POL", "HHS")) %>% ggplot(aes(x = DEPARTMENT)) + geom_bar() + facet_grid(.~GENDER)+ labs(x="Department", y= "Count") + ggtitle("Comparison DEPARTMENTS VS. GENDERS")
/03 Visualizations/combineData.R
no_license
AnnaPeng/DV_RProject3
R
false
false
300
r
df2 <- data.frame(dplyr::bind_cols(florida, sample_n(baltimore, 9100))) df2 %>% select(DEPARTMENT, GENDER) %>% filter(DEPARTMENT %in% c("POL", "HHS")) %>% ggplot(aes(x = DEPARTMENT)) + geom_bar() + facet_grid(.~GENDER)+ labs(x="Department", y= "Count") + ggtitle("Comparison DEPARTMENTS VS. GENDERS")
## this function aggregates the points data frame to an "n's" data frame for use in estimation. makeNs = function(points ,nonsampled ,quest ,area = areaNew ,ref = refState ,nwosCycle = 2011 ,type = 'generic') { ...
/Archive/makeNs.R
no_license
Brent-Dickinson/estimation-package
R
false
false
5,854
r
## this function aggregates the points data frame to an "n's" data frame for use in estimation. makeNs = function(points ,nonsampled ,quest ,area = areaNew ,ref = refState ,nwosCycle = 2011 ,type = 'generic') { ...
require(readr) require(reshape2) require(ggplot2) require(scales) # set working directory getwd() setwd("../query_results/") # read data data <- read.csv("no_epp_per_year/comp_no_epp_per_year_inferred_noninferred_sent_from_budé.csv", fileEncoding = "UTF-8", na.strings = c("NULL")) # apply melt for wide to long data_...
/budé/r_scripts/no_epp_per_year/comp_no_epp_per_year_inferred_noninferred_sent_from_budé_barchart_percentage.R
no_license
CKudella/corr_data
R
false
false
1,818
r
require(readr) require(reshape2) require(ggplot2) require(scales) # set working directory getwd() setwd("../query_results/") # read data data <- read.csv("no_epp_per_year/comp_no_epp_per_year_inferred_noninferred_sent_from_budé.csv", fileEncoding = "UTF-8", na.strings = c("NULL")) # apply melt for wide to long data_...
### CdG ### 5th March 2015 ## Exploring Data #ASsignment 1 ## Loading the data dat = read.delim("household_power_consumption.txt",header=T,sep=";",na.strings="?",stringsAsFactors=F) #subset on relevant dates library(lubridate) dat[,1] = dmy(dat[,1]) febDat = dat[dat$Date == dmy("01-02-2007") | dat$Date == dmy("02-0...
/plot1.R
no_license
carolyndg/ExData_Plotting1
R
false
false
531
r
### CdG ### 5th March 2015 ## Exploring Data #ASsignment 1 ## Loading the data dat = read.delim("household_power_consumption.txt",header=T,sep=";",na.strings="?",stringsAsFactors=F) #subset on relevant dates library(lubridate) dat[,1] = dmy(dat[,1]) febDat = dat[dat$Date == dmy("01-02-2007") | dat$Date == dmy("02-0...
shinyServer(function(input, output) { outputtext <- reactive({ req(input$file) img <- image_load(input$file$datapath, target_size = RESNET_50_IMAGE_FORMAT) x <- image_to_array(img) x <- array_reshape(x, c(1, dim(x))) x <- imagenet_preprocess_input(x) preds <- model %>% predict(x) ...
/server.R
no_license
tengku-hanis/image_recognition
R
false
false
1,467
r
shinyServer(function(input, output) { outputtext <- reactive({ req(input$file) img <- image_load(input$file$datapath, target_size = RESNET_50_IMAGE_FORMAT) x <- image_to_array(img) x <- array_reshape(x, c(1, dim(x))) x <- imagenet_preprocess_input(x) preds <- model %>% predict(x) ...
/sara.R
no_license
huwang3134/Change_point
R
false
false
631
r
library(timeSeries) ### Name: plot-methods ### Title: Plot a Time Series ### Aliases: plot plot,timeSeries-method lines,timeSeries-method ### points,timeSeries-method pretty.timeSeries ### Keywords: chron ### ** Examples ## Load Swiss Pension Fund Benchmark Data - LPP <- LPP2005REC[1:12, 1:4] colnames(LPP) ...
/data/genthat_extracted_code/timeSeries/examples/methods-plot.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
1,938
r
library(timeSeries) ### Name: plot-methods ### Title: Plot a Time Series ### Aliases: plot plot,timeSeries-method lines,timeSeries-method ### points,timeSeries-method pretty.timeSeries ### Keywords: chron ### ** Examples ## Load Swiss Pension Fund Benchmark Data - LPP <- LPP2005REC[1:12, 1:4] colnames(LPP) ...
# globalVariables(c(".", "!!")) #' Climate attributes from projections. #' #' A example dataset containing the climate attribute values #' in fraction/additive change #' #' @format A data frame with 6 rows and 6 variables: #' \describe{ #' \item{P_ann_tot_m}{change in mean annual total P, fraction} #' \item{P_ann...
/foreSIGHT/R/foreSIGHT.R
no_license
akhikolla/InformationHouse
R
false
false
2,520
r
# globalVariables(c(".", "!!")) #' Climate attributes from projections. #' #' A example dataset containing the climate attribute values #' in fraction/additive change #' #' @format A data frame with 6 rows and 6 variables: #' \describe{ #' \item{P_ann_tot_m}{change in mean annual total P, fraction} #' \item{P_ann...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/init_mhExplorer.R \name{init_mhExplorer} \alias{init_mhExplorer} \title{Initialize Settings for Medical History Explorer widget} \usage{ init_mhExplorer(data, settings) } \arguments{ \item{data}{medical history and demographics data.} \item{...
/man/init_mhExplorer.Rd
permissive
SafetyGraphics/safetyCharts
R
false
true
474
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/init_mhExplorer.R \name{init_mhExplorer} \alias{init_mhExplorer} \title{Initialize Settings for Medical History Explorer widget} \usage{ init_mhExplorer(data, settings) } \arguments{ \item{data}{medical history and demographics data.} \item{...
## GPL-3 License ## Copyright (c) 2021 Vincent Runge #' Computing Euclidean Distance #' #' @description Euclidean Distance with the R function sum #' @param v a vector of numeric data #' @param w a vector of numeric data #' @return the Euclidean distance between v and w Euclide_R <- function(v,w) { return(sqrt(sum...
/R/Euclide.R
no_license
vrunge/M1M2
R
false
false
714
r
## GPL-3 License ## Copyright (c) 2021 Vincent Runge #' Computing Euclidean Distance #' #' @description Euclidean Distance with the R function sum #' @param v a vector of numeric data #' @param w a vector of numeric data #' @return the Euclidean distance between v and w Euclide_R <- function(v,w) { return(sqrt(sum...
####################################################### # Obtains relevant information from cleaned data, # # set hyperparamaters, and # # initialize variables to be updated in gibbs sampler # # Saves what's needed in Gibbs sampler # ########################################...
/smered-tutorial/server-version/scripts-and-reports/init_vars.R
no_license
resteorts/bayesian-graphical-entity-resolution
R
false
false
3,587
r
####################################################### # Obtains relevant information from cleaned data, # # set hyperparamaters, and # # initialize variables to be updated in gibbs sampler # # Saves what's needed in Gibbs sampler # ########################################...
# Jinliang Yang # July 10th, 2014 source("~/Documents/Rcodes/sh4GenSel.R") ### test runs: sh4GenSel(pwd="/home/NSF-SAM-GS/GenSel/testrun", sh="SAM_test.sh", geno="/home/NSF-SAM-GS/snpmatrix/SAM_SNPs_chrall_samid.gensel", pheno="/mnt/02/yangjl/Documents/SAM_GS/SAM_proj/data/SAM_pheno382....
/profiling/3.GWAS/old/3.A.1_GenSel_test.R
no_license
yangjl/SAM_RD
R
false
false
2,131
r
# Jinliang Yang # July 10th, 2014 source("~/Documents/Rcodes/sh4GenSel.R") ### test runs: sh4GenSel(pwd="/home/NSF-SAM-GS/GenSel/testrun", sh="SAM_test.sh", geno="/home/NSF-SAM-GS/snpmatrix/SAM_SNPs_chrall_samid.gensel", pheno="/mnt/02/yangjl/Documents/SAM_GS/SAM_proj/data/SAM_pheno382....
## Exploring the Gapminder data set library(dplyr) library(ggplot2) library(dslabs) data(gapminder) # life expectancy vs. fertility in Africa gapminder %>% filter(year == 2012 & continent == "Africa") %>% ggplot(aes(fertility , life_expectancy)) + geom_point() # color by region gapminder %>% filter(ye...
/Visualization/ExploringGapminder.R
no_license
AndrewS622/Data-Science
R
false
false
3,189
r
## Exploring the Gapminder data set library(dplyr) library(ggplot2) library(dslabs) data(gapminder) # life expectancy vs. fertility in Africa gapminder %>% filter(year == 2012 & continent == "Africa") %>% ggplot(aes(fertility , life_expectancy)) + geom_point() # color by region gapminder %>% filter(ye...
ddctcomp <- function(object, control_gene=NULL, control_treatment=NULL, conf.level=0.95, adjusted=FALSE, ratio_ddct=TRUE){ nt <- object$nt ng <- object$ng est <- object$ct[,1] vce <- object$vcov df <- object$df dat <- object$dat if (ratio_ddct == TRUE) dsymb <- " / " else dsymb <- " - " if (!is.null(con...
/R/ddctcomp.R
no_license
daniel-gerhard/qpcrnlme
R
false
false
3,411
r
ddctcomp <- function(object, control_gene=NULL, control_treatment=NULL, conf.level=0.95, adjusted=FALSE, ratio_ddct=TRUE){ nt <- object$nt ng <- object$ng est <- object$ct[,1] vce <- object$vcov df <- object$df dat <- object$dat if (ratio_ddct == TRUE) dsymb <- " / " else dsymb <- " - " if (!is.null(con...
#Run the lines below to install and load the TOSTER package #Install TOSTER package if needed if(!require(TOSTER)){install.packages('TOSTER')} #Load TOSTER package library(TOSTER) #Question 2 and 3 (replace the zeroes with correct values) # You can type ?TOSTtwo for help with the TOSTtwo function TOSTtwo(m1=4.88, m2=...
/week6/week6_1.r
no_license
changyaochen/Coursera_improving_your_statistical_inferences
R
false
false
1,628
r
#Run the lines below to install and load the TOSTER package #Install TOSTER package if needed if(!require(TOSTER)){install.packages('TOSTER')} #Load TOSTER package library(TOSTER) #Question 2 and 3 (replace the zeroes with correct values) # You can type ?TOSTtwo for help with the TOSTtwo function TOSTtwo(m1=4.88, m2=...
# this is to keep the old S3 behaviour inside the NAMESPACE. is = function(x, class) { if (identical(class, "double")) is.double(x) else if ("double" %in% class) any(class(x) %in% class) || is.double(x) else any(class(x) %in% class) }#IS # get all the subsets of a given size, even if either the ini...
/R/utils-misc.R
no_license
areinert9/bnlearn
R
false
false
5,497
r
# this is to keep the old S3 behaviour inside the NAMESPACE. is = function(x, class) { if (identical(class, "double")) is.double(x) else if ("double" %in% class) any(class(x) %in% class) || is.double(x) else any(class(x) %in% class) }#IS # get all the subsets of a given size, even if either the ini...
complete <- function(directory, id = 1:332){ files_full <- list.files(directory, full.names = TRUE) data <- data.frame() for(i in id){ x <- read.csv(files_full[i]) y <- x[complete.cases(x), ] z <- c(i, nrow(y)) ...
/R_Programming/Assignment 1/complete.R
no_license
clementkan/JHSPH_DataScienceSpecialization
R
false
false
437
r
complete <- function(directory, id = 1:332){ files_full <- list.files(directory, full.names = TRUE) data <- data.frame() for(i in id){ x <- read.csv(files_full[i]) y <- x[complete.cases(x), ] z <- c(i, nrow(y)) ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot.R \name{plot.rSEIQR} \alias{plot.rSEIQR} \title{S3 plot method for stochastic SEIQR model} \usage{ \method{plot}{rSEIQR}(x) } \arguments{ \item{x}{the output from simulation} } \description{ \code{plot} returns the time series plot of si...
/man/plot.rSEIQR.Rd
no_license
jessseliu/epidmod
R
false
true
511
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot.R \name{plot.rSEIQR} \alias{plot.rSEIQR} \title{S3 plot method for stochastic SEIQR model} \usage{ \method{plot}{rSEIQR}(x) } \arguments{ \item{x}{the output from simulation} } \description{ \code{plot} returns the time series plot of si...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/controlPlotsBiSeq.R \name{rnb.plot.biseq.coverage} \alias{rnb.plot.biseq.coverage} \title{rnb.plot.biseq.coverage} \usage{ rnb.plot.biseq.coverage( rnbs.set, sample, type = "sites", writeToFile = FALSE, numeric.names = FALSE, covg...
/man/rnb.plot.biseq.coverage.Rd
no_license
epigen/RnBeads
R
false
true
1,482
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/controlPlotsBiSeq.R \name{rnb.plot.biseq.coverage} \alias{rnb.plot.biseq.coverage} \title{rnb.plot.biseq.coverage} \usage{ rnb.plot.biseq.coverage( rnbs.set, sample, type = "sites", writeToFile = FALSE, numeric.names = FALSE, covg...
\name{intercept} \alias{intercept} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Intercept estimates from segmented relationships } \description{ Computes the intercepts of each `segmented' relationship in the fitted model. } \usage{ intercept(ogg, parm, rev.sgn = FALSE, var.diff=FA...
/man/intercept.Rd
no_license
ChuangWAN1994/segmented
R
false
false
2,588
rd
\name{intercept} \alias{intercept} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Intercept estimates from segmented relationships } \description{ Computes the intercepts of each `segmented' relationship in the fitted model. } \usage{ intercept(ogg, parm, rev.sgn = FALSE, var.diff=FA...
library(ncdf4) base <- "../../3_thredds/data/nwm_retro_full" out_path <- "../../3_thredds/data/nwm_retro_full_" files <- list.files(base, pattern = "*.nc", full.names = TRUE) nc <- nc_open(files[1]) fids <- nc$dim$feature_id$vals lats <- ncvar_get(nc, nc$var$latitude) lons <- ncvar_get(nc, n...
/deprecated/reshape_retro.R
permissive
dblodgett-usgs/nwm_subset
R
false
false
4,475
r
library(ncdf4) base <- "../../3_thredds/data/nwm_retro_full" out_path <- "../../3_thredds/data/nwm_retro_full_" files <- list.files(base, pattern = "*.nc", full.names = TRUE) nc <- nc_open(files[1]) fids <- nc$dim$feature_id$vals lats <- ncvar_get(nc, nc$var$latitude) lons <- ncvar_get(nc, n...
visualize.fpc.scores <- function( variable = NULL, DF.fpc.scores = NULL, DF.colour.scheme = data.frame( row.names = c("marsh", "swamp", "water", "forest", "ag", "shallow"), land_cover = c("marsh", "swamp", "water", "forest", "ag", "shallow"), colour = c...
/401-manuscript/code/visualize-fpc-scores.R
no_license
kennethchu-statcan/nwrc-2020
R
false
false
3,707
r
visualize.fpc.scores <- function( variable = NULL, DF.fpc.scores = NULL, DF.colour.scheme = data.frame( row.names = c("marsh", "swamp", "water", "forest", "ag", "shallow"), land_cover = c("marsh", "swamp", "water", "forest", "ag", "shallow"), colour = c...
palette(c("#E41A1C", "#377EB8", "#4DAF4A", "#984EA3", "#FF7F00", "#FFFF33", "#A65628", "#F781BF", "#999999")) shinyServer(function(input, output, session) { # Combine the selected variables into a new data frame selectedData <- reactive({ mtcars[, c(input$xcol, input$ycol,input$zcol)] }) cl...
/server.R
no_license
jfran04/mtcars-kmeans
R
false
false
612
r
palette(c("#E41A1C", "#377EB8", "#4DAF4A", "#984EA3", "#FF7F00", "#FFFF33", "#A65628", "#F781BF", "#999999")) shinyServer(function(input, output, session) { # Combine the selected variables into a new data frame selectedData <- reactive({ mtcars[, c(input$xcol, input$ycol,input$zcol)] }) cl...
library(shiny) library(shinydashboard) ui <- dashboardPage( dashboardHeader(title = "Teste",dropdownMenu(type = "notifications", icon = icon("question"), messageItem( from = ...
/Dashboard_Shiny.R
no_license
sayuriTakeda/Dashboard_Shiny
R
false
false
2,688
r
library(shiny) library(shinydashboard) ui <- dashboardPage( dashboardHeader(title = "Teste",dropdownMenu(type = "notifications", icon = icon("question"), messageItem( from = ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/sequencewrapper.R \name{phang2nuc} \alias{phang2nuc} \title{phang2nuc} \usage{ phang2nuc(sq = phang.seq, file = "test.out") } \value{ No output. } \description{ Converts output of phangorn to nucleotides. } \author{ Rebecca Harris <rbharris@u...
/man/phang2nuc.Rd
no_license
georgeshirreff/multiNe
R
false
true
330
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/sequencewrapper.R \name{phang2nuc} \alias{phang2nuc} \title{phang2nuc} \usage{ phang2nuc(sq = phang.seq, file = "test.out") } \value{ No output. } \description{ Converts output of phangorn to nucleotides. } \author{ Rebecca Harris <rbharris@u...
# # Vaporware.R, 20 Oct 17 # Data from: # PC-Letter's Vapor list # via # Truth or Consequences: {An} Analysis of Vaporware and New Product Announcements # Barry L. Bayus and Sanjay Jain and Ambar G. Rao # # Example from: # Empirical Software Engineering using R # Derek M. Jones source("ESEUR_config.r") # email infor...
/economics/Vaporware.R
no_license
alanponce/ESEUR-code-data
R
false
false
1,349
r
# # Vaporware.R, 20 Oct 17 # Data from: # PC-Letter's Vapor list # via # Truth or Consequences: {An} Analysis of Vaporware and New Product Announcements # Barry L. Bayus and Sanjay Jain and Ambar G. Rao # # Example from: # Empirical Software Engineering using R # Derek M. Jones source("ESEUR_config.r") # email infor...
######################################################################################################################################### #R code used in Delory et al (2017) archiDART v3.0: a new data analysis pipeline allowing the topological analysis of plant root systems #############################################...
/Delory et al_archiDARTv3_F1000Research_2017.R
no_license
archidart/F1000_paper_data
R
false
false
14,532
r
######################################################################################################################################### #R code used in Delory et al (2017) archiDART v3.0: a new data analysis pipeline allowing the topological analysis of plant root systems #############################################...
library(tidyverse) set.seed(1) tb <- tibble( x = 9*rnorm(10), u = 36*rnorm(10), y = 3 + 2*x + u, yhat = predict(lm(y ~ x)), uhat = residuals(lm(y ~ x)) ) summary(tb) colSums(tb)
/Master_do_files/ols2.R
permissive
snowdj/causal-inference-class
R
false
false
190
r
library(tidyverse) set.seed(1) tb <- tibble( x = 9*rnorm(10), u = 36*rnorm(10), y = 3 + 2*x + u, yhat = predict(lm(y ~ x)), uhat = residuals(lm(y ~ x)) ) summary(tb) colSums(tb)
library(spatstat) ### Name: as.function.im ### Title: Convert Pixel Image to Function of Coordinates ### Aliases: as.function.im ### Keywords: spatial manip ### ** Examples d <- density(cells) f <- as.function(d) f(0.1, 0.3)
/data/genthat_extracted_code/spatstat/examples/as.function.im.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
238
r
library(spatstat) ### Name: as.function.im ### Title: Convert Pixel Image to Function of Coordinates ### Aliases: as.function.im ### Keywords: spatial manip ### ** Examples d <- density(cells) f <- as.function(d) f(0.1, 0.3)
require(quanteda) require(tidyverse) require(readtext) require(data.table) require(openxlsx) require(tidyverse) require(stm) require(tm) stop <- str_split("é la pra en el sobre ser y vai q dia the pode diz los $ utm_medium utm_campaign = contra tá via hoje ter ainda gente del agora todos to vc aqui con un fazer tudo t...
/stm.R
no_license
prldc/MQCP_trabalho_final
R
false
false
4,124
r
require(quanteda) require(tidyverse) require(readtext) require(data.table) require(openxlsx) require(tidyverse) require(stm) require(tm) stop <- str_split("é la pra en el sobre ser y vai q dia the pode diz los $ utm_medium utm_campaign = contra tá via hoje ter ainda gente del agora todos to vc aqui con un fazer tudo t...
#' Scrape FanGraphs.com Guts! #' #' This function allows you to scrape the historical, season-by-season wOBA and FIP constants and coefficients at FanGraphs.com. #' @keywords MLB, sabermetrics #' @export #' @examples #' fg_guts() # scrape historical FanGraphs Guts! table # wOBA and FIP coefficients and constants fg_g...
/R/fg_guts.R
no_license
WillNetsky/baseballr
R
false
false
843
r
#' Scrape FanGraphs.com Guts! #' #' This function allows you to scrape the historical, season-by-season wOBA and FIP constants and coefficients at FanGraphs.com. #' @keywords MLB, sabermetrics #' @export #' @examples #' fg_guts() # scrape historical FanGraphs Guts! table # wOBA and FIP coefficients and constants fg_g...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/summarize_ASAP.r \name{SummarizeASAP} \alias{SummarizeASAP} \title{Summarize ASAP} \usage{ SummarizeASAP(asap, a1, od) } \arguments{ \item{asap}{name of the variable that read in the asap.rdat file} \item{a1}{list file produced by...
/man/SummarizeASAP.Rd
permissive
cmlegault/ASAPplots
R
false
true
497
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/summarize_ASAP.r \name{SummarizeASAP} \alias{SummarizeASAP} \title{Summarize ASAP} \usage{ SummarizeASAP(asap, a1, od) } \arguments{ \item{asap}{name of the variable that read in the asap.rdat file} \item{a1}{list file produced by...
library(imputeTS) x <- ts(c(1, 2, 3, 4, 5, 6, 7, 8, NA, NA, 11, 12)) #impute using the mean of the whole series na.mean(x) # impute using the median na.mean(x, option="median") #since our data has an order might make sense to interpolate na.interpolation(x) tsAirgap statsNA(tsAirgap) plotNA.distribution(tsAirgap) ...
/04_timeseries_imputation.r
no_license
macomino/DataEngineering-
R
false
false
540
r
library(imputeTS) x <- ts(c(1, 2, 3, 4, 5, 6, 7, 8, NA, NA, 11, 12)) #impute using the mean of the whole series na.mean(x) # impute using the median na.mean(x, option="median") #since our data has an order might make sense to interpolate na.interpolation(x) tsAirgap statsNA(tsAirgap) plotNA.distribution(tsAirgap) ...
# Using R: From gather to pivot # https://www.r-bloggers.com/using-r-from-gather-to-pivot/ rm(list=ls()) setwd("~/R/Crosstabulation") library(reshape2) fake_data <- data.frame(id = 1:20, variable1 = runif(20, 0, 1), variable2 = rnorm(20)) melted <- melt(fake_d...
/pivot.R
no_license
Joshuariver/Crosstabulation
R
false
false
950
r
# Using R: From gather to pivot # https://www.r-bloggers.com/using-r-from-gather-to-pivot/ rm(list=ls()) setwd("~/R/Crosstabulation") library(reshape2) fake_data <- data.frame(id = 1:20, variable1 = runif(20, 0, 1), variable2 = rnorm(20)) melted <- melt(fake_d...
splitnum <- function(s) { r <- 0 v <- 0 o <- 1 d <- 1 for (i in 1:nchar(s[2])) { c <- substr(s[2], i, i) if (c == '+') { r <- r + v*o o <- 1 v <- 0 } else if (c == '-') { r <- r + v*o o <- -1 v <- 0 } else { v <- v*10 + as.integer(substr(s[1], d, d)) ...
/easy/split_the_number.r
permissive
shortthirdman/code-eval-challenges
R
false
false
443
r
splitnum <- function(s) { r <- 0 v <- 0 o <- 1 d <- 1 for (i in 1:nchar(s[2])) { c <- substr(s[2], i, i) if (c == '+') { r <- r + v*o o <- 1 v <- 0 } else if (c == '-') { r <- r + v*o o <- -1 v <- 0 } else { v <- v*10 + as.integer(substr(s[1], d, d)) ...
rm(list=ls()) library(rarhsmm) library(nnet) require(Matrix) source("batchsim.R") source("util.R") nboot <- 500 bmean <- matrix(NA,nrow=nboot,ncol=10) colnames(bmean) <- c("obs","stopomlin","stopomquad","stomdplin","stomdpquad", "detpomlin","detpomquad","detmdplin","detmdpquad", "opt") nsubj <-...
/simulations/value/scenario1/avgn100_1.R
no_license
Zekun-Jack-Xu/latent_state_model_precision_medicine
R
false
false
22,863
r
rm(list=ls()) library(rarhsmm) library(nnet) require(Matrix) source("batchsim.R") source("util.R") nboot <- 500 bmean <- matrix(NA,nrow=nboot,ncol=10) colnames(bmean) <- c("obs","stopomlin","stopomquad","stomdplin","stomdpquad", "detpomlin","detpomquad","detmdplin","detmdpquad", "opt") nsubj <-...
#' dissertateOU format. #' #' Format for creating dissertations at Utah State University. It has been approved by the graduate school. #' #' @inheritParams rmarkdown::pdf_document #' @param ... Additional arguments to \code{rmarkdown::pdf_document} #' #' @return R Markdown output format to pass to #' \code{\link[rmar...
/R/dissertateOU.R
no_license
TysonStanley/dissertateOU
R
false
false
2,520
r
#' dissertateOU format. #' #' Format for creating dissertations at Utah State University. It has been approved by the graduate school. #' #' @inheritParams rmarkdown::pdf_document #' @param ... Additional arguments to \code{rmarkdown::pdf_document} #' #' @return R Markdown output format to pass to #' \code{\link[rmar...
############## Plot Heterozygosity for East v. West ################ # # MF 3/30/2018 # #################################################################### # Install Packages -------------------------------------------------------- install.packages("TTR") library(TTR) library(zoo) # don't need to install; will i...
/analyses/SlidingWindow/Plot_Heterozygosity_SlidingWindow.R
no_license
mfisher5/PCod-Compare-repo
R
false
false
2,202
r
############## Plot Heterozygosity for East v. West ################ # # MF 3/30/2018 # #################################################################### # Install Packages -------------------------------------------------------- install.packages("TTR") library(TTR) library(zoo) # don't need to install; will i...
## TODO: mbind for matrix could use sparse matrix code ## check for necessity of [,,drop=FALSE] in mbind for 1x cases ## check problem with merge for samp/taxa ## groupSums and groupMeans setGeneric("groupSums", function(object, ...) standardGeneric("groupSums")) ## MARGIN indicates what to group (1: group rows, 2: ...
/mefa4/R/mefa4plus.R
no_license
ingted/R-Examples
R
false
false
12,258
r
## TODO: mbind for matrix could use sparse matrix code ## check for necessity of [,,drop=FALSE] in mbind for 1x cases ## check problem with merge for samp/taxa ## groupSums and groupMeans setGeneric("groupSums", function(object, ...) standardGeneric("groupSums")) ## MARGIN indicates what to group (1: group rows, 2: ...
context("pull") test_that("default extracts last var from data frame", { df <- data_frame(x = 1:10, y = 1:10) expect_equal(pull(df), 1:10) }) test_that("can extract by name, or positive/negative position", { x <- 1:10 df <- data_frame(x = x, y = runif(10)) expect_equal(pull(df, x), x) expect_equal(pull(d...
/tests/testthat/test-pull.R
permissive
mohamedndiaye/dplyr
R
false
false
1,399
r
context("pull") test_that("default extracts last var from data frame", { df <- data_frame(x = 1:10, y = 1:10) expect_equal(pull(df), 1:10) }) test_that("can extract by name, or positive/negative position", { x <- 1:10 df <- data_frame(x = x, y = runif(10)) expect_equal(pull(df, x), x) expect_equal(pull(d...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mkcpp_from_template.R \name{mkcpp_initialisation_population} \alias{mkcpp_initialisation_population} \title{Function for internal use} \usage{ mkcpp_initialisation_population(ind_t) } \description{ Build source code for population initializat...
/man/mkcpp_initialisation_population.Rd
no_license
cran/IBMPopSim
R
false
true
346
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mkcpp_from_template.R \name{mkcpp_initialisation_population} \alias{mkcpp_initialisation_population} \title{Function for internal use} \usage{ mkcpp_initialisation_population(ind_t) } \description{ Build source code for population initializat...
/Semana 7/SolucionS7.r
no_license
pmojicap/Estadistica
R
false
false
2,892
r
# Date: 07 Feb 2015 # Author: Julia Barthold # Comment: # - this script gets sourced by Code S2.R, see Code S2.R for further details # - plots the mortality rate source("simFcts.R") # Mortality # setting up some objects startAge <- 0 cutOff <- 0.05 # plot objects until (1- cutOff) of synthetic cohort are dead # co...
/chapter_3_mort_meth/plotMortRate.R
no_license
bartholdja/DPhil_supplements
R
false
false
3,581
r
# Date: 07 Feb 2015 # Author: Julia Barthold # Comment: # - this script gets sourced by Code S2.R, see Code S2.R for further details # - plots the mortality rate source("simFcts.R") # Mortality # setting up some objects startAge <- 0 cutOff <- 0.05 # plot objects until (1- cutOff) of synthetic cohort are dead # co...
\name{CPPevalHR} \alias{CPPevalHR} \title{Function to Evaluate CPP Hazard Rates} \description{A function to evaluate a (prior or posterior) sample of CPP hazard rates on a grid of time points.} \usage{CPPevalHR(time, sample)} \arguments{ \item{time}{vector of time points where the hazard rates in the sample should be...
/man/CPPevalHR.Rd
no_license
cran/BayHaz
R
false
false
1,215
rd
\name{CPPevalHR} \alias{CPPevalHR} \title{Function to Evaluate CPP Hazard Rates} \description{A function to evaluate a (prior or posterior) sample of CPP hazard rates on a grid of time points.} \usage{CPPevalHR(time, sample)} \arguments{ \item{time}{vector of time points where the hazard rates in the sample should be...
#class object for mammpc output #Class mammpc.output #mammpc.output object # Function1: summary (generic for summary) # Function2: plot (generic for plot) #defining the class setOldClass('proc_time') setClass(Class='mammpc.output', slots=list(selectedVars='numeric', selectedVarsOrder='numeri...
/R/mammpc.output_script.R
no_license
cran/MXM
R
false
false
4,353
r
#class object for mammpc output #Class mammpc.output #mammpc.output object # Function1: summary (generic for summary) # Function2: plot (generic for plot) #defining the class setOldClass('proc_time') setClass(Class='mammpc.output', slots=list(selectedVars='numeric', selectedVarsOrder='numeri...
#!/usr/bin/env Rscript # consider testing with different rarification methods later ? options(error=recover) library(ape) library(phangorn) library(vegan) originalPar <- par() source("../metrics.r") replicates <- 5 extraReplicates <- 10 darkorchid <- col2rgb("darkorchid4") transparentdarkorchid <- rgb(darkorchi...
/clr_vs_proportion_unifrac/different_datasets_test/separation_comparison.r
no_license
ruthgrace/CLRUniFrac
R
false
false
49,640
r
#!/usr/bin/env Rscript # consider testing with different rarification methods later ? options(error=recover) library(ape) library(phangorn) library(vegan) originalPar <- par() source("../metrics.r") replicates <- 5 extraReplicates <- 10 darkorchid <- col2rgb("darkorchid4") transparentdarkorchid <- rgb(darkorchi...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/UniChar.R \name{vtest.UniChar} \alias{vtest.UniChar} \title{v.test} \usage{ vtest.UniChar(obj, y, label) } \arguments{ \item{obj}{of UniChar class} \item{y}{a data frame representing groups from a clustering process on obj$data} \item{label...
/man/vtest.UniChar.Rd
no_license
PaulineLne/ClusterChar
R
false
true
680
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/UniChar.R \name{vtest.UniChar} \alias{vtest.UniChar} \title{v.test} \usage{ vtest.UniChar(obj, y, label) } \arguments{ \item{obj}{of UniChar class} \item{y}{a data frame representing groups from a clustering process on obj$data} \item{label...
## Put comments here that give an overall description of what your ## functions do # "makeCacheMatrix" fucntion creates a special matrix # which can make and cache its inverse # "cacheSolve" fucnition should compute the inverse of the matrix returned by makeCacheMatrix # if the inverse has already been calculated (an...
/cachematrix.R
no_license
calmardent/ProgrammingAssignment2
R
false
false
1,364
r
## Put comments here that give an overall description of what your ## functions do # "makeCacheMatrix" fucntion creates a special matrix # which can make and cache its inverse # "cacheSolve" fucnition should compute the inverse of the matrix returned by makeCacheMatrix # if the inverse has already been calculated (an...
## ---- ext1 print("#########setup#########TODO: need to incorporate motion parameters!") istest<-FALSE subject<-"111157" datadir<-paste("/Users/stnava/data/KRNS/",subject,"/",sep='') tr<-as.numeric(0.5) responselength<-8/tr # e.g. 15 seconds div by 0.5 tr => 30 volumes labs<-as.numeric(1:90) # label numbers to use ......
/demo/setup.R
no_license
stnava/RKRNS
R
false
false
1,432
r
## ---- ext1 print("#########setup#########TODO: need to incorporate motion parameters!") istest<-FALSE subject<-"111157" datadir<-paste("/Users/stnava/data/KRNS/",subject,"/",sep='') tr<-as.numeric(0.5) responselength<-8/tr # e.g. 15 seconds div by 0.5 tr => 30 volumes labs<-as.numeric(1:90) # label numbers to use ......
# URLs # Women: https://en.wikipedia.org/wiki/List_of_Olympic_medalists_in_athletics_(women) # Men: https://en.wikipedia.org/wiki/List_of_Olympic_medalists_in_athletics_(men) # TO DO: # - Extract table of results from wikipedia pages (current & discontinued events) library(httr) library(XML) men <- 'https://en.wik...
/get_mens_results.R
permissive
wjsutton/olympic_athletics
R
false
false
2,043
r
# URLs # Women: https://en.wikipedia.org/wiki/List_of_Olympic_medalists_in_athletics_(women) # Men: https://en.wikipedia.org/wiki/List_of_Olympic_medalists_in_athletics_(men) # TO DO: # - Extract table of results from wikipedia pages (current & discontinued events) library(httr) library(XML) men <- 'https://en.wik...
#libraries used library(dplyr) library(outliers) library(ggplot2) #Functions used while preprocessing #Since many of the missing NA values for the pumps are in "blocks" since the pumps are not alternationg on and off very frequently #This is used to put NA values to the value above them basic_categorical_replacer <- ...
/data_cleaner.r
no_license
Tanner0397/CS5402_Project_PartOne
R
false
false
8,687
r
#libraries used library(dplyr) library(outliers) library(ggplot2) #Functions used while preprocessing #Since many of the missing NA values for the pumps are in "blocks" since the pumps are not alternationg on and off very frequently #This is used to put NA values to the value above them basic_categorical_replacer <- ...
#' #' @title A function to generate m-surroundings #' @usage m.surround(x, m, r = 1, distance = "Euclidean", control = list()) #' @param x input sf object with points/multipolygons geometry or matrix #' of spatial coordinates #' @param m dimension of m-surrounding #' @param r maximum overlapping between any tw...
/R/m.surround.R
permissive
f8l5h9/spqdep
R
false
false
10,875
r
#' #' @title A function to generate m-surroundings #' @usage m.surround(x, m, r = 1, distance = "Euclidean", control = list()) #' @param x input sf object with points/multipolygons geometry or matrix #' of spatial coordinates #' @param m dimension of m-surrounding #' @param r maximum overlapping between any tw...
# app.yaml # reads builds specs # returns a key value pair list object for each slide requested require(yaml) require(R6) appyaml_location <- c("~/ppt-r/user/app.yaml") Appyaml <- R6Class("Appyaml", private = list( ..outline = read_yaml(file = appyaml_location, fileEncoding = ...
/fn/yaml.r
no_license
acamposc/ppt-r
R
false
false
494
r
# app.yaml # reads builds specs # returns a key value pair list object for each slide requested require(yaml) require(R6) appyaml_location <- c("~/ppt-r/user/app.yaml") Appyaml <- R6Class("Appyaml", private = list( ..outline = read_yaml(file = appyaml_location, fileEncoding = ...
### Functions lifted from spliceR by KVS 2018-03-06 if(TRUE) { ### C functions copied from R 1.9.0 ### Auxillary spliceR functions if(TRUE) { ### Filter functions ### # Filter 1: only test genes with OK status (cufflinks specific) .filterOKGenes <- function(dataList, isoIndex) { ...
/R/analyze_alternative_splicing.R
no_license
alexg9010/IsoformSwitchAnalyzeR
R
false
false
142,913
r
### Functions lifted from spliceR by KVS 2018-03-06 if(TRUE) { ### C functions copied from R 1.9.0 ### Auxillary spliceR functions if(TRUE) { ### Filter functions ### # Filter 1: only test genes with OK status (cufflinks specific) .filterOKGenes <- function(dataList, isoIndex) { ...
#read "survey_new.csv" survey <- read.csv("data/survey_new.csv") #Experience with: R, data manipulation and modeling #to order the facet grid values survey$Programming.and.Analytical.Experiences..R..data.manipulation.and.modeling. <- factor(survey$Programming.and.Analytical.Experiences..R..data.manipulation.and.modeli...
/test/DataChecks.R
permissive
jsafyan/edav-project-1
R
false
false
4,004
r
#read "survey_new.csv" survey <- read.csv("data/survey_new.csv") #Experience with: R, data manipulation and modeling #to order the facet grid values survey$Programming.and.Analytical.Experiences..R..data.manipulation.and.modeling. <- factor(survey$Programming.and.Analytical.Experiences..R..data.manipulation.and.modeli...
library(dplyr) library(tidyr) library(lubridate) library(gdata) ener <- as_data_frame(read.xls("workshops/02 WPI 2017/data/energy/IrelandData January 2017.xlsx"), stringsAsFactors=F) ener <- mutate(ener, DateTime = ymd_hms(DateTime), HourOfDay = hour(DateTime), ...
/workshops/02 WPI 2017/data/02 Manipulation.R
permissive
mohammad-miftakhus-sholikin/SDMR
R
false
false
1,521
r
library(dplyr) library(tidyr) library(lubridate) library(gdata) ener <- as_data_frame(read.xls("workshops/02 WPI 2017/data/energy/IrelandData January 2017.xlsx"), stringsAsFactors=F) ener <- mutate(ener, DateTime = ymd_hms(DateTime), HourOfDay = hour(DateTime), ...
#Temperature rm(list = ls()) library(ggplot2) setwd("~/Desktop/MOODIES/data/alltemps") Acadia.Temp <- read.csv("ACADIA.csv") Hatteras.Temp <- read.csv("HATTERAS.csv") Kenai.Temp <- read.csv("KENAI.csv") Olympic.Temp <- read.csv("OLYMPIC.csv") Padre.Temp <- read.csv("PADRE.csv") Acadia.Month = round(12*(Acadia.Temp$D...
/temperature.R
no_license
nosyarg/MOODIES
R
false
false
7,848
r
#Temperature rm(list = ls()) library(ggplot2) setwd("~/Desktop/MOODIES/data/alltemps") Acadia.Temp <- read.csv("ACADIA.csv") Hatteras.Temp <- read.csv("HATTERAS.csv") Kenai.Temp <- read.csv("KENAI.csv") Olympic.Temp <- read.csv("OLYMPIC.csv") Padre.Temp <- read.csv("PADRE.csv") Acadia.Month = round(12*(Acadia.Temp$D...
#' set_unitList #' #' Define custom units, including new unitTypes. Note that it is not necessary to define #' most common units. #' #' @param units a data.frame describing the custom units, see details. #' @param unitTypes optional, a data.frame defining any additional unitTypes not already defined #' @param as_met...
/R/set_unitList.R
permissive
scelmendorf/eml2
R
false
false
4,828
r
#' set_unitList #' #' Define custom units, including new unitTypes. Note that it is not necessary to define #' most common units. #' #' @param units a data.frame describing the custom units, see details. #' @param unitTypes optional, a data.frame defining any additional unitTypes not already defined #' @param as_met...
makeCacheMatrix <- function(x = matrix()) { s <- NULL set <- function(y) { x <<- y s <<- NULL } get <- function() x setsolve <- function(solve) s <<- inverse getsolve <- function() s list(set = set, get = get, ...
/W3_Assignment.R
no_license
yukesing/boop
R
false
false
875
r
makeCacheMatrix <- function(x = matrix()) { s <- NULL set <- function(y) { x <<- y s <<- NULL } get <- function() x setsolve <- function(solve) s <<- inverse getsolve <- function() s list(set = set, get = get, ...
library(RTransProb) ### Name: cohort.TTC ### Title: Cohort - Data Weighting and "TTC" Calculation ### Aliases: cohort.TTC ### ** Examples ## Not run: ##D ##D #Set parameters ##D startDate <- "2000-01-01" ##D endDate <- "2005-01-01" ##D method <- "cohort" ##D snapshots <- 4 ##D interval <- .25 ##D...
/data/genthat_extracted_code/RTransProb/examples/cohort.TTC.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
604
r
library(RTransProb) ### Name: cohort.TTC ### Title: Cohort - Data Weighting and "TTC" Calculation ### Aliases: cohort.TTC ### ** Examples ## Not run: ##D ##D #Set parameters ##D startDate <- "2000-01-01" ##D endDate <- "2005-01-01" ##D method <- "cohort" ##D snapshots <- 4 ##D interval <- .25 ##D...
sampleinfo <- read.csv("/Users/mmosmond/Documents/PHD/biol525D/Topic_8-9/biol525D_popinfo.csv",header=T) #data name and directory name <- "/Users/mmosmond/Documents/PHD/biol525D/Topic_8-9/biol525D" vcf_filename<- c("/Users/mmosmond/Documents/PHD/biol525D/Topic_8-9/biol525D.snps.vcf") gds_filename<- c("/Users/mmosmond/...
/Topic_8-9/gooddirs.R
permissive
mmosmond/biol525D
R
false
false
4,624
r
sampleinfo <- read.csv("/Users/mmosmond/Documents/PHD/biol525D/Topic_8-9/biol525D_popinfo.csv",header=T) #data name and directory name <- "/Users/mmosmond/Documents/PHD/biol525D/Topic_8-9/biol525D" vcf_filename<- c("/Users/mmosmond/Documents/PHD/biol525D/Topic_8-9/biol525D.snps.vcf") gds_filename<- c("/Users/mmosmond/...
context("bind_parameters") test_that("bind_parameters", { expect_identical(parameters(bind_parameters(subset(coda::as.mcmc.list(mcmcr_example), parameter = "beta"), subset(coda::as.mcmc.list(mcmcr_example), parameter = "alpha"))), c("alpha", "beta")) expect_identical(parameters(bind_parameters(subset(mcmcr_example...
/data/genthat_extracted_code/mcmcr/tests/test-bind-parameters.R
no_license
surayaaramli/typeRrh
R
false
false
569
r
context("bind_parameters") test_that("bind_parameters", { expect_identical(parameters(bind_parameters(subset(coda::as.mcmc.list(mcmcr_example), parameter = "beta"), subset(coda::as.mcmc.list(mcmcr_example), parameter = "alpha"))), c("alpha", "beta")) expect_identical(parameters(bind_parameters(subset(mcmcr_example...
#Potential Turtle Size load(paste(paste("potential",Sys.Date(),sep="_"),"RData",sep=".")) potential <- as.vector(as.matrix(potential[,1])) order_size <- rep(0,length.out=length(potential)) last_price <- rep(0,length.out=length(potential)) range_size <- rep(0,length.out=length(potential)) #atr stop_loss <- rep(0,leng...
/Unconfirmed_Turtle.R
no_license
wzhtc/Renco_Quant_Trading
R
false
false
1,642
r
#Potential Turtle Size load(paste(paste("potential",Sys.Date(),sep="_"),"RData",sep=".")) potential <- as.vector(as.matrix(potential[,1])) order_size <- rep(0,length.out=length(potential)) last_price <- rep(0,length.out=length(potential)) range_size <- rep(0,length.out=length(potential)) #atr stop_loss <- rep(0,leng...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/package.R \name{safe_whisker} \alias{safe_whisker} \title{Workaround for whisker mishandling corner cases} \usage{ safe_whisker(template, ...) } \arguments{ \item{template}{Template.} \item{...}{Extra arguments to \code{whisker.render}.} } \...
/man/safe_whisker.Rd
permissive
MangoTheCat/myghrepos
R
false
true
403
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/package.R \name{safe_whisker} \alias{safe_whisker} \title{Workaround for whisker mishandling corner cases} \usage{ safe_whisker(template, ...) } \arguments{ \item{template}{Template.} \item{...}{Extra arguments to \code{whisker.render}.} } \...
#' @title Tree Species in a Swamp Forest #' #' @description Locations and species classification of trees in a plot in the Savannah River, SC, USA. #' Locations are given in meters, rounded to the nearest 0.1 decimal. #' The data come from a one-hectare (200-by-50m) plot in the Savannah River Site. #' The 734 mapp...
/R/data.R
no_license
cran/pcds
R
false
false
2,071
r
#' @title Tree Species in a Swamp Forest #' #' @description Locations and species classification of trees in a plot in the Savannah River, SC, USA. #' Locations are given in meters, rounded to the nearest 0.1 decimal. #' The data come from a one-hectare (200-by-50m) plot in the Savannah River Site. #' The 734 mapp...
testlist <- list(g = 0, z = 4.94065645841247e-323) result <- do.call(hmlasso:::softThresholdC,testlist) str(result)
/hmlasso/inst/testfiles/softThresholdC/libFuzzer_softThresholdC/softThresholdC_valgrind_files/1609897081-test.R
no_license
akhikolla/newtestfiles-2
R
false
false
115
r
testlist <- list(g = 0, z = 4.94065645841247e-323) result <- do.call(hmlasso:::softThresholdC,testlist) str(result)
##TODO(David): TSprotocol should attach a specific protocol to a subject/session # ## Note all outward facing functions take input as Data, all inward facing functions ## take input as df. # ##' Workhorse for creating and updating a TSExperiment ##' ##' @param ExperimentPath The path to the experiment folder ##' @param...
/TSExperiment/R/old_tsexperiment.R
permissive
dfreestone/TSLibrary
R
false
false
15,510
r
##TODO(David): TSprotocol should attach a specific protocol to a subject/session # ## Note all outward facing functions take input as Data, all inward facing functions ## take input as df. # ##' Workhorse for creating and updating a TSExperiment ##' ##' @param ExperimentPath The path to the experiment folder ##' @param...
#!/usr/bin/env Rscript main <- function(input, output, log) { # Log function out <- file(log$out, open = "wt") err <- file(log$err, open = "wt") sink(out, type = "output") sink(err, type = "message") # Script function library(ggforce) library(ggplot2) library(hues) dat...
/workflow/scripts/clustering/NNGraphSilhouettePlot.R
permissive
jma1991/DiasTailbudData
R
false
false
936
r
#!/usr/bin/env Rscript main <- function(input, output, log) { # Log function out <- file(log$out, open = "wt") err <- file(log$err, open = "wt") sink(out, type = "output") sink(err, type = "message") # Script function library(ggforce) library(ggplot2) library(hues) dat...
data("iris") head(iris) stripchart(iris$Sepal.Length) stripchart(jitter(iris$Sepal.Length)) stripchart(iris$Sepal.Length, method = "stack") stripchart(iris$Sepal.Length, method = "stack", pch = 14) hist(iris$Sepal.Length) hist(iris$Sepal.Length, breaks = 20) hist(iris$Sepal.Length, breaks = 20, xlim = c(4, 8.5)) lin...
/Semestre Otoño 2018/Imanol/graficas.R
no_license
AdrianTJ/Intro-R-Primavera2019
R
false
false
1,481
r
data("iris") head(iris) stripchart(iris$Sepal.Length) stripchart(jitter(iris$Sepal.Length)) stripchart(iris$Sepal.Length, method = "stack") stripchart(iris$Sepal.Length, method = "stack", pch = 14) hist(iris$Sepal.Length) hist(iris$Sepal.Length, breaks = 20) hist(iris$Sepal.Length, breaks = 20, xlim = c(4, 8.5)) lin...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/phytoFilterClass.R \name{is.PhytopFilter} \alias{is.PhytopFilter} \title{function to check if object is of class cyanoFilter(PhytoFilter)} \usage{ is.PhytopFilter(x) } \arguments{ \item{x}{any R object} } \value{ TRUE if object is of class Ph...
/man/is.PhytopFilter.Rd
no_license
fomotis/cyanoFilter
R
false
true
481
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/phytoFilterClass.R \name{is.PhytopFilter} \alias{is.PhytopFilter} \title{function to check if object is of class cyanoFilter(PhytoFilter)} \usage{ is.PhytopFilter(x) } \arguments{ \item{x}{any R object} } \value{ TRUE if object is of class Ph...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gemIntertemporal_1_2.R \name{gemIntertemporal_1_2} \alias{gemIntertemporal_1_2} \title{An Example of a 1-by-2 Intertemporal Equilibrium Model} \usage{ gemIntertemporal_1_2(...) } \arguments{ \item{...}{arguments to be passed to the function s...
/man/gemIntertemporal_1_2.Rd
no_license
cran/GE
R
false
true
1,826
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gemIntertemporal_1_2.R \name{gemIntertemporal_1_2} \alias{gemIntertemporal_1_2} \title{An Example of a 1-by-2 Intertemporal Equilibrium Model} \usage{ gemIntertemporal_1_2(...) } \arguments{ \item{...}{arguments to be passed to the function s...
# this is an r script 2+2 getwd() setwd("/Users/thesmithfamily/GitHub/UCLA-QBC/In-Class-Excercises") xx <- 2 22-> yy # you can assign both directions # from ?lm there is an example, if you use the example and you are still confused you can highlight and examine each part (ie "weight") grad.school.tips <- c("use ...
/In-Class-Excercises/9-14_Morning.R
no_license
lalsmith/UCLA-QBC
R
false
false
2,844
r
# this is an r script 2+2 getwd() setwd("/Users/thesmithfamily/GitHub/UCLA-QBC/In-Class-Excercises") xx <- 2 22-> yy # you can assign both directions # from ?lm there is an example, if you use the example and you are still confused you can highlight and examine each part (ie "weight") grad.school.tips <- c("use ...
# The following function compares before and after samples and calculates enrichment scores # input_df_x=TP3D2 # input_df_y=TP3D6 compare_samples=function(input_df_x, input_df_y, netgr_wodrug=0.055, #In inverse hours, duration=48){ #In hours ...
/code/compare_samples.R
no_license
haiderinam/duplex_sequencing_screen
R
false
false
1,428
r
# The following function compares before and after samples and calculates enrichment scores # input_df_x=TP3D2 # input_df_y=TP3D6 compare_samples=function(input_df_x, input_df_y, netgr_wodrug=0.055, #In inverse hours, duration=48){ #In hours ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gof.R \name{gof} \alias{gof} \title{Goodness of fit based on left-truncated regression model} \usage{ gof(x, B = 200, P = 1) } \arguments{ \item{x}{an object of class \code{trSurvfit} returned by the \code{trSurvfit()} or the \code{trReg()} f...
/man/gof.Rd
no_license
stc04003/tranSurv
R
false
true
2,823
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gof.R \name{gof} \alias{gof} \title{Goodness of fit based on left-truncated regression model} \usage{ gof(x, B = 200, P = 1) } \arguments{ \item{x}{an object of class \code{trSurvfit} returned by the \code{trSurvfit()} or the \code{trReg()} f...
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function ## This Function returns list that contains functions associated ## with given matrix x. Function setsolve sets inverse of matrix x ## and function getsolve lets you get its value within...
/cachematrix.R
no_license
Aniaw81/ProgrammingAssignment2
R
false
false
1,284
r
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function ## This Function returns list that contains functions associated ## with given matrix x. Function setsolve sets inverse of matrix x ## and function getsolve lets you get its value within...
# Intrinio API # # Welcome to the Intrinio API! Through our Financial Data Marketplace, we offer a wide selection of financial data feed APIs sourced by our own proprietary processes as well as from many data vendors. For a complete API request / response reference please view the [Intrinio API documentation](https://d...
/R/InsiderTransactionFilingsApi.r
no_license
intrinio/r-sdk
R
false
false
3,699
r
# Intrinio API # # Welcome to the Intrinio API! Through our Financial Data Marketplace, we offer a wide selection of financial data feed APIs sourced by our own proprietary processes as well as from many data vendors. For a complete API request / response reference please view the [Intrinio API documentation](https://d...