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 |
|---|---|---|---|---|---|---|---|---|---|
source("loaddata.R")
png(filename = "timeseriesplot2.png",
width = 480, height = 480,
units = "px", bg = "transparent")
plot(newdata2$DateTime, newdata2$Global_active_power,
type = "l",
xlab = "Day",
ylab = "Global Active Power (kilowatts)")
dev.off() | /timeseriesplot2.R | no_license | ngwells/project1 | R | false | false | 279 | r |
source("loaddata.R")
png(filename = "timeseriesplot2.png",
width = 480, height = 480,
units = "px", bg = "transparent")
plot(newdata2$DateTime, newdata2$Global_active_power,
type = "l",
xlab = "Day",
ylab = "Global Active Power (kilowatts)")
dev.off() |
# Global Options.
# General globals.
.INITYEAR <- 1965
.LASTYEAR <- 2016
.USEYEAR <- TRUE
# General global variables.
.CEXANNO <- 1.0 # Annotation character expansion.
.CEXANNO2 <- 1.2
.CEXAXIS <- 1.0 # Axis character expansion.
.CEXAXIS2 <- 1.2
.CEXLAB <- 1. # ... | /data/base_ALK_mUnsexed/sca_globals.r | no_license | samueldnj/SablefishSR2019 | R | false | false | 6,124 | r | # Global Options.
# General globals.
.INITYEAR <- 1965
.LASTYEAR <- 2016
.USEYEAR <- TRUE
# General global variables.
.CEXANNO <- 1.0 # Annotation character expansion.
.CEXANNO2 <- 1.2
.CEXAXIS <- 1.0 # Axis character expansion.
.CEXAXIS2 <- 1.2
.CEXLAB <- 1. # ... |
acontext("shiny")
## We do not need if(on wercker or travis){skip shiny test} as of 10
## Oct 2015, since we only run tests that match the TEST_SUITE env
## var, and test-shiny.R never matches.
## shiny tests require navigating to different ports, so remember
## where we are and return when tests are done
old_address... | /tests/testthat/test-shiny.R | no_license | cpsievert/animint | R | false | false | 1,647 | r | acontext("shiny")
## We do not need if(on wercker or travis){skip shiny test} as of 10
## Oct 2015, since we only run tests that match the TEST_SUITE env
## var, and test-shiny.R never matches.
## shiny tests require navigating to different ports, so remember
## where we are and return when tests are done
old_address... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plotSwarm.R
\name{plotSwarmBarBase}
\alias{plotSwarmBarBase}
\alias{plotSwarmBarBase,CIMseqSwarm,CIMseqSinglets,CIMseqMultiplets-method}
\title{plotSwarmBarBase}
\usage{
plotSwarmBarBase(swarm, singlets, multiplets, ...)
\S4method{plotSwarmB... | /man/plotSwarmBarBase.Rd | no_license | EngeLab/CIMseq | R | false | true | 801 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plotSwarm.R
\name{plotSwarmBarBase}
\alias{plotSwarmBarBase}
\alias{plotSwarmBarBase,CIMseqSwarm,CIMseqSinglets,CIMseqMultiplets-method}
\title{plotSwarmBarBase}
\usage{
plotSwarmBarBase(swarm, singlets, multiplets, ...)
\S4method{plotSwarmB... |
library(RCurl) # download https data
urlfile <- 'https://archive.ics.uci.edu/ml/machine-learning-databases/gisette/GISETTE/gisette_train.data'
x <- getURL(urlfile, ssl.verifypeer = FALSE)
gisetteRaw <- read.table(textConnection(x), sep = '', header = FALSE, stringsAsFactors = FALSE)
urlfile <- "https://archive.ics.uc... | /Lecture_05_Code.R | no_license | jodyabney/udemy_prac_data_science_reducing_high_dim_data | R | false | false | 5,965 | r |
library(RCurl) # download https data
urlfile <- 'https://archive.ics.uci.edu/ml/machine-learning-databases/gisette/GISETTE/gisette_train.data'
x <- getURL(urlfile, ssl.verifypeer = FALSE)
gisetteRaw <- read.table(textConnection(x), sep = '', header = FALSE, stringsAsFactors = FALSE)
urlfile <- "https://archive.ics.uc... |
# This is the user-interface definition of a Shiny web application.
# You can find out more about building applications with Shiny here:
#
# http://www.rstudio.com/shiny/
#
library(shiny)
load('school_data.Rda')
entity_data_clean <- entity_data[entity_data$School.Code != 0,]
district_df <- data.frame(
District... | /ui.R | no_license | dmaust/CaliforniaSchools | R | false | false | 2,058 | r |
# This is the user-interface definition of a Shiny web application.
# You can find out more about building applications with Shiny here:
#
# http://www.rstudio.com/shiny/
#
library(shiny)
load('school_data.Rda')
entity_data_clean <- entity_data[entity_data$School.Code != 0,]
district_df <- data.frame(
District... |
library(swfscMisc)
### Name: plotAssignments
### Title: Plot assignment distributions
### Aliases: plotAssignments
### ** Examples
n <- 40
probs <- abs(c(rnorm(n, 80, 10), rnorm(n, 20, 10)))
probs <- (probs - min(probs)) / max(probs)
probs <- cbind(probs, 1 - probs)
colnames(probs) <- NULL
orig <- rep(c("Group.1", ... | /data/genthat_extracted_code/swfscMisc/examples/plotAssignments.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 614 | r | library(swfscMisc)
### Name: plotAssignments
### Title: Plot assignment distributions
### Aliases: plotAssignments
### ** Examples
n <- 40
probs <- abs(c(rnorm(n, 80, 10), rnorm(n, 20, 10)))
probs <- (probs - min(probs)) / max(probs)
probs <- cbind(probs, 1 - probs)
colnames(probs) <- NULL
orig <- rep(c("Group.1", ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/writeDataTable.R
\name{writeDataTable}
\alias{writeDataTable}
\title{Write to a worksheet as an Excel table}
\usage{
writeDataTable(
wb,
sheet,
x,
startCol = 1,
startRow = 1,
xy = NULL,
colNames = TRUE,
rowNames = FALSE,
tab... | /man/writeDataTable.Rd | no_license | echukwuka/openxlsx | R | false | true | 5,828 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/writeDataTable.R
\name{writeDataTable}
\alias{writeDataTable}
\title{Write to a worksheet as an Excel table}
\usage{
writeDataTable(
wb,
sheet,
x,
startCol = 1,
startRow = 1,
xy = NULL,
colNames = TRUE,
rowNames = FALSE,
tab... |
## This first line will likely take a few seconds. Be patient!
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
total_US <- function(year){ sum(NEI[NEI$Pollutant == "PM25-PRI" & NEI$year == year, "Emissions"] ) }
year <- c(1999, 2002, 2005, 2008 )
totals <- sapply(year, tota... | /04_ExploratoryAnalysis/CourseProject2/plot1.R | no_license | gsmetana/datasciencecoursera | R | false | false | 536 | r | ## This first line will likely take a few seconds. Be patient!
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
total_US <- function(year){ sum(NEI[NEI$Pollutant == "PM25-PRI" & NEI$year == year, "Emissions"] ) }
year <- c(1999, 2002, 2005, 2008 )
totals <- sapply(year, tota... |
LoadSpecies<- function(nameSpecies,dataset,simulation, simulationIterations){
data<-read.csv(dataset,header=TRUE)
#Add a column with the name of the species
data <-cbind(data,Species=nameSpecies)
#Get number of rows of the file
nRows <-nrow(data)
#Get minimum and maximum
nMin <-min(data$Sta... | /functions.R | no_license | vanearranz/Quantitative_connecitivity | R | false | false | 8,443 | r | LoadSpecies<- function(nameSpecies,dataset,simulation, simulationIterations){
data<-read.csv(dataset,header=TRUE)
#Add a column with the name of the species
data <-cbind(data,Species=nameSpecies)
#Get number of rows of the file
nRows <-nrow(data)
#Get minimum and maximum
nMin <-min(data$Sta... |
devtools::install_github("mabafaba/mergekobodata", build_opts=c())
library(mergekobodata)
merge_kobo_data("excercise_data/household_parts",
output_file = "output/households.csv")
hh_part1 <- read.csv("excercise_data/household_parts/hh_part1.csv")
hh_part2 <- read.csv("excercise_data/household_p... | /Kobo_tools_excercise.R | no_license | boukepieter/REACH_IRQ_R_training | R | false | false | 701 | r | devtools::install_github("mabafaba/mergekobodata", build_opts=c())
library(mergekobodata)
merge_kobo_data("excercise_data/household_parts",
output_file = "output/households.csv")
hh_part1 <- read.csv("excercise_data/household_parts/hh_part1.csv")
hh_part2 <- read.csv("excercise_data/household_p... |
## Script de fonctions utiles pour Col&Mon
# inspiration des scripts d'Helene Mathian
# 18-10-2019
# 1 - lecture des diocèses géometries =====
# attention utilisateur de windows les chemins d'accés sont differents
diocese <- function(cheminDioc = "data/Diocese/",
FicDioFond ="Contour_diocèse_Fran... | /fonctions_carto.R | no_license | defuneste/coletmon | R | false | false | 4,530 | r | ## Script de fonctions utiles pour Col&Mon
# inspiration des scripts d'Helene Mathian
# 18-10-2019
# 1 - lecture des diocèses géometries =====
# attention utilisateur de windows les chemins d'accés sont differents
diocese <- function(cheminDioc = "data/Diocese/",
FicDioFond ="Contour_diocèse_Fran... |
library(RandomFields)
library(spatstat)
## Define the observation window
height.W <- 0.5
width.W <- 1
mod.W <- height.W * width.W
## Define a function for the summary statistics
Tx <- function(X){
X <- ppp(x=as.numeric(X[,1]),y=as.numeric(X[,2]),marks = as.factor(X[,3]),window = owin(x=c(0,width.W),y=c(0,... | /Pilot runs (simple model).R | no_license | joshcorneck1/SPPs_multi-scale_interactions | R | false | false | 5,985 | r | library(RandomFields)
library(spatstat)
## Define the observation window
height.W <- 0.5
width.W <- 1
mod.W <- height.W * width.W
## Define a function for the summary statistics
Tx <- function(X){
X <- ppp(x=as.numeric(X[,1]),y=as.numeric(X[,2]),marks = as.factor(X[,3]),window = owin(x=c(0,width.W),y=c(0,... |
# 19BDS0042 SAMARTH GUPTA
# Association rule for Market Basket Model
# We use Transactional Data
# Product Recommendation in Online Store
# Suggest Items to customer,Music Recommendation system,Identifies items which are close
# Market Basket Analysis in a Groceries store
# We use Sparce MAtrix ()
install.pack... | /Codes/Q6.r | no_license | samarthgupta19/CSE-3050-Data-Visualization-And-Presentation-Lab-Codes-RStudio | R | false | false | 1,176 | r | # 19BDS0042 SAMARTH GUPTA
# Association rule for Market Basket Model
# We use Transactional Data
# Product Recommendation in Online Store
# Suggest Items to customer,Music Recommendation system,Identifies items which are close
# Market Basket Analysis in a Groceries store
# We use Sparce MAtrix ()
install.pack... |
library(magick)
library(bunny)
x <- magick::image_read("input/pipe2.png")
y <- magick::image_read("input/replay.png")
x%>% magick::image_scale("200x200")
y%>% magick::image_scale("200x200")
hex_canvas <- image_canvas_hex(border_color="#0d4448", border_size = 2, fill_color = "#ede6f2")
hex_border <- image_canvas_hexb... | /input/bunny.R | permissive | yonicd/ripe | R | false | false | 1,848 | r | library(magick)
library(bunny)
x <- magick::image_read("input/pipe2.png")
y <- magick::image_read("input/replay.png")
x%>% magick::image_scale("200x200")
y%>% magick::image_scale("200x200")
hex_canvas <- image_canvas_hex(border_color="#0d4448", border_size = 2, fill_color = "#ede6f2")
hex_border <- image_canvas_hexb... |
###########################################################
##### Remove the effects of distance to oriC
##### Input 1: norm.bin file
##### Input 2: start of oriC Regions (Seperated by comma)
##### Linjie Wu 2019.6.21
###########################################################
require('mgcv')
Args = commandArgs()... | /src/OricCorrection.R | no_license | XiDsLab/CNV-BAC | R | false | false | 4,155 | r | ###########################################################
##### Remove the effects of distance to oriC
##### Input 1: norm.bin file
##### Input 2: start of oriC Regions (Seperated by comma)
##### Linjie Wu 2019.6.21
###########################################################
require('mgcv')
Args = commandArgs()... |
\name{propOB}
\alias{propOB}
\title{
Properties from OpenBabel
}
\description{
Generates the following descriptors in the given order:
'abonds', 'atoms', 'bonds', 'dbonds', 'HBA1', 'HBA2', 'HBD', 'logP', 'MR', 'MW', 'nF', 'sbonds', 'tbonds', 'TPSA'.
}
\usage{
propOB(sdfSet)
}
\arguments{
\item{sdfSet}{
An SDFse... | /man/propOB.Rd | no_license | TylerBackman/ChemmineR | R | false | false | 562 | rd | \name{propOB}
\alias{propOB}
\title{
Properties from OpenBabel
}
\description{
Generates the following descriptors in the given order:
'abonds', 'atoms', 'bonds', 'dbonds', 'HBA1', 'HBA2', 'HBD', 'logP', 'MR', 'MW', 'nF', 'sbonds', 'tbonds', 'TPSA'.
}
\usage{
propOB(sdfSet)
}
\arguments{
\item{sdfSet}{
An SDFse... |
library(optparse)
library(brms)
library(tidyverse)
library(broom.mixed)
library(tidybayes)
option_list = list(
make_option(c("-l", "--lower"), type="integer", default=50,
help="lower bound for number of participants [default= %default]", metavar="integer"),
make_option(c("-u", "--upper"), type="inte... | /elephants-coord-power-analysis.R | no_license | karengu/elephants-coord-power-analysis | R | false | false | 7,740 | r | library(optparse)
library(brms)
library(tidyverse)
library(broom.mixed)
library(tidybayes)
option_list = list(
make_option(c("-l", "--lower"), type="integer", default=50,
help="lower bound for number of participants [default= %default]", metavar="integer"),
make_option(c("-u", "--upper"), type="inte... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generated_client.R
\name{reports_patch}
\alias{reports_patch}
\title{Update a report}
\usage{
reports_patch(id, name = NULL, script_id = NULL, code_body = NULL,
config = NULL, app_state = NULL, provide_api_key = NULL,
template_id = NULL)
... | /man/reports_patch.Rd | permissive | wlattner/civis-r | R | false | true | 3,586 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generated_client.R
\name{reports_patch}
\alias{reports_patch}
\title{Update a report}
\usage{
reports_patch(id, name = NULL, script_id = NULL, code_body = NULL,
config = NULL, app_state = NULL, provide_api_key = NULL,
template_id = NULL)
... |
## Cluster most rated films using archetypes.
# TSAW
rm(list=ls())
library(archetypes)
load(paste(getwd(),'/r_data/ratings_summary.RData',sep=""))
n_films <- 500
sub_dat <- ratings_summary[1:n_films,] # assumes that ratings_summary is ordered by N.
#-------------------
# perform archetype analysis on top n rated f... | /R_code/film_archetypes.R | no_license | timveitch/GoodfilmsModelling | R | false | false | 787 | r | ## Cluster most rated films using archetypes.
# TSAW
rm(list=ls())
library(archetypes)
load(paste(getwd(),'/r_data/ratings_summary.RData',sep=""))
n_films <- 500
sub_dat <- ratings_summary[1:n_films,] # assumes that ratings_summary is ordered by N.
#-------------------
# perform archetype analysis on top n rated f... |
library(rpart)
iris_data <- datasets::iris
fit <- rpart(Species~.,data=iris_data)
plot(fit,uniform=TRUE,main="tree")
text(fit,use.n=TRUE,all=TRUE,cex=.8)
| /J48.r | no_license | adityakuppa26/Data-Mining | R | false | false | 161 | r | library(rpart)
iris_data <- datasets::iris
fit <- rpart(Species~.,data=iris_data)
plot(fit,uniform=TRUE,main="tree")
text(fit,use.n=TRUE,all=TRUE,cex=.8)
|
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' @export
is_compact <- function(x) {
.Call(`_compact_is_compact`, x)
}
#' @export
compact_info <- function(x) {
.Call(`_compact_compact_info`, x)
}
#' @export
compact_is_expanded <-... | /R/RcppExports.R | permissive | romainfrancois/compact | R | false | false | 645 | r | # Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' @export
is_compact <- function(x) {
.Call(`_compact_is_compact`, x)
}
#' @export
compact_info <- function(x) {
.Call(`_compact_compact_info`, x)
}
#' @export
compact_is_expanded <-... |
\alias{gdkPixbufNewFromData}
\name{gdkPixbufNewFromData}
\title{gdkPixbufNewFromData}
\description{Creates a new \code{\link{GdkPixbuf}} out of in-memory image data. Currently only RGB
images with 8 bits per sample are supported.}
\usage{gdkPixbufNewFromData(data, colorspace, has.alpha, bits.per.sample,
width, he... | /RGtk2/man/gdkPixbufNewFromData.Rd | no_license | lawremi/RGtk2 | R | false | false | 965 | rd | \alias{gdkPixbufNewFromData}
\name{gdkPixbufNewFromData}
\title{gdkPixbufNewFromData}
\description{Creates a new \code{\link{GdkPixbuf}} out of in-memory image data. Currently only RGB
images with 8 bits per sample are supported.}
\usage{gdkPixbufNewFromData(data, colorspace, has.alpha, bits.per.sample,
width, he... |
library(tidyverse)
# Part 1
code_input <- readLines("data/aoc_5_data.txt")
polymer_group_df <- data.frame(small=letters,large=LETTERS) %>% mutate(combine_var_1 = paste0(letters,LETTERS),
combine_var_2 = paste0(LETTERS,letters))
pattern_vec <- c(p... | /aoc_5.R | permissive | apoorv74/aoc2018 | R | false | false | 1,979 | r | library(tidyverse)
# Part 1
code_input <- readLines("data/aoc_5_data.txt")
polymer_group_df <- data.frame(small=letters,large=LETTERS) %>% mutate(combine_var_1 = paste0(letters,LETTERS),
combine_var_2 = paste0(LETTERS,letters))
pattern_vec <- c(p... |
## plot4 is a function with an argument as the file or the file path
## argument x is the unzipped file household_power_consumption.txt
plot4 <- function(x)
{
## setting the working directory for execution on local computer - could be removed from the code
setwd("~/R/EXPLORATORY DATA PROJ DATA SET")
... | /plot4.R | no_license | melDalagan/ExData_Plotting1 | R | false | false | 1,678 | r | ## plot4 is a function with an argument as the file or the file path
## argument x is the unzipped file household_power_consumption.txt
plot4 <- function(x)
{
## setting the working directory for execution on local computer - could be removed from the code
setwd("~/R/EXPLORATORY DATA PROJ DATA SET")
... |
rm( list = ls( ) )
library( hlpr4life )
load.pkgs( c( "ggplot2", "ggthemes" ) )
my.df.sex <-
data.frame(
pitch = c(
233, 204, 242, 230, 210,
130, 112, 142, 100, 80,
80, 72, 112, 80, 60,
101, 202, 303, 150, 250 ),
sex = c(
rep( "female", 5 ),
rep( "male", 5 ),
rep( "animal", 5 ),
r... | /Practise/lm.y.1factor.R | no_license | TPeschel/life-for-postgraduates | R | false | false | 5,262 | r | rm( list = ls( ) )
library( hlpr4life )
load.pkgs( c( "ggplot2", "ggthemes" ) )
my.df.sex <-
data.frame(
pitch = c(
233, 204, 242, 230, 210,
130, 112, 142, 100, 80,
80, 72, 112, 80, 60,
101, 202, 303, 150, 250 ),
sex = c(
rep( "female", 5 ),
rep( "male", 5 ),
rep( "animal", 5 ),
r... |
rm(list=ls())
library(oce)
files <- dir('/data/archive/barrow/2022/bsrto/icl', full.names=TRUE)
if (!interactive()) {
if (!('icl' %in% dir())) system('mkdir icl')
}
## read the icl/ dir to see how many images are there
run <- FALSE
nimage <- length(dir('icl'))
if (nimage == 0) {
spec <- NULL
time <- NULL... | /icl.R | no_license | richardsc/bsrto | R | false | false | 3,453 | r | rm(list=ls())
library(oce)
files <- dir('/data/archive/barrow/2022/bsrto/icl', full.names=TRUE)
if (!interactive()) {
if (!('icl' %in% dir())) system('mkdir icl')
}
## read the icl/ dir to see how many images are there
run <- FALSE
nimage <- length(dir('icl'))
if (nimage == 0) {
spec <- NULL
time <- NULL... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/day-decimal.R
\name{dtt_day_decimal}
\alias{dtt_day_decimal}
\alias{dtt_day_decimal.Date}
\alias{dtt_day_decimal.POSIXct}
\title{Get Decimal Day Values}
\usage{
dtt_day_decimal(x, ...)
\method{dtt_day_decimal}{Date}(x, ...)
\method{dtt_day_... | /man/dtt_day_decimal.Rd | permissive | minghao2016/dttr2 | R | false | true | 1,036 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/day-decimal.R
\name{dtt_day_decimal}
\alias{dtt_day_decimal}
\alias{dtt_day_decimal.Date}
\alias{dtt_day_decimal.POSIXct}
\title{Get Decimal Day Values}
\usage{
dtt_day_decimal(x, ...)
\method{dtt_day_decimal}{Date}(x, ...)
\method{dtt_day_... |
\name{dat.normand1999}
\docType{data}
\alias{dat.normand1999}
\title{Studies on the Length of Hospital Stay of Stroke Patients}
\description{Results from 9 studies on the length of the hospital stay of stroke patients under specialized care and under conventional/routine (non-specialist) care.}
\usage{dat.normand1... | /metafor/man/dat.normand1999.Rd | no_license | skoval/meta-analysis | R | false | false | 2,409 | rd | \name{dat.normand1999}
\docType{data}
\alias{dat.normand1999}
\title{Studies on the Length of Hospital Stay of Stroke Patients}
\description{Results from 9 studies on the length of the hospital stay of stroke patients under specialized care and under conventional/routine (non-specialist) care.}
\usage{dat.normand1... |
#===============================================================================
# UTILITY FUNCTIONS FOR INTERNAL USE ONLY (DO NOT EXPORT)
#-------------------------------------------------------------------------------
# asciiToChar()
# as.char()
# is.char()
# sym()
# numberReplicates()
# titleCaps()
#================... | /R/internal.R | no_license | mwrowe/fretr | R | false | false | 6,864 | r | #===============================================================================
# UTILITY FUNCTIONS FOR INTERNAL USE ONLY (DO NOT EXPORT)
#-------------------------------------------------------------------------------
# asciiToChar()
# as.char()
# is.char()
# sym()
# numberReplicates()
# titleCaps()
#================... |
# ---- Load reqd packages
library(testthat)
library(data.table)
library(xgboost)
# ---- Clear environment
rm(list = ls())
# ------------------ #
# ---- OVERHEAD ---- #
# ------------------ #
irisDT <- as.data.table(iris)
binaryClassDT <- copy(irisDT)
binaryClassDT[, Species := ifelse(as.character(Species) == 'setos... | /fbboost/tests/testthat/test_trees.R | no_license | ffineis/stat_350_final | R | false | false | 2,409 | r | # ---- Load reqd packages
library(testthat)
library(data.table)
library(xgboost)
# ---- Clear environment
rm(list = ls())
# ------------------ #
# ---- OVERHEAD ---- #
# ------------------ #
irisDT <- as.data.table(iris)
binaryClassDT <- copy(irisDT)
binaryClassDT[, Species := ifelse(as.character(Species) == 'setos... |
\name{SLID}
\alias{SLID}
\docType{data}
\title{Survey of Labour and Income Dynamics}
\description{
The \code{SLID} data frame has 7425 rows and 5 columns.
The data are from the 1994 wave of the Canadian Survey of Labour and Income Dynamics,
for the province of Ontario.
There are missing data, particularly for wages.
}
... | /man/SLID.Rd | no_license | cran/carData | R | false | false | 1,109 | rd | \name{SLID}
\alias{SLID}
\docType{data}
\title{Survey of Labour and Income Dynamics}
\description{
The \code{SLID} data frame has 7425 rows and 5 columns.
The data are from the 1994 wave of the Canadian Survey of Labour and Income Dynamics,
for the province of Ontario.
There are missing data, particularly for wages.
}
... |
\name{LDwindow2MB_cutoff0.2}
\alias{LDwindow2MB_cutoff0.2}
\docType{data}
\title{LD Information for Hapmap 3 SNPs with LD-Square Threshold 0.2, window size 2MB}
\description{The LD information is based on 1000 Genome data, i.e., analysis of 489 individuals of European origin from the 1000 GENOME project Phase 3. All th... | /man/LDwindow2MB_cutoff0.2.Rd | no_license | GeneticResources/GENESIS_PRS | R | false | false | 993 | rd | \name{LDwindow2MB_cutoff0.2}
\alias{LDwindow2MB_cutoff0.2}
\docType{data}
\title{LD Information for Hapmap 3 SNPs with LD-Square Threshold 0.2, window size 2MB}
\description{The LD information is based on 1000 Genome data, i.e., analysis of 489 individuals of European origin from the 1000 GENOME project Phase 3. All th... |
###################################################### tableau de donnees #######################################
# nbPauses
# peut être effet de var ipu et var deb, pas d'effet de la moyenne
# pas d'effet SDTD ou meanIPU ?
# durée des pauses -> histogramme par condition
setwd("~/Documents/Alex/Stat/")
source("summaryS... | /Stat/SpeechRate_audio.r | no_license | steinhia/M2R | R | false | false | 6,149 | r | ###################################################### tableau de donnees #######################################
# nbPauses
# peut être effet de var ipu et var deb, pas d'effet de la moyenne
# pas d'effet SDTD ou meanIPU ?
# durée des pauses -> histogramme par condition
setwd("~/Documents/Alex/Stat/")
source("summaryS... |
####################################
# fn should follow shao process
# take imputed dataset
# create sample from that
# re-impute
# find ICC values
test <- function(its, orig){
# list of cov's: hardcoded for now
cov.list = "+ ed + marital + working + work.type +
age + age2 + race + eth + children + i... | /bootstrap and imputing function.R | no_license | jackiemauro/iccGit | R | false | false | 3,491 | r | ####################################
# fn should follow shao process
# take imputed dataset
# create sample from that
# re-impute
# find ICC values
test <- function(its, orig){
# list of cov's: hardcoded for now
cov.list = "+ ed + marital + working + work.type +
age + age2 + race + eth + children + i... |
library(conjoint)
### Name: caSegmentation
### Title: Function caSegmentation divides respondents on clusters
### Aliases: caSegmentation
### Keywords: multivariate
### ** Examples
#Example 1
library(conjoint)
require(fpc)
data(tea)
segments<-caSegmentation(tprefm,tprof)
print(segments$seg)
plotcluster(segments$uti... | /data/genthat_extracted_code/conjoint/examples/caSegmentation.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 1,358 | r | library(conjoint)
### Name: caSegmentation
### Title: Function caSegmentation divides respondents on clusters
### Aliases: caSegmentation
### Keywords: multivariate
### ** Examples
#Example 1
library(conjoint)
require(fpc)
data(tea)
segments<-caSegmentation(tprefm,tprof)
print(segments$seg)
plotcluster(segments$uti... |
library(jointPm)
### Name: binteg
### Title: bivariate integration
### Aliases: binteg
### ** Examples
library(jointPm)
data(flood)
px=flood$px;py=flood$py;z=flood$flood_table;prm=flood$prm;pout=flood$pout
binteg(px,py,z,prm,pout,model="log",prob="ARI",nz=100,ninc=1000)
| /data/genthat_extracted_code/jointPm/examples/binteg.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 282 | r | library(jointPm)
### Name: binteg
### Title: bivariate integration
### Aliases: binteg
### ** Examples
library(jointPm)
data(flood)
px=flood$px;py=flood$py;z=flood$flood_table;prm=flood$prm;pout=flood$pout
binteg(px,py,z,prm,pout,model="log",prob="ARI",nz=100,ninc=1000)
|
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Height of the Heatmap — height.Heatmap • ComplexHeatmap</title>
<!--... | /docs/reference/height.Heatmap.rd | permissive | jokergoo/ComplexHeatmap | R | false | false | 6,455 | rd | <!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Height of the Heatmap — height.Heatmap • ComplexHeatmap</title>
<!--... |
files <- list.files("E:/purges_12_16_20/ky/KY-2012-1",
full.names = T, pattern = "CONG.*")
ky_12 <- rbindlist(lapply(files, function(file){
j <- read_fwf(file, fwf_widths(c(3, 4, 1, 25, 15, 10, 1, 1, 3,
40, 20, 2, 9, 40, 20, 2, 9,
... | /code/process_raw/ky.R | no_license | ktmorris/national_purges | R | false | false | 2,839 | r |
files <- list.files("E:/purges_12_16_20/ky/KY-2012-1",
full.names = T, pattern = "CONG.*")
ky_12 <- rbindlist(lapply(files, function(file){
j <- read_fwf(file, fwf_widths(c(3, 4, 1, 25, 15, 10, 1, 1, 3,
40, 20, 2, 9, 40, 20, 2, 9,
... |
library(dplyr)
data<-read.csv("household_power_consumption.txt", sep = ";") #load the data
data<-mutate(data, "Index" = 1:2075259)
data1<-data[(data$Index>=(47*24*60-1043) & data$Index<=(47*24*60-1043+2*1440-1)),] #keep the good data
#head(data1)
#tail(data1)
par(mfrow = c(1,1))
with(data1,plot(as.numeric(as.charac... | /plot2.R | no_license | PierreAttard/Exploratory-Data-Analysis | R | false | false | 607 | r | library(dplyr)
data<-read.csv("household_power_consumption.txt", sep = ";") #load the data
data<-mutate(data, "Index" = 1:2075259)
data1<-data[(data$Index>=(47*24*60-1043) & data$Index<=(47*24*60-1043+2*1440-1)),] #keep the good data
#head(data1)
#tail(data1)
par(mfrow = c(1,1))
with(data1,plot(as.numeric(as.charac... |
x<-read.csv("ex4x.dat",sep="",header=F)
y<-read.csv("ex4y.dat",sep="",header=F)
x<-cbind(rep(1,nrow(x)),x)
x<-as.matrix(x)
y<-as.matrix(y)
logit<-function(z){
+ return(1/(1+exp(-z)))}
# hypothesis
hypo<-function (x,th) {
return( logit(x %*% th) )
} # h(x,th)
#cost J
J<-function(x,y,th,m){
return((1/m) * sum(-... | /logistic.r | no_license | Disha-Patil/Machine-learning | R | false | false | 861 | r |
x<-read.csv("ex4x.dat",sep="",header=F)
y<-read.csv("ex4y.dat",sep="",header=F)
x<-cbind(rep(1,nrow(x)),x)
x<-as.matrix(x)
y<-as.matrix(y)
logit<-function(z){
+ return(1/(1+exp(-z)))}
# hypothesis
hypo<-function (x,th) {
return( logit(x %*% th) )
} # h(x,th)
#cost J
J<-function(x,y,th,m){
return((1/m) * sum(-... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ortho_diff.R
\name{ortho_diff}
\alias{ortho_diff}
\alias{multi_overlay_diff}
\title{Plot differences for Prediction and Gold Standard}
\usage{
ortho_diff(
img,
pred,
roi,
xyz = NULL,
cols = c("#56B4E9", "#D55E00", "#009E73"),
leve... | /man/ortho_diff.Rd | no_license | muschellij2/neurobase | R | false | true | 2,656 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ortho_diff.R
\name{ortho_diff}
\alias{ortho_diff}
\alias{multi_overlay_diff}
\title{Plot differences for Prediction and Gold Standard}
\usage{
ortho_diff(
img,
pred,
roi,
xyz = NULL,
cols = c("#56B4E9", "#D55E00", "#009E73"),
leve... |
fitRF <- train(SalePrice ~ YrSold + MoSold + LotArea + BedroomAbvGr +
LotFrontage + Neighborhood,
data=training, method='rf')
fitRF_B <- train(SalePrice ~ ., data=trainB1, method='rf')
fitRF_all <- train(SalePrice ~ ., data=train_all, method='rf')
# Predict on ... | /RF.R | no_license | dmitrytoda/houseprice | R | false | false | 773 | r | fitRF <- train(SalePrice ~ YrSold + MoSold + LotArea + BedroomAbvGr +
LotFrontage + Neighborhood,
data=training, method='rf')
fitRF_B <- train(SalePrice ~ ., data=trainB1, method='rf')
fitRF_all <- train(SalePrice ~ ., data=train_all, method='rf')
# Predict on ... |
shinyServer(function(input, output) {
output$plot1 <- renderPlot({
lambda <- as.numeric(input$lambda)
lambda <- max(lambda,0.0001)
numPts <- as.numeric(input$numPts)
uicoef <- as.numeric(input$tCoef)
evalues <- rexp(numPts,rate=lambda)
vLineVal <- min(c(boxplot.stats(evalues,coef=... | /exponential/server.R | no_license | Algieba/dataprod | R | false | false | 591 | r | shinyServer(function(input, output) {
output$plot1 <- renderPlot({
lambda <- as.numeric(input$lambda)
lambda <- max(lambda,0.0001)
numPts <- as.numeric(input$numPts)
uicoef <- as.numeric(input$tCoef)
evalues <- rexp(numPts,rate=lambda)
vLineVal <- min(c(boxplot.stats(evalues,coef=... |
##Time Series Analysis of Hummingbird Presences
require(stringr)
require(maptools)
require(ggplot2)
require(scales)
library(dplyr)
library(chron)
# ############Bring in temperature
tdata<-read.csv("C:/Users/Ben/Dropbox/Thesis//Maquipucuna_SantaLucia/Results/Ibuttons/TempData.csv")
#
#
#
# #########Doesn't quite wo... | /TimeSeries.R | no_license | bw4sz/Maquipicuna | R | false | false | 1,011 | r | ##Time Series Analysis of Hummingbird Presences
require(stringr)
require(maptools)
require(ggplot2)
require(scales)
library(dplyr)
library(chron)
# ############Bring in temperature
tdata<-read.csv("C:/Users/Ben/Dropbox/Thesis//Maquipucuna_SantaLucia/Results/Ibuttons/TempData.csv")
#
#
#
# #########Doesn't quite wo... |
##user settings
##input
tres= as.difftime(15,units="mins") ##temporal resolution of input files (Q, P) and desired output [min]
precip_data_file = "0_data\\TESP_15minres_2010_2011.txt" #input file containing (mutiple) rainfall series
fmt_precip = "d.%m.%Y %H:%M" #input format of date column, eg "%Y-%m-%d %H:%... | /settings.R | no_license | TillF/ssc_prediction | R | false | false | 2,401 | r | ##user settings
##input
tres= as.difftime(15,units="mins") ##temporal resolution of input files (Q, P) and desired output [min]
precip_data_file = "0_data\\TESP_15minres_2010_2011.txt" #input file containing (mutiple) rainfall series
fmt_precip = "d.%m.%Y %H:%M" #input format of date column, eg "%Y-%m-%d %H:%... |
#Exercise 1
rm(list=ls())
setwd("C:\\RPI\\ITWS6600 Data Analytics")
EPI_data<- read.csv("2010EPI_data.csv", skip=1)
attach(EPI_data)
plot(ecdf(EPI),do.points=FALSE,verticals=TRUE)
help("qqnorm")
par(pty="s")
qqnorm(EPI);qqline(EPI)
x<-seq(30,95,1)
qqplot(qt(ppoints(250),df=5),x,xlab="Q-Qplot for t dsn")
qq... | /Lab1_part2.R | no_license | JiajieYu9701/DataAnalyticsSpring2020 | R | false | false | 2,782 | r | #Exercise 1
rm(list=ls())
setwd("C:\\RPI\\ITWS6600 Data Analytics")
EPI_data<- read.csv("2010EPI_data.csv", skip=1)
attach(EPI_data)
plot(ecdf(EPI),do.points=FALSE,verticals=TRUE)
help("qqnorm")
par(pty="s")
qqnorm(EPI);qqline(EPI)
x<-seq(30,95,1)
qqplot(qt(ppoints(250),df=5),x,xlab="Q-Qplot for t dsn")
qq... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fitted.R
\name{fitted.PlackettLuce}
\alias{fitted.PlackettLuce}
\alias{fitted.pltree}
\title{Fitted Probabilities for PlackettLuce Objects}
\usage{
\method{fitted}{PlackettLuce}(object, aggregate = TRUE, free = TRUE, ...)
\method{fitted}{plt... | /man/fitted.PlackettLuce.Rd | no_license | Felix660/PlackettLuce | R | false | true | 1,742 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fitted.R
\name{fitted.PlackettLuce}
\alias{fitted.PlackettLuce}
\alias{fitted.pltree}
\title{Fitted Probabilities for PlackettLuce Objects}
\usage{
\method{fitted}{PlackettLuce}(object, aggregate = TRUE, free = TRUE, ...)
\method{fitted}{plt... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fct02_portBuildingFuncs.R
\name{PortfolioBacktest}
\alias{PortfolioBacktest}
\alias{getPort}
\alias{addwgt2port}
\alias{port_limitwgt}
\alias{getPort_throughout}
\alias{port.backtest}
\title{portfolio building and backtesting}
\usage{
getPort... | /man/PortfolioBacktest.Rd | no_license | raphael210/RFactorModel | R | false | true | 6,245 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fct02_portBuildingFuncs.R
\name{PortfolioBacktest}
\alias{PortfolioBacktest}
\alias{getPort}
\alias{addwgt2port}
\alias{port_limitwgt}
\alias{getPort_throughout}
\alias{port.backtest}
\title{portfolio building and backtesting}
\usage{
getPort... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/graphFunctions.R
\name{functionalType}
\alias{functionalType}
\title{Get functional type of a spatio-temporal dataset}
\usage{
functionalType(obj, attr = "ALL")
}
\arguments{
\item{obj}{The object from which the functional type shall be retri... | /man/functionalType.Rd | no_license | MatthiasHinz/SpatialSemantics | R | false | true | 554 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/graphFunctions.R
\name{functionalType}
\alias{functionalType}
\title{Get functional type of a spatio-temporal dataset}
\usage{
functionalType(obj, attr = "ALL")
}
\arguments{
\item{obj}{The object from which the functional type shall be retri... |
#################################### #################################### #################################
#################################### #################################### #################################
#################################### #################################### ############################... | /Code/3_Figures/figure5_rate100k_IHM_icu_mv_region_lrm.R | no_license | oranzani/Ranzani_Bastos_etal_LRM_COVID19Brazil | R | false | false | 42,368 | r | #################################### #################################### #################################
#################################### #################################### #################################
#################################### #################################### ############################... |
## Pair of functions that caches a inverse of matrix
##
## makeCacheMatrix will take a matrix as input and create an object
## that can cache its inverse.
##
makeCacheMatrix <- function(x = matrix()) {
i <- NULL
set <- function(y) {
x <<- y
i <<- NULL
}
get <- function() x
setinv <- function(i... | /cachematrix.R | no_license | rpunit/ProgrammingAssignment2 | R | false | false | 1,217 | r | ## Pair of functions that caches a inverse of matrix
##
## makeCacheMatrix will take a matrix as input and create an object
## that can cache its inverse.
##
makeCacheMatrix <- function(x = matrix()) {
i <- NULL
set <- function(y) {
x <<- y
i <<- NULL
}
get <- function() x
setinv <- function(i... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/aiplatform_objects.R
\name{GoogleCloudAiplatformV1Event.labels}
\alias{GoogleCloudAiplatformV1Event.labels}
\title{GoogleCloudAiplatformV1Event.labels Object}
\usage{
GoogleCloudAiplatformV1Event.labels()
}
\value{
GoogleCloudAiplatformV1Even... | /googleaiplatformv1.auto/man/GoogleCloudAiplatformV1Event.labels.Rd | no_license | justinjm/autoGoogleAPI | R | false | true | 1,141 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/aiplatform_objects.R
\name{GoogleCloudAiplatformV1Event.labels}
\alias{GoogleCloudAiplatformV1Event.labels}
\title{GoogleCloudAiplatformV1Event.labels Object}
\usage{
GoogleCloudAiplatformV1Event.labels()
}
\value{
GoogleCloudAiplatformV1Even... |
library(h2o)
h2o.init()
# Explore a typical Data Science workflow with H2O and R
#
# Goal: assist the manager of data of NYC to load-balance the bicycles
# across the data network of stations, by predicting the number of bike
# trips taken from the station every day. Use 10 million rows of historical
# data, and even... | /h2o-r/demos/rdemo.citi.bike.large.R | permissive | LeyiChi/h2o-3 | R | false | false | 8,883 | r | library(h2o)
h2o.init()
# Explore a typical Data Science workflow with H2O and R
#
# Goal: assist the manager of data of NYC to load-balance the bicycles
# across the data network of stations, by predicting the number of bike
# trips taken from the station every day. Use 10 million rows of historical
# data, and even... |
##Script to import plot and save output of Theta_Measure.tcl
##V1 10/07/16
##Set directory to contain text outputs with suffix Theta_Measure.txt
##Operation
##For each Theta_Measure.txt
## 1) imports data
## 2) Determines the start time and date of recording
## 3) Runs modified Hampel Filter to exclude outliers which... | /NeuroarchiverAnalysisR/R/FilesNotToSOurce/ThetaDelta160710.R | no_license | IrisOren/NeuroarchiverAnalysis | R | false | false | 6,277 | r | ##Script to import plot and save output of Theta_Measure.tcl
##V1 10/07/16
##Set directory to contain text outputs with suffix Theta_Measure.txt
##Operation
##For each Theta_Measure.txt
## 1) imports data
## 2) Determines the start time and date of recording
## 3) Runs modified Hampel Filter to exclude outliers which... |
plot1 <- function() {
# Read the header and data separately
header <- read.csv("household_power_consumption.txt", header=FALSE, sep=";", nrows=1)
plotData <- read.csv("household_power_consumption.txt", header=FALSE, sep=";", nrows=2880, skip=66637)
# Use header names as column names
colnames( ... | /plot1.R | no_license | greggvandusen/ExData_Plotting1 | R | false | false | 708 | r | plot1 <- function() {
# Read the header and data separately
header <- read.csv("household_power_consumption.txt", header=FALSE, sep=";", nrows=1)
plotData <- read.csv("household_power_consumption.txt", header=FALSE, sep=";", nrows=2880, skip=66637)
# Use header names as column names
colnames( ... |
`RM` <-
function(X, W, se = TRUE, sum0 = TRUE, etaStart)
{
#...X: 0/1 person*item matrix
#-------------------main programm-------------------
call<-match.call()
groupvec <- 1
mpoints <- 1
model <- "RM"
if (missing(W)) W <- NA
else W <- as.matrix(W)
if (missing(etaStart)) etaStart <- NA
else etaStart... | /R/RM.R | no_license | cran/eRm | R | false | false | 1,882 | r | `RM` <-
function(X, W, se = TRUE, sum0 = TRUE, etaStart)
{
#...X: 0/1 person*item matrix
#-------------------main programm-------------------
call<-match.call()
groupvec <- 1
mpoints <- 1
model <- "RM"
if (missing(W)) W <- NA
else W <- as.matrix(W)
if (missing(etaStart)) etaStart <- NA
else etaStart... |
################################################################################
# Exponential Family PCA for Bernoulli Data
################################################################################
# optim-funs -------------------------------------------------------------------
#' @title Logistic Function
#' ... | /R/bernoulli.R | no_license | krisrs1128/expPCA | R | false | false | 4,298 | r |
################################################################################
# Exponential Family PCA for Bernoulli Data
################################################################################
# optim-funs -------------------------------------------------------------------
#' @title Logistic Function
#' ... |
freq2$Receipt_Date <- as.Date(freq2$Receipt_Date, format="%m/%d/%Y")
freq2 <- freq2[order(freq2$Receipt_Date),]
freq2$interval <- with(freq2, ave(as.numeric(Receipt_Date),
Name.ID, FUN=function(x) c(0, diff(x))))
| /r-functions/Find interval base on same ID.R | no_license | xqiu625/cookbook-for-R | R | false | false | 248 | r | freq2$Receipt_Date <- as.Date(freq2$Receipt_Date, format="%m/%d/%Y")
freq2 <- freq2[order(freq2$Receipt_Date),]
freq2$interval <- with(freq2, ave(as.numeric(Receipt_Date),
Name.ID, FUN=function(x) c(0, diff(x))))
|
#' # Obtaining tokens in text documents using *quanteda*
#' The following makes use of the *quanteda* package. You may need to install it from
#' [CRAN](https://cran.r-project.org/package=quanteda) using the code
#' `install.packages("quanteda")` if you want to run this on your computer. (The
#' package is already ins... | /09-text-as-data/quanteda-tokens.R | no_license | melff/dataman-r | R | false | false | 1,519 | r | #' # Obtaining tokens in text documents using *quanteda*
#' The following makes use of the *quanteda* package. You may need to install it from
#' [CRAN](https://cran.r-project.org/package=quanteda) using the code
#' `install.packages("quanteda")` if you want to run this on your computer. (The
#' package is already ins... |
# Data preProcess
setwd("C:\\Users\\Ivan.Liuyanfeng\\Desktop\\Data_Mining_Work_Space\\forest-type-cover-prediction")
train = read.csv("train.csv")
train$Wilderness_Area1=as.factor(train$Wilderness_Area1)
train$Wilderness_Area2=as.factor(train$Wilderness_Area2)
train$Wilderness_Area3=as.factor(train$Wilderness_Area3)
tr... | /ensembing model.R | no_license | ivanliu1989/forest-type-cover-prediction | R | false | false | 6,645 | r | # Data preProcess
setwd("C:\\Users\\Ivan.Liuyanfeng\\Desktop\\Data_Mining_Work_Space\\forest-type-cover-prediction")
train = read.csv("train.csv")
train$Wilderness_Area1=as.factor(train$Wilderness_Area1)
train$Wilderness_Area2=as.factor(train$Wilderness_Area2)
train$Wilderness_Area3=as.factor(train$Wilderness_Area3)
tr... |
#' Disattenuate a Cohen's d estimate for unreliability in the continuous variable
#'
#' Measurement error (i.e. the complement of reliability) results in a downward bias
#' of observed effect sizes. This attenuation can be reversed by disattenuation.
#'
#' @param d The (attenuated) value of Cohen's d (i.e. the val... | /R/disattenuate.d.R | no_license | cran/ufs | R | false | false | 996 | r | #' Disattenuate a Cohen's d estimate for unreliability in the continuous variable
#'
#' Measurement error (i.e. the complement of reliability) results in a downward bias
#' of observed effect sizes. This attenuation can be reversed by disattenuation.
#'
#' @param d The (attenuated) value of Cohen's d (i.e. the val... |
# 00-MASTER-RUN-ANALYSIS.R
# This script is designed to run the entire workflow for estimating
# parameters for the stochastic COVID-19 SEIR model and for producing
# estimates of observed states and forecasts of states. Many of the scripts
# rely on parallel processing, the settings for which are defined in this
# mas... | /code/01-MASTER-CLUSTER-RUN.R | no_license | Proloy2018/COVID-stochastic-fitting | R | false | false | 3,527 | r | # 00-MASTER-RUN-ANALYSIS.R
# This script is designed to run the entire workflow for estimating
# parameters for the stochastic COVID-19 SEIR model and for producing
# estimates of observed states and forecasts of states. Many of the scripts
# rely on parallel processing, the settings for which are defined in this
# mas... |
\name{classscatter}
\alias{classscatter}
\title{Classification scatterplot matrix}
\description{
Function to plot a scatterplot matrix with a classification result.
}
\usage{
classscatter(formula, data, method, col.correct = "black",
col.wrong = "red", gs = NULL, ...)
}
\arguments{
\item{formula}... | /man/classscatter.Rd | no_license | cran/klaR | R | false | false | 1,422 | rd | \name{classscatter}
\alias{classscatter}
\title{Classification scatterplot matrix}
\description{
Function to plot a scatterplot matrix with a classification result.
}
\usage{
classscatter(formula, data, method, col.correct = "black",
col.wrong = "red", gs = NULL, ...)
}
\arguments{
\item{formula}... |
## Getting full dataset
data_full <- read.csv("./data/household_power_consumption.txt", header = T, sep = ';',
na.strings = "?", nrows = 2075259, check.names = F,
stringsAsFactors = F, comment.char = "", quote = '\"')
data_full$Date <- as.Date(data_full$Date, format = "%d/%... | /plot3.R | no_license | stjjhi/project_1 | R | false | false | 940 | r | ## Getting full dataset
data_full <- read.csv("./data/household_power_consumption.txt", header = T, sep = ';',
na.strings = "?", nrows = 2075259, check.names = F,
stringsAsFactors = F, comment.char = "", quote = '\"')
data_full$Date <- as.Date(data_full$Date, format = "%d/%... |
context("Test fit functions")
test_that("fit", {
skip_on_cran()
set.seed(1)
dat <- c(sample(1:50, 200, replace = TRUE, prob = 1 + exp(1:50 * 0.1)),
sample(51:100, 200, replace = TRUE, prob = 1 + exp(1:50 * 0.11)))
sex <- sample(c("female", "male"), 400, replace = TRUE)
i <- incidence(dat, 5L)
... | /tests/testthat/test-fit.R | no_license | jrcpulliam/incidence | R | false | false | 3,520 | r | context("Test fit functions")
test_that("fit", {
skip_on_cran()
set.seed(1)
dat <- c(sample(1:50, 200, replace = TRUE, prob = 1 + exp(1:50 * 0.1)),
sample(51:100, 200, replace = TRUE, prob = 1 + exp(1:50 * 0.11)))
sex <- sample(c("female", "male"), 400, replace = TRUE)
i <- incidence(dat, 5L)
... |
#!/usr/bin/env Rscript
################################################################################
###Script was created by S. Sefick in 2016 to plot vcf stats in order to determine hard filtering values.
###worked with R/3.4.3
require(argparse)
parser <- ArgumentParser()
... | /Scripts_old/plotvcftable.R | no_license | srk0002/AU_BIOL-7180_SPR20_GroupProject | R | false | false | 5,494 | r | #!/usr/bin/env Rscript
################################################################################
###Script was created by S. Sefick in 2016 to plot vcf stats in order to determine hard filtering values.
###worked with R/3.4.3
require(argparse)
parser <- ArgumentParser()
... |
#' Predator Prey Lotka Voltera Interaction
#'
#' Computes the change in both predator and prey abundance over time from species abundance and rates of ecological function
#' @param data starting parameters include initial predator and prey abundance (# indivduals), predator and prey carrying capacity (# indivduals), pr... | /final_code_md.R | no_license | sjcruz/ESM232_Project | R | false | false | 3,760 | r | #' Predator Prey Lotka Voltera Interaction
#'
#' Computes the change in both predator and prey abundance over time from species abundance and rates of ecological function
#' @param data starting parameters include initial predator and prey abundance (# indivduals), predator and prey carrying capacity (# indivduals), pr... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functionsH.R
\name{maxout}
\alias{maxout}
\title{Find the maximum number of extreme observations}
\usage{
maxout(x, y)
}
\arguments{
\item{x}{the one sample vector}
\item{y}{the other sample vector}
}
\value{
the maximum number of extreme ob... | /man/maxout.Rd | no_license | zhangjhkk/StatComp | R | false | true | 558 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functionsH.R
\name{maxout}
\alias{maxout}
\title{Find the maximum number of extreme observations}
\usage{
maxout(x, y)
}
\arguments{
\item{x}{the one sample vector}
\item{y}{the other sample vector}
}
\value{
the maximum number of extreme ob... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/totalCorMat.R
\name{totalCorMat}
\alias{totalCorMat}
\title{Total Correlation Matrix}
\usage{
totalCorMat(data)
}
\arguments{
\item{data}{Matrix or data frame.
Variables to be used in the analysis}
}
\value{
Returns a square matrix with pairw... | /man/totalCorMat.Rd | no_license | cran/EGAnet | R | false | true | 978 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/totalCorMat.R
\name{totalCorMat}
\alias{totalCorMat}
\title{Total Correlation Matrix}
\usage{
totalCorMat(data)
}
\arguments{
\item{data}{Matrix or data frame.
Variables to be used in the analysis}
}
\value{
Returns a square matrix with pairw... |
if(!require(aws.s3)) {
message("installing the aws.s3 package to connect to S3 file system.")
install.packages("aws.s3")
}
library(aws.s3) # https://github.com/cloudyr/aws.s3
library(readr)
library(lubridate)
library(dplyr)
library(ggplot2)
library(pryr) # memory usage functions
# specify keys as environment va... | /explore_users_parts_data.R | no_license | bmp475/Rec-Engine-498 | R | false | false | 13,465 | r | if(!require(aws.s3)) {
message("installing the aws.s3 package to connect to S3 file system.")
install.packages("aws.s3")
}
library(aws.s3) # https://github.com/cloudyr/aws.s3
library(readr)
library(lubridate)
library(dplyr)
library(ggplot2)
library(pryr) # memory usage functions
# specify keys as environment va... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ldefs_doc.R
\docType{data}
\name{locusdef.hg19.1kb_outside_upstream}
\alias{locusdef.hg19.1kb_outside_upstream}
\title{locusdef.hg19.1kb_outside_upstream locus definition}
\format{A \code{LocusDefinition} object with the following slots:
\des... | /man/locusdef.hg19.1kb_outside_upstream.Rd | no_license | wangk4/chipenrich.data | R | false | true | 1,454 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ldefs_doc.R
\docType{data}
\name{locusdef.hg19.1kb_outside_upstream}
\alias{locusdef.hg19.1kb_outside_upstream}
\title{locusdef.hg19.1kb_outside_upstream locus definition}
\format{A \code{LocusDefinition} object with the following slots:
\des... |
hapConten <- function(data=NULL, min.freq=50, max.freq=2000, pop.list=1, snpSites = NULL, ...) {
if (!is.null(snpSites) && length(snpSites)>=1) {
data <- data[rownames(data) %in% snpSites, ]
}
dat.mat <- data
dat.mat[is.na(dat.mat)] <- "-"
dat.mat <- t(dat.mat)
dat.mat.bin <- ape::as.DNAbin(dat.mat)
... | /hapConten.R | no_license | li153348734/ECOGEMS | R | false | false | 3,482 | r |
hapConten <- function(data=NULL, min.freq=50, max.freq=2000, pop.list=1, snpSites = NULL, ...) {
if (!is.null(snpSites) && length(snpSites)>=1) {
data <- data[rownames(data) %in% snpSites, ]
}
dat.mat <- data
dat.mat[is.na(dat.mat)] <- "-"
dat.mat <- t(dat.mat)
dat.mat.bin <- ape::as.DNAbin(dat.mat)
... |
context("Guess type")
test_that("guess_element correctly identifies individual elements", {
expect_equal(visdat:::guess_type(TRUE), "logical")
expect_equal(visdat:::guess_type(T), "logical")
expect_equal(visdat:::guess_type("TRUE"), "logical")
expect_equal(visdat:::guess_type("T"), "logical")
expect_equal(v... | /tests/testthat/test-guess-type.R | no_license | yonicd/visdat | R | false | false | 630 | r | context("Guess type")
test_that("guess_element correctly identifies individual elements", {
expect_equal(visdat:::guess_type(TRUE), "logical")
expect_equal(visdat:::guess_type(T), "logical")
expect_equal(visdat:::guess_type("TRUE"), "logical")
expect_equal(visdat:::guess_type("T"), "logical")
expect_equal(v... |
# This file is used to compress the dataverse files for upload
# to Github. Please ensure that you are running zip 2.0 for this
# process to run. This can be done by running update.packages()
# in the console and entering y when prompted for zip [no need
# to update other packages]
library(zip)
# Initial zip of file ... | /compressing.R | no_license | ebuxheli/enos_chicagovotes | R | false | false | 513 | r | # This file is used to compress the dataverse files for upload
# to Github. Please ensure that you are running zip 2.0 for this
# process to run. This can be done by running update.packages()
# in the console and entering y when prompted for zip [no need
# to update other packages]
library(zip)
# Initial zip of file ... |
#<R code>
library(lattice)
library(corrplot)
library(graphics)
#데이터 전처리--------------------------------------------------------------
MOVIES<-read.csv("C:/Users/ksc4you/Desktop/MOVIES.csv",header=T) #원본 데이터
summary(MOVIES)
movies<-MOVIES[,3:11] #gross포함
head(movies)
colnames(movies)<- c("x1","x2","x3","x4"... | /R_code film industry.R | no_license | hikhloee/Multivariate-Analysis-of-box-office-factors-in-the-film-industry | R | false | false | 7,080 | r | #<R code>
library(lattice)
library(corrplot)
library(graphics)
#데이터 전처리--------------------------------------------------------------
MOVIES<-read.csv("C:/Users/ksc4you/Desktop/MOVIES.csv",header=T) #원본 데이터
summary(MOVIES)
movies<-MOVIES[,3:11] #gross포함
head(movies)
colnames(movies)<- c("x1","x2","x3","x4"... |
#' Deprecated: write data file for SS version 3.24
#'
#' Write Stock Synthesis data file from list object in R which was probably
#' created using [SS_readdat()] (which would have called on
#' [SS_readdat_3.24()]).
#'
#' Support for 3.24 models within the r4ss `SS_read*` and `SS_write*()`
#' functions is ending, so ple... | /R/SS_writedat_3.24.R | no_license | r4ss/r4ss | R | false | false | 11,979 | r | #' Deprecated: write data file for SS version 3.24
#'
#' Write Stock Synthesis data file from list object in R which was probably
#' created using [SS_readdat()] (which would have called on
#' [SS_readdat_3.24()]).
#'
#' Support for 3.24 models within the r4ss `SS_read*` and `SS_write*()`
#' functions is ending, so ple... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/seasdummy.R
\name{seasdummy}
\alias{seasdummy}
\title{Create seasonal dummy variables.}
\usage{
seasdummy(n, m = NULL, y = NULL, type = c("bin", "trg"), full = c(FALSE,
TRUE))
}
\arguments{
\item{n}{Number of observations to create.}
\item... | /man/seasdummy.Rd | no_license | al00014/nnfor | R | false | true | 956 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/seasdummy.R
\name{seasdummy}
\alias{seasdummy}
\title{Create seasonal dummy variables.}
\usage{
seasdummy(n, m = NULL, y = NULL, type = c("bin", "trg"), full = c(FALSE,
TRUE))
}
\arguments{
\item{n}{Number of observations to create.}
\item... |
library(dplyr)
library(ggplot2)
library(ggforce)
library(reshape2)
library(ggpubr)
###########################################################################################################
tissue = "Cells_EBV-transformed_lymphocytes"
df = read.table(paste("/Users/chachritkhun/Desktop/TWAS_files/prediction_performance... | /Plots/delta_iv_plot.R | permissive | ckhunsr1/PUMICE | R | false | false | 4,910 | r | library(dplyr)
library(ggplot2)
library(ggforce)
library(reshape2)
library(ggpubr)
###########################################################################################################
tissue = "Cells_EBV-transformed_lymphocytes"
df = read.table(paste("/Users/chachritkhun/Desktop/TWAS_files/prediction_performance... |
#' Plots survival raster results including a nice outline of North America.
#'
#' \code{survivalPlotter} plots the results from \code{\link{survivalRaster}} and
#' adds shapes of North America.
#'
#' @param surv.stk raster result stack from \code{\link{survivalRaster}}
#' @param WNS logical. Should the bats plotted be ... | /R/survivalPlotter_fun.R | no_license | cReedHranac/batwintor | R | false | false | 2,956 | r | #' Plots survival raster results including a nice outline of North America.
#'
#' \code{survivalPlotter} plots the results from \code{\link{survivalRaster}} and
#' adds shapes of North America.
#'
#' @param surv.stk raster result stack from \code{\link{survivalRaster}}
#' @param WNS logical. Should the bats plotted be ... |
#' Title
#'
#' @param mapfile
#'
#' @export
#'
odbcConnectManifold <- function (mapfile)
{
full.path <- function(filename) {
fn <- chartr("\\", "/", filename)
is.abs <- length(grep("^[A-Za-z]:|/", fn)) > 0
chartr("/", "\\", if (!is.abs)
file.path(getwd(), filename)
else filename)
}
... | /R/src_manifold.r | no_license | dis-organization/dplyrodbc | R | false | false | 1,650 | r | #' Title
#'
#' @param mapfile
#'
#' @export
#'
odbcConnectManifold <- function (mapfile)
{
full.path <- function(filename) {
fn <- chartr("\\", "/", filename)
is.abs <- length(grep("^[A-Za-z]:|/", fn)) > 0
chartr("/", "\\", if (!is.abs)
file.path(getwd(), filename)
else filename)
}
... |
NEI <- readRDS("summarySCC_PM25.rds"); SSC <- readRDS("Source_Classification_Code.rds")
library(ggplot2)
library(dplyr)
# Gathering Baltimore City and LA total Motor Vehicle Emission per Year
BaltEmiss<-summarise(group_by(filter(NEI, fips == "24510"& type == 'ON-ROAD'), year), Emissions=sum(Emissions))
LAEmiss... | /plot6.R | no_license | alkgautam/Exploratory-Data-Analysis-Course-Project-2 | R | false | false | 1,171 | r | NEI <- readRDS("summarySCC_PM25.rds"); SSC <- readRDS("Source_Classification_Code.rds")
library(ggplot2)
library(dplyr)
# Gathering Baltimore City and LA total Motor Vehicle Emission per Year
BaltEmiss<-summarise(group_by(filter(NEI, fips == "24510"& type == 'ON-ROAD'), year), Emissions=sum(Emissions))
LAEmiss... |
library(glmnet)
mydata = read.table("../../../../TrainingSet/FullSet/Correlation/pleura.csv",head=T,sep=",")
x = as.matrix(mydata[,4:ncol(mydata)])
y = as.matrix(mydata[,1])
set.seed(123)
glm = cv.glmnet(x,y,nfolds=10,type.measure="mse",alpha=0.65,family="gaussian",standardize=TRUE)
sink('./pleura_069.txt',append=TRUE)... | /Model/EN/Correlation/pleura/pleura_069.R | no_license | esbgkannan/QSMART | R | false | false | 350 | r | library(glmnet)
mydata = read.table("../../../../TrainingSet/FullSet/Correlation/pleura.csv",head=T,sep=",")
x = as.matrix(mydata[,4:ncol(mydata)])
y = as.matrix(mydata[,1])
set.seed(123)
glm = cv.glmnet(x,y,nfolds=10,type.measure="mse",alpha=0.65,family="gaussian",standardize=TRUE)
sink('./pleura_069.txt',append=TRUE)... |
library(testthat)
library(kernelboot)
test_check("kernelboot")
| /fuzzedpackages/kernelboot/tests/testthat.R | no_license | akhikolla/testpackages | R | false | false | 64 | r | library(testthat)
library(kernelboot)
test_check("kernelboot")
|
\name{run_NBPSeq_nbp}
\alias{run_NBPSeq_nbp}
\title{
run_NBPSeq_nbp - Negative Binomial (NB) models for two-group comparisons and regression inferences from RNA-Sequencing Data.
}
\description{
nbp.test fits an NBP model to the RNA-Seq counts and performs Robinson and Smyth's exact NB test on each gene to assess differ... | /DEG.comparison/man/run_NBPSeq_nbp.Rd | no_license | dcassol/DEG.comparison | R | false | false | 1,719 | rd | \name{run_NBPSeq_nbp}
\alias{run_NBPSeq_nbp}
\title{
run_NBPSeq_nbp - Negative Binomial (NB) models for two-group comparisons and regression inferences from RNA-Sequencing Data.
}
\description{
nbp.test fits an NBP model to the RNA-Seq counts and performs Robinson and Smyth's exact NB test on each gene to assess differ... |
\name{addLocal}
\alias{addLocal}
\title{Store a new function or piece of data into the local database}
\usage{
addLocal(item)
}
\arguments{
\item{item}{The item you want to store. Either a
function or data.}
}
\description{
Store a new function or piece of data into the local
database. When you store somethi... | /man/addLocal.Rd | no_license | Dasonk/local | R | false | false | 606 | rd | \name{addLocal}
\alias{addLocal}
\title{Store a new function or piece of data into the local database}
\usage{
addLocal(item)
}
\arguments{
\item{item}{The item you want to store. Either a
function or data.}
}
\description{
Store a new function or piece of data into the local
database. When you store somethi... |
#' @title setup graph legend
#' @description will setup a graph legend according to a decided
#' threshold (min_color to max_color) values. Also uses a colorfuncn to generate
#' color scheme. This can be generated with \code{assign_color_scale}.
#' @param min_color value. Minimum value for lowest color.
#' @param max_... | /R/setup_graph_legend.R | no_license | frhl/KRAS-methods | R | false | false | 1,704 | r | #' @title setup graph legend
#' @description will setup a graph legend according to a decided
#' threshold (min_color to max_color) values. Also uses a colorfuncn to generate
#' color scheme. This can be generated with \code{assign_color_scale}.
#' @param min_color value. Minimum value for lowest color.
#' @param max_... |
library(showtext)
library(tidyverse)
font_add_google("Lato", "Lato")
font_add_google("Merriweather", "Merriweather")
showtext_auto()
ggplot(mtcars, aes(mpg, wt, color = as.character(gear))) +
geom_point() +
labs(
title = "Car Weights vs MPG",
subtitle = "The more a car weights, the more gas it uses per mi... | /theme.R | permissive | jesadrperez/tidy-tuesday | R | false | false | 1,220 | r | library(showtext)
library(tidyverse)
font_add_google("Lato", "Lato")
font_add_google("Merriweather", "Merriweather")
showtext_auto()
ggplot(mtcars, aes(mpg, wt, color = as.character(gear))) +
geom_point() +
labs(
title = "Car Weights vs MPG",
subtitle = "The more a car weights, the more gas it uses per mi... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/GWexPrec_lib.r
\name{get.df.Student}
\alias{get.df.Student}
\title{get.df.Student}
\usage{
get.df.Student(P, Sig, max.df = 20)
}
\arguments{
\item{P}{matrix of non-zero precipitation (zero precipitation are set to NA)}
\item{Sig}{correlation... | /man/get.df.Student.Rd | no_license | guillaumeevin/GWEX | R | false | true | 655 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/GWexPrec_lib.r
\name{get.df.Student}
\alias{get.df.Student}
\title{get.df.Student}
\usage{
get.df.Student(P, Sig, max.df = 20)
}
\arguments{
\item{P}{matrix of non-zero precipitation (zero precipitation are set to NA)}
\item{Sig}{correlation... |
#' Creates a cost surface from a SpatRaster
#'
#' Creates a cost surface using the values in the supplied SpatRaster. This function also provides for the inclusion of maximum slope traversable
#'
#' The supplied 'spatRaster' object must have a projected CRS
#'
#' @param x \code{SpatRaster}
#'
#' @param neighbours \... | /R/create_cs.R | no_license | josephlewis/leastcostpath | R | false | false | 3,647 | r | #' Creates a cost surface from a SpatRaster
#'
#' Creates a cost surface using the values in the supplied SpatRaster. This function also provides for the inclusion of maximum slope traversable
#'
#' The supplied 'spatRaster' object must have a projected CRS
#'
#' @param x \code{SpatRaster}
#'
#' @param neighbours \... |
% Generated by roxygen2 (4.0.1): do not edit by hand
\name{vector_read}
\alias{vector_read}
\alias{vector_read_eps}
\alias{vector_read_svg}
\alias{vector_read_xml}
\title{Load Vector Graphics as a Picture Object}
\usage{
vector_read(filename)
vector_read_xml(filename)
vector_read_eps(filename)
vector_read_svg(filena... | /man/vector_read.Rd | no_license | richfitz/vectoR | R | false | false | 2,697 | rd | % Generated by roxygen2 (4.0.1): do not edit by hand
\name{vector_read}
\alias{vector_read}
\alias{vector_read_eps}
\alias{vector_read_svg}
\alias{vector_read_xml}
\title{Load Vector Graphics as a Picture Object}
\usage{
vector_read(filename)
vector_read_xml(filename)
vector_read_eps(filename)
vector_read_svg(filena... |
library(stringi)
sciezka<-getwd()
# lista folderóœ będących miesiącami
foldery <- list.files(file.path(sciezka,"projekt1/dane"))
# tworzymy katolg, do którego będą zapisywane nasze pliki
dir.create(file.path(scizka,"projekt1/dane_csv"))
for (f in folder){
# tworzymy folder danego miesiaca
dir.create(file.path... | /MINI_2016/zespolyP1/grupa0/Kody/log_to_csv.R | no_license | gradzielr/RandBigData | R | false | false | 1,732 | r | library(stringi)
sciezka<-getwd()
# lista folderóœ będących miesiącami
foldery <- list.files(file.path(sciezka,"projekt1/dane"))
# tworzymy katolg, do którego będą zapisywane nasze pliki
dir.create(file.path(scizka,"projekt1/dane_csv"))
for (f in folder){
# tworzymy folder danego miesiaca
dir.create(file.path... |
list(
Jay = "x86_64-w64-mingw32/x64 (64-bit)",
Lu = "x86_64-w64-mingw32/x64 (64-bit)",
LV = "x86_64-w64-mingw32/x64 (64-bit)",
Wu = "x86_64-w64-mingw32/x64 (64-bit)",
Michael = "x86_64-w64-mingw32/x64 (64-bit)",
Hong = "x86_64-w64-mingw32/x64 (64-bit)"
) | /our_environments.R | no_license | jaywang-EE/Rlads106_team6 | R | false | false | 273 | r | list(
Jay = "x86_64-w64-mingw32/x64 (64-bit)",
Lu = "x86_64-w64-mingw32/x64 (64-bit)",
LV = "x86_64-w64-mingw32/x64 (64-bit)",
Wu = "x86_64-w64-mingw32/x64 (64-bit)",
Michael = "x86_64-w64-mingw32/x64 (64-bit)",
Hong = "x86_64-w64-mingw32/x64 (64-bit)"
) |
#----------------------------------------------------------------
# Examining a Most Likely Case for Strong Campaign Effects:
# Hitler's Speeches and the Rise of the Nazi Party, 1927--1933
# Peter Selb (University of Konstanz)
# Simon Munzert (MZES, University of Mannheim)
# 2016
#-------------------------------------... | /code/1c-prepare_nsdap_members.R | no_license | simonmunzert/hitler-speeches | R | false | false | 13,563 | r | #----------------------------------------------------------------
# Examining a Most Likely Case for Strong Campaign Effects:
# Hitler's Speeches and the Rise of the Nazi Party, 1927--1933
# Peter Selb (University of Konstanz)
# Simon Munzert (MZES, University of Mannheim)
# 2016
#-------------------------------------... |
#Rcode
a1 <- read.table('analysis/accessible_trajectory.txt',header=T)
b2 <- a1[which(a1$hamming_distance==2),]
b3 <- a1[which(a1$hamming_distance==3),]
b4 <- a1[which(a1$hamming_distance==4),]
png('figures/accessible_trajectory.png',res=600,width=6000,height=2400)
par(mfrow=c(1,3))
plot(b2$accessible_frequency,b2$geno... | /accessible_trajectory.R | no_license | Tian-hao/protease-inhibitor | R | false | false | 834 | r | #Rcode
a1 <- read.table('analysis/accessible_trajectory.txt',header=T)
b2 <- a1[which(a1$hamming_distance==2),]
b3 <- a1[which(a1$hamming_distance==3),]
b4 <- a1[which(a1$hamming_distance==4),]
png('figures/accessible_trajectory.png',res=600,width=6000,height=2400)
par(mfrow=c(1,3))
plot(b2$accessible_frequency,b2$geno... |
## Test signatures a function of heterozygosity (correcting for distance from Africa...)
source("~/spectrum/code/spectrumlib.R")
library(geosphere)
exclude.cell.lines <- FALSE
n <- 2
rank <- 4
which <- 4 #Which spectrum - 4=="Signature 1" 1=="Signature 2"
spec <- "spectrum"
what <- "ica_NM... | /distance_from_addis_ababa.R | no_license | mathii/spectrum | R | false | false | 4,376 | r | ## Test signatures a function of heterozygosity (correcting for distance from Africa...)
source("~/spectrum/code/spectrumlib.R")
library(geosphere)
exclude.cell.lines <- FALSE
n <- 2
rank <- 4
which <- 4 #Which spectrum - 4=="Signature 1" 1=="Signature 2"
spec <- "spectrum"
what <- "ica_NM... |
#!/share/apps/R-3.2.2_gcc/bin/Rscript
library(chron)
library(data.table)
library(reshape2)
library(dplyr)
library(foreach)
library(iterators)
source_path = "/home/hnoorazar/cleaner_codes/core.R"
source(source_path)
raw_data_dir = "/data/hydro/users/Hossein/codling_moth_new/local/raw/"
write_path = "/data/hydro/users/... | /codling_moth/code/drivers/local_future/LF_CM_45_S5.R | permissive | HNoorazar/Ag | R | false | false | 3,270 | r | #!/share/apps/R-3.2.2_gcc/bin/Rscript
library(chron)
library(data.table)
library(reshape2)
library(dplyr)
library(foreach)
library(iterators)
source_path = "/home/hnoorazar/cleaner_codes/core.R"
source(source_path)
raw_data_dir = "/data/hydro/users/Hossein/codling_moth_new/local/raw/"
write_path = "/data/hydro/users/... |
pimax=function(Nsim=10^3){
#Monte Carlo approximation to the marginal posterior
library(MASS) #to get Pima.tr
da=cbind(Pima.tr$type,Pima.tr$bmi)
da[,1]=da[,1]-1
like=function(a,b){
sum(pnorm(q=a+outer(X=b,Y=da[,2],FUN="*"),log=T)*da[,1]+pnorm(q=-a-outer(X=b,Y=da[,2],FUN="*"),log=T)*(1-da[,1]))}
newlike=function(a,b)... | /mcsm/R/pimax.R | no_license | ingted/R-Examples | R | false | false | 1,736 | r | pimax=function(Nsim=10^3){
#Monte Carlo approximation to the marginal posterior
library(MASS) #to get Pima.tr
da=cbind(Pima.tr$type,Pima.tr$bmi)
da[,1]=da[,1]-1
like=function(a,b){
sum(pnorm(q=a+outer(X=b,Y=da[,2],FUN="*"),log=T)*da[,1]+pnorm(q=-a-outer(X=b,Y=da[,2],FUN="*"),log=T)*(1-da[,1]))}
newlike=function(a,b)... |
\name{getTime_}
\alias{getTime_}
\title{
Read time
}
\description{
Reads the time when the function is called.
}
\usage{
getTime_()
}
\value{
a \code{numeric}.
}
\seealso{
\code{\link{PrintDuration}},
\code{\link{PrintEstimatedRemainingTime}},
\code{\link{ComputeDuration}}
}
\examples{
ti <- getTime_()
}
\... | /man/getTime_.Rd | no_license | GeoBosh/StableEstim | R | false | false | 347 | rd | \name{getTime_}
\alias{getTime_}
\title{
Read time
}
\description{
Reads the time when the function is called.
}
\usage{
getTime_()
}
\value{
a \code{numeric}.
}
\seealso{
\code{\link{PrintDuration}},
\code{\link{PrintEstimatedRemainingTime}},
\code{\link{ComputeDuration}}
}
\examples{
ti <- getTime_()
}
\... |
library(ggplot2)
data <- read.table("price_data.csv", header=F, sep=",")
pdf("price_compare.pdf")
ggplot(data = data) + scale_colour_grey(name="Average price", start=0, end=0.6) +
geom_line(aes(x = V1, y = V2, color = "chickens")) +
geom_line(aes(x = V1, y = V3, color = "ducks")) +
scale_y_continuous("price") ... | /Chapter 4 - How to Be an Armchair Economist/s2_price_compare.r | no_license | danmigodu/everyday | R | false | false | 362 | r | library(ggplot2)
data <- read.table("price_data.csv", header=F, sep=",")
pdf("price_compare.pdf")
ggplot(data = data) + scale_colour_grey(name="Average price", start=0, end=0.6) +
geom_line(aes(x = V1, y = V2, color = "chickens")) +
geom_line(aes(x = V1, y = V3, color = "ducks")) +
scale_y_continuous("price") ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.