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
vblpcmdrawpie <- function(center,radius,probs,n=50,colours=1:length(probs)) { x <- c(0,cumsum(probs)/sum(probs)) dx <- diff(x) np <- length(probs) for (i in 1:np) { t2p <- 2 * pi * seq(x[i], x[i + 1], length = n) xc <- center[1] + c(cos(t2p), 0) * radius yc <- center[2] + c(sin(t2p), 0) * radius ...
/R/plot_network.R
no_license
cran/VBLPCM
R
false
false
3,068
r
vblpcmdrawpie <- function(center,radius,probs,n=50,colours=1:length(probs)) { x <- c(0,cumsum(probs)/sum(probs)) dx <- diff(x) np <- length(probs) for (i in 1:np) { t2p <- 2 * pi * seq(x[i], x[i + 1], length = n) xc <- center[1] + c(cos(t2p), 0) * radius yc <- center[2] + c(sin(t2p), 0) * radius ...
library(tidymodels) stack_train <- readRDS("data/c2_train.rds") stack_recipe <- recipe(remote ~ ., data = stack_train) %>% step_downsample(remote) ## Build a logistic regression model glm_spec <- ___ %>% set_engine("glm") ## Start a workflow (recipe only) stack_wf <- ___ %>% add_recipe(stack_recipe) #...
/exercises/exc_02_11_1.R
permissive
snowdj/supervised-ML-case-studies-course
R
false
false
470
r
library(tidymodels) stack_train <- readRDS("data/c2_train.rds") stack_recipe <- recipe(remote ~ ., data = stack_train) %>% step_downsample(remote) ## Build a logistic regression model glm_spec <- ___ %>% set_engine("glm") ## Start a workflow (recipe only) stack_wf <- ___ %>% add_recipe(stack_recipe) #...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/AA_Generics.R \name{simulationFilter} \alias{simulationFilter} \title{Create \linkS4class{SimulationFilter} class} \usage{ simulationFilter(product = "character", ...) } \arguments{ \item{product}{One of "directions", "rb3D", "images".} \ite...
/man/simulationFilter.Rd
no_license
kitbenjamin/daRt
R
false
true
473
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/AA_Generics.R \name{simulationFilter} \alias{simulationFilter} \title{Create \linkS4class{SimulationFilter} class} \usage{ simulationFilter(product = "character", ...) } \arguments{ \item{product}{One of "directions", "rb3D", "images".} \ite...
# Exercise 4: practicing with dplyr # Install the `"nycflights13"` package. Load (`library()`) the package. # You'll also need to load `dplyr` install.packages("nycflights13") library(nycflights13) library(dplyr) # The data frame `flights` should now be accessible to you. # Use functions to inspect it: how many rows...
/chapter-11-exercises/exercise-4/exercise.R
permissive
gtjrrui/book-exercises
R
false
false
2,332
r
# Exercise 4: practicing with dplyr # Install the `"nycflights13"` package. Load (`library()`) the package. # You'll also need to load `dplyr` install.packages("nycflights13") library(nycflights13) library(dplyr) # The data frame `flights` should now be accessible to you. # Use functions to inspect it: how many rows...
#---------------------------------------------------------------------- # Purpose: This test exercises the RF model downloaded as java code # for the dhisttest data set. It checks whether the generated # java correctly splits categorical predictors into non- # contiguous groups at each no...
/h2o-r/tests/testdir_javapredict/runit_DRF_javapredict_smallcat.R
permissive
tamseo/h2o-3
R
false
false
1,573
r
#---------------------------------------------------------------------- # Purpose: This test exercises the RF model downloaded as java code # for the dhisttest data set. It checks whether the generated # java correctly splits categorical predictors into non- # contiguous groups at each no...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/blocks.pop.R \docType{data} \name{blocks.pop} \alias{blocks} \alias{blocks.pop} \alias{pop} \title{pop: Over 11 million Census Bureau 2010 block-level values in a single data.frame} \format{A vector with 11078297 elements (Census 2010 blocks)...
/man/blocks.pop.Rd
no_license
Geschwindigkeitsbegrenzung/UScensus2010blocks
R
false
true
2,657
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/blocks.pop.R \docType{data} \name{blocks.pop} \alias{blocks} \alias{blocks.pop} \alias{pop} \title{pop: Over 11 million Census Bureau 2010 block-level values in a single data.frame} \format{A vector with 11078297 elements (Census 2010 blocks)...
##### For moderation regime, take first 13 years as training and last 5 years as test => ##### cutoff year is 2004 (~72% share in training set). ##### ##### For zirp regume, take first 5 years as training and last 2 years as test => ##### cutoff year is 2013 (~71% share in training set). # Import regime data (...
/Programs/R/moderation_zirp.R
no_license
jiantinker/forecasting-US10Y
R
false
false
10,342
r
##### For moderation regime, take first 13 years as training and last 5 years as test => ##### cutoff year is 2004 (~72% share in training set). ##### ##### For zirp regume, take first 5 years as training and last 2 years as test => ##### cutoff year is 2013 (~71% share in training set). # Import regime data (...
# cut interval: n groups with equal range # cut number: n groups with equal observations # cut width: n groups with width
/helpers.R
no_license
aravindhebbali/ggplot_xplorerr
R
false
false
123
r
# cut interval: n groups with equal range # cut number: n groups with equal observations # cut width: n groups with width
# Defines shiny bindings shiny_input_bindings <- new.env(parent = emptyenv()) list2env(list( 'shiny.textInput' = list( binding = "shiny.textInput", update_function = "shiny::updateTextInput" ), 'shiny.textAreaInput' = list( binding = "shiny.textareaInput", update_function = "shiny::updateTextArea...
/dipsaus/R/shiny-inputbindings.R
no_license
akhikolla/TestedPackages-NoIssues
R
false
false
7,708
r
# Defines shiny bindings shiny_input_bindings <- new.env(parent = emptyenv()) list2env(list( 'shiny.textInput' = list( binding = "shiny.textInput", update_function = "shiny::updateTextInput" ), 'shiny.textAreaInput' = list( binding = "shiny.textareaInput", update_function = "shiny::updateTextArea...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/svm_code.R \name{plotperf} \alias{plotperf} \title{Performance plots for the approximation of an SVM model.} \usage{ plotperf(mymodel, mydata, indy, mytestdata, type = "all", filename) } \arguments{ \item{mymodel}{Element of class \c...
/man/plotperf.Rd
no_license
mariakalimeri/VRPM
R
false
true
3,198
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/svm_code.R \name{plotperf} \alias{plotperf} \title{Performance plots for the approximation of an SVM model.} \usage{ plotperf(mymodel, mydata, indy, mytestdata, type = "all", filename) } \arguments{ \item{mymodel}{Element of class \c...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/parameters.R \name{parameters} \alias{parameters} \title{Parameters} \usage{ parameters(...) } \arguments{ \item{...}{\code{\link{Parameter-class}} objects.} } \value{ \code{\link{Parameters-class}} object. } \description{ Create a new collec...
/man/parameters.Rd
no_license
prioritizr/prioritizrutils
R
false
true
670
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/parameters.R \name{parameters} \alias{parameters} \title{Parameters} \usage{ parameters(...) } \arguments{ \item{...}{\code{\link{Parameter-class}} objects.} } \value{ \code{\link{Parameters-class}} object. } \description{ Create a new collec...
#' Check species names against spp2exclude and spp2include #' #' Check species names in a data frame. First, rows whose species name matches any in spp2exclude #' are automatically removed from the data frame. Then remaining rows are checked #' against spp2include: if any species name does not match spp2include, an err...
/R/check_spnames.R
permissive
Pakillo/exclosures-Almoraima
R
false
false
1,347
r
#' Check species names against spp2exclude and spp2include #' #' Check species names in a data frame. First, rows whose species name matches any in spp2exclude #' are automatically removed from the data frame. Then remaining rows are checked #' against spp2include: if any species name does not match spp2include, an err...
###################################### # 11.10.2016 # Multiple Linear Regression (MLR) example # BISC 481 ###################################### ## Install and initialize packages install.packages("ggplot2") install.packages("grid") library(ggplot2) library(grid) ## Theme my.theme <- theme( plot.margin = unit(c(0.1...
/High Thoroughput in vitro data analysis.R
no_license
rhyunyp/BISC481-assignment
R
false
false
1,187
r
###################################### # 11.10.2016 # Multiple Linear Regression (MLR) example # BISC 481 ###################################### ## Install and initialize packages install.packages("ggplot2") install.packages("grid") library(ggplot2) library(grid) ## Theme my.theme <- theme( plot.margin = unit(c(0.1...
library(wavethresh) ### Name: PsiJ ### Title: Compute discrete autocorrelation wavelets. ### Aliases: PsiJ ### Keywords: manip ### ** Examples # # Let us create the discrete autocorrelation wavelets for the Haar wavelet. # We shall create up to scale 4. # PsiJ(-4, filter.number=1, family="DaubExPhase") #Computing P...
/data/genthat_extracted_code/wavethresh/examples/PsiJ.rd.R
no_license
surayaaramli/typeRrh
R
false
false
3,136
r
library(wavethresh) ### Name: PsiJ ### Title: Compute discrete autocorrelation wavelets. ### Aliases: PsiJ ### Keywords: manip ### ** Examples # # Let us create the discrete autocorrelation wavelets for the Haar wavelet. # We shall create up to scale 4. # PsiJ(-4, filter.number=1, family="DaubExPhase") #Computing P...
library(dplyr) library(lubridate) #Import data power_data <- read_delim("household_power_consumption.txt", delim = ";") %>% filter(Date %in% c("2/2/2007", "1/2/2007")) %>% mutate(DateTime = dmy_hms(paste(Date,as.character(Time)))) png(filename = "plot1.png", width = 504, height = 504) with(power_data,hist(Globa...
/plot1.R
no_license
MottledOne/ExData_Plotting1
R
false
false
452
r
library(dplyr) library(lubridate) #Import data power_data <- read_delim("household_power_consumption.txt", delim = ";") %>% filter(Date %in% c("2/2/2007", "1/2/2007")) %>% mutate(DateTime = dmy_hms(paste(Date,as.character(Time)))) png(filename = "plot1.png", width = 504, height = 504) with(power_data,hist(Globa...
##' @export id <- function(object,...) UseMethod("id") ##' Extract different 'id' of neuro netCDF files ##' ##' @title Extract different 'id' of neuro netCDF files ##' @param object netCDF filename ##' @param ... Additional low level argument parsed on to lower level functions ##' @author Klaus K. Holst ##' @S3method ...
/R/id.R
no_license
kkholst/neurocdf
R
false
false
644
r
##' @export id <- function(object,...) UseMethod("id") ##' Extract different 'id' of neuro netCDF files ##' ##' @title Extract different 'id' of neuro netCDF files ##' @param object netCDF filename ##' @param ... Additional low level argument parsed on to lower level functions ##' @author Klaus K. Holst ##' @S3method ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/glue_operations.R \name{glue_batch_create_partition} \alias{glue_batch_create_partition} \title{Creates one or more partitions in a batch operation} \usage{ glue_batch_create_partition(CatalogId, DatabaseName, TableName, PartitionInputList)...
/paws/man/glue_batch_create_partition.Rd
permissive
johnnytommy/paws
R
false
true
2,450
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/glue_operations.R \name{glue_batch_create_partition} \alias{glue_batch_create_partition} \title{Creates one or more partitions in a batch operation} \usage{ glue_batch_create_partition(CatalogId, DatabaseName, TableName, PartitionInputList)...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/GOsummer.R \name{GOsummer} \alias{GOsummer} \title{GOsummer is the function that you can use to do summerization on the myGO object.} \usage{ GOsummer(mygo, Type, Term) } \arguments{ \item{mygo, Type, Term}{Type is the ontology type: MF, BP, ...
/DraOnto.db/man/GOsummer.Rd
no_license
xpingli/DraOnto.db
R
false
true
1,747
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/GOsummer.R \name{GOsummer} \alias{GOsummer} \title{GOsummer is the function that you can use to do summerization on the myGO object.} \usage{ GOsummer(mygo, Type, Term) } \arguments{ \item{mygo, Type, Term}{Type is the ontology type: MF, BP, ...
library("tidyverse") library("tidyr") library("stringr") library("dplyr") library("tibble") library("readr") library("ggplot2") library("dplyr") x = read_csv("eddypro.csv", skip = 1, na =c("","NA","-9999","-9999.0"), comment=c("[")) x = x[-1,] x glimpse(x) x = select(x, -(roll)) x<-x[,c(-1,-3,-9,-12,-15,-1...
/test1.R
no_license
alexissolovev24/MathMod
R
false
false
2,061
r
library("tidyverse") library("tidyr") library("stringr") library("dplyr") library("tibble") library("readr") library("ggplot2") library("dplyr") x = read_csv("eddypro.csv", skip = 1, na =c("","NA","-9999","-9999.0"), comment=c("[")) x = x[-1,] x glimpse(x) x = select(x, -(roll)) x<-x[,c(-1,-3,-9,-12,-15,-1...
CMADE <- function(par, fn, ..., lower, upper, control=list()) { library("ringbuffer") ## Function to check the presence of options in the arguments specified by the user # @name - argument name # @default - default value of the argument # RETURN: value specified by user if the given argument name found,...
/CEC2017/CMADE-v12/CMADEv12.R
no_license
Jagorius/EvolutionAlgorithms
R
false
false
16,221
r
CMADE <- function(par, fn, ..., lower, upper, control=list()) { library("ringbuffer") ## Function to check the presence of options in the arguments specified by the user # @name - argument name # @default - default value of the argument # RETURN: value specified by user if the given argument name found,...
## Put comments here that give an overall description of what your ## functions do ## Creating a list with functions defined in an environment ## where data are saved. makeCacheMatrix <- function(x = matrix()) { ivr <- NULL set <- function(y) { x <<- y ivr <<- NULL } get <- function() x inv...
/cachematrix.R
no_license
archelangelo/ProgrammingAssignment2
R
false
false
742
r
## Put comments here that give an overall description of what your ## functions do ## Creating a list with functions defined in an environment ## where data are saved. makeCacheMatrix <- function(x = matrix()) { ivr <- NULL set <- function(y) { x <<- y ivr <<- NULL } get <- function() x inv...
get_council_le <- function(data, input){ reactive({ req(input$select_sex) req(input$select_year) data %>% filter(council_name != "Scotland Wide", sex %in% input$select_sex, year == input$select_year, simd_quintiles == "All") %>% ...
/life_ex_tab_functions/4_get_council_le.R
no_license
hgw2/scotland_health_group_project
R
false
false
383
r
get_council_le <- function(data, input){ reactive({ req(input$select_sex) req(input$select_year) data %>% filter(council_name != "Scotland Wide", sex %in% input$select_sex, year == input$select_year, simd_quintiles == "All") %>% ...
library(dplyr) library(ggplot2) library(ggthemes) library(rpart) library(rpart.plot) dataset <- read.csv(file.choose()) # Conhecendo os dados dim(dataset) str(dataset) summary(dataset) dataset$userid <- NULL # Remove o ID # Alterando o nome das colunas colnames(dataset) <- c('Idade', 'Dia', 'Ano', 'Mês', 'Sexo', ...
/analise_de_dados_do_facebook/analise_de_dados_facebook.R
no_license
murilo-cremon/R-Lang
R
false
false
4,007
r
library(dplyr) library(ggplot2) library(ggthemes) library(rpart) library(rpart.plot) dataset <- read.csv(file.choose()) # Conhecendo os dados dim(dataset) str(dataset) summary(dataset) dataset$userid <- NULL # Remove o ID # Alterando o nome das colunas colnames(dataset) <- c('Idade', 'Dia', 'Ano', 'Mês', 'Sexo', ...
rm(list = ls()) library(dplyr) library(leaflet) library(leaflet.extras) library(rgdal) library(mapview) library(sf) setwd("C:/Users/REACH/Dropbox (SSD REACH)/REACH South Sudan upscale/34_WFP/11_WFP_IACWG") coordinates <- read.csv('8. Dashboard/r_dashboard/app_plot/coordinates.csv') jmmi <- read.csv('7. JMMI ...
/app_plot/4_Practice/Leaflet_CWG.R
no_license
JonathanBuckleyREACHSSD/SSD-JMMI-Draft
R
false
false
5,989
r
rm(list = ls()) library(dplyr) library(leaflet) library(leaflet.extras) library(rgdal) library(mapview) library(sf) setwd("C:/Users/REACH/Dropbox (SSD REACH)/REACH South Sudan upscale/34_WFP/11_WFP_IACWG") coordinates <- read.csv('8. Dashboard/r_dashboard/app_plot/coordinates.csv') jmmi <- read.csv('7. JMMI ...
library(dplyr) library(here) setwd(paste0(here(), "/LER_inputs/")) oneday <- filter(manual_buoy_temptst, datetime == "1986-07-03 12:00:00") oneday$Water_Temperature_celsius <- 4 oneday$datetime <- as.POSIXct("1975-01-01 12:00:00", format = "%Y-%m-%d %H:%M:%S") write.csv(oneday, row.names = FALSE, file = "ic_hi...
/scripts/stepthrough/step_1_input_data/s1.5_initial_conditions.R
no_license
jacob8776/sunapee_LER_projections
R
false
false
1,614
r
library(dplyr) library(here) setwd(paste0(here(), "/LER_inputs/")) oneday <- filter(manual_buoy_temptst, datetime == "1986-07-03 12:00:00") oneday$Water_Temperature_celsius <- 4 oneday$datetime <- as.POSIXct("1975-01-01 12:00:00", format = "%Y-%m-%d %H:%M:%S") write.csv(oneday, row.names = FALSE, file = "ic_hi...
#######################################################This code is for running INLA Spatial models ####################################################### #######################################################set seed to get similar results####################################################### #####################...
/code/inla_spatial_temporal_morbidity.R
no_license
emilyrfl/SDSS-Datahack-2019
R
false
false
11,313
r
#######################################################This code is for running INLA Spatial models ####################################################### #######################################################set seed to get similar results####################################################### #####################...
############################################################## # Getting and Cleaning Data Course # Final Programming Assignment ############################################################## library(dplyr) library(tidyr) # 1. Read in traing and test sets # feature names (note: remove "meanFreq") feat_names <- read.t...
/run_analysis.R
no_license
frankzyx/Getting_and_cleaning_data__Coursera
R
false
false
1,731
r
############################################################## # Getting and Cleaning Data Course # Final Programming Assignment ############################################################## library(dplyr) library(tidyr) # 1. Read in traing and test sets # feature names (note: remove "meanFreq") feat_names <- read.t...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_facets.R \name{get_facets} \alias{get_facets} \title{Get Dataverse facets} \usage{ get_facets(dataverse, key = Sys.getenv("DATAVERSE_KEY"), server = Sys.getenv("DATAVERSE_SERVER"), ...) } \arguments{ \item{dataverse}{A character string ...
/man/get_facets.Rd
permissive
wibeasley/dataverse-client-r
R
false
true
1,734
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_facets.R \name{get_facets} \alias{get_facets} \title{Get Dataverse facets} \usage{ get_facets(dataverse, key = Sys.getenv("DATAVERSE_KEY"), server = Sys.getenv("DATAVERSE_SERVER"), ...) } \arguments{ \item{dataverse}{A character string ...
#' Vector of evaluated parameters in the simulation study that will be summarised #' using the rsimsum package #' @return vector of length 12 with the names of the to be evaluated parameters #' and the name of their monte carlo standerd error eval_param_rsimsum <- function(){ eval_param_rsimsum <- c("bias", ...
/R/sumsim.R
no_license
LindaNab/simexvsmecor
R
false
false
6,218
r
#' Vector of evaluated parameters in the simulation study that will be summarised #' using the rsimsum package #' @return vector of length 12 with the names of the to be evaluated parameters #' and the name of their monte carlo standerd error eval_param_rsimsum <- function(){ eval_param_rsimsum <- c("bias", ...
# Emi Tanaka (@statsgen) and Garrick Aden-Buie (@grrrck) and Evangeline Reynolds (@EvaMaeRey) # have contributed to this code # how to solve "no visible binding for global variable" note utils::globalVariables( c('func', '.', 'raw_code', 'non_seq', 'func', '.','raw_code', '.', 'replacements','line','code','highligh...
/R/a_create_test_code.R
permissive
brshallo/flipbookr
R
false
false
4,314
r
# Emi Tanaka (@statsgen) and Garrick Aden-Buie (@grrrck) and Evangeline Reynolds (@EvaMaeRey) # have contributed to this code # how to solve "no visible binding for global variable" note utils::globalVariables( c('func', '.', 'raw_code', 'non_seq', 'func', '.','raw_code', '.', 'replacements','line','code','highligh...
library(rvest) res_ptt_get <- read_html('https://www.ptt.cc/bbs/hotboards.html',encoding = "big5") ptt_nodes <- html_nodes(res_ptt_get, xpath = '//div[@class="board-title"]') html_text(ptt_nodes) %>% head()
/Week2/Simple_Crawer/post_PPT_title.r
no_license
d336643/2018_CSX_RProject
R
false
false
206
r
library(rvest) res_ptt_get <- read_html('https://www.ptt.cc/bbs/hotboards.html',encoding = "big5") ptt_nodes <- html_nodes(res_ptt_get, xpath = '//div[@class="board-title"]') html_text(ptt_nodes) %>% head()
# library(R2admb) setwd("C:/admb/admb101-gcc452-win64/examples/admb/SnapInner2015") area="nw" # HERE set area="ea" or "nw" or "sw" plot.out=0 # HERE set =0 or 1 for screen or =2 for tiff output # ==================================================================================================== dat <- read...
/InnGulfFdata.R
no_license
peterfish55/InnerBaysnapper
R
false
false
19,903
r
# library(R2admb) setwd("C:/admb/admb101-gcc452-win64/examples/admb/SnapInner2015") area="nw" # HERE set area="ea" or "nw" or "sw" plot.out=0 # HERE set =0 or 1 for screen or =2 for tiff output # ==================================================================================================== dat <- read...
###### ##### Mothur output files and resulting modified files: # - alpha diversity measures --> xanthan_name_summary.txt # - input file is a summary file of alpha diversity measures created in mothur # - output file combines these with metadata # - xanthan_name.final.0.03.cons.taxonomy --> xanthan_name.taxonomy....
/Code/mothur_preanalysis_file_processing_cefoperazone.R
no_license
mschnizlein/xg_microbiota
R
false
false
13,268
r
###### ##### Mothur output files and resulting modified files: # - alpha diversity measures --> xanthan_name_summary.txt # - input file is a summary file of alpha diversity measures created in mothur # - output file combines these with metadata # - xanthan_name.final.0.03.cons.taxonomy --> xanthan_name.taxonomy....
setwd("/Users/chiewluanl/RProject/ExData_Plotting1") library(httr) if(!file.exists("./data")){ dir.create("./data") fileUrl <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" download.file(fileUrl,destfile="./data/household_power_consumption.zip",method="curl") unzip(z...
/Plot2.R
no_license
chiewluanl/ExData_Plotting1
R
false
false
972
r
setwd("/Users/chiewluanl/RProject/ExData_Plotting1") library(httr) if(!file.exists("./data")){ dir.create("./data") fileUrl <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" download.file(fileUrl,destfile="./data/household_power_consumption.zip",method="curl") unzip(z...
# Problem: Does a employee level 6.5 earn 160 k? # Importing the dataset dataset = read.csv('Position_Salaries.csv') dataset = dataset[2:3] # Splitting the dataset into the Training set and Test set # # install.packages('caTools') # library(caTools) # set.seed(123) # split = sample.split(dataset$Salary, SplitRatio = ...
/Part 2 - Regression/Section 9 - Random Forest Regression/forest_regression.R
no_license
Kostevski/ML-scripts
R
false
false
1,345
r
# Problem: Does a employee level 6.5 earn 160 k? # Importing the dataset dataset = read.csv('Position_Salaries.csv') dataset = dataset[2:3] # Splitting the dataset into the Training set and Test set # # install.packages('caTools') # library(caTools) # set.seed(123) # split = sample.split(dataset$Salary, SplitRatio = ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mosek-solver.R \docType{methods} \name{status_map,MOSEK-method} \alias{status_map,MOSEK-method} \title{MOSEK Status Map} \usage{ \S4method{status_map}{MOSEK}(solver, status) } \arguments{ \item{solver}{A \linkS4class{MOSEK} object.} \item{st...
/man/MOSEK-status_map.Rd
permissive
aszekMosek/CVXR
R
false
true
699
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mosek-solver.R \docType{methods} \name{status_map,MOSEK-method} \alias{status_map,MOSEK-method} \title{MOSEK Status Map} \usage{ \S4method{status_map}{MOSEK}(solver, status) } \arguments{ \item{solver}{A \linkS4class{MOSEK} object.} \item{st...
{ set.seed(42782) tic() # DC implementation source("20200705-DCDR-Functions.R") # getRES function is now relocated to a separate file (20200720-Algos-code.R) source("20200720-Algos-code.R") # regression models for GLM / AIPW if (estimateWithMore == T){ out_path <- "/Users/garethalex/Desktop/Hu...
/Code/20200904-run-sim-code.R
no_license
mengeks/drml-plasmode
R
false
false
2,925
r
{ set.seed(42782) tic() # DC implementation source("20200705-DCDR-Functions.R") # getRES function is now relocated to a separate file (20200720-Algos-code.R) source("20200720-Algos-code.R") # regression models for GLM / AIPW if (estimateWithMore == T){ out_path <- "/Users/garethalex/Desktop/Hu...
#' Country names #' #' Convert country names to echarts format. #' #' @param data Data.frame in which to find column names. #' @param input,output Input and output columns. #' @param type Passed to \link[countrycode]{countrycode} \code{origin} parameter. #' @param ... Any other parameter to pass to \link[countrycode]{c...
/R/helpers.R
no_license
cran/echarts4r
R
false
false
8,496
r
#' Country names #' #' Convert country names to echarts format. #' #' @param data Data.frame in which to find column names. #' @param input,output Input and output columns. #' @param type Passed to \link[countrycode]{countrycode} \code{origin} parameter. #' @param ... Any other parameter to pass to \link[countrycode]{c...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rcax_escdata.R \name{rcax_escdata} \alias{rcax_escdata} \title{Get EscData table} \usage{ rcax_escdata( tablename = "EscData", flist = NULL, qlist = NULL, cols = NULL, sortcols = c("countdate", "refid"), type = c("data.frame", "co...
/man/rcax_escdata.Rd
permissive
nwfsc-math-bio/rCAX
R
false
true
2,350
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rcax_escdata.R \name{rcax_escdata} \alias{rcax_escdata} \title{Get EscData table} \usage{ rcax_escdata( tablename = "EscData", flist = NULL, qlist = NULL, cols = NULL, sortcols = c("countdate", "refid"), type = c("data.frame", "co...
# Stream residence time of salmon # 2015-07-10 CJS Update with split; ggplot2; lsmemans; contrasts etc # The stream residence of time was measured for individually tagged fish in # a number of YearFs. # Example of a two factor CRD analysis of variance with unbalanced data options(useFancyQuotes=FALS...
/Sampling_Regression_Experiment_Design_and_Analysis/residence.r
no_license
burakbayramli/books
R
false
false
6,918
r
# Stream residence time of salmon # 2015-07-10 CJS Update with split; ggplot2; lsmemans; contrasts etc # The stream residence of time was measured for individually tagged fish in # a number of YearFs. # Example of a two factor CRD analysis of variance with unbalanced data options(useFancyQuotes=FALS...
## Caching the inverse of a Matrix ## Matrix inversion is computationally expensive to be performed repeatedly. ## Therefore the functions in this program calculates the inverse and stores in ## the cache. This data is accessed whenever the inverse is called. ## Creates a matrix object that can cache its inver...
/cachematrix.R
no_license
chidam181/ProgrammingAssignment2
R
false
false
1,619
r
## Caching the inverse of a Matrix ## Matrix inversion is computationally expensive to be performed repeatedly. ## Therefore the functions in this program calculates the inverse and stores in ## the cache. This data is accessed whenever the inverse is called. ## Creates a matrix object that can cache its inver...
#!/usr/bin/Rscript # seqstats_density.R # Density plots for sequencing stats. # # Author: Daniel A Cuevas (dcuevas08.at.gmail.com) # Created on 23 Nov 2016 # Updated on 20 Mar 2017 # Import necessary packages # These may need to be installed first if ("getopt" %in% rownames(installed.packages()) == F) { install.pa...
/scripts/seqstats/seqstats_density.R
no_license
Adrian-Cantu/cf_pipeline
R
false
false
5,686
r
#!/usr/bin/Rscript # seqstats_density.R # Density plots for sequencing stats. # # Author: Daniel A Cuevas (dcuevas08.at.gmail.com) # Created on 23 Nov 2016 # Updated on 20 Mar 2017 # Import necessary packages # These may need to be installed first if ("getopt" %in% rownames(installed.packages()) == F) { install.pa...
testlist <- list(data = structure(c(-3.879448322712e+260, NaN), .Dim = 1:2), q = 6.95335580945396e-310) result <- do.call(biwavelet:::rcpp_row_quantile,testlist) str(result)
/biwavelet/inst/testfiles/rcpp_row_quantile/libFuzzer_rcpp_row_quantile/rcpp_row_quantile_valgrind_files/1610556855-test.R
no_license
akhikolla/updated-only-Issues
R
false
false
178
r
testlist <- list(data = structure(c(-3.879448322712e+260, NaN), .Dim = 1:2), q = 6.95335580945396e-310) result <- do.call(biwavelet:::rcpp_row_quantile,testlist) str(result)
library(photobiologyWavebands) ### Name: Orange ### Title: Constructor of orange waveband ### Aliases: Orange ### ** Examples Orange() Orange("ISO")
/data/genthat_extracted_code/photobiologyWavebands/examples/Orange.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
157
r
library(photobiologyWavebands) ### Name: Orange ### Title: Constructor of orange waveband ### Aliases: Orange ### ** Examples Orange() Orange("ISO")
# old rasters from Greg 2015 I think. # rastersOLD <- prepInputs( # url = "https://drive.google.com/file/d/1DN31xcXh97u6v8NaVcy0O3vzKpLpld69/view?usp=sharing", # fun = "raster::stack", # #rasterToMatch = masterRaster, useGDAL = FALSE) # this was Eliot's # destinationPath = 'inputs') # # stackIan <- p...
/buildingAgeRaster1985.R
no_license
cboisvenue/CBM_dataPrep_RIApresentDayTempError
R
false
false
26,811
r
# old rasters from Greg 2015 I think. # rastersOLD <- prepInputs( # url = "https://drive.google.com/file/d/1DN31xcXh97u6v8NaVcy0O3vzKpLpld69/view?usp=sharing", # fun = "raster::stack", # #rasterToMatch = masterRaster, useGDAL = FALSE) # this was Eliot's # destinationPath = 'inputs') # # stackIan <- p...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/reaction.R \name{reaction} \alias{reaction} \title{Define a reaction} \usage{ reaction(propensity, effect, name = NA_character_) } \arguments{ \item{propensity}{\verb{[character/formula]} A character or formula representation of the propensit...
/man/reaction.Rd
no_license
rcannood/GillespieSSA2
R
false
true
1,692
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/reaction.R \name{reaction} \alias{reaction} \title{Define a reaction} \usage{ reaction(propensity, effect, name = NA_character_) } \arguments{ \item{propensity}{\verb{[character/formula]} A character or formula representation of the propensit...
# 10.27 In Class Assignment library(ISLR) library(MASS) library(boot) set.seed(1) help("sample") train = sample(392,196) lm.fit <- lm(mpg~horsepower, data = Auto, subset = train) attach(Auto) mean((mpg-predict(lm.fit,Auto))[-train]^2) lm.fit2 <- lm(mpg~poly(horsepower,2), data = Auto, subset = train...
/group3lab1_randomforest1.R
no_license
ArnoZhang47/DataAnalytics2020_YuxiangZhang
R
false
false
2,668
r
# 10.27 In Class Assignment library(ISLR) library(MASS) library(boot) set.seed(1) help("sample") train = sample(392,196) lm.fit <- lm(mpg~horsepower, data = Auto, subset = train) attach(Auto) mean((mpg-predict(lm.fit,Auto))[-train]^2) lm.fit2 <- lm(mpg~poly(horsepower,2), data = Auto, subset = train...
# Plot model outputs and fit library(postjags) library(ggplot2) library(dplyr) library(cowplot) # logit and antilogit functions logit <- function(x) { log(x/(1-x)) } ilogit <- function(x){ exp(x) / (1 + exp(x)) } # read in data load("../../../../cleaned_data/cover_mono.Rdata") # cover_mono # convert to proportion...
/models/cover/forbs/mono/Forbs_plots.R
permissive
cct-datascience/rangeland-restore
R
false
false
9,462
r
# Plot model outputs and fit library(postjags) library(ggplot2) library(dplyr) library(cowplot) # logit and antilogit functions logit <- function(x) { log(x/(1-x)) } ilogit <- function(x){ exp(x) / (1 + exp(x)) } # read in data load("../../../../cleaned_data/cover_mono.Rdata") # cover_mono # convert to proportion...
#==============Load the packages================ library(tseries) library(vars) library(tidyverse) library(e1071) #==============Load the data==================== setwd('D:/Fall Semester/SYS6018/sysproject/Data') corn<-read.csv('Corn.csv') source('Metrics.R') #==============Data Transformations==============...
/SYS6018 Final Project/Individual Product Models/Group 1 products (time series models also performed)/SVM/cornsvm.R
no_license
alizaidia/SysProject
R
false
false
2,569
r
#==============Load the packages================ library(tseries) library(vars) library(tidyverse) library(e1071) #==============Load the data==================== setwd('D:/Fall Semester/SYS6018/sysproject/Data') corn<-read.csv('Corn.csv') source('Metrics.R') #==============Data Transformations==============...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/funcs_add_new_data_series.R \name{rbinddatasetNMR} \alias{rbinddatasetNMR} \title{Row-bind two datasets for NMR with slight changes, check duplicated keys, set order} \usage{ rbinddatasetNMR(dt_master, dt_new) } \arguments{ \item{dt_master}{m...
/man/rbinddatasetNMR.Rd
permissive
unicef-drp/CME.assistant
R
false
true
511
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/funcs_add_new_data_series.R \name{rbinddatasetNMR} \alias{rbinddatasetNMR} \title{Row-bind two datasets for NMR with slight changes, check duplicated keys, set order} \usage{ rbinddatasetNMR(dt_master, dt_new) } \arguments{ \item{dt_master}{m...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/has_intercept.R \name{has_intercept} \alias{has_intercept} \title{Find out whether a model includes an intercept} \usage{ has_intercept(model) } \arguments{ \item{model}{a model object.} } \value{ logical. \code{TRUE} if the intercept is pres...
/man/has_intercept.Rd
no_license
RymerLab/remef
R
false
true
457
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/has_intercept.R \name{has_intercept} \alias{has_intercept} \title{Find out whether a model includes an intercept} \usage{ has_intercept(model) } \arguments{ \item{model}{a model object.} } \value{ logical. \code{TRUE} if the intercept is pres...
getComposingPrimes <- function (primes, vec.primes) { if(is.null(primes)) return(NULL) a <- strsplit(primes, split = " & ") b <- strsplit(vec.primes, split = " & ") d <- numeric(length(vec.primes)) for (i in 1:length(primes)){ d <- d + sapply(b, function (x, y) ifelse( all(x %in% y) && (length(x...
/R/getComposingPrimes.R
no_license
holgerschw/logicFS
R
false
false
443
r
getComposingPrimes <- function (primes, vec.primes) { if(is.null(primes)) return(NULL) a <- strsplit(primes, split = " & ") b <- strsplit(vec.primes, split = " & ") d <- numeric(length(vec.primes)) for (i in 1:length(primes)){ d <- d + sapply(b, function (x, y) ifelse( all(x %in% y) && (length(x...
### Code for reading data and plot1 library(dplyr) library(pryr) library(data.table) library(tidyr) library(lubridate) # Download of data and keep under the directory----------------------------------------------- url <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" f <...
/plot3.r
no_license
karthyram/ExData_Plotting1
R
false
false
2,389
r
### Code for reading data and plot1 library(dplyr) library(pryr) library(data.table) library(tidyr) library(lubridate) # Download of data and keep under the directory----------------------------------------------- url <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" f <...
library("nleqslv") # Dennis & Schnabel,1996,"Numerical methods for unconstrained optimization and nonlinear equations", SIAM # example 6.5.1 page 149 dslnex <- function(x) { y <- numeric(2) y[1] <- x[1]^2 + x[2]^2 - 2 y[2] <- exp(x[1]-1) + x[2]^3 - 2 y } xstart <- c(2,0.5) fstart <- dslnex(xstart) ...
/tests/dslnexCN.R
no_license
cran/nleqslv
R
false
false
1,228
r
library("nleqslv") # Dennis & Schnabel,1996,"Numerical methods for unconstrained optimization and nonlinear equations", SIAM # example 6.5.1 page 149 dslnex <- function(x) { y <- numeric(2) y[1] <- x[1]^2 + x[2]^2 - 2 y[2] <- exp(x[1]-1) + x[2]^3 - 2 y } xstart <- c(2,0.5) fstart <- dslnex(xstart) ...
#' Create PNG file from plottable object #' #' \code{to_pdf} plots an object directly into one ore multiple PDF files. #' #' @param x object to plot. #' @param name name used for output file(s), might be extended if multiple plots #' are generated and no ending is needed (e.g. 'my_file'). #' @param ... further...
/R/to_png.R
permissive
kkmann/describr
R
false
false
2,919
r
#' Create PNG file from plottable object #' #' \code{to_pdf} plots an object directly into one ore multiple PDF files. #' #' @param x object to plot. #' @param name name used for output file(s), might be extended if multiple plots #' are generated and no ending is needed (e.g. 'my_file'). #' @param ... further...
## ## Write the result of a Redshift sql query to a dataframe ## library(RPostgreSQL) library(uuid) ReadSqlResults <- function(con, sql.query, aws.access.key, aws.secret.key, s3.bucket, redshift.iam.role) { path <- paste0("data/tmp/", UUIDgenerate()) print("Running SQL query") # Escape single quotes in the que...
/db.R
no_license
abrenaut/redshift-r-quick-read
R
false
false
1,340
r
## ## Write the result of a Redshift sql query to a dataframe ## library(RPostgreSQL) library(uuid) ReadSqlResults <- function(con, sql.query, aws.access.key, aws.secret.key, s3.bucket, redshift.iam.role) { path <- paste0("data/tmp/", UUIDgenerate()) print("Running SQL query") # Escape single quotes in the que...
## Matrix inversion is usually a costly computation and there ## may be some benefit to caching the inverse of a matrix rather ## than compute it repeatedly. ## This function creates a special "matrix" object that can ## cache its inverse. makeCacheMatrix <- function(x = matrix()) { m<-NULL set<-function...
/cachematrix.R
no_license
irismeng/ProgrammingAssignment2
R
false
false
833
r
## Matrix inversion is usually a costly computation and there ## may be some benefit to caching the inverse of a matrix rather ## than compute it repeatedly. ## This function creates a special "matrix" object that can ## cache its inverse. makeCacheMatrix <- function(x = matrix()) { m<-NULL set<-function...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ineqQuantile.R \name{run_optim_LC} \alias{run_optim_LC} \title{Optimisation of a parametric Lorenz curve for several functional forms and several areas} \usage{ run_optim_LC(ID, income_cum, population_cum, function_form) } \arguments{ \item{I...
/man/run_optim_LC.Rd
no_license
EnoraBelz/Inequality
R
false
true
1,480
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ineqQuantile.R \name{run_optim_LC} \alias{run_optim_LC} \title{Optimisation of a parametric Lorenz curve for several functional forms and several areas} \usage{ run_optim_LC(ID, income_cum, population_cum, function_form) } \arguments{ \item{I...
install.packages("dplyr",dependencies = TRUE) install.packages("xlsx",dependencies = TRUE) install.packages("ggplot2",dependencies = TRUE) install.packages("RODBC",dependencies = TRUE) install.packages("ztable",dependencies = TRUE)
/AOI_INSTALL_REQUIRED_PACKAGES.R
no_license
agiannikos/Hevel
R
false
false
232
r
install.packages("dplyr",dependencies = TRUE) install.packages("xlsx",dependencies = TRUE) install.packages("ggplot2",dependencies = TRUE) install.packages("RODBC",dependencies = TRUE) install.packages("ztable",dependencies = TRUE)
#!/usr/bin/Rscript ## And now continue as before. get_sepsis_score = function(CINCdata, myModel){ myModel <- load_sepsis_model() ## Add the column names back colnames(CINCdata) <- c("HR", "O2Sat", "Temp", "SBP", "MAP", "DBP", "Resp", "EtCO2", "BaseExcess", "HCO3", "FiO2", "pH", "PaCO2...
/UBCDHIL/pnc2019_22Aug/get_sepsis_score.R
permissive
Eric-Hsieh97/2019ChallengeEntries
R
false
false
24,197
r
#!/usr/bin/Rscript ## And now continue as before. get_sepsis_score = function(CINCdata, myModel){ myModel <- load_sepsis_model() ## Add the column names back colnames(CINCdata) <- c("HR", "O2Sat", "Temp", "SBP", "MAP", "DBP", "Resp", "EtCO2", "BaseExcess", "HCO3", "FiO2", "pH", "PaCO2...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/classic.wordscores.R \name{classic.wordscores} \alias{classic.wordscores} \title{Old-Style Wordscores} \usage{ classic.wordscores(wfm, scores) } \arguments{ \item{wfm}{object of class wfm} \item{scores}{reference document positions/scores} }...
/man/classic.wordscores.Rd
no_license
markwestcott34/austin
R
false
true
1,264
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/classic.wordscores.R \name{classic.wordscores} \alias{classic.wordscores} \title{Old-Style Wordscores} \usage{ classic.wordscores(wfm, scores) } \arguments{ \item{wfm}{object of class wfm} \item{scores}{reference document positions/scores} }...
d <- read.csv2("data/rhc_devoir_epidemio.csv") head(d) str(d) dim(d) summary(d) d$SADMDTE <- as.Date(d$SADMDTE,"%d/%m/%Y") d$DSCHDTE <- as.Date(d$DSCHDTE,"%d/%m/%Y") d$DTHDTE <- as.Date(d$DTHDTE,"%d/%m/%Y") d$LSTCTDTE <- as.Date(d$LSTCTDTE,"%d/%m/%Y") for (i in c("DEATH", "DTH30", "DNR1", "RESP", "CARD", "NEURO"...
/src/epid_data_management.R
no_license
feldmans/M2MSR-epid
R
false
false
29,811
r
d <- read.csv2("data/rhc_devoir_epidemio.csv") head(d) str(d) dim(d) summary(d) d$SADMDTE <- as.Date(d$SADMDTE,"%d/%m/%Y") d$DSCHDTE <- as.Date(d$DSCHDTE,"%d/%m/%Y") d$DTHDTE <- as.Date(d$DTHDTE,"%d/%m/%Y") d$LSTCTDTE <- as.Date(d$LSTCTDTE,"%d/%m/%Y") for (i in c("DEATH", "DTH30", "DNR1", "RESP", "CARD", "NEURO"...