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 |
|---|---|---|---|---|---|---|---|---|---|
\name{checkMonoEmax}
\alias{checkMonoEmax}
\title{Bayes posterior predictive test for Emax (monotone) model fit}
\description{Bayes posterior predictive test for an Emax (monotone) model
fit comparing the best response from lower doses to
the response from the highest dose. \code{checkMonoEmax} is deprecated.... | /man/checkMonoEmax.Rd | no_license | cran/clinDR | R | false | false | 4,443 | rd | \name{checkMonoEmax}
\alias{checkMonoEmax}
\title{Bayes posterior predictive test for Emax (monotone) model fit}
\description{Bayes posterior predictive test for an Emax (monotone) model
fit comparing the best response from lower doses to
the response from the highest dose. \code{checkMonoEmax} is deprecated.... |
#' Mandatory: Cenith Validation V2
#'
#' @description Optional: used to test optimal moving window for the Cenith Segmentation
#' @name Mandatory Cenith
#' @export Mandatory Cenith
#' @param Mandatory if function: chm - a canopy height model
#' @param Mandatory if function: a, b - parameters for moving window
#' pre... | /src/Cenith_V2/CENITH_val/CENITH_validation_V2/002_cenith_val_v2.R | no_license | GeoMOER-Students-Space/Envimaster-Geomorph | R | false | false | 3,113 | r | #' Mandatory: Cenith Validation V2
#'
#' @description Optional: used to test optimal moving window for the Cenith Segmentation
#' @name Mandatory Cenith
#' @export Mandatory Cenith
#' @param Mandatory if function: chm - a canopy height model
#' @param Mandatory if function: a, b - parameters for moving window
#' pre... |
#' Count Letters, Words, and Lines of a File
#'
#' See title.
#'
#' @details
#' \code{wc_l()} is a shorthand for counting only lines, similar to \code{wc -l}
#' in the terminal. Likewise \code{wc_w()} is analogous to \code{wc -w} for
#' words.
#'
#' @param file
#' Location of the file (as a string) from which the co... | /R/wc.r | permissive | wrathematics/filesampler | R | false | false | 2,070 | r | #' Count Letters, Words, and Lines of a File
#'
#' See title.
#'
#' @details
#' \code{wc_l()} is a shorthand for counting only lines, similar to \code{wc -l}
#' in the terminal. Likewise \code{wc_w()} is analogous to \code{wc -w} for
#' words.
#'
#' @param file
#' Location of the file (as a string) from which the co... |
if (any(!file.exists('data/Source_Classification_Code.rds','data/summarySCC_PM25.rds'))) {
dataurl <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_data.zip"
datafname <- "Dataset.zip"
download.file(dataurl,dest=datafname,method="wget")
unzip(datafname,exdir='data')
file.remove(datafname)
}
| /exploratory-data-analysis/proj2/grabdata.R | no_license | jotinha/datasciencecoursera | R | false | false | 320 | r | if (any(!file.exists('data/Source_Classification_Code.rds','data/summarySCC_PM25.rds'))) {
dataurl <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_data.zip"
datafname <- "Dataset.zip"
download.file(dataurl,dest=datafname,method="wget")
unzip(datafname,exdir='data')
file.remove(datafname)
}
|
dataset <- read.csv("http://users.stat.ufl.edu/~winner/data/nfl2008_fga.csv")
library(caTools) # useful to split data to training and test datasets
set.seed(1456)
n=nrow(dataset)
n
indexes = sample(n,n*(80/100))
trainset=dataset[indexes,]
testset =dataset[-indexes,]
#(a)
table(trainset$homekick) # to identify the ou... | /2Q alternate answer.R | no_license | PaulDinesh/Data-DataAnalytics | R | false | false | 932 | r | dataset <- read.csv("http://users.stat.ufl.edu/~winner/data/nfl2008_fga.csv")
library(caTools) # useful to split data to training and test datasets
set.seed(1456)
n=nrow(dataset)
n
indexes = sample(n,n*(80/100))
trainset=dataset[indexes,]
testset =dataset[-indexes,]
#(a)
table(trainset$homekick) # to identify the ou... |
###=====
### Collection of R utility functions
###=====
library(tidyverse)
library(reshape2)
###=====
### pval lmer: LRT based LMM
###=====
pval_lmer <- function(formula, data) {
require(lme4)
require(dplyr)
require(reshape2)
formula <- as.formula(formula)
parsed_formula <- reshape2:::parse_formula(... | /utility_functions.R | no_license | junglee0713/R_functions | R | false | false | 2,289 | r | ###=====
### Collection of R utility functions
###=====
library(tidyverse)
library(reshape2)
###=====
### pval lmer: LRT based LMM
###=====
pval_lmer <- function(formula, data) {
require(lme4)
require(dplyr)
require(reshape2)
formula <- as.formula(formula)
parsed_formula <- reshape2:::parse_formula(... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/core-functions.R
\name{getStartingPoints}
\alias{getStartingPoints}
\title{Obtains starting nodes in a graph given nodes and edges}
\usage{
getStartingPoints(nodes, edgeDf)
}
\description{
Obtains starting nodes in a graph given nodes and edg... | /man/getStartingPoints.Rd | permissive | Mu-Sigma/analysis-pipelines | R | false | true | 344 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/core-functions.R
\name{getStartingPoints}
\alias{getStartingPoints}
\title{Obtains starting nodes in a graph given nodes and edges}
\usage{
getStartingPoints(nodes, edgeDf)
}
\description{
Obtains starting nodes in a graph given nodes and edg... |
library(grobblR)
library(ggplot2)
library(dplyr)
data(iris)
setosa_color = "green4"
virginica_color = "red"
versicolor_color = "blue"
# - Create the content for the report (data frames and ggplots)
sepal_gg = ggplot(
data = iris,
mapping = aes(x = Sepal.Length, y = Sepal.Width, color = Species)
) +
geom_poin... | /examples/code/iris.R | permissive | calvinmfloyd/grobblR | R | false | false | 4,154 | r |
library(grobblR)
library(ggplot2)
library(dplyr)
data(iris)
setosa_color = "green4"
virginica_color = "red"
versicolor_color = "blue"
# - Create the content for the report (data frames and ggplots)
sepal_gg = ggplot(
data = iris,
mapping = aes(x = Sepal.Length, y = Sepal.Width, color = Species)
) +
geom_poin... |
\name{LoCoH}
\alias{LoCoH}
\alias{LoCoH.k}
\alias{LoCoH.r}
\alias{LoCoH.a}
\alias{LoCoH.k.area}
\alias{LoCoH.r.area}
\alias{LoCoH.a.area}
\title{Estimating LoCoH home ranges}
\description{
The functions computes the home range of one or several animals using
the LoCoH family of methods.
The functions \code{LoC... | /man/LoCoH.Rd | no_license | jtvandijk/adehabitatHR | R | false | false | 7,621 | rd | \name{LoCoH}
\alias{LoCoH}
\alias{LoCoH.k}
\alias{LoCoH.r}
\alias{LoCoH.a}
\alias{LoCoH.k.area}
\alias{LoCoH.r.area}
\alias{LoCoH.a.area}
\title{Estimating LoCoH home ranges}
\description{
The functions computes the home range of one or several animals using
the LoCoH family of methods.
The functions \code{LoC... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gl2phylip.r
\name{gl2phylip}
\alias{gl2phylip}
\title{Create a Phylip input distance matrix from a genlight (SNP) \{adegenet\} object}
\usage{
gl2phylip(
x,
outfile = "phyinput.txt",
outpath = tempdir(),
bstrap = 1,
verbose = NULL
)... | /man/gl2phylip.Rd | no_license | carlopacioni/dartR | R | false | true | 1,431 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gl2phylip.r
\name{gl2phylip}
\alias{gl2phylip}
\title{Create a Phylip input distance matrix from a genlight (SNP) \{adegenet\} object}
\usage{
gl2phylip(
x,
outfile = "phyinput.txt",
outpath = tempdir(),
bstrap = 1,
verbose = NULL
)... |
#' RM2C2: Scoring, Summarizing
#' @name make_tidy_datetime_filename
#' @param datetime class: POSIXct
#' @param timezone class: string
#' @import tidyverse
#' @examples
#' make_tidy_datetime_filename(datetime=NA, timezone="UTC")
#' @export
make_tidy_datetime_filename <- function() {
cur_dts <- Sys.time()
dt <- for... | /R/make_tidy_datetime_filename.R | permissive | nelsonroque/surveydolphinr | R | false | false | 368 | r | #' RM2C2: Scoring, Summarizing
#' @name make_tidy_datetime_filename
#' @param datetime class: POSIXct
#' @param timezone class: string
#' @import tidyverse
#' @examples
#' make_tidy_datetime_filename(datetime=NA, timezone="UTC")
#' @export
make_tidy_datetime_filename <- function() {
cur_dts <- Sys.time()
dt <- for... |
BMI <- function(Height, Weight) (Weight/Height^2)
BMI_sd <- function(Height, Weight) {
BMI <-(Weight/Height^2)
message = "Waiting for your inputs......"
if (BMI >= 25) {message = "You are overweight!"}
else if (BMI <= 18.5) {message = "You are underweight!"}
else {message = "Congratulations! You are normal!"}... | /presentation.R | no_license | emjbkfdmylirg/developing-data-products_final | R | false | false | 574 | r | BMI <- function(Height, Weight) (Weight/Height^2)
BMI_sd <- function(Height, Weight) {
BMI <-(Weight/Height^2)
message = "Waiting for your inputs......"
if (BMI >= 25) {message = "You are overweight!"}
else if (BMI <= 18.5) {message = "You are underweight!"}
else {message = "Congratulations! You are normal!"}... |
library("urca")
library("tseries")
library("seasonal")
library("lmtest")
library("vars")
library("forecast")
library("graphics")
library("Hmisc")
library("xtable")
library("tikzDevice")
library("stargazer")
rm(list = ls())
setwd("~/Google Drive/HSU/Paper/2sm/Paper 2sm/Data")
# Market 7: News Magazines
# Included Ma... | /backup/data/fss.R | no_license | franziloew/market_definition_2sm | R | false | false | 21,661 | r |
library("urca")
library("tseries")
library("seasonal")
library("lmtest")
library("vars")
library("forecast")
library("graphics")
library("Hmisc")
library("xtable")
library("tikzDevice")
library("stargazer")
rm(list = ls())
setwd("~/Google Drive/HSU/Paper/2sm/Paper 2sm/Data")
# Market 7: News Magazines
# Included Ma... |
rm(list = ls())
# if (!requireNamespace("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#
# BiocManager::install("TCGAbiolinks")
suppressPackageStartupMessages({
library(futile.logger)
library(TCGAbiolinks)
library(SummarizedExperiment)
library(dplyr)
library(tibble)
library(stringr)
... | /bin/survivalAnalysis_LateStages.R | no_license | kkolmus/CRC_transcriptomics_proj | R | false | false | 6,013 | r | rm(list = ls())
# if (!requireNamespace("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#
# BiocManager::install("TCGAbiolinks")
suppressPackageStartupMessages({
library(futile.logger)
library(TCGAbiolinks)
library(SummarizedExperiment)
library(dplyr)
library(tibble)
library(stringr)
... |
## TWo functions are created below. Function makeCacheMatrix creates a special
## matrix object that can cache its inverse and return it. Function CacheSolve
## makes use of the above created special matrix to get the matrix inverse if already calculated from the cache.
## This function creates a special "matrix" ob... | /cachematrix.R | no_license | Anu-graha/ProgrammingAssignment2 | R | false | false | 1,095 | r | ## TWo functions are created below. Function makeCacheMatrix creates a special
## matrix object that can cache its inverse and return it. Function CacheSolve
## makes use of the above created special matrix to get the matrix inverse if already calculated from the cache.
## This function creates a special "matrix" ob... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/otu_to_taxonomy.R
\name{otu_to_taxonomy}
\alias{otu_to_taxonomy}
\title{Transform OTUs to their taxonomic label}
\usage{
otu_to_taxonomy(OTU, data)
}
\arguments{
\item{OTU}{String vector. Names of OTU labels in \code{data}}
\item{data}{\code... | /man/otu_to_taxonomy.Rd | no_license | weinroth/corncob | R | false | true | 532 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/otu_to_taxonomy.R
\name{otu_to_taxonomy}
\alias{otu_to_taxonomy}
\title{Transform OTUs to their taxonomic label}
\usage{
otu_to_taxonomy(OTU, data)
}
\arguments{
\item{OTU}{String vector. Names of OTU labels in \code{data}}
\item{data}{\code... |
## classic wordcount
## input can be any text file
## inspect output with from.dfs(output) -- this will produce an R list watch out with big datasets
Sys.setenv(HADOOP_CMD="/opt/cloudera/parcels/CDH-5.3.3-1.cdh5.3.3.p0.5/bin/hadoop")
Sys.setenv(HADOOP_STREAMING="/opt/cloudera/parcels/CDH-5.3.3-1.cdh5.3.3.p0.5/lib/hado... | /TextMiningfilesort_rscript/Rhadoop_inputtext.R | no_license | wagaman/MachineLearning | R | false | false | 3,799 | r | ## classic wordcount
## input can be any text file
## inspect output with from.dfs(output) -- this will produce an R list watch out with big datasets
Sys.setenv(HADOOP_CMD="/opt/cloudera/parcels/CDH-5.3.3-1.cdh5.3.3.p0.5/bin/hadoop")
Sys.setenv(HADOOP_STREAMING="/opt/cloudera/parcels/CDH-5.3.3-1.cdh5.3.3.p0.5/lib/hado... |
#### Ejercicio 1
library("tidyverse")
install.packages("gapminder")
library("gapminder")
df <- gapminder
str(df)
summary(df$gdpPercap)
plot(df$year, df$gdpPercap/1000,
main = "Gráfico 1: GDP per cápita",
sub = "GPD per cápita para 172 países entre los año 1952 y 2007",
xlab = "Año",
ylab = "GPD per... | /tarea_1.R | no_license | josereyessaldias/tarea_1_metodos | R | false | false | 3,546 | r | #### Ejercicio 1
library("tidyverse")
install.packages("gapminder")
library("gapminder")
df <- gapminder
str(df)
summary(df$gdpPercap)
plot(df$year, df$gdpPercap/1000,
main = "Gráfico 1: GDP per cápita",
sub = "GPD per cápita para 172 países entre los año 1952 y 2007",
xlab = "Año",
ylab = "GPD per... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/model.R
\name{run_basic}
\alias{run_basic}
\title{Run Basic Model}
\usage{
run_basic(model = model_strat, xstart, params = params,
params2 = NULL, days_out1, days_out2 = NULL, days_out3 = NULL,
det_table = det_table)
}
\description{
Run B... | /1 - R Package/man/run_basic.Rd | permissive | abilinski/COVID19 | R | false | true | 333 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/model.R
\name{run_basic}
\alias{run_basic}
\title{Run Basic Model}
\usage{
run_basic(model = model_strat, xstart, params = params,
params2 = NULL, days_out1, days_out2 = NULL, days_out3 = NULL,
det_table = det_table)
}
\description{
Run B... |
\name{digitizeImages}
\alias{digitizeImages}
\title{Opens the StereoMorph Digitizing App}
\description{This function opens an application in the user's default web browser for manually digitizing landmarks and Bezier curves from photographs. This function replaces digitizeImage.}
\usage{
digitizeImages(image.file, sha... | /StereoMorph/man/digitizeImages.Rd | no_license | hiweller/Eartheaters | R | false | false | 4,400 | rd | \name{digitizeImages}
\alias{digitizeImages}
\title{Opens the StereoMorph Digitizing App}
\description{This function opens an application in the user's default web browser for manually digitizing landmarks and Bezier curves from photographs. This function replaces digitizeImage.}
\usage{
digitizeImages(image.file, sha... |
#' A helper for countReads function
#'
#' A function that helps combine all transcript exons coordinates
#'
#' @param gList A GRanges object that store new exon coordinates.
#' @param dup A GRanges object of narrowed down reference coordinates of human genes. Only contain a target gene's protein coding exon.
#' @param ... | /R/combineTranscripts.R | no_license | leetina4/LSplicing | R | false | false | 2,916 | r | #' A helper for countReads function
#'
#' A function that helps combine all transcript exons coordinates
#'
#' @param gList A GRanges object that store new exon coordinates.
#' @param dup A GRanges object of narrowed down reference coordinates of human genes. Only contain a target gene's protein coding exon.
#' @param ... |
library(dplyr)
library(ggplot2)
alpha <- 0.4
bi_fast <- readRDS("en_US/bi_words_fast.rds")
tri_fast <- readRDS("en_US/tri_words_fast.rds")
quad_fast <- readRDS("en_US/quad_words_fast.rds")
prediction_algo <- function(input, alpha, quadragrams, trigrams, bigrams){
list_words <- unlist(strsplit(input, " ")... | /stupidBackoff.R | no_license | marioraulgz/PredictR | R | false | false | 1,867 | r | library(dplyr)
library(ggplot2)
alpha <- 0.4
bi_fast <- readRDS("en_US/bi_words_fast.rds")
tri_fast <- readRDS("en_US/tri_words_fast.rds")
quad_fast <- readRDS("en_US/quad_words_fast.rds")
prediction_algo <- function(input, alpha, quadragrams, trigrams, bigrams){
list_words <- unlist(strsplit(input, " ")... |
stopifnot(require("testthat"), require("fitode"))
test_that("SI model", {
harbin <- structure(list(week = 2:18,
Deaths = c(2, 7, 2, 6, 12, 68, 91,
126, 229, 250, 212, 161, 101, 108, 46, 40, 14)),
.Names = c("week", "Deaths"),
row.names = c(NA, -17L),
class = "dat... | /tests/testthat/test-methods.R | no_license | manal12341234/fitode | R | false | false | 3,032 | r | stopifnot(require("testthat"), require("fitode"))
test_that("SI model", {
harbin <- structure(list(week = 2:18,
Deaths = c(2, 7, 2, 6, 12, 68, 91,
126, 229, 250, 212, 161, 101, 108, 46, 40, 14)),
.Names = c("week", "Deaths"),
row.names = c(NA, -17L),
class = "dat... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoflow_utils.R
\name{extract_kvp}
\alias{extract_kvp}
\title{extract_kvp}
\usage{
extract_kvp(str)
}
\description{
extract_kvp
}
| /man/extract_kvp.Rd | no_license | gitter-badger/geoflow | R | false | true | 208 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoflow_utils.R
\name{extract_kvp}
\alias{extract_kvp}
\title{extract_kvp}
\usage{
extract_kvp(str)
}
\description{
extract_kvp
}
|
## Loading data will likely take a few seconds.
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
# merge the two data sets
if(!exists("NEISCC")){
NEISCC <- merge(NEI, SCC, by="SCC")
}
library(ggplot2)
# How have emissions from motor vehicle sources changed from 1... | /plot5.R | no_license | sagar22/Exploratory-Data-Analysis--Assignment-2 | R | false | false | 1,079 | r | ## Loading data will likely take a few seconds.
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
# merge the two data sets
if(!exists("NEISCC")){
NEISCC <- merge(NEI, SCC, by="SCC")
}
library(ggplot2)
# How have emissions from motor vehicle sources changed from 1... |
setwd ("/Users/OliviaMartins/Documents/MMSS_311-2/MMSS_311_2")
install.packages("ggplot2")
install.packages("dplyr")
install.packages("stringr")
install.packages("lubridate")
library(ggplot2)
library(dplyr)
library(stringr)
library(lubridate)
url <- "https://www.qogdata.pol.gu.se/data/qog_std_ts_jan19.csv"
qog <-read... | /Lab1.R | no_license | OliviaMartins/MMSS_311_2 | R | false | false | 360 | r | setwd ("/Users/OliviaMartins/Documents/MMSS_311-2/MMSS_311_2")
install.packages("ggplot2")
install.packages("dplyr")
install.packages("stringr")
install.packages("lubridate")
library(ggplot2)
library(dplyr)
library(stringr)
library(lubridate)
url <- "https://www.qogdata.pol.gu.se/data/qog_std_ts_jan19.csv"
qog <-read... |
library(dplyr)
library(Seurat)
library(ggplot2)
path1 = path.expand("~/GSE97930_FrontalCortex_snDrop-seq_UMI_Count_Matrix_08-01-2017.txt.gz")
matrix = read.table(path1, header=TRUE, row.names=1)
FrontalCortex <- CreateSeuratObject(counts = matrix, project = "Datavis", min.cells = 3, min.features = 200)
FrontalCorte... | /data_processing.R | no_license | nshedd/04-Remix | R | false | false | 2,994 | r | library(dplyr)
library(Seurat)
library(ggplot2)
path1 = path.expand("~/GSE97930_FrontalCortex_snDrop-seq_UMI_Count_Matrix_08-01-2017.txt.gz")
matrix = read.table(path1, header=TRUE, row.names=1)
FrontalCortex <- CreateSeuratObject(counts = matrix, project = "Datavis", min.cells = 3, min.features = 200)
FrontalCorte... |
library(ggplot2)
library(seqsetvis)
qid = annotation_dt[gene_name %in% c("GATA6", "SUPT3H", "RUNX1", "RUNX2")]$id
pdt = profile_dt[id %in% qid]
ggplot(pdt, aes(x = x, y = y, color = mark)) + facet_grid("cell~id") + geom_path()
qgr = subset(query_gr, id %in% qid)
names(qgr) = qgr$id
qgr = resize(qgr, 30000, fix = "c... | /test.R | no_license | jrboyd/shiny_seqtsne | R | false | false | 839 | r | library(ggplot2)
library(seqsetvis)
qid = annotation_dt[gene_name %in% c("GATA6", "SUPT3H", "RUNX1", "RUNX2")]$id
pdt = profile_dt[id %in% qid]
ggplot(pdt, aes(x = x, y = y, color = mark)) + facet_grid("cell~id") + geom_path()
qgr = subset(query_gr, id %in% qid)
names(qgr) = qgr$id
qgr = resize(qgr, 30000, fix = "c... |
rsplit <- function(data, in_id, out_id) {
if (!is.data.frame(data) & !is.matrix(data)) {
rlang::abort("`data` must be a data frame.")
}
if (!is.integer(in_id) | any(in_id < 1)) {
rlang::abort("`in_id` must be a positive integer vector.")
}
if (!all(is.na(out_id))) {
if (!is.integer(out_id) | any... | /R/rsplit.R | permissive | tidymodels/rsample | R | false | false | 5,012 | r | rsplit <- function(data, in_id, out_id) {
if (!is.data.frame(data) & !is.matrix(data)) {
rlang::abort("`data` must be a data frame.")
}
if (!is.integer(in_id) | any(in_id < 1)) {
rlang::abort("`in_id` must be a positive integer vector.")
}
if (!all(is.na(out_id))) {
if (!is.integer(out_id) | any... |
myTitanic <- function(){
myData <-read.csv(file="/Users/KarthikMaharajan/Documents/Fall 2015/Introduction to Data Mining/Project 2/Indiviudal Project II_datasets/titanic.csv", header=TRUE, sep=",")
str(myData)
library(caret)
library(arules)
set.seed(4139)
#Printing all of the rules
rules <- apriori(myData... | /41984439asso.R | no_license | KarthikMaharajan/DataMining-Association | R | false | false | 3,091 | r | myTitanic <- function(){
myData <-read.csv(file="/Users/KarthikMaharajan/Documents/Fall 2015/Introduction to Data Mining/Project 2/Indiviudal Project II_datasets/titanic.csv", header=TRUE, sep=",")
str(myData)
library(caret)
library(arules)
set.seed(4139)
#Printing all of the rules
rules <- apriori(myData... |
#' generate_incidence_matrix is a function that returns a matrix of probabilities of infection accross indicated ranges of age and time
#'
#' @param age_step numeric, indicates time at which the incidence rate is desired
#' @param birth_dates ?
#' @param generate_incidence a user defined or package default function wh... | /code/functions/generate_incidence_matrix.R | no_license | andm2010/seams_survey_simulation | R | false | false | 1,296 | r | #' generate_incidence_matrix is a function that returns a matrix of probabilities of infection accross indicated ranges of age and time
#'
#' @param age_step numeric, indicates time at which the incidence rate is desired
#' @param birth_dates ?
#' @param generate_incidence a user defined or package default function wh... |
\name{run_bias_ss3}
\alias{run_bias_ss3}
\title{Determine level of bias adjustment for SS runs}
\usage{
run_bias_ss3(dir, outdir, nsim)
}
\arguments{
\item{dir}{Folder for all of the bias adjustment runs
(e.g. \code{"M1-F1-D1-R1-cod/bias"} which must contain
numbered folders for the \code{nsim} runs, e.g.
\co... | /man/run_bias_ss3.Rd | no_license | Kotkot/ss3sim | R | false | false | 1,886 | rd | \name{run_bias_ss3}
\alias{run_bias_ss3}
\title{Determine level of bias adjustment for SS runs}
\usage{
run_bias_ss3(dir, outdir, nsim)
}
\arguments{
\item{dir}{Folder for all of the bias adjustment runs
(e.g. \code{"M1-F1-D1-R1-cod/bias"} which must contain
numbered folders for the \code{nsim} runs, e.g.
\co... |
# ---------------------------- Deep Learning - Neural Network ---------------- #
#' Build a Deep Neural Network
#'
#' Builds a feed-forward multilayer artificial neural network on an H2OFrame
#'
#' @param x A vector containing the \code{character} names of the predictors in the model.
#' @param y The name of the respon... | /h2o-r/h2o-package/R/deeplearning.R | permissive | qbektrix/h2o-3 | R | false | false | 24,488 | r | # ---------------------------- Deep Learning - Neural Network ---------------- #
#' Build a Deep Neural Network
#'
#' Builds a feed-forward multilayer artificial neural network on an H2OFrame
#'
#' @param x A vector containing the \code{character} names of the predictors in the model.
#' @param y The name of the respon... |
getEquityLine <- function(quotes,
weightsList,
proportionalCost,
initialEquity,
DFL){
# Calculate initial observations of equity lines.
equityLine <-
quotes %>%
filter(Date < names(weightsList)[1]... | /funs/fun-getEquityLine2.R | permissive | pawelsakowski/fintech2020 | R | false | false | 3,579 | r | getEquityLine <- function(quotes,
weightsList,
proportionalCost,
initialEquity,
DFL){
# Calculate initial observations of equity lines.
equityLine <-
quotes %>%
filter(Date < names(weightsList)[1]... |
source("usefulRfunctions.R")
##################################
# E3.1
##################################
ci <- c(3003, 3005, 2997, 3006, 2999, 2998, 3007, 3005, 3001)
µ <- 3000
## a)
mean(ci)
sd(ci)
stdErrorOfMean(ci)
## b)
#Y5 ~ N(15000, 6.708)
xMean <- 15000
xStdDiv <- 6.708
x <- 15010 #15m ± 1cm ... | /week4.R | no_license | ThorMortensen/stat2017 | R | false | false | 955 | r | source("usefulRfunctions.R")
##################################
# E3.1
##################################
ci <- c(3003, 3005, 2997, 3006, 2999, 2998, 3007, 3005, 3001)
µ <- 3000
## a)
mean(ci)
sd(ci)
stdErrorOfMean(ci)
## b)
#Y5 ~ N(15000, 6.708)
xMean <- 15000
xStdDiv <- 6.708
x <- 15010 #15m ± 1cm ... |
server <- function(input, output) {
theme_set(
theme_fivethirtyeight(base_size=15)
)
stemi <- callModule(stemi, "stemi", ambco)
cardiacArrest <- callModule(cardiacArrest, "cardiacArrest", ambco)
callOutcomes <- callModule(callOutcomes, "callOutcomes", ambsys)
responseTimes <- callModule(responseTimes... | /app/server.R | no_license | bairdj/ambstat | R | false | false | 408 | r | server <- function(input, output) {
theme_set(
theme_fivethirtyeight(base_size=15)
)
stemi <- callModule(stemi, "stemi", ambco)
cardiacArrest <- callModule(cardiacArrest, "cardiacArrest", ambco)
callOutcomes <- callModule(callOutcomes, "callOutcomes", ambsys)
responseTimes <- callModule(responseTimes... |
# Title : TODO
# Objective : TODO
# Created by: KIIT
# Created on: 04-08-2020
n <- readline("enter a value")
cat("data type is",class(n))
| /lab2/Q13.R | no_license | listerys/R-Lab-Kiit | R | false | false | 143 | r | # Title : TODO
# Objective : TODO
# Created by: KIIT
# Created on: 04-08-2020
n <- readline("enter a value")
cat("data type is",class(n))
|
#计算cars.naNA的基本统计特性
Boston.mean <- sapply(Boston, mean)
Boston.sd <- sapply(Boston, sd)
Boston.min <- sapply(Boston, min)
Boston.max <- sapply(Boston, max)
Boston.median <- sapply(Boston, median)
Boston.uncertainty <- uncertaintyFunc2(Boston)
Boston.summary <- data.frame(mean=Boston.mean, sd=Boston.sd, min=Boston.min, ... | /Boston_data_process.R | no_license | zhaoyang1221/uncertainty | R | false | false | 1,122 | r | #计算cars.naNA的基本统计特性
Boston.mean <- sapply(Boston, mean)
Boston.sd <- sapply(Boston, sd)
Boston.min <- sapply(Boston, min)
Boston.max <- sapply(Boston, max)
Boston.median <- sapply(Boston, median)
Boston.uncertainty <- uncertaintyFunc2(Boston)
Boston.summary <- data.frame(mean=Boston.mean, sd=Boston.sd, min=Boston.min, ... |
`subjects.latinsquare.fnc` <-
function(dat) {
subjects = unique(dat[ ,c("Group", "Subject", "SOA", "List")])
subjects = subjects[order(subjects$Subject, subjects$List), ]
if ("RT" %in% colnames(dat)) {
subjects$MeanRT = as.vector(t(tapply(dat$RT,
list(dat$Subject, dat$List), mean)))
} else {
subj... | /R/subjects.latinsquare.fnc.R | no_license | cran/languageR | R | false | false | 693 | r | `subjects.latinsquare.fnc` <-
function(dat) {
subjects = unique(dat[ ,c("Group", "Subject", "SOA", "List")])
subjects = subjects[order(subjects$Subject, subjects$List), ]
if ("RT" %in% colnames(dat)) {
subjects$MeanRT = as.vector(t(tapply(dat$RT,
list(dat$Subject, dat$List), mean)))
} else {
subj... |
# load packages
# load dataset
data(iris)
head(iris)
# Univariate approach to outliers, uses IQR.
outlier_values_SL <- boxplot.stats(iris$Sepal.Length)$out # outlier values.
boxplot(iris$Sepal.Length, main="Sepal Length", boxwex=0.1)
mtext(paste("Outliers: ", paste(outlier_values, collapse=", ")), cex=0.6)
# o... | /04.01.18 - Outliers/outliers.R | no_license | Ogweno/SynopticSignals | R | false | false | 2,624 | r | # load packages
# load dataset
data(iris)
head(iris)
# Univariate approach to outliers, uses IQR.
outlier_values_SL <- boxplot.stats(iris$Sepal.Length)$out # outlier values.
boxplot(iris$Sepal.Length, main="Sepal Length", boxwex=0.1)
mtext(paste("Outliers: ", paste(outlier_values, collapse=", ")), cex=0.6)
# o... |
## Support Vector Machines
## author : alexandros karatzoglou
## updated : 08.02.06
setGeneric("ksvm", function(x, ...) standardGeneric("ksvm"))
setMethod("ksvm",signature(x="formula"),
function (x, data=NULL, ..., subset, na.action = na.omit, scaled = TRUE){
cl <- match.call()
m <- match.call(expand.dots = FALSE)... | /R/ksvm.R | no_license | mb706/kernlab | R | false | false | 119,480 | r | ## Support Vector Machines
## author : alexandros karatzoglou
## updated : 08.02.06
setGeneric("ksvm", function(x, ...) standardGeneric("ksvm"))
setMethod("ksvm",signature(x="formula"),
function (x, data=NULL, ..., subset, na.action = na.omit, scaled = TRUE){
cl <- match.call()
m <- match.call(expand.dots = FALSE)... |
# library(RNeo4j)
#
# graph = startGraph("http://localhost:7474/db/data/")
#
# #alice = createNode(graph, "Person", name="Alice")
# #bob = createNode(graph, "Person", name="Bob")
#
# #createRel(alice, "KNOWS", bob, since=2001)
# query="match n return n.name limit 25"
# st=cypher(graph,query)
# print (st)
install.pac... | /tweetdata/twitterneo4j.R | no_license | MadhuCheemala/MLREFERENCES | R | false | false | 4,847 | r | # library(RNeo4j)
#
# graph = startGraph("http://localhost:7474/db/data/")
#
# #alice = createNode(graph, "Person", name="Alice")
# #bob = createNode(graph, "Person", name="Bob")
#
# #createRel(alice, "KNOWS", bob, since=2001)
# query="match n return n.name limit 25"
# st=cypher(graph,query)
# print (st)
install.pac... |
### ------------------------------------------------------------------------ ###
### Aggregate actual yields at buffer zone level ###
### ------------------------------------------------------------------------ ###
library(rgygaGIS)
library(tidyverse)
library(sf)
### Load data ------------... | /scripts/actual-yields/4_aggregate_ya.R | no_license | jvasco323/GYGA_Wheat_Egypt | R | false | false | 1,561 | r | ### ------------------------------------------------------------------------ ###
### Aggregate actual yields at buffer zone level ###
### ------------------------------------------------------------------------ ###
library(rgygaGIS)
library(tidyverse)
library(sf)
### Load data ------------... |
# functions related with roles
#' Add a new role
#'
#' @param id Role id
#' @param type Role type
#' @param organisation Organisation
#' @param group Group
#' @param permissions A vector of of permissions
#'
#' @export
put_role <- function(id, type, organisation, group, permissions) {
if (length(group) != 1) {
... | /R/roles.R | permissive | csiro-crop-informatics/rsenaps | R | false | false | 2,456 | r |
# functions related with roles
#' Add a new role
#'
#' @param id Role id
#' @param type Role type
#' @param organisation Organisation
#' @param group Group
#' @param permissions A vector of of permissions
#'
#' @export
put_role <- function(id, type, organisation, group, permissions) {
if (length(group) != 1) {
... |
#
# Copyright 2007-2018 The OpenMx Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | /SilveR/R-3.5.1/library/OpenMx/models/passing/IntroSEM-UnivariateStd.R | permissive | kevinmiles/SilveR | R | false | false | 2,417 | r | #
# Copyright 2007-2018 The OpenMx Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
##Task 2.2
#by Jed Isom
#Week of September 13th, 2015
#import the applicable JSON files
library("pacman")
pacman::p_load(jsonlite, tm, topicmodels, slam)
#jsonlite for JSON file loading
#tm and topicmodels for LDA topic modeling
rm(list=ls())
json.file <- "yelp_academic_dataset_business.JSON"
#took this ... | /Task 2.2.R | permissive | jedisom/Yelp-projects | R | false | false | 11,057 | r | ##Task 2.2
#by Jed Isom
#Week of September 13th, 2015
#import the applicable JSON files
library("pacman")
pacman::p_load(jsonlite, tm, topicmodels, slam)
#jsonlite for JSON file loading
#tm and topicmodels for LDA topic modeling
rm(list=ls())
json.file <- "yelp_academic_dataset_business.JSON"
#took this ... |
#!/usr/bin/env Rscript
#
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | /lib/node_modules/@stdlib/stats/chi2test/test/fixtures/r/runner.R | permissive | jroell/stdlib | R | false | false | 3,061 | r | #!/usr/bin/env Rscript
#
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... |
library(httr)
library(rvest)
library(reticulate)
library(htmltidy)
library(purrr)
# installation may require KTHVPN be turned off temporarily
#conda_create("r-reticulate")
#conda_install("r-reticulate", "langdetect")
#use_condaenv("r-reticulate")
# create a function that wraps the "langdetect" python call
detect_lang... | /webapis/rewrite_plang.R | no_license | KTH-Library/KTH-Library.github.io | R | false | false | 1,601 | r | library(httr)
library(rvest)
library(reticulate)
library(htmltidy)
library(purrr)
# installation may require KTHVPN be turned off temporarily
#conda_create("r-reticulate")
#conda_install("r-reticulate", "langdetect")
#use_condaenv("r-reticulate")
# create a function that wraps the "langdetect" python call
detect_lang... |
#' Get dataframe of bikeshare feeds and URLs
#'
#' @param url url of feeds json, has default
#' @param lang which language, defaults to english, "en"
#'
#' @return A dataframe of feed names and URLs
#' @export
#'
#' @examples
#' if (interactive()) {
#' feeds_urls()
#' }
feeds_urls <- function(url = "https://gbfs.capi... | /pkg/R/helper_funcs.R | permissive | weisisheng/bike_predict | R | false | false | 6,151 | r | #' Get dataframe of bikeshare feeds and URLs
#'
#' @param url url of feeds json, has default
#' @param lang which language, defaults to english, "en"
#'
#' @return A dataframe of feed names and URLs
#' @export
#'
#' @examples
#' if (interactive()) {
#' feeds_urls()
#' }
feeds_urls <- function(url = "https://gbfs.capi... |
testlist <- list(Beta = 0, CVLinf = 86341236051411296, FM = 1.53632495265886e-311, L50 = 0, L95 = 0, LenBins = c(2.0975686864138e+162, -2.68131210337361e-144, -1.11215735981244e+199, -4.48649879577108e+143, 1.6611802228813e+218, 900371.947279558, 1.07063092954708e+238, 2.88003257377011e-142, 1.29554... | /DLMtool/inst/testfiles/LBSPRgen/AFL_LBSPRgen/LBSPRgen_valgrind_files/1615833781-test.R | no_license | akhikolla/updatedatatype-list2 | R | false | false | 2,048 | r | testlist <- list(Beta = 0, CVLinf = 86341236051411296, FM = 1.53632495265886e-311, L50 = 0, L95 = 0, LenBins = c(2.0975686864138e+162, -2.68131210337361e-144, -1.11215735981244e+199, -4.48649879577108e+143, 1.6611802228813e+218, 900371.947279558, 1.07063092954708e+238, 2.88003257377011e-142, 1.29554... |
stop("Don't source this document")
# readVars parameter abbreviations ----
urls <- selectDWD("Potsdam","","","")
urls <- urls[! (grepl("1*_minute", urls) & !grepl("meta_data", urls)) ]
files <- dataDWD(urls, dir=localtestdir(), read=F)
rv <- readVars(files)
str(rv, max.level=1)
k <- unlist(lapply(rv, function(... | /localtests/developmentNotes.R | no_license | aadler/rdwd | R | false | false | 7,643 | r |
stop("Don't source this document")
# readVars parameter abbreviations ----
urls <- selectDWD("Potsdam","","","")
urls <- urls[! (grepl("1*_minute", urls) & !grepl("meta_data", urls)) ]
files <- dataDWD(urls, dir=localtestdir(), read=F)
rv <- readVars(files)
str(rv, max.level=1)
k <- unlist(lapply(rv, function(... |
# if (.Platform$OS.type == "windows") setwd("~/../Dropbox/teaching/time-series/src")
# source('./utils.R')
source(url("https://www.dropbox.com/s/hjfrdv8ljnn6sc4/utils.R?dl=1"))
# big labels for lecture slides only
theme_set(theme_grey(base_size=18))
options(stringsAsFactors = FALSE)
# === Temperature in Chi... | /lec1.R | no_license | cyrussafaie/TimeSeries | R | false | false | 7,540 | r | # if (.Platform$OS.type == "windows") setwd("~/../Dropbox/teaching/time-series/src")
# source('./utils.R')
source(url("https://www.dropbox.com/s/hjfrdv8ljnn6sc4/utils.R?dl=1"))
# big labels for lecture slides only
theme_set(theme_grey(base_size=18))
options(stringsAsFactors = FALSE)
# === Temperature in Chi... |
testlist <- list(type = 3670017L, z = 2.28135767163908e-310)
result <- do.call(esreg::G1_fun,testlist)
str(result) | /esreg/inst/testfiles/G1_fun/libFuzzer_G1_fun/G1_fun_valgrind_files/1609892535-test.R | no_license | akhikolla/updated-only-Issues | R | false | false | 114 | r | testlist <- list(type = 3670017L, z = 2.28135767163908e-310)
result <- do.call(esreg::G1_fun,testlist)
str(result) |
library(bigsnpr)
args <- commandArgs(trailingOnly = TRUE)
# the folder hosts data for a expanded variant set
vars_sele_folder = as.character(args[1])
# trait id
trait = as.character(args[2])
print(paste0("Start working with variant set:", vars_sele_folder,' , Trait:',trait,' -- ' ,Sys.time()))
# read summary s... | /Updated_Methods/LDpred2_genome_wide.R | no_license | xuyu-cam/PGS-BC-Traits-Using-ML-DL | R | false | false | 6,051 | r | library(bigsnpr)
args <- commandArgs(trailingOnly = TRUE)
# the folder hosts data for a expanded variant set
vars_sele_folder = as.character(args[1])
# trait id
trait = as.character(args[2])
print(paste0("Start working with variant set:", vars_sele_folder,' , Trait:',trait,' -- ' ,Sys.time()))
# read summary s... |
\name{notify}
\alias{notify}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Sends notification message to OS X notification center or terminal (and rings terminal bell)
}
\description{
%% ~~ A concise (1-5 lines) description of what the function does. ~~
}
\usage{
notify(msg)
}
%- maybe also 'u... | /man/notify.Rd | no_license | hedderik/hvR | R | false | false | 1,534 | rd | \name{notify}
\alias{notify}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Sends notification message to OS X notification center or terminal (and rings terminal bell)
}
\description{
%% ~~ A concise (1-5 lines) description of what the function does. ~~
}
\usage{
notify(msg)
}
%- maybe also 'u... |
# Load Data
# USA
SOURCE <- "https://usafactsstatic.blob.core.windows.net/public/data/covid-19/covid_confirmed_usafacts.csv"
Cases_USA <- read.csv(SOURCE, stringsAsFactors = FALSE)
SOURCE <- "https://usafactsstatic.blob.core.windows.net/public/data/covid-19/covid_deaths_usafacts.csv"
Deaths_USA <- read.csv(SOURCE,... | /ImportCovidData.R | permissive | hugoavmedeiros/COVID19 | R | false | false | 9,724 | r | # Load Data
# USA
SOURCE <- "https://usafactsstatic.blob.core.windows.net/public/data/covid-19/covid_confirmed_usafacts.csv"
Cases_USA <- read.csv(SOURCE, stringsAsFactors = FALSE)
SOURCE <- "https://usafactsstatic.blob.core.windows.net/public/data/covid-19/covid_deaths_usafacts.csv"
Deaths_USA <- read.csv(SOURCE,... |
library(data.table)
library("rjson")
clean_actual <- function(datadir) {
df_actual <- read.table(file=datadir, sep=',', skip=1)
names(df_actual)[names(df_actual) == "V1"] <- "patient"
names(df_actual)[names(df_actual) == "V2"] <- "cancer"
return(df_actual)
}
clean_independent <- function(datadir) {
df_inde... | /projects/project_63/src/cleaning/golubCleaning.R | no_license | amuamushu/projects-2020-2021 | R | false | false | 3,552 | r | library(data.table)
library("rjson")
clean_actual <- function(datadir) {
df_actual <- read.table(file=datadir, sep=',', skip=1)
names(df_actual)[names(df_actual) == "V1"] <- "patient"
names(df_actual)[names(df_actual) == "V2"] <- "cancer"
return(df_actual)
}
clean_independent <- function(datadir) {
df_inde... |
# The original WinBUGS code gave "undefined real result" -- the JAGS equivalent does work,
# and the WinBUGS also works when called from Matlab. Alexander Ly discovered that the
# censoring on node delta does not work using the I(,0) operator; hence the
# trick, implemented in OneSampleOrderRestricted_AL.txt, to m... | /R/BCM_book/ModelSelection/Means/OneSampleOrderRestricted.R | no_license | wmmurrah/BayesianAnalysis | R | false | false | 3,814 | r | # The original WinBUGS code gave "undefined real result" -- the JAGS equivalent does work,
# and the WinBUGS also works when called from Matlab. Alexander Ly discovered that the
# censoring on node delta does not work using the I(,0) operator; hence the
# trick, implemented in OneSampleOrderRestricted_AL.txt, to m... |
data(iris)
normalize <- function(x){
return ((x - min(x)) / (max(x) - min(x)))
}
iris_norm <- as.data.frame(lapply(iris[1:4], normalize))
summary(iris_norm)
set.seed(1234)
ind <- sample(2, nrow(iris_norm), replace=TRUE, prob=c(0.67, 0.33))
iris.training <- iris_norm[ind==1, 1:4]
iris.test <- iris_norm[ind==2, 1:... | /scripts/ExemploKnn.R | no_license | fbarth/ExerciciosPosMackenzie | R | false | false | 841 | r | data(iris)
normalize <- function(x){
return ((x - min(x)) / (max(x) - min(x)))
}
iris_norm <- as.data.frame(lapply(iris[1:4], normalize))
summary(iris_norm)
set.seed(1234)
ind <- sample(2, nrow(iris_norm), replace=TRUE, prob=c(0.67, 0.33))
iris.training <- iris_norm[ind==1, 1:4]
iris.test <- iris_norm[ind==2, 1:... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/http.R
\name{http_head}
\alias{http_head}
\title{Asynchronous HTTP HEAD request}
\usage{
http_head(url, headers = character(), file = NULL, options = list(timeout
= 600), on_progress = NULL)
}
\arguments{
\item{url}{URL to connect to.}
\it... | /man/http_head.Rd | permissive | behnido/async | R | false | true | 1,262 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/http.R
\name{http_head}
\alias{http_head}
\title{Asynchronous HTTP HEAD request}
\usage{
http_head(url, headers = character(), file = NULL, options = list(timeout
= 600), on_progress = NULL)
}
\arguments{
\item{url}{URL to connect to.}
\it... |
library(testthat)
library(tlmixture)
library(ggplot2)
# Create a simple simulated dataset.
samples = 100L
means = 0:3
sigma = diag(1:4)
# Add correlation between 1 and 3
sigma[1, 3] = sigma[3, 1] = 0.2
# And between 2 and 4.
sigma[2, 4] = sigma[4, 2] = 0.1
sigma
set.seed(1, "L'Ecuyer-CMRG")
adjustment = data.frame(... | /tests/testthat/test-exposure-groups.R | permissive | ck37/tlmixture | R | false | false | 5,078 | r | library(testthat)
library(tlmixture)
library(ggplot2)
# Create a simple simulated dataset.
samples = 100L
means = 0:3
sigma = diag(1:4)
# Add correlation between 1 and 3
sigma[1, 3] = sigma[3, 1] = 0.2
# And between 2 and 4.
sigma[2, 4] = sigma[4, 2] = 0.1
sigma
set.seed(1, "L'Ecuyer-CMRG")
adjustment = data.frame(... |
# setwd("https://github.com/Sean-Case/WisconsinElection2016")
library(XML); require(rvest); require(stringr);require(xlsx);require(dplyr);require(plyr)
require(agricolae); require(ggplot2); library(gridExtra); library(tidyr); require(corrplot);
require(reshape2); require(janitor); require(nlme); require(car); require(e... | /Rep unit prep 08-06-19.R | no_license | Sean-Case/WisconsinElection2016 | R | false | false | 910,877 | r | # setwd("https://github.com/Sean-Case/WisconsinElection2016")
library(XML); require(rvest); require(stringr);require(xlsx);require(dplyr);require(plyr)
require(agricolae); require(ggplot2); library(gridExtra); library(tidyr); require(corrplot);
require(reshape2); require(janitor); require(nlme); require(car); require(e... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/defaults.R
\docType{data}
\name{tex_opts}
\alias{tex_opts}
\alias{tex_opts_current}
\title{Default and current tex options}
\format{An object of class \code{list} of length 5.}
\usage{
tex_opts
tex_opts_current
}
\description{
Options for fu... | /man/tex_opts.Rd | no_license | kashenfelter/texPreview | R | false | true | 1,521 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/defaults.R
\docType{data}
\name{tex_opts}
\alias{tex_opts}
\alias{tex_opts_current}
\title{Default and current tex options}
\format{An object of class \code{list} of length 5.}
\usage{
tex_opts
tex_opts_current
}
\description{
Options for fu... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/date.functions.R
\name{mixed_freq_data_single}
\alias{mixed_freq_data_single}
\title{MIDAS data structure}
\usage{
mixed_freq_data_single(data.refdate, data.x, data.xdate, x.lag, horizon,
est.start, est.end, disp.flag = TRUE)
}
\arguments{
... | /man/mixed_freq_data_single.Rd | no_license | ababii/midasml | R | false | true | 1,528 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/date.functions.R
\name{mixed_freq_data_single}
\alias{mixed_freq_data_single}
\title{MIDAS data structure}
\usage{
mixed_freq_data_single(data.refdate, data.x, data.xdate, x.lag, horizon,
est.start, est.end, disp.flag = TRUE)
}
\arguments{
... |
## FUNCTIONS from diversitree 0.9-4: commit ec08b1d2bd from 06-22-2012 @ 'https://github.com/richfitz/diversitree'
.drop.tip=function(phy, tip, trim.internal = TRUE, subtree = FALSE, root.edge = 0, rooted = is.rooted(phy)){
if(missing(tip)) return(phy)
if (is.character(tip)) tip <- which(phy$tip.labe... | /R/diversitree.R | no_license | mwpennell/geiger-v2 | R | false | false | 28,987 | r |
## FUNCTIONS from diversitree 0.9-4: commit ec08b1d2bd from 06-22-2012 @ 'https://github.com/richfitz/diversitree'
.drop.tip=function(phy, tip, trim.internal = TRUE, subtree = FALSE, root.edge = 0, rooted = is.rooted(phy)){
if(missing(tip)) return(phy)
if (is.character(tip)) tip <- which(phy$tip.labe... |
## Need to load "SQLDF" library as its members are used in data extraction
## This is done to only select the needed dat and not load all data into
## computer memory.
## To Run this program, you must have the following packages installed:
## gsubfn
## proto
## RSQLite
## DBI
## RSQLite.extfuns
## tcltk
library(sq... | /plot3.R | no_license | ObiomaKI/ExData_Plotting1 | R | false | false | 2,235 | r | ## Need to load "SQLDF" library as its members are used in data extraction
## This is done to only select the needed dat and not load all data into
## computer memory.
## To Run this program, you must have the following packages installed:
## gsubfn
## proto
## RSQLite
## DBI
## RSQLite.extfuns
## tcltk
library(sq... |
testlist <- list(A = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 1.22810536108214e+146, 4.10505121737775e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(5L, 7L)), B = structure(0, .Dim = c(1L, 1L)))
result <- do.call(multivariance:::match_row... | /multivariance/inst/testfiles/match_rows/AFL_match_rows/match_rows_valgrind_files/1613100474-test.R | no_license | akhikolla/updatedatatype-list3 | R | false | false | 343 | r | testlist <- list(A = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 1.22810536108214e+146, 4.10505121737775e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(5L, 7L)), B = structure(0, .Dim = c(1L, 1L)))
result <- do.call(multivariance:::match_row... |
# Read from Consul --------------------------------------------------------
#' Obtain Key / Value from Consul
#' @description See https://www.consul.io/ for more about Consul.
#'
#' @param key Key name to retrieve
#' @param path Path name to retrieve
#' @param ... One or many keys under path to retrieve.
#' All but pa... | /R/utils.R | permissive | stevenmc86/dkbi | R | false | false | 6,668 | r | # Read from Consul --------------------------------------------------------
#' Obtain Key / Value from Consul
#' @description See https://www.consul.io/ for more about Consul.
#'
#' @param key Key name to retrieve
#' @param path Path name to retrieve
#' @param ... One or many keys under path to retrieve.
#' All but pa... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data_check.R
\name{eem_checksize}
\alias{eem_checksize}
\title{Check size of EEMs}
\usage{
eem_checksize(eem_list)
}
\arguments{
\item{eem_list}{eemlist}
}
\value{
character vector
}
\description{
The size of EEMs in an eemlist is checked and... | /man/eem_checksize.Rd | no_license | MatthiasPucher/staRdom | R | false | true | 472 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data_check.R
\name{eem_checksize}
\alias{eem_checksize}
\title{Check size of EEMs}
\usage{
eem_checksize(eem_list)
}
\arguments{
\item{eem_list}{eemlist}
}
\value{
character vector
}
\description{
The size of EEMs in an eemlist is checked and... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/afni_functions.R
\name{run_afni_command}
\alias{run_afni_command}
\title{Runs afni command.}
\usage{
run_afni_command(afni_cmd)
}
\arguments{
\item{afni_cmd}{}
}
\value{
NA
}
\description{
Runs afni command.
}
| /man/run_afni_command.Rd | permissive | willi3by/niiMLr | R | false | true | 288 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/afni_functions.R
\name{run_afni_command}
\alias{run_afni_command}
\title{Runs afni command.}
\usage{
run_afni_command(afni_cmd)
}
\arguments{
\item{afni_cmd}{}
}
\value{
NA
}
\description{
Runs afni command.
}
|
### reliability
# 1. data
Q <- data.frame(
Q1=c(1,4,2,3,4,2,3,4,3,2),
Q2=c(2,4,1,2,4,1,2,5,2,1),
Q3=c(2,5,1,3,3,2,3,4,2,2))
pairs(Q, panel=panel.smooth)
# 2. cronbach : install.packages("psy") / alpha ()
library(psy)
cronbach(Q)
library(psych)
a <- alpha(Q)
str(a)
a$total
View(a$scores)
| /sta_alpha.R | no_license | plus4u/R | R | false | false | 315 | r | ### reliability
# 1. data
Q <- data.frame(
Q1=c(1,4,2,3,4,2,3,4,3,2),
Q2=c(2,4,1,2,4,1,2,5,2,1),
Q3=c(2,5,1,3,3,2,3,4,2,2))
pairs(Q, panel=panel.smooth)
# 2. cronbach : install.packages("psy") / alpha ()
library(psy)
cronbach(Q)
library(psych)
a <- alpha(Q)
str(a)
a$total
View(a$scores)
|
testlist <- list(b = c(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), p1 = c(8.5728629954997e-312, 1.56898424065867e+82, 8.96970809549085e-158, -1.3258495253834e-113, 2.79620616433656e-119, -6.80033518839696e+41, 2.68308675779633e-211, 1444042902784.06, ... | /metacoder/inst/testfiles/intersect_line_rectangle/AFL_intersect_line_rectangle/intersect_line_rectangle_valgrind_files/1615769568-test.R | permissive | akhikolla/updatedatatype-list3 | R | false | false | 727 | r | testlist <- list(b = c(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), p1 = c(8.5728629954997e-312, 1.56898424065867e+82, 8.96970809549085e-158, -1.3258495253834e-113, 2.79620616433656e-119, -6.80033518839696e+41, 2.68308675779633e-211, 1444042902784.06, ... |
library(dplyr)
source('R/life_table_functions.R')
mid.year.pop <- read.csv('Data/mid_year_pop_est.csv')
deaths <- read.csv('Data/extrapolated_deaths_2020.csv')
states <- unique(mid.year.pop$State)
age.cohort <- unique(mid.year.pop$Age.Cohort)
gender <- unique(mid.year.pop$Gender)
n <- n <- c(1, 4, rep(10... | /R/life_expectancy_est.R | no_license | MEDICI-UWO/Impact-of-COVID-19-on-the-US | R | false | false | 1,075 | r | library(dplyr)
source('R/life_table_functions.R')
mid.year.pop <- read.csv('Data/mid_year_pop_est.csv')
deaths <- read.csv('Data/extrapolated_deaths_2020.csv')
states <- unique(mid.year.pop$State)
age.cohort <- unique(mid.year.pop$Age.Cohort)
gender <- unique(mid.year.pop$Gender)
n <- n <- c(1, 4, rep(10... |
########################################################################################
# First batch of data:
firstlot <- read.table("../../real_20160208/analysis/sample_metadata.txt", header=TRUE, sep ="\t")
firstlot <- firstlot[,c(1,7)]
lib.num <- firstlot$Library
exp.num <- sub(".*exp", "\\1", firstlot$Individua... | /data/combine_metadata.R | no_license | MarioniLab/LOFMethods2016 | R | false | false | 8,470 | r | ########################################################################################
# First batch of data:
firstlot <- read.table("../../real_20160208/analysis/sample_metadata.txt", header=TRUE, sep ="\t")
firstlot <- firstlot[,c(1,7)]
lib.num <- firstlot$Library
exp.num <- sub(".*exp", "\\1", firstlot$Individua... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/EPFR.r
\name{sql.1dActWtTrend.Final}
\alias{sql.1dActWtTrend.Final}
\title{sql.1dActWtTrend.Final}
\usage{
sql.1dActWtTrend.Final(x, y, n)
}
\arguments{
\item{x}{= temp table name (#CTRY/#SEC)}
\item{y}{= factor (one of ActWtTrend/ActWtDiff/... | /man/sql.1dActWtTrend.Final.Rd | no_license | vsrimurthy/EPFR | R | false | true | 4,940 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/EPFR.r
\name{sql.1dActWtTrend.Final}
\alias{sql.1dActWtTrend.Final}
\title{sql.1dActWtTrend.Final}
\usage{
sql.1dActWtTrend.Final(x, y, n)
}
\arguments{
\item{x}{= temp table name (#CTRY/#SEC)}
\item{y}{= factor (one of ActWtTrend/ActWtDiff/... |
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 1.22810535952715e+146, 4.12396251261199e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(5L, 7L)))
result <- do.call(CNull:::communities_individual_... | /CNull/inst/testfiles/communities_individual_based_sampling_alpha/AFL_communities_individual_based_sampling_alpha/communities_individual_based_sampling_alpha_valgrind_files/1615776748-test.R | no_license | akhikolla/updatedatatype-list2 | R | false | false | 362 | r | testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 1.22810535952715e+146, 4.12396251261199e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(5L, 7L)))
result <- do.call(CNull:::communities_individual_... |
# load packages -----------------------------------------------------------
library(tidyverse)
library(scales)
library(ambient)
library(here)
# typical helper functions ------------------------------------------------
sample_shades <- function(n) {
sample(colours(distinct = FALSE), n)
}
blend_shades <- function... | /source/perlin_circle_17.R | no_license | djnavarro/perlin-circles | R | false | false | 3,584 | r |
# load packages -----------------------------------------------------------
library(tidyverse)
library(scales)
library(ambient)
library(here)
# typical helper functions ------------------------------------------------
sample_shades <- function(n) {
sample(colours(distinct = FALSE), n)
}
blend_shades <- function... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/all-methods.R
\docType{methods}
\name{[,Data,missing,numeric,missing-method}
\alias{[,Data,missing,numeric,missing-method}
\title{Subsetting \code{Data} class.}
\usage{
\S4method{[}{Data,missing,numeric,missing}(x, i, j, ..., drop = TRUE)
}
\... | /man/sub-Data-missing-numeric-missing-method.Rd | no_license | dataning/ropenfda | R | false | true | 3,113 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/all-methods.R
\docType{methods}
\name{[,Data,missing,numeric,missing-method}
\alias{[,Data,missing,numeric,missing-method}
\title{Subsetting \code{Data} class.}
\usage{
\S4method{[}{Data,missing,numeric,missing}(x, i, j, ..., drop = TRUE)
}
\... |
#' Make a function dependent to dev mode
#'
#' The function returned will be run only if `golem::app_dev()`
#' returns TRUE.
#'
#' @param fun A function
#'
#' @export
#'
#' @return Used for side-effects
make_dev <- function(fun) {
function(...) {
if (golem::app_dev()) {
fun(...)
}
}
}
`%||%` <- f... | /R/make_dev.R | permissive | ThinkR-open/golem | R | false | false | 1,354 | r | #' Make a function dependent to dev mode
#'
#' The function returned will be run only if `golem::app_dev()`
#' returns TRUE.
#'
#' @param fun A function
#'
#' @export
#'
#' @return Used for side-effects
make_dev <- function(fun) {
function(...) {
if (golem::app_dev()) {
fun(...)
}
}
}
`%||%` <- f... |
## The functions below help to caching the inverse of a matrix rather than compute it repeatedly.
##
## Example:
## > test_matrix_a <- matrix(1:4, 2, 2)
## > cache_matrix_a <- makeCacheMatrix(test_matrix_a)
## > ## call the FIRST time - do a real computation!
## > cacheSolve(cache_matrix_a)
## [,1] [,2]
## [1,] ... | /cachematrix.R | no_license | tsumel/ProgrammingAssignment2 | R | false | false | 2,236 | r | ## The functions below help to caching the inverse of a matrix rather than compute it repeatedly.
##
## Example:
## > test_matrix_a <- matrix(1:4, 2, 2)
## > cache_matrix_a <- makeCacheMatrix(test_matrix_a)
## > ## call the FIRST time - do a real computation!
## > cacheSolve(cache_matrix_a)
## [,1] [,2]
## [1,] ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ResistanceGA.R
\docType{data}
\name{Dc_list}
\alias{Dc_list}
\title{Data file. A list of three matrices}
\format{A list of length 3}
\usage{
data(Dc_list)
}
\description{
Sample file to be used with examples in the vignette
}
\details{
Each m... | /man/Dc_list.Rd | no_license | schnappi-wkl/ResistanceGA | R | false | true | 762 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ResistanceGA.R
\docType{data}
\name{Dc_list}
\alias{Dc_list}
\title{Data file. A list of three matrices}
\format{A list of length 3}
\usage{
data(Dc_list)
}
\description{
Sample file to be used with examples in the vignette
}
\details{
Each m... |
library(data.table)
library(ggplot2)
library(ggthemes)
library(readstata13)
library(stringi)
#data_path <- 'F:/STATA/Aggregate/PCS_occ/dta/change/change7015_all.dta'
data_path <- 'F:/STATA/Aggregate/PCS_occ/dta/change/change7015_US.dta'
df <- as.data.table(read.dta13(data_path))
sdf <- df
sdf <- melt(sdf,id='year',va... | /Aggregate-Level/do/3occ_changes_plots.R | no_license | ang-gr/LMP-US-MSA | R | false | false | 1,965 | r | library(data.table)
library(ggplot2)
library(ggthemes)
library(readstata13)
library(stringi)
#data_path <- 'F:/STATA/Aggregate/PCS_occ/dta/change/change7015_all.dta'
data_path <- 'F:/STATA/Aggregate/PCS_occ/dta/change/change7015_US.dta'
df <- as.data.table(read.dta13(data_path))
sdf <- df
sdf <- melt(sdf,id='year',va... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utilities.R
\name{detect_delimeter}
\alias{detect_delimeter}
\title{Get field delimiters of input files}
\usage{
detect_delimeter(
path,
data.files,
os
)
}
\arguments{
\item{path}{(character) Path to files.}
\item{data.files}{(charac... | /man/detect_delimeter.Rd | permissive | earnaud/EMLassemblyline | R | false | true | 655 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utilities.R
\name{detect_delimeter}
\alias{detect_delimeter}
\title{Get field delimiters of input files}
\usage{
detect_delimeter(
path,
data.files,
os
)
}
\arguments{
\item{path}{(character) Path to files.}
\item{data.files}{(charac... |
#http://cran.r-project.org/web/packages/snowfall/vignettes/snowfall.pdf
#####
#OpenMPI http://www.open-mpi.org/
#https://sites.google.com/site/dwhipp/tutorials/installing-open-mpi-on-mac-os-x
#mkdir ~/Code/openmpi
#cd ~/Code/openmpi
#wget http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.5.tar.gz
#ta... | /snowfall.R | no_license | shepner/R_Examples | R | false | false | 2,218 | r | #http://cran.r-project.org/web/packages/snowfall/vignettes/snowfall.pdf
#####
#OpenMPI http://www.open-mpi.org/
#https://sites.google.com/site/dwhipp/tutorials/installing-open-mpi-on-mac-os-x
#mkdir ~/Code/openmpi
#cd ~/Code/openmpi
#wget http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.5.tar.gz
#ta... |
#' Memo clean Function
#'
#' This function splits the MEMO column into MEC1:MEC5
#' @param MEMO, USES.
#' @keywords MEMO
#' @export
#' @examples
#' MEMO()
Memo <- function(MEMO, USES) {
if (requireNamespace("stringr", quietly = TRUE)) {
library(stringr)
}
x2 = tolower(MEMO)
x3 = str_split_fixed(... | /R/Memo.R | no_license | phillipf/Enquiries | R | false | false | 1,162 | r | #' Memo clean Function
#'
#' This function splits the MEMO column into MEC1:MEC5
#' @param MEMO, USES.
#' @keywords MEMO
#' @export
#' @examples
#' MEMO()
Memo <- function(MEMO, USES) {
if (requireNamespace("stringr", quietly = TRUE)) {
library(stringr)
}
x2 = tolower(MEMO)
x3 = str_split_fixed(... |
#' @include metab_model-class.R
NULL
#' Maximum likelihood metabolism model fitting function
#'
#' Fits a model to estimate GPP and ER from input data on DO, temperature,
#' light, etc.
#'
#' @inheritParams metab_model_prototype
#' @inheritParams mm_is_valid_day
#' @return A metab_mle object containing the fitted m... | /R/metab_mle.R | permissive | cyack/streamMetabolizer | R | false | false | 11,344 | r | #' @include metab_model-class.R
NULL
#' Maximum likelihood metabolism model fitting function
#'
#' Fits a model to estimate GPP and ER from input data on DO, temperature,
#' light, etc.
#'
#' @inheritParams metab_model_prototype
#' @inheritParams mm_is_valid_day
#' @return A metab_mle object containing the fitted m... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MESS-package.R
\docType{data}
\name{picea}
\alias{picea}
\title{Ozone concentration damage to picea spruce}
\format{An artificial data frame with 18 observations in each of three groups.
\describe{\item{date}{a character vector giving the dat... | /man/picea.Rd | no_license | minghao2016/MESS | R | false | true | 929 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MESS-package.R
\docType{data}
\name{picea}
\alias{picea}
\title{Ozone concentration damage to picea spruce}
\format{An artificial data frame with 18 observations in each of three groups.
\describe{\item{date}{a character vector giving the dat... |
# Q3
c(rep("A", 10), rep("B", 10))
rep(c("A", "B"), 10)
rbern(20, .5)
rbinom(10, 1, 0.5)
sample(rep(c("A", "B"), 10), replace = FALSE)
# Q4
# data
d.stream <- read.csv("znk.csv", sep = " ", header = TRUE)
# a
str(d.stream)
d.stream$ZINC <- factor(d.stream$ZINC, levels = c("BACK", "LOW", "MED", "HIGH"))
plot(DIVERSITY ... | /Applied-ANOVA/series1.R | no_license | Stanimir-Ivanov/exercise-code | R | false | false | 1,310 | r | # Q3
c(rep("A", 10), rep("B", 10))
rep(c("A", "B"), 10)
rbern(20, .5)
rbinom(10, 1, 0.5)
sample(rep(c("A", "B"), 10), replace = FALSE)
# Q4
# data
d.stream <- read.csv("znk.csv", sep = " ", header = TRUE)
# a
str(d.stream)
d.stream$ZINC <- factor(d.stream$ZINC, levels = c("BACK", "LOW", "MED", "HIGH"))
plot(DIVERSITY ... |
# Program to check if the input year is a leap year or not
year = as.integer(readline(prompt="Enter a year: "))
if((year %% 4) == 0) {
if((year %% 100) == 0) {
if((year %% 400) == 0) {
print(paste(year,"is a leap year"))
} else {
print(paste(year,"is not a leap year"))
}
} else {
print(paste(year,"is a leap year"))
}
}... | /check_leap_year.r | permissive | MarcosFloresta/R_Examples | R | false | false | 369 | r | # Program to check if the input year is a leap year or not
year = as.integer(readline(prompt="Enter a year: "))
if((year %% 4) == 0) {
if((year %% 100) == 0) {
if((year %% 400) == 0) {
print(paste(year,"is a leap year"))
} else {
print(paste(year,"is not a leap year"))
}
} else {
print(paste(year,"is a leap year"))
}
}... |
# Script for analyzing arthropod photo id quiz results
quiz = read.csv('data/quiz_results.csv', header = F, stringsAsFactors = F)
names(quiz) = c('id', 'userID', 'time', 'score', 'possible')
users = read.csv('data/tbl_users.csv', header = F, stringsAsFactors = F)
names(users)[1:2] = c('userID', 'email')
kids = users... | /analysis_scripts/quiz_analysis.r | no_license | hurlbertlab/caterpillars-count-analysis | R | false | false | 1,507 | r | # Script for analyzing arthropod photo id quiz results
quiz = read.csv('data/quiz_results.csv', header = F, stringsAsFactors = F)
names(quiz) = c('id', 'userID', 'time', 'score', 'possible')
users = read.csv('data/tbl_users.csv', header = F, stringsAsFactors = F)
names(users)[1:2] = c('userID', 'email')
kids = users... |
source("4.2_Historical_GLM.R")
# root mean squared error
rmse <- function(pred, obs){
n <- length(pred)
rmse <- sqrt(mean((pred - obs)^2))
return(rmse)
}
## R-squared calculation relative to 1:1 line
r_square_one2one <- function(pred, obs){
obs.mean <- mean(obs)
sum.sq.error <- sum((pred - obs)^2)
diff.ob... | /4.3_Validation_GLM.R | permissive | julbateman/Lil_Aye_Deez_2k19 | R | false | false | 2,450 | r | source("4.2_Historical_GLM.R")
# root mean squared error
rmse <- function(pred, obs){
n <- length(pred)
rmse <- sqrt(mean((pred - obs)^2))
return(rmse)
}
## R-squared calculation relative to 1:1 line
r_square_one2one <- function(pred, obs){
obs.mean <- mean(obs)
sum.sq.error <- sum((pred - obs)^2)
diff.ob... |
% Generated by roxygen2 (4.0.2): do not edit by hand
\name{jstree}
\alias{jstree}
\title{jstree}
\usage{
jstree(id, tree.list)
}
\arguments{
\item{id}{The id used to refer to the jstree}
}
\description{
Creates a jstree
}
| /man/jstree.Rd | no_license | AnalytixWare/shinysky.incubator | R | false | false | 223 | rd | % Generated by roxygen2 (4.0.2): do not edit by hand
\name{jstree}
\alias{jstree}
\title{jstree}
\usage{
jstree(id, tree.list)
}
\arguments{
\item{id}{The id used to refer to the jstree}
}
\description{
Creates a jstree
}
|
#' lmer wrapper to produce HLM7-style output
#'
#' This function is a wrapper for \code{lmer()} to formulate a mixed-effects linear model based on user-supplied variables.
#' In addition to the output from \code{lmer()}, \code{hlmer()} also provides estimates of ICC statistics, random-effect reliability estimates, conf... | /R/hlmer.R | no_license | jadahlke/hlmer | R | false | false | 47,147 | r | #' lmer wrapper to produce HLM7-style output
#'
#' This function is a wrapper for \code{lmer()} to formulate a mixed-effects linear model based on user-supplied variables.
#' In addition to the output from \code{lmer()}, \code{hlmer()} also provides estimates of ICC statistics, random-effect reliability estimates, conf... |
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/ipd.meteESF.R
\name{ipd}
\alias{ipd}
\alias{ipd.meteESF}
\title{Individual Power Distribution}
\usage{
ipd(x, ...)
\method{ipd}{meteESF}(x, ...)
}
\arguments{
\item{x}{an object of class meteESF.}
\item{...}{additiona arguments to b... | /man/ipd.Rd | no_license | cran/meteR | R | false | false | 1,573 | rd | % Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/ipd.meteESF.R
\name{ipd}
\alias{ipd}
\alias{ipd.meteESF}
\title{Individual Power Distribution}
\usage{
ipd(x, ...)
\method{ipd}{meteESF}(x, ...)
}
\arguments{
\item{x}{an object of class meteESF.}
\item{...}{additiona arguments to b... |
/ZeBook/R/lactation.machine.model.r | no_license | ingted/R-Examples | R | false | false | 5,187 | r | ||
## Calculate the inverse of a matrix. Use a cache structure to optimize computations
##
## Construct that stores a matrix and its inverse. If the inverse is not stored NULL is returned
makeCacheMatrix <- function(x = matrix()) {
inv <- NULL
set <- function(y){
x <<- y
inv <<- NULL
}
get <- functio... | /cachematrix.R | no_license | apokalipto/ProgrammingAssignment2 | R | false | false | 800 | r | ## Calculate the inverse of a matrix. Use a cache structure to optimize computations
##
## Construct that stores a matrix and its inverse. If the inverse is not stored NULL is returned
makeCacheMatrix <- function(x = matrix()) {
inv <- NULL
set <- function(y){
x <<- y
inv <<- NULL
}
get <- functio... |
##' @rdname catalog-extract
##' @export
setMethod("[[", c("PermissionCatalog", "character"), function (x, i, ...) {
stopifnot(length(i) == 1L)
w <- whichNameOrURL(x, i, emails(x))
if (is.na(w)) {
halt("Subscript out of bounds: ", i)
}
tup <- index(x)[[w]]
return(PermissionTuple(index_url... | /R/permission-catalog.R | no_license | digideskio/rcrunch | R | false | false | 655 | r | ##' @rdname catalog-extract
##' @export
setMethod("[[", c("PermissionCatalog", "character"), function (x, i, ...) {
stopifnot(length(i) == 1L)
w <- whichNameOrURL(x, i, emails(x))
if (is.na(w)) {
halt("Subscript out of bounds: ", i)
}
tup <- index(x)[[w]]
return(PermissionTuple(index_url... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/emojis_df.R
\docType{data}
\name{Emojis}
\alias{Emojis}
\title{Emoji Reference Dataframe}
\format{A data frame with 3567 rows and five variables
The variables are as follows:
\describe{
\item{unicode}{unicode for emoji as string}
\item{... | /man/Emojis.Rd | no_license | Rkabacoff/emoji2text | R | false | true | 728 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/emojis_df.R
\docType{data}
\name{Emojis}
\alias{Emojis}
\title{Emoji Reference Dataframe}
\format{A data frame with 3567 rows and five variables
The variables are as follows:
\describe{
\item{unicode}{unicode for emoji as string}
\item{... |
## Checking for and creating directories
if(!file.exists("data")){
dir.create("data")
}
fileURL <- "https://data.baltimorecity.gov/api/views/dz54-2aru/rows.csv?accessType=DOWNLOAD"
download.file(fileURL, destfile = "./data/cameras.csv", method = "curl") #method curl is necesary for https
list.files("./data")
d... | /Getting-and-cleaning-data/downloading-files.r | no_license | albert2828/datasciencecoursera | R | false | false | 359 | r | ## Checking for and creating directories
if(!file.exists("data")){
dir.create("data")
}
fileURL <- "https://data.baltimorecity.gov/api/views/dz54-2aru/rows.csv?accessType=DOWNLOAD"
download.file(fileURL, destfile = "./data/cameras.csv", method = "curl") #method curl is necesary for https
list.files("./data")
d... |
library(ggplot2); library(gridExtra);library(plyr);library(GGally)
psep = '/'
NUM=1
thin = 1
burnin = 500
#simid = 1
#if (Sys.info()["sysname"] == "Darwin") setwd("~/...")
simname <- c("exdhmdb10","exaffeul10","exafftcs10","exafftheta10","exdhmdb25","exaffeul25","exafftcs25","exafftheta25","exdhmdb100","exaffeul100",... | /plotmcfhn.R | permissive | getzdan/Bridge.jl | R | false | false | 3,823 | r | library(ggplot2); library(gridExtra);library(plyr);library(GGally)
psep = '/'
NUM=1
thin = 1
burnin = 500
#simid = 1
#if (Sys.info()["sysname"] == "Darwin") setwd("~/...")
simname <- c("exdhmdb10","exaffeul10","exafftcs10","exafftheta10","exdhmdb25","exaffeul25","exafftcs25","exafftheta25","exdhmdb100","exaffeul100",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.