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
setwd(dir = "C:/Users/Lisa/Documents/phd/southern ocean/Mixed models") glm.full <- read.table(file = "glm.full.txt", header= T) stn.info <- read.table(file = "station_information.txt", skip = 1, fill = T) glm.full.cut <- read.table(file = "glm.full.cut.txt", header = T) attach(glm.full) library(asreml) library(calibrat...
/random autoregressive process by depth.R
no_license
lisamarieharrison/R-mixed-models
R
false
false
4,241
r
setwd(dir = "C:/Users/Lisa/Documents/phd/southern ocean/Mixed models") glm.full <- read.table(file = "glm.full.txt", header= T) stn.info <- read.table(file = "station_information.txt", skip = 1, fill = T) glm.full.cut <- read.table(file = "glm.full.cut.txt", header = T) attach(glm.full) library(asreml) library(calibrat...
# getData: # A function with 0 arguments and fetches the necessary data. getData <- function() { # Create a subdirectory for the data if (!file.exists("data")) dir.create("data") # Check to see if the Data fileUrl <-"https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consum...
/HouseholdPowerConsumption/getData.R
no_license
kieranroberts/R-datascience
R
false
false
664
r
# getData: # A function with 0 arguments and fetches the necessary data. getData <- function() { # Create a subdirectory for the data if (!file.exists("data")) dir.create("data") # Check to see if the Data fileUrl <-"https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consum...
dataFile <- "household_power_consumption.txt" data <- read.table(dataFile, header=TRUE, sep=";", stringsAsFactors=FALSE, dec=".") subSetData <- data[data$Date %in% c("1/2/2007","2/2/2007") ,] #str(subSetData) datetime <- strptime(paste(subSetData$Date, subSetData$Time, sep=" "), "%d/%m/%Y %H:%M:%S") globalActivePower...
/plot2.R
no_license
just4jc/ExData_Plotting1
R
false
false
510
r
dataFile <- "household_power_consumption.txt" data <- read.table(dataFile, header=TRUE, sep=";", stringsAsFactors=FALSE, dec=".") subSetData <- data[data$Date %in% c("1/2/2007","2/2/2007") ,] #str(subSetData) datetime <- strptime(paste(subSetData$Date, subSetData$Time, sep=" "), "%d/%m/%Y %H:%M:%S") globalActivePower...
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function ## makeCacheMatrix: This function creates a special ## "matrix" object that can cache its inverse. makeCacheMatrix <- function(x = matrix()) { cached_inv <- NULL set <- functi...
/cachematrix.R
no_license
edysulimin/ProgrammingAssignment2
R
false
false
1,174
r
## Put comments here that give an overall description of what your ## functions do ## Write a short comment describing this function ## makeCacheMatrix: This function creates a special ## "matrix" object that can cache its inverse. makeCacheMatrix <- function(x = matrix()) { cached_inv <- NULL set <- functi...
file rnmod - random numbers include rid:rider If Win include rid:tidef Else include rid:rttim End ; Seed created from current time and date. ; Date and time may be static in some environments. ; An alternative would be to store a seed in a file and ; update the seed using a different random algorithm. ; ; rt_gtm used ...
/m/rls/rnmod.r
no_license
rust11/rust
R
false
false
1,182
r
file rnmod - random numbers include rid:rider If Win include rid:tidef Else include rid:rttim End ; Seed created from current time and date. ; Date and time may be static in some environments. ; An alternative would be to store a seed in a file and ; update the seed using a different random algorithm. ; ; rt_gtm used ...
#' Check input argument `inputlist` #' #' Check the elements of the `inputlist` list used as an argument in #' `SS_write()` function. #' #' @param inputlist List created by the `SS_read()` function with #' elements "dat", "ctl", "start", "fore", and (optionally) "wtatage". #' @author Kelli F. Johnson, Ian G. Taylor #' ...
/R/check_inputlist.R
no_license
r4ss/r4ss
R
false
false
1,174
r
#' Check input argument `inputlist` #' #' Check the elements of the `inputlist` list used as an argument in #' `SS_write()` function. #' #' @param inputlist List created by the `SS_read()` function with #' elements "dat", "ctl", "start", "fore", and (optionally) "wtatage". #' @author Kelli F. Johnson, Ian G. Taylor #' ...
# We need to set our working directory setwd("~/Desktop/Intro to R") # remove everything in my work space rm(list =ls()) # import the data but we have to install the necessary package #install.packages("readxl") library(readxl) #install.packages("haven") library(haven) #install.packages("tidyverse") library(tidyver...
/intro to R class 2.R
no_license
mosesaron/Intro-to-data-Analysis-using-R
R
false
false
2,758
r
# We need to set our working directory setwd("~/Desktop/Intro to R") # remove everything in my work space rm(list =ls()) # import the data but we have to install the necessary package #install.packages("readxl") library(readxl) #install.packages("haven") library(haven) #install.packages("tidyverse") library(tidyver...
# library(fpca) # library(fdapace) # library(readr) # library(reshape2) #Cargamos Datos de Vazoes --------------------------------- load("Data/DataVazoes.RData") # BDDv$Fecha = as.character(seq.Date(from=as.Date("1931-01-01"),to=as.Date("2015-12-01"),by="month")) # ACP Funcional Vazoe ===============================...
/App/Code/ACP Funcional/2_ACP Funcional.R
no_license
CristianPachacama/AppTesis
R
false
false
1,693
r
# library(fpca) # library(fdapace) # library(readr) # library(reshape2) #Cargamos Datos de Vazoes --------------------------------- load("Data/DataVazoes.RData") # BDDv$Fecha = as.character(seq.Date(from=as.Date("1931-01-01"),to=as.Date("2015-12-01"),by="month")) # ACP Funcional Vazoe ===============================...
test_that("LinearTerm constraints are converted correctly", { x <- new_linear_term(new_linear_variable(1), coefficient = 1) res <- 5 * x <= 10 expect_s3_class(res, "LinearConstraint") expect_equal(res$rhs, 10) expect_equal(terms_list(res$lhs), terms_list(5 * x + 0)) expect_equal(res$lhs$constant, 0) expec...
/tests/testthat/test-linear-constraints.R
permissive
dirkschumacher/ompr
R
false
false
1,888
r
test_that("LinearTerm constraints are converted correctly", { x <- new_linear_term(new_linear_variable(1), coefficient = 1) res <- 5 * x <= 10 expect_s3_class(res, "LinearConstraint") expect_equal(res$rhs, 10) expect_equal(terms_list(res$lhs), terms_list(5 * x + 0)) expect_equal(res$lhs$constant, 0) expec...
functionToGalaxify <- function(inputfile1=GalaxyInputFile(), inputfile2=GalaxyInputFile(), plotTitle=GalaxyCharacterParam(testValues="test plot title"), plotSubTitle=GalaxyCharacterParam("My subtitle", testValues="test plot subtitle"), outputfile1=GalaxyOutput("mydata", "csv"), outputfile2=G...
/R/test_functions.R
no_license
dtenenba/RGalaxy
R
false
false
4,848
r
functionToGalaxify <- function(inputfile1=GalaxyInputFile(), inputfile2=GalaxyInputFile(), plotTitle=GalaxyCharacterParam(testValues="test plot title"), plotSubTitle=GalaxyCharacterParam("My subtitle", testValues="test plot subtitle"), outputfile1=GalaxyOutput("mydata", "csv"), outputfile2=G...
# Store stop words vocabulary_translation <- readLines("RPackage/data-raw/vocabulary_translation.txt") x <- stringr::str_split(vocabulary_translation, pattern = "\"") vocabulary_translation <- dplyr::data_frame(sv = unlist(lapply(x, FUN = function(x) x[2])), en = unlist(lapply(x, FUN = function(x...
/RPackage/data-raw/vocabulary_translation.R
no_license
MansMeg/rcrpsriksdag
R
false
false
552
r
# Store stop words vocabulary_translation <- readLines("RPackage/data-raw/vocabulary_translation.txt") x <- stringr::str_split(vocabulary_translation, pattern = "\"") vocabulary_translation <- dplyr::data_frame(sv = unlist(lapply(x, FUN = function(x) x[2])), en = unlist(lapply(x, FUN = function(x...
library(ggplot2) library(dplyr) ### Generate plot for the blog post # Load data dat <- readRDS("dat.RDS") # Plot ethnicity over time ethnicityPlot <- ggplot(filter(dat, measure == "ethnicity"), aes(x=year, y=rate, group=category, color=category)) + geom_point() + geom_line() + theme_classic() + theme( pl...
/graphs.R
no_license
haututu/suicideRates
R
false
false
757
r
library(ggplot2) library(dplyr) ### Generate plot for the blog post # Load data dat <- readRDS("dat.RDS") # Plot ethnicity over time ethnicityPlot <- ggplot(filter(dat, measure == "ethnicity"), aes(x=year, y=rate, group=category, color=category)) + geom_point() + geom_line() + theme_classic() + theme( pl...
library(copula) library(mvtnorm) library(matrixcalc) #This function takes a bunch of time series measured at the same #times in different locations and creates surrogate datasets which #are statistically similar except the copula has been randomized #to a copula in the normal family. "Statistcally similar" means the l...
/ncsurrog.R
no_license
sghosh89/Copula_spaceavg
R
false
false
5,972
r
library(copula) library(mvtnorm) library(matrixcalc) #This function takes a bunch of time series measured at the same #times in different locations and creates surrogate datasets which #are statistically similar except the copula has been randomized #to a copula in the normal family. "Statistcally similar" means the l...
## COURSERA - EXPLORATORY DATA - ASSIGNMENT 1 ## ## PLOT 3 ## plot3 <- function(){ url <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" ## DO NOT DOWNLOAD FILE IF IT EXISTS ALREADY ## if (!file.exists("tempfile.zip")) { ...
/plot3.R
no_license
AcutusMens/ExData_Plotting1
R
false
false
1,729
r
## COURSERA - EXPLORATORY DATA - ASSIGNMENT 1 ## ## PLOT 3 ## plot3 <- function(){ url <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" ## DO NOT DOWNLOAD FILE IF IT EXISTS ALREADY ## if (!file.exists("tempfile.zip")) { ...
# Execute pre processing source('pre_processing_credit_data.R') classificator = glm(formula = default ~., family = binomial, data = training_base) credit_predict = predict(classificator, type = 'response', newdata = test_base[-4]) predict_label = ifelse(credit_predict > 0.5, 1, 0) print(predict_label) library(car...
/regression/logistic_regression_credit_data.R
no_license
thalesraymond/curso-r
R
false
false
484
r
# Execute pre processing source('pre_processing_credit_data.R') classificator = glm(formula = default ~., family = binomial, data = training_base) credit_predict = predict(classificator, type = 'response', newdata = test_base[-4]) predict_label = ifelse(credit_predict > 0.5, 1, 0) print(predict_label) library(car...
## libraries used (install and load) install.packages("plyr") install.packages("ggplot2") install.packages("reshape2") install.packages() ## loading required libraries library(plyr) library(ggplot2) library(reshape2) ## wd already set getwd() ## loading vehicle data vehicles <- read.csv(unz("vehicles....
/R/assignment1a/assignment-1a.R
no_license
Wasencroll/big-data-programming
R
false
false
3,332
r
## libraries used (install and load) install.packages("plyr") install.packages("ggplot2") install.packages("reshape2") install.packages() ## loading required libraries library(plyr) library(ggplot2) library(reshape2) ## wd already set getwd() ## loading vehicle data vehicles <- read.csv(unz("vehicles....
library("data.table") pollutantmean <- function(directory, pollutant, id = 1:332){ #append .cvs to a number files <- paste0(directory,'/', formatC(id, width = 3, flag = "0"),".csv") #Making one large data table list <- lapply(files, data.table::fread) dataTabel <- rbindlist(list) if(c(pol...
/Course 2/Assignment 1/pollutantmean/pollutantmean.R
no_license
piumalkulasekara/datasciencecoursera
R
false
false
453
r
library("data.table") pollutantmean <- function(directory, pollutant, id = 1:332){ #append .cvs to a number files <- paste0(directory,'/', formatC(id, width = 3, flag = "0"),".csv") #Making one large data table list <- lapply(files, data.table::fread) dataTabel <- rbindlist(list) if(c(pol...
## Put comments here that give an overall description of what your ## functions do ##This function will create a special matrix object that can cache its inverse. ##It will do the following: ## -set the value of the matrix ## -get the value of the matrix ## -set the value of the inverse ## -get the value of the inver...
/cachematrix.R
no_license
SevenWatch/ProgrammingAssignment2
R
false
false
1,399
r
## Put comments here that give an overall description of what your ## functions do ##This function will create a special matrix object that can cache its inverse. ##It will do the following: ## -set the value of the matrix ## -get the value of the matrix ## -set the value of the inverse ## -get the value of the inver...
# Read the files NewsTrain = read.csv("NYTimesBlogTrain.csv", stringsAsFactors=FALSE) NewsTest = read.csv("NYTimesBlogTest.csv", stringsAsFactors=FALSE) # Bind the Train and Test BindTrain = NewsTrain BindTest = NewsTest BindTrain$Popular = NULL BindTrain$UniqueID = NULL BindTest$UniqueID = NULL NewsAll = rbind(Bind...
/solutions/RF-02-150422.R
permissive
burun/The-Analytics-Edge-Competition-Spring-2015-
R
false
false
2,913
r
# Read the files NewsTrain = read.csv("NYTimesBlogTrain.csv", stringsAsFactors=FALSE) NewsTest = read.csv("NYTimesBlogTest.csv", stringsAsFactors=FALSE) # Bind the Train and Test BindTrain = NewsTrain BindTest = NewsTest BindTrain$Popular = NULL BindTrain$UniqueID = NULL BindTest$UniqueID = NULL NewsAll = rbind(Bind...
# MUTECT 1.17 ===================== get_mutect = function( folder, pattern='.mutect.1.17.vcf'){ f = list.files(folder, pattern, full.names = T) n = list.files(folder, pattern, full.names = F) n = gsub(pattern,"",n) names(f)=n hs =lapply(f, read.delim, comment.char = "#", h=T, sep="\t");names(hs)=n hs = lap...
/R/variantCalling.R
no_license
matteocereda/ceredaR
R
false
false
10,601
r
# MUTECT 1.17 ===================== get_mutect = function( folder, pattern='.mutect.1.17.vcf'){ f = list.files(folder, pattern, full.names = T) n = list.files(folder, pattern, full.names = F) n = gsub(pattern,"",n) names(f)=n hs =lapply(f, read.delim, comment.char = "#", h=T, sep="\t");names(hs)=n hs = lap...
context('pinerrordetector') test_that('1. convert_down_across', { expect_identical(a1[25:50, , drop = FALSE], a2) #1 across to down expect_identical(a11, a12) #2 vector and data frame formats of data_from expect_identical(b1[25:50, , drop = FALSE], b2...
/tests/testthat/test_pinerrordetector.R
permissive
sathishsrinivasank/pinerrordetector
R
false
false
88,205
r
context('pinerrordetector') test_that('1. convert_down_across', { expect_identical(a1[25:50, , drop = FALSE], a2) #1 across to down expect_identical(a11, a12) #2 vector and data frame formats of data_from expect_identical(b1[25:50, , drop = FALSE], b2...
#!/usr/bin/env Rscript args <- commandArgs(trailingOnly=TRUE) package <- args[1] set <- args[2] input <- args[3] outDir <- args[4] # library(org.Hs.eg.db) # library(ChAMP) source(here::here("code/utility.R")) obj <- readRDS(input) obj$tfit -> tfit obj$maxsize -> maxsize obj$minsize -> minsize obj$mVals -> mVals obj$...
/code/compare-methods/runMissMethyl.R
permissive
seba2550/methyl-geneset-testing
R
false
false
2,956
r
#!/usr/bin/env Rscript args <- commandArgs(trailingOnly=TRUE) package <- args[1] set <- args[2] input <- args[3] outDir <- args[4] # library(org.Hs.eg.db) # library(ChAMP) source(here::here("code/utility.R")) obj <- readRDS(input) obj$tfit -> tfit obj$maxsize -> maxsize obj$minsize -> minsize obj$mVals -> mVals obj$...
################################################################################# # Script to conduct demographic bet hedging test # Use g=0.99, as suggested by reviewers # to examine quasi-extinction ################################################################################# # - Environment ---- rm(list=ls(all=...
/scripts/006_testHypotheses/01.1_demographicBetHedgingTest.R
permissive
gregor-fausto/clarkia-bet-hedging
R
false
false
10,361
r
################################################################################# # Script to conduct demographic bet hedging test # Use g=0.99, as suggested by reviewers # to examine quasi-extinction ################################################################################# # - Environment ---- rm(list=ls(all=...
\name{trdsma} \Rdversion{1.1} \alias{trdsma} \alias{trdsma-methods} \alias{trdsma,data.frame-method} \alias{trdsma,matrix-method} \alias{trdsma,mts-method} \alias{trdsma,numeric-method} \alias{trdsma,timeSeries-method} \alias{trdsma,ts-method} \title{ Simple Moving Average } \description{ Calculation of a right end...
/man/trdsma.Rd
no_license
MatixR/FRAPO
R
false
false
2,374
rd
\name{trdsma} \Rdversion{1.1} \alias{trdsma} \alias{trdsma-methods} \alias{trdsma,data.frame-method} \alias{trdsma,matrix-method} \alias{trdsma,mts-method} \alias{trdsma,numeric-method} \alias{trdsma,timeSeries-method} \alias{trdsma,ts-method} \title{ Simple Moving Average } \description{ Calculation of a right end...
`evaluation.strip.plot` <- function( data, modelnames=c("MAXENT", "GBM", "GBMSTEP", "RF", "GLM", "GLMSTEP", "GAM", "GAMSTEP", "MGCV", "MGCVFIX", "EARTH", "RPART", "NNET", "FDA", "SVM", "SVME", "BIOCLIM", "DOMAIN", "MAHAL"), variable=NULL, model=NULL, ... ) { if(is.null(variable)==F) { ...
/R/evaluation.strip.plot.R
no_license
palc/BiodiversityR
R
false
false
2,063
r
`evaluation.strip.plot` <- function( data, modelnames=c("MAXENT", "GBM", "GBMSTEP", "RF", "GLM", "GLMSTEP", "GAM", "GAMSTEP", "MGCV", "MGCVFIX", "EARTH", "RPART", "NNET", "FDA", "SVM", "SVME", "BIOCLIM", "DOMAIN", "MAHAL"), variable=NULL, model=NULL, ... ) { if(is.null(variable)==F) { ...
# creates lookup table for graphs setwd("R") # assumes fitness INVESTMENT will be the same for all future periods ########################### # parameters ########################### Degen = 1/3 FitPrice = 3 MaxT = 50 # Shock Probability Equation # Pr = exp(RateAge * Age) + exp(RateShocks * Shocks) + Constant RateAg...
/R/MakeLookupGraphsInvest_SD.R
no_license
kajames2/healthcare_chronic
R
false
false
3,341
r
# creates lookup table for graphs setwd("R") # assumes fitness INVESTMENT will be the same for all future periods ########################### # parameters ########################### Degen = 1/3 FitPrice = 3 MaxT = 50 # Shock Probability Equation # Pr = exp(RateAge * Age) + exp(RateShocks * Shocks) + Constant RateAg...
paper_score <- function(y, X, tau, beta){ n <- nrow(X) temp <- t(X[1,,drop=FALSE])*ifelse(y[1] - X[1,,drop=FALSE]%*%as.matrix(beta) < 0, tau - 1, tau) for(i in 2:n){ temp <- temp + t(X[1,,drop=FALSE])*ifelse(y[1] - X[1,,drop=FALSE]%*%as.matrix(beta) < 0, tau - 1, tau) } return(temp) } n <- nrow(X) temp...
/R/scratch.R
no_license
johnschwenck/crimeBQR
R
false
false
723
r
paper_score <- function(y, X, tau, beta){ n <- nrow(X) temp <- t(X[1,,drop=FALSE])*ifelse(y[1] - X[1,,drop=FALSE]%*%as.matrix(beta) < 0, tau - 1, tau) for(i in 2:n){ temp <- temp + t(X[1,,drop=FALSE])*ifelse(y[1] - X[1,,drop=FALSE]%*%as.matrix(beta) < 0, tau - 1, tau) } return(temp) } n <- nrow(X) temp...
testlist <- list(hi = 0, lo = 1.64474453500551e-319, mu = 0, sig = 0) result <- do.call(gjam:::tnormRcpp,testlist) str(result)
/gjam/inst/testfiles/tnormRcpp/libFuzzer_tnormRcpp/tnormRcpp_valgrind_files/1610045050-test.R
no_license
akhikolla/updated-only-Issues
R
false
false
126
r
testlist <- list(hi = 0, lo = 1.64474453500551e-319, mu = 0, sig = 0) result <- do.call(gjam:::tnormRcpp,testlist) str(result)
# Uses output of integrateSoundsscapeData.R to create plots and models for AK soundscape project rm(list=ls()) #general library(dplyr) library(data.table) library(ggplot2) #for model-- start line 354 library(suncalc) library(mgcv) library(zoo) library(MuMIn) library(visreg) library(corrplot) #for map library("sf") lib...
/3_modelPlot_SoundscapeDataV2.R
no_license
mfmckenna/MM_AKSoundscape
R
false
false
60,356
r
# Uses output of integrateSoundsscapeData.R to create plots and models for AK soundscape project rm(list=ls()) #general library(dplyr) library(data.table) library(ggplot2) #for model-- start line 354 library(suncalc) library(mgcv) library(zoo) library(MuMIn) library(visreg) library(corrplot) #for map library("sf") lib...
#!/usr/bin/env Rscript args = commandArgs(trailingOnly=TRUE) input_filenames = c() output_filename = c() for (col in 1:length(args)) { if (args[col]=="-files") { if (col+1>length(args)) { stop("please specify the [InputFileName]") } fnames = strsplit(args[c...
/assignment1/hw1_104761501.R
no_license
chihming/1052DataScience
R
false
false
1,815
r
#!/usr/bin/env Rscript args = commandArgs(trailingOnly=TRUE) input_filenames = c() output_filename = c() for (col in 1:length(args)) { if (args[col]=="-files") { if (col+1>length(args)) { stop("please specify the [InputFileName]") } fnames = strsplit(args[c...
library(basejump) library(Seurat) loadData(seurat, dir = "data/2018-07-09") all_markers <- FindAllMarkers(seurat) saveData(all_markers, dir = file.path("data", Sys.Date()))
/young_virgin/find_all_markers.R
no_license
mjsteinbaugh/brugge-brca1-mammary-singlecell-mmusculus
R
false
false
173
r
library(basejump) library(Seurat) loadData(seurat, dir = "data/2018-07-09") all_markers <- FindAllMarkers(seurat) saveData(all_markers, dir = file.path("data", Sys.Date()))
/cachematrix.R
no_license
riki05/ProgrammingAssignment2
R
false
false
754
r
library(shiny) library(leaflet) WOCHENTAG_1_list <- c("Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag") UNFALLART_list <- unique(as.character(allzips$UNFALLART_)) LICHTVERH_list = c("Tageslicht", "Daemmerung","Dunkelheit") STRASSENZUS_list = unique(as.character(allzips$STRASSENZUS)) B1VE...
/ui.R
no_license
Quiri/bike-accidents
R
false
false
2,963
r
library(shiny) library(leaflet) WOCHENTAG_1_list <- c("Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag") UNFALLART_list <- unique(as.character(allzips$UNFALLART_)) LICHTVERH_list = c("Tageslicht", "Daemmerung","Dunkelheit") STRASSENZUS_list = unique(as.character(allzips$STRASSENZUS)) B1VE...
#1. Merges the training and the test sets to create one data set. #test datasetXTest <- read.csv("test/X_test.txt",sep = "",header = F) datasetYTest <- read.csv("test/Y_test.txt",sep="",header=F) datasetSubjectTest <- read.csv("test/subject_test.txt", sep="",header=F) #train datasetXTrain <- read.csv("train/X_train.t...
/run_analysis.R
no_license
carlosandresSanchez/gettingAndCleaningData
R
false
false
1,847
r
#1. Merges the training and the test sets to create one data set. #test datasetXTest <- read.csv("test/X_test.txt",sep = "",header = F) datasetYTest <- read.csv("test/Y_test.txt",sep="",header=F) datasetSubjectTest <- read.csv("test/subject_test.txt", sep="",header=F) #train datasetXTrain <- read.csv("train/X_train.t...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/apa_p_value.r \name{apa_p_value} \alias{apa_p_value} \title{apa_p_value} \usage{ apa_p_value(p) } \arguments{ \item{p}{p value to be formatted} } \description{ This function uses rounds p values using APA rules: No leading zero, rounded to th...
/man/apa_p_value.Rd
no_license
ianhussey/timesavers
R
false
true
431
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/apa_p_value.r \name{apa_p_value} \alias{apa_p_value} \title{apa_p_value} \usage{ apa_p_value(p) } \arguments{ \item{p}{p value to be formatted} } \description{ This function uses rounds p values using APA rules: No leading zero, rounded to th...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/list.remove.R \name{list.remove} \alias{list.remove} \title{Remove members from a list by index or name} \usage{ list.remove(.data, range = integer()) } \arguments{ \item{.data}{A \code{list} or \code{vector}} \item{range}{A numeric vector o...
/man/list.remove.Rd
permissive
renkun-ken/rlist
R
false
true
663
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/list.remove.R \name{list.remove} \alias{list.remove} \title{Remove members from a list by index or name} \usage{ list.remove(.data, range = integer()) } \arguments{ \item{.data}{A \code{list} or \code{vector}} \item{range}{A numeric vector o...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gist_create.R \name{gist_create} \alias{gist_create} \title{Create a gist} \usage{ gist_create(files = NULL, description = "", public = TRUE, browse = TRUE, code = NULL, filename = "code.R", knit = FALSE, knitopts = list(), renderopts = l...
/man/gist_create.Rd
permissive
pkgspell/gistr
R
false
true
5,377
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/gist_create.R \name{gist_create} \alias{gist_create} \title{Create a gist} \usage{ gist_create(files = NULL, description = "", public = TRUE, browse = TRUE, code = NULL, filename = "code.R", knit = FALSE, knitopts = list(), renderopts = l...
if (interactive() || is.na(Sys.getenv('NOT_CRAN', unset = NA)) ) { # Chapter 3 - The Fundamentals of R # Using the Full Power of Functions ## Vectorizing your functions baskets.of.Granny <- c(12,4,4,6,9,3) baskets.of.Granny sum(baskets.of.Granny) firstnames <- c("Joris", "Carolien", "Koen") lastname <- ...
/inst/scripts/2-clean/ch03.R
no_license
cran/rfordummies
R
false
false
1,876
r
if (interactive() || is.na(Sys.getenv('NOT_CRAN', unset = NA)) ) { # Chapter 3 - The Fundamentals of R # Using the Full Power of Functions ## Vectorizing your functions baskets.of.Granny <- c(12,4,4,6,9,3) baskets.of.Granny sum(baskets.of.Granny) firstnames <- c("Joris", "Carolien", "Koen") lastname <- ...
# Script to read in the csv files to edit the river and farmsite data riverdata <- read.csv('ar.csv',header = TRUE,sep = ',') riverdata$V <- as.numeric(sub(",", ".", as.character(riverdata$V),fixed = TRUE)) riverdata$N <- as.numeric(sub(",", ".", as.character(riverdata$N),fixed = TRUE)) colnames(riverdata) <- c('...
/excel reader.R
no_license
Hafro/Ahaettumat
R
false
false
952
r
# Script to read in the csv files to edit the river and farmsite data riverdata <- read.csv('ar.csv',header = TRUE,sep = ',') riverdata$V <- as.numeric(sub(",", ".", as.character(riverdata$V),fixed = TRUE)) riverdata$N <- as.numeric(sub(",", ".", as.character(riverdata$N),fixed = TRUE)) colnames(riverdata) <- c('...
# Plots for publication # require(plyr) require(ggplot2) require(dplyr) require(vegan) require(ggrepel) require(magrittr) #adding in palette library(RColorBrewer) darkcols <- brewer.pal(10, "Dark2") #Data import plot.fpar <- read.csv("laserquest_master_fpar_plot.csv") # designate light regime based on aPAR or above...
/01_plots_for_publication.R
no_license
fdbesanto2/laserquestR
R
false
false
29,871
r
# Plots for publication # require(plyr) require(ggplot2) require(dplyr) require(vegan) require(ggrepel) require(magrittr) #adding in palette library(RColorBrewer) darkcols <- brewer.pal(10, "Dark2") #Data import plot.fpar <- read.csv("laserquest_master_fpar_plot.csv") # designate light regime based on aPAR or above...
#1. Load the data (i.e. read.csv()) temp<-"activity.zip" data<-read.csv(unz(temp,"activity.csv")) #2. Process/transform the data (if necessary) into a format suitable for your analysis #Question 1: What is mean total number of steps taken per day? library("plyr") q1_data <- na.omit(ddply(data,"date",summarize,Steps...
/assig_1_script.R
no_license
ssrichandra/RepData_PeerAssessment1
R
false
false
3,430
r
#1. Load the data (i.e. read.csv()) temp<-"activity.zip" data<-read.csv(unz(temp,"activity.csv")) #2. Process/transform the data (if necessary) into a format suitable for your analysis #Question 1: What is mean total number of steps taken per day? library("plyr") q1_data <- na.omit(ddply(data,"date",summarize,Steps...
### ----------------------------------------------------------------------------------------------- ### Analysis of Super Bowl National Anthem performance times ### ### ----------------------------------------------------------------------------------------------- library(tidyverse) library(forecast) library(lubridate...
/analysis.R
no_license
friscojosh/superbowl-anthems
R
false
false
5,565
r
### ----------------------------------------------------------------------------------------------- ### Analysis of Super Bowl National Anthem performance times ### ### ----------------------------------------------------------------------------------------------- library(tidyverse) library(forecast) library(lubridate...
% Generated by roxygen2 (4.0.1): do not edit by hand \name{new.obj} \alias{new.obj} \title{Generate a new object of the specified type} \usage{ new.obj(type = get.types()[[typeName]], name, values = NULL, typeName = NULL) } \description{ Generate a new object of the specified type }
/man/new.obj.Rd
no_license
skranz/YamlObjects
R
false
false
287
rd
% Generated by roxygen2 (4.0.1): do not edit by hand \name{new.obj} \alias{new.obj} \title{Generate a new object of the specified type} \usage{ new.obj(type = get.types()[[typeName]], name, values = NULL, typeName = NULL) } \description{ Generate a new object of the specified type }
#' Detects Operating System #' #' Attempts to detect the operating system. #' Returns: "Windows", "Darwin" on Mac, "Linux", or "SunOS" on Solaris #' #' @export p_detectOS <- function(){ Sys.info()[["sysname"]] }
/R/p_detectOS.R
no_license
dpastoor/pacman
R
false
false
217
r
#' Detects Operating System #' #' Attempts to detect the operating system. #' Returns: "Windows", "Darwin" on Mac, "Linux", or "SunOS" on Solaris #' #' @export p_detectOS <- function(){ Sys.info()[["sysname"]] }
setwd("C:/Users/Desktop/Coursera/Data Science Specialization/4. Exploratory Data Analysis/Project 1") #change this to your working directory unzip("exdata%2Fdata%2Fhousehold_power_consumption.zip", exdir = getwd()) #### Import Data #### # Measurements of electric power consumption in one household with a one-m...
/plot1.R
no_license
kmesso1/ExData_Plotting1
R
false
false
1,301
r
setwd("C:/Users/Desktop/Coursera/Data Science Specialization/4. Exploratory Data Analysis/Project 1") #change this to your working directory unzip("exdata%2Fdata%2Fhousehold_power_consumption.zip", exdir = getwd()) #### Import Data #### # Measurements of electric power consumption in one household with a one-m...
# Overdispersed NB# Poisson z low count-i my_path <- dirname(rstudioapi::getSourceEditorContext()$path) setwd(my_path) setwd("..") # Functions se_kernel <- function(x, y, alpha1 = 1, rho1) { alpha1 * exp(- (x - y)^2 / (2 * rho1^2)) } lp_kernel <- function(x, y, alpha2, rho2, rho3) { alpha2 * exp((-2 * (sin(pi * ...
/R_generate_toy/toy_L.R
no_license
bstatcomp/gfac
R
false
false
4,604
r
# Overdispersed NB# Poisson z low count-i my_path <- dirname(rstudioapi::getSourceEditorContext()$path) setwd(my_path) setwd("..") # Functions se_kernel <- function(x, y, alpha1 = 1, rho1) { alpha1 * exp(- (x - y)^2 / (2 * rho1^2)) } lp_kernel <- function(x, y, alpha2, rho2, rho3) { alpha2 * exp((-2 * (sin(pi * ...
corr <- function(directory, threshold = 0){ ##all monitors monitors <- complete(directory, 1:332) ##monitors that meet threshold monitors <- subset(monitors, nobs > threshold) ids = monitors[["id"]] all_files <- list.files(pattern = "*.csv") files_id <- all_files[ids] cors_by...
/corr.R
no_license
genelle/datasciencecoursera
R
false
false
889
r
corr <- function(directory, threshold = 0){ ##all monitors monitors <- complete(directory, 1:332) ##monitors that meet threshold monitors <- subset(monitors, nobs > threshold) ids = monitors[["id"]] all_files <- list.files(pattern = "*.csv") files_id <- all_files[ids] cors_by...
#create spreadsheet outside of R #filter by 02,04,06 or 08 #the fun begins library(XML) setwd("C:\\Documents and Settings\\Ty\\My Documents\\leadership paper\\data") ############################################################################### #merge cmte & pac 02 #match by CID somehow #libraries libra...
/pre-workshop/scripts/cmte merge2.R
no_license
tbonza/Leadership-Paper
R
false
false
4,298
r
#create spreadsheet outside of R #filter by 02,04,06 or 08 #the fun begins library(XML) setwd("C:\\Documents and Settings\\Ty\\My Documents\\leadership paper\\data") ############################################################################### #merge cmte & pac 02 #match by CID somehow #libraries libra...
c DCNF-Autarky [version 0.0.1]. c Copyright (c) 2018-2019 Swansea University. c c Input Clause Count: 2 c Performing E1-Autarky iteration. c Remaining clauses count after E-Reduction: 2 c c Input Parameter (command line, file): c input filename QBFLIB/Jordan-Kaiser/reduction-finding-full-set-params-k1c3n4/falsequ...
/code/dcnf-ankit-optimized/Results/QBFLIB-2018/E1/Experiments/Jordan-Kaiser/reduction-finding-full-set-params-k1c3n4/falsequ_query24_1344/falsequ_query24_1344.R
no_license
arey0pushpa/dcnf-autarky
R
false
false
683
r
c DCNF-Autarky [version 0.0.1]. c Copyright (c) 2018-2019 Swansea University. c c Input Clause Count: 2 c Performing E1-Autarky iteration. c Remaining clauses count after E-Reduction: 2 c c Input Parameter (command line, file): c input filename QBFLIB/Jordan-Kaiser/reduction-finding-full-set-params-k1c3n4/falsequ...
# Filter with a whitelist of individuals #' @title Filter individuals with whitelist #' @description This function use a whitelist of individuals to filter #' a dataset. #' @param data A data frame object or file (using ".tsv") with an 'INDIVIDUALS' #' column. #' @param whitelist.id The whitelist of individuals with no...
/R/filter_individuals_id.R
no_license
anne-laureferchaud/stackr-1
R
false
false
2,393
r
# Filter with a whitelist of individuals #' @title Filter individuals with whitelist #' @description This function use a whitelist of individuals to filter #' a dataset. #' @param data A data frame object or file (using ".tsv") with an 'INDIVIDUALS' #' column. #' @param whitelist.id The whitelist of individuals with no...
#···································································· # np.geo.R (npsp package) #···································································· # np.geo and fitgeo S3 classes and methods # plot.np.geo(x) # # np.fitgeo() S3 generic # np.fitgeo.default(x) # np.fitgeo.locpol.b...
/R/np.geo.R
no_license
rubenfcasal/npsp
R
false
false
15,054
r
#···································································· # np.geo.R (npsp package) #···································································· # np.geo and fitgeo S3 classes and methods # plot.np.geo(x) # # np.fitgeo() S3 generic # np.fitgeo.default(x) # np.fitgeo.locpol.b...
#' marginal edge bayes independence indicators #' #' Outputs statistics on posteriors for tau1, tau2, omega #' Handy for checking for independencies between X1 and X2 #' #' @param rescaled.posterior.potentials Rescaled posterior potentials from marginal.edge.bayes.loglin. #' #' @return The function will XX #' #' #' @ex...
/R/marginal.edge.independence_util.R
no_license
npetraco/CRFutil
R
false
false
10,279
r
#' marginal edge bayes independence indicators #' #' Outputs statistics on posteriors for tau1, tau2, omega #' Handy for checking for independencies between X1 and X2 #' #' @param rescaled.posterior.potentials Rescaled posterior potentials from marginal.edge.bayes.loglin. #' #' @return The function will XX #' #' #' @ex...
library(ape) testtree <- read.tree("11564_0.txt") unrooted_tr <- unroot(testtree) write.tree(unrooted_tr, file="11564_0_unrooted.txt")
/codeml_files/newick_trees_processed_and_cleaned/11564_0/rinput.R
no_license
DaniBoo/cyanobacteria_project
R
false
false
137
r
library(ape) testtree <- read.tree("11564_0.txt") unrooted_tr <- unroot(testtree) write.tree(unrooted_tr, file="11564_0_unrooted.txt")
require(leaflet) source('ipf1dataget.R') #problem with filepaths either here or inside the script 20171011
/global.R
no_license
amberalpha/prezzo2ipf
R
false
false
107
r
require(leaflet) source('ipf1dataget.R') #problem with filepaths either here or inside the script 20171011
#' Validate function input #' #' This function can be used to validate the input to functions. \emph{This function is not exported.} #' #' @param x Function input. #' @param name Character. Name of variable to validate; if \code{NULL} variable name of object supplied to \code{x} is used. #' @param check_class Character...
/R/utils.R
no_license
minzhanggit/papaja
R
false
false
13,078
r
#' Validate function input #' #' This function can be used to validate the input to functions. \emph{This function is not exported.} #' #' @param x Function input. #' @param name Character. Name of variable to validate; if \code{NULL} variable name of object supplied to \code{x} is used. #' @param check_class Character...
#load data getwd() data<-read.csv(file.choose()) head(data) tail(data) #for observing str(data) summary(data) #insights into nxt section data$Year temp<-factor(data$Year) levels(temp) #filterinf\g data frame for splitting data1960<-data[data$Year==1960,] data2013<-data[data$Year==2013,] #check row coun...
/worldtrendshomework.R
no_license
vvicky30/R-visualization
R
false
false
1,428
r
#load data getwd() data<-read.csv(file.choose()) head(data) tail(data) #for observing str(data) summary(data) #insights into nxt section data$Year temp<-factor(data$Year) levels(temp) #filterinf\g data frame for splitting data1960<-data[data$Year==1960,] data2013<-data[data$Year==2013,] #check row coun...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hier_basis_additive.R \name{view.model.addHierBasis} \alias{view.model.addHierBasis} \title{View Fitted Additive Model} \usage{ view.model.addHierBasis(object, lam.index = 1, digits = 3) } \arguments{ \item{object}{An object of class \code{ad...
/man/view.model.addHierBasis.Rd
no_license
peterpark77/HierBasis
R
false
true
1,342
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hier_basis_additive.R \name{view.model.addHierBasis} \alias{view.model.addHierBasis} \title{View Fitted Additive Model} \usage{ view.model.addHierBasis(object, lam.index = 1, digits = 3) } \arguments{ \item{object}{An object of class \code{ad...
bayesHierVar.stHM <- function(x){ K=ncol(x) #### number of observations v=K-1 I=nrow(x) ### number of genes s2est=apply(x,1,var) s2bar=mean(s2est) S=var(s2est)*(I-1) Best=(2/v)/(1+2/v)*(I-1)/I + 1/(1+2/v)*(2/v)*s2bar^2*(I-1)/S if(Best<1){ var_hier_est=(1-Best)*s2est+B...
/R/bayesHierVar.stHM.R
no_license
benliemory/adaptiveHM
R
false
false
462
r
bayesHierVar.stHM <- function(x){ K=ncol(x) #### number of observations v=K-1 I=nrow(x) ### number of genes s2est=apply(x,1,var) s2bar=mean(s2est) S=var(s2est)*(I-1) Best=(2/v)/(1+2/v)*(I-1)/I + 1/(1+2/v)*(2/v)*s2bar^2*(I-1)/S if(Best<1){ var_hier_est=(1-Best)*s2est+B...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/check_single_augment_output.R \name{check_single_augment_output} \alias{check_single_augment_output} \title{Check the output of an augment method} \usage{ check_single_augment_output(au, passed_data, model = NULL, strict = TRUE) } \arguments{...
/man/check_single_augment_output.Rd
permissive
alexpghayes/modeltests
R
false
true
1,285
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/check_single_augment_output.R \name{check_single_augment_output} \alias{check_single_augment_output} \title{Check the output of an augment method} \usage{ check_single_augment_output(au, passed_data, model = NULL, strict = TRUE) } \arguments{...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hcp_scanning_info.R \docType{data} \name{hcp_1200_scanning_info} \alias{hcp_1200_scanning_info} \title{Scanning Information for HCP 1200 Data} \format{ An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 69615 ...
/man/hcp_1200_scanning_info.Rd
no_license
neuroconductor/neurohcp
R
false
true
498
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hcp_scanning_info.R \docType{data} \name{hcp_1200_scanning_info} \alias{hcp_1200_scanning_info} \title{Scanning Information for HCP 1200 Data} \format{ An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 69615 ...
#' @export write_png <- function ( chart_object, path, width = 15, height = NULL, aspect = 1920 / 1080, dpi = 300, ..., verbose = getOption("verbose") ) { msg <- function (...) if(isTRUE(verbose)) message("[write_png] ", ...) stopifnot( inherits(chart_object, "ggplot")) stopifnot( str_d...
/R/write_png.R
no_license
BAAQMD/ggtools
R
false
false
752
r
#' @export write_png <- function ( chart_object, path, width = 15, height = NULL, aspect = 1920 / 1080, dpi = 300, ..., verbose = getOption("verbose") ) { msg <- function (...) if(isTRUE(verbose)) message("[write_png] ", ...) stopifnot( inherits(chart_object, "ggplot")) stopifnot( str_d...
####### IoT analytics - Task 1 ####### Exploratory Data Analysis #### Install and load packages and set seed #### if (require('pacman') == 'FALSE') { install.packages('pacman') } pacman::p_load(readr, caret, dplyr, ggplot2, DataExplorer, ...
/scripts/ExploratoryDataAnalysis.R
no_license
alinebarbosa/Power-Management-for-Smart-Homes
R
false
false
7,093
r
####### IoT analytics - Task 1 ####### Exploratory Data Analysis #### Install and load packages and set seed #### if (require('pacman') == 'FALSE') { install.packages('pacman') } pacman::p_load(readr, caret, dplyr, ggplot2, DataExplorer, ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot_volcano.R \name{plot_volcano} \alias{plot_volcano} \title{Volcano plot for log fold changes and log p-values} \usage{ plot_volcano( res_obj, FDR = 0.05, ylim_up = NULL, vlines = NULL, title = NULL, intgenes = NULL, intgenes...
/man/plot_volcano.Rd
permissive
danielabutano/ideal
R
false
true
2,101
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot_volcano.R \name{plot_volcano} \alias{plot_volcano} \title{Volcano plot for log fold changes and log p-values} \usage{ plot_volcano( res_obj, FDR = 0.05, ylim_up = NULL, vlines = NULL, title = NULL, intgenes = NULL, intgenes...
source("loadData.R") ADT <- makeCacheData("./household_power_consumption.txt") data <- loadData(ADT) png("plot2.png", width = 480, height = 480, units = "px") plot(data$DateTime, data$Global_active_power, type="l", xlab = "", ylab = "Global Active Power (kilowatts)") dev.off()
/plot2.R
no_license
mik23/ExData_Plotting1
R
false
false
279
r
source("loadData.R") ADT <- makeCacheData("./household_power_consumption.txt") data <- loadData(ADT) png("plot2.png", width = 480, height = 480, units = "px") plot(data$DateTime, data$Global_active_power, type="l", xlab = "", ylab = "Global Active Power (kilowatts)") dev.off()
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/TCGAanalyze.R \name{TCGAanalyze_Preprocessing} \alias{TCGAanalyze_Preprocessing} \title{Array Array Intensity correlation (AAIC) and correlation boxplot to define outlier} \usage{ TCGAanalyze_Preprocessing(object, cor.cut = 0, filename = NULL...
/man/TCGAanalyze_Preprocessing.Rd
no_license
Juggernaut93/TCGAbiolinks
R
false
true
1,224
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/TCGAanalyze.R \name{TCGAanalyze_Preprocessing} \alias{TCGAanalyze_Preprocessing} \title{Array Array Intensity correlation (AAIC) and correlation boxplot to define outlier} \usage{ TCGAanalyze_Preprocessing(object, cor.cut = 0, filename = NULL...
## This function reads the "household_power_consumption" data file and creates the ## second plot for Course Project 1 of the Exploratory Data Analysis Course ## Author: Miguel Alvarez plot2 <- function(){ ## Load the data file into a dataframe powerFrame <- read.csv("household_power_consumption.txt", ...
/plot2.R
no_license
moalvarez/ExData_Plotting1
R
false
false
1,185
r
## This function reads the "household_power_consumption" data file and creates the ## second plot for Course Project 1 of the Exploratory Data Analysis Course ## Author: Miguel Alvarez plot2 <- function(){ ## Load the data file into a dataframe powerFrame <- read.csv("household_power_consumption.txt", ...
#setwd("C:/Users/DAILLOUX/Document travail/Cours R/Ex/rprog_data_ProgAssignment3-data") hdata=read.csv("hospital-data.csv",stringsAsFactor=F) outdata=read.csv("outcome-of-care-measures.csv",stringsAsFactor=F) rankall<-function(outcome,num="best"){ i<- outcome==c("heart attack","heart failure...
/Ex/rprog_data_ProgAssignment3-data/main_rankall.R
no_license
daillouf/Cours-Data-Science
R
false
false
2,541
r
#setwd("C:/Users/DAILLOUX/Document travail/Cours R/Ex/rprog_data_ProgAssignment3-data") hdata=read.csv("hospital-data.csv",stringsAsFactor=F) outdata=read.csv("outcome-of-care-measures.csv",stringsAsFactor=F) rankall<-function(outcome,num="best"){ i<- outcome==c("heart attack","heart failure...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/collapse_rows.R \name{collapse_rows} \alias{collapse_rows} \title{Collapse repeated rows to multirow cell} \usage{ collapse_rows(kable_input, columns = NULL, latex_hline = c("full", "major", "none")) } \arguments{ \item{kable_input}{Output ...
/man/collapse_rows.Rd
no_license
antoine-182/kableExtra
R
false
true
1,111
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/collapse_rows.R \name{collapse_rows} \alias{collapse_rows} \title{Collapse repeated rows to multirow cell} \usage{ collapse_rows(kable_input, columns = NULL, latex_hline = c("full", "major", "none")) } \arguments{ \item{kable_input}{Output ...
## Coursera R Programming ## Pogramming Assignment 2 ## This file contains the solution to Programming Assignment 2 ## ------------------------------------------------------------ ## makeCacheMatrix creates a list of functions which: ## - set: Set the value of a matrix ## - get: Get the value of a matrix ## - setInvers...
/cachematrix.R
no_license
ajhsutton/ProgrammingAssignment2
R
false
false
1,825
r
## Coursera R Programming ## Pogramming Assignment 2 ## This file contains the solution to Programming Assignment 2 ## ------------------------------------------------------------ ## makeCacheMatrix creates a list of functions which: ## - set: Set the value of a matrix ## - get: Get the value of a matrix ## - setInvers...
library(KoNLP) library(httr) library(rvest) library(readr) library(xml2) library(stringr) library(dplyr) library(tidytext) library(lubridate) library(RMariaDB) library(DBI) library(googledrive) library(googlesheets4) ### 주가는 관련 뉴스와 많은 관계가 있습니다. 정확한 상관관계나 선후관계는 알 수 없지만, 많은 영향을 주고 받습니다. 기존에 주가를 가져오는 함수들은 많은 분들에 의해 작성됐고,...
/stockinsertauto.R
permissive
kmo130519/Stockmarket-news-summary
R
false
false
6,840
r
library(KoNLP) library(httr) library(rvest) library(readr) library(xml2) library(stringr) library(dplyr) library(tidytext) library(lubridate) library(RMariaDB) library(DBI) library(googledrive) library(googlesheets4) ### 주가는 관련 뉴스와 많은 관계가 있습니다. 정확한 상관관계나 선후관계는 알 수 없지만, 많은 영향을 주고 받습니다. 기존에 주가를 가져오는 함수들은 많은 분들에 의해 작성됐고,...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Utility.R \name{getcountsfromMatchedbed} \alias{getcountsfromMatchedbed} \title{getcountsfromMatchedbed} \usage{ getcountsfromMatchedbed(input.bedfile.dir, output.count.file.dir, filter.sample) } \arguments{ \item{ld}{upstream base} \item{rd...
/man/getcountsfromMatchedbed.Rd
no_license
aiminy/3UTR-Seq
R
false
true
654
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Utility.R \name{getcountsfromMatchedbed} \alias{getcountsfromMatchedbed} \title{getcountsfromMatchedbed} \usage{ getcountsfromMatchedbed(input.bedfile.dir, output.count.file.dir, filter.sample) } \arguments{ \item{ld}{upstream base} \item{rd...
### Add numericInput # The app on the right allows users to randomly select a desired number of movies, # and displays some information on the selected movies in a tabular output. # This table is created using a new function, renderDataTable function from the DT package, # but for now we will keep our focus on the n...
/01 Shiny Fundamentals with R/203 DT:: .r
no_license
chunhuayu/Building-Web-Applications-in-R-with-Shiny
R
false
false
2,339
r
### Add numericInput # The app on the right allows users to randomly select a desired number of movies, # and displays some information on the selected movies in a tabular output. # This table is created using a new function, renderDataTable function from the DT package, # but for now we will keep our focus on the n...
### Plot 12: IRU comparisons RPlot12 <- function (data) { ## needs PITCH, ROLL, THDG, PITCH_IRS2, ROLL_IRS2, THDG_IRS2 layout(matrix(1:3, ncol = 1), widths = 1, heights = c(5,5,6)) op <- par (mar=c(2,4,1,2)+0.1,oma=c(1.1,0,0,0)) DF <- data[, c("Time", "PITCH", "PITCH_IRS2")] DF$DifferenceX50 <- (DF$PITCH - DF...
/PlotFunctions/RPlot12.R
permissive
WilliamCooper/WINTER
R
false
false
2,582
r
### Plot 12: IRU comparisons RPlot12 <- function (data) { ## needs PITCH, ROLL, THDG, PITCH_IRS2, ROLL_IRS2, THDG_IRS2 layout(matrix(1:3, ncol = 1), widths = 1, heights = c(5,5,6)) op <- par (mar=c(2,4,1,2)+0.1,oma=c(1.1,0,0,0)) DF <- data[, c("Time", "PITCH", "PITCH_IRS2")] DF$DifferenceX50 <- (DF$PITCH - DF...
#' Default Zika parameters for sims #' #' A function that gives a list of parameters for running a zika simulation. #' Defaults to parameters for Zika with no introductions. #' #' @param r_not value specifying outbreak R0, which automatically modulates transmission rate #' @param infBoxes Integer specifying number of i...
/R/sim_zika_outbreaks.R
no_license
lindapei2016/rtZIKVrisk
R
false
false
17,717
r
#' Default Zika parameters for sims #' #' A function that gives a list of parameters for running a zika simulation. #' Defaults to parameters for Zika with no introductions. #' #' @param r_not value specifying outbreak R0, which automatically modulates transmission rate #' @param infBoxes Integer specifying number of i...
library(glmmfields) ### Name: sim_glmmfields ### Title: Simulate a random field with a MVT distribution ### Aliases: sim_glmmfields ### ** Examples s <- sim_glmmfields(n_draws = 12, n_knots = 12, gp_theta = 1.5, gp_sigma = 0.2, sd_obs = 0.2) names(s)
/data/genthat_extracted_code/glmmfields/examples/sim_glmmfields.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
260
r
library(glmmfields) ### Name: sim_glmmfields ### Title: Simulate a random field with a MVT distribution ### Aliases: sim_glmmfields ### ** Examples s <- sim_glmmfields(n_draws = 12, n_knots = 12, gp_theta = 1.5, gp_sigma = 0.2, sd_obs = 0.2) names(s)
#' @title #' Augmentation of simple_brix model #' #' @description #' Augments simple_brix model with unobserved claims (losses smaller than the deductibles) #' for claims model distribution testing. #' #' @param object object of class "brix_simple", see \code{\link{brix_simple}}. #' #' @details #' Using the Poisson dis...
/R/augmentation.R
no_license
kbrix/brixtools
R
false
false
5,101
r
#' @title #' Augmentation of simple_brix model #' #' @description #' Augments simple_brix model with unobserved claims (losses smaller than the deductibles) #' for claims model distribution testing. #' #' @param object object of class "brix_simple", see \code{\link{brix_simple}}. #' #' @details #' Using the Poisson dis...
library(VFP) ### Name: getMat.VCA ### Title: Transform list of VCA-object into VFP-matrix required for ### fitting. ### Aliases: getMat.VCA ### ** Examples ## No test: library(VCA) data(VCAdata1) lst <- anovaVCA(y~(device+lot)/day/run, VCAdata1, by="sample") mat <- getMat.VCA(lst) mat ## End(No test)
/data/genthat_extracted_code/VFP/examples/getMat.VCA.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
312
r
library(VFP) ### Name: getMat.VCA ### Title: Transform list of VCA-object into VFP-matrix required for ### fitting. ### Aliases: getMat.VCA ### ** Examples ## No test: library(VCA) data(VCAdata1) lst <- anovaVCA(y~(device+lot)/day/run, VCAdata1, by="sample") mat <- getMat.VCA(lst) mat ## End(No test)
## Load and subset data fileName <- "household_power_consumption.txt" fullDataset <- read.csv(fileName, sep=";", na.strings=c("","?")) dataset <- subset(fullDataset, Date %in% c("1/2/2007", "2/2/2007")) ## Parse datetimes datetime <- strptime(paste(dataset$Date, dataset$Time), "%d/%m/%Y %H:%M:%S") ## Get dataseries ...
/plot4.R
no_license
dmarjenburgh/ExData_Plotting1
R
false
false
1,151
r
## Load and subset data fileName <- "household_power_consumption.txt" fullDataset <- read.csv(fileName, sep=";", na.strings=c("","?")) dataset <- subset(fullDataset, Date %in% c("1/2/2007", "2/2/2007")) ## Parse datetimes datetime <- strptime(paste(dataset$Date, dataset$Time), "%d/%m/%Y %H:%M:%S") ## Get dataseries ...
\name{print.sbrl} \alias{show.sbrl} \alias{print.sbrl} %- Also NEED an '\alias' for EACH other topic documented here. \title{ %% ~~function to do ... ~~ INTERPRETABLE VERSION OF A SBRL MODEL } \description{ This function prints an sbrl object. It is a method for the generic function print of class "sbrl". } \usage{ # ...
/man/print.sbrl.Rd
no_license
cran/sbrl
R
false
false
1,886
rd
\name{print.sbrl} \alias{show.sbrl} \alias{print.sbrl} %- Also NEED an '\alias' for EACH other topic documented here. \title{ %% ~~function to do ... ~~ INTERPRETABLE VERSION OF A SBRL MODEL } \description{ This function prints an sbrl object. It is a method for the generic function print of class "sbrl". } \usage{ # ...
testlist <- list(x = structure(c(2.31584307392677e+77, 9.56412844572735e+295, 1.22810536108214e+146, 4.12396251261199e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(5L, 7L))) result <- do.call(multivariance:::doubleCenterBiasCorrected,testlist) str(result...
/multivariance/inst/testfiles/doubleCenterBiasCorrected/AFL_doubleCenterBiasCorrected/doubleCenterBiasCorrected_valgrind_files/1613140826-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
321
r
testlist <- list(x = structure(c(2.31584307392677e+77, 9.56412844572735e+295, 1.22810536108214e+146, 4.12396251261199e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(5L, 7L))) result <- do.call(multivariance:::doubleCenterBiasCorrected,testlist) str(result...
#' @title Reports data available for a NOAA station #' @description Reports data available for a NOAA station #' #' @details \code{noaa.parameters} reports the parameters (meteorological #' and tidal) available for a specified NOAA station. #' #' #' @param stn NOAA station number (note that station names are not ...
/R/noaaParameters.R
no_license
robindang0573/VulnToolkit
R
false
false
2,369
r
#' @title Reports data available for a NOAA station #' @description Reports data available for a NOAA station #' #' @details \code{noaa.parameters} reports the parameters (meteorological #' and tidal) available for a specified NOAA station. #' #' #' @param stn NOAA station number (note that station names are not ...
add_gallery_images <- function(album = NULL, id = NULL, title = NULL, ...){ b <- list(title = title, terms = 1) if(!is.null(image)) { if(is.null(title)) b$title <- get_image(id, ...)$title out <- imgurPOST(paste0('gallery/image/', ...
/imguR/R/add_gallery_images.r
no_license
ingted/R-Examples
R
false
false
649
r
add_gallery_images <- function(album = NULL, id = NULL, title = NULL, ...){ b <- list(title = title, terms = 1) if(!is.null(image)) { if(is.null(title)) b$title <- get_image(id, ...)$title out <- imgurPOST(paste0('gallery/image/', ...
source('/home/ccirelli2/Desktop/Repositories/ML_Final_Project_2019/Gotham_Cabs/code/R/Decision_Tree/module0_random_forest.R') # Test Function f.test = function(){ print('hello world') } # Random Forest - Test Number of Trees rf_num_trees = function(data.train, data.test, ntrees.from, ntrees.to, ntrees.step, lis...
/Gotham_Cabs/code/R/Decision_Tree/module0_random_forest.R
no_license
ccirelli2/ML_Final_Project_2019
R
false
false
1,334
r
source('/home/ccirelli2/Desktop/Repositories/ML_Final_Project_2019/Gotham_Cabs/code/R/Decision_Tree/module0_random_forest.R') # Test Function f.test = function(){ print('hello world') } # Random Forest - Test Number of Trees rf_num_trees = function(data.train, data.test, ntrees.from, ntrees.to, ntrees.step, lis...
setwd("../") library(diem) library(ggplot2) library(scales) library(ggpubr) library(gridExtra) library(scales) source("scripts/common/plotting.R") #========================================= # Plot functions #========================================= set_breaks_10 <- function(x){ xmax <- x[2] bk <- 10 br...
/scripts/plot_quant_umap_sf.R
no_license
marcalva/DIEM2019
R
false
false
3,693
r
setwd("../") library(diem) library(ggplot2) library(scales) library(ggpubr) library(gridExtra) library(scales) source("scripts/common/plotting.R") #========================================= # Plot functions #========================================= set_breaks_10 <- function(x){ xmax <- x[2] bk <- 10 br...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/component.effect.R \name{component.effect} \alias{component.effect} \title{Title} \usage{ component.effect( parallel = TRUE, dependent = FALSE, mu = logb(10), xlim = c(0, 1), ylim = c(0, 1), sd = 1, rho = c(0, 0.4, 0.7, 0.9, 1) ...
/man/component.effect.Rd
no_license
anhnguyendepocen/SMRD
R
false
true
591
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/component.effect.R \name{component.effect} \alias{component.effect} \title{Title} \usage{ component.effect( parallel = TRUE, dependent = FALSE, mu = logb(10), xlim = c(0, 1), ylim = c(0, 1), sd = 1, rho = c(0, 0.4, 0.7, 0.9, 1) ...
# Reshaping the data for the eligibility form reshape_eligibility <- function(eligibility) { require(lubridate) eligibility$ic1 <<- NULL eligibility$ic2 <<- NULL eligibility$ic3 <<- NULL eligibility$sex <<- factor(eligibility$sex) eligibility$ic_date <<- as_date(eligibility$ic_date) }
/reshaping_data/reshape_eligibility.R
no_license
EricMenetre/Swiss_first
R
false
false
288
r
# Reshaping the data for the eligibility form reshape_eligibility <- function(eligibility) { require(lubridate) eligibility$ic1 <<- NULL eligibility$ic2 <<- NULL eligibility$ic3 <<- NULL eligibility$sex <<- factor(eligibility$sex) eligibility$ic_date <<- as_date(eligibility$ic_date) }
\name{priceToHILO} \alias{priceToHILO} \title{Price To n-period High and Low} \usage{ priceToHILO(prices, n = 252, lag = 1, HI.only = FALSE) } \arguments{ \item{xts}{object of prices} \item{n}{number of lookback periods} \item{lag}{number of periods to lag for the n-period high and low. A value of lag=1 mea...
/man/priceToHILO.Rd
no_license
arturochian/CQA
R
false
false
846
rd
\name{priceToHILO} \alias{priceToHILO} \title{Price To n-period High and Low} \usage{ priceToHILO(prices, n = 252, lag = 1, HI.only = FALSE) } \arguments{ \item{xts}{object of prices} \item{n}{number of lookback periods} \item{lag}{number of periods to lag for the n-period high and low. A value of lag=1 mea...
#!/usr/bin/env Rscript argv = commandArgs(trailingOnly = TRUE); if (is.null(argv) | length(argv) < 1) { cat("Usage: R-install-package package [type] [lib] [repos]\n"); q(status = 1); } package = argv[1]; type = ifelse(is.na(argv[2]), '{{ r_packages_type }}', argv[2]); lib = ifelse(is.na(argv[3]), '{{ r_packages_l...
/ansible/roles/r/templates/usr/local/bin/R-install-package.j2
permissive
NeCTAR-RC/nectar-images
R
false
false
1,174
j2
#!/usr/bin/env Rscript argv = commandArgs(trailingOnly = TRUE); if (is.null(argv) | length(argv) < 1) { cat("Usage: R-install-package package [type] [lib] [repos]\n"); q(status = 1); } package = argv[1]; type = ifelse(is.na(argv[2]), '{{ r_packages_type }}', argv[2]); lib = ifelse(is.na(argv[3]), '{{ r_packages_l...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/compile_files_to_one_df.R \name{compile_distance_to_one_df} \alias{compile_distance_to_one_df} \title{Compile distance to one data frame} \usage{ compile_distance_to_one_df(b, v, start_times, path = NULL) } \arguments{ \item{b}{required, 8 di...
/get.noaa.weather/man/compile_distance_to_one_df.Rd
no_license
yujiex/gsa_2018
R
false
true
757
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/compile_files_to_one_df.R \name{compile_distance_to_one_df} \alias{compile_distance_to_one_df} \title{Compile distance to one data frame} \usage{ compile_distance_to_one_df(b, v, start_times, path = NULL) } \arguments{ \item{b}{required, 8 di...
# Load libraries ---------------------------------------------------------- require(pacman) pacman::p_load(raster, rgdal, rgeos, stringr, velox, sf, tidyverse, readxl) g <- gc(reset = TRUE) rm(list = ls()) options(scipen = 999) # Load data --------------------------------------------------------------- fls <- list.f...
/01_01_map_3_4.R
no_license
fabiolexcastro/MovilidadUV
R
false
false
470
r
# Load libraries ---------------------------------------------------------- require(pacman) pacman::p_load(raster, rgdal, rgeos, stringr, velox, sf, tidyverse, readxl) g <- gc(reset = TRUE) rm(list = ls()) options(scipen = 999) # Load data --------------------------------------------------------------- fls <- list.f...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/generated_client.R \name{jobs_list_workflows} \alias{jobs_list_workflows} \title{List the workflows a job belongs to} \usage{ jobs_list_workflows(id, archived = NULL) } \arguments{ \item{id}{integer required.} \item{archived}{string optional...
/man/jobs_list_workflows.Rd
no_license
JosiahParry/civis-r
R
false
true
1,925
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/generated_client.R \name{jobs_list_workflows} \alias{jobs_list_workflows} \title{List the workflows a job belongs to} \usage{ jobs_list_workflows(id, archived = NULL) } \arguments{ \item{id}{integer required.} \item{archived}{string optional...
library(ggplot2) # Plot the chart plotCrime <- function(df, theState,theCrime){ if(theState==""){ theState <-"Assam" } if(theCrime==""){ theCrime="RAPE" } print(theState) # Create a subset frame based on the user choice r <- filter(df,state==theState,crime==theCrime) ...
/stateCrime.R
no_license
tvganesh/crimesAgainstWomenIndia
R
false
false
3,327
r
library(ggplot2) # Plot the chart plotCrime <- function(df, theState,theCrime){ if(theState==""){ theState <-"Assam" } if(theCrime==""){ theCrime="RAPE" } print(theState) # Create a subset frame based on the user choice r <- filter(df,state==theState,crime==theCrime) ...
############################################################################## # # Social Network Prediction on Enron Email dataset # CSC-522 Project # # By: # Anshuman Goel - agoel5 # Rohit Nambisam - rnambis # Tyler Cannon - tjcannon # ########################################################################...
/SocialNetwork.R
no_license
anshuman-goel/Prediction-of-Communication-between-Employees-using-Supervised-Learning-Methods
R
false
false
3,163
r
############################################################################## # # Social Network Prediction on Enron Email dataset # CSC-522 Project # # By: # Anshuman Goel - agoel5 # Rohit Nambisam - rnambis # Tyler Cannon - tjcannon # ########################################################################...
#!/usr/bin/env Rscript # # Glenn K. Lockwood, San Diego Supercomputer Center August 2013 # # Generate a pretty plot of queue backlog from the temporally concatenated # output of `nodeview --brief-summary` # ################################################################################ ismooth <-...
/clog-plot.R
no_license
glennklockwood/sdsc-monthly
R
false
false
6,106
r
#!/usr/bin/env Rscript # # Glenn K. Lockwood, San Diego Supercomputer Center August 2013 # # Generate a pretty plot of queue backlog from the temporally concatenated # output of `nodeview --brief-summary` # ################################################################################ ismooth <-...
rm(list = ls()) ## Date: 2020-04-10 ## User: Chelsea Wilmer ## SFA/CSU Thesis ## Script: processing date to make figure like in Gugger et al. ## Packages: library(tidyverse) library(ggpubr) ####Bring in phenology data#### source("/Users/chelseawilmer/Desktop/Github/Phenology/Phenology.data.cleanup.R") # path for Dana...
/7_timing_and_duration.R
no_license
chelsfw/Phenology
R
false
false
2,051
r
rm(list = ls()) ## Date: 2020-04-10 ## User: Chelsea Wilmer ## SFA/CSU Thesis ## Script: processing date to make figure like in Gugger et al. ## Packages: library(tidyverse) library(ggpubr) ####Bring in phenology data#### source("/Users/chelseawilmer/Desktop/Github/Phenology/Phenology.data.cleanup.R") # path for Dana...
library(rxSeq) ### Name: data.X ### Title: Sample data example for X chromosome genes ### Aliases: data.X ### Keywords: utilities ### ** Examples # see total read counts (TReC) for first 2 X chromosome genes of a data example: data.X$y[1:2,]
/data/genthat_extracted_code/rxSeq/examples/data.X.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
249
r
library(rxSeq) ### Name: data.X ### Title: Sample data example for X chromosome genes ### Aliases: data.X ### Keywords: utilities ### ** Examples # see total read counts (TReC) for first 2 X chromosome genes of a data example: data.X$y[1:2,]
## 0) Load dplyr library(dplyr) ## 1) Mean total steps per day ## read data working_directiory <- "C:/Users/IBM_ADMIN/Dropbox/General/Data_Science/coursea/5 - reproducible research/project 1" setwd(working_directiory) act <- read.csv(unz("repdata_data_activity.zip", "activity.csv")) ## Convert $date to as.Date() a...
/Plot1.R
no_license
mr-j-sinclair/RepData_PeerAssessment1
R
false
false
928
r
## 0) Load dplyr library(dplyr) ## 1) Mean total steps per day ## read data working_directiory <- "C:/Users/IBM_ADMIN/Dropbox/General/Data_Science/coursea/5 - reproducible research/project 1" setwd(working_directiory) act <- read.csv(unz("repdata_data_activity.zip", "activity.csv")) ## Convert $date to as.Date() a...
############################################################################## ### file: 03_Descriptives ### authors: Connor Graber ### creation date: 09/03/2020 ### description: Describe the distribution of class, age and sex variables ##########################################################################...
/Graber_Project_01/Code/03_Descriptives.R
no_license
cgraber2/BIOS-6621
R
false
false
1,136
r
############################################################################## ### file: 03_Descriptives ### authors: Connor Graber ### creation date: 09/03/2020 ### description: Describe the distribution of class, age and sex variables ##########################################################################...
# here you can write everyhing # R code for plotting the relationship among ecological variables install.packages("sp") library(sp) #used to modify spatial data #data is used to recall datasets data(meuse) #llock insiede the set meuse #horrible list of data #View is written with capital letter, and allow to se...
/R_code_plot_ecol_var.r
no_license
carlonotari/monitoring_2021
R
false
false
1,404
r
# here you can write everyhing # R code for plotting the relationship among ecological variables install.packages("sp") library(sp) #used to modify spatial data #data is used to recall datasets data(meuse) #llock insiede the set meuse #horrible list of data #View is written with capital letter, and allow to se...
setwd("G:/Meine Ablage/work/coursera/exdata_data_household_power_consumption") #read data dat <- read.table("household_power_consumption.txt", header=T, sep=";") #adapt date dat$Date <- as.Date(as.character(dat$Date), "%d/%m/%Y") #reduce dataset dat1 <- bind_rows(dat[dat$Date =="2007-02-01",], dat[dat$Dat...
/plot2.R
no_license
Christine200/ExData_Plotting1
R
false
false
787
r
setwd("G:/Meine Ablage/work/coursera/exdata_data_household_power_consumption") #read data dat <- read.table("household_power_consumption.txt", header=T, sep=";") #adapt date dat$Date <- as.Date(as.character(dat$Date), "%d/%m/%Y") #reduce dataset dat1 <- bind_rows(dat[dat$Date =="2007-02-01",], dat[dat$Dat...