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 |
|---|---|---|---|---|---|---|---|---|---|
differentialAnalyzeNet <- function(ssns, sample.state, method = c("OR", "rank", "JSD"), cutoff, p.value = TRUE,
Visualization = TRUE) {
## odds ratio
odds_ratio <- function(abund) {
fodds <- function(x){
if (is.null(dim(x)))
return(sapply(x, functi... | /R/differentialAnalyzeNet.R | no_license | yiluheihei/mmnet | R | false | false | 4,783 | r | differentialAnalyzeNet <- function(ssns, sample.state, method = c("OR", "rank", "JSD"), cutoff, p.value = TRUE,
Visualization = TRUE) {
## odds ratio
odds_ratio <- function(abund) {
fodds <- function(x){
if (is.null(dim(x)))
return(sapply(x, functi... |
##-----------------------------------------------------------------------------
## Title: CAPM portfolio analysis
## Author: Armando Enriquez Z.
## Date: November 12th, 2014
## Purpose: Analyze 3 securities returns with the CAPM model
##-----------------------------------------------------------------------------
## ... | /tarea2CAPM.R | no_license | elabuel-o/capm-pro | R | false | false | 2,958 | r |
##-----------------------------------------------------------------------------
## Title: CAPM portfolio analysis
## Author: Armando Enriquez Z.
## Date: November 12th, 2014
## Purpose: Analyze 3 securities returns with the CAPM model
##-----------------------------------------------------------------------------
## ... |
testlist <- list(a = -1L, b = -1L, x = c(-606339073L, -1L, -1L, -16711680L, 8452604L, -117046529L, 671024887L, -48317L, 1128481603L, 1128481603L, 1128481603L, 1128481603L, 1128481603L, 1128481603L, 1128481603L, 1128481603L, 0L, 0L, 1128481603L, 1128481603L, 1128481603L, 1128481603L, 1128481603L, 1128481791L, -230L,... | /grattan/inst/testfiles/anyOutside/libFuzzer_anyOutside/anyOutside_valgrind_files/1610130447-test.R | no_license | akhikolla/updated-only-Issues | R | false | false | 495 | r | testlist <- list(a = -1L, b = -1L, x = c(-606339073L, -1L, -1L, -16711680L, 8452604L, -117046529L, 671024887L, -48317L, 1128481603L, 1128481603L, 1128481603L, 1128481603L, 1128481603L, 1128481603L, 1128481603L, 1128481603L, 0L, 0L, 1128481603L, 1128481603L, 1128481603L, 1128481603L, 1128481603L, 1128481791L, -230L,... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/core.R
\name{mcmcSurv}
\alias{mcmcSurv}
\title{mcmcSurv}
\usage{
mcmcSurv(Y, C, X, N, burn, thin, w = c(1, 1, 1), m = 10, form)
}
\arguments{
\item{Y}{response variable}
\item{C}{censoring indicator}
\item{X}{covariates for betas}
\item{N}... | /pkg/man/mcmcSurv.Rd | no_license | bomin8319/SpatialCure | R | false | true | 765 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/core.R
\name{mcmcSurv}
\alias{mcmcSurv}
\title{mcmcSurv}
\usage{
mcmcSurv(Y, C, X, N, burn, thin, w = c(1, 1, 1), m = 10, form)
}
\arguments{
\item{Y}{response variable}
\item{C}{censoring indicator}
\item{X}{covariates for betas}
\item{N}... |
#0.7089947 SEM PONTOS DO TIME - CORRETO ESSE CRITERIO
#0.7513228 com parametros
#0.7301587 sem parametros e search
#0.6046512
#0.6860465
#0.6860465
#0.6860465
#0.6744186
#0.6860465
#0.7093023
#0.627907
#0.6976744
#0.7093023
#0.7209302
#0.7674419 agora na aula
#0.744186
#0.755814 com altura nfolds = 100,
#0.709302... | /scripts/gridDL.R | no_license | wellrangel/MDM-Predict-5p | R | false | false | 3,914 | r | #0.7089947 SEM PONTOS DO TIME - CORRETO ESSE CRITERIO
#0.7513228 com parametros
#0.7301587 sem parametros e search
#0.6046512
#0.6860465
#0.6860465
#0.6860465
#0.6744186
#0.6860465
#0.7093023
#0.627907
#0.6976744
#0.7093023
#0.7209302
#0.7674419 agora na aula
#0.744186
#0.755814 com altura nfolds = 100,
#0.709302... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rds_operations.R
\name{rds_create_db_cluster}
\alias{rds_create_db_cluster}
\title{Creates a new Amazon Aurora DB cluster or Multi-AZ DB cluster}
\usage{
rds_create_db_cluster(
AvailabilityZones = NULL,
BackupRetentionPeriod = NULL,
Cha... | /cran/paws.database/man/rds_create_db_cluster.Rd | permissive | paws-r/paws | R | false | true | 28,423 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rds_operations.R
\name{rds_create_db_cluster}
\alias{rds_create_db_cluster}
\title{Creates a new Amazon Aurora DB cluster or Multi-AZ DB cluster}
\usage{
rds_create_db_cluster(
AvailabilityZones = NULL,
BackupRetentionPeriod = NULL,
Cha... |
#Bootstrap GWR code edited from Harry's code
#Basic test statistic, modified test statistic and localised test statistic are returned
#R: number of random samples
gwr.bootstrap <- function(formula, data, kernel="bisquare",approach="AIC", R=99,k.nearneigh=4,
adaptive=FALSE, p=2, theta=0, longla... | /00_pkg_src/GWmodel/R/BootstrapGWR.r | no_license | lbb220/GWmodel.Rcheck | R | false | false | 21,390 | r | #Bootstrap GWR code edited from Harry's code
#Basic test statistic, modified test statistic and localised test statistic are returned
#R: number of random samples
gwr.bootstrap <- function(formula, data, kernel="bisquare",approach="AIC", R=99,k.nearneigh=4,
adaptive=FALSE, p=2, theta=0, longla... |
#' @title Growth increment data for Red Lakes Walleye.
#'
#' @description Growth increment data for Red Lakes Walleye (\emph{Sander vitreus}) in one-fish-per-line format.
#'
#' @note Data is in one-fish-per-line format.
#'
#' @name WalleyeRL
#'
#' @docType data
#'
#' @format A data frame with 1543 observ... | /FSAdata/R/WalleyeRL.R | no_license | ingted/R-Examples | R | false | false | 1,710 | r | #' @title Growth increment data for Red Lakes Walleye.
#'
#' @description Growth increment data for Red Lakes Walleye (\emph{Sander vitreus}) in one-fish-per-line format.
#'
#' @note Data is in one-fish-per-line format.
#'
#' @name WalleyeRL
#'
#' @docType data
#'
#' @format A data frame with 1543 observ... |
\name{education}
\alias{education}
\docType{data}
\title{
Data file for various regression illustrations
}
\description{
Data file for various regression illustrations
}
\usage{data(education)}
\format{
A data frame with 50 observations on the following 6 variables.
\describe{
\item{\code{state}}{a factor with ... | /Docs/hodar/man/education.Rd | no_license | kwlee58/zmPDSwR_Class | R | false | false | 1,243 | rd | \name{education}
\alias{education}
\docType{data}
\title{
Data file for various regression illustrations
}
\description{
Data file for various regression illustrations
}
\usage{data(education)}
\format{
A data frame with 50 observations on the following 6 variables.
\describe{
\item{\code{state}}{a factor with ... |
### Jinliang Yang
### 8/11/2016
### Counting kmer frq for each genes
####### get gene id
geneid <- read.table("/home/jolyang/dbcenter/AGP/AGPv2/ZmB73_5b_FGS_info.txt", header=T)
geneid <- subset(geneid, is_canonical == "yes")
feature <- geneid[, c("chromosome", "transcript_start", "transcript_end", "gene_id")]
names... | /profiling/9.ML/5.A.1_kmer_count.R | no_license | yangjl/methylation | R | false | false | 1,585 | r | ### Jinliang Yang
### 8/11/2016
### Counting kmer frq for each genes
####### get gene id
geneid <- read.table("/home/jolyang/dbcenter/AGP/AGPv2/ZmB73_5b_FGS_info.txt", header=T)
geneid <- subset(geneid, is_canonical == "yes")
feature <- geneid[, c("chromosome", "transcript_start", "transcript_end", "gene_id")]
names... |
library(rethinking)
library(dplyr)
library(wesanderson)
# simulate career choices among 500 individuals
n <- 500 # number of individuals
income <- 1:3 # expected income of each career
score <- 0.5 * income # scores for each career, based on income
# next line converts scores to pro... | /Bayesian_Modelling/Chapters/Misc/brms_mulinomial.R | no_license | psahai10/datascienceprojects | R | false | false | 2,298 | r | library(rethinking)
library(dplyr)
library(wesanderson)
# simulate career choices among 500 individuals
n <- 500 # number of individuals
income <- 1:3 # expected income of each career
score <- 0.5 * income # scores for each career, based on income
# next line converts scores to pro... |
library(data.table)
library(stringr)
library(cowplot)
fig_dir='../figures/finemap/finemap/rs2327429_tcf21/'
if (!dir.exists(fig_dir)) dir.create(fig_dir,recursive=TRUE)
# Genotype:
cmd="bcftools query -H -r chr6:134209837-134209837 -f '%CHROM\t%POS\t%ID[\t%GT]\n' ../data/joint3/asvcf/phased_and_imputed.chr6.rename.d... | /finemap/finemap/rs2327429_tcf21.R | no_license | chanibravo/hcasmc_eqtl | R | false | false | 3,027 | r | library(data.table)
library(stringr)
library(cowplot)
fig_dir='../figures/finemap/finemap/rs2327429_tcf21/'
if (!dir.exists(fig_dir)) dir.create(fig_dir,recursive=TRUE)
# Genotype:
cmd="bcftools query -H -r chr6:134209837-134209837 -f '%CHROM\t%POS\t%ID[\t%GT]\n' ../data/joint3/asvcf/phased_and_imputed.chr6.rename.d... |
getFixEF.twoPhase =
function(effFactors, trt.Coef, T, Rep, table.legend){
trt = numeric(length(trt.Coef) + ncol(Rep))
names(trt) = c( names(T), paste("eff", names(T), sep = ".") )
for(i in 1:length(effFactors)){
trt = rbind(trt, character(length = length(T)*2))
if( names(effFactors[i]) ... | /infoDecompuTE/R/getFixEF.twoPhase.R | no_license | ingted/R-Examples | R | false | false | 1,644 | r | getFixEF.twoPhase =
function(effFactors, trt.Coef, T, Rep, table.legend){
trt = numeric(length(trt.Coef) + ncol(Rep))
names(trt) = c( names(T), paste("eff", names(T), sep = ".") )
for(i in 1:length(effFactors)){
trt = rbind(trt, character(length = length(T)*2))
if( names(effFactors[i]) ... |
x<-c(1,2,3,4,5,6,7,8,9,10,11,12,13); y<-c(mean(c(71971806 ,71971806 ,71971806 ,71971806 ,71971806 ,71971806 ,71971806 ,71971806 ,71971806 ,71971806)),mean(c(71971810 ,71971810 ,71971810 ,71971810 ,71971810 ,71971810 ,71971810 ,71971810 ,71971810 ,71971810)),mean(c(71971814 ,71971814 ,71971814 ,71971814 ,71971814 ,71971... | /plots/networkusage.R | no_license | ptitlazy/sys-rep | R | false | false | 2,439 | r | x<-c(1,2,3,4,5,6,7,8,9,10,11,12,13); y<-c(mean(c(71971806 ,71971806 ,71971806 ,71971806 ,71971806 ,71971806 ,71971806 ,71971806 ,71971806 ,71971806)),mean(c(71971810 ,71971810 ,71971810 ,71971810 ,71971810 ,71971810 ,71971810 ,71971810 ,71971810 ,71971810)),mean(c(71971814 ,71971814 ,71971814 ,71971814 ,71971814 ,71971... |
# Input Predicted_Y, Test_Y (ordering is assumed)
# K: An integer giving no. of classes
#' Calculation of Accuracy of Prediction on Test Set for Bayesian Ordered Multinomial Regression
#'
#'\code{MultinomGibbs_Test_Accuracy} Calculates Accuracy of Prediction on Test Set for Bayesian Ordered Multinomial Regression.
#'
#... | /R/Poly_Gibbs_TestAccuracy.R | no_license | zovialpapai/PolyGibbs | R | false | false | 2,725 | r | # Input Predicted_Y, Test_Y (ordering is assumed)
# K: An integer giving no. of classes
#' Calculation of Accuracy of Prediction on Test Set for Bayesian Ordered Multinomial Regression
#'
#'\code{MultinomGibbs_Test_Accuracy} Calculates Accuracy of Prediction on Test Set for Bayesian Ordered Multinomial Regression.
#'
#... |
library(glmnet)
mydata = read.table("./TrainingSet/AvgRank/kidney.csv",head=T,sep=",")
x = as.matrix(mydata[,4:ncol(mydata)])
y = as.matrix(mydata[,1])
set.seed(123)
glm = cv.glmnet(x,y,nfolds=10,type.measure="mse",alpha=0.05,family="gaussian",standardize=FALSE)
sink('./Model/EN/AvgRank/kidney/kidney_022.txt',append=TR... | /Model/EN/AvgRank/kidney/kidney_022.R | no_license | leon1003/QSMART | R | false | false | 353 | r | library(glmnet)
mydata = read.table("./TrainingSet/AvgRank/kidney.csv",head=T,sep=",")
x = as.matrix(mydata[,4:ncol(mydata)])
y = as.matrix(mydata[,1])
set.seed(123)
glm = cv.glmnet(x,y,nfolds=10,type.measure="mse",alpha=0.05,family="gaussian",standardize=FALSE)
sink('./Model/EN/AvgRank/kidney/kidney_022.txt',append=TR... |
Data_Import_Cleaning <- function(){
tryCatch({
### Sourcing tools from GEO ###
source("http://www.bioconductor.org/biocLite.R")
BiocManager::install("GenomicRanges")
BiocManager::install("rtracklayer")
BiocManager::install("usethis")
library(GenomicRanges)
library(rtracklayer)... | /Data_Import_Cleaning.R | no_license | shauryajauhari/GSAChIPSeqBenchmarkData | R | false | false | 2,006 | r | Data_Import_Cleaning <- function(){
tryCatch({
### Sourcing tools from GEO ###
source("http://www.bioconductor.org/biocLite.R")
BiocManager::install("GenomicRanges")
BiocManager::install("rtracklayer")
BiocManager::install("usethis")
library(GenomicRanges)
library(rtracklayer)... |
#iv fastplm boot
ivfastplm.boot <- function(seed,
y = NULL,
x = NULL,
z = NULL,
ind = NULL,
sfe.index = NULL,
cfe.index = NULL,
... | /R/ivfastplm_boot.r | permissive | xuyiqing/fastplm | R | false | false | 52,831 | r | #iv fastplm boot
ivfastplm.boot <- function(seed,
y = NULL,
x = NULL,
z = NULL,
ind = NULL,
sfe.index = NULL,
cfe.index = NULL,
... |
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/ecoretriever-package.R
\docType{package}
\name{ecoretriever}
\alias{ecoretriever}
\alias{ecoretriever-package}
\title{ecoretriever: R interface to the EcoData Retriever.}
\description{
ecoretriever: R interface to the EcoData Retrieve... | /man/ecoretriever.Rd | no_license | cran/ecoretriever | R | false | false | 752 | rd | % Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/ecoretriever-package.R
\docType{package}
\name{ecoretriever}
\alias{ecoretriever}
\alias{ecoretriever-package}
\title{ecoretriever: R interface to the EcoData Retriever.}
\description{
ecoretriever: R interface to the EcoData Retrieve... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/process.R
\name{process}
\alias{process}
\alias{process.deleted}
\alias{process.other}
\alias{process.code}
\alias{process.template}
\title{Process website files}
\usage{
process(path, ...)
\method{process}{deleted}(path, ...)
\method{proce... | /man/process.Rd | no_license | jiho/yssr | R | false | true | 708 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/process.R
\name{process}
\alias{process}
\alias{process.deleted}
\alias{process.other}
\alias{process.code}
\alias{process.template}
\title{Process website files}
\usage{
process(path, ...)
\method{process}{deleted}(path, ...)
\method{proce... |
# data
x<-date()
class(x)# character
x2<- Sys.Date()
class(x2)# Date
x3<- as.Date("2018-01-01")# must satisfy this format
weekdays(x3)# monday
months(x3)#January
quarters(x3)#Q1
julian(x3)# this gives the days from 1970-01-01
x4<- as.Date("2016-01-01")
x4-x3; as.numeric(x3-x4)
x1<-"Jan 1, 2016 01:... | /Basic/data and time.R | no_license | beeeear/R | R | false | false | 753 | r | # data
x<-date()
class(x)# character
x2<- Sys.Date()
class(x2)# Date
x3<- as.Date("2018-01-01")# must satisfy this format
weekdays(x3)# monday
months(x3)#January
quarters(x3)#Q1
julian(x3)# this gives the days from 1970-01-01
x4<- as.Date("2016-01-01")
x4-x3; as.numeric(x3-x4)
x1<-"Jan 1, 2016 01:... |
# Understanding and interpreting coding and non-coding variants
| /R/ekta_lab_practical.R | no_license | jakesauter/ANGSD_SNVs_and_SVs | R | false | false | 66 | r |
# Understanding and interpreting coding and non-coding variants
|
## DATA PORTRAITS - CHALLENGE 2
## ICD TIDY TUESDAY
## MARCH 2021
# Load library
library(tidyverse)
library(showtext) #To use googlefonts
library(patchwork)
# Import data
freed_slaves <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-02-16/freed_slaves.csv')
... | /data-portraits/andy-challenge-04.R | no_license | melodyaltschuler/tidytuesday | R | false | false | 2,213 | r | ## DATA PORTRAITS - CHALLENGE 2
## ICD TIDY TUESDAY
## MARCH 2021
# Load library
library(tidyverse)
library(showtext) #To use googlefonts
library(patchwork)
# Import data
freed_slaves <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-02-16/freed_slaves.csv')
... |
\name{confusionMatrix.train}
\alias{confusionMatrix.train}
\alias{confusionMatrix.rfe}
\alias{confusionMatrix.sbf}
\title{Estimate a Resampled Confusion Matrix}
\description{
Using a \code{\link{train}}, \code{\link{rfe}}, \code{\link{sbf}} object, determine a confusion matrix based on the resampling procedure}
\usage{... | /caret_6.0-37/caret/man/confusionMatrix.train.Rd | permissive | QunCh/Applied-Predictive-Modeling-with-Python | R | false | false | 2,812 | rd | \name{confusionMatrix.train}
\alias{confusionMatrix.train}
\alias{confusionMatrix.rfe}
\alias{confusionMatrix.sbf}
\title{Estimate a Resampled Confusion Matrix}
\description{
Using a \code{\link{train}}, \code{\link{rfe}}, \code{\link{sbf}} object, determine a confusion matrix based on the resampling procedure}
\usage{... |
# The return() function can return only a single object. If we want to return multiple values in R, we can use a list (or other objects) and return it.
multi_return <- function() {
my_list <- list("color"="red","size"=20,"shape"="round")
return(my_list)
}
a <- multi_return()
a$color
a$size
a$shape | /03-functions/multiple_return.R | no_license | lincolnbrito/r-examples | R | false | false | 304 | r | # The return() function can return only a single object. If we want to return multiple values in R, we can use a list (or other objects) and return it.
multi_return <- function() {
my_list <- list("color"="red","size"=20,"shape"="round")
return(my_list)
}
a <- multi_return()
a$color
a$size
a$shape |
# Data loading funcs
# We have a data-loading function that reads our data into the workspace,
# we have a data-simulation function for our simulation studies,
loadQuinn2020 = function(dataIdx) {
inDir = './in/quinn2020/'
files <- list.files(inDir)
dataSetNames <- unique(gsub("(-x\\.csv)|(-y\\.csv)", "", file... | /code/loadData.R | no_license | cunningham-lab/codacore | R | false | false | 2,843 | r |
# Data loading funcs
# We have a data-loading function that reads our data into the workspace,
# we have a data-simulation function for our simulation studies,
loadQuinn2020 = function(dataIdx) {
inDir = './in/quinn2020/'
files <- list.files(inDir)
dataSetNames <- unique(gsub("(-x\\.csv)|(-y\\.csv)", "", file... |
# This helper funciton returns just the coefficient from the WeMix results object.
#' @method coef WeMixResults
#' @export
coef.WeMixResults <- function(object, ...) {
object$coef
}
# This helper function prints the coefficient from the WeMix results object.
#' @export
print.WeMixResults <- function(x, ...)... | /R/helpers.R | no_license | cran/WeMix | R | false | false | 16,186 | r | # This helper funciton returns just the coefficient from the WeMix results object.
#' @method coef WeMixResults
#' @export
coef.WeMixResults <- function(object, ...) {
object$coef
}
# This helper function prints the coefficient from the WeMix results object.
#' @export
print.WeMixResults <- function(x, ...)... |
## ---- include = FALSE---------------------------------------------------------
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
## ----setup--------------------------------------------------------------------
library(almanac)
## ---------------------------------------------------------------------------... | /inst/doc/almanac.R | no_license | cran/almanac | R | false | false | 3,016 | r | ## ---- include = FALSE---------------------------------------------------------
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
## ----setup--------------------------------------------------------------------
library(almanac)
## ---------------------------------------------------------------------------... |
################################################################################
# Generate eQTL and pQTL peak tables with allele effects for each test type.
# R/3.4.4
# Daniel Alfonsetti
# daniel.alfonsetti@gmail.com
# Jul. 22, 2018
################################################################################
# Res... | /scripts/pipeline/qtls/scans/get_qtl_peaks.R | no_license | danielalfonsetti/JAXSSP_Aging_Heart | R | false | false | 13,802 | r | ################################################################################
# Generate eQTL and pQTL peak tables with allele effects for each test type.
# R/3.4.4
# Daniel Alfonsetti
# daniel.alfonsetti@gmail.com
# Jul. 22, 2018
################################################################################
# Res... |
#' A more complete summary
#' @description a more complete summary that
#' applyes for both numeric and factor vectors.
#' @param x numeric vector or factor
#' @param p percentiles for computing quantiles
#' when \code{x} is a numeric vector.
#' @return a named vector with the length of \code{x},
#' number of NA`s and ... | /R/mysummary.R | no_license | eliaskrainski/emisc | R | false | false | 805 | r | #' A more complete summary
#' @description a more complete summary that
#' applyes for both numeric and factor vectors.
#' @param x numeric vector or factor
#' @param p percentiles for computing quantiles
#' when \code{x} is a numeric vector.
#' @return a named vector with the length of \code{x},
#' number of NA`s and ... |
## --------------------------------------------------------------------
## Program: mod_scatter.R
## Date: 06/11/2019
## Author: bwang4
## Project: DQM
## Purpose: Base scatter module
## Input: data
## Output: ggplot2 obj
## --------------------------------------------------------------------
scatterUI <- function(id)... | /R/mod_scatter.R | no_license | sibyllwangxxxx/dobby | R | false | false | 5,569 | r | ## --------------------------------------------------------------------
## Program: mod_scatter.R
## Date: 06/11/2019
## Author: bwang4
## Project: DQM
## Purpose: Base scatter module
## Input: data
## Output: ggplot2 obj
## --------------------------------------------------------------------
scatterUI <- function(id)... |
utilities <- read.csv("./utilities.csv")
str(utilities)
plot(Fuel_Cost~Sales, utilities)
# add labels to plots, pos=4 puts labels to the right, cex is text size
with(utilities,text(Fuel_Cost~Sales, labels=Company, pos=4, cex=.5))
## Normalization
# cluster analysis all data to be numeric, there fore remov... | /cluster analysis-1.R | no_license | Philip-Abraham/R | R | false | false | 3,050 | r | utilities <- read.csv("./utilities.csv")
str(utilities)
plot(Fuel_Cost~Sales, utilities)
# add labels to plots, pos=4 puts labels to the right, cex is text size
with(utilities,text(Fuel_Cost~Sales, labels=Company, pos=4, cex=.5))
## Normalization
# cluster analysis all data to be numeric, there fore remov... |
#File Management and data Download
library(dplyr)
library(ggplot2)
#get Directorory
getwd()
# file location - "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_data.zip"
# Create the file
if (!file.exists("PM25_Raw_Data")) {
dir.create("PM25_Raw_Data")
}
fileUrl <- "https://d396qusza40orc.cloudfront.net... | /CourseProject2/Plot2.R | no_license | Fbarangan/Exploratory_Data_Analysis | R | false | false | 1,651 | r | #File Management and data Download
library(dplyr)
library(ggplot2)
#get Directorory
getwd()
# file location - "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2FNEI_data.zip"
# Create the file
if (!file.exists("PM25_Raw_Data")) {
dir.create("PM25_Raw_Data")
}
fileUrl <- "https://d396qusza40orc.cloudfront.net... |
#' Format digits.
#'
#' @param x A digit.
#' @param digits Number of significant digits.
#' @param null_treshold Treshold below which return 0.
#' @param inf_treshold Treshold above which return Inf.
#'
#' @author \href{https://dominiquemakowski.github.io/}{Dominique Makowski}
#'
#' @export
format_digit <- function(x, ... | /R/formatting.R | permissive | anhnguyendepocen/psycho.R | R | false | false | 3,550 | r | #' Format digits.
#'
#' @param x A digit.
#' @param digits Number of significant digits.
#' @param null_treshold Treshold below which return 0.
#' @param inf_treshold Treshold above which return Inf.
#'
#' @author \href{https://dominiquemakowski.github.io/}{Dominique Makowski}
#'
#' @export
format_digit <- function(x, ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mediaconnect_operations.R
\name{mediaconnect_grant_flow_entitlements}
\alias{mediaconnect_grant_flow_entitlements}
\title{Grants entitlements to an existing flow}
\usage{
mediaconnect_grant_flow_entitlements(Entitlements, FlowArn)
}
\argument... | /cran/paws.media.services/man/mediaconnect_grant_flow_entitlements.Rd | permissive | johnnytommy/paws | R | false | true | 1,189 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mediaconnect_operations.R
\name{mediaconnect_grant_flow_entitlements}
\alias{mediaconnect_grant_flow_entitlements}
\title{Grants entitlements to an existing flow}
\usage{
mediaconnect_grant_flow_entitlements(Entitlements, FlowArn)
}
\argument... |
#ARIMA - NN - ETS
library(forecast)
library(fable)
library(forecastHybrid)
library(nnet)
library(readxl)
library(GA)
library(Metrics)
library(tidyverse)
library(TSrepr)
library(smooth)
library(forecTheta)
library(thief)
library(svrpath)
library(e1071)
Dataset_Surabaya <- read_excel("C:/Users/asus/OneDrive - Institut ... | /ARIMA - NN - ETS - Parallel_GA.R | no_license | vpradhana/arimar | R | false | false | 7,304 | r | #ARIMA - NN - ETS
library(forecast)
library(fable)
library(forecastHybrid)
library(nnet)
library(readxl)
library(GA)
library(Metrics)
library(tidyverse)
library(TSrepr)
library(smooth)
library(forecTheta)
library(thief)
library(svrpath)
library(e1071)
Dataset_Surabaya <- read_excel("C:/Users/asus/OneDrive - Institut ... |
#' Extract out common by variables
#'
#' @export
#' @keywords internal
common_by <- function(by = NULL, x, y) UseMethod("common_by", by)
#' @export
common_by.character <- function(by, x, y) {
by <- common_by_from_vector(by)
common_by.list(by, x, y)
}
common_by_from_vector <- function(by) {
by <- by[!duplicated(... | /R/join-common-by.R | permissive | tidyverse/dplyr | R | false | false | 1,795 | r | #' Extract out common by variables
#'
#' @export
#' @keywords internal
common_by <- function(by = NULL, x, y) UseMethod("common_by", by)
#' @export
common_by.character <- function(by, x, y) {
by <- common_by_from_vector(by)
common_by.list(by, x, y)
}
common_by_from_vector <- function(by) {
by <- by[!duplicated(... |
context("XLSX")
test_that("can read folder and store as multiple data frame", {
folder_1 <- importExcel("XLSX")
folder_2 <- importExcel("XLSX2")
expect_equal(folder_1, folder_2)
})
| /DataLoader/tests/testthat/test-xlsx.R | no_license | ingted/R-Examples | R | false | false | 197 | r | context("XLSX")
test_that("can read folder and store as multiple data frame", {
folder_1 <- importExcel("XLSX")
folder_2 <- importExcel("XLSX2")
expect_equal(folder_1, folder_2)
})
|
setwd(data.route)
all.data.table = read.csv("alldata.csv", header = T, stringsAsFactors = F)
#auc.table = read.csv("aucdata.csv", header = T, stringsAsFactors = F)
setwd(specs.route)
specs = read.csv("specs.csv", header = T, stringsAsFactors = F)
setwd(data.random.route)
all.data.random.table = read.csv("alldata.csv", ... | /rabbitGUI_code/loadTables.R | no_license | anabrandusa/rabbitGUI | R | false | false | 573 | r | setwd(data.route)
all.data.table = read.csv("alldata.csv", header = T, stringsAsFactors = F)
#auc.table = read.csv("aucdata.csv", header = T, stringsAsFactors = F)
setwd(specs.route)
specs = read.csv("specs.csv", header = T, stringsAsFactors = F)
setwd(data.random.route)
all.data.random.table = read.csv("alldata.csv", ... |
# Set up environment -----------------------------------------------------------
## Libraries
"reshape2" %>=>% libInstall %!=>% library(.., char = T)
"lme4" %>=>% libInstall %!=>% library(.., char = T)
"ggplot2" %>=>% libInstall %!=>% library(.., char = T)
"grid" %=>% libInstall
"extrafont" %>=>% libInstall %!=>% libr... | /prediction.R | no_license | rknx/AvrBsT | R | false | false | 9,880 | r | # Set up environment -----------------------------------------------------------
## Libraries
"reshape2" %>=>% libInstall %!=>% library(.., char = T)
"lme4" %>=>% libInstall %!=>% library(.., char = T)
"ggplot2" %>=>% libInstall %!=>% library(.., char = T)
"grid" %=>% libInstall
"extrafont" %>=>% libInstall %!=>% libr... |
#~~~~~~~~~~~~~~~~~~~~DATA EXPLORATION~~~~~~~~~~~~~~~~~~
load("/Users/lancefernando/Desktop/DataMining/DataSets/BayAreaBikeShareData/DataPreprocessing.RData")
attach(SF_daily_bikeshare)
summary(SF_daily_bikeshare)
par(mfrow = c(2,2))
plot(weekday, sub_total, xlab = "Day of the week", ylab = "Number of rentals", main =... | /DataExploration.R | no_license | ccortezaguilera/BikeSharing | R | false | false | 5,788 | r | #~~~~~~~~~~~~~~~~~~~~DATA EXPLORATION~~~~~~~~~~~~~~~~~~
load("/Users/lancefernando/Desktop/DataMining/DataSets/BayAreaBikeShareData/DataPreprocessing.RData")
attach(SF_daily_bikeshare)
summary(SF_daily_bikeshare)
par(mfrow = c(2,2))
plot(weekday, sub_total, xlab = "Day of the week", ylab = "Number of rentals", main =... |
context("make_stationary_popn")
test_that("make_stationary_popn creates population of expected size", {
ans_obtained <- sum(make_stationary_popn(popn_size = 123,
Lx = dembase::Counts(Lx_west[,,15]),
sex_ratio = 111))
ans... | /tests/testthat/test-make_stationary_popn.R | permissive | johnrbryant/agesim | R | false | false | 1,399 | r |
context("make_stationary_popn")
test_that("make_stationary_popn creates population of expected size", {
ans_obtained <- sum(make_stationary_popn(popn_size = 123,
Lx = dembase::Counts(Lx_west[,,15]),
sex_ratio = 111))
ans... |
################### Weather vs Frequency #####################
# Select Weather Data
Weather_Frequency = sqldf('select PickupDate, TAVG, SNOW, AWND, count(PickupTime) as WeatherPickupFreq
from NYTaxi_Sub
group by 1,2,3,4')
# Normalized Data
Normalized_Weather_F... | /7_Correlation_Analysis_WeatherIndex_vs_PickupFrequency.r | no_license | ChenLGit/NYC-Green-Cab-Analysis | R | false | false | 4,007 | r | ################### Weather vs Frequency #####################
# Select Weather Data
Weather_Frequency = sqldf('select PickupDate, TAVG, SNOW, AWND, count(PickupTime) as WeatherPickupFreq
from NYTaxi_Sub
group by 1,2,3,4')
# Normalized Data
Normalized_Weather_F... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{A549ChromLoops}
\alias{A549ChromLoops}
\title{Predicted chromsome loops in A549's chromsome 18}
\format{A dataframewith 216 rows and 3 columns:
\describe{
\item{chr}{chromosome 18}
\item{start}{chromatin loops'... | /man/A549ChromLoops.Rd | permissive | NElnour/annotator3D | R | false | true | 882 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{A549ChromLoops}
\alias{A549ChromLoops}
\title{Predicted chromsome loops in A549's chromsome 18}
\format{A dataframewith 216 rows and 3 columns:
\describe{
\item{chr}{chromosome 18}
\item{start}{chromatin loops'... |
#' Given alternate promoter score for samples,
#' divide samples into groups and calculate survival differences
#'
#' @param alternatePromoterScore A data.frame object. Two columns containing sample ids and
#' numeric alternate promoter score
#'
#' @param clinicaldata A data.frame object. Should have an id column label... | /R/estimate-survival.R | permissive | aditiqamra/APcalc | R | false | false | 3,897 | r | #' Given alternate promoter score for samples,
#' divide samples into groups and calculate survival differences
#'
#' @param alternatePromoterScore A data.frame object. Two columns containing sample ids and
#' numeric alternate promoter score
#'
#' @param clinicaldata A data.frame object. Should have an id column label... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{c_ps_gmm_dg}
\alias{c_ps_gmm_dg}
\title{Get Derivative of Moment Constraints}
\usage{
c_ps_gmm_dg(beta, mat_grp_x, att = FALSE)
}
\description{
return k row p column matrix
Row: 1..k moment functions
Column: 1..p coeffi... | /man/c_ps_gmm_dg.Rd | no_license | olssol/rwetools | R | false | true | 329 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{c_ps_gmm_dg}
\alias{c_ps_gmm_dg}
\title{Get Derivative of Moment Constraints}
\usage{
c_ps_gmm_dg(beta, mat_grp_x, att = FALSE)
}
\description{
return k row p column matrix
Row: 1..k moment functions
Column: 1..p coeffi... |
#' Relevant Component Analysis
#'
#' The RECA package performs Relevant Component Analysis (RCA).
#'
#' \tabular{ll}{ Package: \tab RECA\cr Type: \tab Package\cr
#' Version: \tab 1.1\cr License: \tab GPL (>= 2)\cr }
#'
#' @name RECA-package
#' @docType package
#' @author Nan Xiao <\email{road2stat@@gmail.com}>
#'
#' @n... | /RECA/R/RECA-package.R | no_license | ingted/R-Examples | R | false | false | 436 | r | #' Relevant Component Analysis
#'
#' The RECA package performs Relevant Component Analysis (RCA).
#'
#' \tabular{ll}{ Package: \tab RECA\cr Type: \tab Package\cr
#' Version: \tab 1.1\cr License: \tab GPL (>= 2)\cr }
#'
#' @name RECA-package
#' @docType package
#' @author Nan Xiao <\email{road2stat@@gmail.com}>
#'
#' @n... |
# https://www.coursera.org/learn/logistic-regression-r-public-health/supplement/YPw6w/practice-in-r-simple-logistic-regression
# https://www.coursera.org/learn/logistic-regression-r-public-health/supplement/TkoUt/feedback-output-and-interpretation-from-simple-logistic-regression
g <- read.csv(file = "Data/final-diabet... | /week2-simple-logistic-regression.R | no_license | Samah-Abdelaal/ICL-Diabetes-MOOC | R | false | false | 3,701 | r | # https://www.coursera.org/learn/logistic-regression-r-public-health/supplement/YPw6w/practice-in-r-simple-logistic-regression
# https://www.coursera.org/learn/logistic-regression-r-public-health/supplement/TkoUt/feedback-output-and-interpretation-from-simple-logistic-regression
g <- read.csv(file = "Data/final-diabet... |
# EJERCICIO 1
#1. INTRODUCIR DATOS Y CREAR OBJETOS CON METADATOS
edad <- c(18,19,NA,18,24,17,22,15,22,25,NA,16,23,16)
sexo <- c(0,1,0,0,1,0,0,1,1,0,0,1,0,1)
estudios <- c(1,2,0,1,3,2,3,1,2,3,1,2,3,0)
#factores para variables categoricas se a?aden tantos niveles como variables categoricas haya
sexo <- factor(sexo, leve... | /Programacion con R/Practicas/PracticaClase0.R | no_license | josejaviermartingar/MasterDataScienceCUNEF_2019_2020 | R | false | false | 2,065 | r | # EJERCICIO 1
#1. INTRODUCIR DATOS Y CREAR OBJETOS CON METADATOS
edad <- c(18,19,NA,18,24,17,22,15,22,25,NA,16,23,16)
sexo <- c(0,1,0,0,1,0,0,1,1,0,0,1,0,1)
estudios <- c(1,2,0,1,3,2,3,1,2,3,1,2,3,0)
#factores para variables categoricas se a?aden tantos niveles como variables categoricas haya
sexo <- factor(sexo, leve... |
library(trackeR)
### Name: leaflet_route
### Title: Plot routes for training sessions
### Aliases: leaflet_route leafletRoute
### ** Examples
## Not run:
##D data('runs', package = 'trackeR')
##D leafletRoute(runs, session = 23:24)
## End(Not run)
| /data/genthat_extracted_code/trackeR/examples/leaflet_route.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 256 | r | library(trackeR)
### Name: leaflet_route
### Title: Plot routes for training sessions
### Aliases: leaflet_route leafletRoute
### ** Examples
## Not run:
##D data('runs', package = 'trackeR')
##D leafletRoute(runs, session = 23:24)
## End(Not run)
|
#' PubMed Abstracts corresponding to a search for terms "arabidopsis thaliana gibberellin"
#'
#' Data from function \code{get_pubmed_abstracts} with arguments "arabidopsis thaliana gibberellin", default number of results returned
#'
#' @docType data
#' @name arabidopsis_data
#' @usage data(arabidopsis_data)
#'
#' @form... | /R/arabidopsis_data.R | permissive | jlee118/tmine | R | false | false | 471 | r | #' PubMed Abstracts corresponding to a search for terms "arabidopsis thaliana gibberellin"
#'
#' Data from function \code{get_pubmed_abstracts} with arguments "arabidopsis thaliana gibberellin", default number of results returned
#'
#' @docType data
#' @name arabidopsis_data
#' @usage data(arabidopsis_data)
#'
#' @form... |
library(glmnet)
mydata = read.table("../../../../TrainingSet/FullSet/ReliefF/lung_other.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.6,family="gaussian",standardize=FALSE)
sink('./lung_other_068.txt',append=T... | /Model/EN/ReliefF/lung_other/lung_other_068.R | no_license | esbgkannan/QSMART | R | false | false | 354 | r | library(glmnet)
mydata = read.table("../../../../TrainingSet/FullSet/ReliefF/lung_other.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.6,family="gaussian",standardize=FALSE)
sink('./lung_other_068.txt',append=T... |
# This is the server logic for a Shiny web application.
# You can find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com
#
library(shiny)
library(sandwich)
library(lmtest)
library(quantreg)
library(ggplot2)
library(leaflet)
source("source_map_icon.R",local = T)
source("addressfunctio... | /server.R | no_license | patienthsia/Taipei_Housing_Comparative_Price_System | R | false | false | 3,242 | r |
# This is the server logic for a Shiny web application.
# You can find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com
#
library(shiny)
library(sandwich)
library(lmtest)
library(quantreg)
library(ggplot2)
library(leaflet)
source("source_map_icon.R",local = T)
source("addressfunctio... |
library(dplyr)
setwd("/Users/georgejacobs/Desktop/Hospital Compare Scores - Friedson/DateExcel/HQI_MSR_XWLK/Hospital Structure")
#setwd("/Users/georgejacobs/Desktop/Hospital Compare Scores - Friedson/DateExcel/HQI_MSR_XWLK")
#Loading in the dataset - bcoded.RData
load("/Users/georgejacobs/Desktop/Hospital Compare... | /Step_3_Clean_Up_Backcoding.R | no_license | GeorgeRJacobs/Scripts---Master-s-Thesis | R | false | false | 3,207 | r | library(dplyr)
setwd("/Users/georgejacobs/Desktop/Hospital Compare Scores - Friedson/DateExcel/HQI_MSR_XWLK/Hospital Structure")
#setwd("/Users/georgejacobs/Desktop/Hospital Compare Scores - Friedson/DateExcel/HQI_MSR_XWLK")
#Loading in the dataset - bcoded.RData
load("/Users/georgejacobs/Desktop/Hospital Compare... |
# Plot functions for trace object
# The generic plot function expects the trace object
# and a string to the the function what has to be ploted.
# additional arguments are geneIndex, and category to index function like
# getExpressionTraceForGene or plotCodonSpecificParameters
#' Plot Trace Object
#' @param x An Rcpp ... | /R/plotTraceObject.R | no_license | denizhanpak/RibModelFramework | R | false | false | 14,534 | r | # Plot functions for trace object
# The generic plot function expects the trace object
# and a string to the the function what has to be ploted.
# additional arguments are geneIndex, and category to index function like
# getExpressionTraceForGene or plotCodonSpecificParameters
#' Plot Trace Object
#' @param x An Rcpp ... |
#' Code to do the cell matching from Young et al., Science, 2018.
#'
#' Train a regularised logistic regression model on some training single cell data, usually reference normal. Then use this trained model to infer the similarity of every cell in some target data set to the reference. A basic plotting function to vi... | /logisticRegression.R | no_license | GKild/dediff | R | false | false | 25,605 | r | #' Code to do the cell matching from Young et al., Science, 2018.
#'
#' Train a regularised logistic regression model on some training single cell data, usually reference normal. Then use this trained model to infer the similarity of every cell in some target data set to the reference. A basic plotting function to vi... |
library(ape)
testtree <- read.tree("12968_0.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="12968_0_unrooted.txt") | /codeml_files/newick_trees_processed/12968_0/rinput.R | no_license | DaniBoo/cyanobacteria_project | R | false | false | 137 | r | library(ape)
testtree <- read.tree("12968_0.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="12968_0_unrooted.txt") |
theta = rgamma(100000, 50, rate = 37815)
50*756
beta = 1/theta
plot(density(beta, from = 400, to=1500, n=1000, bw=15))
install.packages("invgamma")
library(invgamma)
real = rinvgamma(10000, 50, 37815)
dth = seq(400, 1500, 15)
plot(dth, dinvgamma(dth, 50, 37815))
lines(density(beta, from = 400, to=1500, n=1000, bw=15))... | /scripts/L1_L3.R | no_license | readerwei/Bayesian_Stats | R | false | false | 987 | r | theta = rgamma(100000, 50, rate = 37815)
50*756
beta = 1/theta
plot(density(beta, from = 400, to=1500, n=1000, bw=15))
install.packages("invgamma")
library(invgamma)
real = rinvgamma(10000, 50, 37815)
dth = seq(400, 1500, 15)
plot(dth, dinvgamma(dth, 50, 37815))
lines(density(beta, from = 400, to=1500, n=1000, bw=15))... |
file1=read.csv("flights1.csv")
head(file1)
data.work1=file1
#data.work1$ARRIVAL_DELAY_BUCKETED <- data.work1$ARRIVAL_DELAY/15
#data.work1$ARRIVAL_DELAY_BUCKETED <- as.integer(data.work1$ARRIVAL_DELAY_BUCKETED)
data.work1$ARRIVAL_DELAY_BUCKETED <- ifelse(data.work1$ARRIVAL_DELAY_BUCKETED <= 0, 0, data.work1$ARRIVAL_DE... | /Regression Tree.R | no_license | kanchanmark/Data-Mining-and-Predictive-Analytics-Flight-Delays | R | false | false | 3,814 | r | file1=read.csv("flights1.csv")
head(file1)
data.work1=file1
#data.work1$ARRIVAL_DELAY_BUCKETED <- data.work1$ARRIVAL_DELAY/15
#data.work1$ARRIVAL_DELAY_BUCKETED <- as.integer(data.work1$ARRIVAL_DELAY_BUCKETED)
data.work1$ARRIVAL_DELAY_BUCKETED <- ifelse(data.work1$ARRIVAL_DELAY_BUCKETED <= 0, 0, data.work1$ARRIVAL_DE... |
render_tweet_html <- function(screen_name,
name,
text,
urls_expanded_url,
created_at,
favorite_count,
retweet_count,
... | /function_render_tweet_html.R | permissive | wjsutton/icymi_email | R | false | false | 1,858 | r | render_tweet_html <- function(screen_name,
name,
text,
urls_expanded_url,
created_at,
favorite_count,
retweet_count,
... |
Geno <- readRDS("/Volumes/Nothing/Pig/Chip/Data/Trimmed_1cM_F2Geno-1.rds")
# Trimmed_1cM_F2Geno-1.rds
# Contains an nx(2p) matrix with Chip data
# trimmed down to ~ 1 SNP per 1 cM interval
# With both additive & dominant effect scaled according to
# our beloved generalized 2 allelic model
# Column names of the matri... | /Script/Demo_FunctionUsage.R | no_license | DiurnalMoon/Epistasis | R | false | false | 1,980 | r | Geno <- readRDS("/Volumes/Nothing/Pig/Chip/Data/Trimmed_1cM_F2Geno-1.rds")
# Trimmed_1cM_F2Geno-1.rds
# Contains an nx(2p) matrix with Chip data
# trimmed down to ~ 1 SNP per 1 cM interval
# With both additive & dominant effect scaled according to
# our beloved generalized 2 allelic model
# Column names of the matri... |
library(readr)
library(dplyr)
library(tidyr)
library(lubridate)
library(lmerTest)
sub_use <- read_rds("data/processed/remote_substance_use.rds")
twin_info <- read_rds("data/processed/Robin_paper-entry_2-22-17_cleaned.rds") %>%
haven::zap_formats() %>%
haven::zap_labels()
id_mapping_long <- read_csv("data/processed... | /src/models/ecig_per_week_at_home_knot_point.R | permissive | dbrazel/cotwins-analyses | R | false | false | 2,459 | r | library(readr)
library(dplyr)
library(tidyr)
library(lubridate)
library(lmerTest)
sub_use <- read_rds("data/processed/remote_substance_use.rds")
twin_info <- read_rds("data/processed/Robin_paper-entry_2-22-17_cleaned.rds") %>%
haven::zap_formats() %>%
haven::zap_labels()
id_mapping_long <- read_csv("data/processed... |
##################################################################################
#### INTIAL WORK WITH INTERACTION DATA
#### GETTING FROM AN EDGE LIST OF SPECIES INTERATIONS TO A SPECIES INTERACTION MATRIX
#### GENERATING BIPARTITE PLOTS
#### ASSESSMENT OF BETADIVERSITY AND INTERACTION TURNOVER
# Housekeep... | /Edge_list_to_bipartite_plots_betadiversity_and_interaction-turnover.r | no_license | oconned5/Mangrove_restoration_networks | R | false | false | 47,133 | r | ##################################################################################
#### INTIAL WORK WITH INTERACTION DATA
#### GETTING FROM AN EDGE LIST OF SPECIES INTERATIONS TO A SPECIES INTERACTION MATRIX
#### GENERATING BIPARTITE PLOTS
#### ASSESSMENT OF BETADIVERSITY AND INTERACTION TURNOVER
# Housekeep... |
#C.M. Gienger
#Ch6 ANCOVA
library(HH)
library(dplyr)
library(ggplot2)
library(ggfortify)
library(emmeans)
#import and view data
limp <- read.csv("limpet.csv")
limp$SEASON <- as.factor(limp$SEASON) #force SEASON to be considered as a factor
View(limp)
glimpse(limp)
#as always, we make a plot to visualize data; no fi... | /6-ANCOVA.R | no_license | cmgienger/6-ANCOVA | R | false | false | 2,353 | r | #C.M. Gienger
#Ch6 ANCOVA
library(HH)
library(dplyr)
library(ggplot2)
library(ggfortify)
library(emmeans)
#import and view data
limp <- read.csv("limpet.csv")
limp$SEASON <- as.factor(limp$SEASON) #force SEASON to be considered as a factor
View(limp)
glimpse(limp)
#as always, we make a plot to visualize data; no fi... |
# Simulate the disease progression within 60 months for one subject
d <- gen.one.sub(params_or,policy=randompolicy,alpha=1)
p0 <- p+1
p1 <- ncol(d$X1)
p2 <- ncol(d$X2[,1:8])
nt <- rep(0,n)
base <- matrix(0,n,p0)
XX1 <- array(0,c(n,p1,p1))
XY1 <- matrix(0,n,p1)
YY1 <- matrix(0,n)
XX2 <- array(0,... | /model_mis/Sim_One_Dataset.R | no_license | qianguan/BayesianPolicySearch | R | false | false | 976 | r | # Simulate the disease progression within 60 months for one subject
d <- gen.one.sub(params_or,policy=randompolicy,alpha=1)
p0 <- p+1
p1 <- ncol(d$X1)
p2 <- ncol(d$X2[,1:8])
nt <- rep(0,n)
base <- matrix(0,n,p0)
XX1 <- array(0,c(n,p1,p1))
XY1 <- matrix(0,n,p1)
YY1 <- matrix(0,n)
XX2 <- array(0,... |
#' Pipe operator
#'
#' @name %>%
#' @rdname pipe
#' @keywords internal
#' @export
#' @importFrom purrr %>%
#' @usage lhs \%>\% rhs
NULL
# environment to hold data about the Drive API
.drive <- new.env(parent = emptyenv())
.drive$base_url <- "https://www.googleapis.com"
.drive$translate_mime_types <-
system.file("ex... | /R/aaa.R | no_license | hturner/googledrive | R | false | false | 2,025 | r | #' Pipe operator
#'
#' @name %>%
#' @rdname pipe
#' @keywords internal
#' @export
#' @importFrom purrr %>%
#' @usage lhs \%>\% rhs
NULL
# environment to hold data about the Drive API
.drive <- new.env(parent = emptyenv())
.drive$base_url <- "https://www.googleapis.com"
.drive$translate_mime_types <-
system.file("ex... |
x <- c(2,3,4)
y <- x/9
plot(x, y, main = "Figure 2.1.1: PMF", type = "p", xlim = c(0,4), ylim = c(0,0.5))
line.input <- c(0:4)
line.output <- line.input/9
lines(line.input, line.output)
| /Figure 2.1.1.R | no_license | henrylankin/stat6304 | R | false | false | 186 | r | x <- c(2,3,4)
y <- x/9
plot(x, y, main = "Figure 2.1.1: PMF", type = "p", xlim = c(0,4), ylim = c(0,0.5))
line.input <- c(0:4)
line.output <- line.input/9
lines(line.input, line.output)
|
# load and read data
library(sqldf)
data <- read.csv.sql("household_power_consumption.txt", sql="select * from file where Date in ('1/2/2007','2/2/2007')", header=TRUE, stringsAsFactors=FALSE,sep=',')
data["dataTime"] <- NA;
data$dateTime <- paste(data$Date,data$Time, sep=" ")
data$dateTime <- as.POSIXct(strptime(data$... | /Desktop/Coursera/Exploratory/plot2.R | no_license | brmjr9/Practical-Machine-Learning | R | false | false | 516 | r | # load and read data
library(sqldf)
data <- read.csv.sql("household_power_consumption.txt", sql="select * from file where Date in ('1/2/2007','2/2/2007')", header=TRUE, stringsAsFactors=FALSE,sep=',')
data["dataTime"] <- NA;
data$dateTime <- paste(data$Date,data$Time, sep=" ")
data$dateTime <- as.POSIXct(strptime(data$... |
\name{estimateQ}
\Rdversion{1.2.0-4}
\alias{estimateQ}
\title{
Initial Estimation of Q portion of the Likelihood}
\description{
An internal function called by the \code{tmle} function to obtain an initial estimate of the \eqn{Q} portion of the likelihood based on user-supplied matrix values for predicted values of (cou... | /man/estimateQ.Rd | no_license | paulhendricks/tmle-R | R | false | false | 2,830 | rd | \name{estimateQ}
\Rdversion{1.2.0-4}
\alias{estimateQ}
\title{
Initial Estimation of Q portion of the Likelihood}
\description{
An internal function called by the \code{tmle} function to obtain an initial estimate of the \eqn{Q} portion of the likelihood based on user-supplied matrix values for predicted values of (cou... |
Copyright (c) <2022>, <DanniGadd>
All rights reserved.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory.
####################################################################################################
### PROCESSING SUPPLEMENTARY TABLES 4 and 5 - CPG and PREICTO... | /28_process_suppl_table_episcores.R | permissive | DanniGadd/EpiScores-for-protein-levels | R | false | false | 4,291 | r | Copyright (c) <2022>, <DanniGadd>
All rights reserved.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory.
####################################################################################################
### PROCESSING SUPPLEMENTARY TABLES 4 and 5 - CPG and PREICTO... |
## code corresponding to examples in fish510.5
# simulating a stock
linf <- 160;
k <- 0.1;
beta <- 3;
cond <- 0.02;
ages <- 1:14;
t0 <- 0;
la <- linf*(1-exp(-k*(ages-t0)));
# mean length at ages
la <- round(la, 2)
wa <- cond*la**beta/100
# mean weight at age in kg
wa <- round(wa,2)
s50 <- 5
# age at 50% selection
s... | /fish510.5/fish510_5_2.R | no_license | pfrater/fish510 | R | false | false | 6,997 | r | ## code corresponding to examples in fish510.5
# simulating a stock
linf <- 160;
k <- 0.1;
beta <- 3;
cond <- 0.02;
ages <- 1:14;
t0 <- 0;
la <- linf*(1-exp(-k*(ages-t0)));
# mean length at ages
la <- round(la, 2)
wa <- cond*la**beta/100
# mean weight at age in kg
wa <- round(wa,2)
s50 <- 5
# age at 50% selection
s... |
## Splitting the dataset into smaller peices for parallel processing
set.seed(1)
chunk = function(vector, num_splits){return(split(vector, factor(sort(rank(vector) %% num_splits))))}
num_shards = detectCores()*70
shards = chunk(vector = seq(1:nrow(D_test)), num_splits = num_shards)
names(shards) = seq(1,num_shards,1) | /chunk_test_set.R | no_license | jacobmunson/RecommenderSystems | R | false | false | 319 | r | ## Splitting the dataset into smaller peices for parallel processing
set.seed(1)
chunk = function(vector, num_splits){return(split(vector, factor(sort(rank(vector) %% num_splits))))}
num_shards = detectCores()*70
shards = chunk(vector = seq(1:nrow(D_test)), num_splits = num_shards)
names(shards) = seq(1,num_shards,1) |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/main.R
\name{computeMultivariateSupport}
\alias{computeMultivariateSupport}
\title{Compute the support for a list of feature sets}
\usage{
computeMultivariateSupport(Mat, genesets, gamma = 1:9/10, beta = 0.95,
method = "euclidean")
}
\descr... | /man/computeMultivariateSupport.Rd | no_license | wikum/divergence.legacy | R | false | true | 377 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/main.R
\name{computeMultivariateSupport}
\alias{computeMultivariateSupport}
\title{Compute the support for a list of feature sets}
\usage{
computeMultivariateSupport(Mat, genesets, gamma = 1:9/10, beta = 0.95,
method = "euclidean")
}
\descr... |
find_file <- function(file_url, cache_file = cache_file, cache_folder_name = "cache") {
file_name <- strsplit(file_url, "/", fixed = TRUE)
file_name <- file_name[[1]][length(file_name[[1]])]
cached_file_name <- file.path(cache_folder_name, file_name)
if (file.exists(cached_file_name)) {
file_path <- cached_... | /R/utils.R | permissive | dkgaraujo/DoddFrankST | R | false | false | 1,350 | r | find_file <- function(file_url, cache_file = cache_file, cache_folder_name = "cache") {
file_name <- strsplit(file_url, "/", fixed = TRUE)
file_name <- file_name[[1]][length(file_name[[1]])]
cached_file_name <- file.path(cache_folder_name, file_name)
if (file.exists(cached_file_name)) {
file_path <- cached_... |
library(shiny)
shinyUI(pageWithSidebar(
headerPanel("BMI Calculator"),
sidebarPanel(
numericInput("htft","Patient Height (feet)",5,min=0,max=8),
numericInput("htin","Patient Height (inches)",0,min=0,max=12),
sliderInput("wt","Patient Weight in Pounds:",160,min=40,max=400),
ra... | /ui.R | no_license | Booherd/Developing-Data-Products-Course-Project | R | false | false | 1,434 | r | library(shiny)
shinyUI(pageWithSidebar(
headerPanel("BMI Calculator"),
sidebarPanel(
numericInput("htft","Patient Height (feet)",5,min=0,max=8),
numericInput("htin","Patient Height (inches)",0,min=0,max=12),
sliderInput("wt","Patient Weight in Pounds:",160,min=40,max=400),
ra... |
setwd("/Users/williamjohnson/Desktop/Laura/Hallett_Lab/Repositories/thesis-mussels/site_DATAexplore")
library(tidyverse)
library(cowplot)
slopeData <- as.tibble(read_csv("sump_slope.csv", col_names = TRUE))
#read in csv of my and Nancy's data PLUS site distance/basin area file
duncandata <- as.tibble(read_tsv("LatLon... | /site_DATAexplore/slope.R | no_license | ljohnso8/thesis-mussels | R | false | false | 3,085 | r | setwd("/Users/williamjohnson/Desktop/Laura/Hallett_Lab/Repositories/thesis-mussels/site_DATAexplore")
library(tidyverse)
library(cowplot)
slopeData <- as.tibble(read_csv("sump_slope.csv", col_names = TRUE))
#read in csv of my and Nancy's data PLUS site distance/basin area file
duncandata <- as.tibble(read_tsv("LatLon... |
# FFmleGlassoCorrelation: computes iPCA covariance estimates via Flip-Flop MLE
# with additive Glasso penalty (using correlations)
#
# inputs: (must supply either draw or dat)
# draw = list of 2 elements:
# 1) sim_data: K-list of n x pk CENTERED data matrices
# 2) truth: list of true Sigma and... | /functions/FFmleGlassoCorrelation.R | no_license | DataSlingers/iPCA | R | false | false | 6,254 | r | # FFmleGlassoCorrelation: computes iPCA covariance estimates via Flip-Flop MLE
# with additive Glasso penalty (using correlations)
#
# inputs: (must supply either draw or dat)
# draw = list of 2 elements:
# 1) sim_data: K-list of n x pk CENTERED data matrices
# 2) truth: list of true Sigma and... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/05.inferCNV.R
\name{run.inferCNV}
\alias{run.inferCNV}
\title{run.inferCNV}
\usage{
run.inferCNV(seurat, assay='RNA', output.dir = "./", rda.dir = "./data", fdata, pheno_info = pheno.df, cnv.ref.type = c("tissue.type", "cell.type"), cnv.ref.n... | /man/run.inferCNV.Rd | no_license | ChenPeizhan/scTyper | R | false | true | 2,261 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/05.inferCNV.R
\name{run.inferCNV}
\alias{run.inferCNV}
\title{run.inferCNV}
\usage{
run.inferCNV(seurat, assay='RNA', output.dir = "./", rda.dir = "./data", fdata, pheno_info = pheno.df, cnv.ref.type = c("tissue.type", "cell.type"), cnv.ref.n... |
#working can be better
gg.pls <- function(pls.object, group, comp.1="Comp 1", comp.2="Comp 2", hjust=0, vjust=0, vip_cut=0, equal_contribution=0){
require(BioMark)
##test comment out when finished testing##
test.data=0
if(test.data==1){
pls.object <- plsr.bug.red
group <- Y
comp.1 <- "Comp... | /gg.pls.R | no_license | ssefick/R_scripts | R | false | false | 2,530 | r | #working can be better
gg.pls <- function(pls.object, group, comp.1="Comp 1", comp.2="Comp 2", hjust=0, vjust=0, vip_cut=0, equal_contribution=0){
require(BioMark)
##test comment out when finished testing##
test.data=0
if(test.data==1){
pls.object <- plsr.bug.red
group <- Y
comp.1 <- "Comp... |
library(e1071)
x=c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)
y=c(3,4,5,4,8,10,10,11,14,20,23,24,32,34,35,37,42,48,53,60)
train=data.frame(x,y)
plot(train,pch=16)
model_svm<- svm(y ~ x , train)
print(model_svm)
pred<- predict(model_svm, train)
print(pred)
model <- lm(y ~ x, train)
error <- model$resi... | /Programs/10.SVM.R | no_license | sachin782/Advanced-Analytics | R | false | false | 687 | r | library(e1071)
x=c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)
y=c(3,4,5,4,8,10,10,11,14,20,23,24,32,34,35,37,42,48,53,60)
train=data.frame(x,y)
plot(train,pch=16)
model_svm<- svm(y ~ x , train)
print(model_svm)
pred<- predict(model_svm, train)
print(pred)
model <- lm(y ~ x, train)
error <- model$resi... |
#!/usr/bin/env Rscript --vanilla
# Packrat is required to make sure right libraries are picked.
packrat::on()
# Library to Parse command line params.
library(optparse)
# For Pipe operators.
library(magrittr)
# Our Scoring (it automatically loads Model library).
library(PhotographerScoring)
# Specify the desired opt... | /photographer_classifier/app/photographer_classifier.R | no_license | rajatmnnit/csx415.1-project | R | false | false | 3,296 | r | #!/usr/bin/env Rscript --vanilla
# Packrat is required to make sure right libraries are picked.
packrat::on()
# Library to Parse command line params.
library(optparse)
# For Pipe operators.
library(magrittr)
# Our Scoring (it automatically loads Model library).
library(PhotographerScoring)
# Specify the desired opt... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate_Drug_Resistance_Evolution_stochastic.R
\name{simulate_Drug_Resistance_Evolution_stochastic}
\alias{simulate_Drug_Resistance_Evolution_stochastic}
\title{Drug Resistance Evolution}
\usage{
simulate_Drug_Resistance_Evolution_stochastic... | /man/simulate_Drug_Resistance_Evolution_stochastic.Rd | no_license | ahgroup/DSAIDE | R | false | true | 3,039 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate_Drug_Resistance_Evolution_stochastic.R
\name{simulate_Drug_Resistance_Evolution_stochastic}
\alias{simulate_Drug_Resistance_Evolution_stochastic}
\title{Drug Resistance Evolution}
\usage{
simulate_Drug_Resistance_Evolution_stochastic... |
# Project for Getting and Cleaning Data
# June 9, 2017
## run_analysis.R
## load packages
library(data.table)
## set working directory
setwd("~/Desktop")
## download data and put it in data folder
if(!file.exists("./data")){dir.create("./data")}
fileUrl<-"https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfile... | /run_analysis.R | no_license | OceanGirl07/Getting-and-Cleaning-Data-Project | R | false | false | 5,925 | r | # Project for Getting and Cleaning Data
# June 9, 2017
## run_analysis.R
## load packages
library(data.table)
## set working directory
setwd("~/Desktop")
## download data and put it in data folder
if(!file.exists("./data")){dir.create("./data")}
fileUrl<-"https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfile... |
library(caret)
library(AppliedPredictiveModeling)
library(pROC)
data(oil)
table(oilType)
table(oilType) / sum(table(oilType))
## chapter 12
## a if data has significant imbalances, should data be split into test and training data sets?
## The data should still be split into testing and training data sets
## ... | /hw4.r | no_license | mfzeidan/marks_tools | R | false | false | 6,024 | r |
library(caret)
library(AppliedPredictiveModeling)
library(pROC)
data(oil)
table(oilType)
table(oilType) / sum(table(oilType))
## chapter 12
## a if data has significant imbalances, should data be split into test and training data sets?
## The data should still be split into testing and training data sets
## ... |
\name{sperm.comp1}
\alias{sperm.comp1}
%- Also NEED an `\alias' for EACH other topic documented here.
\title{Sperm competition data I}
\description{Data relating sperm count to time since last inter-pair
copulation and proportion of that time spent together for 15 couples living in
Manchester UK.}
\usage{
data(sperm.co... | /man/sperm.comp1.Rd | no_license | cran/gamair | R | false | false | 1,326 | rd | \name{sperm.comp1}
\alias{sperm.comp1}
%- Also NEED an `\alias' for EACH other topic documented here.
\title{Sperm competition data I}
\description{Data relating sperm count to time since last inter-pair
copulation and proportion of that time spent together for 15 couples living in
Manchester UK.}
\usage{
data(sperm.co... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/indices-class.R
\name{iborindices}
\alias{iborindices}
\alias{AUDBBSW}
\alias{EURIBOR}
\alias{GBPLIBOR}
\alias{JPYLIBOR}
\alias{JPYTIBOR}
\alias{NZDBKBM}
\alias{USDLIBOR}
\alias{CHFLIBOR}
\alias{HKDHIBOR}
\alias{NOKNIBOR}
\alias{AUDBBSW}
\ali... | /man/iborindices.Rd | no_license | f024719/fmbasics | R | false | true | 2,905 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/indices-class.R
\name{iborindices}
\alias{iborindices}
\alias{AUDBBSW}
\alias{EURIBOR}
\alias{GBPLIBOR}
\alias{JPYLIBOR}
\alias{JPYTIBOR}
\alias{NZDBKBM}
\alias{USDLIBOR}
\alias{CHFLIBOR}
\alias{HKDHIBOR}
\alias{NOKNIBOR}
\alias{AUDBBSW}
\ali... |
testlist <- list(x = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 1.22810536108214e+146, 4.13098670798471e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(5L, 7L)))
result <- do.call(multivariance::fastdist,testlist)
str(result) | /multivariance/inst/testfiles/fastdist/AFL_fastdist/fastdist_valgrind_files/1613098599-test.R | no_license | akhikolla/updatedatatype-list3 | R | false | false | 303 | r | testlist <- list(x = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 1.22810536108214e+146, 4.13098670798471e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(5L, 7L)))
result <- do.call(multivariance::fastdist,testlist)
str(result) |
# Clear workspace
# ------------------------------------------------------------------------------
rm(list=ls())
# Load libraries
# ------------------------------------------------------------------------------
library('tidyverse')
library('cowplot')
# Set seed for reproducibility
# ----------------------------------... | /univariate_vs_multivariate.R | no_license | anhnguyendepocen/univariate-multivariate | R | false | false | 1,986 | r | # Clear workspace
# ------------------------------------------------------------------------------
rm(list=ls())
# Load libraries
# ------------------------------------------------------------------------------
library('tidyverse')
library('cowplot')
# Set seed for reproducibility
# ----------------------------------... |
rm(list = ls())
#################################################################################
#
# Modified PHAC S(E)IR model script with n age classes to estimate the number of
# COVID-19 cases (infected, hospitalized, etc).
#
#==================================================================================
#
#
#... | /claude_v9/BluePrint4 StatCanMicroSimTeam_SEIR sweep.r | no_license | barnzilla/SEIR | R | false | false | 15,240 | r | rm(list = ls())
#################################################################################
#
# Modified PHAC S(E)IR model script with n age classes to estimate the number of
# COVID-19 cases (infected, hospitalized, etc).
#
#==================================================================================
#
#
#... |
#!/usr/bin/Rscript
options(scipen=100)
startTime <- Sys.time()
### !!! UPDATE 24.07.19: STOUFFER ONE-SIDED
################ USE THE FOLLOWING FILES FROM PREVIOUS STEPS
# - script3: all_meanLogFC_TAD.Rdata
# - script8: all_obs_ratioDown.Rdata
# - script9sameNbr: emp_pval_meanLogFC.Rdata
# - script10sameNbr: emp_pva... | /11sameNbrSameNbr_runEmpPvalCombined.R | no_license | marzuf/TAD_DE_pipeline_v2 | R | false | false | 10,014 | r | #!/usr/bin/Rscript
options(scipen=100)
startTime <- Sys.time()
### !!! UPDATE 24.07.19: STOUFFER ONE-SIDED
################ USE THE FOLLOWING FILES FROM PREVIOUS STEPS
# - script3: all_meanLogFC_TAD.Rdata
# - script8: all_obs_ratioDown.Rdata
# - script9sameNbr: emp_pval_meanLogFC.Rdata
# - script10sameNbr: emp_pva... |
# This program illustrates how we actually obtain the transition matrix
library(MASS)
library(dplyr)
library(tidytext)
library(janeaustenr)
library(ggplot2)
library(tidyr)
# Simulate some data
set.seed(123456)
mu <- c(0,0)
Sigma <- matrix(c(10,3,3,10),2,2)
data <- mvrnorm(n = 1000, mu, Sigma)
# P... | /lecture/example/mv03_cond_dist_mobility02.R | no_license | anhnguyendepocen/man2 | R | false | false | 1,057 | r | # This program illustrates how we actually obtain the transition matrix
library(MASS)
library(dplyr)
library(tidytext)
library(janeaustenr)
library(ggplot2)
library(tidyr)
# Simulate some data
set.seed(123456)
mu <- c(0,0)
Sigma <- matrix(c(10,3,3,10),2,2)
data <- mvrnorm(n = 1000, mu, Sigma)
# P... |
# Example 2: Comparing Alcohol Use Between Females and Males
# set work directory and load lavaan packages
setwd("c:/users/wchan/google drive/stat6108/data")
library(lavaan)
# data preparation
# group 1: Females
female.corr <- matrix(
c(1.0000, 0.4641, 0.4200,
0.4641, 1.0000, 0.5614,
0.4200, 0.5614, ... | /2019R2 Official Statistics and Structural Equation Modelling (STAT6108)/SEM/Latent–Growth-Curve-Models /Example 2. Comparing Alcohol Use Between Females and Males/biglan2.R | no_license | emailyc/Msc-DSBS-CUHK | R | false | false | 2,838 | r | # Example 2: Comparing Alcohol Use Between Females and Males
# set work directory and load lavaan packages
setwd("c:/users/wchan/google drive/stat6108/data")
library(lavaan)
# data preparation
# group 1: Females
female.corr <- matrix(
c(1.0000, 0.4641, 0.4200,
0.4641, 1.0000, 0.5614,
0.4200, 0.5614, ... |
# 1. Merges the training and the test sets to create one data set.
X_test <- read.table("C:/Users/bpu313718/Desktop/coursera/UCI HAR Dataset/test/X_test.txt")
X_test <- read.table("C:/Users/bpu313718/Desktop/coursera/UCI HAR Dataset/test/X_test.txt")
Y_test <- read.table("C:/Users/bpu313718/Desktop/coursera/UC... | /run_analysis.R | no_license | danielsabreu/Getting-and-Cleaning-Data-Course-Project | R | false | false | 1,910 | r |
# 1. Merges the training and the test sets to create one data set.
X_test <- read.table("C:/Users/bpu313718/Desktop/coursera/UCI HAR Dataset/test/X_test.txt")
X_test <- read.table("C:/Users/bpu313718/Desktop/coursera/UCI HAR Dataset/test/X_test.txt")
Y_test <- read.table("C:/Users/bpu313718/Desktop/coursera/UC... |
# Define parameters after model defaults
plant_density <-
5 * max(15000)
spore_interception_parameter <-
0.00006 * (15000 / 350)
test1 <-
interception_probability(target_density = plant_density,
k = spore_interception_parameter)
test2 <-
interception_probability(1e12,0.00005)
tes... | /tests/testthat/test-interception_probability.R | permissive | IhsanKhaliq/ascotraceR | R | false | false | 592 | r |
# Define parameters after model defaults
plant_density <-
5 * max(15000)
spore_interception_parameter <-
0.00006 * (15000 / 350)
test1 <-
interception_probability(target_density = plant_density,
k = spore_interception_parameter)
test2 <-
interception_probability(1e12,0.00005)
tes... |
SAMP_PROBA <-
function(X,PROBA){
Xsamp=do.call(X$qfun,as.list(c(PROBA,X$param)))
return (Xsamp)
}
| /R/SAMP_PROBA.R | no_license | cran/HYRISK | R | false | false | 101 | r | SAMP_PROBA <-
function(X,PROBA){
Xsamp=do.call(X$qfun,as.list(c(PROBA,X$param)))
return (Xsamp)
}
|
## makeCacheMatrix creates a special "matrix" object that can cache its inverse.
## cacheSolve computes the inverse of the special "matrix" returned by makeCacheMatrix.
## If the inverse has already been calculated (and the matrix has not changed), then cacheSolve
## retrieves the inverse from the cache.
## Create a... | /cachematrix.R | no_license | cspringe/ProgrammingAssignment2 | R | false | false | 2,325 | r | ## makeCacheMatrix creates a special "matrix" object that can cache its inverse.
## cacheSolve computes the inverse of the special "matrix" returned by makeCacheMatrix.
## If the inverse has already been calculated (and the matrix has not changed), then cacheSolve
## retrieves the inverse from the cache.
## Create a... |
#' plotRoastProfile
#'
#' Plot a single roast profile - takes the filename of a filled out profile
#' template (found in /data). It takes the total_seconds and temp column to
#' plot the profile, the target column to plot the targets, and uses the notes
#' column to plot points in the roast where any note was taken. Us... | /R/plotRoastProfile.R | no_license | hferg/beanHeatR | R | false | false | 5,374 | r | #' plotRoastProfile
#'
#' Plot a single roast profile - takes the filename of a filled out profile
#' template (found in /data). It takes the total_seconds and temp column to
#' plot the profile, the target column to plot the targets, and uses the notes
#' column to plot points in the roast where any note was taken. Us... |
# 데이터 전처리 - dplyr 패키지를 학습하자....
# dplyr : 데이터프레임(티블)을 다루는 유용한 기능의 함수들 제공
install.packages("dplyr")
library(dplyr)
#install.packages("ggplot2")
rm(mpg)
library(ggplot2)
head(mpg)
str(mpg)
exam <- read.csv("data/csv_exam.csv")
str(exam)
dim(exam)
head(exam);tail(exam)
View(exam)
# exam에서 class가 1인 경우만 추출하여 출력
exam %>%... | /K-Digital Training/R/exam/day13.R | no_license | JungHyun0902/TIL | R | false | false | 7,857 | r | # 데이터 전처리 - dplyr 패키지를 학습하자....
# dplyr : 데이터프레임(티블)을 다루는 유용한 기능의 함수들 제공
install.packages("dplyr")
library(dplyr)
#install.packages("ggplot2")
rm(mpg)
library(ggplot2)
head(mpg)
str(mpg)
exam <- read.csv("data/csv_exam.csv")
str(exam)
dim(exam)
head(exam);tail(exam)
View(exam)
# exam에서 class가 1인 경우만 추출하여 출력
exam %>%... |
## Illium - Data
## Illium - VMatrix
IlliumCore <- MatrixSet(PasSkills=c("Javelin_EnhancedJavelin", "Destruction", "Machina_Domination", "Deus_Liyo", "CurseMark", "MotalSwing_MotalWingBeat"),
PasLvs=c(50, 50, 50, 50, 50, 50),
PasMP=c(10, 10, 10, 10, 10, 10),
... | /history/Illium12347.R | no_license | MapleStory-Archive/Maplestory_DPM | R | false | false | 52,505 | r | ## Illium - Data
## Illium - VMatrix
IlliumCore <- MatrixSet(PasSkills=c("Javelin_EnhancedJavelin", "Destruction", "Machina_Domination", "Deus_Liyo", "CurseMark", "MotalSwing_MotalWingBeat"),
PasLvs=c(50, 50, 50, 50, 50, 50),
PasMP=c(10, 10, 10, 10, 10, 10),
... |
#### STAT-S 610 Homework #1
df <- data.frame(nrow = 21)
colnames(df) <- c("title", "n_words", "n_chars", "n_individuals")
| /Homework1.R | no_license | BJKill/S610_Hmwk1 | R | false | false | 147 | r | #### STAT-S 610 Homework #1
df <- data.frame(nrow = 21)
colnames(df) <- c("title", "n_words", "n_chars", "n_individuals")
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.