content
large_stringlengths
0
6.46M
path
large_stringlengths
3
331
license_type
large_stringclasses
2 values
repo_name
large_stringlengths
5
125
language
large_stringclasses
1 value
is_vendor
bool
2 classes
is_generated
bool
2 classes
length_bytes
int64
4
6.46M
extension
large_stringclasses
75 values
text
stringlengths
0
6.46M
library(shiny) library(plotly) library(sqldf) library(shinythemes) list<-read.csv('pokemonGO.csv') list$Name<-as.character(list$Name) list[29,2]<-'Nidoran' list<-list[-32,] shinyUI(fluidPage(theme = shinytheme("slate"), titlePanel('Pokemon Go EDA'), sidebarLayout( ...
/PokemonGo/ui.R
no_license
jindal2309/KaggleCompetition
R
false
false
3,299
r
library(shiny) library(plotly) library(sqldf) library(shinythemes) list<-read.csv('pokemonGO.csv') list$Name<-as.character(list$Name) list[29,2]<-'Nidoran' list<-list[-32,] shinyUI(fluidPage(theme = shinytheme("slate"), titlePanel('Pokemon Go EDA'), sidebarLayout( ...
## Association Rules ########## Book Data Set ######### library(arules) book<-read.transactions("C:\\Users\\Nik\\Downloads\\book (2).csv",format="basket") inspect(book[1:10]) class(book) # itemFrequencyPlot can be applicable only for transaction data # count of each item from all the transactions itemFreque...
/Association Rules - Book Dataset.R
no_license
Nikanksha/Association-Rules
R
false
false
1,076
r
## Association Rules ########## Book Data Set ######### library(arules) book<-read.transactions("C:\\Users\\Nik\\Downloads\\book (2).csv",format="basket") inspect(book[1:10]) class(book) # itemFrequencyPlot can be applicable only for transaction data # count of each item from all the transactions itemFreque...
source('util.R') package_list <- list('devtools', 'data.table', 'ggplot2') # Load and execute specified libraries load_or_install(package_list) ### Read in command line arguments ### arg_len <- 5 args <- commandArgs(TRUE) # print(args) if (length(args) != arg_len) { stop(sprintf('Must supply %i arguments -- you ...
/scripts/R/06_post_modeling_analysis.R
no_license
ctcovington/ml_pipeline_prototype
R
false
false
5,311
r
source('util.R') package_list <- list('devtools', 'data.table', 'ggplot2') # Load and execute specified libraries load_or_install(package_list) ### Read in command line arguments ### arg_len <- 5 args <- commandArgs(TRUE) # print(args) if (length(args) != arg_len) { stop(sprintf('Must supply %i arguments -- you ...
library(radiant.data) ### Name: iterms ### Title: Create a vector of interaction terms ### Aliases: iterms ### ** Examples paste0("var", 1:3) %>% iterms(2) paste0("var", 1:3) %>% iterms(3) paste0("var", 1:3) %>% iterms(2, sep = ".")
/data/genthat_extracted_code/radiant.data/examples/iterms.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
241
r
library(radiant.data) ### Name: iterms ### Title: Create a vector of interaction terms ### Aliases: iterms ### ** Examples paste0("var", 1:3) %>% iterms(2) paste0("var", 1:3) %>% iterms(3) paste0("var", 1:3) %>% iterms(2, sep = ".")
% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/ModelA_D.R \name{calcResid} \alias{calcResid} \title{Forward calculation for residual only} \usage{ calcResid(par, data, cModel, fixParms, fixInis, transParms, sepn, ...) } \arguments{ \item{par}{parameters} \item{data}{data frame} ...
/man/calcResid.Rd
no_license
zhenglei-gao/SedimentWater
R
false
false
607
rd
% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/ModelA_D.R \name{calcResid} \alias{calcResid} \title{Forward calculation for residual only} \usage{ calcResid(par, data, cModel, fixParms, fixInis, transParms, sepn, ...) } \arguments{ \item{par}{parameters} \item{data}{data frame} ...
# Check if data exists in working directory (or sub directories) # if not download data # create vector of ALL file paths file_list<-list.files(getwd(), all.files=TRUE, full.names=TRUE, recursive=TRUE) # check if "household power consumption.txt" file exists exists = sum(grepl("household_power_consumption.txt", ...
/plot2.R
no_license
WongD/ExData_Plotting1
R
false
false
2,057
r
# Check if data exists in working directory (or sub directories) # if not download data # create vector of ALL file paths file_list<-list.files(getwd(), all.files=TRUE, full.names=TRUE, recursive=TRUE) # check if "household power consumption.txt" file exists exists = sum(grepl("household_power_consumption.txt", ...
############################################ # Flatfish Harvest Control Rule MSE # #Load in the files from the Operating Model# # and the estimation model. # # # # Plotting and Reporting # # Created January 13, 2016 by # # Chantel Wetzel ...
/Defense_plots.R
no_license
chantelwetzel-noaa/Chapter4_HCR
R
false
false
17,284
r
############################################ # Flatfish Harvest Control Rule MSE # #Load in the files from the Operating Model# # and the estimation model. # # # # Plotting and Reporting # # Created January 13, 2016 by # # Chantel Wetzel ...
#' @title Timestamp classifier #' @description Get the timestamp classifier of an object of class \code{eventlog} #' @param x An \code{eventlog} of \code{eventlog_mapping} #' @seealso \code{\link{eventlog}}, \code{\link{mapping}} #' @family Eventlog classifiers #' @export timestamp <- function(x) { UseMethod("...
/R/timestamp.R
no_license
analyzethat/bupaR
R
false
false
648
r
#' @title Timestamp classifier #' @description Get the timestamp classifier of an object of class \code{eventlog} #' @param x An \code{eventlog} of \code{eventlog_mapping} #' @seealso \code{\link{eventlog}}, \code{\link{mapping}} #' @family Eventlog classifiers #' @export timestamp <- function(x) { UseMethod("...
"============================================================ Title : RBM vs AE vs CNN Updates : 20200718 ============================================================" rm(list = ls()) #========================================================================= # 0. 패키지 로드 #=====================================...
/on_site_training/8. 딥러닝 알고리즘 강화학습 - 김도현 대표/2.Practice1/1.RBM_AE_CNN.R
no_license
soykim-snail/Begas-BigDataTraining
R
false
false
10,549
r
"============================================================ Title : RBM vs AE vs CNN Updates : 20200718 ============================================================" rm(list = ls()) #========================================================================= # 0. 패키지 로드 #=====================================...
#' Build a data frame or list. #' #' @description #' `tibble()` is a trimmed down version of [data.frame()] that: #' #' * Never coerces inputs (i.e. strings stay as strings!). #' * Never adds `row.names`. #' * Never munges column names. #' * Only recycles length 1 inputs. #' * Evaluates its arguments lazily and in orde...
/R/tibble.R
no_license
fomenkosmart/tibble
R
false
false
3,683
r
#' Build a data frame or list. #' #' @description #' `tibble()` is a trimmed down version of [data.frame()] that: #' #' * Never coerces inputs (i.e. strings stay as strings!). #' * Never adds `row.names`. #' * Never munges column names. #' * Only recycles length 1 inputs. #' * Evaluates its arguments lazily and in orde...
# # vim:set ff=unix expandtab ts=2 sw=2: vecFuncMaker=function# creates a vector valued function from the functions for the components ### The function is a helper to create a vector valued function of two arguments which is very useful to create systems of ode ( funcs, ##<< The list of functions computing the vector c...
/pkg/R/vecFuncMaker.R
no_license
Dong-po/SoilR-exp
R
false
false
698
r
# # vim:set ff=unix expandtab ts=2 sw=2: vecFuncMaker=function# creates a vector valued function from the functions for the components ### The function is a helper to create a vector valued function of two arguments which is very useful to create systems of ode ( funcs, ##<< The list of functions computing the vector c...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/model_select.R \name{model_select} \alias{model_select} \title{Fit multiple models and select the best fit} \usage{ model_select( x, models = univariateML_models, criterion = c("aic", "bic", "loglik"), na.rm = FALSE, ... ...
/man/model_select.Rd
no_license
cran/univariateML
R
false
true
1,556
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/model_select.R \name{model_select} \alias{model_select} \title{Fit multiple models and select the best fit} \usage{ model_select( x, models = univariateML_models, criterion = c("aic", "bic", "loglik"), na.rm = FALSE, ... ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/R2ReasyR_functions.R \name{r2easyR.write} \alias{r2easyR.write} \title{Generates a Stockholm file and a R2R meta file that can be read by R2R to draw a secondary structure.} \usage{ r2easyR.write(output, data_frame, RNA_name = "default"...
/man/r2easyR.write.Rd
permissive
JPSieg/R2easyR
R
false
true
874
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/R2ReasyR_functions.R \name{r2easyR.write} \alias{r2easyR.write} \title{Generates a Stockholm file and a R2R meta file that can be read by R2R to draw a secondary structure.} \usage{ r2easyR.write(output, data_frame, RNA_name = "default"...
set.seed(2) x <- matrix(rnorm(50 * 2), ncol = 2) x[1:25, 1] <- x[1:25, 1] + 3 x[1:25, 2] <- x[1:25, 2] - 4 km.out <- kmeans(x, 2, nstart = 20) km.out$cluster plot(x, col = (km.out$cluster + 1), main = "K-Means Clustering Results with K=2", xlab = "", ylab = "", pch = 20, cex = 2) km.out$centers points(km...
/R语言数据分析与挖掘实战/第五章/kmeans_example.R
no_license
xiaogang00/R-and-machine-learning
R
false
false
480
r
set.seed(2) x <- matrix(rnorm(50 * 2), ncol = 2) x[1:25, 1] <- x[1:25, 1] + 3 x[1:25, 2] <- x[1:25, 2] - 4 km.out <- kmeans(x, 2, nstart = 20) km.out$cluster plot(x, col = (km.out$cluster + 1), main = "K-Means Clustering Results with K=2", xlab = "", ylab = "", pch = 20, cex = 2) km.out$centers points(km...
library(UsingR) data(galton) shinyServer( function(input, output) { output$myHist <- renderPlot({ hist(galton$child, xlab='child height', col='lightblue',main='Histogram') mu <- input$mu lines(c(mu, mu), c(0, 200),col="red",lwd=5) mse <- mean((galton$child - ...
/q1q5/server.R
no_license
philallen117/data-products
R
false
false
453
r
library(UsingR) data(galton) shinyServer( function(input, output) { output$myHist <- renderPlot({ hist(galton$child, xlab='child height', col='lightblue',main='Histogram') mu <- input$mu lines(c(mu, mu), c(0, 200),col="red",lwd=5) mse <- mean((galton$child - ...
#' Calculate averages (e.g. ERPs) for single datasets #' #' This function is used to create an \code{eeg_evoked} object from #' \code{eeg_epochs}. #' #' @param data An \code{eeg_epochs} object. #' @param ... Other arguments passed to the averaging functions #' @author Matt craddock \email{matt@@mattcraddock.com} #' @ex...
/R/data_averaging.R
permissive
dannydaniel/eegUtils
R
false
false
6,468
r
#' Calculate averages (e.g. ERPs) for single datasets #' #' This function is used to create an \code{eeg_evoked} object from #' \code{eeg_epochs}. #' #' @param data An \code{eeg_epochs} object. #' @param ... Other arguments passed to the averaging functions #' @author Matt craddock \email{matt@@mattcraddock.com} #' @ex...
### R code from vignette source 'Ch_multiple_linear_regression.Rnw' ################################################### ### code chunk number 1: setup ################################################### rm(list = ls()) s <- search()[-1] s <- s[-match(c("package:base", "package:stats", "package:graphics", "package:grDe...
/HSAUR2/doc/Ch_multiple_linear_regression.R
permissive
solgenomics/R_libs
R
false
false
8,412
r
### R code from vignette source 'Ch_multiple_linear_regression.Rnw' ################################################### ### code chunk number 1: setup ################################################### rm(list = ls()) s <- search()[-1] s <- s[-match(c("package:base", "package:stats", "package:graphics", "package:grDe...
#Importing the data dataset <- read.csv('Salary_Data.csv') #In this case Years of Experience is the indepedent variable and salary the dependent variable #install.packages('caTools') library(caTools) set.seed(123) split <- sample.split(dataset$Salary, SplitRatio = 2/3) training_set <- subset(dataset, split == TRUE) te...
/simple-linear-regression/YearsOfExperience vs Salary.r
permissive
iamdv/ml-atoz
R
false
false
1,456
r
#Importing the data dataset <- read.csv('Salary_Data.csv') #In this case Years of Experience is the indepedent variable and salary the dependent variable #install.packages('caTools') library(caTools) set.seed(123) split <- sample.split(dataset$Salary, SplitRatio = 2/3) training_set <- subset(dataset, split == TRUE) te...
#' Fish growth snippet from Katie's summer 2018 field work #' @format length is in mm, these are all integers #' @source Katie Zinn "Fish_data"
/FishGrowth/R/fish_data.R
no_license
katiezinn/Instantaneous_growth
R
false
false
150
r
#' Fish growth snippet from Katie's summer 2018 field work #' @format length is in mm, these are all integers #' @source Katie Zinn "Fish_data"
# Random forest classification rm(list=ls()) library(randomForest) library(rgdal) library(raster) train_csv_path = "/projectnb/landsat/users/shijuan/above/bh09v15/rand_forest/combined_csv.csv" img_dir = "/projectnb/landsat/projects/ABOVE/CCDC/Bh09v15/out_tc/" #img = "Bh09v15_dTC_2006.tif" #img_2006 = paste0(img_dir,...
/others/rand_forest_classify.R
no_license
fdbesanto2/ABOVE
R
false
false
1,078
r
# Random forest classification rm(list=ls()) library(randomForest) library(rgdal) library(raster) train_csv_path = "/projectnb/landsat/users/shijuan/above/bh09v15/rand_forest/combined_csv.csv" img_dir = "/projectnb/landsat/projects/ABOVE/CCDC/Bh09v15/out_tc/" #img = "Bh09v15_dTC_2006.tif" #img_2006 = paste0(img_dir,...
stoch.reg <- function(data, cols.full, cols.red, alpha, L, M, plot.which) { # nextn = stats::nextn kernel = stats::kernel qf = stats::qf plot = graphics::plot abline = graphics::abline # # SPEC[i,j,k] is the spectrum between the i-th and j-th series at frequency k/n': SPEC = array(dim = c(nc...
/R/stoch.reg.R
no_license
cran/astsa
R
false
false
3,366
r
stoch.reg <- function(data, cols.full, cols.red, alpha, L, M, plot.which) { # nextn = stats::nextn kernel = stats::kernel qf = stats::qf plot = graphics::plot abline = graphics::abline # # SPEC[i,j,k] is the spectrum between the i-th and j-th series at frequency k/n': SPEC = array(dim = c(nc...
#' Nonparametric Sobol Estimator with Bootstrap Bandwidth #' #' Algorithm to estimate the Sobol indices using a non-parametric #' fit of the regression curve. The bandwidth is estimated using #' bootstrap to reduce the finite-sample bias. #' #' @param Y Response continuous variable #' @param X Matrix of independent var...
/R/sobolnp.R
no_license
maikol-solis/sobolnp
R
false
false
10,225
r
#' Nonparametric Sobol Estimator with Bootstrap Bandwidth #' #' Algorithm to estimate the Sobol indices using a non-parametric #' fit of the regression curve. The bandwidth is estimated using #' bootstrap to reduce the finite-sample bias. #' #' @param Y Response continuous variable #' @param X Matrix of independent var...
\name{g1} \alias{g1} \title{g1 statistic for Skewness} \description{A common statistic for skewness. Called by the function sktable} \usage{g1(x) } \arguments{ \item{x}{The variable of interest}} \details{see Wright and Herrington (2011)} \references{ Wright, D.B. & Harrington, J.A. (2011, actual in press a...
/man/g1.Rd
no_license
cran/mrt
R
false
false
683
rd
\name{g1} \alias{g1} \title{g1 statistic for Skewness} \description{A common statistic for skewness. Called by the function sktable} \usage{g1(x) } \arguments{ \item{x}{The variable of interest}} \details{see Wright and Herrington (2011)} \references{ Wright, D.B. & Harrington, J.A. (2011, actual in press a...
# MARSHALL (CENTER FOR SYSTEMIC PEACE) COUP DATA # 2015-04-29 # Source: Center for Systemic Peace http://www.systemicpeace.org/inscr/CSPCoupsList2014.xls # Clear workspace rm(list=ls(all=TRUE)) # Get working directory wd <- getwd() # Load required packages and functions library(XLConnect) library(reshape) source(pa...
/R/data.cmm.R
no_license
EarlyWarningProject/2015-Statistical-Risk-Assessment
R
false
false
2,392
r
# MARSHALL (CENTER FOR SYSTEMIC PEACE) COUP DATA # 2015-04-29 # Source: Center for Systemic Peace http://www.systemicpeace.org/inscr/CSPCoupsList2014.xls # Clear workspace rm(list=ls(all=TRUE)) # Get working directory wd <- getwd() # Load required packages and functions library(XLConnect) library(reshape) source(pa...
#Robert A Brown #CS 581 ~ Homework 01 #University of Rhode Island learner <- function(training.df) { if (!is.data.frame(training.df)) stop("not a data frame") n <- ncol(training.df) target.attribute <- training.df[[n]] target.levels <- table(target.attribute) ix <- which.max(target.levels) majority.labe...
/01/1_4.r
no_license
rab170/SVMs
R
false
false
715
r
#Robert A Brown #CS 581 ~ Homework 01 #University of Rhode Island learner <- function(training.df) { if (!is.data.frame(training.df)) stop("not a data frame") n <- ncol(training.df) target.attribute <- training.df[[n]] target.levels <- table(target.attribute) ix <- which.max(target.levels) majority.labe...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/guardduty_operations.R \name{guardduty_delete_members} \alias{guardduty_delete_members} \title{Deletes GuardDuty member accounts (to the current GuardDuty administrator account) specified by the account IDs} \usage{ guardduty_delete_members(D...
/cran/paws.security.identity/man/guardduty_delete_members.Rd
permissive
sanchezvivi/paws
R
false
true
867
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/guardduty_operations.R \name{guardduty_delete_members} \alias{guardduty_delete_members} \title{Deletes GuardDuty member accounts (to the current GuardDuty administrator account) specified by the account IDs} \usage{ guardduty_delete_members(D...
dml_pliv_partial_z = function(data, y, d, z, n_folds, ml_r, dml_procedure, score, n_rep = 1, smpls=NULL, params_r = NULL) { if (is.null(smpls)) { smpls = lapply(1:n...
/tests/testthat/helper-14-dml_pliv_partial_z.R
no_license
k-segiet/doubleml-for-r
R
false
false
5,088
r
dml_pliv_partial_z = function(data, y, d, z, n_folds, ml_r, dml_procedure, score, n_rep = 1, smpls=NULL, params_r = NULL) { if (is.null(smpls)) { smpls = lapply(1:n...
# ---------------------------------------------------------------------------- # # Merge FinStress, WDI, OECD, Run basic regressions on FinStress Variance # Christopher Gandrud # MIT LICENSE # ---------------------------------------------------------------------------- # # Load required packages library(simpleSetup) ...
/B_analysts_sources_github/christophergandrud/predicting_finstress/finstress_predict_v1.R
no_license
Irbis3/crantasticScrapper
R
false
false
14,546
r
# ---------------------------------------------------------------------------- # # Merge FinStress, WDI, OECD, Run basic regressions on FinStress Variance # Christopher Gandrud # MIT LICENSE # ---------------------------------------------------------------------------- # # Load required packages library(simpleSetup) ...
#' Make request to Zillow API GetMonthlyPayments Web Service #' #' For a specific loan amount, the GetMonthlyPayments API returns the estimated #' monthly payment that includes principal and interest based on today's #' mortgage rate. The API returns the estimated monthly payment per loan type #' (30-year fixed, 15-ye...
/ZillowR/R/GetMonthlyPayments.R
no_license
jkosteck/South_Bend_Clustering
R
false
false
3,592
r
#' Make request to Zillow API GetMonthlyPayments Web Service #' #' For a specific loan amount, the GetMonthlyPayments API returns the estimated #' monthly payment that includes principal and interest based on today's #' mortgage rate. The API returns the estimated monthly payment per loan type #' (30-year fixed, 15-ye...
#!/bin/Rscript inputDir <-'readCounts/' outputDir <- 'DESeqOutput/' suppressMessages(library(DESeq2)) suppressMessages(library(apeglm)) for (i in list.files(inputDir)){ file<-read.csv(file=paste(inputDir,i,sep=''), header=TRUE, sep=",", row.names=1) sampleTable <- data.frame(condition = factor(c("Mock","Mock","Mock...
/transcriptomics/7_DESeq_Ath.R
no_license
fantin-mesny/Scripts-from-Mesny-et-al.-2021
R
false
false
1,214
r
#!/bin/Rscript inputDir <-'readCounts/' outputDir <- 'DESeqOutput/' suppressMessages(library(DESeq2)) suppressMessages(library(apeglm)) for (i in list.files(inputDir)){ file<-read.csv(file=paste(inputDir,i,sep=''), header=TRUE, sep=",", row.names=1) sampleTable <- data.frame(condition = factor(c("Mock","Mock","Mock...
## ----setup, include = FALSE--------------------------------------------------- if ("xaringan" %in% loadedNamespaces()) { options(htmltools.dir.version = FALSE) knitr::opts_chunk$set(fig.height = 5, fig.width = 6) xaringanExtra::use_tile_view() xaringanExtra::use_clipboard() xaringanExtra::use_sear...
/sibs.R
no_license
ltierney/SIBS-WV-2021
R
false
false
35,499
r
## ----setup, include = FALSE--------------------------------------------------- if ("xaringan" %in% loadedNamespaces()) { options(htmltools.dir.version = FALSE) knitr::opts_chunk$set(fig.height = 5, fig.width = 6) xaringanExtra::use_tile_view() xaringanExtra::use_clipboard() xaringanExtra::use_sear...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/OutcomeModels.R \name{fitOutcomeModel} \alias{fitOutcomeModel} \title{Create an outcome model, and compute the relative risk} \usage{ fitOutcomeModel( population, cohortMethodData = NULL, modelType = "logistic", stratified = FALSE, ...
/man/fitOutcomeModel.Rd
permissive
estone96/CohortMethod
R
false
true
2,769
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/OutcomeModels.R \name{fitOutcomeModel} \alias{fitOutcomeModel} \title{Create an outcome model, and compute the relative risk} \usage{ fitOutcomeModel( population, cohortMethodData = NULL, modelType = "logistic", stratified = FALSE, ...
library(nnet) data1=read.table("T6 NWP.txt" ) data2=read.table("T6 EXP.txt") x1=data1[,1] x2=data2[,1] length(x1) length(x2) #x2=2*x2; #df=data.frame(cbind(x1, x2)) rep1=30 # number of ensemble components nn=240 # sample size if training data nn2=384-nn #nn2=84 nn_bootstrap=samp...
/WATCFD_software/Rwindspeed_nnet/ws_nnet_bootstrap.R
permissive
younfor/windPredictSystem
R
false
false
12,047
r
library(nnet) data1=read.table("T6 NWP.txt" ) data2=read.table("T6 EXP.txt") x1=data1[,1] x2=data2[,1] length(x1) length(x2) #x2=2*x2; #df=data.frame(cbind(x1, x2)) rep1=30 # number of ensemble components nn=240 # sample size if training data nn2=384-nn #nn2=84 nn_bootstrap=samp...
# 1. Natural logarithm of 5 # 2. Square root of 121 # 3. Absolute value of 10 and -11 # 4. 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 (the factorial of 8) # 5. Round pi (3.141593) to 3 decimal places # 6. The lograithm of 100 to the base 10 # 7. The exponential of 4 # 8. Print your name using the message functi...
/ex12.R
no_license
Yuyu19/data-science-for-demography-
R
false
false
326
r
# 1. Natural logarithm of 5 # 2. Square root of 121 # 3. Absolute value of 10 and -11 # 4. 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 (the factorial of 8) # 5. Round pi (3.141593) to 3 decimal places # 6. The lograithm of 100 to the base 10 # 7. The exponential of 4 # 8. Print your name using the message functi...
library(reshape) library(ggplot2) library(plyr) library(gtools) #source('~/Documents/Rscripts/120704-sortDataFrame.R') # Intialise the package at the end by building a list containing all the functions in this script # Transpose the 384 well map (tab text) using a python script and output into another file transposeL...
/Templates/qPCRFunctions.R
no_license
dvbrown/Rscripts
R
false
false
8,821
r
library(reshape) library(ggplot2) library(plyr) library(gtools) #source('~/Documents/Rscripts/120704-sortDataFrame.R') # Intialise the package at the end by building a list containing all the functions in this script # Transpose the 384 well map (tab text) using a python script and output into another file transposeL...
# Day 8 - boot computer with R6 library(tidyverse) library(R6) # https://r6.r-lib.org/articles/Introduction.html # a program is a series of instructions # A computer runs a program Computer <- R6Class("Computer", public = list( # binding to be initialized pgm = NULL, line = NULL, ...
/aoc2020_day8_R6.R
no_license
nalsalam/aoc2020
R
false
false
3,000
r
# Day 8 - boot computer with R6 library(tidyverse) library(R6) # https://r6.r-lib.org/articles/Introduction.html # a program is a series of instructions # A computer runs a program Computer <- R6Class("Computer", public = list( # binding to be initialized pgm = NULL, line = NULL, ...
#' Parsimony score of random postorder tree #' #' @param nTip number of tips (minimum 3) #' @template morphyObjParam #' #' @return the parsimony score of a random tree, for the given Morphy object. #' #' @export RandomTreeScore <- function (nTip, morphyObj) { if (nTip < 3) { warning("nTip < 3 not implemented, ...
/R/RandomTreeScore.R
no_license
gitter-badger/TreeSearch
R
false
false
1,448
r
#' Parsimony score of random postorder tree #' #' @param nTip number of tips (minimum 3) #' @template morphyObjParam #' #' @return the parsimony score of a random tree, for the given Morphy object. #' #' @export RandomTreeScore <- function (nTip, morphyObj) { if (nTip < 3) { warning("nTip < 3 not implemented, ...
# input으로 Pooled vehicles이 들어왔을 때 각 차량들의 좌표값을 계산 # 이 좌표값에 따라 차량들이 움직일 수 있도록 # X_intra_relo; Y_intra_relo IntraZonalPositionCalculator <- function(PoolVehicle,type="intra_s1",time){ if (type=="intra_s1"){ num_pod_per_grid<-data.frame(table(PoolVehicle$grid_id)) colnames(num_pod_per_grid)<-c("grid_id","num_po...
/module/utils/IntraZonalPositionCalculator.R
no_license
jihoyeo/taxi-relocation
R
false
false
3,569
r
# input으로 Pooled vehicles이 들어왔을 때 각 차량들의 좌표값을 계산 # 이 좌표값에 따라 차량들이 움직일 수 있도록 # X_intra_relo; Y_intra_relo IntraZonalPositionCalculator <- function(PoolVehicle,type="intra_s1",time){ if (type=="intra_s1"){ num_pod_per_grid<-data.frame(table(PoolVehicle$grid_id)) colnames(num_pod_per_grid)<-c("grid_id","num_po...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/aggregate.R \name{aggregate.stars} \alias{aggregate.stars} \title{spatially or temporally aggregate stars object} \usage{ \method{aggregate}{stars}(x, by, FUN, ..., drop = FALSE, join = st_intersects, as_points = any(st_dimension(by) == 2, ...
/man/aggregate.stars.Rd
permissive
flahn/stars
R
false
true
2,575
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/aggregate.R \name{aggregate.stars} \alias{aggregate.stars} \title{spatially or temporally aggregate stars object} \usage{ \method{aggregate}{stars}(x, by, FUN, ..., drop = FALSE, join = st_intersects, as_points = any(st_dimension(by) == 2, ...
library("testthat") library("syberiaMungebits2") test_check("syberiaMungebits2")
/tests/test-all.R
permissive
syberia/syberiaMungebits2
R
false
false
81
r
library("testthat") library("syberiaMungebits2") test_check("syberiaMungebits2")
#' Tibble for intervals. #' #' Required column names are `chrom`, `start` and `end`. #' #' @param x A `data_frame` #' @param ... params for [tibble::tibble()] #' @param .validate check valid column names #' #' @rdname tbl_interval #' #' @examples #' x <- tibble::tribble( #' ~chrom, ~start, ~end, #' 'chr1', 1, ...
/R/tbls.r
permissive
romainfrancois/valr
R
false
false
5,501
r
#' Tibble for intervals. #' #' Required column names are `chrom`, `start` and `end`. #' #' @param x A `data_frame` #' @param ... params for [tibble::tibble()] #' @param .validate check valid column names #' #' @rdname tbl_interval #' #' @examples #' x <- tibble::tribble( #' ~chrom, ~start, ~end, #' 'chr1', 1, ...
# Tutorial "Cómo agrupar factores" pacman::p_load('tidyverse') # NOTA: un factor es una estructura de datos en R que le permite crear un conjunto de categorías. Llamamos a estas categorías niveles. Es bien sabido en la literatura psicológica que solo podemos almacenar un cierto número de cosas en nuestra memoria de t...
/tidyverse_booster/03_Improve creating and modifying columns/4to_tutorial.r
no_license
Leo4Luffy/Mi_practica
R
false
false
4,390
r
# Tutorial "Cómo agrupar factores" pacman::p_load('tidyverse') # NOTA: un factor es una estructura de datos en R que le permite crear un conjunto de categorías. Llamamos a estas categorías niveles. Es bien sabido en la literatura psicológica que solo podemos almacenar un cierto número de cosas en nuestra memoria de t...
## Read in the file into a data variable ## Read Data From Working Session Folder data <- read.table("household_power_consumption.txt", header = TRUE, sep = ";") ## Subset the data using Date as a factor with level 1/2/2007 and 2/2/2007 data2 <- subset(data, Date == "1/2/2007" | Date == "2/2/2007") ## Convert and co...
/plot4.R
no_license
Kamran-Wali/ExData_Plotting1
R
false
false
1,810
r
## Read in the file into a data variable ## Read Data From Working Session Folder data <- read.table("household_power_consumption.txt", header = TRUE, sep = ";") ## Subset the data using Date as a factor with level 1/2/2007 and 2/2/2007 data2 <- subset(data, Date == "1/2/2007" | Date == "2/2/2007") ## Convert and co...
# Extract only the rows matching the 2 dates - 2007-02-01 and 2007-02-02. library(sqldf) epc <- "household_power_consumption.txt" epcdata <- read.csv.sql(epc, sql = "select * from file where Date = '1/2/2007' or Date = '2/2/2007' ", header=TRUE, sep=";", na.strings="?") closeAllConnections() epc...
/plot4.R
no_license
dkspeaks/ExData_Plotting1
R
false
false
1,195
r
# Extract only the rows matching the 2 dates - 2007-02-01 and 2007-02-02. library(sqldf) epc <- "household_power_consumption.txt" epcdata <- read.csv.sql(epc, sql = "select * from file where Date = '1/2/2007' or Date = '2/2/2007' ", header=TRUE, sep=";", na.strings="?") closeAllConnections() epc...
library(pacman);p_load('rvest','hellno',stringr,data.table, XML) getAbstact=function(URL,checkSave=FALSE) { print('getAbstact') # defineST<-a<-str_extract(pattern='[0-9]+',url) # if(checkSave) # { # if( length(grep(defineST, list.files('../tmpfiles3/')))>0 ) #test if found # { # print(paste0('currently reading file...
/scripts/newSEARCHfun.R
no_license
SkanderMulder/Abstractastic
R
false
false
2,323
r
library(pacman);p_load('rvest','hellno',stringr,data.table, XML) getAbstact=function(URL,checkSave=FALSE) { print('getAbstact') # defineST<-a<-str_extract(pattern='[0-9]+',url) # if(checkSave) # { # if( length(grep(defineST, list.files('../tmpfiles3/')))>0 ) #test if found # { # print(paste0('currently reading file...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot.ctsemFit.R \name{plot.ctsemFit} \alias{plot.ctsemFit} \title{Plotting function for object class ctsemFit} \usage{ \method{plot}{ctsemFit}(x, resolution = 50, wait = TRUE, max.time = "auto", mean = TRUE, withinVariance = TRUE, AR = TRUE...
/man/plot.ctsemFit.Rd
no_license
davan690/ctsem
R
false
true
2,984
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot.ctsemFit.R \name{plot.ctsemFit} \alias{plot.ctsemFit} \title{Plotting function for object class ctsemFit} \usage{ \method{plot}{ctsemFit}(x, resolution = 50, wait = TRUE, max.time = "auto", mean = TRUE, withinVariance = TRUE, AR = TRUE...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/in.da.R \name{in.da} \alias{in.da} \alias{rv.da} \title{Optimization functions for Dimensional Anchors in Radviz} \usage{ in.da(springs, similarity) rv.da(springs, similarity) } \arguments{ \item{springs}{A matrix of 2D dimensional anchor coo...
/man/in.da.Rd
no_license
ivan-marroquin/Radviz
R
false
true
1,653
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/in.da.R \name{in.da} \alias{in.da} \alias{rv.da} \title{Optimization functions for Dimensional Anchors in Radviz} \usage{ in.da(springs, similarity) rv.da(springs, similarity) } \arguments{ \item{springs}{A matrix of 2D dimensional anchor coo...
\name{pairwise} \alias{pairwise} \title{ Pair Indices } \description{ A utility function to determine indices for pairwise comparisons. } \usage{ pairwise(N) } \arguments{ \item{N}{ a single numeric value representing the total number of things to undergo pairwise comparison. } } \value{ Returns a two column ...
/ver_devel/bio3d/man/pairwise.Rd
no_license
Grantlab/bio3d
R
false
false
586
rd
\name{pairwise} \alias{pairwise} \title{ Pair Indices } \description{ A utility function to determine indices for pairwise comparisons. } \usage{ pairwise(N) } \arguments{ \item{N}{ a single numeric value representing the total number of things to undergo pairwise comparison. } } \value{ Returns a two column ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rejSamp.R \name{rejSamp} \alias{rejSamp} \title{Generate random numbers by rejection sampling} \usage{ rejSamp(f, n = 1, min = 0, max = 1, g = NULL, rg = NULL, g.factor = 1) } \arguments{ \item{f}{[\code{function}]\cr Function to be interpr...
/man/rejSamp.Rd
no_license
jakob-r/rejSamp-1
R
false
true
1,461
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rejSamp.R \name{rejSamp} \alias{rejSamp} \title{Generate random numbers by rejection sampling} \usage{ rejSamp(f, n = 1, min = 0, max = 1, g = NULL, rg = NULL, g.factor = 1) } \arguments{ \item{f}{[\code{function}]\cr Function to be interpr...
# Agave Platform Science API # # Power your digital lab and reduce the time from theory to discovery using the Agave Science-as-a-Service API Platform. Agave provides hosted services that allow researchers to manage data, conduct experiments, and publish and share results from anywhere at any time. # # Agave Platform v...
/R/FileRenameAction.r
permissive
agaveplatform/r-sdk
R
false
false
2,889
r
# Agave Platform Science API # # Power your digital lab and reduce the time from theory to discovery using the Agave Science-as-a-Service API Platform. Agave provides hosted services that allow researchers to manage data, conduct experiments, and publish and share results from anywhere at any time. # # Agave Platform v...
########################## ########################## ##emission calculations ########################## ########################## #kr #description ########################## #functions to calculate emissions #includes ########################## #calcEm #calcEMHoribaPitot # #to do #####...
/R/calcEm.R
no_license
cran/pems.utils
R
false
false
7,161
r
########################## ########################## ##emission calculations ########################## ########################## #kr #description ########################## #functions to calculate emissions #includes ########################## #calcEm #calcEMHoribaPitot # #to do #####...
# --------------------------------------------------------------------------- # # # # Legger til lag der trafikklenker med toveistrafikk ligger dobbelt # # # ...
/nr_prep_links/toi/3_rettede_lenker_metrering.R
no_license
snohan/trafikkdata
R
false
false
3,383
r
# --------------------------------------------------------------------------- # # # # Legger til lag der trafikklenker med toveistrafikk ligger dobbelt # # # ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{UNSDGGoals} \alias{UNSDGGoals} \title{UNSDGGoals} \format{ A data frame with 17 rows and 6 variables: \describe{ \item{\code{code}}{double COLUMN_DESCRIPTION} \item{\code{name}}{character COLUMN_DESCRIPTION} ...
/man/UNSDGGoals.Rd
permissive
unhcr-americas/IatiTidy
R
false
true
854
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{UNSDGGoals} \alias{UNSDGGoals} \title{UNSDGGoals} \format{ A data frame with 17 rows and 6 variables: \describe{ \item{\code{code}}{double COLUMN_DESCRIPTION} \item{\code{name}}{character COLUMN_DESCRIPTION} ...
if (!exists("hpc_data")) { source('load_data.R') } png("plot4.png", width = 480, height = 480) par(mfcol = c(2, 2), mar = c(4, 4, 2, 1), oma = c(0, 0, 2, 0)) with(hpc_data, { plot(datetime, Global_active_power, type = "l", xlab = "", ylab = "Global Active Power") with(hpc_data, plot(datetime, Sub_...
/plot4.R
no_license
jmterrettaz/ExData_Plotting1
R
false
false
812
r
if (!exists("hpc_data")) { source('load_data.R') } png("plot4.png", width = 480, height = 480) par(mfcol = c(2, 2), mar = c(4, 4, 2, 1), oma = c(0, 0, 2, 0)) with(hpc_data, { plot(datetime, Global_active_power, type = "l", xlab = "", ylab = "Global Active Power") with(hpc_data, plot(datetime, Sub_...
# This file is generated by make.paws. Please do not edit here. #' @importFrom paws.common new_handlers new_service set_config NULL #' AWS OpsWorks #' #' @description #' Welcome to the *AWS OpsWorks Stacks API Reference*. This guide provides #' descriptions, syntax, and usage examples for AWS OpsWorks Stacks actions #...
/paws/R/opsworks_service.R
permissive
williazo/paws
R
false
false
13,759
r
# This file is generated by make.paws. Please do not edit here. #' @importFrom paws.common new_handlers new_service set_config NULL #' AWS OpsWorks #' #' @description #' Welcome to the *AWS OpsWorks Stacks API Reference*. This guide provides #' descriptions, syntax, and usage examples for AWS OpsWorks Stacks actions #...
# SET DIRECTORY TO SOURCE FILE LOCATION: Session> Set Working Directory> To Source File Location ######################## ### Read in raw Data ### ######################## library(tidyverse) covid <- read.csv("../../data/interim/full_data.csv") ##################### ### Data Cleaning ### ##################### # ...
/covid-stats-proj/src/data/feature_engineering.R
no_license
jearcher/Data-Science
R
false
false
4,659
r
# SET DIRECTORY TO SOURCE FILE LOCATION: Session> Set Working Directory> To Source File Location ######################## ### Read in raw Data ### ######################## library(tidyverse) covid <- read.csv("../../data/interim/full_data.csv") ##################### ### Data Cleaning ### ##################### # ...
#### Figure 7 ADVI has a bad fit in Horseshoe logistic library(rstan) options(mc.cores = parallel::detectCores()) datafile <- 'leukemia.RData' load(datafile,verbose=T) x <- scale(x) d <- NCOL(x) n <- NROW(x) # compile the model stanmodel <- stan_model('glm_bernoulli_rhs.stan') scale_icept=10 slab_scale=5 slab_df=4 # ...
/WIP/Evaluating Variational Inference/Figure_7_Horseshoe.R
permissive
junpenglao/Planet_Sakaar_Data_Science
R
false
false
6,889
r
#### Figure 7 ADVI has a bad fit in Horseshoe logistic library(rstan) options(mc.cores = parallel::detectCores()) datafile <- 'leukemia.RData' load(datafile,verbose=T) x <- scale(x) d <- NCOL(x) n <- NROW(x) # compile the model stanmodel <- stan_model('glm_bernoulli_rhs.stan') scale_icept=10 slab_scale=5 slab_df=4 # ...
testlist <- list(A = structure(c(1.38997190089718e-309, 3.81575932257023e-236, 3.81571422920468e-236), .Dim = c(1L, 3L)), B = structure(0, .Dim = c(1L, 1L))) result <- do.call(multivariance:::match_rows,testlist) str(result)
/multivariance/inst/testfiles/match_rows/AFL_match_rows/match_rows_valgrind_files/1613126275-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
226
r
testlist <- list(A = structure(c(1.38997190089718e-309, 3.81575932257023e-236, 3.81571422920468e-236), .Dim = c(1L, 3L)), B = structure(0, .Dim = c(1L, 1L))) result <- do.call(multivariance:::match_rows,testlist) str(result)
#' @title multimodality_score #' @description Calculate multimodality score based on bootstrapped potential analysis #' @param x A vector, or data matrix (variables x samples) #' @param detection.threshold Mode detection threshold #' @param bw.adjust Bandwidth adjustment #' @param bs.iterations Bootstrap iterations #' ...
/R/multimodality_score.R
no_license
himanshu-fff/microbiome
R
false
false
2,784
r
#' @title multimodality_score #' @description Calculate multimodality score based on bootstrapped potential analysis #' @param x A vector, or data matrix (variables x samples) #' @param detection.threshold Mode detection threshold #' @param bw.adjust Bandwidth adjustment #' @param bs.iterations Bootstrap iterations #' ...
#' Get community membership by modularity optimization #' @description Through the use of greedy optimization #' of a modularity score, obtain the group membership #' values for each of the nodes in the graph. #' @param graph a graph object of class #' \code{dgr_graph}. #' @return a data frame with group membership #' ...
/R/get_cmty_fast_greedy.R
no_license
chengfeifan/DiagrammeR
R
false
false
2,332
r
#' Get community membership by modularity optimization #' @description Through the use of greedy optimization #' of a modularity score, obtain the group membership #' values for each of the nodes in the graph. #' @param graph a graph object of class #' \code{dgr_graph}. #' @return a data frame with group membership #' ...
testlist <- list(cost = structure(c(1.44888560957826e+135, 1.6249392498385e+65, 5.27956628994611e-134, 1.56839475268612e-251, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(5L, 5L)), flow = structure(c(3.80768289350145e+125, 8.58414828913381e+155, 3.37787969964034e+43, 2.83184518248624e-19...
/epiphy/inst/testfiles/costTotCPP/AFL_costTotCPP/costTotCPP_valgrind_files/1615926619-test.R
no_license
akhikolla/updatedatatype-list2
R
false
false
1,101
r
testlist <- list(cost = structure(c(1.44888560957826e+135, 1.6249392498385e+65, 5.27956628994611e-134, 1.56839475268612e-251, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(5L, 5L)), flow = structure(c(3.80768289350145e+125, 8.58414828913381e+155, 3.37787969964034e+43, 2.83184518248624e-19...
\name{requireData} \alias{requireData} \title{ Attach packages as required and expose non-LazyData data sets as promises. } \description{ This function provides \code{LazyData} functionality for packages which do not provide it. It acts as an enhanced substitute for the base packges \code{require} function. } ...
/man/requireData.Rd
no_license
cran/lazyData
R
false
false
3,562
rd
\name{requireData} \alias{requireData} \title{ Attach packages as required and expose non-LazyData data sets as promises. } \description{ This function provides \code{LazyData} functionality for packages which do not provide it. It acts as an enhanced substitute for the base packges \code{require} function. } ...
library(pafdR) ### Name: gen.rnd.vec ### Title: Generates random vector for numerical answer (internal) ### Aliases: gen.rnd.vec ### ** Examples library(pafdR) my.sol <- 1 #assume solution to exercise is 1 my.answers <- gen.rnd.vec()*my.sol my.answers
/data/genthat_extracted_code/pafdR/examples/gen.rnd.vec.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
262
r
library(pafdR) ### Name: gen.rnd.vec ### Title: Generates random vector for numerical answer (internal) ### Aliases: gen.rnd.vec ### ** Examples library(pafdR) my.sol <- 1 #assume solution to exercise is 1 my.answers <- gen.rnd.vec()*my.sol my.answers
# PRODUCTS ------------------------------------------------------------------------------------------------------------ #' Products available #' #' Returns information about the Uber products offered at a given location. #' #' @param latitude Latitude of location. #' @param longitude Longitude of location. #' @para...
/R/api.R
no_license
arthurwuhoo/ubeR
R
false
false
9,216
r
# PRODUCTS ------------------------------------------------------------------------------------------------------------ #' Products available #' #' Returns information about the Uber products offered at a given location. #' #' @param latitude Latitude of location. #' @param longitude Longitude of location. #' @para...
cholera<-read.csv(file.choose(),header = TRUE) blood_vidal<-read.csv(file.choose(),header = TRUE) malaria<-read.csv(file.choose(),header = TRUE) dengue<-read.csv(file.choose(),header = TRUE) swine_flu<-read.csv(file.choose(),header = TRUE) par(mfrow=c(2,3)) plot(cholera$month.year,cholera$Count,xlab="month",yla...
/line plot.R
no_license
RAGAVARTHINI/R-final-year-project
R
false
false
707
r
cholera<-read.csv(file.choose(),header = TRUE) blood_vidal<-read.csv(file.choose(),header = TRUE) malaria<-read.csv(file.choose(),header = TRUE) dengue<-read.csv(file.choose(),header = TRUE) swine_flu<-read.csv(file.choose(),header = TRUE) par(mfrow=c(2,3)) plot(cholera$month.year,cholera$Count,xlab="month",yla...
# Load the data set if(!file.exists("exdata-data-household_power_consumption.zip")) { temp <- tempfile() download.file("http://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip",temp) file <- unzip(temp) unlink(temp) } # Read data power <- read.table(file = "household_power_consump...
/plot2.R
no_license
aorillio/ExData_Plotting1
R
false
false
831
r
# Load the data set if(!file.exists("exdata-data-household_power_consumption.zip")) { temp <- tempfile() download.file("http://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip",temp) file <- unzip(temp) unlink(temp) } # Read data power <- read.table(file = "household_power_consump...
library(party) library(ggplot2) library(randomForest) library(e1071) library(caret) setwd("C:/Users/siddartha/Desktop/sid/data_analatics/Cricket-Insights/scripts/R scripts") segment_one <- read.csv("./../../prediction data generated/first_six_overs.csv") segment_two <- read.csv("./../../prediction data generated/...
/scripts/R scripts/classification.R
no_license
kumarshivam675/Cricket-Insights
R
false
false
5,079
r
library(party) library(ggplot2) library(randomForest) library(e1071) library(caret) setwd("C:/Users/siddartha/Desktop/sid/data_analatics/Cricket-Insights/scripts/R scripts") segment_one <- read.csv("./../../prediction data generated/first_six_overs.csv") segment_two <- read.csv("./../../prediction data generated/...
# Write log10 HITChip data matrix taxa x samples into a file # in the sparCC format sparcc.write <- function (dat, file) { # Mimic absolute counts datc <- round(10^dat) rownames(datc) <- gsub(" ", "_", rownames(datc)) datc <- cbind(rownames(datc), datc) colnames(datc)[[1]] <- "OTU_id" datc <- r...
/R/sparcc.R
no_license
antagomir/scripts
R
false
false
482
r
# Write log10 HITChip data matrix taxa x samples into a file # in the sparCC format sparcc.write <- function (dat, file) { # Mimic absolute counts datc <- round(10^dat) rownames(datc) <- gsub(" ", "_", rownames(datc)) datc <- cbind(rownames(datc), datc) colnames(datc)[[1]] <- "OTU_id" datc <- r...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{goa_cc_table} \alias{goa_cc_table} \title{GO cellular component annotations} \format{ A data frame with 83,029 rows and 3 variables: \describe{ \item{Gene.symbol}{HGNC gene symbol} \item{GO.ID}{GO term ID} \i...
/man/goa_cc_table.Rd
permissive
lagelab/Genoppi
R
false
true
1,784
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{goa_cc_table} \alias{goa_cc_table} \title{GO cellular component annotations} \format{ A data frame with 83,029 rows and 3 variables: \describe{ \item{Gene.symbol}{HGNC gene symbol} \item{GO.ID}{GO term ID} \i...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/repl.R \name{repl_python} \alias{repl_python} \title{Run a Python REPL} \usage{ repl_python(module = NULL, quiet = getOption("reticulate.repl.quiet", default = FALSE)) } \arguments{ \item{module}{An (optional) Python module to be imported b...
/man/repl_python.Rd
permissive
rossholmberg/reticulate
R
false
true
1,266
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/repl.R \name{repl_python} \alias{repl_python} \title{Run a Python REPL} \usage{ repl_python(module = NULL, quiet = getOption("reticulate.repl.quiet", default = FALSE)) } \arguments{ \item{module}{An (optional) Python module to be imported b...
require(knitr) require(markdown) setwd("~/Repositories/Coursera/GettingAndCleaning/") knit("run_analysis.Rmd", encoding="ISO8859-1") markdownToHTML("run_analysis.md", "run_analysis.html")
/run_analysis.r
no_license
henriquehashimoto/GettingAndCleaning
R
false
false
191
r
require(knitr) require(markdown) setwd("~/Repositories/Coursera/GettingAndCleaning/") knit("run_analysis.Rmd", encoding="ISO8859-1") markdownToHTML("run_analysis.md", "run_analysis.html")
# Source of data for the project: # https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip # 1. Merge the training and the test sets to create one data set. # assign subject ID for test and training data sets subjectTest <- read.table('test/subject_test.txt', col.names=c('Subject')) s...
/run_analysis.R
no_license
jigarcian/Getting-and-Cleaning-Data
R
false
false
3,751
r
# Source of data for the project: # https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip # 1. Merge the training and the test sets to create one data set. # assign subject ID for test and training data sets subjectTest <- read.table('test/subject_test.txt', col.names=c('Subject')) s...
ml_prepare_dataframe <- function(df, features, response = NULL, ..., envir = new.env(parent = emptyenv())) { df <- spark_dataframe(df) schema <- sdf_schema(df) # default report for feature, response variable names envir$features <- random_string("features") envir$response <- ...
/R/ml_utils.R
permissive
land23/sparklyr
R
false
false
3,695
r
ml_prepare_dataframe <- function(df, features, response = NULL, ..., envir = new.env(parent = emptyenv())) { df <- spark_dataframe(df) schema <- sdf_schema(df) # default report for feature, response variable names envir$features <- random_string("features") envir$response <- ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{numeric_to_vector_text} \alias{numeric_to_vector_text} \title{Convert numeric to string} \usage{ numeric_to_vector_text(x) } \arguments{ \item{x}{Numeric vector.} } \description{ Convert a numeric vector to a string in which eac...
/man/numeric_to_vector_text.Rd
permissive
DavidBarke/QWUtils
R
false
true
357
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{numeric_to_vector_text} \alias{numeric_to_vector_text} \title{Convert numeric to string} \usage{ numeric_to_vector_text(x) } \arguments{ \item{x}{Numeric vector.} } \description{ Convert a numeric vector to a string in which eac...
# Jake Yeung # Date of Creation: 2019-08-16 # File: ~/projects/scchic/scripts/scripts_analysis/scrnaseq/zebrafish_marrow.R # Zebrafish rm(list=ls()) require(statmod) library(dplyr) library(tidyr) library(ggplot2) library(data.table) library(Matrix) library(irlba) library(umap) library(scchicFuncs) library(Seurat) l...
/scripts/scripts_analysis/scrnaseq/zebrafish_marrow_entropy.R
no_license
jakeyeung/sortchicAllScripts
R
false
false
8,313
r
# Jake Yeung # Date of Creation: 2019-08-16 # File: ~/projects/scchic/scripts/scripts_analysis/scrnaseq/zebrafish_marrow.R # Zebrafish rm(list=ls()) require(statmod) library(dplyr) library(tidyr) library(ggplot2) library(data.table) library(Matrix) library(irlba) library(umap) library(scchicFuncs) library(Seurat) l...
#!/usr/bin/env Rscript #scriptdir = getSrcDirectory(function(x) {x}) scriptdir <- dirname(sys.frame(1)$ofile) message("ScriptDir: ", scriptdir) main = function() { suppressPackageStartupMessages(library("argparse")) parser = ArgumentParser() parser$add_argument("--numA", help="numA", type="integer", re...
/R_test_fun/example.funcs.R
no_license
brianjohnhaas/misc
R
false
false
778
r
#!/usr/bin/env Rscript #scriptdir = getSrcDirectory(function(x) {x}) scriptdir <- dirname(sys.frame(1)$ofile) message("ScriptDir: ", scriptdir) main = function() { suppressPackageStartupMessages(library("argparse")) parser = ArgumentParser() parser$add_argument("--numA", help="numA", type="integer", re...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_gene_info.R \name{get_previous_gene} \alias{get_previous_gene} \title{Get previous genes bnumbers for a given vector of genes, with respect to strand orientation} \usage{ get_previous_gene(list_genes) } \arguments{ \item{list_genes}{A cha...
/man/get_previous_gene.Rd
no_license
PGC-CCG/EcoliGenes
R
false
true
523
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_gene_info.R \name{get_previous_gene} \alias{get_previous_gene} \title{Get previous genes bnumbers for a given vector of genes, with respect to strand orientation} \usage{ get_previous_gene(list_genes) } \arguments{ \item{list_genes}{A cha...
#clean console cat(c("\014")) #google trends on methodologies: change filetoRead with your working directory #file.to.read <- "D:/workspaceR/prove/hall-of-fame-methodologies/resources/week-search-about-software-development-methodologies.csv" file.to.read <- "C:/repo-progetti-R/Hall-of-Fame-methodologies/input/week-sea...
/R/1-load-data.R
permissive
alepuzio/Hall-of-Fame-methodologies
R
false
false
608
r
#clean console cat(c("\014")) #google trends on methodologies: change filetoRead with your working directory #file.to.read <- "D:/workspaceR/prove/hall-of-fame-methodologies/resources/week-search-about-software-development-methodologies.csv" file.to.read <- "C:/repo-progetti-R/Hall-of-Fame-methodologies/input/week-sea...
rankall <- function(outcome, num="best"){ data <- read.csv("outcome-of-care-measures.csv", stringsAsFactors = FALSE, na.strings = "Not Available") ## Read outcome data relevant <- data[,c(2, 7, 11, 17, 23)] names(relevant) <- c("hospital", "state", "heart attack", "heart failure", "pneumonia") outcomes <- rel...
/rankall.R
no_license
ArunimaSethi/datasciencecoursera
R
false
false
1,135
r
rankall <- function(outcome, num="best"){ data <- read.csv("outcome-of-care-measures.csv", stringsAsFactors = FALSE, na.strings = "Not Available") ## Read outcome data relevant <- data[,c(2, 7, 11, 17, 23)] names(relevant) <- c("hospital", "state", "heart attack", "heart failure", "pneumonia") outcomes <- rel...
no_function() library(tidyverse) masstools::setwd_project() rm(list = ls()) source("code/tools.R") source("code/modified_dtw.R") source("code/lagged_correlation.R") ####load data ###CGM load("data/24_7_study/cgm/data_preparation/sample_info") load("data/24_7_study/cgm/data_preparation/variable_info") load("data/24_7_s...
/code/24_7_study/wearable_omics_correlation/CGM/cgm_total_protein_correlation.R
permissive
jaspershen/microsampling_multiomics
R
false
false
14,148
r
no_function() library(tidyverse) masstools::setwd_project() rm(list = ls()) source("code/tools.R") source("code/modified_dtw.R") source("code/lagged_correlation.R") ####load data ###CGM load("data/24_7_study/cgm/data_preparation/sample_info") load("data/24_7_study/cgm/data_preparation/variable_info") load("data/24_7_s...
library(data.table) library(dplyr) library(tidyr) library(NbClust) library(ggplot2) library(gridExtra) library(ggdendro) library(cluster) library(purrr) library(tibble) library(ggradar) library(naniar) ############################################################################### ################################ TAB...
/patients_selection/patient_selection.R
no_license
shalabysar/T2D_study
R
false
false
8,745
r
library(data.table) library(dplyr) library(tidyr) library(NbClust) library(ggplot2) library(gridExtra) library(ggdendro) library(cluster) library(purrr) library(tibble) library(ggradar) library(naniar) ############################################################################### ################################ TAB...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rm_repeated_characters.R \name{rm_repeated_characters} \alias{rm_repeated_characters} \alias{ex_repeated_characters} \title{Remove/Replace/Extract Words With Repeating Characters} \usage{ rm_repeated_characters(text.var, trim = !extract, clea...
/man/rm_repeated_characters.Rd
no_license
dajxyz/qdapRegex
R
false
true
3,089
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rm_repeated_characters.R \name{rm_repeated_characters} \alias{rm_repeated_characters} \alias{ex_repeated_characters} \title{Remove/Replace/Extract Words With Repeating Characters} \usage{ rm_repeated_characters(text.var, trim = !extract, clea...
load("~/Dropbox/__HTWG/Statistic/Stat_HS2018/handouts/inference/LR/unique2010.rda") res = lm(Pax ~ ATM, data=unique2010) predict(res,data.frame(ATM=c(20100, 24000, 500))) plot(Pax ~ ATM, data=unique2010) abline(res) xi = seq(1,10,0.5) n = length(xi) beta0 = 2.0 beta1 = 1.0 yi = rnorm(n, mean=beta0 + beta1*xi, sd = 0.5...
/schliessende/LR.R
no_license
oduerr/stat
R
false
false
896
r
load("~/Dropbox/__HTWG/Statistic/Stat_HS2018/handouts/inference/LR/unique2010.rda") res = lm(Pax ~ ATM, data=unique2010) predict(res,data.frame(ATM=c(20100, 24000, 500))) plot(Pax ~ ATM, data=unique2010) abline(res) xi = seq(1,10,0.5) n = length(xi) beta0 = 2.0 beta1 = 1.0 yi = rnorm(n, mean=beta0 + beta1*xi, sd = 0.5...
dat <- data.frame(x=1:10, y=10:1) ffdat <- as.ffdf(dat) with(ffdat, {x+y})
/examples/with.R
no_license
edwindj/ffbase
R
false
false
77
r
dat <- data.frame(x=1:10, y=10:1) ffdat <- as.ffdf(dat) with(ffdat, {x+y})
# prepareZiref.R # # Purpose: prepare (global) object ziRef with character information # # Precondition: The cedict dictionary source file exists in # "../cedict/cedict_ts.u8.txt" # ziFreq has been loaded # # Postcondition: (global) object ziRef exists and has be...
/prepareZiRef.R
no_license
scylense/wenji
R
false
false
3,358
r
# prepareZiref.R # # Purpose: prepare (global) object ziRef with character information # # Precondition: The cedict dictionary source file exists in # "../cedict/cedict_ts.u8.txt" # ziFreq has been loaded # # Postcondition: (global) object ziRef exists and has be...
.rowdata <- DataFrame( A=rep(letters[1:3], each=6), B=rep(letters[1:6], each=3), C=1:18 ) rownames(.rowdata) = letters[1:18] .coldata <- DataFrame( D=rep(letters[1:2], each=6), E=rep(letters[1:3], each=4), F=1:12 ) rownames(.coldata) = month.abb[1:12] .a1 <- matrix(1:216, nrow = 18) .a2 <- matrix(216:1, ...
/tests/testthat/test-filter-se.R
no_license
ahmohamed/slyr
R
false
false
1,729
r
.rowdata <- DataFrame( A=rep(letters[1:3], each=6), B=rep(letters[1:6], each=3), C=1:18 ) rownames(.rowdata) = letters[1:18] .coldata <- DataFrame( D=rep(letters[1:2], each=6), E=rep(letters[1:3], each=4), F=1:12 ) rownames(.coldata) = month.abb[1:12] .a1 <- matrix(1:216, nrow = 18) .a2 <- matrix(216:1, ...
timestamp <- Sys.time() library(caret) library(plyr) library(recipes) library(dplyr) model <- "ordinalNet" ## In case the package or one of its dependencies uses random numbers ## on startup so we'll pre-load the required libraries: for(i in getModelInfo(model)[[1]]$library) do.call("requireNamespace", list(packa...
/RegressionTests/Code/ordinalNet.R
no_license
tymenschreuder/caret
R
false
false
6,142
r
timestamp <- Sys.time() library(caret) library(plyr) library(recipes) library(dplyr) model <- "ordinalNet" ## In case the package or one of its dependencies uses random numbers ## on startup so we'll pre-load the required libraries: for(i in getModelInfo(model)[[1]]$library) do.call("requireNamespace", list(packa...
### Atividade prática ## Vamos começar carregando um ambiente previamente criado para esta aula. ## Nas aulas seguintes trabalharemos com fontes de dados em arquivos de formatos diversos. load("aula-02/data/dados_exercicio.RData") ### 1 #### ## Inicie mostrando uma prévia do conteúdo da variável acessos_alunos ## #...
/aula-02/05_atividade.R
no_license
mauriciolena/data-analysis_with_R-201801
R
false
false
5,479
r
### Atividade prática ## Vamos começar carregando um ambiente previamente criado para esta aula. ## Nas aulas seguintes trabalharemos com fontes de dados em arquivos de formatos diversos. load("aula-02/data/dados_exercicio.RData") ### 1 #### ## Inicie mostrando uma prévia do conteúdo da variável acessos_alunos ## #...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/paws.wafregional_operations.R \name{get_byte_match_set} \alias{get_byte_match_set} \title{Returns the ByteMatchSet specified by ByteMatchSetId} \usage{ get_byte_match_set(ByteMatchSetId) } \arguments{ \item{ByteMatchSetId}{[required] The \cod...
/service/paws.wafregional/man/get_byte_match_set.Rd
permissive
CR-Mercado/paws
R
false
true
871
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/paws.wafregional_operations.R \name{get_byte_match_set} \alias{get_byte_match_set} \title{Returns the ByteMatchSet specified by ByteMatchSetId} \usage{ get_byte_match_set(ByteMatchSetId) } \arguments{ \item{ByteMatchSetId}{[required] The \cod...
##' Equivalence t-Test Summary Function ##' ##' \code{summary.equivttest} is a summary function for objects of the class \code{equivttest}. This summary function should be paired with the \code{equiv.t.test} function. ##' ##' @seealso \code{\link{equiv.t.test}} ##' ##' @examples ##' # Wellek p 124 ##' x=c(10.3,11.3,2,-...
/R/summary_equivttest.R
permissive
jwbowers/equivtest
R
false
false
1,202
r
##' Equivalence t-Test Summary Function ##' ##' \code{summary.equivttest} is a summary function for objects of the class \code{equivttest}. This summary function should be paired with the \code{equiv.t.test} function. ##' ##' @seealso \code{\link{equiv.t.test}} ##' ##' @examples ##' # Wellek p 124 ##' x=c(10.3,11.3,2,-...
# # This is the user-interface definition 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 UI for application that draws a histogram shinyUI(fluid...
/ui.R
no_license
jbm5582/case_study_4
R
false
false
1,177
r
# # This is the user-interface definition 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 UI for application that draws a histogram shinyUI(fluid...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tl_labels.R \name{tl_labels} \alias{tl_labels} \title{tl_labels} \usage{ tl_labels(data, spss = FALSE) } \arguments{ \item{data}{Dataframe from which you want to draw labels} \item{spss}{Whether the dataset is from SPSS or not. Defaults to F...
/man/tl_labels.Rd
no_license
willdebras/topliner
R
false
true
576
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tl_labels.R \name{tl_labels} \alias{tl_labels} \title{tl_labels} \usage{ tl_labels(data, spss = FALSE) } \arguments{ \item{data}{Dataframe from which you want to draw labels} \item{spss}{Whether the dataset is from SPSS or not. Defaults to F...
##Version Updates #Version 1: everything is new! #Someday, I will describe the model here ###Notes for Alexander### ##Things that need fixing: #~~noticed that detour sometimes goes to a resource further away than AG destinations. This should not be happening. ##Things to improve: #~~Additive gravity rule (we...
/navigation sim v1.r
no_license
aqvining/Animal-nav-abm
R
false
false
20,230
r
##Version Updates #Version 1: everything is new! #Someday, I will describe the model here ###Notes for Alexander### ##Things that need fixing: #~~noticed that detour sometimes goes to a resource further away than AG destinations. This should not be happening. ##Things to improve: #~~Additive gravity rule (we...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/clean_table.R \name{clean_byGroup} \alias{clean_byGroup} \title{clean table by the group} \usage{ clean_byGroup(meta_table, group) } \arguments{ \item{meta_table}{tibble} \item{group}{i have no idea} } \value{ tibble } \description{ clean ta...
/man/clean_byGroup.Rd
permissive
luoboqingcai81/metaNIE
R
false
true
436
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/clean_table.R \name{clean_byGroup} \alias{clean_byGroup} \title{clean table by the group} \usage{ clean_byGroup(meta_table, group) } \arguments{ \item{meta_table}{tibble} \item{group}{i have no idea} } \value{ tibble } \description{ clean ta...
# Removes unwanted features from the data, and name the rows FilterDataColumns <- function(data, featureDim) { indices <- which(grepl("mean()", featureDim, fixed = T) | grepl("std()", featureDim, fixed = T)) newData <- data[, indices] names(newData) <- featureDim[indices] newData } # Repla...
/run_analysis.R
no_license
Lordshinjo/getdata
R
false
false
1,710
r
# Removes unwanted features from the data, and name the rows FilterDataColumns <- function(data, featureDim) { indices <- which(grepl("mean()", featureDim, fixed = T) | grepl("std()", featureDim, fixed = T)) newData <- data[, indices] names(newData) <- featureDim[indices] newData } # Repla...
install.packages("dplyr") install.packages("tidyverse") library(dplyr) library(tidyverse) data = read.csv(file = '/Users/Christian/Documents/Bracketlytics/data/2018TeamStats_Final.csv', header = TRUE, sep = ",") sos.data = read.csv(file = '/Users/Christian/Documents/Bracketlytics/data/sos.csv') ####Compiling game da...
/archive/data_cleaning.R
no_license
geerc/bracketlytics
R
false
false
12,440
r
install.packages("dplyr") install.packages("tidyverse") library(dplyr) library(tidyverse) data = read.csv(file = '/Users/Christian/Documents/Bracketlytics/data/2018TeamStats_Final.csv', header = TRUE, sep = ",") sos.data = read.csv(file = '/Users/Christian/Documents/Bracketlytics/data/sos.csv') ####Compiling game da...
test_that("in_sample works with include.differenciation=TRUE", { benchmark <- annualBenchmark(hfserie = turnover, lfserie = construction, include.differenciation = TRUE) simul <- lag(aggregate(construction),-1)*(100+in_sample(benchmark,type="chan...
/fuzzedpackages/disaggR/tests/testthat/test-in_sample.R
no_license
akhikolla/testpackages
R
false
false
2,385
r
test_that("in_sample works with include.differenciation=TRUE", { benchmark <- annualBenchmark(hfserie = turnover, lfserie = construction, include.differenciation = TRUE) simul <- lag(aggregate(construction),-1)*(100+in_sample(benchmark,type="chan...
library(e1071) library(glmnet) fb_post <- read_csv("../../../machine_learning/fb_post_train.csv") #F1+F2+F3+F5 df <- fb_post %>% select(comment, page_category, title_nu, pos_word, neg_word, 核四:億元, topic1:topic7, stan...
/code/opinion_mining/main/trainmodel_fbPost.R
no_license
ppjs/public-opinion-mining
R
false
false
4,105
r
library(e1071) library(glmnet) fb_post <- read_csv("../../../machine_learning/fb_post_train.csv") #F1+F2+F3+F5 df <- fb_post %>% select(comment, page_category, title_nu, pos_word, neg_word, 核四:億元, topic1:topic7, stan...
wttest <- function(x,y) { l1 <- y[which(x==x[1])] l2 <- y[which(x!=x[1])] if(length(unique(x))==1 | length(unique(y))==1){ return(1) # solve level problem }else if(length(l1)==1 | length(l2)==1){ return(1) # solve not enough observers problem }else if(length(unique(l1))==1 & length(unique(...
/R/Wttest.R
no_license
chenhong-dkfz/wombat
R
false
false
441
r
wttest <- function(x,y) { l1 <- y[which(x==x[1])] l2 <- y[which(x!=x[1])] if(length(unique(x))==1 | length(unique(y))==1){ return(1) # solve level problem }else if(length(l1)==1 | length(l2)==1){ return(1) # solve not enough observers problem }else if(length(unique(l1))==1 & length(unique(...
\name{radSV} \alias{radSV} %- Also NEED an '\alias' for EACH other topic documented here. \title{Radiation pattern for SV waves} \description{ calculate the radiation patterns for SV waves } \usage{ radSV(del, phiS, lam, ichi, phi) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{del}{deg...
/man/radSV.Rd
no_license
cran/RFOC
R
false
false
1,244
rd
\name{radSV} \alias{radSV} %- Also NEED an '\alias' for EACH other topic documented here. \title{Radiation pattern for SV waves} \description{ calculate the radiation patterns for SV waves } \usage{ radSV(del, phiS, lam, ichi, phi) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{del}{deg...