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 |
|---|---|---|---|---|---|---|---|---|---|
Principal Components Analysis
states=row.names(USArrests)
states
names(USArrests)
apply(USArrests, 2, mean)
apply(USArrests, 2, var)
pr.out=prcomp(USArrests, scale=TRUE)
names(pr.out)
pr.out$center
pr.out$scale
pr.out$rotation
dim(pr.out$x)
biplot(pr.out, scale=0)
pr.out$rotation=-pr.out$rotation
pr.out$x=-pr.out$x
bi... | /PCA.r | no_license | rushilgoyal/Principal_Component_Analysis | R | false | false | 654 | r | Principal Components Analysis
states=row.names(USArrests)
states
names(USArrests)
apply(USArrests, 2, mean)
apply(USArrests, 2, var)
pr.out=prcomp(USArrests, scale=TRUE)
names(pr.out)
pr.out$center
pr.out$scale
pr.out$rotation
dim(pr.out$x)
biplot(pr.out, scale=0)
pr.out$rotation=-pr.out$rotation
pr.out$x=-pr.out$x
bi... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/UNRATENSA.R
\docType{data}
\name{UNRATENSA}
\alias{UNRATENSA}
\title{Civilian Unemployment Rate}
\format{
An \code{\link{xts}} object of the Civilian Unemployment Rate.
\itemize{
\item\strong{Release:} {Employment Situation}
\item\strong{S... | /man/UNRATENSA.Rd | no_license | cran/neverhpfilter | R | false | true | 1,420 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/UNRATENSA.R
\docType{data}
\name{UNRATENSA}
\alias{UNRATENSA}
\title{Civilian Unemployment Rate}
\format{
An \code{\link{xts}} object of the Civilian Unemployment Rate.
\itemize{
\item\strong{Release:} {Employment Situation}
\item\strong{S... |
#----------------------------------------------------------------------------#
#' Basic ggplot theme.
#'
#' \
#'
#' @details Maintained by: Clara Marquardt
#'
#' @export
#' @import ggplot2
#'
#' @param title_size Font size - title (numeric) [default: 8].
#' @param subtitle_size Font size - sub title (numeric) [default... | /R/theme_basic.R | permissive | sysmedlab/ehR | R | false | false | 2,777 | r | #----------------------------------------------------------------------------#
#' Basic ggplot theme.
#'
#' \
#'
#' @details Maintained by: Clara Marquardt
#'
#' @export
#' @import ggplot2
#'
#' @param title_size Font size - title (numeric) [default: 8].
#' @param subtitle_size Font size - sub title (numeric) [default... |
# 4.1 Function documentation
?mean
help(mean)
args(mean)
# 4.2 Use a function
linkedin <- c(16, 9, 13, 5, 2, 17, 14)
facebook <- c(17, 7, 5, 16, 8, 13, 14)
avg_li <- mean(x = linkedin)
avg_fb <- mean(facebook)
avg_li
avg_fb
# 4.3 Use a function
avg_sum <- mean(linkedin + facebook)
avg_sum_trimmed <-... | /Intermediate R/Tutorials/4. Tutorial.r | no_license | TopicosSelectos/tutoriales-2019-2-mimi1698 | R | false | false | 2,013 | r | # 4.1 Function documentation
?mean
help(mean)
args(mean)
# 4.2 Use a function
linkedin <- c(16, 9, 13, 5, 2, 17, 14)
facebook <- c(17, 7, 5, 16, 8, 13, 14)
avg_li <- mean(x = linkedin)
avg_fb <- mean(facebook)
avg_li
avg_fb
# 4.3 Use a function
avg_sum <- mean(linkedin + facebook)
avg_sum_trimmed <-... |
restData <- read.csv("restaurants.csv")
# Creating sequences
s1 <- seq(1, 10, by=2); s1
s2 <- seq(1, 10, length=3); s2
x <- c(1,3,8,25,100); seq(along = x)
# Subsetting variables
str(restData)
restData$nearMe <- restData$neighborhood %in% c("Roland Park", "Homeland")
table(restData$nearMe)
# Creating binary variabl... | /Coursera/Data Science (JHU)/03 Getting and cleaning data/Week 3/03_03_creatingNewVariables.R | no_license | abudish/Course_Materials_and_Certificates | R | false | false | 1,221 | r | restData <- read.csv("restaurants.csv")
# Creating sequences
s1 <- seq(1, 10, by=2); s1
s2 <- seq(1, 10, length=3); s2
x <- c(1,3,8,25,100); seq(along = x)
# Subsetting variables
str(restData)
restData$nearMe <- restData$neighborhood %in% c("Roland Park", "Homeland")
table(restData$nearMe)
# Creating binary variabl... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{howto}
\alias{howto}
\title{How to use a package}
\usage{
howto(package)
}
\arguments{
\item{package}{a package to open vigettes of.}
}
\value{
Vignette data, invisibly.
}
\description{
Open all package vignettes in browser tabs... | /man/howto.Rd | no_license | johnfrye/fryeutilities | R | false | true | 385 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{howto}
\alias{howto}
\title{How to use a package}
\usage{
howto(package)
}
\arguments{
\item{package}{a package to open vigettes of.}
}
\value{
Vignette data, invisibly.
}
\description{
Open all package vignettes in browser tabs... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ICUcapacity_FR.R
\docType{data}
\name{ICUcapacity_FR}
\alias{ICUcapacity_FR}
\title{Numbers of ICU beds in France}
\format{
A data frame with 19 rows and 2 variables
}
\source{
DREEES 2018 \url{https://www.sae-diffusion.sante.gouv.fr/sae-diff... | /man/ICUcapacity_FR.Rd | permissive | sistm/SEIRcovid19 | R | false | true | 730 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ICUcapacity_FR.R
\docType{data}
\name{ICUcapacity_FR}
\alias{ICUcapacity_FR}
\title{Numbers of ICU beds in France}
\format{
A data frame with 19 rows and 2 variables
}
\source{
DREEES 2018 \url{https://www.sae-diffusion.sante.gouv.fr/sae-diff... |
library(ribiosNGS)
library(testthat)
test_that("readMpsnakeAsDGEList works", {
mpsnakeDir <- system.file("extdata/mpsnake-minimal-outdir", package="ribiosNGS")
mpsDgeList <- readMpsnakeAsDGEList(mpsnakeDir)
#' ## equivalent
mpsnakeResDir <- system.file("extdata/mpsnake-minimal-outdir/results", package="ribi... | /tests/testthat/test-readMpsnakeAsDGEList.R | no_license | bedapub/ribiosNGS | R | false | false | 1,559 | r | library(ribiosNGS)
library(testthat)
test_that("readMpsnakeAsDGEList works", {
mpsnakeDir <- system.file("extdata/mpsnake-minimal-outdir", package="ribiosNGS")
mpsDgeList <- readMpsnakeAsDGEList(mpsnakeDir)
#' ## equivalent
mpsnakeResDir <- system.file("extdata/mpsnake-minimal-outdir/results", package="ribi... |
#This function creates object that cache its inverse
makeCacheMatrix<-function(x=matrix()){
inv<-NULL
set<-function(funtion(y){
x<<-y
inv<<-NULL
}
get<-function()x
setInverse<-funtion(inverse) inv<<- inverse
getInverse<-funtion() inv
list(set=set,
get=get,
setInverse=setInverse,
getInverse=getInvers... | /ProgrammingAssignment2/cachematrix.R | no_license | vikranthkasi/GitTestNew | R | false | false | 615 | r | #This function creates object that cache its inverse
makeCacheMatrix<-function(x=matrix()){
inv<-NULL
set<-function(funtion(y){
x<<-y
inv<<-NULL
}
get<-function()x
setInverse<-funtion(inverse) inv<<- inverse
getInverse<-funtion() inv
list(set=set,
get=get,
setInverse=setInverse,
getInverse=getInvers... |
#' @title FLR to srmsymc
#'
#' @description XXX
#'
#' @export
#'
#' @param stk FLStock object
#' @param y Years
#' @param name_stock Name of the stock. May later down the line be used in
#' table and plot outputs
#' @param filename_age Name of the associated file containing biological (weights,
#' maturity and mort... | /R/srmsymc_converter.R | no_license | AndyCampbell/msy | R | false | false | 23,485 | r | #' @title FLR to srmsymc
#'
#' @description XXX
#'
#' @export
#'
#' @param stk FLStock object
#' @param y Years
#' @param name_stock Name of the stock. May later down the line be used in
#' table and plot outputs
#' @param filename_age Name of the associated file containing biological (weights,
#' maturity and mort... |
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
huber_weight <- function(x, cw) {
.Call('_RobustFPLM_huber_weight', PACKAGE = 'RobustFPLM', x, cw)
}
huber_rho <- function(x, cw) {
.Call('_RobustFPLM_huber_rho', PACKAGE = 'RobustFPLM... | /R/RcppExports.R | no_license | ywbetter/RobustFPLM | R | false | false | 473 | r | # Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
huber_weight <- function(x, cw) {
.Call('_RobustFPLM_huber_weight', PACKAGE = 'RobustFPLM', x, cw)
}
huber_rho <- function(x, cw) {
.Call('_RobustFPLM_huber_rho', PACKAGE = 'RobustFPLM... |
library(dplyr)
morph <- read.csv('input/morph_data.csv', header = T)
## subsetting parameters ----
mammalsp <- c(1,2,5,6)
nafodiet <- c('2H','2J','3K')
dietby <- c('year', 'mmsp')
## look only at data from main stomach and nafo Divs ----
diet <- diet[which(diet$digestivetractsection == 'Main Stomac... | /analysis/mm_weight_dist.R | no_license | adbpatagonia/SealDietAnalysis | R | false | false | 1,414 | r | library(dplyr)
morph <- read.csv('input/morph_data.csv', header = T)
## subsetting parameters ----
mammalsp <- c(1,2,5,6)
nafodiet <- c('2H','2J','3K')
dietby <- c('year', 'mmsp')
## look only at data from main stomach and nafo Divs ----
diet <- diet[which(diet$digestivetractsection == 'Main Stomac... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AccountBalance.R
\name{AccountBalance}
\alias{AccountBalance}
\alias{accountbalance}
\alias{getbalance}
\alias{get_account_balance}
\title{Retrieve MTurk account balance}
\usage{
AccountBalance()
}
\value{
Returns a list of length 2: \dQuote{... | /man/AccountBalance.Rd | no_license | cloudyr/pyMTurkR | R | false | true | 1,032 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AccountBalance.R
\name{AccountBalance}
\alias{AccountBalance}
\alias{accountbalance}
\alias{getbalance}
\alias{get_account_balance}
\title{Retrieve MTurk account balance}
\usage{
AccountBalance()
}
\value{
Returns a list of length 2: \dQuote{... |
library(DiffBind)
library(microbenchmark)
bin = 250
method = 'DiffBind'
mark = 'EZH2'
cell = 'Encode_threecells'
chip1 = c(
'wgEncodeBroadHistoneHelas3Ezh239875AlnRep1.markdup.q10.sorted.bam',
'wgEncodeBroadHistoneHelas3Ezh239875AlnRep2.markdup.q10.sorted.bam'
)
chip2 = c(
'wgEncodeBroadHistoneHepg2Ezh239875Al... | /Public/DiffBind/EZH2/Encode_threecells/DiffBind_EZH2_Encode_threecells_250bp.R | permissive | plbaldoni/epigraHMMPaper | R | false | false | 4,518 | r | library(DiffBind)
library(microbenchmark)
bin = 250
method = 'DiffBind'
mark = 'EZH2'
cell = 'Encode_threecells'
chip1 = c(
'wgEncodeBroadHistoneHelas3Ezh239875AlnRep1.markdup.q10.sorted.bam',
'wgEncodeBroadHistoneHelas3Ezh239875AlnRep2.markdup.q10.sorted.bam'
)
chip2 = c(
'wgEncodeBroadHistoneHepg2Ezh239875Al... |
#' Connect to pelagic database
#'
#' @param dbname Database name
connect_to_pelagic = function(dbname = "pelagic"){
require(RpgSQL)
# it does not work from loval
con <- dbConnect(pgSQL(),host='baseline.stanford.edu',user = "postgres", password = "DELETED", dbname = dbname) # this works in remote R
con
#icc... | /R/connect_to_pelagic.R | no_license | seananderson/sharkbase | R | false | false | 575 | r | #' Connect to pelagic database
#'
#' @param dbname Database name
connect_to_pelagic = function(dbname = "pelagic"){
require(RpgSQL)
# it does not work from loval
con <- dbConnect(pgSQL(),host='baseline.stanford.edu',user = "postgres", password = "DELETED", dbname = dbname) # this works in remote R
con
#icc... |
# ---------------------------------------------------------------------------------
# carregando pacotes para Large Data
library(ff)
library(ffbase)
library(tidyverse)
# Baixar a base do SAEB 2019 no endereço abaixo e salvar na pasta bases_originais
# https://download.inep.gov.br/microdados/microdados_saeb_2019.zip
# n... | /scripts/06_large_data.R | no_license | marcosabmelo/eletiva_analise_dados | R | false | false | 1,425 | r | # ---------------------------------------------------------------------------------
# carregando pacotes para Large Data
library(ff)
library(ffbase)
library(tidyverse)
# Baixar a base do SAEB 2019 no endereço abaixo e salvar na pasta bases_originais
# https://download.inep.gov.br/microdados/microdados_saeb_2019.zip
# n... |
#YJLs code for making dotplots
# ggplot2 point plot (pp) with specified circle size
library(ggplot2)
# GO_BP
# ggplot2 point plot (pp) with specified circle size (5x5.5 inches)
data <- read.table("/Users/JulianKimura/Documents/Lab/Single_Cell_Seq/Post_Embryonic/RH_For_JK_URD_Data2/JK_embedding/HJ/filtered/GO_dotplots/... | /GO_dotplots.R | no_license | JulianKimura/Hulett_etal | R | false | false | 2,277 | r | #YJLs code for making dotplots
# ggplot2 point plot (pp) with specified circle size
library(ggplot2)
# GO_BP
# ggplot2 point plot (pp) with specified circle size (5x5.5 inches)
data <- read.table("/Users/JulianKimura/Documents/Lab/Single_Cell_Seq/Post_Embryonic/RH_For_JK_URD_Data2/JK_embedding/HJ/filtered/GO_dotplots/... |
# rankall <- function(outcome, num = "best") {
# ## Read outcome data
# data <- read.csv("outcome-of-care-measures.csv",colClasses = "character")
#
# ## Check that state and outcome are valid
#
# outcomes <- c("heart attack","heart failure","pneumonia")
#
# if ((outcome %in% outcomes)==FALSE) {
# ... | /rankall.R | no_license | sonarshalaka/R-Programming-week4 | R | false | false | 3,289 | r | # rankall <- function(outcome, num = "best") {
# ## Read outcome data
# data <- read.csv("outcome-of-care-measures.csv",colClasses = "character")
#
# ## Check that state and outcome are valid
#
# outcomes <- c("heart attack","heart failure","pneumonia")
#
# if ((outcome %in% outcomes)==FALSE) {
# ... |
# prepare data
results = read.csv("times.csv",sep=";")
avg_results = aggregate( time_better ~ size, data=results, FUN=mean)
avg_results$time_naive = aggregate(time_naive ~ size,data = results,FUN = mean)$time_naive
avg_results$sd_time_better = aggregate(time_better ~ size,data=results,FUN = sd)$time_better
avg_results$... | /lab05/create_aggregate_data.R | no_license | mimagiera/mownit-agh | R | false | false | 1,372 | r | # prepare data
results = read.csv("times.csv",sep=";")
avg_results = aggregate( time_better ~ size, data=results, FUN=mean)
avg_results$time_naive = aggregate(time_naive ~ size,data = results,FUN = mean)$time_naive
avg_results$sd_time_better = aggregate(time_better ~ size,data=results,FUN = sd)$time_better
avg_results$... |
source('read_data.R')
with(t, {
plot(Sub_metering_1~dateTime, type="l",
ylab="Global Active Power (kilowatts)", xlab="")
lines(Sub_metering_2~dateTime,col='Red')
lines(Sub_metering_3~dateTime,col='Blue')
})
legend("topright", col=c("black", "red", "blue"), lwd=c(1,1,1),
c("Sub_metering_... | /plot3.R | no_license | xarus01/ExData_Plotting1 | R | false | false | 423 | r | source('read_data.R')
with(t, {
plot(Sub_metering_1~dateTime, type="l",
ylab="Global Active Power (kilowatts)", xlab="")
lines(Sub_metering_2~dateTime,col='Red')
lines(Sub_metering_3~dateTime,col='Blue')
})
legend("topright", col=c("black", "red", "blue"), lwd=c(1,1,1),
c("Sub_metering_... |
#
# select_nesting.R, 16 Jan 20
# Data from:
# The New {C} Standard: {An} Economic and Cultural Commentary
# Derek M. Jones
#
# Example from:
# Evidence-based Software Engineering: based on the publicly available data
# Derek M. Jones
#
# TAG C selection-statement_nesting source-code_C
source("ESEUR_config.r")
plot... | /sourcecode/select_nesting.R | no_license | Derek-Jones/ESEUR-code-data | R | false | false | 1,350 | r | #
# select_nesting.R, 16 Jan 20
# Data from:
# The New {C} Standard: {An} Economic and Cultural Commentary
# Derek M. Jones
#
# Example from:
# Evidence-based Software Engineering: based on the publicly available data
# Derek M. Jones
#
# TAG C selection-statement_nesting source-code_C
source("ESEUR_config.r")
plot... |
#Reading data
data <- read.table("household_power_consumption.txt", header=TRUE, sep=";", stringsAsFactors=FALSE, dec=".",na.strings="?")
#subseting the data from the dates 2007-02-01 and 2007-02-02
reqData <- data[data$Date %in% c("1/2/2007","2/2/2007") ,]
#converting the dates to right format
reqData$Datetim... | /plot4.R | no_license | arunbv123/ExploratoryDataAnalysis | R | false | false | 1,166 | r | #Reading data
data <- read.table("household_power_consumption.txt", header=TRUE, sep=";", stringsAsFactors=FALSE, dec=".",na.strings="?")
#subseting the data from the dates 2007-02-01 and 2007-02-02
reqData <- data[data$Date %in% c("1/2/2007","2/2/2007") ,]
#converting the dates to right format
reqData$Datetim... |
rm(list=ls())
options(stringsAsFactors = FALSE)
setwd("/net/wong05/home/liz86/Steffi/primary_vs_mets/")
## load data
load("Data_v2/tpm.RData")
log2tpm <- log2(tpm + 1)
load("Data_v2/gene_annot_biomart.RData")
load("Data_v2/sample_annot.RData")
length(unique(gene_annot_biomart[,"external_gene_name_v2"])) #55644
dup_ge... | /Code/convert_to_unique_genes.R | no_license | lizhu06/TILsComparison_PBTvsMET | R | false | false | 1,507 | r | rm(list=ls())
options(stringsAsFactors = FALSE)
setwd("/net/wong05/home/liz86/Steffi/primary_vs_mets/")
## load data
load("Data_v2/tpm.RData")
log2tpm <- log2(tpm + 1)
load("Data_v2/gene_annot_biomart.RData")
load("Data_v2/sample_annot.RData")
length(unique(gene_annot_biomart[,"external_gene_name_v2"])) #55644
dup_ge... |
#######################################################################
# 전현직 대통령 연설문 연습문제
#######################################################################
park <- file("data\\park.txt", encoding="UTF-8")
myline <- readLines(park)
myline
myword <- sapply(myline, extractNoun, USE.NAMES=F)
myword
result <-... | /text_mining_president.R | no_license | HappyBottle/Bottles | R | false | false | 1,496 | r | #######################################################################
# 전현직 대통령 연설문 연습문제
#######################################################################
park <- file("data\\park.txt", encoding="UTF-8")
myline <- readLines(park)
myline
myword <- sapply(myline, extractNoun, USE.NAMES=F)
myword
result <-... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/SBGN.to.SVG.R
\name{renderSbgn}
\alias{renderSbgn}
\title{Overlay omics data on a SBGN pathway graph and output image files.}
\usage{
renderSbgn(
input.sbgn,
output.file,
output.formats,
sbgn.id.attr,
glyphs.user = list(),
arcs.us... | /man/renderSbgn.Rd | no_license | datapplab/SBGNview | R | false | true | 12,827 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/SBGN.to.SVG.R
\name{renderSbgn}
\alias{renderSbgn}
\title{Overlay omics data on a SBGN pathway graph and output image files.}
\usage{
renderSbgn(
input.sbgn,
output.file,
output.formats,
sbgn.id.attr,
glyphs.user = list(),
arcs.us... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/objectSetOfTimePoints.R
\docType{class}
\name{SetOfTimePoints-class}
\alias{SetOfTimePoints-class}
\alias{SetOfTimePoints}
\alias{setOfTimePoints}
\title{S4 class SetOfTimePoints representing a set of designs with given time points}
\descript... | /man/SetOfTimePoints-class.Rd | no_license | cran/microsamplingDesign | R | false | true | 1,082 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/objectSetOfTimePoints.R
\docType{class}
\name{SetOfTimePoints-class}
\alias{SetOfTimePoints-class}
\alias{SetOfTimePoints}
\alias{setOfTimePoints}
\title{S4 class SetOfTimePoints representing a set of designs with given time points}
\descript... |
if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager")
BiocManager::version()
# If your bioconductor version is previous to 3.9, see the section bellow
## Required
BiocManager::install(c("AUCell", "RcisTarget"))
BiocManager::install(c("GENIE3")) # Optional. Can be replaced by GRNBoos... | /for_install_SCENIC_reqiured_packages.r | no_license | WinterFor/Telomerase.top | R | false | false | 894 | r | if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager")
BiocManager::version()
# If your bioconductor version is previous to 3.9, see the section bellow
## Required
BiocManager::install(c("AUCell", "RcisTarget"))
BiocManager::install(c("GENIE3")) # Optional. Can be replaced by GRNBoos... |
# Data wrangling in R
# Created by jdegen on Sep 17, 2016
# Modified by jdegen on May 11, 2018
library(tidyverse)
# Load datasets. R will automatically read the contents of these files into data.frames.
wide = read.csv("data/lexdec_wide.csv")
head(wide)
wordinfo = read.csv("data/wordinfo.csv")
head(wordinfo)
# If yo... | /code_sheets/3_reformatting_data.R | permissive | willclapp/Replication245B | R | false | false | 3,174 | r | # Data wrangling in R
# Created by jdegen on Sep 17, 2016
# Modified by jdegen on May 11, 2018
library(tidyverse)
# Load datasets. R will automatically read the contents of these files into data.frames.
wide = read.csv("data/lexdec_wide.csv")
head(wide)
wordinfo = read.csv("data/wordinfo.csv")
head(wordinfo)
# If yo... |
#Script to analyze environmental factors, and their significances, in shaping trends in zeta diversity.
library("plyr")
library(dplyr)
library("ggplot2")
library(lubridate)
library("ape")
library("vegan")
library("microbiome")
library(data.table)
library(tidyr)
library(MASS)
library(zetadiv)
library(magrittr)
library(s... | /ZetaFactors.R | no_license | levisimons/SCCWRP | R | false | false | 8,010 | r | #Script to analyze environmental factors, and their significances, in shaping trends in zeta diversity.
library("plyr")
library(dplyr)
library("ggplot2")
library(lubridate)
library("ape")
library("vegan")
library("microbiome")
library(data.table)
library(tidyr)
library(MASS)
library(zetadiv)
library(magrittr)
library(s... |
# Empirical Macro Model of my THESIS
#
# INIT ####
options(max.print=3000)
# set working Directory
setwd("C:/Users/Ferdi/Documents/R/C5")
setwd("C:/Users/fouwe/Documents/R/C5")
library(tseries)
library(vars)
library(lmtest)
library(urca)
library(ardl)
library(outliers)
library(strucchange)
## library(gvlma)
# Data --... | /Recap.R | no_license | Fouwed/C5 | R | false | false | 33,544 | r | # Empirical Macro Model of my THESIS
#
# INIT ####
options(max.print=3000)
# set working Directory
setwd("C:/Users/Ferdi/Documents/R/C5")
setwd("C:/Users/fouwe/Documents/R/C5")
library(tseries)
library(vars)
library(lmtest)
library(urca)
library(ardl)
library(outliers)
library(strucchange)
## library(gvlma)
# Data --... |
# Download classifying and cleaning tweets
rm(list = ls())
source("twitterAuthorization.R")
source("dataRetriever.R")
source("preprocessing.R")
source("corpusBuilding.R")
source("emojiRetriever.R")
num <- 500
size <- "small"
emojiDict <- readEmojiDictionary("./data/emoji_dictionary.csv")
emoteDict <- readEmoticonDic... | /downloadTweets.R | no_license | hucara/eanalysis_rio | R | false | false | 4,416 | r |
# Download classifying and cleaning tweets
rm(list = ls())
source("twitterAuthorization.R")
source("dataRetriever.R")
source("preprocessing.R")
source("corpusBuilding.R")
source("emojiRetriever.R")
num <- 500
size <- "small"
emojiDict <- readEmojiDictionary("./data/emoji_dictionary.csv")
emoteDict <- readEmoticonDic... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{ecg_beats}
\alias{ecg_beats}
\title{Killer whale heart beats recorded by ECG}
\format{
An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 1075 rows and 3 columns.
}
\usage{
ecg_beat... | /man/ecg_beats.Rd | permissive | FlukeAndFeather/cetaceanbcg | R | false | true | 400 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{ecg_beats}
\alias{ecg_beats}
\title{Killer whale heart beats recorded by ECG}
\format{
An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 1075 rows and 3 columns.
}
\usage{
ecg_beat... |
## ------- ptmScan.R -------------- ##
# #
# p.scan #
# ac.scan #
# me.scan #
# ub.scan #
# su.scan #
# gl.scan #
# sni.... | /ptm_0.1.0/R/ptmScan.R | no_license | jcaledo/ptm | R | false | false | 23,680 | r | ## ------- ptmScan.R -------------- ##
# #
# p.scan #
# ac.scan #
# me.scan #
# ub.scan #
# su.scan #
# gl.scan #
# sni.... |
plot.AcrossTic <- function (x, X.values, y, grp.cols = c(2, 4), grp.pch = c(16, 17), ...)
{
#
# plot an AcrossTic object. This is intended for a two-column X and
# a two-level y.
#
# If X is supplied, use it. Otherwise use the "X" component of the
# AcrossTic object. If neither is supplied, that's an error.
#... | /R/plot.AcrossTic.R | no_license | cran/AcrossTic | R | false | false | 2,135 | r | plot.AcrossTic <- function (x, X.values, y, grp.cols = c(2, 4), grp.pch = c(16, 17), ...)
{
#
# plot an AcrossTic object. This is intended for a two-column X and
# a two-level y.
#
# If X is supplied, use it. Otherwise use the "X" component of the
# AcrossTic object. If neither is supplied, that's an error.
#... |
#' @useDynLib parglm
#' @importFrom Rcpp sourceCpp
NULL
#' @name parglm
#' @title Fitting Generalized Linear Models in Parallel
#'
#' @description Function like \code{\link{glm}} which can make the computation
#' in parallel. The function supports most families listed in \code{\link{family}}.
#' See "\code{vignette("p... | /R/parglm.R | no_license | boennecd/parglm | R | false | false | 11,843 | r | #' @useDynLib parglm
#' @importFrom Rcpp sourceCpp
NULL
#' @name parglm
#' @title Fitting Generalized Linear Models in Parallel
#'
#' @description Function like \code{\link{glm}} which can make the computation
#' in parallel. The function supports most families listed in \code{\link{family}}.
#' See "\code{vignette("p... |
#' Find PWS within the cities
#'
#' @description Find PWS within the cities
#'
#' @param myKey key to access Wunderground API
#' @param nearbyCities a vector of city names formated as {state}/{city} for US cities and {country}/{city} for cities in other countries
#' @param maxPerCity a numeric scalar that sets a limit ... | /weatherProject/R/findPWS.R | no_license | DrRoad/Wunderground-Weather-Project | R | false | false | 3,113 | r | #' Find PWS within the cities
#'
#' @description Find PWS within the cities
#'
#' @param myKey key to access Wunderground API
#' @param nearbyCities a vector of city names formated as {state}/{city} for US cities and {country}/{city} for cities in other countries
#' @param maxPerCity a numeric scalar that sets a limit ... |
## File Name: frm_formula_extract_terms.R
## File Version: 0.10
frm_formula_extract_terms <- function(formula)
{
dv_form <- formula[[2]]
iv_form <- formula[[3]]
h1 <- all.vars(formula)
h2 <- stats::terms(formula)
terms_formula_transform <- FALSE
X_factors <- colnames( attr(h2,"factors... | /R/frm_formula_extract_terms.R | no_license | cran/mdmb | R | false | false | 790 | r | ## File Name: frm_formula_extract_terms.R
## File Version: 0.10
frm_formula_extract_terms <- function(formula)
{
dv_form <- formula[[2]]
iv_form <- formula[[3]]
h1 <- all.vars(formula)
h2 <- stats::terms(formula)
terms_formula_transform <- FALSE
X_factors <- colnames( attr(h2,"factors... |
\name{syn.survctree}
\alias{syn.survctree}
%\alias{syn.survctree.proper}
\title{Synthesis of survival time by classification and regression trees (CART)}
\description{
Generates synthetic event indicator and time to event data using
classification and regression trees (without or with bootstrap).
}
\usage{... | /man/syn.survctree.Rd | no_license | xfang-cloud/SynthpopDebug | R | false | false | 2,134 | rd | \name{syn.survctree}
\alias{syn.survctree}
%\alias{syn.survctree.proper}
\title{Synthesis of survival time by classification and regression trees (CART)}
\description{
Generates synthetic event indicator and time to event data using
classification and regression trees (without or with bootstrap).
}
\usage{... |
###############################################################################
# TANOVA: test.R
#
# TODO: Add comment
#
# Author: Weihong
# Mar 20, 2009, 2009
###############################################################################
group.ix<-function(f1,f2){
n1<-nlevels(as.factor(f1))
n2<-nlevels(a... | /TANOVA/R/group.ix.R | no_license | ingted/R-Examples | R | false | false | 463 | r | ###############################################################################
# TANOVA: test.R
#
# TODO: Add comment
#
# Author: Weihong
# Mar 20, 2009, 2009
###############################################################################
group.ix<-function(f1,f2){
n1<-nlevels(as.factor(f1))
n2<-nlevels(a... |
library(magrittr)
library(tidyverse)
# Import -------------
rm(list = ls())
nestdb <- readRDS("rdsobj/nestdb.RDS")
nestdb_md5 <- tools::md5sum("rdsobj/nestdb.RDS")
coln <- read.csv('reference/col_names.csv', header = FALSE)
# Analysis -------------------
## Age(mean,sd)
age <- nestdb %>%
summarise(
mean = mean... | /BLDescr.R | no_license | kalsajana/prostatecancer | R | false | false | 2,604 | r | library(magrittr)
library(tidyverse)
# Import -------------
rm(list = ls())
nestdb <- readRDS("rdsobj/nestdb.RDS")
nestdb_md5 <- tools::md5sum("rdsobj/nestdb.RDS")
coln <- read.csv('reference/col_names.csv', header = FALSE)
# Analysis -------------------
## Age(mean,sd)
age <- nestdb %>%
summarise(
mean = mean... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lgb.unloader.R
\name{lgb.unloader}
\alias{lgb.unloader}
\title{Remove lightgbm and its objects from an environment}
\usage{
lgb.unloader(restore = TRUE, wipe = FALSE, envir = .GlobalEnv)
}
\arguments{
\item{restore}{Whether to reload \code{Li... | /R-package/man/lgb.unloader.Rd | permissive | edwarchou/LightGBM | R | false | true | 1,817 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lgb.unloader.R
\name{lgb.unloader}
\alias{lgb.unloader}
\title{Remove lightgbm and its objects from an environment}
\usage{
lgb.unloader(restore = TRUE, wipe = FALSE, envir = .GlobalEnv)
}
\arguments{
\item{restore}{Whether to reload \code{Li... |
AttachMnems <- function(fulldbmelted,srcDir){
codedir <- "Directory-namestonaicscodes-2.xlsx"
smerge <- "SeriesMerge"
naicsdir <- paste(srcDir, eval(codedir), sep = "")
mnems <- as.data.table(read_excel(naicsdir, na = "NA", sheet = "FinalMnem", col_names = TRUE))
sectors <- as.data.table(read_excel(naic... | /code/functions/AttachMnemonics.R | no_license | fpalacio-OE/eccc | R | false | false | 2,482 | r |
AttachMnems <- function(fulldbmelted,srcDir){
codedir <- "Directory-namestonaicscodes-2.xlsx"
smerge <- "SeriesMerge"
naicsdir <- paste(srcDir, eval(codedir), sep = "")
mnems <- as.data.table(read_excel(naicsdir, na = "NA", sheet = "FinalMnem", col_names = TRUE))
sectors <- as.data.table(read_excel(naic... |
############################################################################
#Step 1: Download data, unzipe, and create list of all files in zipped file
#Steps that do not need to be repeated more than once are commented out
setwd("C:\\Users\\Diane\\Desktop\\workingDirectory")
file="https://d396qusza40orc.cloudfront.ne... | /plot1.R | no_license | dmenuz/ExData_Plotting1 | R | false | false | 1,253 | r | ############################################################################
#Step 1: Download data, unzipe, and create list of all files in zipped file
#Steps that do not need to be repeated more than once are commented out
setwd("C:\\Users\\Diane\\Desktop\\workingDirectory")
file="https://d396qusza40orc.cloudfront.ne... |
# Create a combo table to show breakdown of multiple choice answers
mycombolocus = data.frame(
Informatics = mysurveys[,paste0(myvarstub,'_locus_options___1')],
ResearchOffice = mysurveys[,paste0(myvarstub,'_locus_options___2')],
IT = mysurveys[,paste0(myvarstub,'_locus_options___3')],
Other = mysurveys[,paste... | /answercombo.R | no_license | firaswehbe/ctsa-sustainability | R | false | false | 890 | r | # Create a combo table to show breakdown of multiple choice answers
mycombolocus = data.frame(
Informatics = mysurveys[,paste0(myvarstub,'_locus_options___1')],
ResearchOffice = mysurveys[,paste0(myvarstub,'_locus_options___2')],
IT = mysurveys[,paste0(myvarstub,'_locus_options___3')],
Other = mysurveys[,paste... |
library(memoise)
nps_cats <<-list("promoter" = "promoter","detractor" = "detractor")
getIgraph <- memoise(function(nps_cat) {
# Careful not to let just any name slip in here; a
# malicious user could manipulate this value.
backbone <- readRDS(file = sprintf("%s.rda", nps_cat))
}) | /dashboard/global.R | no_license | jamiewan1989/LDA-topicmodel | R | false | false | 289 | r | library(memoise)
nps_cats <<-list("promoter" = "promoter","detractor" = "detractor")
getIgraph <- memoise(function(nps_cat) {
# Careful not to let just any name slip in here; a
# malicious user could manipulate this value.
backbone <- readRDS(file = sprintf("%s.rda", nps_cat))
}) |
## Test draw() methods
## load packages
library("testthat")
library("gratia")
library("mgcv")
library("ggplot2")
library("vdiffr")
context("draw-methods")
## Fit models
set.seed(1)
dat1 <- gamSim(1, n = 400, dist = "normal", scale = 2, verbose = FALSE)
m1 <- gam(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = dat1, method... | /tests/testthat/test-draw-methods.R | permissive | romainfrancois/gratia | R | false | false | 16,161 | r | ## Test draw() methods
## load packages
library("testthat")
library("gratia")
library("mgcv")
library("ggplot2")
library("vdiffr")
context("draw-methods")
## Fit models
set.seed(1)
dat1 <- gamSim(1, n = 400, dist = "normal", scale = 2, verbose = FALSE)
m1 <- gam(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = dat1, method... |
testlist <- list(id = integer(0), x = c(1.90359856625529e+185, 7.29111993354965e-304, NaN, 2.52467545024877e-321, 0, 0, 0, 9.61236224620517e+281, 3.96573944649364e-317, 0, 4.53801546776667e+279, 9.80104716176339e+281, 2.88109526018606e+284, 7.06327445644536e-304, 7.1071553048134e-15, 6.8181059126092e-322, 0, -3.275... | /ggforce/inst/testfiles/enclose_points/libFuzzer_enclose_points/enclose_points_valgrind_files/1609955684-test.R | no_license | akhikolla/updated-only-Issues | R | false | false | 1,280 | r | testlist <- list(id = integer(0), x = c(1.90359856625529e+185, 7.29111993354965e-304, NaN, 2.52467545024877e-321, 0, 0, 0, 9.61236224620517e+281, 3.96573944649364e-317, 0, 4.53801546776667e+279, 9.80104716176339e+281, 2.88109526018606e+284, 7.06327445644536e-304, 7.1071553048134e-15, 6.8181059126092e-322, 0, -3.275... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stats.R
\name{stats}
\alias{stats}
\title{Classical estimates for tables}
\usage{
stats(x, margins = NULL, statistics = c("phi", "cramer", "chisq",
"yates"), maggr = mean)
}
\arguments{
\item{x}{a data.frame, matrix or table}
\item{margins... | /man/stats.Rd | no_license | hronkare/robCompositions | R | false | true | 1,764 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stats.R
\name{stats}
\alias{stats}
\title{Classical estimates for tables}
\usage{
stats(x, margins = NULL, statistics = c("phi", "cramer", "chisq",
"yates"), maggr = mean)
}
\arguments{
\item{x}{a data.frame, matrix or table}
\item{margins... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/shift_pickr.R
\name{shift_pickr}
\alias{shift_pickr}
\title{Chemical Shift Picking}
\usage{
shift_pickr(x, p, sh, pm = 0.005)
}
\arguments{
\item{x}{The spectrum of which you want to calculate the total area}
\item{p}{The matched ppm variabl... | /man/shift_pickr.Rd | permissive | kbario/NMRadjustr | R | false | true | 1,612 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/shift_pickr.R
\name{shift_pickr}
\alias{shift_pickr}
\title{Chemical Shift Picking}
\usage{
shift_pickr(x, p, sh, pm = 0.005)
}
\arguments{
\item{x}{The spectrum of which you want to calculate the total area}
\item{p}{The matched ppm variabl... |
library(stratifyR)
### Name: math
### Title: Mathematics Marks for First-year University Students
### Aliases: math
### Keywords: datasets
### ** Examples
data(math)
min(math$final_marks); max(math$final_marks)
hist(math$final_marks)
boxplot(math$final_marks)
| /data/genthat_extracted_code/stratifyR/examples/math.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 268 | r | library(stratifyR)
### Name: math
### Title: Mathematics Marks for First-year University Students
### Aliases: math
### Keywords: datasets
### ** Examples
data(math)
min(math$final_marks); max(math$final_marks)
hist(math$final_marks)
boxplot(math$final_marks)
|
# Generate a sequence of Gaussian random numbers and
# convert the sequence into a time-series object
noise <- ts(rnorm(200, mean = 0, sd = 1))
# Code for the histogram
hist(noise, freq=FALSE, prob=T,ylim=c(0,0.5),xlim=c(-5,5),col="red")
mu <- mean(noise)
sigma <- sd(noise)
x<-seq(-5,5,length=100)
y<-dnorm(x,mu,sigma... | /study/White noise test_Time Series.R | no_license | kanupriyasaxena/datascience | R | false | false | 411 | r | # Generate a sequence of Gaussian random numbers and
# convert the sequence into a time-series object
noise <- ts(rnorm(200, mean = 0, sd = 1))
# Code for the histogram
hist(noise, freq=FALSE, prob=T,ylim=c(0,0.5),xlim=c(-5,5),col="red")
mu <- mean(noise)
sigma <- sd(noise)
x<-seq(-5,5,length=100)
y<-dnorm(x,mu,sigma... |
#' Retrieve structured posts data from news articles, blog posts and online discussions
#'
#' @md
#' @param query A string query containing the filters that define which posts will be returned.
#' @param sort By default the results are sorted by relevancy. Acceptable values are
#' "`relevancy`", "`social.faceboo... | /R/filter_posts.R | no_license | hrbrmstr/webhose | R | false | false | 3,949 | r | #' Retrieve structured posts data from news articles, blog posts and online discussions
#'
#' @md
#' @param query A string query containing the filters that define which posts will be returned.
#' @param sort By default the results are sorted by relevancy. Acceptable values are
#' "`relevancy`", "`social.faceboo... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/makeLine.R
\name{makeLine}
\alias{makeLine}
\title{Create a linear patch (beta version).}
\usage{
makeLine(context, size, direction = NULL, convol = 0.5, spt = NULL,
bgr = 0, edge = FALSE, rast = FALSE, val = 1)
}
\arguments{
\item{context}... | /man/makeLine.Rd | no_license | dariomasante/landscapeR | R | false | true | 2,478 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/makeLine.R
\name{makeLine}
\alias{makeLine}
\title{Create a linear patch (beta version).}
\usage{
makeLine(context, size, direction = NULL, convol = 0.5, spt = NULL,
bgr = 0, edge = FALSE, rast = FALSE, val = 1)
}
\arguments{
\item{context}... |
plot4 <- function() {
require(data.table)
## This first line will likely take a few seconds. Be patient!
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
# Convert NEI to data.table & subset data for Baltimore, fips == "24510"
NEI.dt <- data.table(... | /plot4.R | no_license | avo1d/ExData_Project2 | R | false | false | 1,151 | r | plot4 <- function() {
require(data.table)
## This first line will likely take a few seconds. Be patient!
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
# Convert NEI to data.table & subset data for Baltimore, fips == "24510"
NEI.dt <- data.table(... |
print.llgpcptab <- function( x, ... )
{
###
### This function prints out the augmented tableau at the k-th priority level
###
### Parameters
### x = an object of class 'llgpcptab' that is the modified simplex tableau
### ... = other arguments as they may apply to the generic S3 print function
###
tab <- x
... | /goalprog/R/print.llgpcptab.R | no_license | ingted/R-Examples | R | false | false | 3,526 | r | print.llgpcptab <- function( x, ... )
{
###
### This function prints out the augmented tableau at the k-th priority level
###
### Parameters
### x = an object of class 'llgpcptab' that is the modified simplex tableau
### ... = other arguments as they may apply to the generic S3 print function
###
tab <- x
... |
# data munging for all letter distortion experiment data.
library(plyr)
library(dplyr)
top_dir <- getwd()
# top_dir <- '~/Dropbox/Projects/letter-distortion-detection'
out_dir <- file.path(top_dir, "results", "r-analysis-final-paper")
# raw data experiment 1 -----------------------------------------------------------... | /code/analysis/data_munging_all.R | no_license | tomwallis/letter_distortion_detection | R | false | false | 4,197 | r | # data munging for all letter distortion experiment data.
library(plyr)
library(dplyr)
top_dir <- getwd()
# top_dir <- '~/Dropbox/Projects/letter-distortion-detection'
out_dir <- file.path(top_dir, "results", "r-analysis-final-paper")
# raw data experiment 1 -----------------------------------------------------------... |
# LT 19/10/2020
# plot of proportion in OMIM vs metric decile
# (figure e9a in flagship paper)
load_omim_by_year_data = function() {
omim_data = read_delim('data/forKonrad_cleaned_gene_discovery_years_2018-10-09.tsv', delim = '\t') %>%
filter(yearDiscovered > 1990)
# omim_data %>%
# count(yearDiscovere... | /Oct2020/Plot.OMIMperdecile.R | no_license | tiboloic/optiRVIS | R | false | false | 3,185 | r | # LT 19/10/2020
# plot of proportion in OMIM vs metric decile
# (figure e9a in flagship paper)
load_omim_by_year_data = function() {
omim_data = read_delim('data/forKonrad_cleaned_gene_discovery_years_2018-10-09.tsv', delim = '\t') %>%
filter(yearDiscovered > 1990)
# omim_data %>%
# count(yearDiscovere... |
#' Plot selectivity
#'
#' Plot selectivity, including retention and other quantities, with additional
#' plots for time-varying selectivity.
#'
#'
#' @template replist
#' @template fleets
#' @param infotable Optional table of information controlling appearance of
#' plot and legend. Is produced as output and can be mod... | /R/SSplotSelex.R | no_license | yukio-takeuchi/r4ss | R | false | false | 54,253 | r | #' Plot selectivity
#'
#' Plot selectivity, including retention and other quantities, with additional
#' plots for time-varying selectivity.
#'
#'
#' @template replist
#' @template fleets
#' @param infotable Optional table of information controlling appearance of
#' plot and legend. Is produced as output and can be mod... |
ucipBound <- function(RT, CR, stopping.rule=c("AND", "OR"), bound=c("upper", "lower"), Cspace =FALSE) {
tvec <- c(0,sort(unique(unlist(RT))))
returnlist <- vector("list", 0)
if (agrep("upper", bound, ignore.case=TRUE ) ) {
if(agrep("or", stopping.rule, ignore.case=TRUE) ){
if(Cspace) {
numer ... | /R/capacitySpace.R | no_license | jhoupt/sft | R | false | false | 1,952 | r | ucipBound <- function(RT, CR, stopping.rule=c("AND", "OR"), bound=c("upper", "lower"), Cspace =FALSE) {
tvec <- c(0,sort(unique(unlist(RT))))
returnlist <- vector("list", 0)
if (agrep("upper", bound, ignore.case=TRUE ) ) {
if(agrep("or", stopping.rule, ignore.case=TRUE) ){
if(Cspace) {
numer ... |
#' Extract GitHub RSS feed
#'
#' @param feed a list containing two elements: a username and a RSS atom link
#'
#' @return a data.frame of the RSS feed contents
#' @export
extract_feed <- function(feed) {
entries <- httr::GET(feed) %>%
xml2::read_html() %>%
rvest::html_nodes("entry")
id <- rves... | /R/process.R | no_license | jonocarroll/starryeyes | R | false | false | 1,244 | r | #' Extract GitHub RSS feed
#'
#' @param feed a list containing two elements: a username and a RSS atom link
#'
#' @return a data.frame of the RSS feed contents
#' @export
extract_feed <- function(feed) {
entries <- httr::GET(feed) %>%
xml2::read_html() %>%
rvest::html_nodes("entry")
id <- rves... |
#!/usr/bin/env Rscript
# ==========
# ==========
# ==========
# load ggplot2 library
library(ggplot2)
library(grid)
library(scales)
#file_name="denews-25-set1.denews.10"
#file_name="ap-50-set3.denews.10"
#file_name="ap-50-set2.denews.10"
#file_name="ap-50-set1.denews.10"
#file_name="20news-10.20news.10"
#file_nam... | /src/util/plot_statistics.R | no_license | kzhai/PyHDPOld | R | false | false | 2,673 | r | #!/usr/bin/env Rscript
# ==========
# ==========
# ==========
# load ggplot2 library
library(ggplot2)
library(grid)
library(scales)
#file_name="denews-25-set1.denews.10"
#file_name="ap-50-set3.denews.10"
#file_name="ap-50-set2.denews.10"
#file_name="ap-50-set1.denews.10"
#file_name="20news-10.20news.10"
#file_nam... |
# Converts numeric value to a human readable currency format
# Works for $ and , seperator, Needs more work to support dot representation
currency<-function(amount){
if(amount<1000000){
return (paste0("$",signif(amount, digits=3)/1000, "K"))
}else{
return (paste0("$", signif(amount, digits=3)/1000000, "M"))... | /housing/currency.R | no_license | bhattsachin/datascience | R | false | false | 326 | r | # Converts numeric value to a human readable currency format
# Works for $ and , seperator, Needs more work to support dot representation
currency<-function(amount){
if(amount<1000000){
return (paste0("$",signif(amount, digits=3)/1000, "K"))
}else{
return (paste0("$", signif(amount, digits=3)/1000000, "M"))... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/print.CBFM.R
\name{print.CBFM}
\alias{print.CBFM}
\alias{print.CBFM_hurdle}
\title{Print a (hurdle) CBFM object}
\usage{
\method{print}{CBFM}(x, ...)
\method{print}{CBFM_hurdle}(x, ...)
}
\arguments{
\item{x}{An object of class \code{CBFM} o... | /man/print.CBFM.Rd | no_license | fhui28/CBFM | R | false | true | 1,248 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/print.CBFM.R
\name{print.CBFM}
\alias{print.CBFM}
\alias{print.CBFM_hurdle}
\title{Print a (hurdle) CBFM object}
\usage{
\method{print}{CBFM}(x, ...)
\method{print}{CBFM_hurdle}(x, ...)
}
\arguments{
\item{x}{An object of class \code{CBFM} o... |
library(haven)
library(stringr)
library(reshape)
library(dplyr)
library(plyr)
library(data.table)
library(splitstackshape)
library(doBy)
library(ggplot2)
library(foreign)
#setwd("T:/Practice ClickStream/NewApp")
#NewData <- read_csv("data/NewData.csv",col_types = cols(X1 = col_skip()))
NewData<- read_sav(... | /app.R | no_license | ATLAS-CITLDataAnalyticsServices/Coursera-ClickStream-ShinyApp | R | false | false | 7,854 | r | library(haven)
library(stringr)
library(reshape)
library(dplyr)
library(plyr)
library(data.table)
library(splitstackshape)
library(doBy)
library(ggplot2)
library(foreign)
#setwd("T:/Practice ClickStream/NewApp")
#NewData <- read_csv("data/NewData.csv",col_types = cols(X1 = col_skip()))
NewData<- read_sav(... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/badge.R
\name{badge_bioc_download}
\alias{badge_bioc_download}
\title{badge_bioc_download}
\usage{
badge_bioc_download(pkg = NULL, by, color, type = "distinct")
}
\arguments{
\item{pkg}{package. If \code{NULL} (the default) the package
is det... | /man/badge_bioc_download.Rd | permissive | GuangchuangYu/badger | R | false | true | 573 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/badge.R
\name{badge_bioc_download}
\alias{badge_bioc_download}
\title{badge_bioc_download}
\usage{
badge_bioc_download(pkg = NULL, by, color, type = "distinct")
}
\arguments{
\item{pkg}{package. If \code{NULL} (the default) the package
is det... |
library(MASS)
## File handling for Random Jungle
rjungleExe <- file.path("rjungle")
rjungleInFile <- file.path("input/finaldatainput.scrambled")
rjungleOutFile <- file.path("output/rjungle.scrambled")
random_seed<-read.table(paste("input/random_seed"), header=FALSE)
system("module load randomjungle")
n=dim(random_seed... | /workingset_lisa/process_rjungle.scrambled.R | no_license | iqbalrosiadi/intern_igmm | R | false | false | 721 | r | library(MASS)
## File handling for Random Jungle
rjungleExe <- file.path("rjungle")
rjungleInFile <- file.path("input/finaldatainput.scrambled")
rjungleOutFile <- file.path("output/rjungle.scrambled")
random_seed<-read.table(paste("input/random_seed"), header=FALSE)
system("module load randomjungle")
n=dim(random_seed... |
#' 給定一個矩陣X
X <- cbind(x1 = 1, x2 = 1:10, x3 = sin(1:10))
#' 以及一個長度為3 的向量 beta
beta <- c(0.5, -1, 4.3)
#' 我們稱`X[,1]`為x1, `X[,2]`為x2, `X[,3]`為x3
#' 向量y 的值是 x1 * beta[1] + x2 * beta[2] + x3 * beta[3]
#' 請用矩陣乘法`%*%`算出向量y
#' ps. class(y) 應該要是 "matrix"
#' dim(y) 應該是 c(10, 1)
y <- X %*% beta
#' epsilon 是一個隨機產生的雜訊向量
epsi... | /hw2/RBasic-05-HW.R | no_license | behappycc/Data-Science | R | false | false | 1,402 | r | #' 給定一個矩陣X
X <- cbind(x1 = 1, x2 = 1:10, x3 = sin(1:10))
#' 以及一個長度為3 的向量 beta
beta <- c(0.5, -1, 4.3)
#' 我們稱`X[,1]`為x1, `X[,2]`為x2, `X[,3]`為x3
#' 向量y 的值是 x1 * beta[1] + x2 * beta[2] + x3 * beta[3]
#' 請用矩陣乘法`%*%`算出向量y
#' ps. class(y) 應該要是 "matrix"
#' dim(y) 應該是 c(10, 1)
y <- X %*% beta
#' epsilon 是一個隨機產生的雜訊向量
epsi... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
\name{cells_stub_grand_summary}
\alias{cells_stub_grand_summary}
\title{Location helper for targeting the stub cells in a grand summary}
\usage{
cells_stub_grand_summary(rows = everything())
}
\arguments{
\item{rows}{\emph{Rows to t... | /man/cells_stub_grand_summary.Rd | permissive | rstudio/gt | R | false | true | 7,242 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helpers.R
\name{cells_stub_grand_summary}
\alias{cells_stub_grand_summary}
\title{Location helper for targeting the stub cells in a grand summary}
\usage{
cells_stub_grand_summary(rows = everything())
}
\arguments{
\item{rows}{\emph{Rows to t... |
context("each_of")
test_that("each_of", {
done <- character()
index <- integer()
coll <- letters[1:10]
dx <- when_all(
.list = lapply(seq_along(coll), function(i) {
delay(1/1000)$then(function(value) {
done <<- c(done, coll[[i]])
index <<- c(index, i)
})
})
)$then(func... | /tests/testthat/test-each-of.R | permissive | strategist922/async-2 | R | false | false | 438 | r |
context("each_of")
test_that("each_of", {
done <- character()
index <- integer()
coll <- letters[1:10]
dx <- when_all(
.list = lapply(seq_along(coll), function(i) {
delay(1/1000)$then(function(value) {
done <<- c(done, coll[[i]])
index <<- c(index, i)
})
})
)$then(func... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/factorial_function.R
\name{factorial_function}
\alias{factorial_function}
\title{A Factorial Function}
\usage{
factorial_function(n)
}
\description{
This function does a factorial given a few conditions
}
\examples{
factorial_function()
}
\ke... | /man/factorial_function.Rd | no_license | James9669/R-Cats-Factorial | R | false | true | 337 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/factorial_function.R
\name{factorial_function}
\alias{factorial_function}
\title{A Factorial Function}
\usage{
factorial_function(n)
}
\description{
This function does a factorial given a few conditions
}
\examples{
factorial_function()
}
\ke... |
library(Biostrings)
library(VennDiagram)
workingDir <- "E:/oscar/Documents/TFM/5.Filter_and_ReplicateLibraries/5.4.Insect_Libraries_Filtered/5.4.1.Filter_2/"
setwd(workingDir)
getwd()
make.italic <- function(x) as.expression(lapply(x, function(y) bquote(italic(.(y)))))
############## BLATTELLA GERMANICA ###... | /Replicates_VennDiagram_Filter2.R | no_license | PaniPaniello/TFM | R | false | false | 10,263 | r | library(Biostrings)
library(VennDiagram)
workingDir <- "E:/oscar/Documents/TFM/5.Filter_and_ReplicateLibraries/5.4.Insect_Libraries_Filtered/5.4.1.Filter_2/"
setwd(workingDir)
getwd()
make.italic <- function(x) as.expression(lapply(x, function(y) bquote(italic(.(y)))))
############## BLATTELLA GERMANICA ###... |
random_algo <- function(no, donnees, x) {
donnees$random_sorting_variable <- rnorm(400,0,1)
donnees <- donnees[order(donnees$random_sorting_variable),]
donnees$group_allocation <- rep(c(1:20),each=20)
donnees <- select(donnees, -random_sorting_variable)
donnees <<- donnees
}
#random_algo(no, donnees, x) | /Functions/F_random_algo.R | no_license | hannahbull/peer_effects | R | false | false | 319 | r |
random_algo <- function(no, donnees, x) {
donnees$random_sorting_variable <- rnorm(400,0,1)
donnees <- donnees[order(donnees$random_sorting_variable),]
donnees$group_allocation <- rep(c(1:20),each=20)
donnees <- select(donnees, -random_sorting_variable)
donnees <<- donnees
}
#random_algo(no, donnees, x) |
###############################################################################
###This function calculates Mean recurrence time of a markov chain
ergodic_projector <- function(P, n){
n <- n
A <- array(1, dim=c(dim(P)[1], dim(P)[2] ,n))
for (i in 0:n){
result <- P %^% i
A[,,i] <- result
}
... | /Mean_recurrence.R | no_license | khyejin1231/SocialNetworkAnalysis | R | false | false | 1,016 | r | ###############################################################################
###This function calculates Mean recurrence time of a markov chain
ergodic_projector <- function(P, n){
n <- n
A <- array(1, dim=c(dim(P)[1], dim(P)[2] ,n))
for (i in 0:n){
result <- P %^% i
A[,,i] <- result
}
... |
#simple closure store for request data
req <- local({
state = NULL;
init <- function(reqdata){
state <<- reqdata;
};
reset <- function(){
init(NULL);
}
getvalue <- function(name){
if(is.null(state)){
stop("req not initiated.")
}
return(state[[name]]);
};
method <- f... | /R/req.R | permissive | nagyistge/opencpu | R | false | false | 1,482 | r | #simple closure store for request data
req <- local({
state = NULL;
init <- function(reqdata){
state <<- reqdata;
};
reset <- function(){
init(NULL);
}
getvalue <- function(name){
if(is.null(state)){
stop("req not initiated.")
}
return(state[[name]]);
};
method <- f... |
\name{UpsideRisk}
\alias{UpsideRisk}
\title{upside risk, variance and potential of the return distribution}
\usage{
UpsideRisk(R, MAR = 0, method = c("full", "subset"), stat = c("risk",
"variance", "potential"), ...)
}
\arguments{
\item{R}{an xts, vector, matrix, data frame, timeSeries
or zoo object of asset retu... | /man/UpsideRisk.Rd | no_license | guillermozbta/portafolio-master | R | false | false | 2,473 | rd | \name{UpsideRisk}
\alias{UpsideRisk}
\title{upside risk, variance and potential of the return distribution}
\usage{
UpsideRisk(R, MAR = 0, method = c("full", "subset"), stat = c("risk",
"variance", "potential"), ...)
}
\arguments{
\item{R}{an xts, vector, matrix, data frame, timeSeries
or zoo object of asset retu... |
#' Compose multiple cli functions
#'
#' `cli()` will record all `cli_*` calls in `expr`, and emit them together
#' in a single message. This is useful if you want to built a larger
#' piece of output from multiple `cli_*` calls.
#'
#' Use this function to build a more complex piece of CLI that would not
#' make sense ... | /R/cli.R | permissive | queilawithaQ/cli-1 | R | false | false | 18,370 | r |
#' Compose multiple cli functions
#'
#' `cli()` will record all `cli_*` calls in `expr`, and emit them together
#' in a single message. This is useful if you want to built a larger
#' piece of output from multiple `cli_*` calls.
#'
#' Use this function to build a more complex piece of CLI that would not
#' make sense ... |
library(here)
library(dplyr)
library(data.table)
if (!exists("dir_atlas")) source(here("code", "_constants.R"))
## schaefer (L first, R second!) ---
fname_schaefer <- file.path(
dir_atlas,
"Schaefer2018_Parcellations", "HCP", "fslr32k", "cifti", "Schaefer2018_400Parcels_7Networks_order_info.txt"
)
if (file.exi... | /in/_write_atlas_keys.R | no_license | mcfreund/psychomet | R | false | false | 1,825 | r | library(here)
library(dplyr)
library(data.table)
if (!exists("dir_atlas")) source(here("code", "_constants.R"))
## schaefer (L first, R second!) ---
fname_schaefer <- file.path(
dir_atlas,
"Schaefer2018_Parcellations", "HCP", "fslr32k", "cifti", "Schaefer2018_400Parcels_7Networks_order_info.txt"
)
if (file.exi... |
#-------------------------------------------------------------------------------------------------------------------------------------#
# In this code, we are running a simulation to model the effectiveness of various surveillance strategies in detecting
# local Zika virus transmission. The end result is a data table w... | /Simulation Code.R | no_license | StevenRussell/Local_ZIKV_transmission | R | false | false | 15,306 | r | #-------------------------------------------------------------------------------------------------------------------------------------#
# In this code, we are running a simulation to model the effectiveness of various surveillance strategies in detecting
# local Zika virus transmission. The end result is a data table w... |
setwd("~/Documents/7thSemester/dmp/corpus")
library("RSQLite")
library("tokenizers")
library("dplyr")
library("textclean")
library("stringr")
library("tm")
library(qdap)
rm(list=ls())
sec <- scan("rawTexts/detective/agatha-christie-the-secret-adversary.txt",what="character",sep="\n")
sec.start <- which(sec=="IT was 2 p... | /scriptsAndDatabase/detective_clean/ADVERSARYclean.R | no_license | timschott/dmp | R | false | false | 7,322 | r | setwd("~/Documents/7thSemester/dmp/corpus")
library("RSQLite")
library("tokenizers")
library("dplyr")
library("textclean")
library("stringr")
library("tm")
library(qdap)
rm(list=ls())
sec <- scan("rawTexts/detective/agatha-christie-the-secret-adversary.txt",what="character",sep="\n")
sec.start <- which(sec=="IT was 2 p... |
data1 <- readRDS("summarySCC_PM25.rds")
data2 <- readRDS("Source_Classification_Code.rds" )
both <- merge(data1, data2, by="data2")
str(both)
library(ggplot2)
subsetdata1 <- data1[data1$fips=="24510" & data1$type=="ON-ROAD", ]
AggregatedTotalYear <- aggregate(Emissions ~ year, subsetdata1, sum)
p... | /Project.Plot5.R | no_license | basakritu/Coursera_Exploratory_data_analysis_Project_2 | R | false | false | 696 | r | data1 <- readRDS("summarySCC_PM25.rds")
data2 <- readRDS("Source_Classification_Code.rds" )
both <- merge(data1, data2, by="data2")
str(both)
library(ggplot2)
subsetdata1 <- data1[data1$fips=="24510" & data1$type=="ON-ROAD", ]
AggregatedTotalYear <- aggregate(Emissions ~ year, subsetdata1, sum)
p... |
#new file lalla
#and some more | /newfile.R | no_license | scelmendorf/test | R | false | false | 31 | r | #new file lalla
#and some more |
#' Adaptive Maximum Margin Criterion
#'
#' Adaptive Maximum Margin Criterion (AMMC) is a supervised linear dimension reduction method.
#' The method uses different weights to characterize the different contributions of the
#' training samples embedded in MMC framework. With the choice of \code{a=0}, \code{b=0}, and
#'... | /R/linear_AMMC.R | no_license | dungcv/Rdimtools | R | false | false | 6,078 | r | #' Adaptive Maximum Margin Criterion
#'
#' Adaptive Maximum Margin Criterion (AMMC) is a supervised linear dimension reduction method.
#' The method uses different weights to characterize the different contributions of the
#' training samples embedded in MMC framework. With the choice of \code{a=0}, \code{b=0}, and
#'... |
#' Brewery Location and Home/Rental Information
#'
#' This data provides a very small sample of different breweries in the U.S
#' with some home listing information and typical rental information in the
#' same areas as breweries. The home/rental information is all for the month
#' of October, 2019.
#'
#' @format The b... | /BrewHome/R/data.R | no_license | ecwalters112/BrewHome-Package | R | false | false | 1,624 | r | #' Brewery Location and Home/Rental Information
#'
#' This data provides a very small sample of different breweries in the U.S
#' with some home listing information and typical rental information in the
#' same areas as breweries. The home/rental information is all for the month
#' of October, 2019.
#'
#' @format The b... |
library(gapminder)
library(dplyr)
library(ggplot2)
gapminder_1952 <- gapminder %>%
filter(year == 1952)
# Scatter plot comparing pop and lifeExp, faceted by continent
ggplot(data = gapminder_1952, aes(x = pop, y = lifeExp)) +
geom_point() +
scale_x_log10() +
facet_wrap(~ continent)
| /DCamp/Intro Tidyverse/Data Visualization/Creating a subgraph facet_wrap().R | no_license | shinichimatsuda/R_Training | R | false | false | 293 | r | library(gapminder)
library(dplyr)
library(ggplot2)
gapminder_1952 <- gapminder %>%
filter(year == 1952)
# Scatter plot comparing pop and lifeExp, faceted by continent
ggplot(data = gapminder_1952, aes(x = pop, y = lifeExp)) +
geom_point() +
scale_x_log10() +
facet_wrap(~ continent)
|
make_CO2_ratios_of_A_and_gs_plots_DT <- function() {
### read input
pilDF<-read.csv("data/glasshouse2/Pilularis_Phys.csv",sep=",", header=TRUE)
popDF<-read.csv("data/glasshouse2/Populnea_Phys.csv",sep=",", header=TRUE)
### day list
d1 <- unique(pilDF$Day)
d2 <- unique(popDF$Day)
... | /scripts/DT/make_CO2_ratios_of_A_and_gs_plots_DT.R | no_license | mingkaijiang/CO2_x_Drought_Glasshouse_Experiment | R | false | false | 62,914 | r | make_CO2_ratios_of_A_and_gs_plots_DT <- function() {
### read input
pilDF<-read.csv("data/glasshouse2/Pilularis_Phys.csv",sep=",", header=TRUE)
popDF<-read.csv("data/glasshouse2/Populnea_Phys.csv",sep=",", header=TRUE)
### day list
d1 <- unique(pilDF$Day)
d2 <- unique(popDF$Day)
... |
for(i in 1:10)
{
cat(i)
if(i==10)
{
cat("\n")
break
}
cat(", ")
}
| /Programming Language Detection/Experiment-2/Dataset/Train/R/loops-n-plus-one-half-2.r | no_license | dlaststark/machine-learning-projects | R | false | false | 93 | r | for(i in 1:10)
{
cat(i)
if(i==10)
{
cat("\n")
break
}
cat(", ")
}
|
##
## sendmailR.r - send email from within R
##
## Author:
## Olaf Mersmann (OME) <olafm@datensplitter.net>
##
.rfc2822_date <- function(time=Sys.time()) {
lc <- Sys.getlocale("LC_TIME")
on.exit(Sys.setlocale("LC_TIME", lc))
Sys.setlocale("LC_TIME", "C")
strftime(time, format="%a, %d %b %Y %H:%M:%S -0000",
... | /B_analysts_sources_github/jeroen/sendmailR/sendmailR.r | no_license | Irbis3/crantasticScrapper | R | false | false | 5,452 | r | ##
## sendmailR.r - send email from within R
##
## Author:
## Olaf Mersmann (OME) <olafm@datensplitter.net>
##
.rfc2822_date <- function(time=Sys.time()) {
lc <- Sys.getlocale("LC_TIME")
on.exit(Sys.setlocale("LC_TIME", lc))
Sys.setlocale("LC_TIME", "C")
strftime(time, format="%a, %d %b %Y %H:%M:%S -0000",
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_cells.R
\name{get_cells}
\alias{get_cells}
\title{Get cells of a tree}
\usage{
get_cells(tree, treeT = c("LT", "DT"), type = c("all", "nr", "inc"))
}
\arguments{
\item{tree}{The lineage or division tree, an object of class \code{"igraph"}... | /man/get_cells.Rd | no_license | vicstefanou/ViSCA | R | false | true | 1,042 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_cells.R
\name{get_cells}
\alias{get_cells}
\title{Get cells of a tree}
\usage{
get_cells(tree, treeT = c("LT", "DT"), type = c("all", "nr", "inc"))
}
\arguments{
\item{tree}{The lineage or division tree, an object of class \code{"igraph"}... |
#' The Rorschach protocol.
#'
#' This protocol is used to calibrate the eyes for variation due to sampling.
#' All plots are typically null data sets, data that is consistent with a null
#' hypothesis. The protocol is described in Buja, Cook, Hofmann, Lawrence,
#' Lee, Swayne, Wickham (2009) Statistical inference for e... | /R/protocols.r | no_license | ellisvalentiner/nullabor | R | false | false | 4,352 | r | #' The Rorschach protocol.
#'
#' This protocol is used to calibrate the eyes for variation due to sampling.
#' All plots are typically null data sets, data that is consistent with a null
#' hypothesis. The protocol is described in Buja, Cook, Hofmann, Lawrence,
#' Lee, Swayne, Wickham (2009) Statistical inference for e... |
context("yaml config manipulation")
test_that("can remove a data item", {
file <- system.file("extdata", "tests", "subsetCars.Rmd",
package = "DataPackageR"
)
file2 <- system.file("extdata", "tests", "extra.rmd",
package = "DataPackageR"
)
expect_null(
datapackage_skeleton(
name = ... | /tests/testthat/test-yaml-manipulation.R | no_license | cran/DataPackageR | R | false | false | 1,214 | r | context("yaml config manipulation")
test_that("can remove a data item", {
file <- system.file("extdata", "tests", "subsetCars.Rmd",
package = "DataPackageR"
)
file2 <- system.file("extdata", "tests", "extra.rmd",
package = "DataPackageR"
)
expect_null(
datapackage_skeleton(
name = ... |
library(tidyverse)
library(sva)
library(RUVSeq)
library(RColorBrewer)
library("factoextra")
library(FactoMineR)
require(patchwork)
require(limma)
library(peer)
require(edgeR)
library("ggsci")
###############################################################################################################################... | /bin/NormMethods.R | no_license | mpmorley/MAGNet | R | false | false | 6,759 | r | library(tidyverse)
library(sva)
library(RUVSeq)
library(RColorBrewer)
library("factoextra")
library(FactoMineR)
require(patchwork)
require(limma)
library(peer)
require(edgeR)
library("ggsci")
###############################################################################################################################... |
#ANN
#Our regression ANN will use the Yacht Hydrodynamics data set from UCI’s Machine Learning Repository.
#This data set contains data contains results from 308 full-scale experiments performed at the Delft
#Ship Hydromechanics Laboratory where they test 22 different hull forms. Their experiment tested the
#effect ... | /Neural Networks/NN Regression - Yacht Hydrodynamics/NN Regression- Yacht Hydrodynamics.R | no_license | pmayav/Machine-Learning-in-R | R | false | false | 4,719 | r | #ANN
#Our regression ANN will use the Yacht Hydrodynamics data set from UCI’s Machine Learning Repository.
#This data set contains data contains results from 308 full-scale experiments performed at the Delft
#Ship Hydromechanics Laboratory where they test 22 different hull forms. Their experiment tested the
#effect ... |
library(mvbutils)
### Name: do.in.envir
### Title: Modify a function's scope
### Aliases: do.in.envir
### Keywords: programming utilities
### ** Examples
fff <- function( abcdef) ffdie( 3)
ffdie <- function( x) do.in.envir( { x+abcdef} )
fff( 9) # 12; ffdie wouldn't know about abcdef without the do.in.envir call
# ... | /data/genthat_extracted_code/mvbutils/examples/do.in.envir.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 556 | r | library(mvbutils)
### Name: do.in.envir
### Title: Modify a function's scope
### Aliases: do.in.envir
### Keywords: programming utilities
### ** Examples
fff <- function( abcdef) ffdie( 3)
ffdie <- function( x) do.in.envir( { x+abcdef} )
fff( 9) # 12; ffdie wouldn't know about abcdef without the do.in.envir call
# ... |
/weekly_R/REmap.R | no_license | tuqiang2014/R-Programming | R | false | false | 5,994 | r | ||
.formatDAVIDResult <- function(result, verbose=FALSE) {
### we always use read.delim(...header=TRUE) but formatting expects the first row tobe the column names
### in order to make formatting work we add the top row
result<-rbind(colnames(result),result);
tool <- attr(result,"tool")
if(verbose)
cat("formatDAV... | /R/DAVIDQuery.r | no_license | sirusb/R3CPET | R | false | false | 6,345 | r | .formatDAVIDResult <- function(result, verbose=FALSE) {
### we always use read.delim(...header=TRUE) but formatting expects the first row tobe the column names
### in order to make formatting work we add the top row
result<-rbind(colnames(result),result);
tool <- attr(result,"tool")
if(verbose)
cat("formatDAV... |
#' Adds the global p-value for a categorical variables
#'
#' This function uses [car::Anova] with argument
#' `type = "III"` to calculate global p-values for categorical variables.
#' Output from `tbl_regression` and `tbl_uvregression` objects supported.
#'
#' @section Note:
#' If a needed class of model is not support... | /R/add_global_p.R | permissive | shijianasdf/gtsummary | R | false | false | 11,463 | r | #' Adds the global p-value for a categorical variables
#'
#' This function uses [car::Anova] with argument
#' `type = "III"` to calculate global p-values for categorical variables.
#' Output from `tbl_regression` and `tbl_uvregression` objects supported.
#'
#' @section Note:
#' If a needed class of model is not support... |
##' One-line description
##'
##' Short description
##'
##' @details detailed description
##'
##' @return An object of class \code{wcr_data}, which is a list of resampled datasets, each of which consists of independent data points.
##'
##' @references HOffman EB, SEN PK, Weinberg CR. (2001). Within-cluster resampling. \... | /R/WcrData.R | no_license | kaz-yos/mouse | R | false | false | 976 | r | ##' One-line description
##'
##' Short description
##'
##' @details detailed description
##'
##' @return An object of class \code{wcr_data}, which is a list of resampled datasets, each of which consists of independent data points.
##'
##' @references HOffman EB, SEN PK, Weinberg CR. (2001). Within-cluster resampling. \... |
library(glmnet)
mydata = read.table("../../../../TrainingSet/FullSet/Classifier/soft_tissue.csv",head=T,sep=",")
x = as.matrix(mydata[,4:ncol(mydata)])
y = as.matrix(mydata[,1])
set.seed(123)
glm = cv.glmnet(x,y,nfolds=10,type.measure="mae",alpha=0.8,family="gaussian",standardize=TRUE)
sink('./soft_tissue_083.txt',appe... | /Model/EN/Classifier/soft_tissue/soft_tissue_083.R | no_license | esbgkannan/QSMART | R | false | false | 358 | r | library(glmnet)
mydata = read.table("../../../../TrainingSet/FullSet/Classifier/soft_tissue.csv",head=T,sep=",")
x = as.matrix(mydata[,4:ncol(mydata)])
y = as.matrix(mydata[,1])
set.seed(123)
glm = cv.glmnet(x,y,nfolds=10,type.measure="mae",alpha=0.8,family="gaussian",standardize=TRUE)
sink('./soft_tissue_083.txt',appe... |
### load a set of core functions
source('ntx_deseq_functions.R')
### load the feature counts data and generate count matrix (rawcounts)
PE <- read.csv('raw_gene_counts/PE_featurecounts.txt',sep = "\t",comment.char = "#")
SE <- read.csv('raw_gene_counts/SE_featurecounts.txt',sep = "\t",comment.char = "#")
rawcounts <-... | /DESeq_initialize.R | no_license | bnmtthws/ntx_deseq | R | false | false | 1,592 | r | ### load a set of core functions
source('ntx_deseq_functions.R')
### load the feature counts data and generate count matrix (rawcounts)
PE <- read.csv('raw_gene_counts/PE_featurecounts.txt',sep = "\t",comment.char = "#")
SE <- read.csv('raw_gene_counts/SE_featurecounts.txt',sep = "\t",comment.char = "#")
rawcounts <-... |
#' @title Plot heatmap
#'
#' @description This function plots a heatmap for direct visualisation of results
#'
#' @details This function will plot a heatmap directly from the count data, an annotation bar at the top of the heatmap will offer information about the plot at a glance. A side bar indicating the pvalue will ... | /InteGRAPE_current_buggy/R/plotHeatmap.R | no_license | UofABioinformaticsHub/InteGRAPE | R | false | false | 1,128 | r | #' @title Plot heatmap
#'
#' @description This function plots a heatmap for direct visualisation of results
#'
#' @details This function will plot a heatmap directly from the count data, an annotation bar at the top of the heatmap will offer information about the plot at a glance. A side bar indicating the pvalue will ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.