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
library("vegan") # Read in input data merged_microbes <- read.csv('./BM_4/merged_genusrpm.tsv',header=TRUE,sep='\t',row.names=1) # Calculate Simpson's Diversity Index for all individuals simpsons_div <- diversity(t(merged_microbes),index = "simpson", MARGIN = 1) print(simpsons_div) # write to consol write.csv(simpso...
/getSimpsonsDiversityIndex.R
no_license
katrinakalantar/mNGSDiversity
R
false
false
620
r
library("vegan") # Read in input data merged_microbes <- read.csv('./BM_4/merged_genusrpm.tsv',header=TRUE,sep='\t',row.names=1) # Calculate Simpson's Diversity Index for all individuals simpsons_div <- diversity(t(merged_microbes),index = "simpson", MARGIN = 1) print(simpsons_div) # write to consol write.csv(simpso...
## Load dataset and packages if(!file.exists("./data")){dir.create("./data")} url <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" path <- "./data/project.zip" download.file(url,path,method="curl") unzip("./data/project.zip", exdir = "./data") library(lubridate) ...
/plot3.R
no_license
jesselibra/ExData_Plotting1
R
false
false
1,232
r
## Load dataset and packages if(!file.exists("./data")){dir.create("./data")} url <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" path <- "./data/project.zip" download.file(url,path,method="curl") unzip("./data/project.zip", exdir = "./data") library(lubridate) ...
\name{Human_transcript_name} \alias{Human_transcript_name} \docType{data} \title{ The names of transcripts mapped to each gene for human exon chips} \description{ This data include the names of transcripts mapped to each gene for human exon chips. } \usage{data(Human_transcript_name)} \format{ A 121741*1 m...
/man/Human_transcript_name.Rd
no_license
PUGEA1/pumadata
R
false
false
657
rd
\name{Human_transcript_name} \alias{Human_transcript_name} \docType{data} \title{ The names of transcripts mapped to each gene for human exon chips} \description{ This data include the names of transcripts mapped to each gene for human exon chips. } \usage{data(Human_transcript_name)} \format{ A 121741*1 m...
test_that("run handlers", { r <- Request() f <- function(request) { request$data <- "a" return(request) } r$handlers <- list(l = HandlerList(f)) r <- run(r, l) expect_equal(r$data, "a") }) test_that("run multiple handlers", { r <- Request() f <- function(request) { request$data <- TRUE ...
/paws.common/tests/testthat/test_handlers.R
permissive
paws-r/paws
R
false
false
1,205
r
test_that("run handlers", { r <- Request() f <- function(request) { request$data <- "a" return(request) } r$handlers <- list(l = HandlerList(f)) r <- run(r, l) expect_equal(r$data, "a") }) test_that("run multiple handlers", { r <- Request() f <- function(request) { request$data <- TRUE ...
library(kazaam) ### Name: cov ### Title: Covariance and Correlation ### Aliases: cov cov,shaq-method cor,shaq-method ### ** Examples ## Not run: ##D library(kazaam) ##D x = ranshaq(runif, 10, 3) ##D ##D cov(x) ##D cor(x) ##D ##D finalize() ## End(Not run)
/data/genthat_extracted_code/kazaam/examples/cov.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
267
r
library(kazaam) ### Name: cov ### Title: Covariance and Correlation ### Aliases: cov cov,shaq-method cor,shaq-method ### ** Examples ## Not run: ##D library(kazaam) ##D x = ranshaq(runif, 10, 3) ##D ##D cov(x) ##D cor(x) ##D ##D finalize() ## End(Not run)
\name{mi.inference} \alias{mi.inference} \title{ Multiple Imputation Inference } \description{ Combines estimates and standard errors from m complete-data analyses performed on m imputed datasets to produce a single inference. Uses the technique described by Rubin (1987) for multiple imputation inference for...
/man/mi.inference.Rd
no_license
cran/mix
R
false
false
2,360
rd
\name{mi.inference} \alias{mi.inference} \title{ Multiple Imputation Inference } \description{ Combines estimates and standard errors from m complete-data analyses performed on m imputed datasets to produce a single inference. Uses the technique described by Rubin (1987) for multiple imputation inference for...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/androidpublisher_objects.R \name{ApkListingsListResponse} \alias{ApkListingsListResponse} \title{ApkListingsListResponse Object} \usage{ ApkListingsListResponse(listings = NULL) } \arguments{ \item{listings}{No description} } \value{ ApkListi...
/googleandroidpublisherv2.auto/man/ApkListingsListResponse.Rd
permissive
GVersteeg/autoGoogleAPI
R
false
true
487
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/androidpublisher_objects.R \name{ApkListingsListResponse} \alias{ApkListingsListResponse} \title{ApkListingsListResponse Object} \usage{ ApkListingsListResponse(listings = NULL) } \arguments{ \item{listings}{No description} } \value{ ApkListi...
library(mousetrap) ### Name: mt_export_long ### Title: Export mouse-tracking data. ### Aliases: mt_export_long mt_export_wide ### ** Examples # Export data in long format # (and include information about condition and subject_nr) mt_data_long <- mt_export_long(mt_example, use2_variables=c("subject_nr","Condition"...
/data/genthat_extracted_code/mousetrap/examples/mt_export_long.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
505
r
library(mousetrap) ### Name: mt_export_long ### Title: Export mouse-tracking data. ### Aliases: mt_export_long mt_export_wide ### ** Examples # Export data in long format # (and include information about condition and subject_nr) mt_data_long <- mt_export_long(mt_example, use2_variables=c("subject_nr","Condition"...
library(rvest) library(stringr) library(tidyverse) ################################### # Extract Data # ################################### #### Functions for extracting tables #### extract_tables <- function(x){ z <- html_attr(x, "style") == "width:100%;" return(x[z]) } bind_tables <- fu...
/data_extract.R
no_license
wspagnola/nyc_mayor2021
R
false
false
8,688
r
library(rvest) library(stringr) library(tidyverse) ################################### # Extract Data # ################################### #### Functions for extracting tables #### extract_tables <- function(x){ z <- html_attr(x, "style") == "width:100%;" return(x[z]) } bind_tables <- fu...
# code from proto vignette library(proto) addProto <- proto( x = rnorm(5), add = function(.) sum(.$x) ) addProto$add() addProto2 <- addProto$proto( x = 1:5 ) addProto2$add() addProto2$y <- seq(2,10,2) addProto2$x <- 1:10 addProto2$add3 <- function(., z) sum(.$x) + sum(.$y) + sum(z) addProto2$add() add...
/packrat/lib/x86_64-apple-darwin13.4.0/3.1.2/proto/demo/proto-vignette.R
no_license
alexanderm10/TreeRings-to-Biomass
R
false
false
4,976
r
# code from proto vignette library(proto) addProto <- proto( x = rnorm(5), add = function(.) sum(.$x) ) addProto$add() addProto2 <- addProto$proto( x = 1:5 ) addProto2$add() addProto2$y <- seq(2,10,2) addProto2$x <- 1:10 addProto2$add3 <- function(., z) sum(.$x) + sum(.$y) + sum(z) addProto2$add() add...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tzupdater.R \name{get_last_published_tz} \alias{get_last_published_tz} \title{get_last_published_tz} \usage{ get_last_published_tz() } \value{ Latest IANA tz db version name or Unknown if not found. } \description{ Get the name of the latest ...
/man/get_last_published_tz.Rd
permissive
sthonnard/tzupdater
R
false
true
429
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tzupdater.R \name{get_last_published_tz} \alias{get_last_published_tz} \title{get_last_published_tz} \usage{ get_last_published_tz() } \value{ Latest IANA tz db version name or Unknown if not found. } \description{ Get the name of the latest ...
library(survtmle) ### Name: mean_tmle ### Title: TMLE for G-Computation of Cumulative Incidence ### Aliases: mean_tmle ### ** Examples ## Single failure type examples # simulate data set.seed(1234) n <- 100 trt <- rbinom(n,1,0.5) adjustVars <- data.frame(W1 = round(runif(n)), W2 = round(runif(n, 0, 2))) ftime <- ...
/data/genthat_extracted_code/survtmle/examples/mean_tmle.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
730
r
library(survtmle) ### Name: mean_tmle ### Title: TMLE for G-Computation of Cumulative Incidence ### Aliases: mean_tmle ### ** Examples ## Single failure type examples # simulate data set.seed(1234) n <- 100 trt <- rbinom(n,1,0.5) adjustVars <- data.frame(W1 = round(runif(n)), W2 = round(runif(n, 0, 2))) ftime <- ...
####################################################################################### ############### ############### AntMAN Package ############### ############### ####################################################################################### #' S3 class AM_mix_weights_prior #' @description Object type ret...
/AntMAN/R/AM_mix_weights_prior.R
no_license
bbodin/AntMAN
R
false
false
3,583
r
####################################################################################### ############### ############### AntMAN Package ############### ############### ####################################################################################### #' S3 class AM_mix_weights_prior #' @description Object type ret...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/leMsMs.r \name{recalibrate.addMS1data} \alias{recalibrate.addMS1data} \title{Return MS1 peaks to be used for recalibration} \usage{ recalibrate.addMS1data(spec,mode="pH", recalibrateMS1Window = getOption("RMassBank")$recalibrateMS...
/man/recalibrate.addMS1data.Rd
no_license
jorainer/RMassBank
R
false
true
1,749
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/leMsMs.r \name{recalibrate.addMS1data} \alias{recalibrate.addMS1data} \title{Return MS1 peaks to be used for recalibration} \usage{ recalibrate.addMS1data(spec,mode="pH", recalibrateMS1Window = getOption("RMassBank")$recalibrateMS...
/Assignment1/Assignment1_SourceCode+Explanations_YeRong.R
no_license
ReneeYe/Applied_Time_Series_Analysis_ST3233
R
false
false
7,525
r
## ----global_options, include = FALSE--------------------------------------------------------------------------------------------- try(source("../../../.Rprofile")) ## import pprint ## import copy as copy ## dc_speckey_dict = {0: 'mpoly_1', ## 1: 'ng_s_t', ## 2: 'ng_s_d', ...
/vig/amto/dict/htmlpdfr/fp_dict.R
permissive
fagan2888/pyfan
R
false
false
5,073
r
## ----global_options, include = FALSE--------------------------------------------------------------------------------------------- try(source("../../../.Rprofile")) ## import pprint ## import copy as copy ## dc_speckey_dict = {0: 'mpoly_1', ## 1: 'ng_s_t', ## 2: 'ng_s_d', ...
#' Power Function #' #' This function raises input to a power. #' #' @param x Numeric input to be raised to the power of the \code{power}. #' @param power Numeric input for power that \code{x} will be raised to, #' default to \code{2}. #' @keywords p-value #' #' @return Numeric representing \code{x} raised to the pow...
/R/my_pow.R
no_license
chenxr666/Project3Package
R
false
false
467
r
#' Power Function #' #' This function raises input to a power. #' #' @param x Numeric input to be raised to the power of the \code{power}. #' @param power Numeric input for power that \code{x} will be raised to, #' default to \code{2}. #' @keywords p-value #' #' @return Numeric representing \code{x} raised to the pow...
# Dec / Random Tree # Paul Turner library(caTools) library(rpart) library(rpart.plot) library(randomForest) library(ggplot2) library(corrgram) library(corrplot) library(dplyr) library(Rtsne) library(ISLR) # college data data.college <- College str(data.college) ggplot(data.college, aes(Grad.Rate, Room.Board)) + ge...
/TreesandTSNE.R
no_license
Paul-Kyle-Turner/Rquickbootcamp
R
false
false
1,833
r
# Dec / Random Tree # Paul Turner library(caTools) library(rpart) library(rpart.plot) library(randomForest) library(ggplot2) library(corrgram) library(corrplot) library(dplyr) library(Rtsne) library(ISLR) # college data data.college <- College str(data.college) ggplot(data.college, aes(Grad.Rate, Room.Board)) + ge...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot_life_curve.R \name{plot_life_curve} \alias{plot_life_curve} \title{Life curve} \usage{ plot_life_curve(m_flexsurvreg, title_aux = "", x_label = "time", y_label = "reliability", ylim = c(0, 1), xlim = NA, line_width = 1.5) } \a...
/man/plot_life_curve.Rd
no_license
leonardommarques/reliabilitytools
R
false
true
967
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plot_life_curve.R \name{plot_life_curve} \alias{plot_life_curve} \title{Life curve} \usage{ plot_life_curve(m_flexsurvreg, title_aux = "", x_label = "time", y_label = "reliability", ylim = c(0, 1), xlim = NA, line_width = 1.5) } \a...
% File src/library/base/man/seek.Rd % Part of the R package, https://www.R-project.org % Copyright 1995-2015 R Core Team % Distributed under GPL 2 or later \name{seek} \alias{seek} \alias{seek.connection} \alias{truncate} \alias{truncate.connection} \alias{isSeekable} \title{Functions to Reposition Connections} \descr...
/bin/R-3.5.1/src/library/base/man/seek.Rd
permissive
lifebit-ai/exomedepth
R
false
false
4,187
rd
% File src/library/base/man/seek.Rd % Part of the R package, https://www.R-project.org % Copyright 1995-2015 R Core Team % Distributed under GPL 2 or later \name{seek} \alias{seek} \alias{seek.connection} \alias{truncate} \alias{truncate.connection} \alias{isSeekable} \title{Functions to Reposition Connections} \descr...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/cat.R \name{gcolor} \alias{gcolor} \title{generate random colors without grey o not} \usage{ gcolor(ncolor, grey = FALSE, alpha = 1) } \arguments{ \item{grey}{include the grey color or not (default: FALSE)} \item{alpha}{Transparent level aut...
/man/gcolor.Rd
no_license
guokai8/rcolors
R
false
true
393
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/cat.R \name{gcolor} \alias{gcolor} \title{generate random colors without grey o not} \usage{ gcolor(ncolor, grey = FALSE, alpha = 1) } \arguments{ \item{grey}{include the grey color or not (default: FALSE)} \item{alpha}{Transparent level aut...
rm(list=ls()) library(data.table) library(rgdal) library(dplyr) library(sp) # library(sf) library(foreign) source_1 = "/Users/hn/Documents/00_GitHub/Ag/remote_sensing/R/remote_core.R" source(source_1) options(digits=9) options(digit=9) ############################################################################## da...
/NASA/shapefile_codes/shapefile_dataparts.R
permissive
HNoorazar/Ag
R
false
false
1,706
r
rm(list=ls()) library(data.table) library(rgdal) library(dplyr) library(sp) # library(sf) library(foreign) source_1 = "/Users/hn/Documents/00_GitHub/Ag/remote_sensing/R/remote_core.R" source(source_1) options(digits=9) options(digit=9) ############################################################################## da...
centroid = function ( X, Y ) { cx = (X[1] + X[2] + X[3] + X[4]) / 4 cy = (Y[1] + Y[2] + Y[3] + Y[4]) / 4 data.frame( cx, cy ) } show = function ( X, Y, TX=NULL, TY=NULL, title="" ) { TL = c( "t1", "t2", "t3" ) #labels for tri pts QL = c( "p1", "p2", "p3", "p4" ) #labels for quad pts width = max( abs( X[1] - X[2] ),...
/square_circle_hole/BADSquareCircleHolercode.r
no_license
sju-senior-projects-2019/ns
R
false
false
1,159,421
r
centroid = function ( X, Y ) { cx = (X[1] + X[2] + X[3] + X[4]) / 4 cy = (Y[1] + Y[2] + Y[3] + Y[4]) / 4 data.frame( cx, cy ) } show = function ( X, Y, TX=NULL, TY=NULL, title="" ) { TL = c( "t1", "t2", "t3" ) #labels for tri pts QL = c( "p1", "p2", "p3", "p4" ) #labels for quad pts width = max( abs( X[1] - X[2] ),...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Task_operators.R \name{getTaskFormula} \alias{getTaskFormula} \title{Get formula of a task.} \usage{ getTaskFormula(x, target = getTaskTargetNames(x), explicit.features = FALSE, env = parent.frame()) } \arguments{ \item{x}{[\code{\link{Task...
/man/getTaskFormula.Rd
no_license
randikegaje/mlr
R
false
true
1,341
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Task_operators.R \name{getTaskFormula} \alias{getTaskFormula} \title{Get formula of a task.} \usage{ getTaskFormula(x, target = getTaskTargetNames(x), explicit.features = FALSE, env = parent.frame()) } \arguments{ \item{x}{[\code{\link{Task...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/colorQuantiles.R \name{colorQuantiles} \alias{colorQuantiles} \title{Soil Color Range via Quantiles} \usage{ colorQuantiles(soilColors, p = c(0.05, 0.5, 0.95)) } \arguments{ \item{soilColors}{vector of R colors (sRGB colorspace)} \item{p}{ma...
/man/colorQuantiles.Rd
no_license
Memo1986/aqp
R
false
true
1,615
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/colorQuantiles.R \name{colorQuantiles} \alias{colorQuantiles} \title{Soil Color Range via Quantiles} \usage{ colorQuantiles(soilColors, p = c(0.05, 0.5, 0.95)) } \arguments{ \item{soilColors}{vector of R colors (sRGB colorspace)} \item{p}{ma...
iris_ls_df <- list(iris_1 = iris, iris_2 = iris) # Prefix `Sepal` with Names of the List nms_ls1 <- rename_with_ls_df_names( iris_ls_df, tidyselect::starts_with("Sepal") ) %>% purrr::map(names) test_that("rename_with_ls_df_names() works", { expect_identical( nms_ls1$iris_1, c( "iris_1_Sepal...
/tests/testthat/test-rename.R
permissive
Lightbridge-KS/moodleQuiz
R
false
false
568
r
iris_ls_df <- list(iris_1 = iris, iris_2 = iris) # Prefix `Sepal` with Names of the List nms_ls1 <- rename_with_ls_df_names( iris_ls_df, tidyselect::starts_with("Sepal") ) %>% purrr::map(names) test_that("rename_with_ls_df_names() works", { expect_identical( nms_ls1$iris_1, c( "iris_1_Sepal...
library(dplyr) library(coloc) library(data.table) # args = c("Adipose_Subcutaneous_Analysis.cis.eqtl.gz", "Adipose_Visceral_Omentum_Analysis.cis.eqtl.gz") # Read the command line arguments args <- commandArgs(trailingOnly = TRUE) # Define useful functions ## One to get the tissue type name get_tissue <- function(fi...
/160618/coloc-analysis-master/coloc.R
no_license
chanibravo/hcasmc_eqtl
R
false
false
4,456
r
library(dplyr) library(coloc) library(data.table) # args = c("Adipose_Subcutaneous_Analysis.cis.eqtl.gz", "Adipose_Visceral_Omentum_Analysis.cis.eqtl.gz") # Read the command line arguments args <- commandArgs(trailingOnly = TRUE) # Define useful functions ## One to get the tissue type name get_tissue <- function(fi...
#' R6 Class Representing a markdown report #' #' @description #' A report contains chunks of code contributing to an R #' Markdown report #' #' @details #' Chunks can be added or removed from the report and the updated code will #' trigger recreation of the stored markdown document. #' R6md <- R6Class( "code_block", ...
/R/r6md.R
no_license
kismet303/r6md
R
false
false
4,572
r
#' R6 Class Representing a markdown report #' #' @description #' A report contains chunks of code contributing to an R #' Markdown report #' #' @details #' Chunks can be added or removed from the report and the updated code will #' trigger recreation of the stored markdown document. #' R6md <- R6Class( "code_block", ...
## This one is great! raw_data <- rio::import(file.choose()) require(quanteda) corpus <- readtext::readtext('/Users/anitaneil/Documents/UniMa/HWS 1920/PS II Gegenöffentlichkeiten/Twitter_Counterpublics/Zeitungsartikel/The New York Times/txt/*') require(stringr) brokentext <- str_split(corpus$text[1], '[:space:]')[[...
/data_counterpublics.R
no_license
chainsawriot/counterpublics_project
R
false
false
1,175
r
## This one is great! raw_data <- rio::import(file.choose()) require(quanteda) corpus <- readtext::readtext('/Users/anitaneil/Documents/UniMa/HWS 1920/PS II Gegenöffentlichkeiten/Twitter_Counterpublics/Zeitungsartikel/The New York Times/txt/*') require(stringr) brokentext <- str_split(corpus$text[1], '[:space:]')[[...
\alias{AtkHyperlink} \name{AtkHyperlink} \title{AtkHyperlink} \description{An ATK object which encapsulates a link or set of links in a hypertext document.} \section{Methods and Functions}{ \code{\link{atkHyperlinkGetUri}(object, i)}\cr \code{\link{atkHyperlinkGetObject}(object, i)}\cr \code{\link{atkHyperlinkGetEndInd...
/RGtk2/man/AtkHyperlink.Rd
no_license
hjy1210/RGtk2
R
false
false
2,337
rd
\alias{AtkHyperlink} \name{AtkHyperlink} \title{AtkHyperlink} \description{An ATK object which encapsulates a link or set of links in a hypertext document.} \section{Methods and Functions}{ \code{\link{atkHyperlinkGetUri}(object, i)}\cr \code{\link{atkHyperlinkGetObject}(object, i)}\cr \code{\link{atkHyperlinkGetEndInd...
# Funkcje do rzutu kostkami rzut_kostkami = function(liczba_kostek = 1) sample(1:6, size = liczba_kostek, replace = TRUE) rzut_kostkami(4) # Czołgi czołg_1 = list(atak = 5, pancerz = 2, nazwa = "Pantera") czołg_2 = list(atak = 6, pancerz = 10, naz...
/Tanks/czolgi.R
no_license
BetaAndBit/Statystyka-w-grach
R
false
false
1,056
r
# Funkcje do rzutu kostkami rzut_kostkami = function(liczba_kostek = 1) sample(1:6, size = liczba_kostek, replace = TRUE) rzut_kostkami(4) # Czołgi czołg_1 = list(atak = 5, pancerz = 2, nazwa = "Pantera") czołg_2 = list(atak = 6, pancerz = 10, naz...
c2t <- function(lst){ if(!inherits(lst,"list")) stop("wrong input") class(lst) <- c("TISEANmatrixlist","list") #needs special serialization method out <- as.list(callTISEAN("c2t",input=lst)) out <- as.matrixList(out) out <- colnamesout(out,1,c("epsilon","log.der.")) out <- .cleanList(out) return(out) }
/R/c2t.r
no_license
cran/RTisean
R
false
false
314
r
c2t <- function(lst){ if(!inherits(lst,"list")) stop("wrong input") class(lst) <- c("TISEANmatrixlist","list") #needs special serialization method out <- as.list(callTISEAN("c2t",input=lst)) out <- as.matrixList(out) out <- colnamesout(out,1,c("epsilon","log.der.")) out <- .cleanList(out) return(out) }
numPerPatch54648 <- c(2533,2467)
/NatureEE-data-archive/Run203071/JAFSdata/JAFSnumPerPatch54648.R
no_license
flaxmans/NatureEE2017
R
false
false
33
r
numPerPatch54648 <- c(2533,2467)
############################################################# ########### Visualize the tf-idf of multiple texts library(gutenbergr) library(dplyr) library(tidytext) library(tidyverse) physics = gutenberg_download(c(37729, 14725, 13476, 5001), meta_fields = "author") physics_...
/TF-IDF_viz.R
no_license
vijaysakhamuri/TextMining-Topic-Modelling
R
false
false
1,580
r
############################################################# ########### Visualize the tf-idf of multiple texts library(gutenbergr) library(dplyr) library(tidytext) library(tidyverse) physics = gutenberg_download(c(37729, 14725, 13476, 5001), meta_fields = "author") physics_...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/confcurve.R \name{bootcurve} \alias{bootcurve} \title{Generate bootstrap samples for computation of confidence curves and related inferential statistics.} \usage{ bootcurve(data, statistic, B = 2000, formula = NULL) } \arguments{ \item{data}{...
/man/bootcurve.Rd
no_license
ddarmon/confcurve
R
false
true
884
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/confcurve.R \name{bootcurve} \alias{bootcurve} \title{Generate bootstrap samples for computation of confidence curves and related inferential statistics.} \usage{ bootcurve(data, statistic, B = 2000, formula = NULL) } \arguments{ \item{data}{...
library("sqldf") # Question Two - Select only data for the probability weights pwgtp1 # with ages less than 50 url <- "https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06pid.csv" f <- file.path(getwd(), "ss06pid.csv") download.file(url, f) acs <- data.table::data.table(read.csv(f)) # Answer: query1 <- sqldf...
/Tidy_Data_Week_2_quiz_reading_different_file_types.R
no_license
samuelfinnerty/datasciencecoursera
R
false
false
1,913
r
library("sqldf") # Question Two - Select only data for the probability weights pwgtp1 # with ages less than 50 url <- "https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06pid.csv" f <- file.path(getwd(), "ss06pid.csv") download.file(url, f) acs <- data.table::data.table(read.csv(f)) # Answer: query1 <- sqldf...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/visualize.R \name{visualize.default} \alias{visualize.default} \title{Visualize a fitted model} \usage{ \method{visualize}{default}(object, plot = c("all", "residuals", "model"), formula = NULL, ...) } \arguments{ \item{object}{a lmer objec...
/man/visualize.default.Rd
no_license
vandenman/flexplot
R
false
true
530
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/visualize.R \name{visualize.default} \alias{visualize.default} \title{Visualize a fitted model} \usage{ \method{visualize}{default}(object, plot = c("all", "residuals", "model"), formula = NULL, ...) } \arguments{ \item{object}{a lmer objec...
library(testthat) library(riceware) test_check("riceware")
/tests/testthat.R
no_license
fmichonneau/riceware
R
false
false
60
r
library(testthat) library(riceware) test_check("riceware")
dyad.se.helper <- function(fit,dyad.mat,iUp,sw) { if(length(iUp) == 1) { clusUp <- as.numeric(iUp == dyad.mat$ego) + as.numeric(iUp == dyad.mat$alter) clusIndexUp <- clusUp*-99 + (1-clusUp)*1:nrow(dyad.mat) } else if(length(iUp) == nrow(sw)) { clusIndexUp <- iUp } else { stop("Dyad ID issue...
/R/utils.R
no_license
prodriguezsosa/dyadRobust
R
false
false
633
r
dyad.se.helper <- function(fit,dyad.mat,iUp,sw) { if(length(iUp) == 1) { clusUp <- as.numeric(iUp == dyad.mat$ego) + as.numeric(iUp == dyad.mat$alter) clusIndexUp <- clusUp*-99 + (1-clusUp)*1:nrow(dyad.mat) } else if(length(iUp) == nrow(sw)) { clusIndexUp <- iUp } else { stop("Dyad ID issue...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/vignette.R \name{rnw} \alias{rnw} \alias{isManualVignette} \alias{as.rnw} \alias{rnwCompiler} \alias{rnwWrapper} \alias{rnwDriver} \alias{rnwIncludes} \alias{rnwChildren} \alias{vignetteMakefile} \alias{compactVignettes} \title{Utilities for ...
/man/vignette.Rd
no_license
Bhanditz/pkgmaker
R
false
true
4,409
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/vignette.R \name{rnw} \alias{rnw} \alias{isManualVignette} \alias{as.rnw} \alias{rnwCompiler} \alias{rnwWrapper} \alias{rnwDriver} \alias{rnwIncludes} \alias{rnwChildren} \alias{vignetteMakefile} \alias{compactVignettes} \title{Utilities for ...
# # hack to make sure its not run during package loading # if(FALSE){ #' @export getX <- function(K, N){ t(qlogis((K + 0.5)/(N + 1))) } #' @export numericLossGrad <- function(fn, epsilon, w, ..., BPPARAM=bpparam()){ grad <- unlist(bplapply(seq_along(w), fn=fn, w=w, epsilon=epsilon, ..., BPPARAM=BPPARAM, funct...
/R/gradient_loss_R.R
no_license
ischeller/FraseR
R
false
false
11,255
r
# # hack to make sure its not run during package loading # if(FALSE){ #' @export getX <- function(K, N){ t(qlogis((K + 0.5)/(N + 1))) } #' @export numericLossGrad <- function(fn, epsilon, w, ..., BPPARAM=bpparam()){ grad <- unlist(bplapply(seq_along(w), fn=fn, w=w, epsilon=epsilon, ..., BPPARAM=BPPARAM, funct...
extract_selected_sites <- function(sourceDir, destDir, varName, siteDF, user.region.name) { #### Create output folder if(!dir.exists(destDir)) { dir.create(de...
/functions/Adriano/extract_selected_sites.R
no_license
mingkaijiang/Australia_drought_storm_risk
R
false
false
2,262
r
extract_selected_sites <- function(sourceDir, destDir, varName, siteDF, user.region.name) { #### Create output folder if(!dir.exists(destDir)) { dir.create(de...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_graph_log.R \name{get_graph_log} \alias{get_graph_log} \title{Get the graph log information} \usage{ get_graph_log(graph) } \arguments{ \item{graph}{A graph object of class \code{dgr_graph}.} } \value{ A \code{df_tbl} object. } \descripti...
/man/get_graph_log.Rd
permissive
rich-iannone/DiagrammeR
R
false
true
857
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_graph_log.R \name{get_graph_log} \alias{get_graph_log} \title{Get the graph log information} \usage{ get_graph_log(graph) } \arguments{ \item{graph}{A graph object of class \code{dgr_graph}.} } \value{ A \code{df_tbl} object. } \descripti...
#' Show interactive projection plot #' #' @param projection COVID-19 projection. #' @param value Whether to plot daily incidence or cumulative incidence. Valid values are "daily" and "cumulative". #' #' @importFrom rlang arg_match #' @importFrom glue glue #' @importFrom highcharter hchart hcaes hc_add_series hc_xAxis h...
/R/show_projection_i.R
no_license
dateam-jds/pikobar
R
false
false
2,867
r
#' Show interactive projection plot #' #' @param projection COVID-19 projection. #' @param value Whether to plot daily incidence or cumulative incidence. Valid values are "daily" and "cumulative". #' #' @importFrom rlang arg_match #' @importFrom glue glue #' @importFrom highcharter hchart hcaes hc_add_series hc_xAxis h...
## ---- include = FALSE--------------------------------------------------------- knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ## ----setup-------------------------------------------------------------------- library(readr) ## -----------------------------------------------------------------------------...
/inst/doc/column-types.R
no_license
cran/readr
R
false
false
1,041
r
## ---- include = FALSE--------------------------------------------------------- knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ## ----setup-------------------------------------------------------------------- library(readr) ## -----------------------------------------------------------------------------...
source('/imppc/labs/lplab/share/marc/repos/ergWgsTools/tmp/variables.R') library(devtools) devtools::load_all('/imppc/labs/lplab/share/marc/repos/ergWgsTools') threads <- parallel::detectCores() args <- commandArgs(trailingOnly = TRUE) inputFile <- args[1] outPath <- args[2] threads <- args[3] mosdepth(inputFile=inp...
/tmp/mosdepth.R
no_license
msubirana/ergWgsTools
R
false
false
380
r
source('/imppc/labs/lplab/share/marc/repos/ergWgsTools/tmp/variables.R') library(devtools) devtools::load_all('/imppc/labs/lplab/share/marc/repos/ergWgsTools') threads <- parallel::detectCores() args <- commandArgs(trailingOnly = TRUE) inputFile <- args[1] outPath <- args[2] threads <- args[3] mosdepth(inputFile=inp...
# Installing packages ----------------------------------------------------------------------------------------------------------------- #install.packages("mice") #install.packages("readxl") #install.packages("devtools") #install.packages("dplyr") #install.packages("plyr") # Loading packages -------------------------...
/Multiple_ImputationSubset.R
no_license
ambervdmeijs/MastersThesis-DataImputation-AvdM
R
false
false
50,303
r
# Installing packages ----------------------------------------------------------------------------------------------------------------- #install.packages("mice") #install.packages("readxl") #install.packages("devtools") #install.packages("dplyr") #install.packages("plyr") # Loading packages -------------------------...
source("code/gaf_tools.r") reduce_nr_data <- function(annot_file,gold){ tool_data = read_gaf(annot_file) tool_data = gaf_check_simple(go_obo,tool_data) tool_data = tool_data[order(db_object_symbol,term_accession)] tool_data = tool_data[grep("AC|GRMZM",db_object_symbol)] setkey(tool_data,db_object_s...
/code/R/sample_tools.r
permissive
Dill-PICL/GOMAP
R
false
false
650
r
source("code/gaf_tools.r") reduce_nr_data <- function(annot_file,gold){ tool_data = read_gaf(annot_file) tool_data = gaf_check_simple(go_obo,tool_data) tool_data = tool_data[order(db_object_symbol,term_accession)] tool_data = tool_data[grep("AC|GRMZM",db_object_symbol)] setkey(tool_data,db_object_s...
#' Process incoming messages #' #' This function is only used for processing incoming messages. #' #' @param in_msg #' @param ib_con #' #' @return used for processing incoming messages. Called for it's side-effects. #' @keywords internal #' ProcessMsg <- function(in_msg, ib_con) { msg_counter <- counter() msgId <-...
/R/decode_messages.R
permissive
pverspeelt/ibapir
R
false
false
1,774
r
#' Process incoming messages #' #' This function is only used for processing incoming messages. #' #' @param in_msg #' @param ib_con #' #' @return used for processing incoming messages. Called for it's side-effects. #' @keywords internal #' ProcessMsg <- function(in_msg, ib_con) { msg_counter <- counter() msgId <-...
### Adapted from a file produced by Prof. Jay Emerson used in ### Introductory Data Analysis (STAT 230), Spring 2016 library(dplyr) # Get date materials today <- unclass(as.POSIXlt(Sys.time())) year <- 1900 + today$year month <- 1 + today$mon day <- today$mday # Stripwhite function stripwhite <- function(x) gsub("\\...
/ncaa_hoops_scraper.R
no_license
degengambla/NCAA_Hoops
R
false
false
5,387
r
### Adapted from a file produced by Prof. Jay Emerson used in ### Introductory Data Analysis (STAT 230), Spring 2016 library(dplyr) # Get date materials today <- unclass(as.POSIXlt(Sys.time())) year <- 1900 + today$year month <- 1 + today$mon day <- today$mday # Stripwhite function stripwhite <- function(x) gsub("\\...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/assign_defaults.R \name{assign_defaults} \alias{assign_defaults} \alias{assign_defaults_addin} \title{Set function arguments to defaults} \usage{ assign_defaults_addin() assign_defaults(fun) } \arguments{ \item{fun}{A function object or a ch...
/man/assign_defaults.Rd
no_license
rmflight/jadd
R
false
true
1,404
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/assign_defaults.R \name{assign_defaults} \alias{assign_defaults} \alias{assign_defaults_addin} \title{Set function arguments to defaults} \usage{ assign_defaults_addin() assign_defaults(fun) } \arguments{ \item{fun}{A function object or a ch...
score_pdss <- function(long_survey_data_filtered, gender_mix='mf', gendercode=c(m=1,f=0)){ #`gender` can be c('mixed','m','f') where 'm' and 'f' assumes # homogeneous gender of either males of females. # # Takes a long survey data frame with colums # "SID" "item" "value" "survey_name" # !! Import...
/behavioral/surveys/score-qualtrics/score_pds.r
no_license
brendanhcullen/REV_scripts
R
false
false
9,459
r
score_pdss <- function(long_survey_data_filtered, gender_mix='mf', gendercode=c(m=1,f=0)){ #`gender` can be c('mixed','m','f') where 'm' and 'f' assumes # homogeneous gender of either males of females. # # Takes a long survey data frame with colums # "SID" "item" "value" "survey_name" # !! Import...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tbl_xdf.R \name{deleteXdfTbls} \alias{deleteXdfTbls} \title{Delete data files for xdf tbls} \usage{ deleteXdfTbls(path, fileSystem = rxGetFileSystem()) } \arguments{ \item{path}{Directory where the files are located. Defaults to the temporary...
/man/deleteXdfTbls.Rd
no_license
yueguoguo/dplyrXdf
R
false
true
662
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tbl_xdf.R \name{deleteXdfTbls} \alias{deleteXdfTbls} \title{Delete data files for xdf tbls} \usage{ deleteXdfTbls(path, fileSystem = rxGetFileSystem()) } \arguments{ \item{path}{Directory where the files are located. Defaults to the temporary...
#these functions require the following libraries #library(proxy) #dist #library(fastcluster) #for(i in list.files(path="F:/DATA/R/my_functions",full.names = T)){source(i)} ################################# #function in db_build get_MarkMatrix=function(position_info,dbhandle,target_cell_type,target_markers){ #create ...
/3Main_Processing/HicChipRNACor_functionPack.r
no_license
Arthurhe/ChIP-RNA-HiC-correlations
R
false
false
17,399
r
#these functions require the following libraries #library(proxy) #dist #library(fastcluster) #for(i in list.files(path="F:/DATA/R/my_functions",full.names = T)){source(i)} ################################# #function in db_build get_MarkMatrix=function(position_info,dbhandle,target_cell_type,target_markers){ #create ...
.libPaths("O:/paths") #set library path library('tidyverse') #load tidyverse library(gridExtra) #load gridExtra library(ggpubr) library(ggsignif) library(reshape2) ## spontaneous frequencies #import csv file of results df1 <- read_csv("trimmed-Seedpixel_0-1hz_frequency-animal-ave.csv") df1 <- df1 %>% ...
/trimmed-seedpixel.R
no_license
cx749/Thesis-statistic-in-R
R
false
false
3,835
r
.libPaths("O:/paths") #set library path library('tidyverse') #load tidyverse library(gridExtra) #load gridExtra library(ggpubr) library(ggsignif) library(reshape2) ## spontaneous frequencies #import csv file of results df1 <- read_csv("trimmed-Seedpixel_0-1hz_frequency-animal-ave.csv") df1 <- df1 %>% ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{futbol} \alias{futbol} \title{Dataset futbol} \format{ A data frame with 300 rows and 2 variables: \describe{ \item{longp}{category of leg length} \item{dist}{kick distance} } } \source{ Unknown } \usage{ futbo...
/man/futbol.Rd
no_license
mpru/ggcleveland
R
false
true
426
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{futbol} \alias{futbol} \title{Dataset futbol} \format{ A data frame with 300 rows and 2 variables: \describe{ \item{longp}{category of leg length} \item{dist}{kick distance} } } \source{ Unknown } \usage{ futbo...
#Provides barplot of counts per library colored by tags and sorted by total counts. summarize_barnon_plot <- function(df, datadir=getwd(), format = '.pdf'){ #df is the output file by running function = tidy_bar.R library(GGally) library(tidyverse) library(gridExtra) #Library size overview p1 <- df %>...
/R/summarize_plot.R
no_license
GreshamLab/bartools
R
false
false
2,135
r
#Provides barplot of counts per library colored by tags and sorted by total counts. summarize_barnon_plot <- function(df, datadir=getwd(), format = '.pdf'){ #df is the output file by running function = tidy_bar.R library(GGally) library(tidyverse) library(gridExtra) #Library size overview p1 <- df %>...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/verify_codes.R \name{verify_post_code} \alias{verify_post_code} \title{Verify Post Code} \usage{ verify_post_code(post_code = NULL) } \arguments{ \item{post_code}{character vector of post codes} } \value{ a logical vector } \description{ Veri...
/man/verify_post_code.Rd
no_license
CC-HIC/inspectEHR
R
false
true
912
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/verify_codes.R \name{verify_post_code} \alias{verify_post_code} \title{Verify Post Code} \usage{ verify_post_code(post_code = NULL) } \arguments{ \item{post_code}{character vector of post codes} } \value{ a logical vector } \description{ Veri...
#data preparation data <- read.csv("hour.csv",T,sep=",") head(data) data.2011 <- data[which(data$yr==0),] dim(data.2011) ##2011## N <- 800 set.seed(6) random <- sample(1:8645,replace=FALSE,size=800) data.2011 <- data.2011[random,-c(1,2,4,5,8,12,15,16)] dim(data.2011) attach(data.2011) #creating dummy vari...
/Codes.R
no_license
oltuluorcun/LinearModels
R
false
false
8,038
r
#data preparation data <- read.csv("hour.csv",T,sep=",") head(data) data.2011 <- data[which(data$yr==0),] dim(data.2011) ##2011## N <- 800 set.seed(6) random <- sample(1:8645,replace=FALSE,size=800) data.2011 <- data.2011[random,-c(1,2,4,5,8,12,15,16)] dim(data.2011) attach(data.2011) #creating dummy vari...
#' mtd: a package for fitting univariate non-Gaussian time series #' using mixture transition distribution (MTD) models #' #' The mtd package provides four categories of functions: #' model simulation, model fitting, model checking and model prediction. #' #' @section Model simulation: #' The \code{\link{rMTD}} func...
/R/mtd-package.R
no_license
xzheng42/mtd
R
false
false
1,096
r
#' mtd: a package for fitting univariate non-Gaussian time series #' using mixture transition distribution (MTD) models #' #' The mtd package provides four categories of functions: #' model simulation, model fitting, model checking and model prediction. #' #' @section Model simulation: #' The \code{\link{rMTD}} func...
## r script for running Hver production ## #load in library(chron) options(stringsAsFactors = F) library(ggplot2) theme_set(theme_classic()) #import raw data hengill_full <- read.table(file = './hengill_full.txt', header= T, sep = "\t", quote = "", strip.white = T, check.names = F, row.names = 1) #subset to just ...
/st7_prod.R
permissive
jimjunker1/SFS2017
R
false
false
8,376
r
## r script for running Hver production ## #load in library(chron) options(stringsAsFactors = F) library(ggplot2) theme_set(theme_classic()) #import raw data hengill_full <- read.table(file = './hengill_full.txt', header= T, sep = "\t", quote = "", strip.white = T, check.names = F, row.names = 1) #subset to just ...
library(forecast) library(tseries) library(ggplot2) db=read.csv("bookings",header=T,sep=";") #db=db[!db$Proveedor=="",] #Quitamos las entradas que tienen el campo proveedor vacío db$Diasemana= factor(db$Diasemana,levels(db$Diasemana)[c(3,4,5,2,7,1,6)]) #Ordena los niveles de los días por su orden en la semana db$Mes...
/Machine Learning/serie temporal.R
no_license
Xmael/R
R
false
false
5,564
r
library(forecast) library(tseries) library(ggplot2) db=read.csv("bookings",header=T,sep=";") #db=db[!db$Proveedor=="",] #Quitamos las entradas que tienen el campo proveedor vacío db$Diasemana= factor(db$Diasemana,levels(db$Diasemana)[c(3,4,5,2,7,1,6)]) #Ordena los niveles de los días por su orden en la semana db$Mes...
############################## #### AKI - Data Extraction#### ############################## rm(list=ls()) gc() source("./R/util.R") #load libraries require_libraries(c("DBI", "tidyr", "dplyr", "magrittr", "stringr", ...
/R/data_extract.R
permissive
kumc-bmi/AKI_CDM
R
false
false
12,455
r
############################## #### AKI - Data Extraction#### ############################## rm(list=ls()) gc() source("./R/util.R") #load libraries require_libraries(c("DBI", "tidyr", "dplyr", "magrittr", "stringr", ...
#Merges the training and the test sets to create one data set. #Read test files # Read txt files with names of the form "*test.txt" testfiles = list.files(path="./UCI HAR Dataset/test", pattern= '*test.txt') # Read txt files into a data list and transform it into a data frame testdir ="./UCI HAR Data...
/run_analysis.R
no_license
Jiling2019/GettingCleaningDataProject
R
false
false
2,119
r
#Merges the training and the test sets to create one data set. #Read test files # Read txt files with names of the form "*test.txt" testfiles = list.files(path="./UCI HAR Dataset/test", pattern= '*test.txt') # Read txt files into a data list and transform it into a data frame testdir ="./UCI HAR Data...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/methods_prop_df.R \name{summary.prop_df} \alias{summary.prop_df} \title{Summarize a \code{prop_df} object as a table} \usage{ \method{summary}{prop_df}(object) } \arguments{ \item{object}{an object of class \code{prop_df}.} } \value{ A \code{...
/man/summary.prop_df.Rd
permissive
multinormal/fhi.informed-health-choices-norway.2019
R
false
true
438
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/methods_prop_df.R \name{summary.prop_df} \alias{summary.prop_df} \title{Summarize a \code{prop_df} object as a table} \usage{ \method{summary}{prop_df}(object) } \arguments{ \item{object}{an object of class \code{prop_df}.} } \value{ A \code{...
createMatrixfromGSE<-function() { GSEdataSet<-readline("Please enter the GSE data set identifier: ") if(findPack("limma")==FALSE) { library("limma") } else if (findPack("affy")==FALSE) { library("affy") } else if (findPack("GEOquery")==FALSE) { library("GEOquery") } geoSet<-suppressWarnings(getGEO(GSEdataSet, G...
/R/createMatrixfromGSE.R
no_license
uwazac/Array-Functions
R
false
false
1,241
r
createMatrixfromGSE<-function() { GSEdataSet<-readline("Please enter the GSE data set identifier: ") if(findPack("limma")==FALSE) { library("limma") } else if (findPack("affy")==FALSE) { library("affy") } else if (findPack("GEOquery")==FALSE) { library("GEOquery") } geoSet<-suppressWarnings(getGEO(GSEdataSet, G...
.sparseVARX = function(j, y, x, p, b, Z, y.spec, x.spec, alpha) { colIndex = j[1] x.to.remove = which(!x.spec[colIndex,]) y.to.remove = which(!y.spec[colIndex,]) np = ncol(y) * p z.x.to.remove = c() z.y.to.remove = c() if(length(x.to.remove) > 0) { z.x.to.remove = as.vector(sapply(1:b, function(ii) { ...
/R/SparseVARX.R
no_license
kwjusu1/fastVAR
R
false
false
7,616
r
.sparseVARX = function(j, y, x, p, b, Z, y.spec, x.spec, alpha) { colIndex = j[1] x.to.remove = which(!x.spec[colIndex,]) y.to.remove = which(!y.spec[colIndex,]) np = ncol(y) * p z.x.to.remove = c() z.y.to.remove = c() if(length(x.to.remove) > 0) { z.x.to.remove = as.vector(sapply(1:b, function(ii) { ...
#' Virtual S4 class for all tensor objects #' #' The \code{tensor} class is a base virtual tensor class for objects in this #' repository. #' @keywords internal setClass("tensor", contains = "VIRTUAL") #' An S4 class for a sparse tensor #' #' Stores the tensor in co-ordinate (COO) format. Non-zero entries are stored #...
/R/all-classes.r
no_license
zamorarr/tensorr
R
false
false
2,233
r
#' Virtual S4 class for all tensor objects #' #' The \code{tensor} class is a base virtual tensor class for objects in this #' repository. #' @keywords internal setClass("tensor", contains = "VIRTUAL") #' An S4 class for a sparse tensor #' #' Stores the tensor in co-ordinate (COO) format. Non-zero entries are stored #...
cat("\014") library(parallel) NCORES = detectCores() NINDIV = NCORES source("DataSimulation.R") runMCMC <- function(x){ library(nimble) # SOURCE DATA SIMULATION AND INPUT SCRIPT ( REFERENCED IN DATASIMULATION ) source("DataSimulation.R", local = TRUE) mcmc.out <- nimbleMCMC( code = nimCode, consta...
/src/test/R/Individual/ModelFitting.R
no_license
pmahon3/UWO-MOTUS-Analysis
R
false
false
669
r
cat("\014") library(parallel) NCORES = detectCores() NINDIV = NCORES source("DataSimulation.R") runMCMC <- function(x){ library(nimble) # SOURCE DATA SIMULATION AND INPUT SCRIPT ( REFERENCED IN DATASIMULATION ) source("DataSimulation.R", local = TRUE) mcmc.out <- nimbleMCMC( code = nimCode, consta...
#' Create cards for the tinyslider carousel #' #' @param title Title of the card #' @param subtitle Subtitle of the card #' @param content Text of the card #' @param button_text Display some text inside a button placed at the bottom of the card. If `NULL`, the button is not created. #' @param image An image to place on...
/R/tinyslider_card.R
permissive
etiennebacher/tinyslider
R
false
false
2,689
r
#' Create cards for the tinyslider carousel #' #' @param title Title of the card #' @param subtitle Subtitle of the card #' @param content Text of the card #' @param button_text Display some text inside a button placed at the bottom of the card. If `NULL`, the button is not created. #' @param image An image to place on...
SimulateAR1 <- function(n, phi){ sde <- sqrt(1-phi^2) e<-rnorm(n, sd=sde) #variance of time series will be 1 u<-numeric(n) u[1]<-rnorm(1) for (i in 2:n) u[i] <- phi*u[i-1] + e[i] u }
/pRSR/R/SimulateAR1.R
no_license
ingted/R-Examples
R
false
false
199
r
SimulateAR1 <- function(n, phi){ sde <- sqrt(1-phi^2) e<-rnorm(n, sd=sde) #variance of time series will be 1 u<-numeric(n) u[1]<-rnorm(1) for (i in 2:n) u[i] <- phi*u[i-1] + e[i] u }
############################################################################## ##### Subdistribution Hazard Models for Competing Risks in Discrete Time ##### ##### Electronic Supplement ##### ############################################################################## ...
/Simulation/simulation_II.R
no_license
MahmudRahman/SubDistDiscSurvival
R
false
false
5,683
r
############################################################################## ##### Subdistribution Hazard Models for Competing Risks in Discrete Time ##### ##### Electronic Supplement ##### ############################################################################## ...
power <- read.table("household_power_consumption.txt",skip=1,sep=";") names(power) <- c("Date","Time","Global_active_power","Global_reactive_power","Voltage","Global_intensity","Sub_metering_1","Sub_metering_2","Sub_metering_3") subpower <- subset(power,power$Date=="1/2/2007" | power$Date =="2/2/2007") # Transforming ...
/plot3.R
no_license
vedantmanu/EDA-WEEK-1-PROJECT
R
false
false
1,220
r
power <- read.table("household_power_consumption.txt",skip=1,sep=";") names(power) <- c("Date","Time","Global_active_power","Global_reactive_power","Voltage","Global_intensity","Sub_metering_1","Sub_metering_2","Sub_metering_3") subpower <- subset(power,power$Date=="1/2/2007" | power$Date =="2/2/2007") # Transforming ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data-movie.R \docType{data} \name{movie_368} \alias{movie_368} \title{Indiana Jones and the Temple of Doom} \format{ igraph object } \source{ https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/T4HBA3 https://www.imdb.co...
/man/movie_368.Rd
permissive
schochastics/networkdata
R
false
true
1,055
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data-movie.R \docType{data} \name{movie_368} \alias{movie_368} \title{Indiana Jones and the Temple of Doom} \format{ igraph object } \source{ https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/T4HBA3 https://www.imdb.co...
#Seurat library("Seurat") library("cowplot") #library("Matrix") #library("magrittr") library("dplyr") #not installed on Fameux #library("pryr") #library("svglite") ####### #Load and label ####### ### #mLN ### #Label mLN cells with 1_1 & 1_2 #Experiment 2 sample_1_2.data <- Read10X(data.dir = "/home/pezoldt/NAS2/pezol...
/UPDE/scRNAseq/seurat/Commensal_LN/2018-10-18_mLN_pLN_SPF.R
no_license
jpezoldt/UDPE
R
false
false
44,508
r
#Seurat library("Seurat") library("cowplot") #library("Matrix") #library("magrittr") library("dplyr") #not installed on Fameux #library("pryr") #library("svglite") ####### #Load and label ####### ### #mLN ### #Label mLN cells with 1_1 & 1_2 #Experiment 2 sample_1_2.data <- Read10X(data.dir = "/home/pezoldt/NAS2/pezol...
Das ist die dritte Datei library(ODBC) neue änderung von mir ja mir und jetzt die letzte änderung
/dritteDatei.R
no_license
realricci/testrepo
R
false
false
102
r
Das ist die dritte Datei library(ODBC) neue änderung von mir ja mir und jetzt die letzte änderung
##install&require packages packages<-function(x){ x<-as.character(match.call()[[2]]) if (!require(x,character.only=TRUE)){ install.packages(pkgs=x,repos="http://cran.r-project.org") require(x,character.only=TRUE) } else { require(x,character.only=TRUE) } } options(expressions=500000) setTimeL...
/AEGIS_package/ui.R
no_license
JaehyeongCho/AEGIS_daily
R
false
false
26,929
r
##install&require packages packages<-function(x){ x<-as.character(match.call()[[2]]) if (!require(x,character.only=TRUE)){ install.packages(pkgs=x,repos="http://cran.r-project.org") require(x,character.only=TRUE) } else { require(x,character.only=TRUE) } } options(expressions=500000) setTimeL...
tab_model(best.model.a.1, pred.labels = c("Intercept", "Alien Status - Alien","Aspect Ratio", "Tank Size", "Predator Mass", "Prey Mass", "Temperature", "Habitat - Marine", "Alien : Temperature", "Aspect Ratio : Predator Size", ...
/get model tables.R
no_license
hezibu/frma
R
false
false
1,234
r
tab_model(best.model.a.1, pred.labels = c("Intercept", "Alien Status - Alien","Aspect Ratio", "Tank Size", "Predator Mass", "Prey Mass", "Temperature", "Habitat - Marine", "Alien : Temperature", "Aspect Ratio : Predator Size", ...
library("seqinr") getncbiseq <- function(accession) { # retrieve sequence from NCBI via accession number # e.g. dengueseq <- getncbiseq("NC_001477") require("seqinr") # this function requires the SeqinR R package # first find which ACNUC database the accession is stored in: dbs <- c("genbank","refseq",...
/get-ncbi-seq.R
no_license
cmrn-rhi/R-genome-practice
R
false
false
956
r
library("seqinr") getncbiseq <- function(accession) { # retrieve sequence from NCBI via accession number # e.g. dengueseq <- getncbiseq("NC_001477") require("seqinr") # this function requires the SeqinR R package # first find which ACNUC database the accession is stored in: dbs <- c("genbank","refseq",...
#' Tier S4 class for Praat TextGrids. #' #' The \code{Tier} class is extended by the \code{\link[=PointTier-class]{PointTier}} #' and \code{\link[=IntervalTier-class]{IntervalTier}} classes. As such, the #' \code{Tier} class encapsulates only very general information that is common #' to both subtypes of tier-like obj...
/R/Tier-class.R
no_license
M-Lancien/textgRid
R
false
false
699
r
#' Tier S4 class for Praat TextGrids. #' #' The \code{Tier} class is extended by the \code{\link[=PointTier-class]{PointTier}} #' and \code{\link[=IntervalTier-class]{IntervalTier}} classes. As such, the #' \code{Tier} class encapsulates only very general information that is common #' to both subtypes of tier-like obj...
library(waffle) setwd("~/p.Diss/Papers_to_be_eingebunden") #Eurostat NRG_100a & 107a Gross inland consumption in Terajoule #2015 EU28 #Color palet from http://colorbrewer2.org <3 total<-c("Solid fuels (11 EJ)"=11006039, "Total petroleum (23 EJ)"=23441554, "Gas (15 EJ)"=14984951, "Nuclear he...
/waffleplot.R
no_license
schipfer/provenGraphs
R
false
false
1,436
r
library(waffle) setwd("~/p.Diss/Papers_to_be_eingebunden") #Eurostat NRG_100a & 107a Gross inland consumption in Terajoule #2015 EU28 #Color palet from http://colorbrewer2.org <3 total<-c("Solid fuels (11 EJ)"=11006039, "Total petroleum (23 EJ)"=23441554, "Gas (15 EJ)"=14984951, "Nuclear he...
/软件度量/h3/calculate.R
no_license
abbycc/course
R
false
false
1,598
r
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/501.Error-Failure_LimitBased_BASE_All.R \name{errAll} \alias{errAll} \title{Calculates error, long term power and pass/fail criteria using 6 base methods (Wald, Wald-T, Likelihood, Score, Logit-Wald, ArcSine)} \usage{ errAll(n, alp, phi, f) }...
/man/errAll.Rd
no_license
RajeswaranV/proportion
R
false
true
1,781
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/501.Error-Failure_LimitBased_BASE_All.R \name{errAll} \alias{errAll} \title{Calculates error, long term power and pass/fail criteria using 6 base methods (Wald, Wald-T, Likelihood, Score, Logit-Wald, ArcSine)} \usage{ errAll(n, alp, phi, f) }...
#est. E(X^4) by monte carlo f<-function(x){ 1/sqrt(2*pi)*(x^4)*exp(-x^2/2) } I<-integrate(f,-Inf,Inf)$value plot(x=seq(0.01,5,0.01),y=f(seq(0.01,5,0.01))) #with U(0,1) n<-1e04;b<-10 #integrate(f,10,Inf) I_Muni<-2*sum(f(runif(n,0,b)))*b/n confi.of.I_Muni<-function(N,alpha){ x<-rep(0,N) for(i in 1:N){ x[i]<-x[i]+2...
/hw04/HW04.R
no_license
oicjacky/Statistical-Computing
R
false
false
2,548
r
#est. E(X^4) by monte carlo f<-function(x){ 1/sqrt(2*pi)*(x^4)*exp(-x^2/2) } I<-integrate(f,-Inf,Inf)$value plot(x=seq(0.01,5,0.01),y=f(seq(0.01,5,0.01))) #with U(0,1) n<-1e04;b<-10 #integrate(f,10,Inf) I_Muni<-2*sum(f(runif(n,0,b)))*b/n confi.of.I_Muni<-function(N,alpha){ x<-rep(0,N) for(i in 1:N){ x[i]<-x[i]+2...
##PH525.2x ## Week 4 exercises list.of.packages <- c("contrast", "UsingR","rafalib") new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])] if(length(new.packages)) install.packages(new.packages) library(contrast) library(rafalib) species <- factor(c("A","A","B","B")) condition...
/2x-Linear-Models-and-Matrix-Algebra/Code/PH525-2x-Week4Ex contrasts.R
no_license
KuldeepSJadon/HDDA
R
false
false
8,592
r
##PH525.2x ## Week 4 exercises list.of.packages <- c("contrast", "UsingR","rafalib") new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])] if(length(new.packages)) install.packages(new.packages) library(contrast) library(rafalib) species <- factor(c("A","A","B","B")) condition...
## # Recode values in excel file from old product categories to new MOJO craegories # Assumes: # Predictive Markets Norms Database with Star Calculator.xlsx is in data dir of working dir # categoryMapping.csv is in working dir # openxlsx libray is installed # plyr library is installed # Open data files # Get excel lib...
/recodeConOpt.R
no_license
richshaw/categoryRecode
R
false
false
2,037
r
## # Recode values in excel file from old product categories to new MOJO craegories # Assumes: # Predictive Markets Norms Database with Star Calculator.xlsx is in data dir of working dir # categoryMapping.csv is in working dir # openxlsx libray is installed # plyr library is installed # Open data files # Get excel lib...
library('matrixStats', lib.loc="~/R/libs") library('Clomial', lib.loc="~/R/libs") args <- commandArgs(trailingOnly=TRUE) R <- read.table(args[1]) X <- read.table(args[2]) meta.log.likelihood <- function(Dc, Dt, Mu, P) { log.likelihood <- 0 for (i in 1:nrow(Mu)) { p <- (Mu[i, ]) %*% P p[p > 1] <- 1 l...
/scripts/calculate_BIC.R
permissive
snurk/meta-strains
R
false
false
1,581
r
library('matrixStats', lib.loc="~/R/libs") library('Clomial', lib.loc="~/R/libs") args <- commandArgs(trailingOnly=TRUE) R <- read.table(args[1]) X <- read.table(args[2]) meta.log.likelihood <- function(Dc, Dt, Mu, P) { log.likelihood <- 0 for (i in 1:nrow(Mu)) { p <- (Mu[i, ]) %*% P p[p > 1] <- 1 l...
#' @title Statistics on Soil Moisture State #' #' @param x `data.frame`, created by [`moistureStateProportions()`] #' @param id name of ID column #' #' @return `data.frame` containing the most-likely moisture state and Shannon entropy. #' @export #' moistureStateStats <- function(x, id = 'compname') { ...
/R/moistureStateProportions.R
no_license
cran/sharpshootR
R
false
false
2,107
r
#' @title Statistics on Soil Moisture State #' #' @param x `data.frame`, created by [`moistureStateProportions()`] #' @param id name of ID column #' #' @return `data.frame` containing the most-likely moisture state and Shannon entropy. #' @export #' moistureStateStats <- function(x, id = 'compname') { ...
library(parallel) start.time <- Sys.time() setwd("/MesonetData/") files <- scan("Files.txt", what ="", sep ="\n") #MTS files to read evaluateAg <- function(fLocation) { length <- nchar(fLocation) dateloc <- substr(fLocation, length-15, length-4) #Get station name and data date dframe <- read.csv(fLocat...
/UnFlyablePeriods.R
no_license
coopermor/Mesonet-Flyable
R
false
false
3,019
r
library(parallel) start.time <- Sys.time() setwd("/MesonetData/") files <- scan("Files.txt", what ="", sep ="\n") #MTS files to read evaluateAg <- function(fLocation) { length <- nchar(fLocation) dateloc <- substr(fLocation, length-15, length-4) #Get station name and data date dframe <- read.csv(fLocat...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/readnDSPA.R \name{readnDSPA} \alias{readnDSPA} \title{nDSPA} \usage{ readnDSPA(x, experiment = c("Protein", "RNA", "CTA"), meta = NULL) } \arguments{ \item{x}{character. Specify the file name in .tsv, .csv or .xlsx} \item{experiment}{charact...
/man/readnDSPA.Rd
no_license
Rohit-Satyam/nDSPA
R
false
true
916
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/readnDSPA.R \name{readnDSPA} \alias{readnDSPA} \title{nDSPA} \usage{ readnDSPA(x, experiment = c("Protein", "RNA", "CTA"), meta = NULL) } \arguments{ \item{x}{character. Specify the file name in .tsv, .csv or .xlsx} \item{experiment}{charact...
# Verilerin yüklenmesi AB_data <- read.csv("Data_agac.csv",header = TRUE,col.names = c("A","B")) AB_data # Verileri A ve B alanı olmak üzere iki kısma ayırın ve boş verileri atın (NA) alan_A <- AB_data$A alan_B <- na.omit(AB_data$B) # Tanımlayıcı istatistik summary(alan_A) summary(alan_B) # standart sapma ve varya...
/Biyometri.R
no_license
yegenek/Ekoloji_Ders
R
false
false
1,056
r
# Verilerin yüklenmesi AB_data <- read.csv("Data_agac.csv",header = TRUE,col.names = c("A","B")) AB_data # Verileri A ve B alanı olmak üzere iki kısma ayırın ve boş verileri atın (NA) alan_A <- AB_data$A alan_B <- na.omit(AB_data$B) # Tanımlayıcı istatistik summary(alan_A) summary(alan_B) # standart sapma ve varya...
library(LearningRlab) ### Name: median_ ### Title: Median Calculus Function ### Aliases: median_ ### Keywords: ~median ~mediana ### ** Examples { result = median_(c(1,3,2,5,12,4,4,2,9)) result }
/data/genthat_extracted_code/LearningRlab/examples/median_.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
203
r
library(LearningRlab) ### Name: median_ ### Title: Median Calculus Function ### Aliases: median_ ### Keywords: ~median ~mediana ### ** Examples { result = median_(c(1,3,2,5,12,4,4,2,9)) result }
\name{FastExpected} \alias{FastExpected} \title{Fast expected value function} \description{Approximate the expected value function using conditional expectaion matrices.} \usage{ FastExpected(grid, value, disturb, weight, r_index, smooth = 1) } \arguments{ \item{grid}{Matrix representing the grid. The i-th...
/man/FastExpected.Rd
no_license
cran/rcss
R
false
false
2,332
rd
\name{FastExpected} \alias{FastExpected} \title{Fast expected value function} \description{Approximate the expected value function using conditional expectaion matrices.} \usage{ FastExpected(grid, value, disturb, weight, r_index, smooth = 1) } \arguments{ \item{grid}{Matrix representing the grid. The i-th...
geoms_with_pattern_fill <- c('rect', 'polygon', 'path', 'circle') #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #' Construct a vector of styles related to 'stroke' #' #' Note: 1 lwd = 1/96", but units in rest of document are 1/72" #' #' @param state list including 'gc' (graphics cont...
/R/utils-style.R
permissive
coolbutuseless/devoutsvg
R
false
false
7,282
r
geoms_with_pattern_fill <- c('rect', 'polygon', 'path', 'circle') #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #' Construct a vector of styles related to 'stroke' #' #' Note: 1 lwd = 1/96", but units in rest of document are 1/72" #' #' @param state list including 'gc' (graphics cont...
library(ape) testtree <- read.tree("11333_0.txt") unrooted_tr <- unroot(testtree) write.tree(unrooted_tr, file="11333_0_unrooted.txt")
/codeml_files/newick_trees_processed/11333_0/rinput.R
no_license
DaniBoo/cyanobacteria_project
R
false
false
137
r
library(ape) testtree <- read.tree("11333_0.txt") unrooted_tr <- unroot(testtree) write.tree(unrooted_tr, file="11333_0_unrooted.txt")
# # # set_token( read.dcf("~/.googleAPI", fields = "MAPBOX")) # # df <- melbourne ## data.frame with encoded polylnies # df$elevation <- sample(100:5000, size = nrow(df)) # df$info <- paste0("<b>SA2 - </b><br>",df$SA2_NAME) # # l1 <- legend_element( # colours = colourvalues::colour_values(1:5) # , variables = letter...
/R/scratch.R
no_license
nemochina2008/mapdeck
R
false
false
2,659
r
# # # set_token( read.dcf("~/.googleAPI", fields = "MAPBOX")) # # df <- melbourne ## data.frame with encoded polylnies # df$elevation <- sample(100:5000, size = nrow(df)) # df$info <- paste0("<b>SA2 - </b><br>",df$SA2_NAME) # # l1 <- legend_element( # colours = colourvalues::colour_values(1:5) # , variables = letter...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/model_grid.R, R/train_model_grid.R \name{model_grid} \alias{model_grid} \alias{train.model_grid} \title{Pre-allocate an empty model grid} \usage{ model_grid() \method{train}{model_grid}(mg, train_all = FALSE, resample_seed = 123) }...
/man/model_grid.Rd
no_license
cran/modelgrid
R
false
true
2,830
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/model_grid.R, R/train_model_grid.R \name{model_grid} \alias{model_grid} \alias{train.model_grid} \title{Pre-allocate an empty model grid} \usage{ model_grid() \method{train}{model_grid}(mg, train_all = FALSE, resample_seed = 123) }...
library(Rcpp) sourceCpp("SMC_fast.cpp") PIMH_fast <- function(N, y, sv, sw, iters) { chain <- matrix(NA, iters+1, length(y)) marginal.ll <- numeric(iters+1) accept <- 0 u <- runif(iters) filtering_means <- matrix(NA, iters+1, length(y)) # step 1 (i = 0) s <- SMC_cpp(N, y, sv, sw) index <- sample(1:N, ...
/PIMH_fast.R
no_license
EllaKaye/PMCMC
R
false
false
1,208
r
library(Rcpp) sourceCpp("SMC_fast.cpp") PIMH_fast <- function(N, y, sv, sw, iters) { chain <- matrix(NA, iters+1, length(y)) marginal.ll <- numeric(iters+1) accept <- 0 u <- runif(iters) filtering_means <- matrix(NA, iters+1, length(y)) # step 1 (i = 0) s <- SMC_cpp(N, y, sv, sw) index <- sample(1:N, ...
####################################################################################################################### ### Determine where data on some Bundeslaender are missing, and manually add # Author: Sarah Kramer # Date: 20/11/2020 #################################################################################...
/src/manually_compile_missing_Bundeslaender.R
no_license
sarahckramer/daily_COVID_deaths_Germany
R
false
false
4,035
r
####################################################################################################################### ### Determine where data on some Bundeslaender are missing, and manually add # Author: Sarah Kramer # Date: 20/11/2020 #################################################################################...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data-movie.R \docType{data} \name{movie_599} \alias{movie_599} \title{Saving Private Ryan} \format{igraph object} \source{ https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/T4HBA3 https://www.imdb.com/title/tt0120815 }...
/man/movie_599.Rd
permissive
kjhealy/networkdata
R
false
true
1,019
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data-movie.R \docType{data} \name{movie_599} \alias{movie_599} \title{Saving Private Ryan} \format{igraph object} \source{ https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/T4HBA3 https://www.imdb.com/title/tt0120815 }...