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 |
|---|---|---|---|---|---|---|---|---|---|
#' Plots the probability increase for the basic elements based on the condition
#'
#' The function takes all single elements in a netfacs object, and plots the distribution of ratios between the observed value and all randomisations
#'
#'
#' @param netfacs.data object resulting from netfacs() function
#'
#' @return ... | /R/element_plot.R | permissive | gobbios/NetFACS | R | false | false | 2,753 | r | #' Plots the probability increase for the basic elements based on the condition
#'
#' The function takes all single elements in a netfacs object, and plots the distribution of ratios between the observed value and all randomisations
#'
#'
#' @param netfacs.data object resulting from netfacs() function
#'
#' @return ... |
#' Rewrite DESCRIPTION file overwriting Remotes
#'
#' @param path Path to DESCRIPTION file
#' @param remotes Packages for remotes field
#'
#' @return Name of path
#' @export
rewrite_remotes = function(path, remotes = NULL) {
rres = read_dcf(path = path)
res = rres$dcf
if (!is.null(remotes)) {
if (!all(remote... | /R/rewrite_remotes.R | no_license | muschellij2/ghtravis | R | false | false | 667 | r |
#' Rewrite DESCRIPTION file overwriting Remotes
#'
#' @param path Path to DESCRIPTION file
#' @param remotes Packages for remotes field
#'
#' @return Name of path
#' @export
rewrite_remotes = function(path, remotes = NULL) {
rres = read_dcf(path = path)
res = rres$dcf
if (!is.null(remotes)) {
if (!all(remote... |
library(readr)
library(ggplot2)
library(moments)
game = "Serious Statistics and Scripts"
cGPU = "RTX 2060"
gameF = gsub(":", "-", game)
gameF = unlist(strsplit(gameF, split=" [(]"))[1]
theme_set(theme_grey(base_size = 16))
DPI = 120
ggdevice = "png"
textOUT = TRUE
HTMLOUT = TRUE
graphs = TRUE
graphs_all = FALSE
... | /OCAT Data/RTX 2060/DirectX 12/Max/New folder/@Combined - Input - Serious Statistics and Scripts.r | no_license | GuestJim/Serious-Statistics-Reprocessed | R | false | false | 5,240 | r | library(readr)
library(ggplot2)
library(moments)
game = "Serious Statistics and Scripts"
cGPU = "RTX 2060"
gameF = gsub(":", "-", game)
gameF = unlist(strsplit(gameF, split=" [(]"))[1]
theme_set(theme_grey(base_size = 16))
DPI = 120
ggdevice = "png"
textOUT = TRUE
HTMLOUT = TRUE
graphs = TRUE
graphs_all = FALSE
... |
\name{DOvalidation-package}
\alias{DOvalidation-package}
\alias{DOvalidation}
\docType{package}
\title{
Local Linear Hazard Estimation with Do-Validated and Cross-Validated Bandwidths
}
\description{
Local linear estimator for the univariate hazard (hazard rate) and bandwidth parameter selection using the do-va... | /man/DOvalidation-package.Rd | no_license | arturochian/DOvalidation | R | false | false | 2,146 | rd | \name{DOvalidation-package}
\alias{DOvalidation-package}
\alias{DOvalidation}
\docType{package}
\title{
Local Linear Hazard Estimation with Do-Validated and Cross-Validated Bandwidths
}
\description{
Local linear estimator for the univariate hazard (hazard rate) and bandwidth parameter selection using the do-va... |
\name{see.lma.tck}
\alias{see.lma.tck}
\title{
ANOVA linear models
}
\description{
Derives ANOVA linear model using matrix algebra
}
\usage{
see.lma.tck()
}
\author{
Ken Aho
}
\keyword{graphs}
| /man/see.lma.tck.rd | no_license | cran/asbio | R | false | false | 220 | rd | \name{see.lma.tck}
\alias{see.lma.tck}
\title{
ANOVA linear models
}
\description{
Derives ANOVA linear model using matrix algebra
}
\usage{
see.lma.tck()
}
\author{
Ken Aho
}
\keyword{graphs}
|
## makeCacheMatrix stores the orginal matrix to be inverted as well as the inverted matrix if it has been already inverted by the cacheSolve function. For new matrices, makeCacheMatrix resets the values and variables so the list can be feeded again with new data, storing new matrices.
## cacheSolve for a new matrix, c... | /cachematrix.R | no_license | franciscosotom/ProgrammingAssignment2 | R | false | false | 1,806 | r | ## makeCacheMatrix stores the orginal matrix to be inverted as well as the inverted matrix if it has been already inverted by the cacheSolve function. For new matrices, makeCacheMatrix resets the values and variables so the list can be feeded again with new data, storing new matrices.
## cacheSolve for a new matrix, c... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ref.plot.R
\name{ref.plot}
\alias{ref.plot}
\title{Trace Plots for Parameters in ICAR Model}
\usage{
ref.plot(MCMCchain, X, burnin, num.reg)
}
\arguments{
\item{MCMCchain}{Matrix of MCMC chains for the model parameters.}
\item{X}{Matrix of c... | /man/ref.plot.Rd | no_license | cran/ref.ICAR | R | false | true | 910 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ref.plot.R
\name{ref.plot}
\alias{ref.plot}
\title{Trace Plots for Parameters in ICAR Model}
\usage{
ref.plot(MCMCchain, X, burnin, num.reg)
}
\arguments{
\item{MCMCchain}{Matrix of MCMC chains for the model parameters.}
\item{X}{Matrix of c... |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ============= Functions used in code ~~~~~~~===============
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Creating basic functions to show top few rows of data
View50 <- function(x){View(x[1:50,])}
View100 <- function(x){View(x... | /r/Cote_d_Ivoire_CDC_TDY/_2019_05_17_CDI_WETMOT.R | no_license | ICPI/Engagements | R | false | false | 9,281 | r | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ============= Functions used in code ~~~~~~~===============
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Creating basic functions to show top few rows of data
View50 <- function(x){View(x[1:50,])}
View100 <- function(x){View(x... |
library(xlsx)
library(magrittr)
library(reshape2)
library(dplyr)
library(ggplot2)
# bad - no need to use xlsx
sheet2 = read.xlsx("/Users/zhengz11/myscripts/FAFB2017_paper/data/PNcountsPerGlom.xlsx", 1) %>%
.[,-c(5,6)]
t1 = sheet2[,c(1,2,4)] %>%
setNames(c("Glomerulus", "LM", "EM")) %>%
melt(id.vars="Glomeru... | /temca2data/geometry_analysis/Fig4E_EMvsLM_PN_counts_per_glom.R | permissive | mlnichols/bocklab_public | R | false | false | 1,608 | r |
library(xlsx)
library(magrittr)
library(reshape2)
library(dplyr)
library(ggplot2)
# bad - no need to use xlsx
sheet2 = read.xlsx("/Users/zhengz11/myscripts/FAFB2017_paper/data/PNcountsPerGlom.xlsx", 1) %>%
.[,-c(5,6)]
t1 = sheet2[,c(1,2,4)] %>%
setNames(c("Glomerulus", "LM", "EM")) %>%
melt(id.vars="Glomeru... |
library(idar)
### Name: ipsim
### Title: Simulate Multivariate Point Patterns
### Aliases: ipsim ipsimlist simulador2 multifocalsimulator
### Keywords: spatial
### ** Examples
# Build a multivariate point pattern where maple is simulated according to a Poisson process
# and where all the other species are keep fi... | /data/genthat_extracted_code/idar/examples/ipsim.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 5,321 | r | library(idar)
### Name: ipsim
### Title: Simulate Multivariate Point Patterns
### Aliases: ipsim ipsimlist simulador2 multifocalsimulator
### Keywords: spatial
### ** Examples
# Build a multivariate point pattern where maple is simulated according to a Poisson process
# and where all the other species are keep fi... |
#Experimental script to see if I can take a HTML table showing webserver benchmark
#results; import it into R and output visualisations of the data
#
#I'm partly basing this script on https://stackoverflow.com/questions/22037122/importing-html-table
#
#It's making use of the htmltab package : https://cran.r-project.org... | /ws-analysis.R | permissive | shearichard/web-frameworks-benchmark-data-analysis | R | false | false | 1,403 | r | #Experimental script to see if I can take a HTML table showing webserver benchmark
#results; import it into R and output visualisations of the data
#
#I'm partly basing this script on https://stackoverflow.com/questions/22037122/importing-html-table
#
#It's making use of the htmltab package : https://cran.r-project.org... |
testlist <- list(id = NULL, id = NULL, booklet_id = c(8168473L, 2127314835L, 171177770L, -1942759639L, -1815221204L, 601253144L, -804651186L, 2094281728L, 860713787L, -971707632L, -1475044502L, 870040598L, -1182814557L, -1415711445L, 1901326755L, -1882837573L, 1340545259L, 1156041943L, 823641812L, -1106109928L, -10... | /dexterMST/inst/testfiles/is_person_booklet_sorted/AFL_is_person_booklet_sorted/is_person_booklet_sorted_valgrind_files/1615939582-test.R | no_license | akhikolla/updatedatatype-list1 | R | false | false | 826 | r | testlist <- list(id = NULL, id = NULL, booklet_id = c(8168473L, 2127314835L, 171177770L, -1942759639L, -1815221204L, 601253144L, -804651186L, 2094281728L, 860713787L, -971707632L, -1475044502L, 870040598L, -1182814557L, -1415711445L, 1901326755L, -1882837573L, 1340545259L, 1156041943L, 823641812L, -1106109928L, -10... |
# Prime Number Checking in R
isPrime <- function(number) {
if (number == 2) {
return(TRUE)
}
for (x in 2:(number-1)) {
if (number %% x == 0) {
return(FALSE)
}
}
return(TRUE)
}
isPrime(2)
isPrime(5)
isPrime(4)
| /Mathematics/Prime.R | permissive | acylam/R | R | false | false | 245 | r | # Prime Number Checking in R
isPrime <- function(number) {
if (number == 2) {
return(TRUE)
}
for (x in 2:(number-1)) {
if (number %% x == 0) {
return(FALSE)
}
}
return(TRUE)
}
isPrime(2)
isPrime(5)
isPrime(4)
|
#'
#' Exports the count and viterbi code to a folder in order to visualize it in IGV.
#'
#' @param object an RTIGER or RViterbi object with the filtered data
#' @param sample character with the sample name as specified in the experimentalDesign
#' @param dir character with the chromosome to plot. If left null, it will ... | /R/export2IGV.R | no_license | mnshgl0110/RTIGER | R | false | false | 3,910 | r | #'
#' Exports the count and viterbi code to a folder in order to visualize it in IGV.
#'
#' @param object an RTIGER or RViterbi object with the filtered data
#' @param sample character with the sample name as specified in the experimentalDesign
#' @param dir character with the chromosome to plot. If left null, it will ... |
## Put comments here that give an overall description of what your
## functions do
## Write a short comment describing this function
## makeCacheMatrix: creates a special "matrix" objects and caches its inverse
makeCacheMatrix <- function(x = matrix()) {
m <- NULL
##set value of the vector
set <- function(y) {
... | /cachematrix.R | no_license | xxtan/ProgrammingAssignment2 | R | false | false | 1,296 | r | ## Put comments here that give an overall description of what your
## functions do
## Write a short comment describing this function
## makeCacheMatrix: creates a special "matrix" objects and caches its inverse
makeCacheMatrix <- function(x = matrix()) {
m <- NULL
##set value of the vector
set <- function(y) {
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ridgereg.R
\docType{class}
\name{ridgereg-class}
\alias{ridgereg-class}
\alias{ridgereg}
\title{Linear Regression}
\description{
You can have Reference Class containing some calculations by giving formula and data.
}
\section{Fields}{
\descr... | /man/ridgereg-class.Rd | no_license | ugurcanlacin/Lab7 | R | false | true | 548 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ridgereg.R
\docType{class}
\name{ridgereg-class}
\alias{ridgereg-class}
\alias{ridgereg}
\title{Linear Regression}
\description{
You can have Reference Class containing some calculations by giving formula and data.
}
\section{Fields}{
\descr... |
# create function to reorder rows of a coefsplot
# move this to boralis soon
order_boral <- function(
data, # data.frame from boral_coefs
x # a name of a covariate in data
){
data_list <- split(data, data$covname)
data_order <- order(data_list[[x]]$x, decreasing = TRUE)
data_ordered <- lapply(data_list, func... | /R/order_boral.R | no_license | sustainablefarms/linking-data | R | false | false | 652 | r | # create function to reorder rows of a coefsplot
# move this to boralis soon
order_boral <- function(
data, # data.frame from boral_coefs
x # a name of a covariate in data
){
data_list <- split(data, data$covname)
data_order <- order(data_list[[x]]$x, decreasing = TRUE)
data_ordered <- lapply(data_list, func... |
#' Add an edge between nodes in a graph object.
#'
#' With a graph object of class \code{causact_graph} created from \code{dag_create}, add an edge between nodes in the graph. Vector recycling is used for all arguments.
#' @param from a character vector representing the parent nodes label or description from which the... | /R/dag_edge.R | permissive | Rosenguyen0411/causact | R | false | false | 2,131 | r | #' Add an edge between nodes in a graph object.
#'
#' With a graph object of class \code{causact_graph} created from \code{dag_create}, add an edge between nodes in the graph. Vector recycling is used for all arguments.
#' @param from a character vector representing the parent nodes label or description from which the... |
# =====
# Some utility functions (using Seurat v2.3.4) to clustering scRNA-seq data
# and remove cluster than are likey consiting of low-quality cells
#
# umi.count is a raw UMI count matrix (or TPM matrix for Smart-seq2 data)
#
library(ROCR)
library(Seurat)
library(dplyr)
# =====
ClusterSeurat = function(umi.coun... | /R/sc_compare_util.R | permissive | sygongcode/scumi-for-sci-RNAd-seq3 | R | false | false | 7,303 | r | # =====
# Some utility functions (using Seurat v2.3.4) to clustering scRNA-seq data
# and remove cluster than are likey consiting of low-quality cells
#
# umi.count is a raw UMI count matrix (or TPM matrix for Smart-seq2 data)
#
library(ROCR)
library(Seurat)
library(dplyr)
# =====
ClusterSeurat = function(umi.coun... |
# Preprocessing (normalization and batch effect correction) for Copy-number
# Analysis
#' Preprocess
#'
#' Preprocessing include normalization and batch effect removal.
#'
#' @param ref Reference samples stored in an object of
#' \code{\link[minfi]{RGChannelSet-class}}.
#' @param qry Query samples stored in an obje... | /R/preprocess.R | no_license | markgene/yamatCN | R | false | false | 7,875 | r | # Preprocessing (normalization and batch effect correction) for Copy-number
# Analysis
#' Preprocess
#'
#' Preprocessing include normalization and batch effect removal.
#'
#' @param ref Reference samples stored in an object of
#' \code{\link[minfi]{RGChannelSet-class}}.
#' @param qry Query samples stored in an obje... |
#! /usr/bin/env Rscript
read.bedgraph <- function(file) {
dat <- scan(file=file,
what=list(character(),integer(),integer(),numeric(),integer(),integer(),character()),
sep="\t")
dat <- data.frame(chr=dat[[1]], start=dat[[2]], end=dat[[3]],
val=dat[[4]], unchange=dat[[5]], all=dat[[6]... | /pvalall.R | no_license | rachelGoldfeder/cfDNA | R | false | false | 1,757 | r | #! /usr/bin/env Rscript
read.bedgraph <- function(file) {
dat <- scan(file=file,
what=list(character(),integer(),integer(),numeric(),integer(),integer(),character()),
sep="\t")
dat <- data.frame(chr=dat[[1]], start=dat[[2]], end=dat[[3]],
val=dat[[4]], unchange=dat[[5]], all=dat[[6]... |
\name{bnbc}
\alias{bnbc}
\title{
Normalize Contact Matrices with BNBC
}
\description{
Applies BNBC method to normalize contact matrices.
}
\usage{bnbc(cg, batch, threshold=NULL, step=NULL,
downSample=FALSE, qn=TRUE, Harmony=FALSE, vars_use = c('Batch'),
scalePCA=TRUE, theta=c(2)... | /man/bnbc.Rd | no_license | helengracehuang/HiC-Harmony | R | false | false | 4,168 | rd | \name{bnbc}
\alias{bnbc}
\title{
Normalize Contact Matrices with BNBC
}
\description{
Applies BNBC method to normalize contact matrices.
}
\usage{bnbc(cg, batch, threshold=NULL, step=NULL,
downSample=FALSE, qn=TRUE, Harmony=FALSE, vars_use = c('Batch'),
scalePCA=TRUE, theta=c(2)... |
## read data
source("read_data.R")
## plot3
library(ggplot2)
png(filename = "plot3.png",width = 720, height = 480, units = "px")
g <- ggplot(df2, aes(x=as.factor(year), y = log10(Emissions), fill=as.factor(year), group = as.factor(year)))
g + geom_boxplot() +
facet_grid(.~ type) +
stat_boxpl... | /plot3.R | no_license | surgeonchen/ExData_Plotting2 | R | false | false | 621 | r | ## read data
source("read_data.R")
## plot3
library(ggplot2)
png(filename = "plot3.png",width = 720, height = 480, units = "px")
g <- ggplot(df2, aes(x=as.factor(year), y = log10(Emissions), fill=as.factor(year), group = as.factor(year)))
g + geom_boxplot() +
facet_grid(.~ type) +
stat_boxpl... |
# Comparing means
# :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# Global function to compare means
compare_mean <- function( data, formula, method = "t.test", paired = FALSE,
comparisons = NULL, ref.group = NULL,
p.adjust.method = "holm"... | /R/utilities_two_sample_test.R | no_license | kassambara/rstatix | R | false | false | 9,895 | r |
# Comparing means
# :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# Global function to compare means
compare_mean <- function( data, formula, method = "t.test", paired = FALSE,
comparisons = NULL, ref.group = NULL,
p.adjust.method = "holm"... |
load(file = "sources/data/clean/pop.map.RData")
source("analysis/scripts/02-Functions.R")
## VAR NAMES
colnames(ShpMMRTownship@data)[58]
## var range
range(unlist(ShpMMRTownship@data[309]), na.rm = TRUE)
FunMNTownMap(var = 308,
town = c("Mandalay", "Ayeyarwady"), n = 10, breaks = seq(0,... | /analysis/scripts/00-ScratchPad.R | no_license | majazaloznik/MyanmarSecondaryData | R | false | false | 3,730 | r | load(file = "sources/data/clean/pop.map.RData")
source("analysis/scripts/02-Functions.R")
## VAR NAMES
colnames(ShpMMRTownship@data)[58]
## var range
range(unlist(ShpMMRTownship@data[309]), na.rm = TRUE)
FunMNTownMap(var = 308,
town = c("Mandalay", "Ayeyarwady"), n = 10, breaks = seq(0,... |
\name{lock}
\alias{lock}
\title{Locking/Unlocking}
\description{Locks a file in exclusive or shared mode.}
\usage{lock(path, exclusive = TRUE)}
\arguments{
\item{path}{Character. The path.}
\item{exclusive}{Logical. The lock type, exclusive or shared.}
}
\details{The file is created if it doesn't exist.}
\value{
Re... | /flock/man/lock.Rd | no_license | akhikolla/TestedPackages-NoIssues | R | false | false | 594 | rd | \name{lock}
\alias{lock}
\title{Locking/Unlocking}
\description{Locks a file in exclusive or shared mode.}
\usage{lock(path, exclusive = TRUE)}
\arguments{
\item{path}{Character. The path.}
\item{exclusive}{Logical. The lock type, exclusive or shared.}
}
\details{The file is created if it doesn't exist.}
\value{
Re... |
#Loadind dplyr package
library(dplyr)
#Downloading the dataset
filename <- "getdata_projectfiles_UCI HAR Dataset.zip"
#Checking it the file already exists
if(!file.exists(filename))
{
fileURL <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip"
download.file(fileUR... | /Getting and Cleaning Data/run_analysis.R | no_license | deekshant1/datasciencecoursera | R | false | false | 3,002 | r | #Loadind dplyr package
library(dplyr)
#Downloading the dataset
filename <- "getdata_projectfiles_UCI HAR Dataset.zip"
#Checking it the file already exists
if(!file.exists(filename))
{
fileURL <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip"
download.file(fileUR... |
## This pair of functions will create a special matrix object that can
##cache its inverse and also compute the inverse of the matrix, however
## the matrix supplied should be always invertible
##
## The function creates a special "matrix object", which is really a list containing a function to
#Thus it caches the ... | /cachematrix.R | no_license | Maka123/datasciencecoursera | R | false | false | 1,547 | r | ## This pair of functions will create a special matrix object that can
##cache its inverse and also compute the inverse of the matrix, however
## the matrix supplied should be always invertible
##
## The function creates a special "matrix object", which is really a list containing a function to
#Thus it caches the ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read_nmtables.R
\name{read_nmtables}
\alias{read_nmtables}
\title{Reads NONMEM output tables.}
\usage{
read_nmtables(
tableFiles = NULL,
runNo = NULL,
tabSuffix = "",
tableNames = c("sdtab", "mutab", "patab", "catab", "cotab... | /man/read_nmtables.Rd | no_license | cran/pmxTools | R | false | true | 1,930 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read_nmtables.R
\name{read_nmtables}
\alias{read_nmtables}
\title{Reads NONMEM output tables.}
\usage{
read_nmtables(
tableFiles = NULL,
runNo = NULL,
tabSuffix = "",
tableNames = c("sdtab", "mutab", "patab", "catab", "cotab... |
# Exploratory Data Analysis, Course Project 2
source('~/ExData_Plotting2/loadData.R')
t <- tapply(dat$Emissions, dat$year, sum)
x <- as.vector(dimnames(t)[[1]])
y <- as.vector(t)
# Some place I found info for twiking plots
# http://www.statmethods.net/advgraphs/axes.html
# http://stackoverflow.com/questions/5963047... | /plot1.R | no_license | DeanBrundige/ExData_Plotting2 | R | false | false | 1,005 | r | # Exploratory Data Analysis, Course Project 2
source('~/ExData_Plotting2/loadData.R')
t <- tapply(dat$Emissions, dat$year, sum)
x <- as.vector(dimnames(t)[[1]])
y <- as.vector(t)
# Some place I found info for twiking plots
# http://www.statmethods.net/advgraphs/axes.html
# http://stackoverflow.com/questions/5963047... |
require(httr)
headers = c(
`Content-Type` = 'application/x-www-form-urlencoded'
)
data = list(
`foo` = '\\\'bar\\\''
)
res <- httr::POST(url = 'http://example.com/', httr::add_headers(.headers=headers), body = data)
| /fixtures/r/post_escaped_single_quotes_in_double_quotes.r | permissive | Killua67/curlconverter | R | false | false | 223 | r | require(httr)
headers = c(
`Content-Type` = 'application/x-www-form-urlencoded'
)
data = list(
`foo` = '\\\'bar\\\''
)
res <- httr::POST(url = 'http://example.com/', httr::add_headers(.headers=headers), body = data)
|
\name{ex14.40}
\alias{ex14.40}
\docType{data}
\title{R Data set: ex14.40}
\description{
The \code{ex14.40} data frame has 6 rows and 3 columns.
}
\usage{data(ex14.40)}
\format{
A data frame with 6 observations on the following 3 variables.
\describe{
\item{\code{C1}}{a factor with levels \code{Baseball} \code{B... | /man/ex14.40.Rd | no_license | cran/Devore7 | R | false | false | 984 | rd | \name{ex14.40}
\alias{ex14.40}
\docType{data}
\title{R Data set: ex14.40}
\description{
The \code{ex14.40} data frame has 6 rows and 3 columns.
}
\usage{data(ex14.40)}
\format{
A data frame with 6 observations on the following 3 variables.
\describe{
\item{\code{C1}}{a factor with levels \code{Baseball} \code{B... |
#
# the four lines below are for counting errors
#
.error.count <- 0
old.error.fun <- getOption("error")
new.error.fun <- quote(.error.count <- .error.count + 1)
options(error = new.error.fun, width=2400)
######################################################################################################... | /R_files_a/R_file_1.R | no_license | IcterusGalbula/Tutorial-for-Running-a-Large-Number-of-R-files-using-Amazon-Web-Services | R | false | false | 1,619 | r |
#
# the four lines below are for counting errors
#
.error.count <- 0
old.error.fun <- getOption("error")
new.error.fun <- quote(.error.count <- .error.count + 1)
options(error = new.error.fun, width=2400)
######################################################################################################... |
### Plot2.R
library(datasets)
library(dplyr)
library(lubridate)
library(lettice)
libarary(ggplot2)
### saved 2 days data in day1-2.txt
hxd <- read.table("day1-2.txt", sep = ";", stringsAsFactors = TRUE )
xnames <- c("Date","Time","Global_active_power","Global_reactive_power","Voltage","Global_intensi... | /Plot2.R | no_license | SamiBoy2001/ExpData | R | false | false | 982 | r | ### Plot2.R
library(datasets)
library(dplyr)
library(lubridate)
library(lettice)
libarary(ggplot2)
### saved 2 days data in day1-2.txt
hxd <- read.table("day1-2.txt", sep = ";", stringsAsFactors = TRUE )
xnames <- c("Date","Time","Global_active_power","Global_reactive_power","Voltage","Global_intensi... |
#' my_dictionary
#' @description A simple \code{list} containing a dictionary with positive and negative words(English and Portuguese).
#'
#' @format A list with 2 components.
#'
#' \describe{
#' \item{positive_terms}{The positive words.}
#' \item{negative_terms}{The negative words.}
#' }
"my_dictionary"
| /R/my_dictionary.R | no_license | cran/TwitterAutomatedTrading | R | false | false | 316 | r | #' my_dictionary
#' @description A simple \code{list} containing a dictionary with positive and negative words(English and Portuguese).
#'
#' @format A list with 2 components.
#'
#' \describe{
#' \item{positive_terms}{The positive words.}
#' \item{negative_terms}{The negative words.}
#' }
"my_dictionary"
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AMIS_steps.R
\name{calculate_ess}
\alias{calculate_ess}
\title{Compute the current effective sample size}
\usage{
calculate_ess(weight_mat)
}
\arguments{
\item{weight_mat}{The weight matrix. A n x m matrix with n the number of IUS
and m the n... | /man/calculate_ess.Rd | permissive | rretkute/trachomAMIS | R | false | true | 784 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AMIS_steps.R
\name{calculate_ess}
\alias{calculate_ess}
\title{Compute the current effective sample size}
\usage{
calculate_ess(weight_mat)
}
\arguments{
\item{weight_mat}{The weight matrix. A n x m matrix with n the number of IUS
and m the n... |
## JHU Data Science: Exploratory Data Analysis - Course Project 1
## load libraries that might be useful for the project
library(ggplot2)
library(dplyr)
library(lubridate)
library(tidyr)
## Set proper working directory, for the JHU folders and verify the dataset is stored in folder
setwd("//prod-am.ameritrade.com/use... | /plot2.R | no_license | decross1/ExData_Plotting1 | R | false | false | 1,548 | r | ## JHU Data Science: Exploratory Data Analysis - Course Project 1
## load libraries that might be useful for the project
library(ggplot2)
library(dplyr)
library(lubridate)
library(tidyr)
## Set proper working directory, for the JHU folders and verify the dataset is stored in folder
setwd("//prod-am.ameritrade.com/use... |
library(raster)
library(sf)
library(rnaturalearth)
library(patchwork)
library(lubridate)
# library(ggrepel)
library(tidyverse)
library(ggsflabel) #devtools::install_github("yutannihilation/ggsflabel")
# lonlatCRS <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs")
# lonlatCRS_no <- 4326
## Create NRS details
... | /HarmfulAlgalBlooms/HABS_AustraliaCaseStudies.R | no_license | MathMarEcol/StateOfEnvironment2021 | R | false | false | 2,119 | r |
library(raster)
library(sf)
library(rnaturalearth)
library(patchwork)
library(lubridate)
# library(ggrepel)
library(tidyverse)
library(ggsflabel) #devtools::install_github("yutannihilation/ggsflabel")
# lonlatCRS <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs")
# lonlatCRS_no <- 4326
## Create NRS details
... |
library(deaR)
### Name: summary.dea
### Title: Summary conventional DEA models.
### Aliases: summary.dea
### ** Examples
data("PFT1981")
# Selecting DMUs in Program Follow Through (PFT)
PFT <- PFT1981[1:49, ]
PFT <- read_data(PFT,
dmus = 1,
inputs = 2:6,
outpu... | /data/genthat_extracted_code/deaR/examples/summary.dea.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 484 | r | library(deaR)
### Name: summary.dea
### Title: Summary conventional DEA models.
### Aliases: summary.dea
### ** Examples
data("PFT1981")
# Selecting DMUs in Program Follow Through (PFT)
PFT <- PFT1981[1:49, ]
PFT <- read_data(PFT,
dmus = 1,
inputs = 2:6,
outpu... |
library(dplyr)
power_consumption <- read.table("household_power_consumption.txt", sep=";", na.strings = "?", stringsAsFactors = F, header = T) %>%
filter((as.Date("2007-02-01") <= as.Date(strptime(Date, "%d/%m/%Y"))) & (as.Date("2007-02-02") >= as.Date(strptime(Date, "%d/%m/%Y")))) %>%
mutate(datetime = as.POSIXct... | /shared.R | no_license | fvankrieken/ExData_Plotting1 | R | false | false | 371 | r | library(dplyr)
power_consumption <- read.table("household_power_consumption.txt", sep=";", na.strings = "?", stringsAsFactors = F, header = T) %>%
filter((as.Date("2007-02-01") <= as.Date(strptime(Date, "%d/%m/%Y"))) & (as.Date("2007-02-02") >= as.Date(strptime(Date, "%d/%m/%Y")))) %>%
mutate(datetime = as.POSIXct... |
########## Question 1##############
# Black Scholes ----
CallOption <- function(S,k, tau, r, sigma) {
d1 <- (log(S/k) + (r + sigma^2/2 ) * tau) / (sigma * sqrt(tau))
d2 <- d1 - sigma*sqrt(tau)
price = S*pnorm(d1) - k * exp(-r*tau)*pnorm(d2)
return(price)
}
PutOption <- function(S,... | /17_fall_Assignments/Assignment 2/Question 1.R | no_license | shining-cloud/SIT-FE621-Computational-Method | R | false | false | 25,034 | r | ########## Question 1##############
# Black Scholes ----
CallOption <- function(S,k, tau, r, sigma) {
d1 <- (log(S/k) + (r + sigma^2/2 ) * tau) / (sigma * sqrt(tau))
d2 <- d1 - sigma*sqrt(tau)
price = S*pnorm(d1) - k * exp(-r*tau)*pnorm(d2)
return(price)
}
PutOption <- function(S,... |
#' Pan Sharpen Imagery / Image Fusion
#'
#' provides different methods for pan sharpening a coarse resolution (typically multispectral) image with
#' a higher reolution panchromatic image. Values of the pan-chromatic and multispectral images must be of the same scale, (e.g. from 0:1, or all DNs from 0:255)
#'
#' @pa... | /R/panSharpen.R | no_license | benitezrcamilo/RStoolbox | R | false | false | 4,580 | r | #' Pan Sharpen Imagery / Image Fusion
#'
#' provides different methods for pan sharpening a coarse resolution (typically multispectral) image with
#' a higher reolution panchromatic image. Values of the pan-chromatic and multispectral images must be of the same scale, (e.g. from 0:1, or all DNs from 0:255)
#'
#' @pa... |
#' Get summary values from MADseqLOY or MADloy objects
#'
#' This function retrieves the summary values from the MADloy or MADseqLOY
#' objects and prepares the data to be analyzed for LOY events.
#'
#' @param object A MADloy or MADseqLOY object from the \code{MADloy} or
#' \code{MADseqLOY} functions.
#'
#' @re... | /R/getSummary.R | no_license | isglobal-brge/madloy_v1 | R | false | false | 1,479 | r | #' Get summary values from MADseqLOY or MADloy objects
#'
#' This function retrieves the summary values from the MADloy or MADseqLOY
#' objects and prepares the data to be analyzed for LOY events.
#'
#' @param object A MADloy or MADseqLOY object from the \code{MADloy} or
#' \code{MADseqLOY} functions.
#'
#' @re... |
# Bunny's Greenie Board Maker
# version 1.0
# takes data from Bunny's LSO Score Recording Script
library(flextable)
library(officer)
library(gridExtra)
library(webshot)
substrRight <- function(x, n){
substr(x, nchar(x)-n+1, nchar(x))
}
currentMonth <- substr(date(),5,7)
currentYear <- substrRight(dat... | /greenieBoardMaker.R | no_license | dcshowlers/howlersmissionfiles | R | false | false | 5,666 | r | # Bunny's Greenie Board Maker
# version 1.0
# takes data from Bunny's LSO Score Recording Script
library(flextable)
library(officer)
library(gridExtra)
library(webshot)
substrRight <- function(x, n){
substr(x, nchar(x)-n+1, nchar(x))
}
currentMonth <- substr(date(),5,7)
currentYear <- substrRight(dat... |
complete <- function(directory, id = 1:332) {
## 'directory' is a character vector of length 1 indicating
## the location of the CSV files
## 'id' is an integer vector indicating the monitor ID numbers
## to be used
## Return a data frame of the form:
##... | /Week2/complete.R | no_license | jerzybaranowski/datasciencecoursera | R | false | false | 792 | r | complete <- function(directory, id = 1:332) {
## 'directory' is a character vector of length 1 indicating
## the location of the CSV files
## 'id' is an integer vector indicating the monitor ID numbers
## to be used
## Return a data frame of the form:
##... |
#' @title Fit the BMEA model for a single gene.
#'
#' @description Fits the BMEA model using the MCMC process for a single gene.
#'
#' @details
#' This function runs the complete BMEA process for a single gene.
#' Currently the only implemented model is the uniform prior for the exon proportions term (phi).
#'
#'... | /R/runMCMC.BMEA.R | no_license | smped/BMEA | R | false | false | 6,958 | r | #' @title Fit the BMEA model for a single gene.
#'
#' @description Fits the BMEA model using the MCMC process for a single gene.
#'
#' @details
#' This function runs the complete BMEA process for a single gene.
#' Currently the only implemented model is the uniform prior for the exon proportions term (phi).
#'
#'... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/directincid.R
\name{prepare_directincid}
\alias{prepare_directincid}
\title{Prepare direct incidence input EPP simulation}
\usage{
prepare_directincid(pjnz, method = "directincid_hts")
}
\arguments{
\item{method}{Method for intercalating new ... | /man/prepare_directincid.Rd | no_license | mrc-ide/eppasm | R | false | true | 508 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/directincid.R
\name{prepare_directincid}
\alias{prepare_directincid}
\title{Prepare direct incidence input EPP simulation}
\usage{
prepare_directincid(pjnz, method = "directincid_hts")
}
\arguments{
\item{method}{Method for intercalating new ... |
library(ggplot2)
library(cowplot)
library(RColorBrewer)
library(dplyr)
library(UpSetR)
##############
# Parameters #
##############
# simulations
## sample sizes
sample_sizes <- c(20, 30, 40, 50, 100)
## number of genes
genes <- 10000
## sequencing depth
depth <- 5000000
## DE genes
non_DE_runif_FC <- TRUE # generate... | /src/simulations-figures.R | no_license | lepriolc/RNAseq_differential_dispersion | R | false | false | 52,932 | r | library(ggplot2)
library(cowplot)
library(RColorBrewer)
library(dplyr)
library(UpSetR)
##############
# Parameters #
##############
# simulations
## sample sizes
sample_sizes <- c(20, 30, 40, 50, 100)
## number of genes
genes <- 10000
## sequencing depth
depth <- 5000000
## DE genes
non_DE_runif_FC <- TRUE # generate... |
library(scales)
library(kableExtra)
library(webshot)
library(xtable)
library(gridExtra)
library(ggplot2)
library(tidyverse)
library(hrbrthemes)
library(viridis)
library(apcluster)
library(reshape2)
library(minpack.lm)
library(plotly)
library(lubridate)
library(dplyr)
options(scipen = 999)
getData <- function(item)
{... | /main.R | no_license | tarek-hassan-FE/EGYPT-19 | R | false | false | 9,429 | r | library(scales)
library(kableExtra)
library(webshot)
library(xtable)
library(gridExtra)
library(ggplot2)
library(tidyverse)
library(hrbrthemes)
library(viridis)
library(apcluster)
library(reshape2)
library(minpack.lm)
library(plotly)
library(lubridate)
library(dplyr)
options(scipen = 999)
getData <- function(item)
{... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/statar.R
\docType{package}
\name{statar}
\alias{statar}
\title{A package for applied research}
\description{
A package for applied research
}
| /man/statar.Rd | no_license | cran/statar | R | false | true | 220 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/statar.R
\docType{package}
\name{statar}
\alias{statar}
\title{A package for applied research}
\description{
A package for applied research
}
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wrappers.R
\name{mtoraster}
\alias{mtoraster}
\title{mtoraster: Convert a matrix to raster object}
\usage{
mtoraster(m, centre = TRUE, mask = NA)
}
\arguments{
\item{m}{a matrix of values.}
\item{centre}{if true, centres values to prime meri... | /man/mtoraster.Rd | no_license | ilyamaclean/climvars | R | false | true | 674 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wrappers.R
\name{mtoraster}
\alias{mtoraster}
\title{mtoraster: Convert a matrix to raster object}
\usage{
mtoraster(m, centre = TRUE, mask = NA)
}
\arguments{
\item{m}{a matrix of values.}
\item{centre}{if true, centres values to prime meri... |
sudo apt-get install phantomjs
| /README.rd | no_license | hitoshi-t-pepe3/rspec-capybara-poltergeist-template | R | false | false | 31 | rd | sudo apt-get install phantomjs
|
options(pillar.sigfig = 7)
# Extend these frequency lists as required
LOW_FREQUENCIES <- c("4_seconds", "minutely", "10_minutes", "15_minutes", "half_hourly", "hourly")
LOW_FREQ_VALS <- c("4 sec", "1 min", "10 min", "15 min", "30 min", "1 hour")
HIGH_FREQUENCIES <- c("daily", "weekly", "monthly", "quarterly", "yearly... | /utils/data_loader.R | permissive | prigrecov/TSForecasting | R | false | false | 7,586 | r | options(pillar.sigfig = 7)
# Extend these frequency lists as required
LOW_FREQUENCIES <- c("4_seconds", "minutely", "10_minutes", "15_minutes", "half_hourly", "hourly")
LOW_FREQ_VALS <- c("4 sec", "1 min", "10 min", "15 min", "30 min", "1 hour")
HIGH_FREQUENCIES <- c("daily", "weekly", "monthly", "quarterly", "yearly... |
#load libraries
library(tidyverse)
library(magrittr)
library(readxl)
library(ggmap)
library(shiny)
library(leaflet)
library(maps)
library(htmlwidgets)
library(mapdata)
library(htmltools)
library(mapproj)
type = c(Cylindrica = "cylindrical", Mercato = "mercator", Sinusoidal = "sinusoidal", Gnomonic = "gnomonic",
... | /MA615/Mapping/world_map.R | no_license | feiyiru/feiyiru | R | false | false | 1,202 | r | #load libraries
library(tidyverse)
library(magrittr)
library(readxl)
library(ggmap)
library(shiny)
library(leaflet)
library(maps)
library(htmlwidgets)
library(mapdata)
library(htmltools)
library(mapproj)
type = c(Cylindrica = "cylindrical", Mercato = "mercator", Sinusoidal = "sinusoidal", Gnomonic = "gnomonic",
... |
actlabels <- read.table(file = "activity_labels.txt", header = FALSE)
features <- read.table(file = "features.txt", header = FALSE)
subject_test <- read.table(file = "subject_test.txt")
X_test <- read.table(file = "X_test.txt", header = FALSE)
y_test <- read.table(file = "y_test.txt", header = FALSE)
subject_train <... | /run_analisis.R | no_license | Nelfernandez/Getting-and-Cleaning-Data-Course-Project | R | false | false | 777 | r | actlabels <- read.table(file = "activity_labels.txt", header = FALSE)
features <- read.table(file = "features.txt", header = FALSE)
subject_test <- read.table(file = "subject_test.txt")
X_test <- read.table(file = "X_test.txt", header = FALSE)
y_test <- read.table(file = "y_test.txt", header = FALSE)
subject_train <... |
##' @include Class-Dasst.R Dasst-methods.R
##'
NULL
##' Stack the tables of an object of class Dasst
##'
##' \code{stackTables} stacks the tables of an object
##' of class \code{\linkS4class{Dasst}}.
##'
##' This function stacks the tables of an object
##' of class \code{\linkS4class{Dasst}}.
##' The result is given ... | /R/stackTables.R | no_license | cran/Dasst | R | false | false | 1,087 | r | ##' @include Class-Dasst.R Dasst-methods.R
##'
NULL
##' Stack the tables of an object of class Dasst
##'
##' \code{stackTables} stacks the tables of an object
##' of class \code{\linkS4class{Dasst}}.
##'
##' This function stacks the tables of an object
##' of class \code{\linkS4class{Dasst}}.
##' The result is given ... |
## Listed below are functions that provide access to
## a matrix object with cached inverse calculation
## This function creates an extended matrix object
## and provides it with "set" and "get" methods to set
## and get the value of the matrix and "setinv" and
## "getinv" methods to set and retrieve the values of... | /cachematrix.R | no_license | SergueiSmirnov/ProgrammingAssignment2 | R | false | false | 1,518 | r | ## Listed below are functions that provide access to
## a matrix object with cached inverse calculation
## This function creates an extended matrix object
## and provides it with "set" and "get" methods to set
## and get the value of the matrix and "setinv" and
## "getinv" methods to set and retrieve the values of... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dtsl.R
\name{dtsl_bs4_book}
\alias{dtsl_bs4_book}
\title{Creates an R Markdown bs4_book DTSL document}
\usage{
dtsl_bs4_book(...)
}
\arguments{
\item{...}{Further arguments passed to or from other methods.}
}
\value{
A Bootstrap 4 webpage
}
\... | /man/dtsl_bs4_book.Rd | permissive | Workoho/dtsldown | R | false | true | 520 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dtsl.R
\name{dtsl_bs4_book}
\alias{dtsl_bs4_book}
\title{Creates an R Markdown bs4_book DTSL document}
\usage{
dtsl_bs4_book(...)
}
\arguments{
\item{...}{Further arguments passed to or from other methods.}
}
\value{
A Bootstrap 4 webpage
}
\... |
##
## image segmentation
##
postdataseg <-
function(x, z, ngrid, dbg=FALSE)
{
zsent <- c(z,-1) # add sentinel
zjumps <- NULL
cnt <- 1
## select sequential intervals with same zi
for(k in 2:length(zsent)) {
if(zsent[k] != zsent[k-1]) {
zj <- c(zsent[k-1], cnt)
zjumps <... | /R/postdataseg.R | no_license | cran/dpmixsim | R | false | false | 1,530 | r | ##
## image segmentation
##
postdataseg <-
function(x, z, ngrid, dbg=FALSE)
{
zsent <- c(z,-1) # add sentinel
zjumps <- NULL
cnt <- 1
## select sequential intervals with same zi
for(k in 2:length(zsent)) {
if(zsent[k] != zsent[k-1]) {
zj <- c(zsent[k-1], cnt)
zjumps <... |
#' @title OASIS Training
#' @description This function trains the OASIS model from a data frame produced by the function oasis_train_vectors
#' @param ... dataframe(s) produced by the oasis_preproc function
#' @param remove_preproc a logical stateing if preprocessed volumes need to be removed from the dataframes
#' ... | /R/oasis_training.R | no_license | edobryakova/oasis | R | false | false | 1,905 | r | #' @title OASIS Training
#' @description This function trains the OASIS model from a data frame produced by the function oasis_train_vectors
#' @param ... dataframe(s) produced by the oasis_preproc function
#' @param remove_preproc a logical stateing if preprocessed volumes need to be removed from the dataframes
#' ... |
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!... | /R/data_subset.r | no_license | Neato-Nick/poppr | R | false | false | 32,314 | r | #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!... |
template.file <- "grouping.Rmd"
template.content <- readLines(template.file)
sample.list <- list.files(pattern="\\.rds$")
for (sample in sample.list) {
script <- gsub("INDEX", deparse(gsub(".rds", "", sample)), template.content)
sample.prefix <- gsub("\\..*", "", gsub(".*_", "", sample))
writeLines(text = script... | /pipeline/dispatcher_grouping.R | no_license | dbrg77/CELLOseq | R | false | false | 373 | r | template.file <- "grouping.Rmd"
template.content <- readLines(template.file)
sample.list <- list.files(pattern="\\.rds$")
for (sample in sample.list) {
script <- gsub("INDEX", deparse(gsub(".rds", "", sample)), template.content)
sample.prefix <- gsub("\\..*", "", gsub(".*_", "", sample))
writeLines(text = script... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gamelift_operations.R
\name{gamelift_describe_fleet_events}
\alias{gamelift_describe_fleet_events}
\title{Retrieves entries from the specified fleet's event log}
\usage{
gamelift_describe_fleet_events(FleetId, StartTime, EndTime, Limit,
Nex... | /cran/paws.game.development/man/gamelift_describe_fleet_events.Rd | permissive | paws-r/paws | R | false | true | 4,411 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gamelift_operations.R
\name{gamelift_describe_fleet_events}
\alias{gamelift_describe_fleet_events}
\title{Retrieves entries from the specified fleet's event log}
\usage{
gamelift_describe_fleet_events(FleetId, StartTime, EndTime, Limit,
Nex... |
### This function compares feature selection and C-Index recovery and prediction ###
### Let's see what comes up
ComparisionFLX = function(){
smod <- Surv(exp(time), censoring)
smod.new <- Surv(exp(time.new), censoring.new)
gr.km <- kmeans(Y, F, nstart =10)
gr.km.rand <- adjustedRandIndex(c.true,as.f... | /R_Scripts_First_Results/ComparisionFLX.R | no_license | CamilaDuitama/MasterThesis | R | false | false | 4,019 | r | ### This function compares feature selection and C-Index recovery and prediction ###
### Let's see what comes up
ComparisionFLX = function(){
smod <- Surv(exp(time), censoring)
smod.new <- Surv(exp(time.new), censoring.new)
gr.km <- kmeans(Y, F, nstart =10)
gr.km.rand <- adjustedRandIndex(c.true,as.f... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/datasets.R
\docType{data}
\name{mart_mm}
\alias{mart_mm}
\title{BioMart-Ensembl for mouse proteins.}
\format{
An object of class \code{Mart} of length 1.
}
\source{
\url{https://bioconductor.org/packages/release/bioc/html/biomaRt.html}
}
\usa... | /man/mart_mm.Rd | permissive | sailfish009/proteoQ | R | false | true | 449 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/datasets.R
\docType{data}
\name{mart_mm}
\alias{mart_mm}
\title{BioMart-Ensembl for mouse proteins.}
\format{
An object of class \code{Mart} of length 1.
}
\source{
\url{https://bioconductor.org/packages/release/bioc/html/biomaRt.html}
}
\usa... |
football <- read.csv("~/Documents/DATA_PGMG/foot20teams6props.csv",header = T)
names(football) <- c( "Team", "Points" , "Goals2Shots" ,
"LongGoals" , "Short2LongPasses" , "BallCrosses" ,
"ConcededGoals","NumYellowCards")
tiers <- c(rep("top_tier",4),rep("mid_tier",12),rep("bottom_tier",4))
fb_ordered <- football[w... | /R_Coursework.R | no_license | ibrahim85/Portfolio | R | false | false | 1,860 | r | football <- read.csv("~/Documents/DATA_PGMG/foot20teams6props.csv",header = T)
names(football) <- c( "Team", "Points" , "Goals2Shots" ,
"LongGoals" , "Short2LongPasses" , "BallCrosses" ,
"ConcededGoals","NumYellowCards")
tiers <- c(rep("top_tier",4),rep("mid_tier",12),rep("bottom_tier",4))
fb_ordered <- football[w... |
graph <- cces16 %>%
filter(religpew == 9 | religpew == 10 | religpew ==11) %>%
filter(pid7 <= 7) %>%
mutate(religpew = to_factor(religpew)) %>%
group_by(religpew) %>%
ct(pid7, wt = commonweight_vv) %>%
mutate(pid7 = frcode(pid7 == 1 ~ "Strong Democrat",
pid7 == 2 ~ "Not very\ns... | /pid.R | no_license | ryanburge/nips | R | false | false | 1,193 | r | graph <- cces16 %>%
filter(religpew == 9 | religpew == 10 | religpew ==11) %>%
filter(pid7 <= 7) %>%
mutate(religpew = to_factor(religpew)) %>%
group_by(religpew) %>%
ct(pid7, wt = commonweight_vv) %>%
mutate(pid7 = frcode(pid7 == 1 ~ "Strong Democrat",
pid7 == 2 ~ "Not very\ns... |
data=read.table('household_power_consumption.txt',sep=';',header=TRUE, na.strings = "?")
data <- data[complete.cases(data),]
datasub <- subset(data, Date == "1/2/2007" | Date == "2/2/2007")
hist(datasub$Global_active_power, main = "Global Active Power", col = "red", xlab = "Global Active Power (kilowatts)")
dev.cop... | /4 - Exploratory Data Analysis/week1/plot1.R | no_license | carlosem/MyDataScience | R | false | false | 348 | r |
data=read.table('household_power_consumption.txt',sep=';',header=TRUE, na.strings = "?")
data <- data[complete.cases(data),]
datasub <- subset(data, Date == "1/2/2007" | Date == "2/2/2007")
hist(datasub$Global_active_power, main = "Global Active Power", col = "red", xlab = "Global Active Power (kilowatts)")
dev.cop... |
#tkae the "descriptions" data file and wrote out text files for me too look at.
main <- function(datafile, listfile, directory) {
oldwidth <- options("width")
on.exit(options(oldwidth), add=TRUE)
options(width=10000)
e <- new.env(parent=globalenv())
load(datafile, envir=e)
listing <- file(listfile, "w"... | /writeDescriptions.R | no_license | crowding/analysis | R | false | false | 847 | r | #tkae the "descriptions" data file and wrote out text files for me too look at.
main <- function(datafile, listfile, directory) {
oldwidth <- options("width")
on.exit(options(oldwidth), add=TRUE)
options(width=10000)
e <- new.env(parent=globalenv())
load(datafile, envir=e)
listing <- file(listfile, "w"... |
\encoding{UTF-8}
\name{simHDSopen}
\alias{simHDSopen}
\title{
Simulate open hierarchical distance sampling data
}
\description{
Simulates distance sampling data from a multi-season (or multi-year) model, incorporating habitat and detection covariates, temporary emigration, and a trend in abundance or density.
}... | /man/simHDSopen.Rd | no_license | guillaumesouchay/AHMbook | R | false | false | 3,240 | rd | \encoding{UTF-8}
\name{simHDSopen}
\alias{simHDSopen}
\title{
Simulate open hierarchical distance sampling data
}
\description{
Simulates distance sampling data from a multi-season (or multi-year) model, incorporating habitat and detection covariates, temporary emigration, and a trend in abundance or density.
}... |
library(triangle)
LCOE_NUCLEAR <- function(i=0.10, Fc=0.65, terms=40, count=10000){
# Nuclear
# Terms is the estimated lifetime of power plant
# count is the number of Monte Carlo replications
# i is the interest rate on capital costs
# Fc is fuel cost ($/MMBtu) - convert in-situ
##################... | /Energy_Optim_Project/Scripts_and_functions/LCOE_NUCLEAR.R | permissive | malooney/Economic_Optimization | R | false | false | 2,645 | r |
library(triangle)
LCOE_NUCLEAR <- function(i=0.10, Fc=0.65, terms=40, count=10000){
# Nuclear
# Terms is the estimated lifetime of power plant
# count is the number of Monte Carlo replications
# i is the interest rate on capital costs
# Fc is fuel cost ($/MMBtu) - convert in-situ
##################... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/byStrand.R
\name{byStrand}
\alias{byStrand}
\title{simple helper function to split a *RangesList by the strand of its mt target}
\usage{
byStrand(x, anno = NULL)
}
\arguments{
\item{x}{a *RangesList}
\item{anno}{optional feature annotation, ... | /man/byStrand.Rd | no_license | ttriche/MTseeker.Clippy | R | false | true | 517 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/byStrand.R
\name{byStrand}
\alias{byStrand}
\title{simple helper function to split a *RangesList by the strand of its mt target}
\usage{
byStrand(x, anno = NULL)
}
\arguments{
\item{x}{a *RangesList}
\item{anno}{optional feature annotation, ... |
#' @title Aliases
#' @name aliases
#' @description Aliases more pleasing to use in a dplyr pipeline:
#' \tabular{ll}{
#' \code{brackets} \tab \code{`[[`} \cr
#' \code{dollar} \tab \code{`$`} \cr
#' \code{is_in} \tab \code{`\%in\%`} \cr
#' \code{and} \tab ... | /R/aliases.R | no_license | 95teza/Tmisc | R | false | false | 2,002 | r | #' @title Aliases
#' @name aliases
#' @description Aliases more pleasing to use in a dplyr pipeline:
#' \tabular{ll}{
#' \code{brackets} \tab \code{`[[`} \cr
#' \code{dollar} \tab \code{`$`} \cr
#' \code{is_in} \tab \code{`\%in\%`} \cr
#' \code{and} \tab ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/date_management.R
\name{calc_target_string_end_date}
\alias{calc_target_string_end_date}
\title{Calculate the target end date by parsing a target specification string and
adding appropriate integer to \code{start_date}.}
\usage{
calc_target_s... | /man/calc_target_string_end_date.Rd | no_license | reichlab/covidEnsembles | R | false | true | 626 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/date_management.R
\name{calc_target_string_end_date}
\alias{calc_target_string_end_date}
\title{Calculate the target end date by parsing a target specification string and
adding appropriate integer to \code{start_date}.}
\usage{
calc_target_s... |
#install.packages("dplyr")
library("dplyr")
library("readr")
args <- commandArgs(TRUE)
if (length(args)!=2) {
stop("At least two argument must be supplied (input_file, output_file).", call.=FALSE)
}
cancerTable <- read_tsv("analysis_threshold_10_sorted")
pValues <- c()
visitedCancer <- c()
for(i in 1:nrow(cancerT... | /scripts/finalTopCancerAnalysis.R | no_license | zacdanielson/PANCAN_Bio465 | R | false | false | 1,329 | r | #install.packages("dplyr")
library("dplyr")
library("readr")
args <- commandArgs(TRUE)
if (length(args)!=2) {
stop("At least two argument must be supplied (input_file, output_file).", call.=FALSE)
}
cancerTable <- read_tsv("analysis_threshold_10_sorted")
pValues <- c()
visitedCancer <- c()
for(i in 1:nrow(cancerT... |
library(data.table)
## Reading test data
testdata <- fread("./UCI HAR Dataset/test/X_test.txt")
testactivity <- fread("./UCI HAR Dataset/test/y_test.txt")
testsubject <- fread("./UCI HAR Dataset/test/subject_test.txt")
## Reading training data
traindata <- fread("./UCI HAR Dataset/train/X_train.txt")
trainactivity <-... | /run_analysis.R | no_license | ricardorac/getcleandata | R | false | false | 2,273 | r | library(data.table)
## Reading test data
testdata <- fread("./UCI HAR Dataset/test/X_test.txt")
testactivity <- fread("./UCI HAR Dataset/test/y_test.txt")
testsubject <- fread("./UCI HAR Dataset/test/subject_test.txt")
## Reading training data
traindata <- fread("./UCI HAR Dataset/train/X_train.txt")
trainactivity <-... |
library(testthat)
library(LEANR)
test_check("LEANR") | /tests/testthat.R | no_license | fgwinner/LEANR | R | false | false | 56 | r | library(testthat)
library(LEANR)
test_check("LEANR") |
\name{precip.dep}
\alias{precip.dep}
\title{Cumulative precipitation departure}
\description{
Calculate the cumulative precipitation departure (\acronym{CPD}) for a station with a given precipitation normal.
}
\usage{
precip.dep(dat, norm, id)
}
\arguments{
\item{dat}{\code{data.frame} of climate data}
... | /man/precip.dep.Rd | no_license | cran/climate.plot | R | false | false | 2,078 | rd | \name{precip.dep}
\alias{precip.dep}
\title{Cumulative precipitation departure}
\description{
Calculate the cumulative precipitation departure (\acronym{CPD}) for a station with a given precipitation normal.
}
\usage{
precip.dep(dat, norm, id)
}
\arguments{
\item{dat}{\code{data.frame} of climate data}
... |
#' Retrieve structured products data from thousands of online retailers and e-commerce sites
#'
#' @md
#' @param query A string query containing the filters that define which products will be returned.
#' @param sort By default the results are sorted by relevancy. Acceptable values are
#' "`relevancy`", "`social... | /R/filter_products.R | no_license | hrbrmstr/webhose | R | false | false | 3,297 | r | #' Retrieve structured products data from thousands of online retailers and e-commerce sites
#'
#' @md
#' @param query A string query containing the filters that define which products will be returned.
#' @param sort By default the results are sorted by relevancy. Acceptable values are
#' "`relevancy`", "`social... |
library(shiny)
library(leaflet)
library(dbscan)
library(DT)
sampleLocations <- read.csv("./locations_sample.csv")
ui <- fluidPage(
titlePanel("Clustering Locations"),
sidebarLayout(
sidebarPanel(
sliderInput("eps",
"Clustering Radius:",
min = 0.0,
ma... | /shiny_cluster/app.R | permissive | averymavroudis/locations | R | false | false | 3,158 | r | library(shiny)
library(leaflet)
library(dbscan)
library(DT)
sampleLocations <- read.csv("./locations_sample.csv")
ui <- fluidPage(
titlePanel("Clustering Locations"),
sidebarLayout(
sidebarPanel(
sliderInput("eps",
"Clustering Radius:",
min = 0.0,
ma... |
test_that("Test suite aaf.R, seq_onion()",{
for(i in 1:2){
for(slerp in c(TRUE,FALSE)){
expect_silent(seq_onion(from=rquat(1),to=rquat(1),len=3,slerp=slerp))
expect_silent(seq_onion(from=roct(1),to=roct(1),len=3,slerp=slerp))
expect_silent(seq_onion(from=rquat(1),by=r... | /tests/testthat/test_aaf.R | no_license | RobinHankin/onion | R | false | false | 649 | r | test_that("Test suite aaf.R, seq_onion()",{
for(i in 1:2){
for(slerp in c(TRUE,FALSE)){
expect_silent(seq_onion(from=rquat(1),to=rquat(1),len=3,slerp=slerp))
expect_silent(seq_onion(from=roct(1),to=roct(1),len=3,slerp=slerp))
expect_silent(seq_onion(from=rquat(1),by=r... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cfd.semipar.mean.R
\name{cfd.semipar.mean}
\alias{cfd.semipar.mean}
\title{Mean Decomposition: semiparametric version}
\usage{
cfd.semipar.mean(
formula,
mediator,
group,
strata = NA,
nbin = 5,
data,
family = "binomial",
bs.si... | /man/cfd.semipar.mean.Rd | no_license | MaartenBijlsma/cfdecomp | R | false | true | 3,639 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cfd.semipar.mean.R
\name{cfd.semipar.mean}
\alias{cfd.semipar.mean}
\title{Mean Decomposition: semiparametric version}
\usage{
cfd.semipar.mean(
formula,
mediator,
group,
strata = NA,
nbin = 5,
data,
family = "binomial",
bs.si... |
# Normalize function
Normalize <- function(x) {
return((x - min(x)) / (max(x) - min(x)))
}
# Multiple plot function
#
# ggplot objects can be passed in ..., or to plotlist (as a list of ggplot objects)
# - cols: Number of columns in layout
# - layout: A matrix specifying the layout. If present, 'cols' is ignor... | /lab2_peer_review/lab2-3032998360/R/function.R | no_license | amyko/stat215a | R | false | false | 2,091 | r |
# Normalize function
Normalize <- function(x) {
return((x - min(x)) / (max(x) - min(x)))
}
# Multiple plot function
#
# ggplot objects can be passed in ..., or to plotlist (as a list of ggplot objects)
# - cols: Number of columns in layout
# - layout: A matrix specifying the layout. If present, 'cols' is ignor... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/DBI.R
\name{src_pool}
\alias{src_pool}
\title{Wrap DBI Database Connection Pool for dplyr use.}
\usage{
src_pool(pool)
}
\arguments{
\item{pool}{A pool object}
}
\description{
This functions opens a \code{dplyr}-compatible connection. If you'... | /man/src_pool.Rd | no_license | zzawadz/pool | R | false | true | 3,540 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/DBI.R
\name{src_pool}
\alias{src_pool}
\title{Wrap DBI Database Connection Pool for dplyr use.}
\usage{
src_pool(pool)
}
\arguments{
\item{pool}{A pool object}
}
\description{
This functions opens a \code{dplyr}-compatible connection. If you'... |
library(clikcorr)
### Name: lrt
### Title: censoring data and likelihood-based correlation estimation
### inference
### Aliases: lrt
### ** Examples
data(ND)
logND <- log(ND)
lrt(logND, "t1_TCDD", "t2_TCDD", "t1_PeCDD", "t2_PeCDD")
## Not run:
##D lrt(logND, "t1_TCDD", "t2_TCDD", "t1_PeCDD", "t2_PeCDD", dist=... | /data/genthat_extracted_code/clikcorr/examples/clikcorr.lrt.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 344 | r | library(clikcorr)
### Name: lrt
### Title: censoring data and likelihood-based correlation estimation
### inference
### Aliases: lrt
### ** Examples
data(ND)
logND <- log(ND)
lrt(logND, "t1_TCDD", "t2_TCDD", "t1_PeCDD", "t2_PeCDD")
## Not run:
##D lrt(logND, "t1_TCDD", "t2_TCDD", "t1_PeCDD", "t2_PeCDD", dist=... |
#' Construct a Linear Estimator
#'
#' Construct a linear model, which can be used to predict a continuous outcome
#' (in the case of `linear_regressor()`) or a categorical outcome (in the case
#' of `linear_classifier()`).
#'
#' @inheritParams estimators
#'
#' @param optimizer Either the name of the optimizer to be us... | /R/linear_estimators.R | no_license | cran/tfestimators | R | false | false | 2,537 | r | #' Construct a Linear Estimator
#'
#' Construct a linear model, which can be used to predict a continuous outcome
#' (in the case of `linear_regressor()`) or a categorical outcome (in the case
#' of `linear_classifier()`).
#'
#' @inheritParams estimators
#'
#' @param optimizer Either the name of the optimizer to be us... |
\name{MRSP.fit}
\alias{MRSP.fit}
\alias{MRSP.fit,ANY,ANY,ANY,ANY,ANY,ANY,ANY,ANY,list-method}
\alias{MRSP.fit,ANY,ANY,ANY,ANY,ANY,ANY,ANY,ANY,missing-method}
\alias{MRSP.fit,ANY,ANY,ANY,ANY,ANY,ANY,ANY,ANY,numeric-method}
\title{
Fitting function for multinomial response models with structured penalties
}
\de... | /man/MRSP.fit.Rd | no_license | cran/MRSP | R | false | false | 13,387 | rd | \name{MRSP.fit}
\alias{MRSP.fit}
\alias{MRSP.fit,ANY,ANY,ANY,ANY,ANY,ANY,ANY,ANY,list-method}
\alias{MRSP.fit,ANY,ANY,ANY,ANY,ANY,ANY,ANY,ANY,missing-method}
\alias{MRSP.fit,ANY,ANY,ANY,ANY,ANY,ANY,ANY,ANY,numeric-method}
\title{
Fitting function for multinomial response models with structured penalties
}
\de... |
testlist <- list(m = NULL, repetitions = -304992360L, in_m = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 0.000600285396124581), .Dim = c(3L, 1L )))
result <- do.call(CNull:::communities_individual_based_sampling_alpha,testlist)
str(result) | /CNull/inst/testfiles/communities_individual_based_sampling_alpha/AFL_communities_individual_based_sampling_alpha/communities_individual_based_sampling_alpha_valgrind_files/1615786539-test.R | no_license | akhikolla/updatedatatype-list2 | R | false | false | 253 | r | testlist <- list(m = NULL, repetitions = -304992360L, in_m = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 0.000600285396124581), .Dim = c(3L, 1L )))
result <- do.call(CNull:::communities_individual_based_sampling_alpha,testlist)
str(result) |
context("decDS-expt")
test_that("expt",
{
assign(".DangerEnv", new.env(), envir = .GlobalEnv)
settings <- list(env <- ".DangerEnv")
assign(".DangerSettings", settings, envir = .GlobalEnv)
expect_true(exists(".DangerEnv", envir = .GlobalEnv))
DangerEnv <- get(".DangerEnv", envir = .GlobalEnv)
expect_false(e... | /tests/testthat/test_decDS.R | no_license | patRyserWelch8/DangerIncAndDecServer | R | false | false | 894 | r | context("decDS-expt")
test_that("expt",
{
assign(".DangerEnv", new.env(), envir = .GlobalEnv)
settings <- list(env <- ".DangerEnv")
assign(".DangerSettings", settings, envir = .GlobalEnv)
expect_true(exists(".DangerEnv", envir = .GlobalEnv))
DangerEnv <- get(".DangerEnv", envir = .GlobalEnv)
expect_false(e... |
#Reading in the rockfish co-occurance file - your first species of interest should be in column one - there should be labels for columns (not rows)
# Change the file number to whatever you are reading in (make sure it is csv)
rocky <- read.csv(file="Rockstar_winter.csv",sep=",", stringsAsFactors=FALSE,header=FALSE)
#D... | /multiple_species_cooccurence.R | permissive | laninsky/species_occurence | R | false | false | 1,988 | r | #Reading in the rockfish co-occurance file - your first species of interest should be in column one - there should be labels for columns (not rows)
# Change the file number to whatever you are reading in (make sure it is csv)
rocky <- read.csv(file="Rockstar_winter.csv",sep=",", stringsAsFactors=FALSE,header=FALSE)
#D... |
#Mapas
#Addons para visualización
TilesBA <- 'https://servicios.usig.buenosaires.gob.ar/mapcache/tms/1.0.0/amba_con_transporte_3857@GoogleMapsCompatible/{z}/{x}/{-y}.png'
pal <- colorBin("Reds", domain = df$casos)
pal2 <- colorBin("Reds", domain = df$Casos7_5)
pal3 <- colorBin("Blues", domain = densidad$Densidad_pob, ... | /Mapas.r | no_license | bruno3a/EANT | R | false | false | 12,934 | r | #Mapas
#Addons para visualización
TilesBA <- 'https://servicios.usig.buenosaires.gob.ar/mapcache/tms/1.0.0/amba_con_transporte_3857@GoogleMapsCompatible/{z}/{x}/{-y}.png'
pal <- colorBin("Reds", domain = df$casos)
pal2 <- colorBin("Reds", domain = df$Casos7_5)
pal3 <- colorBin("Blues", domain = densidad$Densidad_pob, ... |
context('Log Density')
library(plyr)
library(reshape)
Gdep <- HurdleStructure(G=matrix(c(-2, 1, 1, -2), nrow=2),
H =matrix(c(2, 0, 0, 2), nrow=2),
K =diag(2))
Hlowdep <- HurdleStructure(G=diag(2)*-4, H=matrix(c(2, 1, 0, 2), nrow=2),K=diag(2))
Hupdep <- HurdleStructure... | /tests/testthat/test-HurdleDistributions.R | no_license | amcdavid/HurdleNormal | R | false | false | 3,452 | r | context('Log Density')
library(plyr)
library(reshape)
Gdep <- HurdleStructure(G=matrix(c(-2, 1, 1, -2), nrow=2),
H =matrix(c(2, 0, 0, 2), nrow=2),
K =diag(2))
Hlowdep <- HurdleStructure(G=diag(2)*-4, H=matrix(c(2, 1, 0, 2), nrow=2),K=diag(2))
Hupdep <- HurdleStructure... |
#' Extract SpatRaster overlap
#'
#' Extract the union of overlapping [terra] SpatRasters with different extents, origins, and projections.
#'
#' @details SpatRaster y will be transformed (e.g., projected, resampled) with respect to x if
#' extents, origins, or crs do not match.
#'
#' @param x,y SpatRaster.
#' @para... | /R/overlap.R | no_license | benjaminmisiuk/bulkshift | R | false | false | 1,521 | r | #' Extract SpatRaster overlap
#'
#' Extract the union of overlapping [terra] SpatRasters with different extents, origins, and projections.
#'
#' @details SpatRaster y will be transformed (e.g., projected, resampled) with respect to x if
#' extents, origins, or crs do not match.
#'
#' @param x,y SpatRaster.
#' @para... |
generate_cor_matrix <- function(vars = 3, cors = 0, mu = 0, sd = 1) {
if (length(mu) == 1) {
mu <- rep(mu, vars)
} else if (length(mu) != vars) {
stop("the length of mu must be 1 or vars");
}
if (length(sd) == 1) {
sd <- rep(sd, vars)
} else if (length(sd) != vars) {
stop("the length of sd... | /R/generate_cor_matrix.R | permissive | arcaldwell49/Superpower | R | false | false | 1,928 | r | generate_cor_matrix <- function(vars = 3, cors = 0, mu = 0, sd = 1) {
if (length(mu) == 1) {
mu <- rep(mu, vars)
} else if (length(mu) != vars) {
stop("the length of mu must be 1 or vars");
}
if (length(sd) == 1) {
sd <- rep(sd, vars)
} else if (length(sd) != vars) {
stop("the length of sd... |
#'
#'
#' Tropical Product of Vectors
#' This functio returns the product of two vectors. This function works only if both Vectors are of same length.
#' @param x A vector.
#' @param y A vector.
#'
#' @return Product of \code{x} and \code{y} in tropical algebra.
#'
#'
#' @examples
#' x<-c(5,6,7)
... | /R/tvectorMultiply.R | no_license | cran/tropAlgebra | R | false | false | 1,297 | r | #'
#'
#' Tropical Product of Vectors
#' This functio returns the product of two vectors. This function works only if both Vectors are of same length.
#' @param x A vector.
#' @param y A vector.
#'
#' @return Product of \code{x} and \code{y} in tropical algebra.
#'
#'
#' @examples
#' x<-c(5,6,7)
... |
## Put comments here that give an overall description of what your
## functions do
## this function gets simulates OO and creates 4 methods ,
## get , setInverse , getInverse and set
makeCacheMatrix <- function(x = matrix()) {
inverse <- NULL
set <-function(y) {
x<<-y #updates value of X
... | /cachematrix.R | no_license | guilhermeCoutinho/ProgrammingAssignment2 | R | false | false | 1,162 | r | ## Put comments here that give an overall description of what your
## functions do
## this function gets simulates OO and creates 4 methods ,
## get , setInverse , getInverse and set
makeCacheMatrix <- function(x = matrix()) {
inverse <- NULL
set <-function(y) {
x<<-y #updates value of X
... |
# Input: binsize, flankingLength, howManyBins (default: 1M)
# mergedPeaks (mergedPeakHeightMatrix_HumanFC_filtered.bed,
# mergedPeakHeightMatrix_EpiMap_filtered.bed,
# Brain_CagePeaks_filtered.bed,
# final.tf.bed)
# Host: RNA machine/KATANA
# RNA: Data dir: /Volumes/Data1/PR... | /Full Pipeline/full_pipeline_TF.R | no_license | Akmazad/deepPsych | R | false | false | 7,329 | r | # Input: binsize, flankingLength, howManyBins (default: 1M)
# mergedPeaks (mergedPeakHeightMatrix_HumanFC_filtered.bed,
# mergedPeakHeightMatrix_EpiMap_filtered.bed,
# Brain_CagePeaks_filtered.bed,
# final.tf.bed)
# Host: RNA machine/KATANA
# RNA: Data dir: /Volumes/Data1/PR... |
tar_test("set, get, exists, and unset target", {
x <- runtime_init()
expect_false(x$exists_target())
expect_null(x$get_target())
x$set_target(tar_target(x, 1))
expect_true(x$exists_target())
expect_true(inherits(x$get_target(), "tar_target"))
x$unset_target()
expect_false(x$exists_target())
expect_nul... | /tests/testthat/test-class_runtime.R | permissive | billdenney/targets | R | false | false | 1,759 | r | tar_test("set, get, exists, and unset target", {
x <- runtime_init()
expect_false(x$exists_target())
expect_null(x$get_target())
x$set_target(tar_target(x, 1))
expect_true(x$exists_target())
expect_true(inherits(x$get_target(), "tar_target"))
x$unset_target()
expect_false(x$exists_target())
expect_nul... |
rm(list=ls())
##------------------------------------------------------------------------------
## INITIALIZATION
##------------------------------------------------------------------------------
library(data.table)
## Steps to read civis data
## For key setup, see https://civisanalytics.github.io/civis-r/
library(civ... | /report_crosswalk_comparison/crosswalk_civis_github_example.R | permissive | Chicago/census2020_ward_rpt | R | false | false | 2,185 | r |
rm(list=ls())
##------------------------------------------------------------------------------
## INITIALIZATION
##------------------------------------------------------------------------------
library(data.table)
## Steps to read civis data
## For key setup, see https://civisanalytics.github.io/civis-r/
library(civ... |
#
## Read in all annotated bed files of peaks
#
nice R
library(GenomicRanges)
extend <- function(x, upstream=0, downstream=0)
{
if (any(strand(x) == "*"))
warning("'*' ranges were treated as '+'")
on_plus <- strand(x) == "+" | strand(x) == "*"
new_start <- start(x) - ifelse(on_plus, upstream, d... | /Shuchen_h3k27achighlow.R | no_license | emmabell42/general | R | false | false | 3,006 | r | #
## Read in all annotated bed files of peaks
#
nice R
library(GenomicRanges)
extend <- function(x, upstream=0, downstream=0)
{
if (any(strand(x) == "*"))
warning("'*' ranges were treated as '+'")
on_plus <- strand(x) == "+" | strand(x) == "*"
new_start <- start(x) - ifelse(on_plus, upstream, d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.