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 |
|---|---|---|---|---|---|---|---|---|---|
# Charging libraries
library(reshape2)
# Original data files compressed
filename <- "getdata_dataset.zip"
# Download and unzip the dataset:
if (!file.exists("UCI HAR Dataset")) {
unzip(filename)
}
# Read activity labels + features.
actLabels <- read.table("UCI HAR Dataset/activity_labels.txt")
actLabels[... | /run_analysis.R | no_license | macgithub2017/getting_and_cleaning_data | R | false | false | 1,996 | r | # Charging libraries
library(reshape2)
# Original data files compressed
filename <- "getdata_dataset.zip"
# Download and unzip the dataset:
if (!file.exists("UCI HAR Dataset")) {
unzip(filename)
}
# Read activity labels + features.
actLabels <- read.table("UCI HAR Dataset/activity_labels.txt")
actLabels[... |
# SFDA using FEM
# All functions
# Last modified 23 February 2012 by laura
smooth.FEM.fd = function (data,fdobj,lambda)
{
# SMOOTH.FEM.FD Compute a solution for a Spatial Spline problem
#
# Arguments:
# FELSPLOBJ a FELspline object.
# LAMBDA a scalar smoothing parameter.
# DATA a n-by-2 set of noisy obs... | /Codici/00 - Codici solo spaziali/03.2 - Miglior lambda SR (Provincia Venezia)/[PL]/2013_SSR_AllFunctions.R | no_license | GabrieleMazza/TesiDiLaurea | R | false | false | 43,181 | r | # SFDA using FEM
# All functions
# Last modified 23 February 2012 by laura
smooth.FEM.fd = function (data,fdobj,lambda)
{
# SMOOTH.FEM.FD Compute a solution for a Spatial Spline problem
#
# Arguments:
# FELSPLOBJ a FELspline object.
# LAMBDA a scalar smoothing parameter.
# DATA a n-by-2 set of noisy obs... |
`getLevels` <- function(data) {
data <- as.data.frame(data)
colnames <- paste("V", ncol(data), sep = ".")
pN <- unlist(lapply(data, possibleNumeric))
noflevels <- rep(NA, ncol(data))
ulevels <- rep(NA, ncol(data))
noflevels[pN] <- apply(
data[, pN, drop = FALSE... | /R/getLevels.R | no_license | dusadrian/admisc | R | false | false | 1,242 | r | `getLevels` <- function(data) {
data <- as.data.frame(data)
colnames <- paste("V", ncol(data), sep = ".")
pN <- unlist(lapply(data, possibleNumeric))
noflevels <- rep(NA, ncol(data))
ulevels <- rep(NA, ncol(data))
noflevels[pN] <- apply(
data[, pN, drop = FALSE... |
shinyServer(
pageWithSidebar(
headerPanel("LoL Stats"),
sidebarPanel("Account Info",
textInput("nameInput", "Name", ""),
selectInput("region", "Region:",
c("NA" = "na1",
"EUW" = "euw1",
"KR" = "kr")),
actionButton(
... | /ui_old.R | permissive | Kevinjchang98/INFO201-Final-Project-LoL-Stats | R | false | false | 538 | r | shinyServer(
pageWithSidebar(
headerPanel("LoL Stats"),
sidebarPanel("Account Info",
textInput("nameInput", "Name", ""),
selectInput("region", "Region:",
c("NA" = "na1",
"EUW" = "euw1",
"KR" = "kr")),
actionButton(
... |
library(dplyr)
ss.bounds <- readRDS("ss.bounds.rds")
alpha <- 0.025
method <- 'wn'
scenario <- 2
param <- 1
anal_type <- "mice"
ss <- ss.bounds%>%
dplyr::filter(method == "wn", scenario.id == scenario)
do_val <- 0.1
x1 <- parallel::mclapply(X = 1:10000,
mc.cores = parallel::detectCore... | /sim_pgms/wn/do10/2xcontH1_sc2_do10_mice.R | no_license | yuliasidi/nibinom_apply | R | false | false | 3,312 | r | library(dplyr)
ss.bounds <- readRDS("ss.bounds.rds")
alpha <- 0.025
method <- 'wn'
scenario <- 2
param <- 1
anal_type <- "mice"
ss <- ss.bounds%>%
dplyr::filter(method == "wn", scenario.id == scenario)
do_val <- 0.1
x1 <- parallel::mclapply(X = 1:10000,
mc.cores = parallel::detectCore... |
if (!require("quanteda")) {
install.packages("quanteda")
library(quanteda)
}
?tokens_ngrams
?dfm
str(docTokensTrn)
#> str(docTokensTrn)
#List of 3
#$ train_1_en_US_blogs.txt : chr [1:298349] "In" "the" "years" "thereafter" ...
#$ train_1_en_US_news.txt : chr [1:278283] "He" "wasn" "t" "home" ...
#$ train_1_... | /RLearning.R | no_license | vvasamgit/datascience_capstone | R | false | false | 6,952 | r |
if (!require("quanteda")) {
install.packages("quanteda")
library(quanteda)
}
?tokens_ngrams
?dfm
str(docTokensTrn)
#> str(docTokensTrn)
#List of 3
#$ train_1_en_US_blogs.txt : chr [1:298349] "In" "the" "years" "thereafter" ...
#$ train_1_en_US_news.txt : chr [1:278283] "He" "wasn" "t" "home" ...
#$ train_1_... |
# PURPOSE: Produce Poisson AR(1) Gaussian likelihood estimates for revised Figure 3 (see aarxiv)
#
#
# AUTHORS: Stefanos Kechagias, James Livsey, Vladas Pipiras
#
# DATE: April 2020
#
# R version 3.6.3
# ---- Load libraries ----
library(parallel)
library(doParallel)
library(countsFun)
# ---- setup parameters for P... | /archived sims/PoissonAR1/GL/IndividualSimFiles/PoisAR1_GL_N400_NS200_PhiNeg.R | no_license | jlivsey/countsFun | R | false | false | 1,900 | r | # PURPOSE: Produce Poisson AR(1) Gaussian likelihood estimates for revised Figure 3 (see aarxiv)
#
#
# AUTHORS: Stefanos Kechagias, James Livsey, Vladas Pipiras
#
# DATE: April 2020
#
# R version 3.6.3
# ---- Load libraries ----
library(parallel)
library(doParallel)
library(countsFun)
# ---- setup parameters for P... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/norms.R
\name{compmus_long_distance}
\alias{compmus_long_distance}
\alias{compmus_self_similarity}
\title{Pairwise distances in long format}
\usage{
compmus_long_distance(xdat, ydat, feature, method = "euclidean")
compmus_self_similarity(dat... | /man/compmus_long_distance.Rd | no_license | jaburgoyne/compmus | R | false | true | 2,219 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/norms.R
\name{compmus_long_distance}
\alias{compmus_long_distance}
\alias{compmus_self_similarity}
\title{Pairwise distances in long format}
\usage{
compmus_long_distance(xdat, ydat, feature, method = "euclidean")
compmus_self_similarity(dat... |
rm(list=ls())
library(rjags)
library(jagsUI)
library(plyr)
set.seed(2013)
# ---- Data simulation ----
# 1.2. Try random intercept in site to see if it converges
# 9 years of data
# Balanced number of transects per year (NA in not sampled ones)
# TRY TO ACCOUNT FOR OVERDISPERSION BY USING A POISSON-GAMMA MIXTURE ... | /Ch. 2-3/Ch. 2/Bayes/Simulation/1.2. TRIM_PoisGam. S_x[dcat_area_integralBin]_sigma[obs(j,t)_covZone(j)]_lambda[site.alpha.random(j)_year(t)_beta.year(j)].r | no_license | anasanz/MyScripts | R | false | false | 10,896 | r |
rm(list=ls())
library(rjags)
library(jagsUI)
library(plyr)
set.seed(2013)
# ---- Data simulation ----
# 1.2. Try random intercept in site to see if it converges
# 9 years of data
# Balanced number of transects per year (NA in not sampled ones)
# TRY TO ACCOUNT FOR OVERDISPERSION BY USING A POISSON-GAMMA MIXTURE ... |
#library(rstan)
setwd("/Users/karimimohammedbelhal/Desktop/variationalBayes/mcmc_R_isolate/Dir2")
source('compute_LL.R')
source('func_aux.R')
source('func_cov.R')
source('func_distcond.R')
source('func_FIM.R')
source('func_ggplot2.R')
source('func_plots.R')
source('func_simulations.R')
source(... | /MALA - Main/mamyula/saem_mala_cow.R | no_license | BelhalK/AccelerationTrainingAlgorithms | R | false | false | 4,689 | r | #library(rstan)
setwd("/Users/karimimohammedbelhal/Desktop/variationalBayes/mcmc_R_isolate/Dir2")
source('compute_LL.R')
source('func_aux.R')
source('func_cov.R')
source('func_distcond.R')
source('func_FIM.R')
source('func_ggplot2.R')
source('func_plots.R')
source('func_simulations.R')
source(... |
source('util.R', echo = FALSE)
Gene_stats_table <- read.csv("../WW_MiHA/All.IDH1.csv", header = F)
colnames(Gene_stats_table) <- c("GroupType", "SubjectID", "CHROM", "POS", "DD", "REF", "ALT", "QUAL", "VariantType", "MODIFIER", "GeneName", "AssembleID", "TranscriptID")
Num_subjects <- length(unique(Gene_stats_table$S... | /scripts/Gene_stats_IDH.R | permissive | hhuang2018/WGS_analysis | R | false | false | 4,263 | r | source('util.R', echo = FALSE)
Gene_stats_table <- read.csv("../WW_MiHA/All.IDH1.csv", header = F)
colnames(Gene_stats_table) <- c("GroupType", "SubjectID", "CHROM", "POS", "DD", "REF", "ALT", "QUAL", "VariantType", "MODIFIER", "GeneName", "AssembleID", "TranscriptID")
Num_subjects <- length(unique(Gene_stats_table$S... |
# an example CI from a sample of size 20
t.test(rexp(20,1/10))$conf.int
# 10,000 simulated samples of size 20
CIsim(n=20, samples=10000, estimand=10, rdist=rexp, args=list(rate=1/10))
#
# an example CI from a sample of size 5
t.test(rexp(5,1/10))$conf.int
# 10,000 simulated samples of size 5
CIsim... | /inst/snippet/t-robust-exp.R | no_license | cran/fastR | R | false | false | 581 | r | # an example CI from a sample of size 20
t.test(rexp(20,1/10))$conf.int
# 10,000 simulated samples of size 20
CIsim(n=20, samples=10000, estimand=10, rdist=rexp, args=list(rate=1/10))
#
# an example CI from a sample of size 5
t.test(rexp(5,1/10))$conf.int
# 10,000 simulated samples of size 5
CIsim... |
# Exercise 1
x = c(56, 3, 17, 2, 4, 9, 6, 5, 19, 5, 2, 3, 5, 0, 13, 12, 6, 31, 10, 21, 8, 4, 1, 1, 2, 5, 16, 1, 3, 8, 1,
3, 4, 8, 5, 2, 8, 6, 18, 40, 10, 20, 1, 27, 2, 11, 14, 5, 7, 0, 3, 0, 7, 0, 8, 10, 10, 12, 8, 82,
21, 3, 34, 55, 18, 2, 9, 29, 1, 4, 7, 14, 7, 1, 2, 7, 4, 74, 5, 0, 3, 13, 2, 8, 1, 6, 13... | /ex_2019_01_24.R | no_license | hail2thief/exercises | R | false | false | 764 | r | # Exercise 1
x = c(56, 3, 17, 2, 4, 9, 6, 5, 19, 5, 2, 3, 5, 0, 13, 12, 6, 31, 10, 21, 8, 4, 1, 1, 2, 5, 16, 1, 3, 8, 1,
3, 4, 8, 5, 2, 8, 6, 18, 40, 10, 20, 1, 27, 2, 11, 14, 5, 7, 0, 3, 0, 7, 0, 8, 10, 10, 12, 8, 82,
21, 3, 34, 55, 18, 2, 9, 29, 1, 4, 7, 14, 7, 1, 2, 7, 4, 74, 5, 0, 3, 13, 2, 8, 1, 6, 13... |
#' An alternative to the internal \code{do.call}
#'
#' The \code{\link[base]{do.call}} can be somewhat slow, especially when working
#' with large objects. This function is based upon the suggestions from Hadley
#' Wickham on the R mailing list, see \href{http://r.789695.n4.nabble.com/call-do-call-expression-too-bi... | /Gmisc/R/fastDoCall.R | no_license | ingted/R-Examples | R | false | false | 2,199 | r | #' An alternative to the internal \code{do.call}
#'
#' The \code{\link[base]{do.call}} can be somewhat slow, especially when working
#' with large objects. This function is based upon the suggestions from Hadley
#' Wickham on the R mailing list, see \href{http://r.789695.n4.nabble.com/call-do-call-expression-too-bi... |
library(edgeR)
#Read in the raw counts (be sure set row.names if list of genes)
counts <- read.delim("/seq/vgb/barkbase/human_comparison/GTEx_Analysis_2016-01-15_v7_RNASeQCv1.1.8_gene_reads.gct", row.names="Name",sep="\t")
counts <- subset(counts, select=-c(Description))
#Make a DGEList object
dge <- DGEList(counts=c... | /normalizeGTEx.R | permissive | broadinstitute/barkbase_paper_analysis | R | false | false | 683 | r | library(edgeR)
#Read in the raw counts (be sure set row.names if list of genes)
counts <- read.delim("/seq/vgb/barkbase/human_comparison/GTEx_Analysis_2016-01-15_v7_RNASeQCv1.1.8_gene_reads.gct", row.names="Name",sep="\t")
counts <- subset(counts, select=-c(Description))
#Make a DGEList object
dge <- DGEList(counts=c... |
#' Convert h2o gbm or drf to tabular structure
#'
#' Takes a h2o tree based model (gbm or drf) and returns a \code{list} of
#' \code{data.frame}s representing each tree in the model in tabular structure.
#'
#' @param h2o_model gbm or drf h2o model.
#' @param output_subdir directory to output intermediate files (mojo .z... | /R/h2o_tree_convertR.R | no_license | pasacmorg/h2oTreeHelpR | R | false | false | 6,922 | r | #' Convert h2o gbm or drf to tabular structure
#'
#' Takes a h2o tree based model (gbm or drf) and returns a \code{list} of
#' \code{data.frame}s representing each tree in the model in tabular structure.
#'
#' @param h2o_model gbm or drf h2o model.
#' @param output_subdir directory to output intermediate files (mojo .z... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tasks_functions.R
\name{tasklists.list}
\alias{tasklists.list}
\title{Returns all the authenticated user's task lists.}
\usage{
tasklists.list(maxResults = NULL, pageToken = NULL)
}
\arguments{
\item{maxResults}{Maximum number of task lists r... | /googletasksv1.auto/man/tasklists.list.Rd | permissive | Phippsy/autoGoogleAPI | R | false | true | 1,010 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tasks_functions.R
\name{tasklists.list}
\alias{tasklists.list}
\title{Returns all the authenticated user's task lists.}
\usage{
tasklists.list(maxResults = NULL, pageToken = NULL)
}
\arguments{
\item{maxResults}{Maximum number of task lists r... |
library(rjson)
library(httr)
library(twitteR)
# -------------------
# Groups on twitter
# -------------------
# We need several info from the twitter API
# app name (you can choose whatever you. Mine is "rtweet-pkg")
# consumer_key, consumer_secret, access_token, access_token_secret
# I save all the keys and tokens a... | /R/get-data-twitter.R | no_license | rladies/rladies-metrics | R | false | false | 2,587 | r | library(rjson)
library(httr)
library(twitteR)
# -------------------
# Groups on twitter
# -------------------
# We need several info from the twitter API
# app name (you can choose whatever you. Mine is "rtweet-pkg")
# consumer_key, consumer_secret, access_token, access_token_secret
# I save all the keys and tokens a... |
################################################################################
################################################################################
########
######## Utility functions for the maximum likelihood estimation
######## of xylem vessel lengths
########
######## ... | /R/01_VL_distributions.R | permissive | r-link/vessel_length_simulations | R | false | false | 9,189 | r | ################################################################################
################################################################################
########
######## Utility functions for the maximum likelihood estimation
######## of xylem vessel lengths
########
######## ... |
#' add a water year column
#'
#' Add a column to the dataRetrieval data frame with the water year. WQP
#' queries will return a water year column for the start and end dates
#' of the data.
#'
#' @param rawData the daily- or unit-values datset retrieved from NWISweb. Must
#' have at least one of the following co... | /R/addWaterYear.R | no_license | cran/dataRetrieval | R | false | false | 4,397 | r | #' add a water year column
#'
#' Add a column to the dataRetrieval data frame with the water year. WQP
#' queries will return a water year column for the start and end dates
#' of the data.
#'
#' @param rawData the daily- or unit-values datset retrieved from NWISweb. Must
#' have at least one of the following co... |
#a
df = mtcars
df[1:5,]
#b
pairs(~disp + wt + mpg + hp, data = mtcars)
#c
a <- mtcars[,c("mpg","wt")]
model <- lm(mpg~wt, data = a)
print(model)
| /Lab5/assigment5_1.R | no_license | tiyaroy123/Data_Analytics_Lab | R | false | false | 147 | r | #a
df = mtcars
df[1:5,]
#b
pairs(~disp + wt + mpg + hp, data = mtcars)
#c
a <- mtcars[,c("mpg","wt")]
model <- lm(mpg~wt, data = a)
print(model)
|
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | /R/pkg/inst/tests/testthat/test_sparkSQL.R | permissive | mrpyaesone/spark | R | false | false | 68,297 | r | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
############# TUNE CALIPER FOR SIMILARITY METHODS #############
# required functions
source("matching_functions.R")
calipers <- c(-1, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9)
# change for various datasets
dval <- read.table("/scratch/users/naromano/OSIM2/dval2.txt", header=T)
resultsArrayCal <- array(dim=c(1, 10,... | /R/tune_caliper.R | no_license | natoromano/propensity | R | false | false | 2,281 | r | ############# TUNE CALIPER FOR SIMILARITY METHODS #############
# required functions
source("matching_functions.R")
calipers <- c(-1, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9)
# change for various datasets
dval <- read.table("/scratch/users/naromano/OSIM2/dval2.txt", header=T)
resultsArrayCal <- array(dim=c(1, 10,... |
###################################################################################################
### Library #######################################################################################
###################################################################################################
library(XML)
lib... | /FIGSHARE_Code_Fahrrad_Berlin/Listen speichern/Netzwerk_Berlin_Listen_erstellen.R | no_license | LiliaMilo/GPS | R | false | false | 8,519 | r | ###################################################################################################
### Library #######################################################################################
###################################################################################################
library(XML)
lib... |
#import datasets
dataset=read.csv('../input/train.csv')
head(dataset,n=5)
#show columns with respective number of missing values
colSums(is.na(dataset))
colnames(dataset)[colSums(is.na(dataset)) > 0]
#Add average of values in this column in place of NAs
summary(dataset$LotFrontage)
head(dataset$LotFrontage)
dataset$L... | /Script.R | no_license | lokeshnaik808/Beginner-s-House-Price-Prediction-Regression | R | false | false | 9,856 | r | #import datasets
dataset=read.csv('../input/train.csv')
head(dataset,n=5)
#show columns with respective number of missing values
colSums(is.na(dataset))
colnames(dataset)[colSums(is.na(dataset)) > 0]
#Add average of values in this column in place of NAs
summary(dataset$LotFrontage)
head(dataset$LotFrontage)
dataset$L... |
testlist <- list(AgeVector = c(-4.73074171454048e-167, 2.2262381097027e-76, -9.12990429450944e-204, 5.97087417427845e-79, 4.7390525269307e-300, 6.58361441690132e-121, 3.58611068565168e-154, -2.94504776827523e-186, 2.62380314702636e-116, -6.78950518864266e+23, 6.99695749856012e-167, 86485.676793021, 1.11271562183704... | /myTAI/inst/testfiles/cpp_bootMatrix/AFL_cpp_bootMatrix/cpp_bootMatrix_valgrind_files/1615768218-test.R | no_license | akhikolla/updatedatatype-list3 | R | false | false | 1,803 | r | testlist <- list(AgeVector = c(-4.73074171454048e-167, 2.2262381097027e-76, -9.12990429450944e-204, 5.97087417427845e-79, 4.7390525269307e-300, 6.58361441690132e-121, 3.58611068565168e-154, -2.94504776827523e-186, 2.62380314702636e-116, -6.78950518864266e+23, 6.99695749856012e-167, 86485.676793021, 1.11271562183704... |
#' Estimate density of population using density estimator on points.
#'
#' This takes a grid of population in latitude and longitude
#' and turns it into a point per person in order to estimate
#' the density of people.
#'
#' @param projected_raster A raster in projected coordinates.
#' @return A list with a density ra... | /R/density.R | no_license | dd-harp/population_comparison_bioko | R | false | false | 6,179 | r | #' Estimate density of population using density estimator on points.
#'
#' This takes a grid of population in latitude and longitude
#' and turns it into a point per person in order to estimate
#' the density of people.
#'
#' @param projected_raster A raster in projected coordinates.
#' @return A list with a density ra... |
library(ggplot2)
library(gridExtra)
library(grid)
##########################################################################county
count_tbl <- function(varcode, year){
data.frame(get_acs(geography = "county", state = 51,
county = 157,
table = varcode,
y... | /not_shiny_app/Scripts/computer_internet_subscriptions.R | no_license | DSPG-Young-Scholars-Program/dspg21rappk | R | false | false | 7,122 | r | library(ggplot2)
library(gridExtra)
library(grid)
##########################################################################county
count_tbl <- function(varcode, year){
data.frame(get_acs(geography = "county", state = 51,
county = 157,
table = varcode,
y... |
# Example 11.9
x <- scan('software.dat')
tt<- 25.4
x<- x/3600
n<- length(x)
par(mfrow=c(2,2))
hist(x,nclass=15,xlab='CPU time (hours)',ylab='Number',main='')
points(x,rep(0,length(x)),pch='|',cex=.4,lwd=.2)
title(expression('(a) Software failures'))
sumx<- sum(x)
fun1 <- function(alpha,beta){
-alph... | /R/LKPACK/EX11-9.R | permissive | yanliangs/in-all-likelihood | R | false | false | 1,322 | r | # Example 11.9
x <- scan('software.dat')
tt<- 25.4
x<- x/3600
n<- length(x)
par(mfrow=c(2,2))
hist(x,nclass=15,xlab='CPU time (hours)',ylab='Number',main='')
points(x,rep(0,length(x)),pch='|',cex=.4,lwd=.2)
title(expression('(a) Software failures'))
sumx<- sum(x)
fun1 <- function(alpha,beta){
-alph... |
#set working directory (by setwd() command) to where your datafile is placed i.e. "household_power_consumption.txt"
#clear workspace
rm(list=ls())
#check and install the missing packages
list.of.packages <- c("data.table", "lubridate")
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Pa... | /plot2.r | no_license | AjmaniS/ExData_Plotting1 | R | false | false | 1,147 | r | #set working directory (by setwd() command) to where your datafile is placed i.e. "household_power_consumption.txt"
#clear workspace
rm(list=ls())
#check and install the missing packages
list.of.packages <- c("data.table", "lubridate")
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Pa... |
setwd("/Users/jameslondall/Dropbox/DS Course/RPrograming/Week 4")
#Define Worst
sub_worst <- function(data, col_nam, state) {
state_subset <- data[data$'State' == state,]
outcome_arr <- state_subset[[col_nam]]
maxN <- max(outcome_arr, na.rm=T)
max_index <- which(outcome_arr == maxN)
name <- state_subset[max_... | /Week 4/worst.R | no_license | jlondal/RPrograming | R | false | false | 1,738 | r | setwd("/Users/jameslondall/Dropbox/DS Course/RPrograming/Week 4")
#Define Worst
sub_worst <- function(data, col_nam, state) {
state_subset <- data[data$'State' == state,]
outcome_arr <- state_subset[[col_nam]]
maxN <- max(outcome_arr, na.rm=T)
max_index <- which(outcome_arr == maxN)
name <- state_subset[max_... |
library(plot3D)
### Declare variables
x <- df203$southernEdgeDist
y <- df203$mahalDist
z <- df203$painorm
### Change meters to kilometers
x <-x/10^3
### Fit Data
fit <- lm(z ~ x+y+x:y)
fitpoints <- predict(fit)
### prepare Surface
grid.lines = 51
x.pred <- seq(min(x), max(x), length.out = grid.lines)
y.pred <- seq(... | /day2/Plot 3d.R | no_license | jjanski/CasperRRR | R | false | false | 1,062 | r | library(plot3D)
### Declare variables
x <- df203$southernEdgeDist
y <- df203$mahalDist
z <- df203$painorm
### Change meters to kilometers
x <-x/10^3
### Fit Data
fit <- lm(z ~ x+y+x:y)
fitpoints <- predict(fit)
### prepare Surface
grid.lines = 51
x.pred <- seq(min(x), max(x), length.out = grid.lines)
y.pred <- seq(... |
sds_boilerplate_checks <- function(x, sds = NULL) {
## don't pass relative paths to GDAL
## but also don't prevent access to non-files
if (file.exists(x)) x <- base::normalizePath(x, mustWork = FALSE)
## use sds wrapper to target the first by default
datavars <- as.data.frame(vapour_sds_names(x), stringsAsFa... | /R/raster-info.R | no_license | minghao2016/vapour | R | false | false | 10,164 | r | sds_boilerplate_checks <- function(x, sds = NULL) {
## don't pass relative paths to GDAL
## but also don't prevent access to non-files
if (file.exists(x)) x <- base::normalizePath(x, mustWork = FALSE)
## use sds wrapper to target the first by default
datavars <- as.data.frame(vapour_sds_names(x), stringsAsFa... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hdma2.R
\docType{data}
\name{example}
\alias{example}
\title{Dataset for example}
\format{
A list with 4 objects
\describe{
\item{M}{methylation matrix, 668 individuals and 10000 probes}
\item{X}{Exposure for 668 individuals}
\item{Y}{O... | /man/example.Rd | no_license | jumentib/hdma2 | R | false | true | 478 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hdma2.R
\docType{data}
\name{example}
\alias{example}
\title{Dataset for example}
\format{
A list with 4 objects
\describe{
\item{M}{methylation matrix, 668 individuals and 10000 probes}
\item{X}{Exposure for 668 individuals}
\item{Y}{O... |
#Day 3, August 31st - NHIS Data Exploratory Analysis and Cleaning
#what features does the set have?
str(NHISdata)
#what are some general patterns
plot(x = NHISdata$SEX, y = NHISdata$height,
main = "Scatterplot of Sex vs. Height",
xlab = "Sex",
ylab = "height")
plot(x = NHISdata$weight, y = NH... | /NHIS Practicum.R | no_license | sabreenaabedin/ds4001 | R | false | false | 1,073 | r | #Day 3, August 31st - NHIS Data Exploratory Analysis and Cleaning
#what features does the set have?
str(NHISdata)
#what are some general patterns
plot(x = NHISdata$SEX, y = NHISdata$height,
main = "Scatterplot of Sex vs. Height",
xlab = "Sex",
ylab = "height")
plot(x = NHISdata$weight, y = NH... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tisch.R, R/utils.R
\name{reorder_df}
\alias{reorder_df}
\title{Reorder the df}
\usage{
reorder_df(df, vec)
reorder_df(df, vec)
}
\arguments{
\item{df}{the data frame}
\item{vec}{the vector by which the data frame is sorted}
\item{row.names... | /man/reorder_df.Rd | no_license | crubba/tisch | R | false | true | 486 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tisch.R, R/utils.R
\name{reorder_df}
\alias{reorder_df}
\title{Reorder the df}
\usage{
reorder_df(df, vec)
reorder_df(df, vec)
}
\arguments{
\item{df}{the data frame}
\item{vec}{the vector by which the data frame is sorted}
\item{row.names... |
boot.paired.per <-
function(x, y, variable=NULL, null.hyp = NULL,
alternative = c("two.sided","less","greater"), conf.level = 0.95,
type = NULL, R = 9999)
{
# require(boot)
test <- !is.null(null.hyp)
pop.1 <- all.names(substitute(x));
if (length(pop.1)>1) ... | /wBoot/R/boot.paired.per.R | no_license | ingted/R-Examples | R | false | false | 2,347 | r | boot.paired.per <-
function(x, y, variable=NULL, null.hyp = NULL,
alternative = c("two.sided","less","greater"), conf.level = 0.95,
type = NULL, R = 9999)
{
# require(boot)
test <- !is.null(null.hyp)
pop.1 <- all.names(substitute(x));
if (length(pop.1)>1) ... |
nsuppressMessages(library(GenomicRanges))
suppressMessages(library(gplots))
suppressMessages(library(RColorBrewer))
suppressMessages(library(ggplot2))
suppressMessages(library(gridExtra))
suppressMessages(library(scales))
suppressMessages(library(Sushi))
## Params
hic.binsize = 5e3
expr.cutoff = 0.4
enh.radius = 2... | /analysis/src/clust_analysis_multiple.R | no_license | MaKuzman/genome_structure_and_HIV_integration | R | false | false | 138,772 | r | nsuppressMessages(library(GenomicRanges))
suppressMessages(library(gplots))
suppressMessages(library(RColorBrewer))
suppressMessages(library(ggplot2))
suppressMessages(library(gridExtra))
suppressMessages(library(scales))
suppressMessages(library(Sushi))
## Params
hic.binsize = 5e3
expr.cutoff = 0.4
enh.radius = 2... |
# PACKAGES
packages = c(
'shiny',
'shinydashboard',
'ggplot2',
'ggrepel',
'dygraphs',
'dplyr',
'lsr',
'leaflet.extras',
'ggrepel',
'maps'
)
for (p in packages) {
if (!require(p, character.only = T))
install.packages(p, dependencies = T)
library(p, character.only = T)
}
... | /global.R | no_license | KarthikNityanand/asar-PISA | R | false | false | 3,118 | r | # PACKAGES
packages = c(
'shiny',
'shinydashboard',
'ggplot2',
'ggrepel',
'dygraphs',
'dplyr',
'lsr',
'leaflet.extras',
'ggrepel',
'maps'
)
for (p in packages) {
if (!require(p, character.only = T))
install.packages(p, dependencies = T)
library(p, character.only = T)
}
... |
do_salmon <- function(tx2gene, out_tpm, outTrans_tpm, out_counts, out_image, threads, sample_ids) {
# R code
library(tximport)
library(readr)
suppressMessages(library('EnsDb.Hsapiens.v86'))
#txdb <- EnsDb.Hsapiens.v86
#k <- keys(txdb, keytype = "GENEID")
#df <- select(txdb, keys = k, keytype = "GENEID", ... | /scripts/runTximport.R | no_license | yuzhenpeng/snakeflow | R | false | false | 1,885 | r | do_salmon <- function(tx2gene, out_tpm, outTrans_tpm, out_counts, out_image, threads, sample_ids) {
# R code
library(tximport)
library(readr)
suppressMessages(library('EnsDb.Hsapiens.v86'))
#txdb <- EnsDb.Hsapiens.v86
#k <- keys(txdb, keytype = "GENEID")
#df <- select(txdb, keys = k, keytype = "GENEID", ... |
testlist <- list(x = c(7.29112897568282e-304, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0))
result <- do.call(myTAI:::cpp_geom_mean,testlist)
str(result) | /myTAI/inst/testfiles/cpp_geom_mean/AFL_cpp_geom_mean/cpp_geom_mean_valgrind_files/1615839192-test.R | no_license | akhikolla/updatedatatype-list3 | R | false | false | 230 | r | testlist <- list(x = c(7.29112897568282e-304, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0))
result <- do.call(myTAI:::cpp_geom_mean,testlist)
str(result) |
library(shiny)
# Define UI for Fake Contacts Generator application
shinyUI(pageWithSidebar(
# Application title
headerPanel("Fake Contacts Generator by Manish Dhiman"),
# Left panel with control elements for Fake Contacts Generator
sidebarPanel(
h5("Please, choose gender for generator..."),
selec... | /shiny-application/ui.R | no_license | manishdhiman187/shiny-application-and-reproducible-pitch | R | false | false | 1,000 | r | library(shiny)
# Define UI for Fake Contacts Generator application
shinyUI(pageWithSidebar(
# Application title
headerPanel("Fake Contacts Generator by Manish Dhiman"),
# Left panel with control elements for Fake Contacts Generator
sidebarPanel(
h5("Please, choose gender for generator..."),
selec... |
# Code by David Banks <davidgbanks@gmail.com>
# Original concept and application by James Curran <j.curran@auckland.ac.nz>
library(shiny)
library(tfer)
source("parameter_settings.R")
# Get vector of simulation parameter names
paramNames = names(parameters)
# Create shiny server
shinyServer(fun... | /server.R | no_license | jmcurran/tferDocker | R | false | false | 2,261 | r |
# Code by David Banks <davidgbanks@gmail.com>
# Original concept and application by James Curran <j.curran@auckland.ac.nz>
library(shiny)
library(tfer)
source("parameter_settings.R")
# Get vector of simulation parameter names
paramNames = names(parameters)
# Create shiny server
shinyServer(fun... |
\name{Davis.Southern.women.2mode}
\docType{data}
\alias{Davis.Southern.women.2mode}
\alias{Davis.Southern.women.1mode.Cooccurance}
\alias{Davis.Southern.women.1mode.Newman}
\title{ Davis' Southern Women network }
\description{
This dataset was collected by Davis and colleague in the 1930s. It contains the observ... | /man/Davis.Southern.women.Rd | no_license | cran/tnet | R | false | false | 1,174 | rd | \name{Davis.Southern.women.2mode}
\docType{data}
\alias{Davis.Southern.women.2mode}
\alias{Davis.Southern.women.1mode.Cooccurance}
\alias{Davis.Southern.women.1mode.Newman}
\title{ Davis' Southern Women network }
\description{
This dataset was collected by Davis and colleague in the 1930s. It contains the observ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cluster.R
\name{set_idents_nmf}
\alias{set_idents_nmf}
\title{set_idents_nmf}
\usage{
set_idents_nmf(object, k, rank = NULL, stop_if_unavail = FALSE)
}
\arguments{
\item{object}{Object, clustered by \code{\link{cluster_nmf}}.}
\item{k}{Featu... | /man/set_idents_nmf.Rd | permissive | lima1/sttkit | R | false | true | 693 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cluster.R
\name{set_idents_nmf}
\alias{set_idents_nmf}
\title{set_idents_nmf}
\usage{
set_idents_nmf(object, k, rank = NULL, stop_if_unavail = FALSE)
}
\arguments{
\item{object}{Object, clustered by \code{\link{cluster_nmf}}.}
\item{k}{Featu... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/DSC_streamkm.R
\name{DSC_StreamKM}
\alias{DSC_StreamKM}
\alias{streamkm}
\alias{StreamKM}
\title{streamKM++}
\usage{
DSC_StreamKM(sizeCoreset = 10000, numClusters = 5, length = 100000L, ...)
}
\arguments{
\item{sizeCoreset}{Size of the corese... | /man/DSC_StreamKM.Rd | no_license | mhahsler/streamMOA | R | false | true | 1,947 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/DSC_streamkm.R
\name{DSC_StreamKM}
\alias{DSC_StreamKM}
\alias{streamkm}
\alias{StreamKM}
\title{streamKM++}
\usage{
DSC_StreamKM(sizeCoreset = 10000, numClusters = 5, length = 100000L, ...)
}
\arguments{
\item{sizeCoreset}{Size of the corese... |
\name{snpqueries}
\alias{snpqueries}
\title{phenoscanner snpqueries in batches}
\usage{snpqueries(snplist,catalogue="pQTL",proxies="EUR",p=5e-8,r2=0.7,build=37,wait=TRUE)}
\description{
R/phenoscanner only allows for certain number of items supplied. This simple function return
a large number of calls in batches as wel... | /pQTLtools/man/snpqueries.Rd | no_license | chinhbn/R | R | false | false | 2,402 | rd | \name{snpqueries}
\alias{snpqueries}
\title{phenoscanner snpqueries in batches}
\usage{snpqueries(snplist,catalogue="pQTL",proxies="EUR",p=5e-8,r2=0.7,build=37,wait=TRUE)}
\description{
R/phenoscanner only allows for certain number of items supplied. This simple function return
a large number of calls in batches as wel... |
## driftsel
## R package for detecting signals of natural selection in quantitative traits
## Working with Ipomopsis matched population datasets
## April 2015
setwd("~/Dropbox/QSTFST/match/driftsel/")
# install.packages("MCMCpack")
# install.packages("SparseM")
# download packates from http://www.helsinki.fi/biosci... | /match/driftsel/driftsel_matched.R | no_license | ermilano/QSTFST_git | R | false | false | 11,393 | r | ## driftsel
## R package for detecting signals of natural selection in quantitative traits
## Working with Ipomopsis matched population datasets
## April 2015
setwd("~/Dropbox/QSTFST/match/driftsel/")
# install.packages("MCMCpack")
# install.packages("SparseM")
# download packates from http://www.helsinki.fi/biosci... |
#reset the work directory
setwd("E:/coursera/Exploeratory data analysis/assignment/exdata-data-household_power_consumption")
#change the local language
Sys.setlocale("LC_TIME", "English")
#read the data
install.packages("sqldf")
library(sqldf)
data <- read.csv.sql(file = "household_power_consumption.txt",
... | /plot4.R | no_license | kaurala/ExData_Plotting1 | R | false | false | 1,587 | r | #reset the work directory
setwd("E:/coursera/Exploeratory data analysis/assignment/exdata-data-household_power_consumption")
#change the local language
Sys.setlocale("LC_TIME", "English")
#read the data
install.packages("sqldf")
library(sqldf)
data <- read.csv.sql(file = "household_power_consumption.txt",
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllGenerics.R, R/AllMethods.R
\docType{methods}
\name{InputData}
\alias{InputData}
\alias{InputData,MOFAmodel-method}
\title{InputData: set and retrieve training data}
\usage{
InputData(object)
\S4method{InputData}{MOFAmodel}(object)
}
\argu... | /MOFAtools/man/InputData.Rd | no_license | ttriche/MOFA | R | false | true | 450 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllGenerics.R, R/AllMethods.R
\docType{methods}
\name{InputData}
\alias{InputData}
\alias{InputData,MOFAmodel-method}
\title{InputData: set and retrieve training data}
\usage{
InputData(object)
\S4method{InputData}{MOFAmodel}(object)
}
\argu... |
\name{rsu.sep.rb2st}
\alias{rsu.sep.rb2st}
\title{
Surveillance system sensitivity assuming risk based, two-stage sampling
}
\description{
Calculates the surveillance system sensitivity for detection of disease assuming risk based, two-stage sampling (sampling of clusters and sampling of units within cluste... | /man/rsu.sep.rb2st.Rd | no_license | cran/epiR | R | false | false | 5,886 | rd | \name{rsu.sep.rb2st}
\alias{rsu.sep.rb2st}
\title{
Surveillance system sensitivity assuming risk based, two-stage sampling
}
\description{
Calculates the surveillance system sensitivity for detection of disease assuming risk based, two-stage sampling (sampling of clusters and sampling of units within cluste... |
# roughly caculation of memory need:
# 2075259*9*8/2^20 #142.4967mb
#load data
ini<-read.table('household_power_consumption.txt',nrow=20,header=T,sep=';')
classes<-sapply(ini,class)
fl<-file('household_power_consumption.txt')
datas <- read.table(text = grep("^[1,2]/2/2007", readLines(fl), value = T),
... | /plot4.R | no_license | foxet/ExData_Plotting1 | R | false | false | 1,357 | r |
# roughly caculation of memory need:
# 2075259*9*8/2^20 #142.4967mb
#load data
ini<-read.table('household_power_consumption.txt',nrow=20,header=T,sep=';')
classes<-sapply(ini,class)
fl<-file('household_power_consumption.txt')
datas <- read.table(text = grep("^[1,2]/2/2007", readLines(fl), value = T),
... |
library(ggplot2)
library(dplyr)
fp <- file("moby.txt", "r", blocking = FALSE)
moby <- readLines(fp)
close(fp)
moby <- paste0(moby, sep=" ", collapse="")
x <- as.integer(charToRaw(moby))
df <- data.frame(ascii = x)
dat <- df %>% group_by(ascii) %>% summarize(count=length(ascii))
o <- order(dat$count, decreasing=T)
freq... | /moby.R | no_license | aaronferrucci/moby | R | false | false | 667 | r | library(ggplot2)
library(dplyr)
fp <- file("moby.txt", "r", blocking = FALSE)
moby <- readLines(fp)
close(fp)
moby <- paste0(moby, sep=" ", collapse="")
x <- as.integer(charToRaw(moby))
df <- data.frame(ascii = x)
dat <- df %>% group_by(ascii) %>% summarize(count=length(ascii))
o <- order(dat$count, decreasing=T)
freq... |
zones_many = zones_msoa_national %>% filter(geo_code %in% desire_lines_many$geo_code2)
centroids_lsoa_national = pct::get_pct(layer = "c", national = TRUE)
zones_lsoa_national = pct::get_pct(layer = "z", national = TRUE)
centroids_lsoa_many = centroids_lsoa_national[zones_many, ]
zones_lsoa_many = centroids_lsoa_nation... | /code/disaggregate.R | no_license | dabreegster/actdev | R | false | false | 3,423 | r | zones_many = zones_msoa_national %>% filter(geo_code %in% desire_lines_many$geo_code2)
centroids_lsoa_national = pct::get_pct(layer = "c", national = TRUE)
zones_lsoa_national = pct::get_pct(layer = "z", national = TRUE)
centroids_lsoa_many = centroids_lsoa_national[zones_many, ]
zones_lsoa_many = centroids_lsoa_nation... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pitch.R
\name{pitch.read}
\alias{pitch.read}
\title{pitch.read}
\usage{
pitch.read(fileNamePitch, encoding = "UTF-8")
}
\arguments{
\item{fileNamePitch}{file name of Pitch object}
\item{encoding}{File encoding (default: \code{"UTF... | /man/pitch.read.Rd | permissive | cran/rPraat | R | false | true | 2,046 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pitch.R
\name{pitch.read}
\alias{pitch.read}
\title{pitch.read}
\usage{
pitch.read(fileNamePitch, encoding = "UTF-8")
}
\arguments{
\item{fileNamePitch}{file name of Pitch object}
\item{encoding}{File encoding (default: \code{"UTF... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/make_grid.R
\name{make_grid}
\alias{make_grid}
\title{Make a depth stratified survey grid}
\usage{
make_grid(
x_range = c(-140, 140),
y_range = c(-140, 140),
res = c(3.5, 3.5),
shelf_depth = 200,
shelf_width = 100,
depth_range = c... | /man/make_grid.Rd | no_license | rboenish/SimSurvey-Length-based-shenanigans | R | false | true | 1,584 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/make_grid.R
\name{make_grid}
\alias{make_grid}
\title{Make a depth stratified survey grid}
\usage{
make_grid(
x_range = c(-140, 140),
y_range = c(-140, 140),
res = c(3.5, 3.5),
shelf_depth = 200,
shelf_width = 100,
depth_range = c... |
library(rsconnect)
library(shiny)
library(shinythemes)
library(ggplot2)
library(DT)
library(dplyr)
library(rgl)
library(car)
##### data cleaning/assembly
# note: SRM chosen to measure color these measurements vary based on source
# note: IBU can also vary based on source (since these measurements were constructed
# f... | /beersvis.R | no_license | briceran/R-DSTools | R | false | false | 3,831 | r | library(rsconnect)
library(shiny)
library(shinythemes)
library(ggplot2)
library(DT)
library(dplyr)
library(rgl)
library(car)
##### data cleaning/assembly
# note: SRM chosen to measure color these measurements vary based on source
# note: IBU can also vary based on source (since these measurements were constructed
# f... |
#Antes de Testar:
# É necessário baixar/atualizar a versão da biblioteca:
install.packages("devtools")
library(devtools)
install_github("pedroliman/oshcba")
# Uma vez instalada ou atualizada, é necessário carregar a biblioteca e executar os comandos.
library(oshcba)
#' Carregar arquivo de inputs (Alterar para a loca... | /tests/testthat/como_testar_oshcba.R | no_license | pedroliman/oshcba | R | false | false | 2,251 | r | #Antes de Testar:
# É necessário baixar/atualizar a versão da biblioteca:
install.packages("devtools")
library(devtools)
install_github("pedroliman/oshcba")
# Uma vez instalada ou atualizada, é necessário carregar a biblioteca e executar os comandos.
library(oshcba)
#' Carregar arquivo de inputs (Alterar para a loca... |
#' Wrapper function for computing unified information-theoretic causality
#' for the marginal embedding dimension.
#'
#' \code{uic.marginal} returns model statistics computed from given multiple time
#' series using simplex projection and cross mapping. This function computes UICs
#' by a model averaging technique (i.... | /R/uic.marginal.R | no_license | yutakaos/rUIC | R | false | false | 2,603 | r | #' Wrapper function for computing unified information-theoretic causality
#' for the marginal embedding dimension.
#'
#' \code{uic.marginal} returns model statistics computed from given multiple time
#' series using simplex projection and cross mapping. This function computes UICs
#' by a model averaging technique (i.... |
# Need to download Shiny from GitHub
testModule(chart, {
# Confirm that the data reactive is behaving as expected
expect_equal(nrow(p()), 150)
expect_equal(ncol(p()), 5)
# How can we set this to colnames(datafile)
# expect_equal(colnames(p()), c("length", "width"))
# And now the plot function is so simpl... | /tests/plot.R | no_license | skybett/module_demo | R | false | false | 552 | r | # Need to download Shiny from GitHub
testModule(chart, {
# Confirm that the data reactive is behaving as expected
expect_equal(nrow(p()), 150)
expect_equal(ncol(p()), 5)
# How can we set this to colnames(datafile)
# expect_equal(colnames(p()), c("length", "width"))
# And now the plot function is so simpl... |
t.test(Auction$dutch, Auction$FP, paired = TRUE)
t.test(~ (dutch - FP), data = Auction)
| /inst/snippets/Exploration7.3.7.R | no_license | rpruim/ISIwithR | R | false | false | 89 | r | t.test(Auction$dutch, Auction$FP, paired = TRUE)
t.test(~ (dutch - FP), data = Auction)
|
## This function first creates a matrix and stores it.
makeCacheMatrix <- function(x = matrix()) {
inver <- NULL
set <- function(y) {
x <<- y
inver <<- NULL
}
get <- function() x
set_inver <- function(inverse) inver <<- inverse
get_inver <... | /cachematrix.R | no_license | nyusupov/Week3-R-Programming-course | R | false | false | 845 | r | ## This function first creates a matrix and stores it.
makeCacheMatrix <- function(x = matrix()) {
inver <- NULL
set <- function(y) {
x <<- y
inver <<- NULL
}
get <- function() x
set_inver <- function(inverse) inver <<- inverse
get_inver <... |
#Julian Ramirez-Villegas
#June 2013
#CIAT / CCAFS / UoL
stop("!")
### prepare the Sacks calendar for necessary analyses.
#load libraries
library(raster); library(rgdal)
#i/o directories
#bDir <- "/nfs/a17/eejarv/PhD-work/crop-modelling/niche-based"
bDir <- "/mnt/a17/eejarv/PhD-work/crop-modelling/niche-based"
envDir... | /PhD/0007-crop-modelling/scripts/niche_based/nb-04-prepare_soil.R | no_license | CIAT-DAPA/dapa-climate-change | R | false | false | 1,099 | r | #Julian Ramirez-Villegas
#June 2013
#CIAT / CCAFS / UoL
stop("!")
### prepare the Sacks calendar for necessary analyses.
#load libraries
library(raster); library(rgdal)
#i/o directories
#bDir <- "/nfs/a17/eejarv/PhD-work/crop-modelling/niche-based"
bDir <- "/mnt/a17/eejarv/PhD-work/crop-modelling/niche-based"
envDir... |
# setwd("/home/marc/research/subjects/mixtures/combining_mixtures")
if(!exists('IFILE')) IFILE = 'data/sim-mo_01-10-spherical-fig02.RData'
if(!exists('lambda')) lambda = 'DEMP'
if(!exists('omega')) omega = 'prop'
if(!exists('OFILE')) OFILE = sprintf('data/hp_sim-mo_01-10-spherical-%s-%s-fig02.RData', lambda, omega)
... | /combining_mixtures/figure02/build_hierarchical_partitions.R | no_license | mcomas/mixtures | R | false | false | 1,295 | r | # setwd("/home/marc/research/subjects/mixtures/combining_mixtures")
if(!exists('IFILE')) IFILE = 'data/sim-mo_01-10-spherical-fig02.RData'
if(!exists('lambda')) lambda = 'DEMP'
if(!exists('omega')) omega = 'prop'
if(!exists('OFILE')) OFILE = sprintf('data/hp_sim-mo_01-10-spherical-%s-%s-fig02.RData', lambda, omega)
... |
################################################################################
############# Create regional innovation networks from paten data ##############
#### working directory and options
getwd()
rm(list = ls())
options(scipen = 999)
#### load some packages
library(openxlsx)
library(tidyverse)
##############... | /code.R | no_license | nghauranalain/rin | R | false | false | 5,853 | r | ################################################################################
############# Create regional innovation networks from paten data ##############
#### working directory and options
getwd()
rm(list = ls())
options(scipen = 999)
#### load some packages
library(openxlsx)
library(tidyverse)
##############... |
# add global variable
if (getRversion() >= "2.15.1") {
utils::globalVariables(unique(c(
"labelp", # cor plot
c("..density..", "..scaled..", "x"), # facetdensitystrip plot
c("..scaled..", "x"), #density diagonal plot
c("x", "y", "lab"), # internal axis plot
c("x", "y", "result", "freq") # fluctuati... | /R/gg-plots.R | no_license | ewallace/ggally | R | false | false | 38,658 | r | # add global variable
if (getRversion() >= "2.15.1") {
utils::globalVariables(unique(c(
"labelp", # cor plot
c("..density..", "..scaled..", "x"), # facetdensitystrip plot
c("..scaled..", "x"), #density diagonal plot
c("x", "y", "lab"), # internal axis plot
c("x", "y", "result", "freq") # fluctuati... |
plsregress <- function(X, Y, ncomp){
#X = read.table("C:/Users/Horace/Desktop/BPM_R/VM_PLS/XF.txt", header = FALSE)
#Y = read.table("C:/Users/Horace/Desktop/BPM_R/VM_PLS/YF.txt", header = FALSE)
#ncomp = 3
n = nrow(X)
dx = ncol(X)
maxncomp = min(n-1,dx)
if (ncomp > maxncomp)... | /VM_PLS/plsregress.R | no_license | JamesShieh0510/bpm | R | false | false | 2,003 | r | plsregress <- function(X, Y, ncomp){
#X = read.table("C:/Users/Horace/Desktop/BPM_R/VM_PLS/XF.txt", header = FALSE)
#Y = read.table("C:/Users/Horace/Desktop/BPM_R/VM_PLS/YF.txt", header = FALSE)
#ncomp = 3
n = nrow(X)
dx = ncol(X)
maxncomp = min(n-1,dx)
if (ncomp > maxncomp)... |
#' Unit Conversion - SI Prefixes - Base to Yocto-
#'
#' Yocto- means 1/1 000 000 000 000 000 000 000 000 or 10^(-24)
#'
#' Performs a conversion from base units to yocto-units (ex. grams to yoctograms).
#'
#' @param x Vector - Values in units of base units
#'
#' @return x, but converted to yocto-units
#'
#' @refe... | /R/unitconversion.siprefix.base.to.yocto.R | permissive | burrm/lolcat | R | false | false | 7,330 | r | #' Unit Conversion - SI Prefixes - Base to Yocto-
#'
#' Yocto- means 1/1 000 000 000 000 000 000 000 000 or 10^(-24)
#'
#' Performs a conversion from base units to yocto-units (ex. grams to yoctograms).
#'
#' @param x Vector - Values in units of base units
#'
#' @return x, but converted to yocto-units
#'
#' @refe... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sns_operations.R
\name{sns_get_platform_application_attributes}
\alias{sns_get_platform_application_attributes}
\title{Retrieves the attributes of the platform application object for the
supported push notification services, such as APNS and ... | /cran/paws.application.integration/man/sns_get_platform_application_attributes.Rd | permissive | jcheng5/paws | R | false | true | 1,001 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sns_operations.R
\name{sns_get_platform_application_attributes}
\alias{sns_get_platform_application_attributes}
\title{Retrieves the attributes of the platform application object for the
supported push notification services, such as APNS and ... |
library(shiny)
library(ggplot2)
ptData <- read.csv("www/ptData_1.csv", header=TRUE, na.strings = "NA")
dataset <- ptData
function(input, output) {
output$summary<-renderPrint(
str(ptData))
output$agePlot <- renderPlot({
y1 <- cut(ptData[,1], b = input$bins)
plot... | /server.R | no_license | rhosek/developing_data_products | R | false | false | 1,007 | r |
library(shiny)
library(ggplot2)
ptData <- read.csv("www/ptData_1.csv", header=TRUE, na.strings = "NA")
dataset <- ptData
function(input, output) {
output$summary<-renderPrint(
str(ptData))
output$agePlot <- renderPlot({
y1 <- cut(ptData[,1], b = input$bins)
plot... |
#Get the data set for Reference series GSE6631
#NCBI GDS2520
#annotation file GPL8300
library(Biobase)
library(GEOquery)
gds <- getGEO("GDS2520")
# Convert to expression set
eset <- GDS2eSet(gds, do.log2 = TRUE)
#get sample names
smp <- sampleNames(eset)
#get gene annotation information
gpl <- getGEO("GPL8300")
#create... | /Final_Kbeers.R | no_license | kllavin2/Final_Project | R | false | false | 3,477 | r | #Get the data set for Reference series GSE6631
#NCBI GDS2520
#annotation file GPL8300
library(Biobase)
library(GEOquery)
gds <- getGEO("GDS2520")
# Convert to expression set
eset <- GDS2eSet(gds, do.log2 = TRUE)
#get sample names
smp <- sampleNames(eset)
#get gene annotation information
gpl <- getGEO("GPL8300")
#create... |
% File man/getSnapQuotesList.Rd
\name{getSnapQuotesList}
\alias{getSnapQuotesList}
\title{Retrieve a list of current quotes from the API}
\description{
Given a set of symbols, retrieve the current quote for them.
}
\usage{
getSnapQuotesList(sessionid, source, stocks)
}
... | /man/getSnapQuotesList.Rd | no_license | Gsaenz1977/RTDAmeritrade | R | false | false | 1,026 | rd | % File man/getSnapQuotesList.Rd
\name{getSnapQuotesList}
\alias{getSnapQuotesList}
\title{Retrieve a list of current quotes from the API}
\description{
Given a set of symbols, retrieve the current quote for them.
}
\usage{
getSnapQuotesList(sessionid, source, stocks)
}
... |
library(readr)
library(tidyr)
library(dplyr)
library(rgdal)
library(spdplyr)
library(janitor)
library(openxlsx)
use_local_data <- TRUE
##' Load water right information from California Water Rights LIST on the CA
##' Open Data Portal website. We trust the data sets we publish to the public,
##' right?
##'
##' Data s... | /explore/huc8-completeness-check.R | permissive | dhesswrce/dwr-wasdet | R | false | false | 2,747 | r |
library(readr)
library(tidyr)
library(dplyr)
library(rgdal)
library(spdplyr)
library(janitor)
library(openxlsx)
use_local_data <- TRUE
##' Load water right information from California Water Rights LIST on the CA
##' Open Data Portal website. We trust the data sets we publish to the public,
##' right?
##'
##' Data s... |
library(reshape)
library(MASS)
library(plyr)
library(dplyr)
#library(rgdal)
if(Sys.info()[4]=="JOSH_LAPTOP")
setwd("~/Professional Files/Mines/SmartGeo/Queens/")
if(grepl("ch",Sys.info()[4]))
setwd("~/SmartGeo/Queens")
#ground contains data for ground deformation by station_ID
ground = read.csv(file="Data/AMTS_Fi... | /data_cleanup.R | no_license | joshbrowning2358/SmartGeo | R | false | false | 4,480 | r | library(reshape)
library(MASS)
library(plyr)
library(dplyr)
#library(rgdal)
if(Sys.info()[4]=="JOSH_LAPTOP")
setwd("~/Professional Files/Mines/SmartGeo/Queens/")
if(grepl("ch",Sys.info()[4]))
setwd("~/SmartGeo/Queens")
#ground contains data for ground deformation by station_ID
ground = read.csv(file="Data/AMTS_Fi... |
#' @useDynLib ForesToolboxRS
#' @importFrom Rcpp sourceCpp
NULL
| /R/ForesToolboxRS-package.R | permissive | amsantac/ForesToolboxRS | R | false | false | 64 | r | #' @useDynLib ForesToolboxRS
#' @importFrom Rcpp sourceCpp
NULL
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/core.R
\name{nter}
\alias{nter}
\title{nter}
\usage{
nter(id, input = "window")
}
\arguments{
\item{id}{Id of button.}
\item{input}{Active input that triggers, useful if you have
more than one button triggered by an enter key.}
}
\descripti... | /man/nter.Rd | permissive | JohnCoene/nter | R | false | true | 369 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/core.R
\name{nter}
\alias{nter}
\title{nter}
\usage{
nter(id, input = "window")
}
\arguments{
\item{id}{Id of button.}
\item{input}{Active input that triggers, useful if you have
more than one button triggered by an enter key.}
}
\descripti... |
#' Projection of Vector y on columns of X
#'
#' Fitting a linear model, \code{lm(y ~ X)}, by least squares can be thought of geometrically as the orthogonal projection of
#' \code{y} on the column space of \code{X}. This function is designed to allow exploration of projections
#' and orthogonality.
#'
#' The proj... | /R/proj.R | no_license | cran/matlib | R | false | false | 1,716 | r | #' Projection of Vector y on columns of X
#'
#' Fitting a linear model, \code{lm(y ~ X)}, by least squares can be thought of geometrically as the orthogonal projection of
#' \code{y} on the column space of \code{X}. This function is designed to allow exploration of projections
#' and orthogonality.
#'
#' The proj... |
## An implementation of
## "A Resampling Approach for Correcting Systematic Spatiotemporal Biases for Multiple Variables in a Changing Climate"
## by Mehrotra and Sharma (2019), Water Resources Research, 55(1), pp.754-770, doi: 10.1029/2018WR023270
## Refered to as 3DBC (3-dimensional bias-correction), as it keeps inte... | /EC-EARTH_RCA/RCP85/3DBC_hurs_EC-EARTH_RCA_APP_template.R | no_license | doblerone/3DBC | R | false | false | 5,043 | r | ## An implementation of
## "A Resampling Approach for Correcting Systematic Spatiotemporal Biases for Multiple Variables in a Changing Climate"
## by Mehrotra and Sharma (2019), Water Resources Research, 55(1), pp.754-770, doi: 10.1029/2018WR023270
## Refered to as 3DBC (3-dimensional bias-correction), as it keeps inte... |
# Problem explanation
# 3 Ranking hospitals by outcome in a state
# Write a function called rankhospital that takes three arguments: the 2-character abbreviated name of a
# state (state), an outcome (outcome), and the ranking of a hospital in that state for that outcome (num).
# The function reads the outcome-of-care-m... | /rankhospital_test.R | no_license | datamaniac03/DataAnalysis_BestHospital | R | false | false | 5,009 | r | # Problem explanation
# 3 Ranking hospitals by outcome in a state
# Write a function called rankhospital that takes three arguments: the 2-character abbreviated name of a
# state (state), an outcome (outcome), and the ranking of a hospital in that state for that outcome (num).
# The function reads the outcome-of-care-m... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/effectsoperations.R
\name{modeled_windows}
\alias{modeled_windows}
\title{Returns a dataframe with factor variables including window breaks at a specifie level.}
\usage{
modeled_windows(effectsobj, pval = 0.05)
}
\arguments{
\item{effectsobj:... | /man/modeled_windows.Rd | no_license | bjb40/apcwin | R | false | true | 610 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/effectsoperations.R
\name{modeled_windows}
\alias{modeled_windows}
\title{Returns a dataframe with factor variables including window breaks at a specifie level.}
\usage{
modeled_windows(effectsobj, pval = 0.05)
}
\arguments{
\item{effectsobj:... |
#' Rounds number to nearest increment.
#'
#' Instead of rounding a number to the nearest nth
#' decimal place, this function rounds to the neares
#' multiple of \code{dx}.
#'
#' @param x Number to be rounded.
#' @param dx Increment to be rounded.
#' @return Rounded number.
#' @export
rounddx <- function(x, dx=1){
r... | /R/round.R | permissive | tunelipt/wutils | R | false | false | 1,422 | r |
#' Rounds number to nearest increment.
#'
#' Instead of rounding a number to the nearest nth
#' decimal place, this function rounds to the neares
#' multiple of \code{dx}.
#'
#' @param x Number to be rounded.
#' @param dx Increment to be rounded.
#' @return Rounded number.
#' @export
rounddx <- function(x, dx=1){
r... |
#ESM 262
#Jonathan Pham
#Shiny and Online publishing lecture
#A slide will break everywhere there is a "##"
#When creating an R markdaown, the output options are there for decfault to slect the format of output document | /shinylecturenotes.R | no_license | jpham916/shinyweek | R | false | false | 224 | r | #ESM 262
#Jonathan Pham
#Shiny and Online publishing lecture
#A slide will break everywhere there is a "##"
#When creating an R markdaown, the output options are there for decfault to slect the format of output document |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MiscFuns.R
\name{wald}
\alias{wald}
\title{Wald test of nullity of coefficients}
\usage{
wald(x, keep = NULL, drop = NULL, print = TRUE, se, cluster, ...)
}
\arguments{
\item{x}{A \code{fixest} object. Obtained using the methods \code{\link[f... | /fixest/man/wald.Rd | no_license | akhikolla/InformationHouse | R | false | true | 4,496 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MiscFuns.R
\name{wald}
\alias{wald}
\title{Wald test of nullity of coefficients}
\usage{
wald(x, keep = NULL, drop = NULL, print = TRUE, se, cluster, ...)
}
\arguments{
\item{x}{A \code{fixest} object. Obtained using the methods \code{\link[f... |
## This R-script uses all data to estimate species richness across samples,
## using an offset to correct for sampling effort, and while fitting block and
## sequencing run (ptp_id) as technical covariates. The BLUPs are written out
## in mixmogam file format for GWAS.
##
## Author: matt.horton
#######################... | /field/panel/2_analyze/1_diversity/1_gwas_richness/1_alpha_richness/1_kingdom_richness/1_single_kingdom_alpha_ranef.R | no_license | carbon14bond/microbePCA | R | false | false | 5,465 | r | ## This R-script uses all data to estimate species richness across samples,
## using an offset to correct for sampling effort, and while fitting block and
## sequencing run (ptp_id) as technical covariates. The BLUPs are written out
## in mixmogam file format for GWAS.
##
## Author: matt.horton
#######################... |
library(tidyverse)
library(dynbenchmark)
experiment("10-benchmark_interpretation")
data <- read_rds(result_file("benchmark_results_normalised.rds", "06-benchmark"))$data
# aggregate without errors
data_aggregations <- benchmark_aggregate(
data = data %>% filter(error_status == "no_error")
)$data_aggregations
over... | /scripts/10-benchmark_interpretation/02-dataset_sources.R | no_license | AswinSSoman/dynbenchmark | R | false | false | 1,729 | r | library(tidyverse)
library(dynbenchmark)
experiment("10-benchmark_interpretation")
data <- read_rds(result_file("benchmark_results_normalised.rds", "06-benchmark"))$data
# aggregate without errors
data_aggregations <- benchmark_aggregate(
data = data %>% filter(error_status == "no_error")
)$data_aggregations
over... |
#
# This is the user-interface definition of a Shiny web application. You can
# run the application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
# Define UI for application that draws a histogram
shinyUI(navbarPage("BIOS... | /project_2/app/ui.R | no_license | datasci611/bios611-projects-fall-2019-arquinter | R | false | false | 1,976 | r | #
# This is the user-interface definition of a Shiny web application. You can
# run the application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
# Define UI for application that draws a histogram
shinyUI(navbarPage("BIOS... |
#Load library for date conversion
library("lubridate")
#Read file, convert date, subset relevant dates to new data frame, transform data series to numeric
PC<-read.csv(unzip("C:/Users/DG/Documents/EDX/ExplorData/PowC.csv"), header=T, sep=";", stringsAsFactors = FALSE)
PC$Date<-dmy(PC$Date)
PoC<-PC[PC$Date==y... | /plot3.R | no_license | dgodca/ExData_Plotting1 | R | false | false | 1,605 | r | #Load library for date conversion
library("lubridate")
#Read file, convert date, subset relevant dates to new data frame, transform data series to numeric
PC<-read.csv(unzip("C:/Users/DG/Documents/EDX/ExplorData/PowC.csv"), header=T, sep=";", stringsAsFactors = FALSE)
PC$Date<-dmy(PC$Date)
PoC<-PC[PC$Date==y... |
vars <- scale(microvan[,3:32]) #standardizing the content
cor <- cor(vars) #Analyse the correlation matrix
upper<-round(cor,3) # we round the results to the 3d digit after comma
upper[upper.tri(cor)]<-""
upper<-as.data.frame(upper)
upper
#As the correlation matrix is rather large (30 dimensions),
#we will visua... | /.github/workflows/microvan_assignment.r | no_license | johnyvas/R-CUSA | R | false | false | 7,008 | r | vars <- scale(microvan[,3:32]) #standardizing the content
cor <- cor(vars) #Analyse the correlation matrix
upper<-round(cor,3) # we round the results to the 3d digit after comma
upper[upper.tri(cor)]<-""
upper<-as.data.frame(upper)
upper
#As the correlation matrix is rather large (30 dimensions),
#we will visua... |
library(tidyverse)
library(scico)
inPark = "Gar"
parkJoiner <- read_csv("joinTables/parkNames.csv")
#mean variables by subzone
meanVars <- read_csv("outputCsvs/meanVars.csv")
meanVarNames <- read_csv("joinTables/structure.csv")
meanVars <- left_join(meanVars, meanVarNames)
meanVars <- left_join(meanVars, parkJoine... | /R_elev_graphs.R | no_license | emuise/code-BCparksReportCards | R | false | false | 1,799 | r | library(tidyverse)
library(scico)
inPark = "Gar"
parkJoiner <- read_csv("joinTables/parkNames.csv")
#mean variables by subzone
meanVars <- read_csv("outputCsvs/meanVars.csv")
meanVarNames <- read_csv("joinTables/structure.csv")
meanVars <- left_join(meanVars, meanVarNames)
meanVars <- left_join(meanVars, parkJoine... |
# Install and load packages
package_names <- c("survey","dplyr","foreign","devtools")
lapply(package_names, function(x) if(!x %in% installed.packages()) install.packages(x))
lapply(package_names, require, character.only=T)
install_github("e-mitchell/meps_r_pkg/MEPS")
library(MEPS)
options(survey.lonely.ps... | /mepstrends/hc_use/json/code/r/totPOP__health__agegrps__.r | permissive | HHS-AHRQ/MEPS-summary-tables | R | false | false | 2,198 | r | # Install and load packages
package_names <- c("survey","dplyr","foreign","devtools")
lapply(package_names, function(x) if(!x %in% installed.packages()) install.packages(x))
lapply(package_names, require, character.only=T)
install_github("e-mitchell/meps_r_pkg/MEPS")
library(MEPS)
options(survey.lonely.ps... |
library(leaflet)
# Choices for drop-downs
vars <- c(
"Is SuperZIP?" = "superzip",
"Centile score" = "centile",
"College education" = "college",
"Median income" = "income",
"Population" = "adultpop"
)
navbarPage("WeatherMap", id="nav",
tabPanel("Interactive map",
div(class="outer",
tags$head(
... | /ui.R | no_license | xiaopupeng/WeatherMap | R | false | false | 4,841 | r | library(leaflet)
# Choices for drop-downs
vars <- c(
"Is SuperZIP?" = "superzip",
"Centile score" = "centile",
"College education" = "college",
"Median income" = "income",
"Population" = "adultpop"
)
navbarPage("WeatherMap", id="nav",
tabPanel("Interactive map",
div(class="outer",
tags$head(
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/runCheck.R
\name{pca_check}
\alias{pca_check}
\title{PCA QC check}
\usage{
pca_check(
data,
group,
dir = ".",
prefix = "1-run_check",
palette = RColorBrewer::brewer.pal(3, "Set2")[1:2]
)
}
\arguments{
\item{data}{a cpm data frame of... | /man/pca_check.Rd | no_license | xiayh17/RNAseqStat2 | R | false | true | 656 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/runCheck.R
\name{pca_check}
\alias{pca_check}
\title{PCA QC check}
\usage{
pca_check(
data,
group,
dir = ".",
prefix = "1-run_check",
palette = RColorBrewer::brewer.pal(3, "Set2")[1:2]
)
}
\arguments{
\item{data}{a cpm data frame of... |
# mod 1
v <- c(1,4,-3)
v2 <- 3 * v
w <- c(-2,5,7)
## linear combination
v + w
3*v - 2*w
## dot product
dot <- v %*% w
## vector length and angle
lv <- sqrt(sum(v^2))
lw <- sqrt(sum(w^2))
angle <- acos(dot / (lv*lw)) * 180/pi
## orthogonal (considered to be orthoganal if vectors are 90degrees apart
## / dot product ... | /Week01/mod1.R | no_license | wwells/CUNY_DATA_605 | R | false | false | 376 | r | # mod 1
v <- c(1,4,-3)
v2 <- 3 * v
w <- c(-2,5,7)
## linear combination
v + w
3*v - 2*w
## dot product
dot <- v %*% w
## vector length and angle
lv <- sqrt(sum(v^2))
lw <- sqrt(sum(w^2))
angle <- acos(dot / (lv*lw)) * 180/pi
## orthogonal (considered to be orthoganal if vectors are 90degrees apart
## / dot product ... |
#################################################
###r80, individual number of loci and coverage###
#################################################
#Diane, on March 2018
#diane.bailleul.pro@gmail.com
#after setting the goos parameters
##############################
#Version Stacks 2.08B ou 1.46#
##################... | /overlapping_loci_1batch_all.R | no_license | dbailleul/RadSeq | R | false | false | 2,627 | r | #################################################
###r80, individual number of loci and coverage###
#################################################
#Diane, on March 2018
#diane.bailleul.pro@gmail.com
#after setting the goos parameters
##############################
#Version Stacks 2.08B ou 1.46#
##################... |
library(dplyr)
library(ggplot2)
library(ranger)
bikes_df <- read.csv("https://raw.githubusercontent.com/mehtablocker/cuny_605/master/data_files/bike_sharing_hourly.csv")
bikesJuly <- bikes_df %>% filter(mnth==7)
bikesAugust <- bikes_df %>% filter(mnth==8)
# The outcome column
(outcome <- "cnt")
# The inpu... | /random_forest_datacamp_ex.R | no_license | mehtablocker/cuny_605 | R | false | false | 1,251 | r | library(dplyr)
library(ggplot2)
library(ranger)
bikes_df <- read.csv("https://raw.githubusercontent.com/mehtablocker/cuny_605/master/data_files/bike_sharing_hourly.csv")
bikesJuly <- bikes_df %>% filter(mnth==7)
bikesAugust <- bikes_df %>% filter(mnth==8)
# The outcome column
(outcome <- "cnt")
# The inpu... |
checkSampling <- function(x, y, samples){
## x,y - names of columns in samples to compare
pairs <- gettextf('%i-%i', samples[[x]], samples[[y]])
table(table(pairs))/nrow(samples)
}
source('scripts/common.R')
args <- getargs(argv=commandArgs(trailingOnly=TRUE), ntargets=2)
sources <- args$sources
targets <- args$... | /scripts/checkOversampling.R | no_license | nhoffman/deltas | R | false | false | 1,347 | r | checkSampling <- function(x, y, samples){
## x,y - names of columns in samples to compare
pairs <- gettextf('%i-%i', samples[[x]], samples[[y]])
table(table(pairs))/nrow(samples)
}
source('scripts/common.R')
args <- getargs(argv=commandArgs(trailingOnly=TRUE), ntargets=2)
sources <- args$sources
targets <- args$... |
library(googledrive)
library(googlesheets4)
library(dplyr)
library(readr)
#----- Connect Google Drive to R Studio ----------------#
holidays <- drive_get("Holidays")
#------------------ Read a sheet from Drive -----------------#
holiday_df <- read_sheet(as_sheets_id(holidays),sheet="holidays2020") %>%
... | /R/googlesheets.R | permissive | campanell/data_science_live | R | false | false | 856 | r | library(googledrive)
library(googlesheets4)
library(dplyr)
library(readr)
#----- Connect Google Drive to R Studio ----------------#
holidays <- drive_get("Holidays")
#------------------ Read a sheet from Drive -----------------#
holiday_df <- read_sheet(as_sheets_id(holidays),sheet="holidays2020") %>%
... |
########################################################################
######################### Initialize ###################################
########################################################################
rm(AmountOfOffers)
#load packages
library(utils)
library(stringr)
library(ngram) #for preprocess(x)... | /Observations.R | no_license | NinoFoudraine/subwep | R | false | false | 2,342 | r | ########################################################################
######################### Initialize ###################################
########################################################################
rm(AmountOfOffers)
#load packages
library(utils)
library(stringr)
library(ngram) #for preprocess(x)... |
## This program predicts the number of inches of rain in
## region 9, given the number of inches of rain in surrounding
## regions using ensemble methods (stacking) from 2 base
## models: k-NN and random forests.
setwd("/Users/Bradley/Dropbox/...")
library(caret)
library(randomForest)
# read in data + clean
r_data... | /ensemble.R | no_license | jbeustice/machineLearning | R | false | false | 2,687 | r |
## This program predicts the number of inches of rain in
## region 9, given the number of inches of rain in surrounding
## regions using ensemble methods (stacking) from 2 base
## models: k-NN and random forests.
setwd("/Users/Bradley/Dropbox/...")
library(caret)
library(randomForest)
# read in data + clean
r_data... |
# ------------------------------------------
# Set working directory and load libraries
# ------------------------------------------
if (interactive()){
cur.dir <- dirname(parent.frame(2)$ofile)
setwd(cur.dir)
}
library(mpgex)
library(processHTS)
library(cowplot)
library(ggplot2)
library(earth)
library(randomForest... | /src/plot_across_cell_line.R | no_license | andreaskapou/ECCB2016 | R | false | false | 8,813 | r | # ------------------------------------------
# Set working directory and load libraries
# ------------------------------------------
if (interactive()){
cur.dir <- dirname(parent.frame(2)$ofile)
setwd(cur.dir)
}
library(mpgex)
library(processHTS)
library(cowplot)
library(ggplot2)
library(earth)
library(randomForest... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.