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 |
|---|---|---|---|---|---|---|---|---|---|
# Read Key Stats Information from Marketwatch
KeyStatsDataframe <- function(ticker){
url_stats <- paste0("https://www.marketwatch.com/investing/stock/", ticker)
key_stats_elements <- url_stats %>%
read_html() %>%
html_nodes(xpath='//ul[@class="list list--kv list--col50"]')
# key_stats_elements
... | /key-stats-valuation.R | no_license | heclon/capm | R | false | false | 4,114 | r | # Read Key Stats Information from Marketwatch
KeyStatsDataframe <- function(ticker){
url_stats <- paste0("https://www.marketwatch.com/investing/stock/", ticker)
key_stats_elements <- url_stats %>%
read_html() %>%
html_nodes(xpath='//ul[@class="list list--kv list--col50"]')
# key_stats_elements
... |
library(testthat)
context("Nonsyntactic names")
test_that("Nonsyntactic variable names are accepted", {
library(ggplot2)
mpg2 <- within(mpg, `car class` <- class)
gg <- ggplot(mpg2, aes(hwy, cty, colour=`car class`)) +
geom_point()
p <- directlabels::direct.label(gg)
expect_is(p, "ggplot")
})
| /tests/testthat/test_nonsyntactic.R | no_license | tdhock/directlabels | R | false | false | 308 | r | library(testthat)
context("Nonsyntactic names")
test_that("Nonsyntactic variable names are accepted", {
library(ggplot2)
mpg2 <- within(mpg, `car class` <- class)
gg <- ggplot(mpg2, aes(hwy, cty, colour=`car class`)) +
geom_point()
p <- directlabels::direct.label(gg)
expect_is(p, "ggplot")
})
|
library(shiny)
library(ggplot2)
#Server
function(input, output) {
dataset <- reactive({
diamonds[sample(nrow(diamonds), input$sampleSize),]
})
output$plot <- renderPlot({
p <- ggplot(dataset(), aes_string(x=input$x, y=input$y)) + geom_point()
if (input$color != 'None')
p <- p ... | /shiny_test/server.R | no_license | MadPacUte/myrepo | R | false | false | 628 | r | library(shiny)
library(ggplot2)
#Server
function(input, output) {
dataset <- reactive({
diamonds[sample(nrow(diamonds), input$sampleSize),]
})
output$plot <- renderPlot({
p <- ggplot(dataset(), aes_string(x=input$x, y=input$y)) + geom_point()
if (input$color != 'None')
p <- p ... |
#' Estimate the Size Factors
#'
#' @param Y any matrix-like object (\code{base::matrix()}, \code{DelayedArray}, \code{HDF5Matrix},
#' \code{Matrix::Matrix()}, etc.)
#' @param method one of \code{c("normed_sum", "deconvolution", "poscounts")}
#'
#'
#' @return a vector with one size factor per column of `Y`
#'
#' @... | /R/estimate_size_factors.R | no_license | lzygenomics/glmGamPoi | R | false | false | 4,307 | r |
#' Estimate the Size Factors
#'
#' @param Y any matrix-like object (\code{base::matrix()}, \code{DelayedArray}, \code{HDF5Matrix},
#' \code{Matrix::Matrix()}, etc.)
#' @param method one of \code{c("normed_sum", "deconvolution", "poscounts")}
#'
#'
#' @return a vector with one size factor per column of `Y`
#'
#' @... |
# Code assumes that the data is extracted on the working folder and therefore first has to obtain all necessary data
# This is important to know in understanding first part of the code
#Create and place all necessary files in the directory GCD
baseDir<-getwd()
dir.create("GCD")
dataDir<-paste(getwd(),"GCD",sep="/")
... | /run_analysis.R | no_license | YT-10/GCD | R | false | false | 2,680 | r | # Code assumes that the data is extracted on the working folder and therefore first has to obtain all necessary data
# This is important to know in understanding first part of the code
#Create and place all necessary files in the directory GCD
baseDir<-getwd()
dir.create("GCD")
dataDir<-paste(getwd(),"GCD",sep="/")
... |
addSymbol=as.symbol('+')
multSymbol=as.symbol('*')
subtSymbol=as.symbol('-')
symPolyMult=function(e1, e2)
{
d1=length(e1); # l1=sapply(e1, length)
d2=length(e2); # l2=sapply(e2, length)
ans=rep(expression(0), d1+d2-1L)
for(i1 in seq(d1)-1L){
j1=i1+1L
for(i2 in seq(d2)-1L){
j2=i2+1L
j=i1+i2+1L
toAdd=a... | /R/SymbolicPolynomialAlgebra.R | no_license | gitlongor/bigPolyRat | R | false | false | 3,326 | r | addSymbol=as.symbol('+')
multSymbol=as.symbol('*')
subtSymbol=as.symbol('-')
symPolyMult=function(e1, e2)
{
d1=length(e1); # l1=sapply(e1, length)
d2=length(e2); # l2=sapply(e2, length)
ans=rep(expression(0), d1+d2-1L)
for(i1 in seq(d1)-1L){
j1=i1+1L
for(i2 in seq(d2)-1L){
j2=i2+1L
j=i1+i2+1L
toAdd=a... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{sort_matrix}
\alias{sort_matrix}
\title{Sort matrix}
\usage{
sort_matrix(m, margin = 1L, order = NULL, na.last = TRUE, index.return = FALSE)
}
\arguments{
\item{m}{a matrix, usually an integer matrix}
\item{margin}{margin to so... | /man/sort_matrix.Rd | no_license | raredd/rawr | R | false | true | 1,449 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{sort_matrix}
\alias{sort_matrix}
\title{Sort matrix}
\usage{
sort_matrix(m, margin = 1L, order = NULL, na.last = TRUE, index.return = FALSE)
}
\arguments{
\item{m}{a matrix, usually an integer matrix}
\item{margin}{margin to so... |
seed <- 513
log.wt <- -15.762085088736278
penalty <- 2.8115950178536287e-8
intervals.send <- c()
intervals.recv <- c(56, 112, 225, 450, 900, 1800, 3600, 7200, 14400, 28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600, 29491200, 58982400)
dev.null <- 358759.0022669336
df.null <- 35567
dev.... | /analysis/boot/boot513.R | no_license | patperry/interaction-proc | R | false | false | 3,762 | r | seed <- 513
log.wt <- -15.762085088736278
penalty <- 2.8115950178536287e-8
intervals.send <- c()
intervals.recv <- c(56, 112, 225, 450, 900, 1800, 3600, 7200, 14400, 28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600, 29491200, 58982400)
dev.null <- 358759.0022669336
df.null <- 35567
dev.... |
library(tidyverse)
library(lme4)
library(plm)
##Read in the data from pulling it from the pyton script
full_2014_data <- read_csv("full_2014_data.csv") %>% select(-X1) %>% mutate(file_year = 2014) %>% mutate(avg_down_spd = coalesce(avg_down_spd, 0))
full_2015_data <- read_csv("full_2015_data.csv")%>% select(-X1) %>% m... | /DataModelingScript.R | no_license | fccdsicapstone/team-2-data-etl-viz | R | false | false | 13,967 | r | library(tidyverse)
library(lme4)
library(plm)
##Read in the data from pulling it from the pyton script
full_2014_data <- read_csv("full_2014_data.csv") %>% select(-X1) %>% mutate(file_year = 2014) %>% mutate(avg_down_spd = coalesce(avg_down_spd, 0))
full_2015_data <- read_csv("full_2015_data.csv")%>% select(-X1) %>% m... |
## Put comments here that give an overall description of what your
## functions do
## Write a short comment describing this function
## the function below creates a closure around the
## passed matrix so that it can be Cached
makeCacheMatrix <- function(x = matrix()) {
Inv <- NULL
set <- function(y) {
x <<-... | /cachematrix.R | no_license | PriyankPathakWebDev/ProgrammingAssignment2 | R | false | false | 1,013 | r | ## Put comments here that give an overall description of what your
## functions do
## Write a short comment describing this function
## the function below creates a closure around the
## passed matrix so that it can be Cached
makeCacheMatrix <- function(x = matrix()) {
Inv <- NULL
set <- function(y) {
x <<-... |
########################################
## ##
## 1. Install programs needed ##
## ##
########################################
install.packages('Seurat')
# There version of Seurat used here is 3.1.4
library(Seurat)
# Needs pyt... | /LiverDeconv_scFigures.R | no_license | atomadam2/Liver_Deconvolution | R | false | false | 34,171 | r |
########################################
## ##
## 1. Install programs needed ##
## ##
########################################
install.packages('Seurat')
# There version of Seurat used here is 3.1.4
library(Seurat)
# Needs pyt... |
##########################################################
#### Installing required Package
##########################################################
################## Install Basic Package required -- from edx
if(!require(tidyverse)) install.packages("tidyverse", repos = "http://cran.us.r-project.org")
if(!r... | /movielens_code.R | no_license | moh41/movielens_project | R | false | false | 30,484 | r | ##########################################################
#### Installing required Package
##########################################################
################## Install Basic Package required -- from edx
if(!require(tidyverse)) install.packages("tidyverse", repos = "http://cran.us.r-project.org")
if(!r... |
modelFAMT <-
function(data,x=1,test=x[1],nbf=NULL,maxnbfactors=8,min.err=1e-03) {
if (class(data)[1]!="FAMTdata") stop("Class of data should be FAMTdata")
if (!is.null(nbf)) optimnbfactors = nbf
if (is.null(nbf)) optimnbfactors = nbfactors(data,x,test,pvalues=NULL,maxnbfactors,min.err)$optimalnbfactors
pval = raw.... | /R/modelFAMT.R | no_license | cran/FAMT | R | false | false | 1,225 | r | modelFAMT <-
function(data,x=1,test=x[1],nbf=NULL,maxnbfactors=8,min.err=1e-03) {
if (class(data)[1]!="FAMTdata") stop("Class of data should be FAMTdata")
if (!is.null(nbf)) optimnbfactors = nbf
if (is.null(nbf)) optimnbfactors = nbfactors(data,x,test,pvalues=NULL,maxnbfactors,min.err)$optimalnbfactors
pval = raw.... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/add_kwic.R
\name{add_kwic}
\alias{add_kwic}
\title{add_kwic Function}
\usage{
add_kwic(corpus)
}
\arguments{
\item{corpus}{A data frame that contains a column for tokens}
}
\description{
This function creates columns 'word' for originally pun... | /man/add_kwic.Rd | permissive | langdoc/FRelan | R | false | true | 476 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/add_kwic.R
\name{add_kwic}
\alias{add_kwic}
\title{add_kwic Function}
\usage{
add_kwic(corpus)
}
\arguments{
\item{corpus}{A data frame that contains a column for tokens}
}
\description{
This function creates columns 'word' for originally pun... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/function_checks.R
\name{argcheck_lmin}
\alias{argcheck_lmin}
\title{Check for argument 'lmin'}
\usage{
argcheck_lmin(lmin, is_segclust)
}
\arguments{
\item{lmin}{minimum length of segments.}
\item{is_segclust}{TRUE if function is called from... | /man/argcheck_lmin.Rd | no_license | rpatin/segclust2d | R | false | true | 540 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/function_checks.R
\name{argcheck_lmin}
\alias{argcheck_lmin}
\title{Check for argument 'lmin'}
\usage{
argcheck_lmin(lmin, is_segclust)
}
\arguments{
\item{lmin}{minimum length of segments.}
\item{is_segclust}{TRUE if function is called from... |
library(skda)
### Name: skda
### Title: Sparse (Multicategory) Kernel Discriminant Analysis for variable
### selection in nonparametric classification
### Aliases: skda
### Keywords: file
### ** Examples
# a binary example
rm(list=ls())
n=200
p=20
r=0.8
... | /data/genthat_extracted_code/skda/examples/skda.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 1,323 | r | library(skda)
### Name: skda
### Title: Sparse (Multicategory) Kernel Discriminant Analysis for variable
### selection in nonparametric classification
### Aliases: skda
### Keywords: file
### ** Examples
# a binary example
rm(list=ls())
n=200
p=20
r=0.8
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/clockAddin.R
\name{clockAddin}
\alias{clockAddin}
\title{Title}
\usage{
clockAddin()
}
\value{
返回值
}
\description{
Title
}
\examples{
clockAddin
}
| /man/clockAddin.Rd | no_license | takewiki/tstk | R | false | true | 231 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/clockAddin.R
\name{clockAddin}
\alias{clockAddin}
\title{Title}
\usage{
clockAddin()
}
\value{
返回值
}
\description{
Title
}
\examples{
clockAddin
}
|
plot(mpg ~ hp, data = mtcars, col = am + 1, pch = am + 1, cex = 2)
legend("topright", c("Automatic", "Manual"), col = c(1, 2), pch = c(1, 2))
mpg_hp_slr = lm(mpg ~ hp, data = mtcars)
plot(mpg ~ hp, data = mtcars, col = am + 1, pch = am + 1, cex = 2)
abline(mpg_hp_slr, lwd = 3, col = "grey")
legend("topright", c("Auto... | /week 7/Intro Week 7.R | no_license | memasanz/stats420 | R | false | false | 1,126 | r | plot(mpg ~ hp, data = mtcars, col = am + 1, pch = am + 1, cex = 2)
legend("topright", c("Automatic", "Manual"), col = c(1, 2), pch = c(1, 2))
mpg_hp_slr = lm(mpg ~ hp, data = mtcars)
plot(mpg ~ hp, data = mtcars, col = am + 1, pch = am + 1, cex = 2)
abline(mpg_hp_slr, lwd = 3, col = "grey")
legend("topright", c("Auto... |
\name{Lab4-package}
\alias{Lab4-package}
\alias{Lab4}
\docType{package}
\title{
\packageTitle{Lab4}
}
\description{
\packageDescription{Lab4}
}
\details{
The DESCRIPTION file:
\packageDESCRIPTION{Lab4}
\packageIndices{Lab4}
}
\author{
\packageAuthor{Lab4}
Maintainer: \packageMaintainer{Lab4}
}
\keyword{ package }
| /man/Lab4-package.Rd | no_license | PedramKasebzadeh/Class-for-Linear-regression | R | false | false | 319 | rd | \name{Lab4-package}
\alias{Lab4-package}
\alias{Lab4}
\docType{package}
\title{
\packageTitle{Lab4}
}
\description{
\packageDescription{Lab4}
}
\details{
The DESCRIPTION file:
\packageDESCRIPTION{Lab4}
\packageIndices{Lab4}
}
\author{
\packageAuthor{Lab4}
Maintainer: \packageMaintainer{Lab4}
}
\keyword{ package }
|
rm(list=ls())
# heatmap.3 referring https://raw.githubusercontent.com/obigriffith/biostar-tutorials/master/Heatmaps/heatmap.3.R
library("devtools")
source_url("https://raw.githubusercontent.com/obigriffith/biostar-tutorials/master/Heatmaps/heatmap.3.R")
library(ggplot2)
library(reshape2)
setwd("/your/working/... | /Simulation/simulate_data.R | no_license | songfd2018/BUSseq-1.0_implementation | R | false | false | 15,627 | r | rm(list=ls())
# heatmap.3 referring https://raw.githubusercontent.com/obigriffith/biostar-tutorials/master/Heatmaps/heatmap.3.R
library("devtools")
source_url("https://raw.githubusercontent.com/obigriffith/biostar-tutorials/master/Heatmaps/heatmap.3.R")
library(ggplot2)
library(reshape2)
setwd("/your/working/... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/permutation-testing.R
\name{cluster_permute_test}
\alias{cluster_permute_test}
\title{Tests for independence between labels and covariates using permutation of cells}
\usage{
cluster_permute_test(
ccdb,
cell_covariate_keys,
cell_label_k... | /man/cluster_permute_test.Rd | no_license | zr0719/CellaRepertorium | R | false | true | 2,392 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/permutation-testing.R
\name{cluster_permute_test}
\alias{cluster_permute_test}
\title{Tests for independence between labels and covariates using permutation of cells}
\usage{
cluster_permute_test(
ccdb,
cell_covariate_keys,
cell_label_k... |
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/main.R
\name{get.prior.covar.nopcs}
\alias{get.prior.covar.nopcs}
\title{get.prior.covar.nopcs}
\usage{
get.prior.covar.nopcs(lambda.mat, Q, factor.mat, omega.table, bma = TRUE)
}
\description{
get.prior.covar.nopcs
}
| /man/get.prior.covar.nopcs.Rd | no_license | jhsiao999/matrix_ash | R | false | false | 305 | rd | % Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/main.R
\name{get.prior.covar.nopcs}
\alias{get.prior.covar.nopcs}
\title{get.prior.covar.nopcs}
\usage{
get.prior.covar.nopcs(lambda.mat, Q, factor.mat, omega.table, bma = TRUE)
}
\description{
get.prior.covar.nopcs
}
|
## name: plot_sub2_final_vs_baseline.r
## date: 02/22/2018
library(ggplot2)
library(reshape2)
library(plyr)
library(scales)
source("~/function/my_palette.r")
source("~/function/multiplot.R")
fold=5
## breast
path1="../sub2/prediction/breast/rna/"
path2="../sub2/prediction/breast/final/"
ymax=2
tmp=as.matrix(read.... | /analysis/plot_sub2_final_vs_baseline.r | no_license | GuanLab/CPTAC_sub2 | R | false | false | 3,042 | r |
## name: plot_sub2_final_vs_baseline.r
## date: 02/22/2018
library(ggplot2)
library(reshape2)
library(plyr)
library(scales)
source("~/function/my_palette.r")
source("~/function/multiplot.R")
fold=5
## breast
path1="../sub2/prediction/breast/rna/"
path2="../sub2/prediction/breast/final/"
ymax=2
tmp=as.matrix(read.... |
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 4.08374657985866e+149, 4.12396251261199e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(5L, 7L)))
result <- do.call(CNull:::communities_individual_... | /CNull/inst/testfiles/communities_individual_based_sampling_beta/AFL_communities_individual_based_sampling_beta/communities_individual_based_sampling_beta_valgrind_files/1615829476-test.R | no_license | akhikolla/updatedatatype-list2 | R | false | false | 361 | r | testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 4.08374657985866e+149, 4.12396251261199e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(5L, 7L)))
result <- do.call(CNull:::communities_individual_... |
#!/usr/bin/env Rscript
# be aware that CRAN rules and messages can change with R upgrade
# NOTE whitelist to be used by grepl, for each check step
whitelist = list(
"CRAN incoming feasibility" = c("Maintainer:",
"New maintainer:",
"Erin LeDell <eri... | /scripts/validate_r_cmd_check_output.R | permissive | Winfredemalx54/h2o-3 | R | false | false | 4,986 | r | #!/usr/bin/env Rscript
# be aware that CRAN rules and messages can change with R upgrade
# NOTE whitelist to be used by grepl, for each check step
whitelist = list(
"CRAN incoming feasibility" = c("Maintainer:",
"New maintainer:",
"Erin LeDell <eri... |
"mlcbbsel" <-
function (U, V)
{
model = c("CBB1", "CBB2", "CBB3", "CBB4", "CBB5", "CBB6",
"CBB7", "CBB8", "CBB9", "CBB10", "CMM1", "CMM2", "CMM3",
"CMM4", "CMM5", "CMM6", "CMM7", "CMM8", "CMM9", "CMM10",
"CBM1", "CBM2", "CBM3", "CBM4", "CBM5", "CBM6", "CBM7",
"CBM8", "CBM9", "CB... | /R/mlcbbsel.R | no_license | cran/mlCopulaSelection | R | false | false | 2,472 | r | "mlcbbsel" <-
function (U, V)
{
model = c("CBB1", "CBB2", "CBB3", "CBB4", "CBB5", "CBB6",
"CBB7", "CBB8", "CBB9", "CBB10", "CMM1", "CMM2", "CMM3",
"CMM4", "CMM5", "CMM6", "CMM7", "CMM8", "CMM9", "CMM10",
"CBM1", "CBM2", "CBM3", "CBM4", "CBM5", "CBM6", "CBM7",
"CBM8", "CBM9", "CB... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/foofactors-package.r
\docType{package}
\name{foofactors}
\alias{foofactors}
\alias{foofactors-package}
\title{foofactors: Make factors less annoying}
\description{
Factors have driven people to extreme measures, like ordering custom
conferenc... | /man/foofactors.Rd | no_license | eshinesimida/foofactors | R | false | true | 490 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/foofactors-package.r
\docType{package}
\name{foofactors}
\alias{foofactors}
\alias{foofactors-package}
\title{foofactors: Make factors less annoying}
\description{
Factors have driven people to extreme measures, like ordering custom
conferenc... |
library(testthat)
library(AhoCorasickTrie)
test_check("AhoCorasickTrie")
| /fuzzedpackages/AhoCorasickTrie/tests/testthat.R | no_license | akhikolla/testpackages | R | false | false | 78 | r | library(testthat)
library(AhoCorasickTrie)
test_check("AhoCorasickTrie")
|
#-- Merging Data Frames --#
stats$MyCalc <- NULL
head(stats)
head(mydf)
merged <- merge(stats, mydf, by.x = "Country.Code", by.y = "Code")
head(merged)
merged$Country <- NULL
str(merged)
tail(merged)
| /04 - Data Frames/35 - Merging Data Frames.R | no_license | panchalashish4/R-Programming-A-Z | R | false | false | 204 | r | #-- Merging Data Frames --#
stats$MyCalc <- NULL
head(stats)
head(mydf)
merged <- merge(stats, mydf, by.x = "Country.Code", by.y = "Code")
head(merged)
merged$Country <- NULL
str(merged)
tail(merged)
|
`PlotOnStaticMap` <-structure(function# overlays plot on background image of map tile
###This function is the workhorse of the package RgoogleMaps. It overlays plot on background image of map tile
(
MyMap, ##<< optional map object
lat, ##<< latitude values to be overlaid
lon, ##<< longitude values to be ove... | /R/PlotOnStaticMap.R | no_license | cran/RgoogleMaps | R | false | false | 6,362 | r | `PlotOnStaticMap` <-structure(function# overlays plot on background image of map tile
###This function is the workhorse of the package RgoogleMaps. It overlays plot on background image of map tile
(
MyMap, ##<< optional map object
lat, ##<< latitude values to be overlaid
lon, ##<< longitude values to be ove... |
# ケース:野菜をクラスタリングする
par(family="Hiragino Mincho Pro W6")
# データ読み込み
ysi <- read.csv("yasai_eiyou.csv", row.names = 1)
# 中身を確認
head(ysi)
# 階層クラスタ分析
# 距離をユークリッド距離で算出
D0 <- dist(ysi, method="euclidian")
D <- (1/2)*D0*2
# 確認
D
# クラスタリングする
ysi.out <- hclust(d=D, method="ward.D")
# デンドログラムを描画
plot(as.dendrogram(ysi.out), ... | /clusdter.R | no_license | yamathcy/lspc_toukei_5 | R | false | false | 1,222 | r | # ケース:野菜をクラスタリングする
par(family="Hiragino Mincho Pro W6")
# データ読み込み
ysi <- read.csv("yasai_eiyou.csv", row.names = 1)
# 中身を確認
head(ysi)
# 階層クラスタ分析
# 距離をユークリッド距離で算出
D0 <- dist(ysi, method="euclidian")
D <- (1/2)*D0*2
# 確認
D
# クラスタリングする
ysi.out <- hclust(d=D, method="ward.D")
# デンドログラムを描画
plot(as.dendrogram(ysi.out), ... |
/strategies/CCI_TEMPLATE.R | no_license | RadishLamb/automated-trading-program | R | false | false | 5,318 | r | ||
# Instruction
# 1. Create a folder with the name of the experiment;
# 2. In the experiment folder, create a folder named "zip" and put all participant zip files into the "zip" folder;
# 3. Run the entire script ("function_list_pre.R"), then run "function_list_1.R", followed by "function_list_2.R";
# 4. To create dendro... | /catanalysis.r | no_license | kevinsparksportfolio/buildingCatanalysisLibrary | R | false | false | 58,304 | r | # Instruction
# 1. Create a folder with the name of the experiment;
# 2. In the experiment folder, create a folder named "zip" and put all participant zip files into the "zip" folder;
# 3. Run the entire script ("function_list_pre.R"), then run "function_list_1.R", followed by "function_list_2.R";
# 4. To create dendro... |
############################# Analiza techniczna #####################################################
#duża część kodu to zmodyfikowany kod z referatu o Analizie Technicznej; w gruncie rzeczy #
#jego sens polegał na wyjaśnieniu zastosowań funkcyj zaimpelentowanych w R, #
#dlatego ni... | /Skrypt do sprawozdania 3.R | no_license | astat22/stock_analysis | R | false | false | 11,356 | r | ############################# Analiza techniczna #####################################################
#duża część kodu to zmodyfikowany kod z referatu o Analizie Technicznej; w gruncie rzeczy #
#jego sens polegał na wyjaśnieniu zastosowań funkcyj zaimpelentowanych w R, #
#dlatego ni... |
library(tibbrConnector)
### Name: tibbr.user
### Title: Search tibbr For Users
### Aliases: tibbr.user
### ** Examples
## Not run:
##D con <- tibbr.connect("try.tibbr.com", "myusername", "mypassword")
##D users <- tibbr.user(con, "Sam")
##D users
## End(Not run)
| /data/genthat_extracted_code/tibbrConnector/examples/tibbr.user.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 271 | r | library(tibbrConnector)
### Name: tibbr.user
### Title: Search tibbr For Users
### Aliases: tibbr.user
### ** Examples
## Not run:
##D con <- tibbr.connect("try.tibbr.com", "myusername", "mypassword")
##D users <- tibbr.user(con, "Sam")
##D users
## End(Not run)
|
#' @title Load CDM Non-Vocabulary Tables.
#'
#' @description This function loads the CDM Event tables with Synthea data.
#'
#' @usage LoadEventTables (connectionDetails, cdmSchema, syntheaSchema, cdmVersion, sqlOnly)
#'
#' @details This function assumes \cr\code{createCDMTables()}, \cr\code{createSyntheaTables()}, \cr\... | /R/LoadEventTables.r | permissive | mpreusse/ETL-Synthea | R | false | false | 7,477 | r | #' @title Load CDM Non-Vocabulary Tables.
#'
#' @description This function loads the CDM Event tables with Synthea data.
#'
#' @usage LoadEventTables (connectionDetails, cdmSchema, syntheaSchema, cdmVersion, sqlOnly)
#'
#' @details This function assumes \cr\code{createCDMTables()}, \cr\code{createSyntheaTables()}, \cr\... |
iris
y = c()
for (i in 1:150)
{x = sum(iris[i,1:4]/4)
y = c(x,y)}
y
| /Zadanie2.R | no_license | seregin-ivan126/matmod- | R | false | false | 77 | r | iris
y = c()
for (i in 1:150)
{x = sum(iris[i,1:4]/4)
y = c(x,y)}
y
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/prob_forecast.R
\name{pdf_subfunction}
\alias{pdf_subfunction}
\title{Get probability density for individual ensemble member
Includes continuous estimation of discrete component, starting at the threshold and extending to 1}
\usage{
pdf_subfu... | /man/pdf_subfunction.Rd | permissive | kdayday/forecasting | R | false | true | 808 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/prob_forecast.R
\name{pdf_subfunction}
\alias{pdf_subfunction}
\title{Get probability density for individual ensemble member
Includes continuous estimation of discrete component, starting at the threshold and extending to 1}
\usage{
pdf_subfu... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gsw.R
\name{gsw_SA_from_SP}
\alias{gsw_SA_from_SP}
\title{Convert from practical salinity to absolute salinity}
\usage{
gsw_SA_from_SP(SP, p, longitude, latitude)
}
\arguments{
\item{SP}{Practical Salinity (PSS-78) [ unitless ]}
\item{p}{sea... | /man/gsw_SA_from_SP.Rd | no_license | Abulos/GSW-R | R | false | true | 1,422 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gsw.R
\name{gsw_SA_from_SP}
\alias{gsw_SA_from_SP}
\title{Convert from practical salinity to absolute salinity}
\usage{
gsw_SA_from_SP(SP, p, longitude, latitude)
}
\arguments{
\item{SP}{Practical Salinity (PSS-78) [ unitless ]}
\item{p}{sea... |
pkgname <- "testpackage"
source(file.path(R.home("share"), "R", "examples-header.R"))
options(warn = 1)
base::assign(".ExTimings", "testpackage-Ex.timings", pos = 'CheckExEnv')
base::cat("name\tuser\tsystem\telapsed\n", file=base::get(".ExTimings", pos = 'CheckExEnv'))
base::assign(".format_ptime",
function(x) {
if(!... | /homework/FINAL_project/testpackage.Rcheck/testpackage-Ex.R | no_license | bgreen39/reproducible_data_analysis | R | false | false | 1,420 | r | pkgname <- "testpackage"
source(file.path(R.home("share"), "R", "examples-header.R"))
options(warn = 1)
base::assign(".ExTimings", "testpackage-Ex.timings", pos = 'CheckExEnv')
base::cat("name\tuser\tsystem\telapsed\n", file=base::get(".ExTimings", pos = 'CheckExEnv'))
base::assign(".format_ptime",
function(x) {
if(!... |
setwd("/home/jbde/Trainings/Phylogeny_BixCoP_2018/Practicals/ApesData/")
library(ape)
read.FASTA("mito_sequences.fasta") -> seqs
sub(" .*","",names(seqs)) -> accessions
# generating trees
trees = rmtree(N=100, n=7, rooted=F, tip.label = accessions, br = 0.1)
write.tree(phy = trees, file = "hundred_trees.nh")
# then ... | /generate_trees_ape.R | no_license | davekk/summary_r_scripts | R | false | false | 736 | r | setwd("/home/jbde/Trainings/Phylogeny_BixCoP_2018/Practicals/ApesData/")
library(ape)
read.FASTA("mito_sequences.fasta") -> seqs
sub(" .*","",names(seqs)) -> accessions
# generating trees
trees = rmtree(N=100, n=7, rooted=F, tip.label = accessions, br = 0.1)
write.tree(phy = trees, file = "hundred_trees.nh")
# then ... |
## Prepare plots and tables for report
## Before:
## After:
library(icesTAF)
mkdir("report")
# collate documents into a zip file
# make a zip of fatage csv files
fatage.files <- dir("output", full.names = TRUE, pattern = "*_fatage.csv")
zip(
file.path(
"report",
"fatage-csv.zip"
),
fatage.files,
ex... | /report_zip.R | no_license | ices-taf/2020_4029-29_SpecialRequest | R | false | false | 2,187 | r | ## Prepare plots and tables for report
## Before:
## After:
library(icesTAF)
mkdir("report")
# collate documents into a zip file
# make a zip of fatage csv files
fatage.files <- dir("output", full.names = TRUE, pattern = "*_fatage.csv")
zip(
file.path(
"report",
"fatage-csv.zip"
),
fatage.files,
ex... |
library(dplyr)
cran <- tbl_df(mydf)
rm("mydf")
## The main idea behind grouping data is that you want to break up your dataset into groups of rows based
## on the values of one or more variables. The group_by() function is reponsible for doing this.
by_package <- group_by(cran, package) ## Group cran by the package v... | /Get and Cleaning Data/2. Grouping and chaining with dplyr.R | no_license | gyz0807/Swirl-Learning | R | false | false | 2,217 | r | library(dplyr)
cran <- tbl_df(mydf)
rm("mydf")
## The main idea behind grouping data is that you want to break up your dataset into groups of rows based
## on the values of one or more variables. The group_by() function is reponsible for doing this.
by_package <- group_by(cran, package) ## Group cran by the package v... |
setwd("~/Box Sync/skinner/projects_analyses/SCEPTIC/compiled_sceptic_vba_datasets/")
library(readr)
library(lme4)
library(lmerTest)
library(ggplot2)
library(dplyr)
library(tidyr)
library(tibble)
library(corrplot)
library(ggpubr)
# meaning fMRI decay subject
fds <- read_csv("mmclock_fmri_decay_mfx_sceptic_global_statis... | /clock_task/vba_fmri/global_output_examination.R | no_license | DecisionNeurosciencePsychopathology/temporal_instrumental_agent | R | false | false | 3,168 | r | setwd("~/Box Sync/skinner/projects_analyses/SCEPTIC/compiled_sceptic_vba_datasets/")
library(readr)
library(lme4)
library(lmerTest)
library(ggplot2)
library(dplyr)
library(tidyr)
library(tibble)
library(corrplot)
library(ggpubr)
# meaning fMRI decay subject
fds <- read_csv("mmclock_fmri_decay_mfx_sceptic_global_statis... |
#{
## read in hydronetwork
#nhd_fyh <- readOGR(".","nhd_feathyuba")
#nhd_fyh_sf <- nhd_fyh %>% st_as_sf()
#latlonwgs84CRS <- st_crs(nhd_fyh_sf)
### read in cnrfc basin zones
#fyhz <- readOGR(".","feathyuba_zones")
#fyhz_sf <- fyhz %>% st_as_sf()
{
maptypes = c(#"Stamen.TonerLite",
#"Sta... | /agency_rt_mapview_usgshydrostart_june5a.r | no_license | dbo99/publicflowvis | R | false | false | 5,092 | r | #{
## read in hydronetwork
#nhd_fyh <- readOGR(".","nhd_feathyuba")
#nhd_fyh_sf <- nhd_fyh %>% st_as_sf()
#latlonwgs84CRS <- st_crs(nhd_fyh_sf)
### read in cnrfc basin zones
#fyhz <- readOGR(".","feathyuba_zones")
#fyhz_sf <- fyhz %>% st_as_sf()
{
maptypes = c(#"Stamen.TonerLite",
#"Sta... |
library(RNetLogo)
# PLEASE FILL IN THE PATH TO YOUR NetLogo INSTALLATION FOLDER !!!!
path.to.NetLogo <- "C:/Program Files/NetLogo 5.3/app"
# start NetLogo, if it is not started yet
if (!exists("nl.test1", -1))
{
# an reference name
nl.test1 <- "nl.test1"
NLStart(path.to.NetLogo, gui=TRUE, nl.obj=nl.t... | /RNetLogo/inst/examples/code_samples/3-NLCommand/NLCommand.R | no_license | ingted/R-Examples | R | false | false | 1,557 | r | library(RNetLogo)
# PLEASE FILL IN THE PATH TO YOUR NetLogo INSTALLATION FOLDER !!!!
path.to.NetLogo <- "C:/Program Files/NetLogo 5.3/app"
# start NetLogo, if it is not started yet
if (!exists("nl.test1", -1))
{
# an reference name
nl.test1 <- "nl.test1"
NLStart(path.to.NetLogo, gui=TRUE, nl.obj=nl.t... |
c DCNF-Autarky [version 0.0.1].
c Copyright (c) 2018-2019 Swansea University.
c
c Input Clause Count: 108838
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 105814
c
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 105814
c
c Input Parameter (command lin... | /code/dcnf-ankit-optimized/Results/QBFLIB-2018/E1/Experiments/Gent-Rowley/Connect2/cf_2_7x7_d_/cf_2_7x7_d_.R | no_license | arey0pushpa/dcnf-autarky | R | false | false | 22,990 | r | c DCNF-Autarky [version 0.0.1].
c Copyright (c) 2018-2019 Swansea University.
c
c Input Clause Count: 108838
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 105814
c
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 105814
c
c Input Parameter (command lin... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllGeneric.R, R/BrainSpace.R
\docType{methods}
\name{bounds}
\alias{bounds}
\alias{bounds,BrainData-method}
\alias{bounds,BrainSpace-method}
\title{Generic function to extract the spatial bounds (origin + dim * spacing) of an image
param x th... | /neuroim/man/bounds-methods.Rd | no_license | akhikolla/updatedatatype-list3 | R | false | true | 870 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllGeneric.R, R/BrainSpace.R
\docType{methods}
\name{bounds}
\alias{bounds}
\alias{bounds,BrainData-method}
\alias{bounds,BrainSpace-method}
\title{Generic function to extract the spatial bounds (origin + dim * spacing) of an image
param x th... |
settings_init <- function(
name = character(0),
format = "rds",
pattern = NULL,
iteration = "vector",
error = "stop",
memory = "persistent",
garbage_collection = FALSE,
deployment = "worker",
priority = 0,
resources = list(),
storage = "main",
retrieval = "main"
) {
pattern <- settings_produce... | /R/class_settings.R | permissive | billdenney/targets | R | false | false | 4,224 | r | settings_init <- function(
name = character(0),
format = "rds",
pattern = NULL,
iteration = "vector",
error = "stop",
memory = "persistent",
garbage_collection = FALSE,
deployment = "worker",
priority = 0,
resources = list(),
storage = "main",
retrieval = "main"
) {
pattern <- settings_produce... |
#' English league results 1888-2016
#'
#' All results for English soccer games in the top 4 tiers
#' from 1888/89 season to 2016/17 season. For playoff games
#' see separate dataset `englandplayoffs`
#'
#' @format A data frame with 194025 rows and 12 variables:
#' \describe{
#' \item{Date}{Date of match}
#' \item{... | /R/england.R | no_license | Astorgibus10/engsoccerdata | R | false | false | 880 | r | #' English league results 1888-2016
#'
#' All results for English soccer games in the top 4 tiers
#' from 1888/89 season to 2016/17 season. For playoff games
#' see separate dataset `englandplayoffs`
#'
#' @format A data frame with 194025 rows and 12 variables:
#' \describe{
#' \item{Date}{Date of match}
#' \item{... |
library(openxlsx)
library(dplyr)
library(stringi)
## DATA CRUNCH (Pre-processing) --------
# Tab.1. Data Crunh --------
current_trustee_subset <- c("TF072236","TF072584", "TF072129","TF071630")
current_trustee_subset <- active_trustee %>%
filter(Fund %in% c("TF072236","TF072584", "TF072129","TF071630")) %>%
se... | /reports/Sameh_Report_jaime_data.R | no_license | andresgf91/SARA-GFDRR | R | false | false | 38,941 | r | library(openxlsx)
library(dplyr)
library(stringi)
## DATA CRUNCH (Pre-processing) --------
# Tab.1. Data Crunh --------
current_trustee_subset <- c("TF072236","TF072584", "TF072129","TF071630")
current_trustee_subset <- active_trustee %>%
filter(Fund %in% c("TF072236","TF072584", "TF072129","TF071630")) %>%
se... |
# #librairies------
# library(data.table)
# library(dplyr)
# library(readr)
# library(ggplot2)
# library(tidyr)
# library(sf)
# library(fasterize)
# library(elevatr) #permet d'acceder aux bases de données MNH
# library(raster)
# library(gstat)
# library(rlist)
# library(tcltk)
# library(colorspace)
# lib... | /data-raw/fonctions_IFN.R | no_license | antoine25C/emergeIFNVol | R | false | false | 7,754 | r | # #librairies------
# library(data.table)
# library(dplyr)
# library(readr)
# library(ggplot2)
# library(tidyr)
# library(sf)
# library(fasterize)
# library(elevatr) #permet d'acceder aux bases de données MNH
# library(raster)
# library(gstat)
# library(rlist)
# library(tcltk)
# library(colorspace)
# lib... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/filter_cases.R
\name{filter_cases}
\alias{filter_cases}
\title{Filters cases from a MADS dataframe}
\usage{
filter_cases(data, ..., min.days.to.new.episode = 14)
}
\arguments{
\item{data}{a MADS dataframe}
\item{min.days.to.new.episode}{Mini... | /man/filter_cases.Rd | permissive | marcmtk/MadsR | R | false | true | 576 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/filter_cases.R
\name{filter_cases}
\alias{filter_cases}
\title{Filters cases from a MADS dataframe}
\usage{
filter_cases(data, ..., min.days.to.new.episode = 14)
}
\arguments{
\item{data}{a MADS dataframe}
\item{min.days.to.new.episode}{Mini... |
## Remove excess white spaces. Keep one space.
cleanWhite <- function(s) gsub('[[:blank:]]+', ' ', s)
## This is a base class for c++ variables.
## To avoid having many unused fields in many cases, this can handle only ptrs and refs.
## If you need static, const, template arguments, or other adornments, use cppFullVa... | /packages/nimble/R/cppDefs_variables.R | permissive | nimble-dev/nimble | R | false | false | 9,863 | r | ## Remove excess white spaces. Keep one space.
cleanWhite <- function(s) gsub('[[:blank:]]+', ' ', s)
## This is a base class for c++ variables.
## To avoid having many unused fields in many cases, this can handle only ptrs and refs.
## If you need static, const, template arguments, or other adornments, use cppFullVa... |
library(openintro)
#data(dds.discr)
data(COL)
myPDF("ddsAgeHist.pdf",
6.05, 3.1,
mar = c(3.5, 3.5, 0.5, 1),
mgp = c(2.4, 0.7, 0))
histPlot(dds.discr$age,
breaks = 10,
xlab = 'Age (years)',
ylab = "Frequency",
ylim = c(0, 450),
col = COL[1],
border... | /ch_intro_to_data_oi_biostat/figures/ddsAgeHist/ddsAgeHist.R | no_license | OI-Biostat/oi_biostat_text | R | false | false | 340 | r | library(openintro)
#data(dds.discr)
data(COL)
myPDF("ddsAgeHist.pdf",
6.05, 3.1,
mar = c(3.5, 3.5, 0.5, 1),
mgp = c(2.4, 0.7, 0))
histPlot(dds.discr$age,
breaks = 10,
xlab = 'Age (years)',
ylab = "Frequency",
ylim = c(0, 450),
col = COL[1],
border... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/deletion-utils.R
\name{germlineFilters}
\alias{germlineFilters}
\title{Identify focal, somatic hemizygous deletions and somatic homozygous
deletions}
\usage{
germlineFilters(preprocess, germline_filters, param = DeletionParam())
}
\arguments{... | /man/germlineFilters.Rd | no_license | cancer-genomics/trellis | R | false | true | 1,900 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/deletion-utils.R
\name{germlineFilters}
\alias{germlineFilters}
\title{Identify focal, somatic hemizygous deletions and somatic homozygous
deletions}
\usage{
germlineFilters(preprocess, germline_filters, param = DeletionParam())
}
\arguments{... |
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/get_dataset.R
\name{get_dataset.download}
\alias{get_dataset.download}
\title{Obtain dataset information from an existing \code{download} object.}
\usage{
\method{get_dataset}{download}(x, ...)
}
\arguments{
\item{x}{An object of clas... | /man/get_dataset.download.Rd | no_license | parthasen/neotoma | R | false | false | 499 | rd | % Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/get_dataset.R
\name{get_dataset.download}
\alias{get_dataset.download}
\title{Obtain dataset information from an existing \code{download} object.}
\usage{
\method{get_dataset}{download}(x, ...)
}
\arguments{
\item{x}{An object of clas... |
dashboardPage(title = "OECD",
skin = "blue",
dashboardHeader(title = "OECD", titleWidth=400),
dashboardSidebar(
includeCSS("custom.css"),
uiOutput("a"),
sidebarMenu(
id = "sbMenu",
menuItem(
"Migration",tabName= "migration"
),
# menuItem("In... | /ui.R | no_license | pssguy/OECD | R | false | false | 1,915 | r |
dashboardPage(title = "OECD",
skin = "blue",
dashboardHeader(title = "OECD", titleWidth=400),
dashboardSidebar(
includeCSS("custom.css"),
uiOutput("a"),
sidebarMenu(
id = "sbMenu",
menuItem(
"Migration",tabName= "migration"
),
# menuItem("In... |
# Load required libraries
local({
libs <- c('pander','xtable','ggplot2');
for (i in libs) {
if( !is.element(i, .packages(all.available=T))){
capture.output(install.packages(i));
}
suppressMessages(require(i,character.only=T));
}
});
## Load main file with data
if (!all(sapply(c('regda... | /creditcost_figures.R | permissive | javiertury/cfpr-paper | R | false | false | 5,785 | r | # Load required libraries
local({
libs <- c('pander','xtable','ggplot2');
for (i in libs) {
if( !is.element(i, .packages(all.available=T))){
capture.output(install.packages(i));
}
suppressMessages(require(i,character.only=T));
}
});
## Load main file with data
if (!all(sapply(c('regda... |
library(shiny)
# Define server logic required to generate and plot a random distribution
shinyServer(function(input, output) {
# Expression that generates a plot of the distribution. The expression
# is wrapped in a call to renderPlot to indicate that:
#
# 1) It is "reactive" and therefore should be autom... | /server.R | no_license | GabrielSartori/shiny_aws | R | false | false | 554 | r | library(shiny)
# Define server logic required to generate and plot a random distribution
shinyServer(function(input, output) {
# Expression that generates a plot of the distribution. The expression
# is wrapped in a call to renderPlot to indicate that:
#
# 1) It is "reactive" and therefore should be autom... |
#!/home/kmarchlewski/Programs/bin/Rscript
# source("km_optimization.R")
library(gaussAlgebra)
library(fields)
library(nloptr)
library(mco)
library(lhs)
library(rgl)
library(plotrix)
source("02_solvers_scripts/Hartman_6d_test_fun/hartmann_6d_solver.R")
source("01_kriging_model_optimization/km_optim_data.R")
source("0... | /km_optimization.R | no_license | kmarchlewski/gp-roptim | R | false | false | 1,807 | r | #!/home/kmarchlewski/Programs/bin/Rscript
# source("km_optimization.R")
library(gaussAlgebra)
library(fields)
library(nloptr)
library(mco)
library(lhs)
library(rgl)
library(plotrix)
source("02_solvers_scripts/Hartman_6d_test_fun/hartmann_6d_solver.R")
source("01_kriging_model_optimization/km_optim_data.R")
source("0... |
## This script looks for predictors of rapid change in BMI after correcting ethnicity
# M Samuel
# 16th Nov
## Load libraries
## Specify libraries
library(pacman)
library(tidyverse)
library(Hmisc)
library(here)
library(arrow)
library(purrr)
library(broom)
library(data.table)
library(forcats)
library(rstatix)
libr... | /analysis/ethnicity_check/eth_corrected_regression/rapid_change_counts_ethnicity_corrected.R | permissive | opensafely/BMI-and-Metabolic-Markers | R | false | false | 11,870 | r |
## This script looks for predictors of rapid change in BMI after correcting ethnicity
# M Samuel
# 16th Nov
## Load libraries
## Specify libraries
library(pacman)
library(tidyverse)
library(Hmisc)
library(here)
library(arrow)
library(purrr)
library(broom)
library(data.table)
library(forcats)
library(rstatix)
libr... |
library(pbdMPI)
### Name: sourcetag
### Title: Functions to Obtain source and tag
### Aliases: anysource anytag get.sourcetag
### Keywords: programming
### ** Examples
## Not run:
##D ### Save code in a file "demo.r" and run with 2 processors by
##D ### SHELL> mpiexec -np 2 Rscript demo.r
##D
##D spmd.code <- "
#... | /data/genthat_extracted_code/pbdMPI/examples/dd_sourcetag.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 1,049 | r | library(pbdMPI)
### Name: sourcetag
### Title: Functions to Obtain source and tag
### Aliases: anysource anytag get.sourcetag
### Keywords: programming
### ** Examples
## Not run:
##D ### Save code in a file "demo.r" and run with 2 processors by
##D ### SHELL> mpiexec -np 2 Rscript demo.r
##D
##D spmd.code <- "
#... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/download_dataset.R
\name{download_dataset}
\alias{download_dataset}
\title{Download a dataset as a zip archive and store at the specified path.}
\usage{
download_dataset(owner_id, dataset_id, output_path)
}
\arguments{
\item{owner_id}{User na... | /man/download_dataset.Rd | permissive | datadotworld/dwapi-r | R | false | true | 742 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/download_dataset.R
\name{download_dataset}
\alias{download_dataset}
\title{Download a dataset as a zip archive and store at the specified path.}
\usage{
download_dataset(owner_id, dataset_id, output_path)
}
\arguments{
\item{owner_id}{User na... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/LSD.clusterplot.R
\name{singleclusterplot}
\alias{singleclusterplot}
\alias{LSD.singleclusterplot}
\title{Visualize two-dimensional data clusters (add to an existing plot)}
\usage{
singleclusterplot(input, at = NULL, fromto = c(0.05, 0.95),
... | /man/singleclusterplot.Rd | no_license | jingwen/LSD | R | false | true | 2,889 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/LSD.clusterplot.R
\name{singleclusterplot}
\alias{singleclusterplot}
\alias{LSD.singleclusterplot}
\title{Visualize two-dimensional data clusters (add to an existing plot)}
\usage{
singleclusterplot(input, at = NULL, fromto = c(0.05, 0.95),
... |
library(dplyr)
library(rvest)
library(stringr)
all_links <- function(html) {
html %>%
html_nodes(xpath = '//*[contains(concat( " ", @class, " " ), concat( " ", "job_load_more", " " ))]') %>%
html_attr(name = "href")
}
get_title <- function(html) {
html %>%
html_node(xpath = '//*[(@id = "job-post")... | /Scrapping_test/staff2.R | no_license | KevorkSulahian/ECON_P | R | false | false | 3,384 | r | library(dplyr)
library(rvest)
library(stringr)
all_links <- function(html) {
html %>%
html_nodes(xpath = '//*[contains(concat( " ", @class, " " ), concat( " ", "job_load_more", " " ))]') %>%
html_attr(name = "href")
}
get_title <- function(html) {
html %>%
html_node(xpath = '//*[(@id = "job-post")... |
# 0: Load the data in RStudio
refine <- read.csv("refine_original.csv")
head(refine)
class(refine)
dim(refine)
names(refine)
str(refine)
glimpse(refine)
tail(refine)
# 1: Clean up brand names
refine$company
refine$company <- tolower(refine$company)
head(refine)
tail(refine)
refine$company[refine$company == "phillip... | /Data-Wrangling/refine_cleaning.R | permissive | bolade4/Data-Science-Projects | R | false | false | 2,697 | r | # 0: Load the data in RStudio
refine <- read.csv("refine_original.csv")
head(refine)
class(refine)
dim(refine)
names(refine)
str(refine)
glimpse(refine)
tail(refine)
# 1: Clean up brand names
refine$company
refine$company <- tolower(refine$company)
head(refine)
tail(refine)
refine$company[refine$company == "phillip... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/translate_operations.R
\name{translate_create_parallel_data}
\alias{translate_create_parallel_data}
\title{Creates a parallel data resource in Amazon Translate by importing an
input file from Amazon S3}
\usage{
translate_create_parallel_data(... | /cran/paws.machine.learning/man/translate_create_parallel_data.Rd | permissive | paws-r/paws | R | false | true | 1,693 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/translate_operations.R
\name{translate_create_parallel_data}
\alias{translate_create_parallel_data}
\title{Creates a parallel data resource in Amazon Translate by importing an
input file from Amazon S3}
\usage{
translate_create_parallel_data(... |
#[export]
allbetas <- function(y, x, pvalue = FALSE, logged = FALSE) {
n <- dim(x)[1]
denom <- n - 1
my <- sum(y) / n
m <- Rfast::colmeans(x)
r <- ( Rfast::eachcol.apply(x, y) - n * my * m )/denom
sx <- Rfast::colVars(x, suma = n * m)
be <- r / sx
a <- my - be * m
if ( !pvalue ) {
... | /R/many_regression_models_correlations.R | no_license | weiquanpan/Rfast | R | false | false | 19,647 | r | #[export]
allbetas <- function(y, x, pvalue = FALSE, logged = FALSE) {
n <- dim(x)[1]
denom <- n - 1
my <- sum(y) / n
m <- Rfast::colmeans(x)
r <- ( Rfast::eachcol.apply(x, y) - n * my * m )/denom
sx <- Rfast::colVars(x, suma = n * m)
be <- r / sx
a <- my - be * m
if ( !pvalue ) {
... |
\title{Differential splicing plot}
\name{plotSpliceDGE}
\alias{plotSpliceDGE}
\description{
Plot relative log-fold changes by exons for the specified gene and highlight the significantly spliced exons.
}
\usage{
plotSpliceDGE(lrt, geneid=NULL, genecolname=NULL, rank=1L, FDR=0.05)
}
\arguments{
\item{lrt}{\c... | /man/plotSpliceDGE.Rd | no_license | hiraksarkar/edgeR_fork | R | false | false | 1,292 | rd | \title{Differential splicing plot}
\name{plotSpliceDGE}
\alias{plotSpliceDGE}
\description{
Plot relative log-fold changes by exons for the specified gene and highlight the significantly spliced exons.
}
\usage{
plotSpliceDGE(lrt, geneid=NULL, genecolname=NULL, rank=1L, FDR=0.05)
}
\arguments{
\item{lrt}{\c... |
##' Encode string to URI
##'
##' This function is currently only a gsub - should be more clever and make better URI encoding.
##' @param s A value to be used as URI
##' @return The string{s} encoded as URI
##' @export encodetouri
# TODO - make better way of doing this
encodetouri<- function( s ) {
gsub(" |'|,|\\(|\\... | /rrdfqbcrnd0/R/encodetouri.R | no_license | rjsheperd/rrdfqbcrnd0 | R | false | false | 339 | r | ##' Encode string to URI
##'
##' This function is currently only a gsub - should be more clever and make better URI encoding.
##' @param s A value to be used as URI
##' @return The string{s} encoded as URI
##' @export encodetouri
# TODO - make better way of doing this
encodetouri<- function( s ) {
gsub(" |'|,|\\(|\\... |
context("EPPO database connect")
library("pestr")
test_that("Test that there is database", {
expect_message(eppo_database_check())
expect_message(eppo_database_check('/Database'), 'file does not exist')
expect_message(eppo_database_check(filename = 'emt'), 'file does not exist')
expect_message(eppo_database_check(... | /tests/testthat/test_database.R | permissive | mczyzj/pestr | R | false | false | 835 | r | context("EPPO database connect")
library("pestr")
test_that("Test that there is database", {
expect_message(eppo_database_check())
expect_message(eppo_database_check('/Database'), 'file does not exist')
expect_message(eppo_database_check(filename = 'emt'), 'file does not exist')
expect_message(eppo_database_check(... |
# -------------------------- INFERENCE RUN SCRIPT OPTIMISATION -------------------------- #
# Script to perform single or multi experiment inference with the calculation of the initial guesses for the four chains using the
# stan function optimizing for the computation of a point estimate. As inputs takes the name o... | /Inference/masterRunOptim.R | no_license | csynbiosysIBioEUoE/ICA_CIBCB2019_SI | R | false | false | 6,406 | r |
# -------------------------- INFERENCE RUN SCRIPT OPTIMISATION -------------------------- #
# Script to perform single or multi experiment inference with the calculation of the initial guesses for the four chains using the
# stan function optimizing for the computation of a point estimate. As inputs takes the name o... |
#!/usr/bin/env Rscript
# amp_predict_template.R - Use this to get started building your predictive model
#
# amps_file and decoys_file should point to respective AMP and DECOY text files
# where sequences are each on their own line.
#
# Be sure to save your final model with a ".h5" extension for testing!
#============... | /AMP_Challenge/amp_predict_hint_Rversion.R | no_license | dan-veltri/ace-intro-to-deep-learning | R | false | false | 3,679 | r | #!/usr/bin/env Rscript
# amp_predict_template.R - Use this to get started building your predictive model
#
# amps_file and decoys_file should point to respective AMP and DECOY text files
# where sequences are each on their own line.
#
# Be sure to save your final model with a ".h5" extension for testing!
#============... |
library(tidyverse)
library(ggplot2)
library(maptools)
library(rgeos)
library(ggmap)
library(scales)
library(RColorBrewer)
library(rgdal)
library(ggthemes)
library(plyr)
library(biscale)
library(sf)
library(plotly)
library(cowplot)
set.seed(8000)
options(scipen =999)
states_shape <- readOGR("Admin2.shp")
##read vacci... | /bivariatemap.R | permissive | preethical/covid_proc | R | false | false | 5,230 | r | library(tidyverse)
library(ggplot2)
library(maptools)
library(rgeos)
library(ggmap)
library(scales)
library(RColorBrewer)
library(rgdal)
library(ggthemes)
library(plyr)
library(biscale)
library(sf)
library(plotly)
library(cowplot)
set.seed(8000)
options(scipen =999)
states_shape <- readOGR("Admin2.shp")
##read vacci... |
\name{available.genomes}
\alias{available.genomes}
\alias{installed.genomes}
\alias{getBSgenome}
\title{Find available/installed genomes}
\description{
\code{available.genomes} gets the list of BSgenome data packages that
are available in the Bioconductor repositories for your version of
R/Bioconductor.
\c... | /man/available.genomes.Rd | no_license | Bioconductor/BSgenome | R | false | false | 5,725 | rd | \name{available.genomes}
\alias{available.genomes}
\alias{installed.genomes}
\alias{getBSgenome}
\title{Find available/installed genomes}
\description{
\code{available.genomes} gets the list of BSgenome data packages that
are available in the Bioconductor repositories for your version of
R/Bioconductor.
\c... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/textstat_class.R, R/view_method.R
\docType{class}
\name{textstat-class}
\alias{+,textstat,textstat-method}
\alias{[,textstat,ANY,ANY,ANY-method}
\alias{[[,textstat-method}
\alias{as.DataTables,textstat-method}
\alias{as.bundle}
\alias{as.data... | /man/textstat-class.Rd | no_license | stefan-mueller/polmineR | R | false | true | 2,002 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/textstat_class.R, R/view_method.R
\docType{class}
\name{textstat-class}
\alias{+,textstat,textstat-method}
\alias{[,textstat,ANY,ANY,ANY-method}
\alias{[[,textstat-method}
\alias{as.DataTables,textstat-method}
\alias{as.bundle}
\alias{as.data... |
weight <- read.csv("input.csv", header = T, sep = ",")
weight
plot(weight$ï..chocolate.x.,weight$weight.y.)
plot(weight, main = "chocolate vs Weight", xlab = "Chocolate (grams)",
ylab = "Weight (kgs)")
names(weight) <- c("Chocolate","Weight")
names(weight)
## conf.level cab be adjusted
cor.test(weight$Chocolate,w... | /pearson_correlation.R | no_license | Pratik6666/pearson_correlation | R | false | false | 651 | r | weight <- read.csv("input.csv", header = T, sep = ",")
weight
plot(weight$ï..chocolate.x.,weight$weight.y.)
plot(weight, main = "chocolate vs Weight", xlab = "Chocolate (grams)",
ylab = "Weight (kgs)")
names(weight) <- c("Chocolate","Weight")
names(weight)
## conf.level cab be adjusted
cor.test(weight$Chocolate,w... |
## ----classdiagram, echo=FALSE, fig.cap="The relationship between Classes in the `antitrust` package", out.width = '60%', fig.align = 'center'----
knitr::include_graphics("ClassDiagram.png")
| /vignettes/Reference.R | no_license | luciu5/antitrust | R | false | false | 194 | r | ## ----classdiagram, echo=FALSE, fig.cap="The relationship between Classes in the `antitrust` package", out.width = '60%', fig.align = 'center'----
knitr::include_graphics("ClassDiagram.png")
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/description-data.r
\docType{data}
\name{X_time_vec}
\alias{X_time_vec}
\title{X_time_vec gives the years corr. to Y, i.e. from 1971 to 2099}
\format{
vector of length 129
}
\usage{
data(X_time_vec)
}
\description{
X_time_vec gives the years c... | /man/X_time_vec.Rd | no_license | guillaumeevin/QUALYPSO | R | false | true | 429 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/description-data.r
\docType{data}
\name{X_time_vec}
\alias{X_time_vec}
\title{X_time_vec gives the years corr. to Y, i.e. from 1971 to 2099}
\format{
vector of length 129
}
\usage{
data(X_time_vec)
}
\description{
X_time_vec gives the years c... |
# reading data from csv files
#setpath to datsets
path <- "./dataset/Titanic.csv"
data <- read.csv(path)
#print(data)
#print(data$Class)
#print(data$Survived)
unique_class <- unique(data$Class)
class <- data$Class
#print(class)
#print(unique_class)
#print(data)
#no of rows and cols
col <- ncol(data)
row <- nrow(da... | /titanic_survive_count.R | no_license | abrarShariar/MAT3103-with-R | R | false | false | 2,495 | r | # reading data from csv files
#setpath to datsets
path <- "./dataset/Titanic.csv"
data <- read.csv(path)
#print(data)
#print(data$Class)
#print(data$Survived)
unique_class <- unique(data$Class)
class <- data$Class
#print(class)
#print(unique_class)
#print(data)
#no of rows and cols
col <- ncol(data)
row <- nrow(da... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/analysis.R
\name{curvature_radius}
\alias{curvature_radius}
\title{Return curvature radius}
\usage{
curvature_radius(t, x, y)
}
\arguments{
\item{t}{The times vector}
\item{x}{The x positions}
\item{y}{The y positions}
}
\value{
The local c... | /man/curvature_radius.Rd | permissive | PabRod/tracker | R | false | true | 442 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/analysis.R
\name{curvature_radius}
\alias{curvature_radius}
\title{Return curvature radius}
\usage{
curvature_radius(t, x, y)
}
\arguments{
\item{t}{The times vector}
\item{x}{The x positions}
\item{y}{The y positions}
}
\value{
The local c... |
## Put comments here that give an overall description of what your
## functions do
## Write a short comment describing this function
## makeCacheMatrix provides a set of 4 functions to get/set a matrix and its inverse
## by leveraging lexicol scope
makeCacheMatrix <- function(x = matrix()) {
i <- NULL
set <- fun... | /cachematrix.R | no_license | FernandoChen/ProgrammingAssignment2 | R | false | false | 971 | r | ## Put comments here that give an overall description of what your
## functions do
## Write a short comment describing this function
## makeCacheMatrix provides a set of 4 functions to get/set a matrix and its inverse
## by leveraging lexicol scope
makeCacheMatrix <- function(x = matrix()) {
i <- NULL
set <- fun... |
test_that("Checking the model Proba_aw", {
expect_equal(Proba_aw(0.90,awinf=0.917,awsup=0.988), 0)
expect_equal(Proba_aw(0.99,awinf=0.917,awsup=0.988),1)
expect_equal(Proba_aw(0.96,0.917,0.988),0.6056338)
expect_equal(length(Proba_aw(c(0.90,0.92,0.99),0.917,0.988)),3)
})
| /tests/testthat/test-Proba_aw.R | no_license | bt2vadia/bacterial-growth | R | false | false | 280 | r | test_that("Checking the model Proba_aw", {
expect_equal(Proba_aw(0.90,awinf=0.917,awsup=0.988), 0)
expect_equal(Proba_aw(0.99,awinf=0.917,awsup=0.988),1)
expect_equal(Proba_aw(0.96,0.917,0.988),0.6056338)
expect_equal(length(Proba_aw(c(0.90,0.92,0.99),0.917,0.988)),3)
})
|
# OD matrix
library(tidyverse)
set.seed(1)
reg_stats_compact <- read_csv("data/processed/reg_stats_compact.csv")
tmp <- reg_stats_compact %>%
group_by(Season, TeamID, OTeamID) %>%
summarise(Score = mean(Score)) %>%
ungroup() %>%
group_by(Season) %>%
nest() %>%
mutate(data = map(data, ~ .x %>%
... | /名称未設定フォルダ/src/processed/OD.R | no_license | kur0cky/NCAA2019 | R | false | false | 1,063 | r | # OD matrix
library(tidyverse)
set.seed(1)
reg_stats_compact <- read_csv("data/processed/reg_stats_compact.csv")
tmp <- reg_stats_compact %>%
group_by(Season, TeamID, OTeamID) %>%
summarise(Score = mean(Score)) %>%
ungroup() %>%
group_by(Season) %>%
nest() %>%
mutate(data = map(data, ~ .x %>%
... |
# First define a function to compute Pearson chi-square
# and deviance tests and p-values
goftests <- function(x, m1, m2, df)
{
# Compute Pearson chi-squared
# and deviance tests and p-values
# In this function
# x = observed counts
# m1 = expected counts under H0
# m2 = expected count... | /STAT557/STAT557final/danish_alchol.R | no_license | fanne-stat/Homework | R | false | false | 2,617 | r | # First define a function to compute Pearson chi-square
# and deviance tests and p-values
goftests <- function(x, m1, m2, df)
{
# Compute Pearson chi-squared
# and deviance tests and p-values
# In this function
# x = observed counts
# m1 = expected counts under H0
# m2 = expected count... |
# Function to calculate gradient of log-likelihood
nnGradLogLikelihood <- function(w_seq,beta,X,y,datasize,distr,mean_sigma2_inverse){
output <- list()
n = nrow(X)
out <- nnBackPropagation(X,y,w_seq,beta,distr)
back_prop <- out$gradient
nnOut <- t(out$nnOut)
switch (distr,
normal = {gradient_thet... | /R/02_libs/nnGradLogLikelihood.R | no_license | VBayesLab/deepGLM | R | false | false | 662 | r | # Function to calculate gradient of log-likelihood
nnGradLogLikelihood <- function(w_seq,beta,X,y,datasize,distr,mean_sigma2_inverse){
output <- list()
n = nrow(X)
out <- nnBackPropagation(X,y,w_seq,beta,distr)
back_prop <- out$gradient
nnOut <- t(out$nnOut)
switch (distr,
normal = {gradient_thet... |
# For DRA plots, there are two views
# For polar view,
# Run "startup.R" and "layer_DRA_polar.R"
# scale bar is 10 um
# polar DmDRA1 in Figure 7 as an example ---------------------------------------------------------------------
type <- "Dm-DRA1"
tb <- read.csv(paste("table_by_type_out_DRA/", "DRAR7R8_ou... | /plot_DRA_polar.R | no_license | artxz/FAFB-photoreceptor-connectivity | R | false | false | 3,271 | r | # For DRA plots, there are two views
# For polar view,
# Run "startup.R" and "layer_DRA_polar.R"
# scale bar is 10 um
# polar DmDRA1 in Figure 7 as an example ---------------------------------------------------------------------
type <- "Dm-DRA1"
tb <- read.csv(paste("table_by_type_out_DRA/", "DRAR7R8_ou... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/word2vec.R
\name{word2phrase}
\alias{word2phrase}
\title{to convert words to phrases}
\usage{
word2phrase(train_file, output_file, debug_mode = 0, min_count = 0,
threshold = 0)
}
\arguments{
\item{train_file}{train file name}
\item{output_... | /man/word2phrase.Rd | no_license | xiayh17/rword2vec | R | false | true | 598 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/word2vec.R
\name{word2phrase}
\alias{word2phrase}
\title{to convert words to phrases}
\usage{
word2phrase(train_file, output_file, debug_mode = 0, min_count = 0,
threshold = 0)
}
\arguments{
\item{train_file}{train file name}
\item{output_... |
library(ape)
testtree <- read.tree("331_0.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="331_0_unrooted.txt") | /codeml_files/newick_trees_processed/331_0/rinput.R | no_license | DaniBoo/cyanobacteria_project | R | false | false | 133 | r | library(ape)
testtree <- read.tree("331_0.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="331_0_unrooted.txt") |
#' Convert a igraph object to a simplicial complex
#'
#' @param G the input graph
#'
#' @return a simplicial complex S
graphComplex <- function(G){
S <- c(lapply(V(G), function(v) as.integer(v)), split(t(ends(G, E(G), names=FALSE)), rep(1:length(E(G)), each=2)))
return(S)
}
| /Chapter 6/R/graphComplex.R | no_license | aida-ugent/PhD_Code_Robin_Vandaele | R | false | false | 280 | r | #' Convert a igraph object to a simplicial complex
#'
#' @param G the input graph
#'
#' @return a simplicial complex S
graphComplex <- function(G){
S <- c(lapply(V(G), function(v) as.integer(v)), split(t(ends(G, E(G), names=FALSE)), rep(1:length(E(G)), each=2)))
return(S)
}
|
################# Some network functions for measurment extraction ###########################
############################################
#
# Dyad level measurement functions
#
############################################
#' dyad_weight function
#'
#' This function will take a graph and take dyad level sum of w... | /R/measurment_functions_DYADS.R | no_license | lionel68/netTS | R | false | false | 5,936 | r | ################# Some network functions for measurment extraction ###########################
############################################
#
# Dyad level measurement functions
#
############################################
#' dyad_weight function
#'
#' This function will take a graph and take dyad level sum of w... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rcrainfo_rcr_authcodes.R
\name{rcrainfo_rcr_authcodes}
\alias{rcrainfo_rcr_authcodes}
\title{Retrieve rcr authcodes data from rcrainfo database}
\usage{
rcrainfo_rcr_authcodes(OWNER = NULL, AUTHORITY_TYPE = NULL,
ACTIVE_STATUS = NULL, AUTHO... | /man/rcrainfo_rcr_authcodes.Rd | no_license | markwh/envirofacts | R | false | true | 611 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rcrainfo_rcr_authcodes.R
\name{rcrainfo_rcr_authcodes}
\alias{rcrainfo_rcr_authcodes}
\title{Retrieve rcr authcodes data from rcrainfo database}
\usage{
rcrainfo_rcr_authcodes(OWNER = NULL, AUTHORITY_TYPE = NULL,
ACTIVE_STATUS = NULL, AUTHO... |
## Put comments here that give an overall description of what your
## functions do
## Author: Dave Belding
## Matrix inversion caching functions
## These functions are to demonstrate the use of cached objects. In
## this case, a matrix will be inverted only if the inverse has not
## already been created and cached.
... | /cachematrix.R | no_license | dbelding110/ProgrammingAssignment2 | R | false | false | 2,653 | r | ## Put comments here that give an overall description of what your
## functions do
## Author: Dave Belding
## Matrix inversion caching functions
## These functions are to demonstrate the use of cached objects. In
## this case, a matrix will be inverted only if the inverse has not
## already been created and cached.
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/optimizek.R
\name{optimizek}
\alias{optimizek}
\title{optimize the k parameter}
\usage{
optimizek(
eloobject,
krange = c(2, 400),
optimode = "loop",
resolution = 100,
itype = NULL,
daterange = NULL,
burnin = 0,
doplot = FALSE,... | /man/optimizek.Rd | no_license | gobbios/EloRating | R | false | true | 4,733 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/optimizek.R
\name{optimizek}
\alias{optimizek}
\title{optimize the k parameter}
\usage{
optimizek(
eloobject,
krange = c(2, 400),
optimode = "loop",
resolution = 100,
itype = NULL,
daterange = NULL,
burnin = 0,
doplot = FALSE,... |
train<-read.csv("train.csv")
test<-read.csv("test.csv")
str(test)
str(train)
summary(train)
train$Hazard<-as.factor(train$Hazard)
install.packages("dplyr")
library(dplyr)
inp=select(train,-(Id))
library(rpart)
library(rpart.plot)
CARTmodel = rpart(Hazard~., data=inp)
prp(CARTmodel)
PredictCART = predict(C... | /randomForest.R | no_license | abhisheknagarjuna/Kaggle-Property-Prediction | R | false | false | 779 | r | train<-read.csv("train.csv")
test<-read.csv("test.csv")
str(test)
str(train)
summary(train)
train$Hazard<-as.factor(train$Hazard)
install.packages("dplyr")
library(dplyr)
inp=select(train,-(Id))
library(rpart)
library(rpart.plot)
CARTmodel = rpart(Hazard~., data=inp)
prp(CARTmodel)
PredictCART = predict(C... |
\name{csvToUMF}
\alias{csvToUMF}
\title{Convert .CSV File to an unmarkedFrame}
\usage{csvToUMF(filename, long=FALSE, type, species, ...)}
\description{This function converts an appropriatedly formated comma-separated
values file (.csv) to a format usable by \emph{unmarked}'s fitting
functions (see \emph{Details}).}
\de... | /man/csvToUMF.Rd | no_license | rbchan/unmarked | R | false | false | 2,504 | rd | \name{csvToUMF}
\alias{csvToUMF}
\title{Convert .CSV File to an unmarkedFrame}
\usage{csvToUMF(filename, long=FALSE, type, species, ...)}
\description{This function converts an appropriatedly formated comma-separated
values file (.csv) to a format usable by \emph{unmarked}'s fitting
functions (see \emph{Details}).}
\de... |
shift <-
function (region_t, region_t1, nation_t, nation_t1) {
industries <- length(region_t)
sum_region_t <- sum(region_t)
sum_region_t1 <- sum(region_t1)
sum_nation_t <- sum(nation_t)
sum_nation_t1 <- sum(nation_t1)
nts <- sum_region_t1-(sum_region_t*(sum_nation_t1/sum_nation_t))
i <- 0
m_i <- vecto... | /REAT/R/shift.R | no_license | ingted/R-Examples | R | false | false | 581 | r | shift <-
function (region_t, region_t1, nation_t, nation_t1) {
industries <- length(region_t)
sum_region_t <- sum(region_t)
sum_region_t1 <- sum(region_t1)
sum_nation_t <- sum(nation_t)
sum_nation_t1 <- sum(nation_t1)
nts <- sum_region_t1-(sum_region_t*(sum_nation_t1/sum_nation_t))
i <- 0
m_i <- vecto... |
#getwd()
#list.files()
pollutantmean <- function(directory, pollutant = "sulfate", id = 1:332) {
## 'directory' is a character vector of length 1 indicating
## the location of the CSV files
## 'pollutant' is a character vector of length 1 indicating
## the name of the pollutant for which we will calculate t... | /pollutantmean.R | no_license | kalyansen4u/R-Programming-Assignment1 | R | false | false | 1,189 | r | #getwd()
#list.files()
pollutantmean <- function(directory, pollutant = "sulfate", id = 1:332) {
## 'directory' is a character vector of length 1 indicating
## the location of the CSV files
## 'pollutant' is a character vector of length 1 indicating
## the name of the pollutant for which we will calculate t... |
##read file into memory
first5rows <- read.table("household_power_consumption.txt", header=TRUE, sep=";", nrows=5, na.strings="?")
classes <- sapply(first5rows, class)
names <- names(first5rows)
household_data <- read.table("household_power_consumption.txt", header=TRUE, sep=";", colClasses=classes, na.strings="?", ski... | /plot3.R | no_license | kamerlingh/ExData_Plotting1 | R | false | false | 1,030 | r | ##read file into memory
first5rows <- read.table("household_power_consumption.txt", header=TRUE, sep=";", nrows=5, na.strings="?")
classes <- sapply(first5rows, class)
names <- names(first5rows)
household_data <- read.table("household_power_consumption.txt", header=TRUE, sep=";", colClasses=classes, na.strings="?", ski... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.