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 |
|---|---|---|---|---|---|---|---|---|---|
ui <- fluidPage(
titlePanel("Predicting Diamond Cuts"),
sidebarLayout(
sidebarPanel(
sliderInput("Depth", label = "Depth:", value = 62
, min = 43, max = 79, step = .1)
,sliderInput("Table", "Table:", value = 57
, min = 43, max = 95, step = .5)
,sliderInpu... | /ui.R | no_license | JackStat/DiamondClass | R | false | false | 676 | r |
ui <- fluidPage(
titlePanel("Predicting Diamond Cuts"),
sidebarLayout(
sidebarPanel(
sliderInput("Depth", label = "Depth:", value = 62
, min = 43, max = 79, step = .1)
,sliderInput("Table", "Table:", value = 57
, min = 43, max = 95, step = .5)
,sliderInpu... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/detection.R
\name{detectionPnegNormGS}
\alias{detectionPnegNormGS}
\title{Detection P-value emulating Genome Studio}
\usage{
detectionPnegNormGS(sset)
}
\arguments{
\item{sset}{a \code{SigSet}}
}
\value{
detection p-value
}
\description{
The ... | /man/detectionPnegNormGS.Rd | no_license | ttriche/sesame | R | false | true | 619 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/detection.R
\name{detectionPnegNormGS}
\alias{detectionPnegNormGS}
\title{Detection P-value emulating Genome Studio}
\usage{
detectionPnegNormGS(sset)
}
\arguments{
\item{sset}{a \code{SigSet}}
}
\value{
detection p-value
}
\description{
The ... |
#################################
# Analysis of combined tonal entropy
#################################
library(tidyverse)
#################################
# input data
#################################
entropy <- NULL
inDir <- 'Pipeline/tonal/tonal-entropy/combined/'
infiles <- list.files(inDir)
for (f in infiles)... | /R-scripts/Entropy-Analysis.R | no_license | mattsetz/Improv-Piano-Coordination | R | false | false | 5,252 | r | #################################
# Analysis of combined tonal entropy
#################################
library(tidyverse)
#################################
# input data
#################################
entropy <- NULL
inDir <- 'Pipeline/tonal/tonal-entropy/combined/'
infiles <- list.files(inDir)
for (f in infiles)... |
# read data
housing = read.csv('data\\albuquerque.csv')
plot(housing$Area, housing$Price, pch = 20)
hist(housing$Price)
library(boot)
housing = housing[order(housing$Area),]#reordering data according to Area
# check if reordering is only for plotting, or does it influence the coverage rate and interval lengths
# no... | /unused/dataset_experiments/albuquerque.R | no_license | hradave/Research_project | R | false | false | 3,156 | r | # read data
housing = read.csv('data\\albuquerque.csv')
plot(housing$Area, housing$Price, pch = 20)
hist(housing$Price)
library(boot)
housing = housing[order(housing$Area),]#reordering data according to Area
# check if reordering is only for plotting, or does it influence the coverage rate and interval lengths
# no... |
rm(list=ls())
#
source('../dataFunk.r')
source('../predictFunk.r')
source('../modelFunk.r')
#
#KNOBS
#
#
mcat = 253
minYear = 1978
maxYear = 1983
#
dataFile = sprintf('../%sdata%sTo%s_2018-06-08.csv', mcat, substring(minYear, 3, 4), substring(maxYear, 3, 4))
samplePath = sprintf('./%s%s%s/', mcat, minYear,... | /try1/postSSC/25319781983M4/runM4.r | no_license | gasduster99/sppComp | R | false | false | 5,019 | r | rm(list=ls())
#
source('../dataFunk.r')
source('../predictFunk.r')
source('../modelFunk.r')
#
#KNOBS
#
#
mcat = 253
minYear = 1978
maxYear = 1983
#
dataFile = sprintf('../%sdata%sTo%s_2018-06-08.csv', mcat, substring(minYear, 3, 4), substring(maxYear, 3, 4))
samplePath = sprintf('./%s%s%s/', mcat, minYear,... |
.AER <- function(tab)
{
1 - sum(tab[row(tab) == col(tab)])/sum(tab)
}
mtxconfusion <- function(actual, predicted, prior = NULL, printit=FALSE) {
.confusion(actual, predicted, prior, printit)
}
.confusion <- function(actual, predicted, prior = NULL, printit=FALSE) {
names <- levels(actual)
... | /rrcov/R/da-utils.R | no_license | ingted/R-Examples | R | false | false | 2,799 | r | .AER <- function(tab)
{
1 - sum(tab[row(tab) == col(tab)])/sum(tab)
}
mtxconfusion <- function(actual, predicted, prior = NULL, printit=FALSE) {
.confusion(actual, predicted, prior, printit)
}
.confusion <- function(actual, predicted, prior = NULL, printit=FALSE) {
names <- levels(actual)
... |
testlist <- list(bytes1 = c(1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1258291200L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L... | /mcga/inst/testfiles/ByteCodeMutation/libFuzzer_ByteCodeMutation/ByteCodeMutation_valgrind_files/1612802918-test.R | no_license | akhikolla/updatedatatype-list3 | R | false | false | 572 | r | testlist <- list(bytes1 = c(1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1263225675L, 1258291200L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Main.R
\name{execute}
\alias{execute}
\title{Execute the Study}
\usage{
execute(connectionDetails, cdmDatabaseSchema,
cdmDatabaseName = "friendly database name",
cohortDatabaseSchema = cdmDatabaseSchema, cohortTable = "cohort",
oracleTe... | /CHADS2Tutorial/man/execute.Rd | no_license | NEONKID/StudyProtocolSandbox | R | false | true | 3,770 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Main.R
\name{execute}
\alias{execute}
\title{Execute the Study}
\usage{
execute(connectionDetails, cdmDatabaseSchema,
cdmDatabaseName = "friendly database name",
cohortDatabaseSchema = cdmDatabaseSchema, cohortTable = "cohort",
oracleTe... |
require(dplyr)
require(stringr)
#read trace data set
TRACE <- read.csv("//KNX3IT/AWG Management/Phone Trace Program/TRACE.csv", stringsAsFactors=FALSE)
###paste the date to the time vector
TRACE$TIME <- paste(TRACE$TIME,TRACE$DATE)
###convert time vector to POSIXct format
TRACE$TIME <- as.POSIXct(TRACE$TIME,format="%... | /Run.R | no_license | jlow2499/Time-Comparison-Activity-Monitor | R | false | false | 3,435 | r | require(dplyr)
require(stringr)
#read trace data set
TRACE <- read.csv("//KNX3IT/AWG Management/Phone Trace Program/TRACE.csv", stringsAsFactors=FALSE)
###paste the date to the time vector
TRACE$TIME <- paste(TRACE$TIME,TRACE$DATE)
###convert time vector to POSIXct format
TRACE$TIME <- as.POSIXct(TRACE$TIME,format="%... |
################################################################################
# Utilities for configuring analysis projects
################################################################################
################################################################################
# Parsers for config elements
... | /R/analysisConfig.R | no_license | demuellae/muRtools | R | false | false | 8,546 | r | ################################################################################
# Utilities for configuring analysis projects
################################################################################
################################################################################
# Parsers for config elements
... |
require(dplyr)
require(data.table)
require(uuid)
require(digest)
require(httr)
require(xml2)
require(stringdist)
## Load gbif core and ext vocab names and urls
loadDwcExtensionList = function(url="http://tools.gbif.org/dwca-validator/extensions.do"){
# get core and ext link
dwcExtListPage = GET(url)
xpath = '/... | /dwcHelpeR/R/dwcHelpeR.R | permissive | trashmai/dwcHelper | R | false | false | 20,011 | r | require(dplyr)
require(data.table)
require(uuid)
require(digest)
require(httr)
require(xml2)
require(stringdist)
## Load gbif core and ext vocab names and urls
loadDwcExtensionList = function(url="http://tools.gbif.org/dwca-validator/extensions.do"){
# get core and ext link
dwcExtListPage = GET(url)
xpath = '/... |
# ----------------------------------------
# -- PROGRAM ui_body.R --
# ----------------------------------------
# USE: Create UI elements for the
# application body (right side on the
# desktop; contains output) and
# ATTACH them to the UI by calling
# add_ui_body()
#
# NOTEs:
# -... | /program/ui_body.R | no_license | ginberg/gene_explorer | R | false | false | 2,074 | r | # ----------------------------------------
# -- PROGRAM ui_body.R --
# ----------------------------------------
# USE: Create UI elements for the
# application body (right side on the
# desktop; contains output) and
# ATTACH them to the UI by calling
# add_ui_body()
#
# NOTEs:
# -... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/package.R
\docType{package}
\name{debugme}
\alias{debugme}
\alias{debugme-package}
\title{Debug R Packages}
\usage{
debugme(env = topenv(parent.frame()), pkg = environmentName(env))
}
\arguments{
\item{env}{Environment to instument debugging ... | /man/debugme.Rd | permissive | jmpasmoi/debugme | R | false | true | 2,222 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/package.R
\docType{package}
\name{debugme}
\alias{debugme}
\alias{debugme-package}
\title{Debug R Packages}
\usage{
debugme(env = topenv(parent.frame()), pkg = environmentName(env))
}
\arguments{
\item{env}{Environment to instument debugging ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/transform_filter-methods.R
\name{topp}
\alias{topp}
\title{Make filter fun. that returns the most abundant \code{p} fraction of taxa}
\usage{
topp(p, na.rm=TRUE)
}
\arguments{
\item{p}{A numeric of length 1, indicating what fraction of the mo... | /man/topp.Rd | no_license | benjjneb/phyloseq | R | false | true | 1,135 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/transform_filter-methods.R
\name{topp}
\alias{topp}
\title{Make filter fun. that returns the most abundant \code{p} fraction of taxa}
\usage{
topp(p, na.rm=TRUE)
}
\arguments{
\item{p}{A numeric of length 1, indicating what fraction of the mo... |
#!/usr/bin/Rscript
library(ggplot2)
df <- read.table("timings_GPU.dat", sep = "", header = FALSE)
names(df) <- c('N','m2p')
p <- ggplot(df, aes(N)) +
geom_line(aes(y = m2p, colour = "m2p")) +
ggtitle("Algorithms runtimes with 32cores/64 threads, on PC.") +
theme(plot.title = element_text(hju... | /timings/plot_times_para.R | no_license | jdeviers/singlet_yield | R | false | false | 426 | r | #!/usr/bin/Rscript
library(ggplot2)
df <- read.table("timings_GPU.dat", sep = "", header = FALSE)
names(df) <- c('N','m2p')
p <- ggplot(df, aes(N)) +
geom_line(aes(y = m2p, colour = "m2p")) +
ggtitle("Algorithms runtimes with 32cores/64 threads, on PC.") +
theme(plot.title = element_text(hju... |
## This file contains two functions
## makeCacheMatrix - this function creates a vector of four functions
## cacheSolve - This function returns the inverse of a matrix
## makeCacheMatrix function creates a vector of four functions
## GETMAT - Get the input matrix
## SETMAT - assigns input matrix to a varia... | /cachematrix.R | no_license | Nmahadevan/ProgrammingAssignment2 | R | false | false | 1,779 | r | ## This file contains two functions
## makeCacheMatrix - this function creates a vector of four functions
## cacheSolve - This function returns the inverse of a matrix
## makeCacheMatrix function creates a vector of four functions
## GETMAT - Get the input matrix
## SETMAT - assigns input matrix to a varia... |
#' Custom Map Theme
#'
#' @param map `ggplot2` map object
#' @param continuous Logical defaults to `FALSE`. Is the fill variable continuous.
#'#@param variable_label A character string indicating the variable label to use. If not supplied then the underlying
#' variable name is used.
#' @param trans A character string... | /R/theme_map.R | permissive | leftygray/EpiNow | R | false | false | 2,592 | r | #' Custom Map Theme
#'
#' @param map `ggplot2` map object
#' @param continuous Logical defaults to `FALSE`. Is the fill variable continuous.
#'#@param variable_label A character string indicating the variable label to use. If not supplied then the underlying
#' variable name is used.
#' @param trans A character string... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compute.IPS.R
\name{compute.IPS}
\alias{compute.IPS}
\title{Compute immunophenoscore}
\usage{
compute.IPS(RNA.tpm)
}
\arguments{
\item{RNA.tpm}{numeric matrix with rows=genes and columns=samples}
}
\value{
numeric matrix with rows=samples and... | /man/compute.IPS.Rd | permissive | liangdp1984/easier_manuscript | R | false | true | 492 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compute.IPS.R
\name{compute.IPS}
\alias{compute.IPS}
\title{Compute immunophenoscore}
\usage{
compute.IPS(RNA.tpm)
}
\arguments{
\item{RNA.tpm}{numeric matrix with rows=genes and columns=samples}
}
\value{
numeric matrix with rows=samples and... |
## LOADING BINARY (GRADS) FILES
## Load 1d binary file
#' @export
load_grads1D <- function(fldr="/scratch/01/andrey/PPSCM",ctl="grads/history.ctl",file="OUT/history.dat",n=NULL)
{
## Load variable names from CTL file
ctl <- scan(file.path(fldr,ctl),what="character",sep="\n")
ctl <- strsplit(ctl,split=" ")
n... | /R-extra/grads.r | no_license | alex-robinson/myr | R | false | false | 4,058 | r |
## LOADING BINARY (GRADS) FILES
## Load 1d binary file
#' @export
load_grads1D <- function(fldr="/scratch/01/andrey/PPSCM",ctl="grads/history.ctl",file="OUT/history.dat",n=NULL)
{
## Load variable names from CTL file
ctl <- scan(file.path(fldr,ctl),what="character",sep="\n")
ctl <- strsplit(ctl,split=" ")
n... |
# @file RunPlp.R
#
# Copyright 2018 Observational Health Data Sciences and Informatics
#
# This file is part of PatientLevelPrediction
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | /R/RunPlp.R | permissive | chandryou/PatientLevelPrediction | R | false | false | 30,428 | r | # @file RunPlp.R
#
# Copyright 2018 Observational Health Data Sciences and Informatics
#
# This file is part of PatientLevelPrediction
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... |
# created 6-1-12
# to do
# when plotting use the actual variable names
lagPlot <- function(y, x=NULL, lags=0, corr = TRUE, smooth = TRUE)
{
lag.plot1 <- function (series, lags = 1, corr = TRUE, smooth = TRUE)
{
name1 = paste(deparse(substitute(series)), "(t-", sep = "")
name2 = paste(deparse(substitute(series... | /gamlss.util/R/lagPlot.R | no_license | ingted/R-Examples | R | false | false | 2,506 | r | # created 6-1-12
# to do
# when plotting use the actual variable names
lagPlot <- function(y, x=NULL, lags=0, corr = TRUE, smooth = TRUE)
{
lag.plot1 <- function (series, lags = 1, corr = TRUE, smooth = TRUE)
{
name1 = paste(deparse(substitute(series)), "(t-", sep = "")
name2 = paste(deparse(substitute(series... |
library(plyr)
library(ggplot2)
library(data.table)
data <- read.delim('~/Dropbox/densitypaper/SingleCellSeqData/refSeq_2014-06-17_refGene_ERCC.gtf',header=F,stringsAsFactors=F)
colnames(data) <- c(
'chr',
'source',
'feature',
'start',
'end',
'score',
'strand',
'frame',
'group'
)
dataEx <- subset(dat... | /SingleCellSeqData/Analysis/extract_exon_lengths.R | no_license | arjunrajlaboratory/DensityPaperDataAnalysis | R | false | false | 1,796 | r | library(plyr)
library(ggplot2)
library(data.table)
data <- read.delim('~/Dropbox/densitypaper/SingleCellSeqData/refSeq_2014-06-17_refGene_ERCC.gtf',header=F,stringsAsFactors=F)
colnames(data) <- c(
'chr',
'source',
'feature',
'start',
'end',
'score',
'strand',
'frame',
'group'
)
dataEx <- subset(dat... |
Auta.statystyki<-function(marka="",model="",rodzaj.paliwa="",moc.silnika.w.km=0,
rok.produkcji=0,przebieg.w.km=0,wyswietl=FALSE){
library(PogromcyDanych)
library(dplyr)
statystyki<-tbl_df(auta2012)
if(marka!=""){
statystyki<-filter(statystyki,Marka==marka)
}
if(model!=""){
statystyki... | /MINI_2015/prace_domowe/PD_4/praca_domowa_4_smuda_piotr.R | no_license | smudap/RandBigData | R | false | false | 1,421 | r |
Auta.statystyki<-function(marka="",model="",rodzaj.paliwa="",moc.silnika.w.km=0,
rok.produkcji=0,przebieg.w.km=0,wyswietl=FALSE){
library(PogromcyDanych)
library(dplyr)
statystyki<-tbl_df(auta2012)
if(marka!=""){
statystyki<-filter(statystyki,Marka==marka)
}
if(model!=""){
statystyki... |
\name{ellipsoid}
\alias{ellipsoid}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Calculate an ellipsoid in 3D
}
\description{
Calculates a \code{\link[rgl]{qmesh3d}} object representing 3D ellipsoid with
given \code{center} and \code{shape} matrix. The function allows for
degenerate e... | /man/ellipsoid.Rd | no_license | gmonette/p3d | R | false | false | 3,256 | rd | \name{ellipsoid}
\alias{ellipsoid}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Calculate an ellipsoid in 3D
}
\description{
Calculates a \code{\link[rgl]{qmesh3d}} object representing 3D ellipsoid with
given \code{center} and \code{shape} matrix. The function allows for
degenerate e... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read_tcf.R
\name{read_tcf}
\alias{read_tcf}
\title{Read a TRIM command file}
\usage{
read_tcf(file, encoding = getOption("encoding"), simplify = TRUE)
}
\arguments{
\item{file}{Location of TRIM command file.}
\item{encoding}{The encoding in ... | /man/read_tcf.Rd | no_license | cran/rtrim | R | false | true | 5,210 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read_tcf.R
\name{read_tcf}
\alias{read_tcf}
\title{Read a TRIM command file}
\usage{
read_tcf(file, encoding = getOption("encoding"), simplify = TRUE)
}
\arguments{
\item{file}{Location of TRIM command file.}
\item{encoding}{The encoding in ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/adp.R
\docType{data}
\name{adp}
\alias{adp}
\title{ADP (acoustic-doppler profiler) dataset}
\source{
This file came from the SLEIWEX-2008 experiment.
}
\usage{
data(adp)
}
\description{
This is degraded subsample of measurements that were mad... | /man/adp.Rd | no_license | clayton33/oce | R | false | true | 1,997 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/adp.R
\docType{data}
\name{adp}
\alias{adp}
\title{ADP (acoustic-doppler profiler) dataset}
\source{
This file came from the SLEIWEX-2008 experiment.
}
\usage{
data(adp)
}
\description{
This is degraded subsample of measurements that were mad... |
#!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
# args[1] - input file
# args[2] - map file
# args[3] - output file
# args[4] - count of clusters / cutoff cluster distance
# args[5] - cluster approach i.e. hclust, hclust_height, hclust_old, kmeans
# args[6] - cluster method for hclust: [single, complete, a... | /example/clustering/clusterScript.R | permissive | aharth/fuse | R | false | false | 2,253 | r | #!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
# args[1] - input file
# args[2] - map file
# args[3] - output file
# args[4] - count of clusters / cutoff cluster distance
# args[5] - cluster approach i.e. hclust, hclust_height, hclust_old, kmeans
# args[6] - cluster method for hclust: [single, complete, a... |
source("includes.R")
##### CONSTANTS #####
inDataName = "plot_data/degree_stats.csv"
tabOutName = "degree_stats.tex"
tabLabel = "tab:degreeStats"
tabCaption = c("Average of the degree statistics of all \\lraw{numCrawls} crawls.")
##### PROCESSING & OUTPUT #####
degreeStats = LoadDT(inDataName, header=T)
print(xtab... | /eval/plotting/output_degree_stats.R | permissive | tiago-peres/ipfs-crawler | R | false | false | 554 | r | source("includes.R")
##### CONSTANTS #####
inDataName = "plot_data/degree_stats.csv"
tabOutName = "degree_stats.tex"
tabLabel = "tab:degreeStats"
tabCaption = c("Average of the degree statistics of all \\lraw{numCrawls} crawls.")
##### PROCESSING & OUTPUT #####
degreeStats = LoadDT(inDataName, header=T)
print(xtab... |
## Actividad corespondiente a la semana 3: Léxico
## El código representa una funcion que utiliza los objetos 'datos', 'nrow' y 'ncol'
## la función genera una matriz 'x' usando información de los objetos y genera
## 'inv' como el inverso de 'x'
makeCacheMatrix <- function (x = matrix (), data,... | /cachematrix.R | no_license | UserForCourseDS/ProgrammingAssignment2 | R | false | false | 1,128 | r | ## Actividad corespondiente a la semana 3: Léxico
## El código representa una funcion que utiliza los objetos 'datos', 'nrow' y 'ncol'
## la función genera una matriz 'x' usando información de los objetos y genera
## 'inv' como el inverso de 'x'
makeCacheMatrix <- function (x = matrix (), data,... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/toposearch.R
\name{delete_admix}
\alias{delete_admix}
\title{Delete an admixture edge}
\usage{
delete_admix(graph, from = NULL, to = NULL)
}
\arguments{
\item{graph}{An admixture graph}
\item{from}{Edge source node}
\item{to}{Edge target no... | /man/delete_admix.Rd | no_license | uqrmaie1/admixtools | R | false | true | 454 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/toposearch.R
\name{delete_admix}
\alias{delete_admix}
\title{Delete an admixture edge}
\usage{
delete_admix(graph, from = NULL, to = NULL)
}
\arguments{
\item{graph}{An admixture graph}
\item{from}{Edge source node}
\item{to}{Edge target no... |
covered_area <- function(dc,lat,grado) {
grado <- grado
dc <- dc
lat <- lat
intervalos <- (-18.5+3)/(-grado)
y.tot<-NULL
for (i in 1:intervalos)
{
y <- matrix(cbind(rep(-3-(grado)*(i-1),40),rep(-3-(grado)*i,40)),ncol=2)
y.tot <- rbind(y.tot,y)
}
x.to... | /R/covered_area.R | no_license | PabloMBooster/fenix | R | false | false | 1,149 | r | covered_area <- function(dc,lat,grado) {
grado <- grado
dc <- dc
lat <- lat
intervalos <- (-18.5+3)/(-grado)
y.tot<-NULL
for (i in 1:intervalos)
{
y <- matrix(cbind(rep(-3-(grado)*(i-1),40),rep(-3-(grado)*i,40)),ncol=2)
y.tot <- rbind(y.tot,y)
}
x.to... |
# Copyright 2013 Revolution Analytics
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | /pkg/tests/sqlish.R | no_license | ferry2174/plyrmr | R | false | false | 936 | r | # Copyright 2013 Revolution Analytics
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... |
#' Volume 2: Table 1.2
#'
#' A list of Counties and their respective Sub Counties
#' @docType data
#'
#' @usage data(V2_T1.2)
#'
#' @format A data frame with 4 variables:
#' \describe{
#' \item{\code{CountyCode}}{County Code (1 - 47)}
#' \item{\code{County}}{County}
#' \item{\code{SubCountyCode}}{Sub County Code}
#' \i... | /R/V2_T1.2.R | permissive | LucyNjoki/rKenyaCensus | R | false | false | 394 | r | #' Volume 2: Table 1.2
#'
#' A list of Counties and their respective Sub Counties
#' @docType data
#'
#' @usage data(V2_T1.2)
#'
#' @format A data frame with 4 variables:
#' \describe{
#' \item{\code{CountyCode}}{County Code (1 - 47)}
#' \item{\code{County}}{County}
#' \item{\code{SubCountyCode}}{Sub County Code}
#' \i... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/table.Autocorrelation.R
\name{table.Autocorrelation}
\alias{table.Autocorrelation}
\title{table for calculating the first six autocorrelation coefficients and
significance}
\usage{
table.Autocorrelation(R, digits = 4)
}
\arguments{
\item{R}{a... | /man/table.Autocorrelation.Rd | no_license | timelyportfolio/PerformanceAnalytics | R | false | true | 1,503 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/table.Autocorrelation.R
\name{table.Autocorrelation}
\alias{table.Autocorrelation}
\title{table for calculating the first six autocorrelation coefficients and
significance}
\usage{
table.Autocorrelation(R, digits = 4)
}
\arguments{
\item{R}{a... |
#' @name kpPlotRainfall
#' @title kpPlotRainfall
#'
#' @description
#'
#' Creates a rainfall plot showing the distances between features in the genome.
#' Usually used to plot the distance bewteen somatic mutations to idenify kataegis.
#'
#' @details
#'
#' \code{kpPlotRainfall} plots the distances between a feat... | /R/kpPlotRainfall.R | no_license | bernatgel/karyoploteR | R | false | false | 7,548 | r | #' @name kpPlotRainfall
#' @title kpPlotRainfall
#'
#' @description
#'
#' Creates a rainfall plot showing the distances between features in the genome.
#' Usually used to plot the distance bewteen somatic mutations to idenify kataegis.
#'
#' @details
#'
#' \code{kpPlotRainfall} plots the distances between a feat... |
###### Group Project #######
# Dorothy Walls, 10175187 ##
#Greg Brown, 30080752 ##
#Abraham Hussein, 30016352 #
############################
## Libraries used
library(car)
library(knitr)
## Adding our data set
cancer<-read.csv("breast-cancer-wisconsin.csv", header = T)
## Attaching our data
attach(canc... | /Group Project- Annotated Final.R | no_license | AbrahamHussein/STAT-429-Group-Project | R | false | false | 14,091 | r | ###### Group Project #######
# Dorothy Walls, 10175187 ##
#Greg Brown, 30080752 ##
#Abraham Hussein, 30016352 #
############################
## Libraries used
library(car)
library(knitr)
## Adding our data set
cancer<-read.csv("breast-cancer-wisconsin.csv", header = T)
## Attaching our data
attach(canc... |
library(testthat)
library(nanodsmf)
context("The DNAstringset2gr function")
test_that("The conversion works",{
expect_equal(DNAstringset2gr(genomeFile),genomeGR)
})
context("The BSgenome2gr function")
test_that("The conversion works",{
expect_equal(BSgenome2gr(BSgenome.Celegans.UCSC.ce11::Celegans),genomeGR)
})... | /tests/testthat/test-grangesUtils.R | no_license | CellFateNucOrg/nanodsmf | R | false | false | 321 | r | library(testthat)
library(nanodsmf)
context("The DNAstringset2gr function")
test_that("The conversion works",{
expect_equal(DNAstringset2gr(genomeFile),genomeGR)
})
context("The BSgenome2gr function")
test_that("The conversion works",{
expect_equal(BSgenome2gr(BSgenome.Celegans.UCSC.ce11::Celegans),genomeGR)
})... |
library(tidyverse)
library(lubridate)
library(nycflights13)
# creating dates and times
# current date and time
today()
now()
# creating date and times from strings
ymd("2020-08-21")
mdy("february 21st, 2020")
mdy("08-21-2020")
dmy("21-08-2020")
dmy("21st january 2020")
ymd(20200821)
# date times
ymd_hms("20200821 ... | /Dates and Times.R | no_license | clinton-mwachia/R-for-data-science | R | false | false | 4,188 | r | library(tidyverse)
library(lubridate)
library(nycflights13)
# creating dates and times
# current date and time
today()
now()
# creating date and times from strings
ymd("2020-08-21")
mdy("february 21st, 2020")
mdy("08-21-2020")
dmy("21-08-2020")
dmy("21st january 2020")
ymd(20200821)
# date times
ymd_hms("20200821 ... |
source("global.r")
# This is the user-interface definition of a Shiny web application. You can
# run the application by clicking 'Run App' above.
#
useShinyalert()
# Define UI for application that draws a histogram
ui = fluidPage(theme = shinytheme("sandstone"),
# Application title
titlePanel("NRSA Fish Colle... | /app.r | no_license | kblocksom/eForms_FishUpdates_NRSA | R | false | false | 13,422 | r | source("global.r")
# This is the user-interface definition of a Shiny web application. You can
# run the application by clicking 'Run App' above.
#
useShinyalert()
# Define UI for application that draws a histogram
ui = fluidPage(theme = shinytheme("sandstone"),
# Application title
titlePanel("NRSA Fish Colle... |
# booStrapStabilityforK
#' booStrapStabilityforK chechs stability
#' @param data the data to boostrap from
#' @param Kmax the maximum number of components
#' @param nBoot the number of boostrap sampling
#' @param gBoot logical if TRUE a parametric boostrap who preserves group structure, and in this case argument group... | /R/BootstrapFunctions.R | no_license | MarieEtienne/MixtLiP | R | false | false | 2,074 | r | # booStrapStabilityforK
#' booStrapStabilityforK chechs stability
#' @param data the data to boostrap from
#' @param Kmax the maximum number of components
#' @param nBoot the number of boostrap sampling
#' @param gBoot logical if TRUE a parametric boostrap who preserves group structure, and in this case argument group... |
setwd("C:/Users/Marc-Andy/Desktop/Coursera")
datafile <- "./data/household_power_consumption.txt"
##Find the number of minutes between 17/12/2006 17H24m;00 and 31/01/2007 = 66636
## Number of minutes per day = 1440, thus 2880 minutes for 2 days
## Read 69516 rows but skip the first 66636 rows
data <- read... | /plot4.R | no_license | Marc-Andy/Exploratory_Data_Analysis-Course_Project_1 | R | false | false | 1,499 | r | setwd("C:/Users/Marc-Andy/Desktop/Coursera")
datafile <- "./data/household_power_consumption.txt"
##Find the number of minutes between 17/12/2006 17H24m;00 and 31/01/2007 = 66636
## Number of minutes per day = 1440, thus 2880 minutes for 2 days
## Read 69516 rows but skip the first 66636 rows
data <- read... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/em.R
\name{em}
\alias{em}
\title{Estimate correlations with the EM}
\usage{
em(data.matrix)
}
\arguments{
\item{data.matrix}{a matrix where the rows consist of observations and the
columns consist of variables}
}
\value{
returns a corrected c... | /man/em.Rd | no_license | dustinfife/selection | R | false | true | 759 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/em.R
\name{em}
\alias{em}
\title{Estimate correlations with the EM}
\usage{
em(data.matrix)
}
\arguments{
\item{data.matrix}{a matrix where the rows consist of observations and the
columns consist of variables}
}
\value{
returns a corrected c... |
context('Test that xmin estimations are correct')
GRAPHICAL <- FALSE # Plot some diagnostics.
if ( exists('TEST_XMIN') && TEST_XMIN ) {
# Change dir if running tests manually
if ( file.exists('./tests/testthat') ) {
library(testthat)
setwd('./tests/testthat')
}
# Setup pli from Clauzet et al's
... | /tests/testthat/test-xminest.R | permissive | agmayor/spatialwarnings | R | false | false | 3,146 | r |
context('Test that xmin estimations are correct')
GRAPHICAL <- FALSE # Plot some diagnostics.
if ( exists('TEST_XMIN') && TEST_XMIN ) {
# Change dir if running tests manually
if ( file.exists('./tests/testthat') ) {
library(testthat)
setwd('./tests/testthat')
}
# Setup pli from Clauzet et al's
... |
#Import data
filename = "household_power_consumption.txt"
classes <- c("factor", "factor", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric")
table <- read.table(filename, sep = ";", header = TRUE, colClasses = classes, na.strings = "?")
head(table) #dates are coming in d/m/yyyy form and time... | /plot4.R | no_license | action781/ExData_Plotting1 | R | false | false | 1,432 | r | #Import data
filename = "household_power_consumption.txt"
classes <- c("factor", "factor", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric")
table <- read.table(filename, sep = ";", header = TRUE, colClasses = classes, na.strings = "?")
head(table) #dates are coming in d/m/yyyy form and time... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/format_MON.R
\name{create_individual_MON}
\alias{create_individual_MON}
\title{Create individual data table for Montpellier}
\usage{
create_individual_MON(Capture_data, Brood_data, verbose)
}
\arguments{
\item{Capture_data}{Capture data gener... | /man/create_individual_MON.Rd | no_license | SPI-Birds/pipelines | R | false | true | 638 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/format_MON.R
\name{create_individual_MON}
\alias{create_individual_MON}
\title{Create individual data table for Montpellier}
\usage{
create_individual_MON(Capture_data, Brood_data, verbose)
}
\arguments{
\item{Capture_data}{Capture data gener... |
## Author: Frank Tanner
## File: cachedmatrix.R
## Pedigree: forked from https://github.com/rdpeng/ProgrammingAssignment2
##
## Description: These functions manage a matrix cache so that expensive
## matrix operations do NOT need to be computed more than once. The initial
## implementation only caches matrix inversion... | /cachematrix.R | no_license | ftanner/ProgrammingAssignment2 | R | false | false | 1,787 | r | ## Author: Frank Tanner
## File: cachedmatrix.R
## Pedigree: forked from https://github.com/rdpeng/ProgrammingAssignment2
##
## Description: These functions manage a matrix cache so that expensive
## matrix operations do NOT need to be computed more than once. The initial
## implementation only caches matrix inversion... |
# Code Paper ----------------------------------------------------------
# Author: Valentina Andrade
# 1. Load packages --------------------------------------------------------
pacman::p_load(tidyverse, sjmisc, sjPlot, magrittr, labelled, lavaan, psych)
'%!in%' <- function(x,y)!('%in%'(x,y)) #own function
# 2. Load dat... | /R/01proc-descriptivecode.R | no_license | fabrica-datos-laborales/issp-analysis | R | false | false | 21,282 | r | # Code Paper ----------------------------------------------------------
# Author: Valentina Andrade
# 1. Load packages --------------------------------------------------------
pacman::p_load(tidyverse, sjmisc, sjPlot, magrittr, labelled, lavaan, psych)
'%!in%' <- function(x,y)!('%in%'(x,y)) #own function
# 2. Load dat... |
require(RSQLite)
require(data.table)
require(survey)
library(DBI)
library(curl)
library(hash)
library(readxl)
microdados_censo <- function(uf){
#criando environment com para relacionar o codigo da uf com a uf
h <- hash()
h[['RO']] <- 11
h[['AC']] <- 12
h[['AM']] <- 13
h[['RR']] <- 14
h[['PA']] <- 15
h[... | /CensoDemografico.R | no_license | heitorcmesquita/IBGE | R | false | false | 4,930 | r | require(RSQLite)
require(data.table)
require(survey)
library(DBI)
library(curl)
library(hash)
library(readxl)
microdados_censo <- function(uf){
#criando environment com para relacionar o codigo da uf com a uf
h <- hash()
h[['RO']] <- 11
h[['AC']] <- 12
h[['AM']] <- 13
h[['RR']] <- 14
h[['PA']] <- 15
h[... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cg_memberbystatedistrict.R
\name{cg_memberbystatedistrict}
\alias{cg_memberbystatedistrict}
\title{Get a list of the most recent new members of the current Congress.}
\usage{
cg_memberbystatedistrict(chamber = NULL, state = NULL,
district =... | /man/cg_memberbystatedistrict.Rd | permissive | jpiaskowski/rtimes | R | false | true | 1,895 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cg_memberbystatedistrict.R
\name{cg_memberbystatedistrict}
\alias{cg_memberbystatedistrict}
\title{Get a list of the most recent new members of the current Congress.}
\usage{
cg_memberbystatedistrict(chamber = NULL, state = NULL,
district =... |
#' Data manipulation functions.
#'
#' These five functions form the backbone of dplyr. They are all S3 generic
#' functions with methods for each individual data type. All functions work
#' exactly the same way: the first argument is the tbl, and the
#' subsequence arguments are interpreted in the context of that tbl.
... | /R/manip.r | no_license | tlpinney/dplyr | R | false | false | 2,544 | r | #' Data manipulation functions.
#'
#' These five functions form the backbone of dplyr. They are all S3 generic
#' functions with methods for each individual data type. All functions work
#' exactly the same way: the first argument is the tbl, and the
#' subsequence arguments are interpreted in the context of that tbl.
... |
# if (!require("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#
# BiocManager::install("biomaRt")
library(biomaRt)
library(dplyr)
### NOTE: the biomaRt package may no longer be a supported methof of retrieving the
### data required for this example
mart <- useMart(biomart="ensembl", dataset="... | /inst/example_apps/gene_density.R | no_license | hpeaker/ggcircos | R | false | false | 3,716 | r | # if (!require("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#
# BiocManager::install("biomaRt")
library(biomaRt)
library(dplyr)
### NOTE: the biomaRt package may no longer be a supported methof of retrieving the
### data required for this example
mart <- useMart(biomart="ensembl", dataset="... |
test_that("my_rf_cv outputs a numeric", {
results <- my_rf_cv(5)
expect_is(results, "numeric")
})
| /tests/testthat/test-my_rf_cv.R | no_license | jackgo1889/mystatspackage | R | false | false | 102 | r | test_that("my_rf_cv outputs a numeric", {
results <- my_rf_cv(5)
expect_is(results, "numeric")
})
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/skip.R
\name{skip}
\alias{skip}
\title{Skip the next set of benchmarks.}
\usage{
skip()
}
\value{
\code{NULL}, invisibly.
}
\description{
Skip the next set of benchmarks.
}
\author{
Benjamin Jean-Marie Tremblay
}
| /man/skip.Rd | no_license | bjmt/autobenchR | R | false | true | 291 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/skip.R
\name{skip}
\alias{skip}
\title{Skip the next set of benchmarks.}
\usage{
skip()
}
\value{
\code{NULL}, invisibly.
}
\description{
Skip the next set of benchmarks.
}
\author{
Benjamin Jean-Marie Tremblay
}
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mix.R
\name{comp_cdf_post}
\alias{comp_cdf_post}
\title{comp_cdf_post}
\usage{
comp_cdf_post(m, c, data)
}
\arguments{
\item{m}{mixture distribution with k components}
\item{c}{a scalar}
\item{data}{details depend on model}
}
\value{
a k by... | /man/comp_cdf_post.Rd | no_license | dcgerard/ashr | R | false | true | 726 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mix.R
\name{comp_cdf_post}
\alias{comp_cdf_post}
\title{comp_cdf_post}
\usage{
comp_cdf_post(m, c, data)
}
\arguments{
\item{m}{mixture distribution with k components}
\item{c}{a scalar}
\item{data}{details depend on model}
}
\value{
a k by... |
globalStats <- reactive({
comb_stats %>%
filter(month == input$month) %>%
summarise(stableHours = sum(stableHours),
monthlyHours = sum(monthlyHours),
buffTimeIndex = weighted.mean(buffTimeIndex, vkm),
miseryIndex = weighted.mean(miseryIndex, vk... | /R/value-boxes.R | no_license | DanBoyB/m50-dashboard | R | false | false | 1,521 | r | globalStats <- reactive({
comb_stats %>%
filter(month == input$month) %>%
summarise(stableHours = sum(stableHours),
monthlyHours = sum(monthlyHours),
buffTimeIndex = weighted.mean(buffTimeIndex, vkm),
miseryIndex = weighted.mean(miseryIndex, vk... |
#-----------------------------------------------------------------------
# Definições no knitr para execução e exibição do código.
library(knitr)
opts_chunk$set(cache = FALSE,
tidy = FALSE,
fig.width = 7,
fig.height = 7,
fig.align = "center",
... | /config/setup.R | no_license | leofn/datavis | R | false | false | 2,392 | r | #-----------------------------------------------------------------------
# Definições no knitr para execução e exibição do código.
library(knitr)
opts_chunk$set(cache = FALSE,
tidy = FALSE,
fig.width = 7,
fig.height = 7,
fig.align = "center",
... |
context("Gamma convergence iterated over pairs of years")
library(convergEU)
require(tibble)
require(devtools)
# debug(gamma_conv_msteps)
test_that("Basic exceptions", {
wDF <- structure(list(time = c(2003, 2007, 2011, 2016), AT = c(7.84729051589966,
6.94676637649536, 7.65887212753296, 7.92343091964722), BE = c... | /tests/testthat/test_gamma_conv_msteps.R | no_license | krlmlr/convergEU | R | false | false | 3,613 | r |
context("Gamma convergence iterated over pairs of years")
library(convergEU)
require(tibble)
require(devtools)
# debug(gamma_conv_msteps)
test_that("Basic exceptions", {
wDF <- structure(list(time = c(2003, 2007, 2011, 2016), AT = c(7.84729051589966,
6.94676637649536, 7.65887212753296, 7.92343091964722), BE = c... |
library(ape)
testtree <- read.tree("10023_0.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="10023_0_unrooted.txt") | /codeml_files/newick_trees_processed/10023_0/rinput.R | no_license | DaniBoo/cyanobacteria_project | R | false | false | 137 | r | library(ape)
testtree <- read.tree("10023_0.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="10023_0_unrooted.txt") |
#workshop3.R
#R source file for workshop 3
#Load DESeq2 and pheatmap
require(DESeq2)
require(pheatmap)
#Reads in the matrix of log-transformed gene expression counts, and prints
log_counts = read.table("counts.txt")
print(head(log_counts))
print(dim(log_counts)) #prints the amount of genes in the dataset (51414)
#If ... | /workshop3/workshop3.R | no_license | Learning-jusuE404/bios201-1 | R | false | false | 4,788 | r | #workshop3.R
#R source file for workshop 3
#Load DESeq2 and pheatmap
require(DESeq2)
require(pheatmap)
#Reads in the matrix of log-transformed gene expression counts, and prints
log_counts = read.table("counts.txt")
print(head(log_counts))
print(dim(log_counts)) #prints the amount of genes in the dataset (51414)
#If ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/extract.R
\name{extract,vglm-method}
\alias{extract,vglm-method}
\alias{extract.vglm}
\title{\code{\link{extract}} method for \code{vglm} objects}
\usage{
\S4method{extract}{vglm}(
model,
include.loglik = TRUE,
include.df = TRUE,
incl... | /man/extract-vglm-method.Rd | no_license | leifeld/texreg | R | false | true | 878 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/extract.R
\name{extract,vglm-method}
\alias{extract,vglm-method}
\alias{extract.vglm}
\title{\code{\link{extract}} method for \code{vglm} objects}
\usage{
\S4method{extract}{vglm}(
model,
include.loglik = TRUE,
include.df = TRUE,
incl... |
setMethodS3("unique", "list", function(x, ..., fromLast=FALSE, FUN=all.equal) {
# Argument 'FUN':
stopifnot(is.function(FUN));
# Argument 'fromLast':
fromLast <- as.logical(fromLast);
if (fromLast) {
stop("unique(..., fromLast=TRUE) is not implemented for lists.");
}
# Nothing todo?
if (length(x) ... | /inst/rsp-ex/TCGA,OV,testSet,pairs,fracB,v3/R/unique.list.R | no_license | HenrikBengtsson/aroma.cn.eval | R | false | false | 901 | r | setMethodS3("unique", "list", function(x, ..., fromLast=FALSE, FUN=all.equal) {
# Argument 'FUN':
stopifnot(is.function(FUN));
# Argument 'fromLast':
fromLast <- as.logical(fromLast);
if (fromLast) {
stop("unique(..., fromLast=TRUE) is not implemented for lists.");
}
# Nothing todo?
if (length(x) ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tnsPlotCovariates.R
\docType{methods}
\name{tnsPlotCovariates,TNS-method}
\alias{tnsPlotCovariates,TNS-method}
\alias{tnsPlotCovariates}
\title{Plot regulon activity and categorical covariates}
\usage{
\S4method{tnsPlotCovariates}{TNS}(tns, r... | /man/tnsPlotCovariates-methods.Rd | no_license | csgroen/RTNsurvival | R | false | true | 3,083 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tnsPlotCovariates.R
\docType{methods}
\name{tnsPlotCovariates,TNS-method}
\alias{tnsPlotCovariates,TNS-method}
\alias{tnsPlotCovariates}
\title{Plot regulon activity and categorical covariates}
\usage{
\S4method{tnsPlotCovariates}{TNS}(tns, r... |
#' Standardize Variables
#'
#' This function takes in a dataframe, the name of any number of variables. It then returns either a vector or a dataframe of scaling results. If passed a single variable name, standardize will return a the standardized variable as a vector, when passed 2 or more variable names, standard... | /R/standardize.R | no_license | cran/exploreR | R | false | false | 2,933 | r | #' Standardize Variables
#'
#' This function takes in a dataframe, the name of any number of variables. It then returns either a vector or a dataframe of scaling results. If passed a single variable name, standardize will return a the standardized variable as a vector, when passed 2 or more variable names, standard... |
#install.packages("rvest")
library(rvest)
###############################################
#Function to scrape site
fplscraper <- function(gameweek){
url_week = paste("http://fantasy.premierleague.com/a/team/1537030/event/", gameweek, sep="")
# render HTML from the site with phantomjs
repeat{
writeLine... | /fpl_scraper.R | no_license | pburgoine/FPL_data | R | false | false | 3,988 | r |
#install.packages("rvest")
library(rvest)
###############################################
#Function to scrape site
fplscraper <- function(gameweek){
url_week = paste("http://fantasy.premierleague.com/a/team/1537030/event/", gameweek, sep="")
# render HTML from the site with phantomjs
repeat{
writeLine... |
#R Orientation
#Author: Jonathan H. Morgan
#Based in Part on Jake Fisher's introduction to R: https://dnac.ssri.duke.edu/r-labs/2017/01_data_management.php
#9 May 2018
###################################
# STARTING FROM A CLEAR SLATE #
###################################
#Remove: Removes objects from me... | /Empirical/r/doc-R/Social/graph/SN&H 2018/Day 1 - Intro to SN&H, Intro to R/LAB - Data Management_R intro/01_R_orientation.R | no_license | ygtfrdes/Program | R | false | false | 18,720 | r | #R Orientation
#Author: Jonathan H. Morgan
#Based in Part on Jake Fisher's introduction to R: https://dnac.ssri.duke.edu/r-labs/2017/01_data_management.php
#9 May 2018
###################################
# STARTING FROM A CLEAR SLATE #
###################################
#Remove: Removes objects from me... |
# plot2.R
## setting the working directory to the project file folder
setwd("E:/Coursera/Exploratory Data Analysis/Course Projects/Course Project 1/")
## Reading the data from the dates 2007-02-01 and 2007-02-02.
powerconsumption <- read.table("household_power_consumption.txt",
sep=";"... | /plot2.R | no_license | vriend12345/ExData_Plotting1 | R | false | false | 1,050 | r | # plot2.R
## setting the working directory to the project file folder
setwd("E:/Coursera/Exploratory Data Analysis/Course Projects/Course Project 1/")
## Reading the data from the dates 2007-02-01 and 2007-02-02.
powerconsumption <- read.table("household_power_consumption.txt",
sep=";"... |
###################################################
### chunk number 1: libs
###################################################
options(width = 65)
library(rgdal)
library(spdep)
library(sp)
library(MBA)
library(fields)
###################################################
### chunk number 2: Import master station list... | /NOAA/NOAA-Station-Data-Example.R | no_license | ibrahim85/Cohen-McCreight | R | false | false | 13,186 | r | ###################################################
### chunk number 1: libs
###################################################
options(width = 65)
library(rgdal)
library(spdep)
library(sp)
library(MBA)
library(fields)
###################################################
### chunk number 2: Import master station list... |
# Reads crime scene profile from file.
# Documentation is in man directory.
read.csp.profile = function(path) {
if(!file.exists(path)) stop(paste(path, "does not exist."))
fileType = file_ext(path)
if((fileType=="xlsx")|(fileType=="xls"))
{
profile = read.xls(path, header=T, colClasses='character', sep=',')... | /likeLTD/R/hypothesis.R | no_license | radfordneal/R-package-mods | R | false | false | 17,308 | r | # Reads crime scene profile from file.
# Documentation is in man directory.
read.csp.profile = function(path) {
if(!file.exists(path)) stop(paste(path, "does not exist."))
fileType = file_ext(path)
if((fileType=="xlsx")|(fileType=="xls"))
{
profile = read.xls(path, header=T, colClasses='character', sep=',')... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/servicecatalog_operations.R
\name{servicecatalog_disassociate_tag_option_from_resource}
\alias{servicecatalog_disassociate_tag_option_from_resource}
\title{Disassociates the specified TagOption from the specified resource}
\usage{
servicecata... | /cran/paws.management/man/servicecatalog_disassociate_tag_option_from_resource.Rd | permissive | johnnytommy/paws | R | false | true | 760 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/servicecatalog_operations.R
\name{servicecatalog_disassociate_tag_option_from_resource}
\alias{servicecatalog_disassociate_tag_option_from_resource}
\title{Disassociates the specified TagOption from the specified resource}
\usage{
servicecata... |
library(voteogram)
### Name: house_carto
### Title: Produce a ProPublica- or GovTrack-style House roll call vote
### cartogram
### Aliases: house_carto
### ** Examples
## Not run:
##D # what you'd normally do
##D rep <- roll_call("house", 115, 1, 256)
## End(Not run)
# using a saved object
rep <- readRDS(system... | /data/genthat_extracted_code/voteogram/examples/house_carto.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 407 | r | library(voteogram)
### Name: house_carto
### Title: Produce a ProPublica- or GovTrack-style House roll call vote
### cartogram
### Aliases: house_carto
### ** Examples
## Not run:
##D # what you'd normally do
##D rep <- roll_call("house", 115, 1, 256)
## End(Not run)
# using a saved object
rep <- readRDS(system... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/BiCopMetaContour.R
\name{BiCopMetaContour}
\alias{BiCopMetaContour}
\title{Contour Plot of Bivariate Meta Distribution}
\usage{
BiCopMetaContour(u1 = NULL, u2 = NULL, bw = 1, size = 100,
levels = c(0.01, 0.05, 0.1, 0.15, 0.2), family = "emp... | /man/BiCopMetaContour.Rd | no_license | tvatter/VineCopula | R | false | true | 6,812 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/BiCopMetaContour.R
\name{BiCopMetaContour}
\alias{BiCopMetaContour}
\title{Contour Plot of Bivariate Meta Distribution}
\usage{
BiCopMetaContour(u1 = NULL, u2 = NULL, bw = 1, size = 100,
levels = c(0.01, 0.05, 0.1, 0.15, 0.2), family = "emp... |
library(tidyverse)
library(lubridate)
[
r16 <- read_delim("~/AnacondaProjects/R/Projekte/RadWien/data/rad_vz_2016.csv",
";", escape_double = FALSE, col_types = cols(Datum = col_date(format = "%Y%m%d")),
trim_ws = TRUE)
#plot -------------------------------------------
ggplot(r... | /rad.R | no_license | jKritz/RadWien | R | false | false | 1,392 | r | library(tidyverse)
library(lubridate)
[
r16 <- read_delim("~/AnacondaProjects/R/Projekte/RadWien/data/rad_vz_2016.csv",
";", escape_double = FALSE, col_types = cols(Datum = col_date(format = "%Y%m%d")),
trim_ws = TRUE)
#plot -------------------------------------------
ggplot(r... |
# Chad R Bhatti
# 07.27.2017
# basic_for_loop.R
################################################################
# Basic for loop syntax;
################################################################
for (counter in values){
inside loop here
}
#####################################################... | /Week 7/basic_for_loop.R | no_license | zeelat7/RegressionMultivariateAnalysis | R | false | false | 1,987 | r | # Chad R Bhatti
# 07.27.2017
# basic_for_loop.R
################################################################
# Basic for loop syntax;
################################################################
for (counter in values){
inside loop here
}
#####################################################... |
source(system.file(file.path('tests', 'testthat', 'test_utils.R'), package = 'nimble'))
context('Testing return() type error trapping')
RwarnLevel <- options('warn')$warn
options(warn = 1)
nimbleVerboseSetting <- nimbleOptions('verbose')
nimbleOptions(verbose = FALSE)
nimbleVerboseErrorsSetting <- nimbleOptions('verbo... | /packages/nimble/tests/testthat/test-returnTypeErrorTrapping.R | permissive | nimble-dev/nimble | R | false | false | 2,217 | r | source(system.file(file.path('tests', 'testthat', 'test_utils.R'), package = 'nimble'))
context('Testing return() type error trapping')
RwarnLevel <- options('warn')$warn
options(warn = 1)
nimbleVerboseSetting <- nimbleOptions('verbose')
nimbleOptions(verbose = FALSE)
nimbleVerboseErrorsSetting <- nimbleOptions('verbo... |
## Assignment 2
## This source code contains the two functions needed to allow the caching of the inverse of a matrix and to computed the inverse of a matrix
## The computation of the inverse will take place if the inverse is yet to be computed.
## The makeCacheMatrix sets the value of the matrix,get the value of the ... | /cachematrix.R | no_license | solomon76/ProgrammingAssignment2 | R | false | false | 1,413 | r | ## Assignment 2
## This source code contains the two functions needed to allow the caching of the inverse of a matrix and to computed the inverse of a matrix
## The computation of the inverse will take place if the inverse is yet to be computed.
## The makeCacheMatrix sets the value of the matrix,get the value of the ... |
# Copyright 2017 Observational Health Data Sciences and Informatics
#
# This file is part of AlendronateVsRaloxifene
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.... | /AlendronateVsRaloxifene/R/CreateStudyAnalysesDetails.R | permissive | jingjingz/StudyProtocols | R | false | false | 17,849 | r | # Copyright 2017 Observational Health Data Sciences and Informatics
#
# This file is part of AlendronateVsRaloxifene
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/npv_functionsss.R
\name{npv.z}
\alias{npv.z}
\title{A NPV function}
\usage{
npv.z(i, cf, freq = 1, apr = FALSE, now = NULL, drop.bef.now = TRUE,
adjdisc = NULL)
}
\arguments{
\item{i}{is the interest rate}
\item{cf}{is the cash flow, a zoo... | /asrsMethods/man/npv.z.Rd | no_license | asrshelpdesk/asrsMethods | R | false | true | 848 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/npv_functionsss.R
\name{npv.z}
\alias{npv.z}
\title{A NPV function}
\usage{
npv.z(i, cf, freq = 1, apr = FALSE, now = NULL, drop.bef.now = TRUE,
adjdisc = NULL)
}
\arguments{
\item{i}{is the interest rate}
\item{cf}{is the cash flow, a zoo... |
library(dendextend)
### Name: get_leaves_branches_col
### Title: Get the colors of the branches of a dendrogram's leaves
### Aliases: get_leaves_branches_col
### ** Examples
# define dendrogram object to play with:
hc <- hclust(dist(USArrests[1:5,]), "ave")
dend <- as.dendrogram(hc)
par(mfrow = c(1,2), mar = c(5,2... | /data/genthat_extracted_code/dendextend/examples/get_leaves_branches_col.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 555 | r | library(dendextend)
### Name: get_leaves_branches_col
### Title: Get the colors of the branches of a dendrogram's leaves
### Aliases: get_leaves_branches_col
### ** Examples
# define dendrogram object to play with:
hc <- hclust(dist(USArrests[1:5,]), "ave")
dend <- as.dendrogram(hc)
par(mfrow = c(1,2), mar = c(5,2... |
#' Calculate the sparseness of a vector.
#'
#' Sparseness can be calculated as lifetime kurtosis (LTK, Willmore and Tolhurst, 2001) or as lifetime sparseness (LTS, Bhandawat et al., 2007).
#'
#'
#' @param x numerical input vector
#' @param method type of sparseness measure, either 'ltk' for lifetime kurtosis or 'lts... | /R/sparse.R | no_license | wolfhuette/DoOR.functions | R | false | false | 1,489 | r | #' Calculate the sparseness of a vector.
#'
#' Sparseness can be calculated as lifetime kurtosis (LTK, Willmore and Tolhurst, 2001) or as lifetime sparseness (LTS, Bhandawat et al., 2007).
#'
#'
#' @param x numerical input vector
#' @param method type of sparseness measure, either 'ltk' for lifetime kurtosis or 'lts... |
#' Return information about a package
#'
#' @param package name of package, as character vector
#' @param base_path root directory in which to create documentation. The
#' default, \code{NULL}, first looks at the value of \code{site_path} set in
#' \file{DESCRIPTION}, and if not found uses \code{inst/web}.
#' @para... | /R/package.r | no_license | RyanHope/staticdocs | R | false | false | 2,721 | r | #' Return information about a package
#'
#' @param package name of package, as character vector
#' @param base_path root directory in which to create documentation. The
#' default, \code{NULL}, first looks at the value of \code{site_path} set in
#' \file{DESCRIPTION}, and if not found uses \code{inst/web}.
#' @para... |
setwd('C:/Users/Stephen/datascience/repdata/RepData_PeerAssessment1/')
library("knitr")
knit2html("PA1_template.Rmd")
| /process_file.R | no_license | colod/RepData_PeerAssessment1 | R | false | false | 118 | r | setwd('C:/Users/Stephen/datascience/repdata/RepData_PeerAssessment1/')
library("knitr")
knit2html("PA1_template.Rmd")
|
##############################################################################################
##############################################################################################
##### CREATED 1/28/2018 #####
#install.packages("lqa")
###predictors correlation of 0.2
rm(list=ls())
library("lqa") # version 1.0... | /simulation/case2/sampleSize1000/trueConf_moderate_start_1.R | no_license | TingtingKayla/Stats_Robust_Causal_Estimation | R | false | false | 8,685 | r | ##############################################################################################
##############################################################################################
##### CREATED 1/28/2018 #####
#install.packages("lqa")
###predictors correlation of 0.2
rm(list=ls())
library("lqa") # version 1.0... |
##SPELL CHECKER BASED ON http://www.sumsar.net/blog/2014/12/peter-norvigs-spell-checker-in-two-lines-of-r/
splchk <- function(word, sorted_words) {
if(!grepl("[[:digit:]]",word) & nchar(word) > 3){
# Calculate the edit distance between the word and all other words in sorted_words.
edit_dist <- adist(w... | /R/splchk.R | no_license | gmculp/rNYCclean | R | false | false | 1,074 | r | ##SPELL CHECKER BASED ON http://www.sumsar.net/blog/2014/12/peter-norvigs-spell-checker-in-two-lines-of-r/
splchk <- function(word, sorted_words) {
if(!grepl("[[:digit:]]",word) & nchar(word) > 3){
# Calculate the edit distance between the word and all other words in sorted_words.
edit_dist <- adist(w... |
#' Simulation Method 2 (Structured movement)
#'
#' # Time-varying categorical covariate representing a value that has a 25% chance to change to a "safer" region, but only when there is an event.
#' @param N Total number of people
#' @param Time Total length of simulation in days
#' @param b Covariate values for simulat... | /R/simCat2.R | no_license | daniellemccool/REMThesis | R | false | false | 1,641 | r | #' Simulation Method 2 (Structured movement)
#'
#' # Time-varying categorical covariate representing a value that has a 25% chance to change to a "safer" region, but only when there is an event.
#' @param N Total number of people
#' @param Time Total length of simulation in days
#' @param b Covariate values for simulat... |
library(SiZer)
library(RMySQL)
getall <- function()
{
# DB stuff; query IDmap table to map ids to names for GUI
con <- dbConnect(MySQL(), user='pouria', password='mojabi', host="localhost", dbname="AlgoPhen")
qur <- ('select * Reza_all')
res <- dbGetQuery(con, qur)
dbDisconnect(con)
return(res)
}
hd... | /2012_py_R_java_BaseHealth/ModNonMod_R/ModNmod/risk_rules.R | no_license | celinesf/personal | R | false | false | 907 | r | library(SiZer)
library(RMySQL)
getall <- function()
{
# DB stuff; query IDmap table to map ids to names for GUI
con <- dbConnect(MySQL(), user='pouria', password='mojabi', host="localhost", dbname="AlgoPhen")
qur <- ('select * Reza_all')
res <- dbGetQuery(con, qur)
dbDisconnect(con)
return(res)
}
hd... |
#This is Al Pivonka's Orignial work. The plot#.R files are cleaned versions of the code base below.
library(R.cache)
genPlots<-function(){
plot1()
plot2()
plot3()
plot4()
}
getData<-function(){
theKey=list("dataset")
theData <-loadCache(theKey)
if(!is.null(theData)){
print("got ... | /ClassProject1.R | no_license | alpivonka/ExData_Plotting1 | R | false | false | 4,803 | r |
#This is Al Pivonka's Orignial work. The plot#.R files are cleaned versions of the code base below.
library(R.cache)
genPlots<-function(){
plot1()
plot2()
plot3()
plot4()
}
getData<-function(){
theKey=list("dataset")
theData <-loadCache(theKey)
if(!is.null(theData)){
print("got ... |
% Generated by roxygen2 (4.0.1): do not edit by hand
\name{stripe_retrieve_coupon}
\alias{stripe_retrieve_coupon}
\title{Retrieve a coupon.}
\usage{
stripe_retrieve_coupon(api_key, coupon_id)
}
\arguments{
\item{api_key}{Your Stripe API Key}
\item{coupon_id}{The coupon you want to retrieve.}
}
\value{
A data frame wit... | /man/stripe_retrieve_coupon.Rd | no_license | isabella232/RStripe | R | false | false | 405 | rd | % Generated by roxygen2 (4.0.1): do not edit by hand
\name{stripe_retrieve_coupon}
\alias{stripe_retrieve_coupon}
\title{Retrieve a coupon.}
\usage{
stripe_retrieve_coupon(api_key, coupon_id)
}
\arguments{
\item{api_key}{Your Stripe API Key}
\item{coupon_id}{The coupon you want to retrieve.}
}
\value{
A data frame wit... |
## File Name: tam_pv_mcmc_inits_MH_sampling_objects.R
## File Version: 0.06
tam_pv_mcmc_inits_MH_sampling_objects <- function( adj_MH, nstud)
{
if ( length(adj_MH)==1){
adj_MH <- rep( adj_MH, nstud)
}
theta_acceptance_MH <- as.data.frame( matrix( 0, nrow=nstud, ncol=4) )
colnames(theta_acceptan... | /R/tam_pv_mcmc_inits_MH_sampling_objects.R | no_license | alexanderrobitzsch/TAM | R | false | false | 568 | r | ## File Name: tam_pv_mcmc_inits_MH_sampling_objects.R
## File Version: 0.06
tam_pv_mcmc_inits_MH_sampling_objects <- function( adj_MH, nstud)
{
if ( length(adj_MH)==1){
adj_MH <- rep( adj_MH, nstud)
}
theta_acceptance_MH <- as.data.frame( matrix( 0, nrow=nstud, ncol=4) )
colnames(theta_acceptan... |
# R1
install.packages("data.table")
install.packages("datasets")
prof <- women #Copying the data frame women into another dataset so that the original fields are not afected
View(prof)
id <- 0
for(i in 1:nrow(prof))
{
if
(prof$height[i]>65.0 & prof$weight[i]<136.7)
{
id<- id+1
}
}
print("Number of women sa... | /class exercise 1.r | no_license | viveknair1402/Class-Exercise | R | false | false | 395 | r | # R1
install.packages("data.table")
install.packages("datasets")
prof <- women #Copying the data frame women into another dataset so that the original fields are not afected
View(prof)
id <- 0
for(i in 1:nrow(prof))
{
if
(prof$height[i]>65.0 & prof$weight[i]<136.7)
{
id<- id+1
}
}
print("Number of women sa... |
library(gsw)
### Name: gsw_Fdelta
### Title: Ratio of Absolute to Preformed Salinity, minus 1
### Aliases: gsw_Fdelta
### ** Examples
p <- c( 10, 50, 125, 250, 600, 1000)
latitude <- c( 4, 4, 4, 4, 4, 4)
longitude <- c(188, 188, 188, 188, 188, 188)
r <- gsw_Fdelta(p, longitude, la... | /data/genthat_extracted_code/gsw/examples/gsw_Fdelta.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 490 | r | library(gsw)
### Name: gsw_Fdelta
### Title: Ratio of Absolute to Preformed Salinity, minus 1
### Aliases: gsw_Fdelta
### ** Examples
p <- c( 10, 50, 125, 250, 600, 1000)
latitude <- c( 4, 4, 4, 4, 4, 4)
longitude <- c(188, 188, 188, 188, 188, 188)
r <- gsw_Fdelta(p, longitude, la... |
#' @title Output module: PredictNewAreaMap
#'
#' @description Output module. Predict a model across a new area.
#'
#' @param .model \strong{Internal parameter, do not use in the workflow function}. \code{.model} is list of a data frame (\code{data}) and a model object (\code{model}). \code{.model} is passed automatical... | /R/PredictNewAreaMap.R | no_license | cvisintin/modules | R | false | false | 1,621 | r | #' @title Output module: PredictNewAreaMap
#'
#' @description Output module. Predict a model across a new area.
#'
#' @param .model \strong{Internal parameter, do not use in the workflow function}. \code{.model} is list of a data frame (\code{data}) and a model object (\code{model}). \code{.model} is passed automatical... |
#################################
##### import_pulsar #####
##### By: Marloes Eeftens #####
##### Last edit: 18/12/2017 #####
#################################
#Function import_pulsar:
import_pulsar=function(filename,timeformat,prefix){
#0) Set defaults & parameters:
#Set the time format, or use default... | /R/import_pulsar.R | no_license | MarloesEeftens/NOISEtools | R | false | false | 1,742 | r | #################################
##### import_pulsar #####
##### By: Marloes Eeftens #####
##### Last edit: 18/12/2017 #####
#################################
#Function import_pulsar:
import_pulsar=function(filename,timeformat,prefix){
#0) Set defaults & parameters:
#Set the time format, or use default... |
my.name <- readline(prompt="Enter name: ")
my.age <- readline(prompt="Enter age: ")
# convert character into integer
my.age <- as.integer(my.age)
print(paste("Hi,", my.name, "next year you will be", my.age+1, "years old."))
| /simpleR.r | no_license | Twafsimon/first_pyhon- | R | false | false | 224 | r | my.name <- readline(prompt="Enter name: ")
my.age <- readline(prompt="Enter age: ")
# convert character into integer
my.age <- as.integer(my.age)
print(paste("Hi,", my.name, "next year you will be", my.age+1, "years old."))
|
compute <- function(coins, n) {
combinations <- c(1, rep(0, n))
for (i in seq_along(coins)) {
for (j in (coins[i] + 1):(n + 1)) combinations[j] <- combinations[j] + combinations[j - coins[i]]
}
return(tail(combinations, 1))
}
| /problems/0031/compute.R | permissive | Dynortice/Project-Euler | R | false | false | 250 | r | compute <- function(coins, n) {
combinations <- c(1, rep(0, n))
for (i in seq_along(coins)) {
for (j in (coins[i] + 1):(n + 1)) combinations[j] <- combinations[j] + combinations[j - coins[i]]
}
return(tail(combinations, 1))
}
|
#from url https://satijalab.org/seurat/v3.0/immune_alignment.html
library(tidyverse)
library(Seurat)
library(Matrix)
library(RaceID)
library(cowplot)
date <- Sys.Date()
#load human data
load('/home/roman/Documents/Single cell analysis/20180911-Healthy-microglia-for-resub/RaceID-Cl-14-fused/20181128-H... | /bin/immune-integration.R | permissive | rsankowski/jakel-et-al-raceid | R | false | false | 7,528 | r | #from url https://satijalab.org/seurat/v3.0/immune_alignment.html
library(tidyverse)
library(Seurat)
library(Matrix)
library(RaceID)
library(cowplot)
date <- Sys.Date()
#load human data
load('/home/roman/Documents/Single cell analysis/20180911-Healthy-microglia-for-resub/RaceID-Cl-14-fused/20181128-H... |
library(actuar)
### Name: quantile.grouped.data
### Title: Quantiles of Grouped Data
### Aliases: quantile.grouped.data
### Keywords: univar
### ** Examples
data(gdental)
quantile(gdental)
Fn <- ogive(gdental)
Fn(quantile(gdental)) # inverse function
| /data/genthat_extracted_code/actuar/examples/quantile.grouped.data.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 259 | r | library(actuar)
### Name: quantile.grouped.data
### Title: Quantiles of Grouped Data
### Aliases: quantile.grouped.data
### Keywords: univar
### ** Examples
data(gdental)
quantile(gdental)
Fn <- ogive(gdental)
Fn(quantile(gdental)) # inverse function
|
library(factoextra)
uni.scaled<-scale(Universities[,-1]) #scaling the data
d<-dist(uni.scaled, method = 'euclidean');d #determining distance
d.gram<- hclust(d,method = "centroid") #doing hierarchy clustering
fviz_dend(d.gram,k=3,k_colors = 1,cex = 0.5,ylab = 'distance')+
labs(subtitle = "Dendrgram") #d... | /data mining_clustering dendrogram.R | no_license | Siddharthyerunkar/DS_Datamining_clustering-dendrogram | R | false | false | 510 | r |
library(factoextra)
uni.scaled<-scale(Universities[,-1]) #scaling the data
d<-dist(uni.scaled, method = 'euclidean');d #determining distance
d.gram<- hclust(d,method = "centroid") #doing hierarchy clustering
fviz_dend(d.gram,k=3,k_colors = 1,cex = 0.5,ylab = 'distance')+
labs(subtitle = "Dendrgram") #d... |
# Author: Yen-Chi Chen, Christopher R. Genovese, Larry Wasserman
# Maintainer: Yen-Chi Chen <yenchic@andrew.cmu.edu>
# Reference: Chen, Yen-Chi, Christopher R. Genovese, Ryan J. Tibshirani, and Larry Wasserman. "Nonparametric Modal Regression." arXiv preprint arXiv:1412.1716 (2014).
# Date: 04/07/2015
library(Rcpp)
lib... | /util/mdr/mdr.R | no_license | QSChou/Rlearning | R | false | false | 7,514 | r | # Author: Yen-Chi Chen, Christopher R. Genovese, Larry Wasserman
# Maintainer: Yen-Chi Chen <yenchic@andrew.cmu.edu>
# Reference: Chen, Yen-Chi, Christopher R. Genovese, Ryan J. Tibshirani, and Larry Wasserman. "Nonparametric Modal Regression." arXiv preprint arXiv:1412.1716 (2014).
# Date: 04/07/2015
library(Rcpp)
lib... |
## These functions calculate the inverse of the special "matrix" which is created first by the makeCacheMatrix function. It then checks to see if the inverse has already been calculated, if so it gets the inverse from the cache and skips the compulation. If not it calculates the inverse of the matric and sets the valu... | /cachematrix.R | no_license | vhetz/ProgrammingAssignment2 | R | false | false | 1,125 | r |
## These functions calculate the inverse of the special "matrix" which is created first by the makeCacheMatrix function. It then checks to see if the inverse has already been calculated, if so it gets the inverse from the cache and skips the compulation. If not it calculates the inverse of the matric and sets the valu... |
## makeCacheMatrix and cacheSolve prevent a matrix inverse from being recalculated if it has already been determined.
## We assume the matrix is invertible.
## makeCacheMatrix - a function that takes an invertible matrix x and initialises the inverse variable n to NULL.
## Local functions get, set, getinv and setinv... | /cachematrix.R | no_license | CaraSmith/ProgrammingAssignment2 | R | false | false | 1,710 | r | ## makeCacheMatrix and cacheSolve prevent a matrix inverse from being recalculated if it has already been determined.
## We assume the matrix is invertible.
## makeCacheMatrix - a function that takes an invertible matrix x and initialises the inverse variable n to NULL.
## Local functions get, set, getinv and setinv... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.