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 |
|---|---|---|---|---|---|---|---|---|---|
\name{tr}
\alias{tr}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Trace of matrix
}
\description{
Computes the trace of a given matrix.
}
\usage{
tr(M)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{M}{
A matrix whose trace is to be computed.
}
... | /man/tr.Rd | no_license | cran/lmreg | R | false | false | 748 | rd | \name{tr}
\alias{tr}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Trace of matrix
}
\description{
Computes the trace of a given matrix.
}
\usage{
tr(M)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{M}{
A matrix whose trace is to be computed.
}
... |
#' @include Solver-class.R
NULL
#' Add solvers
#'
#' Specify the software and configuration used to solve a conservation planning
#' problem. By default, the best available
#' software currently installed on the system will be used.
#' For information on the performance of different solvers,
#' please see Schuster _et... | /R/solvers.R | no_license | prioritizr/prioritizr | R | false | false | 5,955 | r | #' @include Solver-class.R
NULL
#' Add solvers
#'
#' Specify the software and configuration used to solve a conservation planning
#' problem. By default, the best available
#' software currently installed on the system will be used.
#' For information on the performance of different solvers,
#' please see Schuster _et... |
book<- read.csv(file.choose())
View(book)
attach(book)
summary(book)
str(book)
# Association Rules
library(arules)
library(arulesViz)
# count of each item from all the transactions
barplot(sapply(book,sum),col=1:11)
# Applying apriori algorithm to get relevant rules
# Trial 1
rules <- apriori(... | /Association rules(Books data).R | no_license | vikasbevoor/Association-Rules-with-R | R | false | false | 1,162 | r | book<- read.csv(file.choose())
View(book)
attach(book)
summary(book)
str(book)
# Association Rules
library(arules)
library(arulesViz)
# count of each item from all the transactions
barplot(sapply(book,sum),col=1:11)
# Applying apriori algorithm to get relevant rules
# Trial 1
rules <- apriori(... |
#Author @ Mohammed 26/01/2017
#Load Libraries
source("Libraries.R")
data<-read.csv("FINALE_MOD_DATA_WITHOUT_NA.csv",header = T)
data<-data[,-1]
data<-data[,-5]
ndata<-data
View(head(ndata))
#======================================================================
#XGBOOST
#================================... | /LOGISTICC_ONXGBOOST.R | no_license | rajachanpreetsingh/UCI_NEW_IMPROVED | R | false | false | 2,971 | r | #Author @ Mohammed 26/01/2017
#Load Libraries
source("Libraries.R")
data<-read.csv("FINALE_MOD_DATA_WITHOUT_NA.csv",header = T)
data<-data[,-1]
data<-data[,-5]
ndata<-data
View(head(ndata))
#======================================================================
#XGBOOST
#================================... |
#!/usr/bin/Rscript
pdf("plot_pareto.pdf", family="Palatino")
par(mar=c(5,5,5,5))
jitfact=0.5
sizepts=0.25
offset=0.15
pchc=16
pchnc=20
cexc=1
cexnc=1
y0=25
x0=14
#skip=1 to begin reading after line 1
ig=read.table("ovoQ6/roc-enhancers-info.dat")
#legend(2/3*x0,2/3*y0,c("Felsen","Halpern"),fill=c("blue","red"))
n... | /figures/plaza/pareto/pareto_plot_manuscript.R | no_license | hedihamdi/thesis | R | false | false | 4,319 | r | #!/usr/bin/Rscript
pdf("plot_pareto.pdf", family="Palatino")
par(mar=c(5,5,5,5))
jitfact=0.5
sizepts=0.25
offset=0.15
pchc=16
pchnc=20
cexc=1
cexnc=1
y0=25
x0=14
#skip=1 to begin reading after line 1
ig=read.table("ovoQ6/roc-enhancers-info.dat")
#legend(2/3*x0,2/3*y0,c("Felsen","Halpern"),fill=c("blue","red"))
n... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plant_growth_mda.R
\docType{data}
\name{plant_growth_mda}
\alias{plant_growth_mda}
\title{Imaginary plant growth}
\format{An object of class \code{array} of dimension 6 x 12 x 3.}
\usage{
plant_growth_mda
}
\description{
Imaginary data for mo... | /man/plant_growth_mda.Rd | no_license | raefuhrman/262_Final_Package | R | false | true | 791 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plant_growth_mda.R
\docType{data}
\name{plant_growth_mda}
\alias{plant_growth_mda}
\title{Imaginary plant growth}
\format{An object of class \code{array} of dimension 6 x 12 x 3.}
\usage{
plant_growth_mda
}
\description{
Imaginary data for mo... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cov.hat.R
\docType{data}
\name{cov.hat}
\alias{cov.hat}
\title{A sample covariance matrix from the same distribution as t.hat and Xs}
\format{A 200x200 data frame}
\usage{
cov.hat
}
\description{
The population precrision matrix has 20 connec... | /man/cov.hat.Rd | no_license | cran/GraphKit | R | false | true | 378 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cov.hat.R
\docType{data}
\name{cov.hat}
\alias{cov.hat}
\title{A sample covariance matrix from the same distribution as t.hat and Xs}
\format{A 200x200 data frame}
\usage{
cov.hat
}
\description{
The population precrision matrix has 20 connec... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/model-tools.R
\name{enw_opts_as_data_list}
\alias{enw_opts_as_data_list}
\title{Format model options for use with stan}
\usage{
enw_opts_as_data_list(
dist = "lognormal",
nowcast = TRUE,
pp = FALSE,
likelihood = TRUE,
debug = FALSE,... | /man/enw_opts_as_data_list.Rd | permissive | laasousa/epinowcast | R | false | true | 1,571 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/model-tools.R
\name{enw_opts_as_data_list}
\alias{enw_opts_as_data_list}
\title{Format model options for use with stan}
\usage{
enw_opts_as_data_list(
dist = "lognormal",
nowcast = TRUE,
pp = FALSE,
likelihood = TRUE,
debug = FALSE,... |
#' Describe a `FluHMM' object
#'
#' This method prints various interesting information about the fitted FluHMM object: the
#' number of initial weeks fixed to the pre-epidemic phase (K), the probability that the
#' epidemic wave has begun, the three most likely first epidemic weeks, the probability that
#' peak intensi... | /R/describe.R | no_license | Kiki1017/FluHMM | R | false | false | 3,200 | r | #' Describe a `FluHMM' object
#'
#' This method prints various interesting information about the fitted FluHMM object: the
#' number of initial weeks fixed to the pre-epidemic phase (K), the probability that the
#' epidemic wave has begun, the three most likely first epidemic weeks, the probability that
#' peak intensi... |
source('pre_processing_census.R')
library(e1071)
classificator = svm(formula = income ~., data = training_base, type='C-classification', kernel = 'radial', cost = 1)
svm_predict = predict(classificator, newdata = test_base[-15])
confusion_matrix = table(test_base[,15], svm_predict)
library(caret)
confusionMatrix(... | /svm_census.R | no_license | thalesraymond/curso-r | R | false | false | 337 | r | source('pre_processing_census.R')
library(e1071)
classificator = svm(formula = income ~., data = training_base, type='C-classification', kernel = 'radial', cost = 1)
svm_predict = predict(classificator, newdata = test_base[-15])
confusion_matrix = table(test_base[,15], svm_predict)
library(caret)
confusionMatrix(... |
wdf2 <- df %>% select(USERS, COUNTRY) %>% group_by(COUNTRY, USERS) %>% summarise(n = n()) %>% filter(COUNTRY %in% c("USA", "China (PR)", "Russia", "Canada", "ESA", "Germany", "India", "Japan", "Multinational", "United Kingdom"), USERS %in% c("Civil", "Commercial", "Government", "Military"))
head(wdf2) | /02_DataWrangling/Wrangle2.R | no_license | Alice16/DV_RProject2 | R | false | false | 302 | r | wdf2 <- df %>% select(USERS, COUNTRY) %>% group_by(COUNTRY, USERS) %>% summarise(n = n()) %>% filter(COUNTRY %in% c("USA", "China (PR)", "Russia", "Canada", "ESA", "Germany", "India", "Japan", "Multinational", "United Kingdom"), USERS %in% c("Civil", "Commercial", "Government", "Military"))
head(wdf2) |
Reduce(intersect, lapply(df.gilman.list, function(df) as.character(df[,1])))
tmp.list = list(data.frame(v1=letters[1:5]), data.frame(v1=letters[6:10]), data.frame(v1=letters[c(2,7)]))
Reduce(intersect, lapply(tmp.list, function(df) as.character(df[,1])))
lapply(tmp.list, function(df) as.character(df[,1]))
if (lengt... | /src_test/test_intersect.R | no_license | pascaltimshel/temporal-brain-expression-scz | R | false | false | 467 | r | Reduce(intersect, lapply(df.gilman.list, function(df) as.character(df[,1])))
tmp.list = list(data.frame(v1=letters[1:5]), data.frame(v1=letters[6:10]), data.frame(v1=letters[c(2,7)]))
Reduce(intersect, lapply(tmp.list, function(df) as.character(df[,1])))
lapply(tmp.list, function(df) as.character(df[,1]))
if (lengt... |
uniq.tryptic.sequence <- function( raw.sequence ) {
## find the smallest tryptic fragment with the labeling sites
seq.vec <- unlist(strsplit(raw.sequence,""))
label.pos <- which(seq.vec=="*")
if ( length(label.pos) == 0 ) {
## no mod site, return center sequence
return( strsplit(raw.sequence,".",fixed=T... | /combine/combined.R | no_license | cravattlab/cimage-minimal | R | false | false | 7,669 | r | uniq.tryptic.sequence <- function( raw.sequence ) {
## find the smallest tryptic fragment with the labeling sites
seq.vec <- unlist(strsplit(raw.sequence,""))
label.pos <- which(seq.vec=="*")
if ( length(label.pos) == 0 ) {
## no mod site, return center sequence
return( strsplit(raw.sequence,".",fixed=T... |
##### Scenario-based Portfolio Optimization (scenportopt)
##### (c)2013-2014 Ronald Hochreiter <ron@hochreiter.net>
##### http://www.finance-r.com/
# set momentum parameters
momentum <- function(model, nmomentum, nmomentum.short=NULL) {
model$momentum.long <- nmomentum
model$momentum.short <- nmomentum.short
re... | /R/momentum.R | no_license | rhochreiter/scenportopt | R | false | false | 333 | r | ##### Scenario-based Portfolio Optimization (scenportopt)
##### (c)2013-2014 Ronald Hochreiter <ron@hochreiter.net>
##### http://www.finance-r.com/
# set momentum parameters
momentum <- function(model, nmomentum, nmomentum.short=NULL) {
model$momentum.long <- nmomentum
model$momentum.short <- nmomentum.short
re... |
doApostrophes <- function(x)
{
x <- gsub("\xe2\x80\x99","\x27",x)
x <- gsub("\xe2\x80\x9c","",x)
x <- gsub("\xe2\x80\x9d","",x)
x <- gsub("\xe2"," ",x)
x <- gsub("won't", "will not ", x)
x <- gsub("n't", " not ", x)
x <- gsub("'d", " would ", x)
x <- gsub("'ll", " will ", x)
x <- gs... | /utils.R | no_license | derickj/Capstone | R | false | false | 2,598 | r | doApostrophes <- function(x)
{
x <- gsub("\xe2\x80\x99","\x27",x)
x <- gsub("\xe2\x80\x9c","",x)
x <- gsub("\xe2\x80\x9d","",x)
x <- gsub("\xe2"," ",x)
x <- gsub("won't", "will not ", x)
x <- gsub("n't", " not ", x)
x <- gsub("'d", " would ", x)
x <- gsub("'ll", " will ", x)
x <- gs... |
#' Author: Ted Kwartler
#' Date: 2-14-2019
#' Purpose: OKCupid Case Supplemental
#'
# Libs
library(okcupiddata)
library(dplyr)
# Set WD
setwd()
# See all files in wd, leave this blank inside the parentheses
dir()
# Get the okcupid data as `profiles`
data('profiles')
latlon<- read.csv('LatLon.csv')
##### I would d... | /Cases/I Ok Cupid/Spring2019_OKcupid_supplemental.R | no_license | shorton278/Harvard-Data-Mining | R | false | false | 1,495 | r | #' Author: Ted Kwartler
#' Date: 2-14-2019
#' Purpose: OKCupid Case Supplemental
#'
# Libs
library(okcupiddata)
library(dplyr)
# Set WD
setwd()
# See all files in wd, leave this blank inside the parentheses
dir()
# Get the okcupid data as `profiles`
data('profiles')
latlon<- read.csv('LatLon.csv')
##### I would d... |
#' flip_button_front
#'
#' button to flip to the front of the flip_box
#'
#' @param id the flipbox id
#' @param text the button text
#'
#' @export
#'
#' @importFrom htmltools tags
#' @family flip_box functions
flip_button_front <- function(id, text) {
tags$button(
id = paste0("btn-flip-front-", id),
class = "... | /R/flip_box.R | permissive | Tychobra/tychobratools | R | false | false | 4,026 | r | #' flip_button_front
#'
#' button to flip to the front of the flip_box
#'
#' @param id the flipbox id
#' @param text the button text
#'
#' @export
#'
#' @importFrom htmltools tags
#' @family flip_box functions
flip_button_front <- function(id, text) {
tags$button(
id = paste0("btn-flip-front-", id),
class = "... |
bcStat <- function(refVal, netVal) {
# Make sure to remove undesired categories e.g., class 0 or urban/nonveg, cropland
r1.val <- refVal
r1.tab <- table(r1.val)
x1 <- data.frame(names(r1.tab),as.vector(r1.tab))
names(x1) <- c("cat",cat="strata")
r2.val <- netVal
r2.tab <- table(r2.val)
x2 <- data.fram... | /functions/bcStat.R | no_license | edwardsmarc/tools-GUI | R | false | false | 2,608 | r | bcStat <- function(refVal, netVal) {
# Make sure to remove undesired categories e.g., class 0 or urban/nonveg, cropland
r1.val <- refVal
r1.tab <- table(r1.val)
x1 <- data.frame(names(r1.tab),as.vector(r1.tab))
names(x1) <- c("cat",cat="strata")
r2.val <- netVal
r2.tab <- table(r2.val)
x2 <- data.fram... |
# using 'by' instead of tensor cos
# RESULTS: slightly better AIC than gam_te
#________________________________________________________________
# read in data ----
#________________________________________________________________
source('read-in-data-and-helper-functions.r')
#____________________________________... | /model_GAM_by.R | no_license | jayruffell/haast-elec-forecast-test | R | false | false | 1,599 | r | # using 'by' instead of tensor cos
# RESULTS: slightly better AIC than gam_te
#________________________________________________________________
# read in data ----
#________________________________________________________________
source('read-in-data-and-helper-functions.r')
#____________________________________... |
# Refer back to the mtcars data set with mpg as an outcome and weight (wt) as the predictor.
# About what is the ratio of the the sum of the squared errors, \sum_{i=1}^n (Y_i - \hat Y_i)^2
# when comparing a model with just an intercept (denominator) to the model with the intercept and slope (numerator)?
data("mtcars... | /reg_ratio.R | no_license | vcwild/lmexercises | R | false | false | 484 | r | # Refer back to the mtcars data set with mpg as an outcome and weight (wt) as the predictor.
# About what is the ratio of the the sum of the squared errors, \sum_{i=1}^n (Y_i - \hat Y_i)^2
# when comparing a model with just an intercept (denominator) to the model with the intercept and slope (numerator)?
data("mtcars... |
library(glmnet)
mydata = read.table("../../../../TrainingSet/FullSet/Lasso/skin.csv",head=T,sep=",")
x = as.matrix(mydata[,4:ncol(mydata)])
y = as.matrix(mydata[,1])
set.seed(123)
glm = cv.glmnet(x,y,nfolds=10,type.measure="mse",alpha=0.55,family="gaussian",standardize=TRUE)
sink('./skin_061.txt',append=TRUE)
print(glm... | /Model/EN/Lasso/skin/skin_061.R | no_license | esbgkannan/QSMART | R | false | false | 340 | r | library(glmnet)
mydata = read.table("../../../../TrainingSet/FullSet/Lasso/skin.csv",head=T,sep=",")
x = as.matrix(mydata[,4:ncol(mydata)])
y = as.matrix(mydata[,1])
set.seed(123)
glm = cv.glmnet(x,y,nfolds=10,type.measure="mse",alpha=0.55,family="gaussian",standardize=TRUE)
sink('./skin_061.txt',append=TRUE)
print(glm... |
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/get_df_ev.R
\name{get_df_ev}
\alias{get_df_ev}
\title{A dataframe for individual events}
\usage{
get_df_ev(df_ind = NULL, df_fam = NULL)
}
\arguments{
\item{df_ind}{A dataframe containing as columns "id", "bdate", "bplace", "bstatus",... | /man/get_df_ev.Rd | no_license | johow/kinlab | R | false | false | 814 | rd | % Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/get_df_ev.R
\name{get_df_ev}
\alias{get_df_ev}
\title{A dataframe for individual events}
\usage{
get_df_ev(df_ind = NULL, df_fam = NULL)
}
\arguments{
\item{df_ind}{A dataframe containing as columns "id", "bdate", "bplace", "bstatus",... |
# global parameters
base_url <- "https://api.discogs.com/"
ua <- user_agent("http://github.com/ewenme/discogger")
check_internet <- function(){
stop_if_not(.x = has_internet(), msg = "Please check your internet connection")
}
check_status <- function(res){
stop_if_not(.x = status_code(res),
.p = ~ .... | /R/utils.R | permissive | ewenme/discogger | R | false | false | 607 | r | # global parameters
base_url <- "https://api.discogs.com/"
ua <- user_agent("http://github.com/ewenme/discogger")
check_internet <- function(){
stop_if_not(.x = has_internet(), msg = "Please check your internet connection")
}
check_status <- function(res){
stop_if_not(.x = status_code(res),
.p = ~ .... |
#' @title
#' Run Synthea
#' @description
#' Run synthea according to the README guide found \href{here}{https://github.com/synthetichealth/synthea/blob/master/README.md}. The default setting opens the synthea.properties file to set the output parameters, such as setting the exporter.csv.export option to TRUE, which is ... | /R/run_synthea.R | permissive | meerapatelmd/polyester2 | R | false | false | 6,429 | r | #' @title
#' Run Synthea
#' @description
#' Run synthea according to the README guide found \href{here}{https://github.com/synthetichealth/synthea/blob/master/README.md}. The default setting opens the synthea.properties file to set the output parameters, such as setting the exporter.csv.export option to TRUE, which is ... |
# Andre Trigueiro
# Exercício 13 ------------------------------------------------------------
# Questão 1 ---------------------------------------------------------------
# Vamos usar novamente o dataset 'DNase'. O objetivo aqui é criar um gráfico de dispersão
# da densidade em função da concentração da dnase, das tr... | /intro_r/exercicio13.R | no_license | andretrigueiro/graduation | R | false | false | 3,355 | r | # Andre Trigueiro
# Exercício 13 ------------------------------------------------------------
# Questão 1 ---------------------------------------------------------------
# Vamos usar novamente o dataset 'DNase'. O objetivo aqui é criar um gráfico de dispersão
# da densidade em função da concentração da dnase, das tr... |
c DCNF-Autarky [version 0.0.1].
c Copyright (c) 2018-2019 Swansea University.
c
c Input Clause Count: 6552
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 6552
c
c Input Parameter (command line, file):
c input filename QBFLIB/Miller-Marin/trafficlight-controller/tlc01-nonuniform-de... | /code/dcnf-ankit-optimized/Results/QBFLIB-2018/E1/Experiments/Miller-Marin/trafficlight-controller/tlc01-nonuniform-depth-6/tlc01-nonuniform-depth-6.R | no_license | arey0pushpa/dcnf-autarky | R | false | false | 683 | r | c DCNF-Autarky [version 0.0.1].
c Copyright (c) 2018-2019 Swansea University.
c
c Input Clause Count: 6552
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 6552
c
c Input Parameter (command line, file):
c input filename QBFLIB/Miller-Marin/trafficlight-controller/tlc01-nonuniform-de... |
\name{Extract_plant_grapevine_function}
\alias{Extract_plant_grapevine_function}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Extract vine plant from the entire dataset.
}
\description{
The function cut the plant at fixes values of x,y and z. Where x is width, y is height and z is front view o... | /man/Extract_plant_grapevine_function.Rd | no_license | cran/PROTOLIDAR | R | false | false | 3,486 | rd | \name{Extract_plant_grapevine_function}
\alias{Extract_plant_grapevine_function}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Extract vine plant from the entire dataset.
}
\description{
The function cut the plant at fixes values of x,y and z. Where x is width, y is height and z is front view o... |
filenames <- list.files('/Users/qidiwang1/Desktop/Google Trend2/', pattern = '*.csv$', full.names = TRUE)
my_data <- lapply(filenames, read.csv, skip = 2)
View(my_data)
for (a in c(1:258)){
if (nrow(my_data[[a]])>0)
for (i in c(1:nrow(my_data[[a]]))){
for (j in c(1:ncol(my_data[[a]]))){
if (my_... | /10月24号为止的r code/data_processing(2).R | no_license | qidiwang1/Rstudio | R | false | false | 2,519 | r | filenames <- list.files('/Users/qidiwang1/Desktop/Google Trend2/', pattern = '*.csv$', full.names = TRUE)
my_data <- lapply(filenames, read.csv, skip = 2)
View(my_data)
for (a in c(1:258)){
if (nrow(my_data[[a]])>0)
for (i in c(1:nrow(my_data[[a]]))){
for (j in c(1:ncol(my_data[[a]]))){
if (my_... |
###############################################################################
# Date: 03/10/2016
# Author: Diego J. Bodas Sagi
# Company: BBVA Data & Analytics
# File: Session4CodeA.R
# Description: Lasso Regression with R
# References:
# http://www4.stat.ncsu.edu/~post/josh/LASSO_Ridge_Elastic_Net_-_Examples.html
#... | /Session4/Session4CodeA.R | no_license | lauramga/Introduction_to_R | R | false | false | 2,582 | r | ###############################################################################
# Date: 03/10/2016
# Author: Diego J. Bodas Sagi
# Company: BBVA Data & Analytics
# File: Session4CodeA.R
# Description: Lasso Regression with R
# References:
# http://www4.stat.ncsu.edu/~post/josh/LASSO_Ridge_Elastic_Net_-_Examples.html
#... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scatter.R
\name{diagnostic}
\alias{diagnostic}
\title{Diagnostic}
\usage{
diagnostic(data., x., y.)
}
\arguments{
\item{data.}{data frame}
\item{x.}{x-axis}
\item{y.}{y-axis}
}
\value{
a residual plot and QQ plot
}
\description{
This functi... | /man/diagnostic.Rd | no_license | MGallow/statr | R | false | true | 454 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scatter.R
\name{diagnostic}
\alias{diagnostic}
\title{Diagnostic}
\usage{
diagnostic(data., x., y.)
}
\arguments{
\item{data.}{data frame}
\item{x.}{x-axis}
\item{y.}{y-axis}
}
\value{
a residual plot and QQ plot
}
\description{
This functi... |
ezPrecis <-
function(
data
, transpose = TRUE
){
if(inherits(data, "tbl_df")) {
data <- as.data.frame(data)
}
cat('Data frame dimensions:',nrow(data),'rows,',ncol(data),'columns\n')
to_return = as.data.frame(
matrix(
NA
, 5
, dim(data)[2]
)
)
names(to_return) = names(data)
row.names(to_return) =... | /R/ezPrecis.R | no_license | cran/ez | R | false | false | 1,791 | r | ezPrecis <-
function(
data
, transpose = TRUE
){
if(inherits(data, "tbl_df")) {
data <- as.data.frame(data)
}
cat('Data frame dimensions:',nrow(data),'rows,',ncol(data),'columns\n')
to_return = as.data.frame(
matrix(
NA
, 5
, dim(data)[2]
)
)
names(to_return) = names(data)
row.names(to_return) =... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/replicapoolupdater_objects.R
\name{RollingUpdate.error}
\alias{RollingUpdate.error}
\title{RollingUpdate.error Object}
\usage{
RollingUpdate.error(RollingUpdate.error.errors = NULL, errors = NULL)
}
\arguments{
\item{RollingUpdate.error.error... | /googlereplicapoolupdaterv1beta1.auto/man/RollingUpdate.error.Rd | permissive | GVersteeg/autoGoogleAPI | R | false | true | 898 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/replicapoolupdater_objects.R
\name{RollingUpdate.error}
\alias{RollingUpdate.error}
\title{RollingUpdate.error Object}
\usage{
RollingUpdate.error(RollingUpdate.error.errors = NULL, errors = NULL)
}
\arguments{
\item{RollingUpdate.error.error... |
library(rethinking)
rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())
#############################
#d=dataframe
#rank=score_preg
#group=preg_residence ("PHG","ENK")
#sire current infant=father (0,1)
#sire next infant= nextdad (0,1)
#id individual 1= prt1 (integer)
#id individual 2= prt2 (in... | /pregnancy parenting effort (PE).R | no_license | coryphella/Parenting-or-mating-effort | R | false | false | 7,967 | r | library(rethinking)
rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())
#############################
#d=dataframe
#rank=score_preg
#group=preg_residence ("PHG","ENK")
#sire current infant=father (0,1)
#sire next infant= nextdad (0,1)
#id individual 1= prt1 (integer)
#id individual 2= prt2 (in... |
library(keras)
mnist <- dataset_mnist()
x_train <- mnist$train$x
y_train <- mnist$train$y
x_test <- mnist$test$x
y_test <- mnist$test$y
# reshape
x_train <- array_reshape(x_train, c(nrow(x_train), 784))
x_test <- array_reshape(x_test, c(nrow(x_test), 784))
# rescale
x_train <- x_train / 255
x_test <- x_test / 255
y_t... | /keras01.R | no_license | Nizard1/R | R | false | false | 1,516 | r | library(keras)
mnist <- dataset_mnist()
x_train <- mnist$train$x
y_train <- mnist$train$y
x_test <- mnist$test$x
y_test <- mnist$test$y
# reshape
x_train <- array_reshape(x_train, c(nrow(x_train), 784))
x_test <- array_reshape(x_test, c(nrow(x_test), 784))
# rescale
x_train <- x_train / 255
x_test <- x_test / 255
y_t... |
# Read in data
plots <- read.csv("../sandbox/portal-teachingdb-master/plots.csv", stringsAsFactors = FALSE)
species <- read.csv("../sandbox/portal-teachingdb-master/species.csv", stringsAsFactors = FALSE)
surveys <- read.csv("../sandbox/portal-teachingdb-master/surveys.csv", na.strings = "", stringsAsFactors = FALSE)
... | /sandbox/app.R | no_license | ultimatemegs/brightshinyindonesia | R | false | false | 2,185 | r | # Read in data
plots <- read.csv("../sandbox/portal-teachingdb-master/plots.csv", stringsAsFactors = FALSE)
species <- read.csv("../sandbox/portal-teachingdb-master/species.csv", stringsAsFactors = FALSE)
surveys <- read.csv("../sandbox/portal-teachingdb-master/surveys.csv", na.strings = "", stringsAsFactors = FALSE)
... |
##########################################################
# #
# Output Excel file #
# #
##########################################################
writeExcel<-function(var... | /functions/writeExcel.R | no_license | jpmtavares/vaRiants-annotation | R | false | false | 1,761 | r | ##########################################################
# #
# Output Excel file #
# #
##########################################################
writeExcel<-function(var... |
# Load the data
load("../element/mm9element.RData")
# split() dataframe into 30 slices
splitted <- split(mm9, sample(rep(1:30, 1840)))
# save slices into separate files
for (i in 1:length(splitted)) {
slice <- splitted[[i]]
save(slice, file=paste0("~/mm9elements/slice", i, ".Rdata"))
} | /splitData.R | no_license | CathyCha/sleepingBeautyDataAnalysis | R | false | false | 293 | r | # Load the data
load("../element/mm9element.RData")
# split() dataframe into 30 slices
splitted <- split(mm9, sample(rep(1:30, 1840)))
# save slices into separate files
for (i in 1:length(splitted)) {
slice <- splitted[[i]]
save(slice, file=paste0("~/mm9elements/slice", i, ".Rdata"))
} |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/paged_zcf.R
\name{paged_zcf}
\alias{paged_zcf}
\title{Function for windmill template}
\usage{
paged_zcf(
logo = pkg_resource("logo/ssi-logo.png"),
front_img = "0",
img_to_dark = TRUE,
logo_to_white = FALSE,
type = "short",
...
)
}... | /man/paged_zcf.Rd | no_license | msandifo/sszcf | R | false | true | 656 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/paged_zcf.R
\name{paged_zcf}
\alias{paged_zcf}
\title{Function for windmill template}
\usage{
paged_zcf(
logo = pkg_resource("logo/ssi-logo.png"),
front_img = "0",
img_to_dark = TRUE,
logo_to_white = FALSE,
type = "short",
...
)
}... |
library(tidyverse)
library(gganimate)
library(janitor)
hcbu <- tidytuesdayR::tt_load('2021-02-02')
hcbu <- hcbu$bach_students %>%
clean_names() %>%
rename(year = total) %>%
filter(year >= 2003)
hbcu <- hbcu %>%
select(year, white1, black1, hispanic, asian_pacific_islander_asian, asian_pacific_islander_paci... | /code/2021-02-02.R | no_license | alexlusco/tidy-tuesday | R | false | false | 2,265 | r | library(tidyverse)
library(gganimate)
library(janitor)
hcbu <- tidytuesdayR::tt_load('2021-02-02')
hcbu <- hcbu$bach_students %>%
clean_names() %>%
rename(year = total) %>%
filter(year >= 2003)
hbcu <- hbcu %>%
select(year, white1, black1, hispanic, asian_pacific_islander_asian, asian_pacific_islander_paci... |
base_dir <- getwd()
source('get_data.R')
image_dir <- "imageDir"
if (file.exists(image_dir)) {
setwd(file.path(base_dir, image_dir))
} else {
dir.create(file.path(base_dir, image_dir))
setwd(file.path(base_dir, image_dir))
}
png("plot4.png",width = 480, height = 480, units = "px", bg= "NA")
par(mfcol = c(2... | /plot_4.R | no_license | highsineburgh/ExData_Plotting1 | R | false | false | 1,066 | r | base_dir <- getwd()
source('get_data.R')
image_dir <- "imageDir"
if (file.exists(image_dir)) {
setwd(file.path(base_dir, image_dir))
} else {
dir.create(file.path(base_dir, image_dir))
setwd(file.path(base_dir, image_dir))
}
png("plot4.png",width = 480, height = 480, units = "px", bg= "NA")
par(mfcol = c(2... |
lgOR.vcov <- function(r, nt, nc, st, sc, n_rt = NA, n_rc = NA){
ft <- nt - st
fc <- nc - sc
if (length(as.vector(ft)) == length(as.matrix(ft)[, 1])) {
colum.number <- 1} else { colum.number <- ncol(ft)}
if (length(as.vector(ft)) == length(as.matrix(ft)[, 1])) {
K <- length(ft)} else { K <- nrow(ft)}
... | /R/lgOR.vcov.R | no_license | cran/metavcov | R | false | false | 1,958 | r | lgOR.vcov <- function(r, nt, nc, st, sc, n_rt = NA, n_rc = NA){
ft <- nt - st
fc <- nc - sc
if (length(as.vector(ft)) == length(as.matrix(ft)[, 1])) {
colum.number <- 1} else { colum.number <- ncol(ft)}
if (length(as.vector(ft)) == length(as.matrix(ft)[, 1])) {
K <- length(ft)} else { K <- nrow(ft)}
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cooccurrences.R
\docType{methods}
\name{cooccurrences,TopicModel-method}
\alias{cooccurrences,TopicModel-method}
\title{Get topic cooccurrences.}
\usage{
\S4method{cooccurrences}{TopicModel}(.Object, k, regex = NULL,
docs = NULL, renumber =... | /man/cooccurrences-TopicModel-method.Rd | no_license | ChristophLeonhardt/topicanalysis | R | false | true | 1,784 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cooccurrences.R
\docType{methods}
\name{cooccurrences,TopicModel-method}
\alias{cooccurrences,TopicModel-method}
\title{Get topic cooccurrences.}
\usage{
\S4method{cooccurrences}{TopicModel}(.Object, k, regex = NULL,
docs = NULL, renumber =... |
#' S3 method for printing objects of class \code{"massStandardKit"}
#'
#' The function prints objects of class \code{"massStandardKit"}.
#' @inheritParams print.massStandard
#' @param x object of class \code{"massStandardKit"}.
#' @seealso [massStandardKit()], [print.massStandard()]
#' @return No return value, called f... | /R/print.massStandardKit.R | no_license | cran/masscor | R | false | false | 4,154 | r | #' S3 method for printing objects of class \code{"massStandardKit"}
#'
#' The function prints objects of class \code{"massStandardKit"}.
#' @inheritParams print.massStandard
#' @param x object of class \code{"massStandardKit"}.
#' @seealso [massStandardKit()], [print.massStandard()]
#' @return No return value, called f... |
#################################################################################
# ROAD DENSITY FROM GRID - This script calculates road density within a preset raster grid #
#################################################################################
# Source code adapted from: https://gis.stackexchange.com/ques... | /Scripts/RoadDensity_Intersect_updated.R | no_license | SarahBassing/WPPP_Data_Integration | R | false | false | 3,179 | r | #################################################################################
# ROAD DENSITY FROM GRID - This script calculates road density within a preset raster grid #
#################################################################################
# Source code adapted from: https://gis.stackexchange.com/ques... |
library(tidyverse)
library(rvest)
# wikipedia url
fixture_url_2012 <- "https://en.wikipedia.org/wiki/2012_AFL_season"
# import data
fixture_raw_2012 <- map(
3:25,
~ fixture_url_2012 %>%
read_html() %>%
html_nodes(xpath = paste("//*[@id='mw-content-text']/div/table[", .x, "]")) %>%
h... | /utils/fixture scripts/fixture_2012.R | permissive | turneralex/afl_elo | R | false | false | 4,826 | r | library(tidyverse)
library(rvest)
# wikipedia url
fixture_url_2012 <- "https://en.wikipedia.org/wiki/2012_AFL_season"
# import data
fixture_raw_2012 <- map(
3:25,
~ fixture_url_2012 %>%
read_html() %>%
html_nodes(xpath = paste("//*[@id='mw-content-text']/div/table[", .x, "]")) %>%
h... |
library(shiny)
fluidPage(
titlePanel("Word prediction"),
fluidRow(
column(4, div(br(), wellPanel(textInput('sentence', 'Input text:')))),
column(8, h3("Suggestions:"), uiOutput('prediction'))
)
)
| /app/ui.R | no_license | tyz910/dsscapstone | R | false | false | 214 | r | library(shiny)
fluidPage(
titlePanel("Word prediction"),
fluidRow(
column(4, div(br(), wellPanel(textInput('sentence', 'Input text:')))),
column(8, h3("Suggestions:"), uiOutput('prediction'))
)
)
|
getLevel2A_algorithm <- function (level2a, aN) {
level2a <- level2a@h5 # level2a@h5 | gedilevel2a@h5
beam_id <- grep("BEAM\\d{4}$", gsub("/", "", hdf5r::list.groups(level2a,
recursive = F)), value = T)
groups_id <- paste(beam_id, "/geolocation... | /Code/getLevel2A_algorithm.R | no_license | eoway/GEDI_code | R | false | false | 2,235 | r | getLevel2A_algorithm <- function (level2a, aN) {
level2a <- level2a@h5 # level2a@h5 | gedilevel2a@h5
beam_id <- grep("BEAM\\d{4}$", gsub("/", "", hdf5r::list.groups(level2a,
recursive = F)), value = T)
groups_id <- paste(beam_id, "/geolocation... |
#'---
#' title: Simulations for normal distributed counts
#' author: Felix Brechtmann, Christian Mertes
#' wb:
#' output:
#' - odsBestQ: '`sm config["DATADIR"] + "/bestQFitODS/SimulationNorm_fitN_Q{q}_ODS.RDS"`'
#' - odsFit: '`sm config["DATADIR"] + "/filteredODS/SimulationNorm_fitY_Q{q}_ODS.RDS"`'
#' -... | /Scripts/PaperPlots/01c_CreateSimulationNormDataSets.R | no_license | gagneurlab/OUTRIDER-analysis | R | false | false | 2,213 | r | #'---
#' title: Simulations for normal distributed counts
#' author: Felix Brechtmann, Christian Mertes
#' wb:
#' output:
#' - odsBestQ: '`sm config["DATADIR"] + "/bestQFitODS/SimulationNorm_fitN_Q{q}_ODS.RDS"`'
#' - odsFit: '`sm config["DATADIR"] + "/filteredODS/SimulationNorm_fitY_Q{q}_ODS.RDS"`'
#' -... |
# preparing a data set for linear regression or any model application is the core of the
# data science profession
# some of the steps involve in data preparation are as follows
# read your data into rstudio or any tool you are using
loan_data <- read.csv("loans data.csv", stringsAsFactors = FALSE)
#View your data ... | /practice_R_syntax/practising_preparatn.R | no_license | ajakaiye33/R_EDA_and_ML | R | false | false | 6,596 | r | # preparing a data set for linear regression or any model application is the core of the
# data science profession
# some of the steps involve in data preparation are as follows
# read your data into rstudio or any tool you are using
loan_data <- read.csv("loans data.csv", stringsAsFactors = FALSE)
#View your data ... |
library(dplyr)
# Plot 2 for Exploratory-Data-Analysis
# date: 04/05/2018 by holger (jerebai)
a<-read.table("household_power_consumption.txt",header=TRUE,sep=";")
a<-tbl_df(a)
b<-subset(a,a$Date=="1/2/2007"|a$Date=="2/2/2007")
c<-b$Global_active_power
d<-as.numeric(as.character(c))
png("plot2.png", width=480... | /Plot2.r | no_license | jerebai/Exploratory_Data_Analysis_Assignment_1 | R | false | false | 497 | r | library(dplyr)
# Plot 2 for Exploratory-Data-Analysis
# date: 04/05/2018 by holger (jerebai)
a<-read.table("household_power_consumption.txt",header=TRUE,sep=";")
a<-tbl_df(a)
b<-subset(a,a$Date=="1/2/2007"|a$Date=="2/2/2007")
c<-b$Global_active_power
d<-as.numeric(as.character(c))
png("plot2.png", width=480... |
test_that('bathy.colors returns the correct number of colors', {
expect_equal(length(bathy.colors(0)), 0)
expect_equal(length(bathy.colors(1)), 1)
expect_equal(length(bathy.colors(128)), 128)
}
)
test_that('bathy.colors does not accept a negative number of colors', {
expect_error(bathy.colors(-1))
... | /tests/testthat/test_color_ramps.R | no_license | jonesbt/ocean | R | false | false | 2,544 | r | test_that('bathy.colors returns the correct number of colors', {
expect_equal(length(bathy.colors(0)), 0)
expect_equal(length(bathy.colors(1)), 1)
expect_equal(length(bathy.colors(128)), 128)
}
)
test_that('bathy.colors does not accept a negative number of colors', {
expect_error(bathy.colors(-1))
... |
#' @title Sample from a 2D Distribution Given FX(x) and F(y|X = x)
#'
#' @author Peter Reiker
#' @date 11/26/2018
#'
#' @description
#' Sample from a 2D Distribution Given FX(x) and F(y|X = x)
#' This function samples from a 2D distribution given the marginal pdf of X and the conditional pdf of Y given X = x.
#' Its ou... | /R/d2_sampler_special.R | no_license | reikerp/contdistpeter | R | false | false | 2,525 | r | #' @title Sample from a 2D Distribution Given FX(x) and F(y|X = x)
#'
#' @author Peter Reiker
#' @date 11/26/2018
#'
#' @description
#' Sample from a 2D Distribution Given FX(x) and F(y|X = x)
#' This function samples from a 2D distribution given the marginal pdf of X and the conditional pdf of Y given X = x.
#' Its ou... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/europe.R
\name{make_table_question_reponse_europe}
\alias{make_table_question_reponse_europe}
\title{Make a table with the question and all answers}
\usage{
make_table_question_reponse_europe(list, i)
}
\arguments{
\item{list}{the name of the... | /man/make_table_question_reponse_europe.Rd | no_license | pachevalier/dataAN | R | false | true | 487 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/europe.R
\name{make_table_question_reponse_europe}
\alias{make_table_question_reponse_europe}
\title{Make a table with the question and all answers}
\usage{
make_table_question_reponse_europe(list, i)
}
\arguments{
\item{list}{the name of the... |
#import necessary libraries
library(RCurl) #for reading the url from github
library(ggplot2) #for plotting
#read in myanmar_merged_v3 file from github
x <- getURL("https://raw.githubusercontent.com/kes4052/INFX575LA/master/myanmar_merged_v3.csv")
#coding blanks and 0 values as NA in R
myanmar <- read.csv(text... | /myanmar_histogram_code.R | no_license | kes4052/INFX575LA | R | false | false | 2,726 | r | #import necessary libraries
library(RCurl) #for reading the url from github
library(ggplot2) #for plotting
#read in myanmar_merged_v3 file from github
x <- getURL("https://raw.githubusercontent.com/kes4052/INFX575LA/master/myanmar_merged_v3.csv")
#coding blanks and 0 values as NA in R
myanmar <- read.csv(text... |
library(MASS)
true.garma.aut.wge=function(u,lambda,phi=0,theta=0,lag.max=50,vara=1,plot=TRUE)
{
if(sum(abs(phi))!=0) {p=length(phi)} else p=0
if(sum(abs(theta))!=0) {q=length(theta)} else q=0
acv=c()
for (i in 1:(lag.max+1))
{
newfunc=function(f)
{
if(q==0) {comp1=1} else comp1=Mod(sum(c(1,-the... | /R/true.garma.aut.wge.R | no_license | cran/tswge | R | false | false | 1,281 | r | library(MASS)
true.garma.aut.wge=function(u,lambda,phi=0,theta=0,lag.max=50,vara=1,plot=TRUE)
{
if(sum(abs(phi))!=0) {p=length(phi)} else p=0
if(sum(abs(theta))!=0) {q=length(theta)} else q=0
acv=c()
for (i in 1:(lag.max+1))
{
newfunc=function(f)
{
if(q==0) {comp1=1} else comp1=Mod(sum(c(1,-the... |
library(ggplot2)
library(ggridges)
library(gridExtra)
library(ggmap)
cl = readRDS('cl_apartments.rds')
#Q1:Big picture of data--------------------------
names(cl)
dim(cl)
#check the data it spans
sort(cl$date_posted)
sort(cl$date_posted,decreasing = TRUE)
sort(cl$date_updated,decreasing = TRUE)
#check the place it... | /report3.R | no_license | Jiegu000/sharing1 | R | false | false | 8,267 | r | library(ggplot2)
library(ggridges)
library(gridExtra)
library(ggmap)
cl = readRDS('cl_apartments.rds')
#Q1:Big picture of data--------------------------
names(cl)
dim(cl)
#check the data it spans
sort(cl$date_posted)
sort(cl$date_posted,decreasing = TRUE)
sort(cl$date_updated,decreasing = TRUE)
#check the place it... |
## File: flips.demo.R
## Part of FLIPS
## FLIPS - Fortran Linear Inverse Problem Solver
## Copyright (C) 2005--2009 University of Oulu
## Written by Mikko Orispaa <mikko.orispaa@oulu.fi>
##
## Licensed under BSD License.
# Construct a function for Hamming window
hamming <- function(L)
{
hamming <- rep(... | /interfaces/rflips/R/flips.demo.R | permissive | morispaa/flips | R | false | false | 2,434 | r | ## File: flips.demo.R
## Part of FLIPS
## FLIPS - Fortran Linear Inverse Problem Solver
## Copyright (C) 2005--2009 University of Oulu
## Written by Mikko Orispaa <mikko.orispaa@oulu.fi>
##
## Licensed under BSD License.
# Construct a function for Hamming window
hamming <- function(L)
{
hamming <- rep(... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/01_prepare_data.R
\name{add_gps}
\alias{add_gps}
\title{Add generalized PS}
\usage{
add_gps(data, formula, family, subset, ps_prefix)
}
\arguments{
\item{data}{data_frame}
\item{formula}{formula for PS model}
\item{family}{\code{multinomial... | /man/add_gps.Rd | no_license | kaz-yos/trim3 | R | false | true | 644 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/01_prepare_data.R
\name{add_gps}
\alias{add_gps}
\title{Add generalized PS}
\usage{
add_gps(data, formula, family, subset, ps_prefix)
}
\arguments{
\item{data}{data_frame}
\item{formula}{formula for PS model}
\item{family}{\code{multinomial... |
cdfSubpopSummaryUI <- function(id){
ns <- NS(id)
tagList(
uiOutput(ns('parameterChoiceUI')),
#verbatimTextOutput(ns('testtest')),
DT::dataTableOutput(ns('table_Site')),
br(),
fluidRow(
column(4,DT::dataTableOutput(ns('riskTable'))),
column(8,uiOutput(ns("dataset_")),
plo... | /functionsAndModules/CDFsubpopModule.R | no_license | EmmaVJones/BenthicStressorAnalysis | R | false | false | 3,439 | r | cdfSubpopSummaryUI <- function(id){
ns <- NS(id)
tagList(
uiOutput(ns('parameterChoiceUI')),
#verbatimTextOutput(ns('testtest')),
DT::dataTableOutput(ns('table_Site')),
br(),
fluidRow(
column(4,DT::dataTableOutput(ns('riskTable'))),
column(8,uiOutput(ns("dataset_")),
plo... |
set.seed(10)
nr <- 20
nc <- 5
x <- matrix(rnorm(nr * nc), nrow = nr, ncol = nc)
n <- 5
p1 <- 5
p2 <- 12
pi <- numeric(4)
pi2 <- c(5, 10, 0, 0)
context("navigate_any")
describe("navigate_any", {
it("Returns error if actually called", {
expect_error(navigate_any(x, pi, p1, p2, n))
})
it("Has correct nav_clas... | /tests/testthat/test-navigate.R | no_license | mdlincoln/pathway | R | false | false | 2,454 | r | set.seed(10)
nr <- 20
nc <- 5
x <- matrix(rnorm(nr * nc), nrow = nr, ncol = nc)
n <- 5
p1 <- 5
p2 <- 12
pi <- numeric(4)
pi2 <- c(5, 10, 0, 0)
context("navigate_any")
describe("navigate_any", {
it("Returns error if actually called", {
expect_error(navigate_any(x, pi, p1, p2, n))
})
it("Has correct nav_clas... |
# Table script for ben-1 manuscript
# set to location of files
main.dir <- "~/Dropbox/HTA/Results/2017_anthelmintic_gwa/analysis/ben1_paper/"
data.dir <- paste0(main.dir,"Raw_data/")
plot.dir <- paste0(main.dir,"Plots/")
script.dir <- paste0(main.dir,"Scripts/")
final.dir <- paste0(main.dir,"Final_Tables/")
source(p... | /Scripts/201800614_final_tables.R | no_license | AndersenLab/Ce_BZ_resistance | R | false | false | 30,566 | r | # Table script for ben-1 manuscript
# set to location of files
main.dir <- "~/Dropbox/HTA/Results/2017_anthelmintic_gwa/analysis/ben1_paper/"
data.dir <- paste0(main.dir,"Raw_data/")
plot.dir <- paste0(main.dir,"Plots/")
script.dir <- paste0(main.dir,"Scripts/")
final.dir <- paste0(main.dir,"Final_Tables/")
source(p... |
#Build glm model with lambda search on and return_all_lambda as true.
#Randomly choose a lambda and get the model specific to that lambda
#Change the 1st parameter of the getLambdaModel method and make sure you get the same model for the same lambda
setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f"))... | /R/tests/testdir_algos/glm/runit_getLambdaModel_medium.R | permissive | ivanliu1989/h2o | R | false | false | 1,683 | r | #Build glm model with lambda search on and return_all_lambda as true.
#Randomly choose a lambda and get the model specific to that lambda
#Change the 1st parameter of the getLambdaModel method and make sure you get the same model for the same lambda
setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f"))... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CIDemo.R
\docType{class}
\name{CIDemo-class}
\alias{CIDemo-class}
\alias{.CIDemo}
\alias{CIDemo}
\title{CIDemo}
\usage{
CIDemo(projectName)
}
\arguments{
\item{projectName}{A character string}
}
\value{
An object of the CIDemo class
}
\descri... | /man/CIDemo-class.Rd | no_license | paul-shannon/R-travis-CI-demo | R | false | true | 384 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CIDemo.R
\docType{class}
\name{CIDemo-class}
\alias{CIDemo-class}
\alias{.CIDemo}
\alias{CIDemo}
\title{CIDemo}
\usage{
CIDemo(projectName)
}
\arguments{
\item{projectName}{A character string}
}
\value{
An object of the CIDemo class
}
\descri... |
testlist <- list(mu = 2.02769481709706e-319, var = 0)
result <- do.call(metafolio:::est_beta_params,testlist)
str(result) | /metafolio/inst/testfiles/est_beta_params/libFuzzer_est_beta_params/est_beta_params_valgrind_files/1612988184-test.R | no_license | akhikolla/updatedatatype-list3 | R | false | false | 121 | r | testlist <- list(mu = 2.02769481709706e-319, var = 0)
result <- do.call(metafolio:::est_beta_params,testlist)
str(result) |
library(feather)
library(tidyverse)
path = "./data/lexicon/"
files = list.files(path)
y0_df <- read_feather(paste0(path, files[8])) %>% as_tibble()
y1_df <- read_feather(paste0(path, files[9])) %>% as_tibble() | /read_lexicon.r | no_license | FahadAijaz/arabic | R | false | false | 212 | r | library(feather)
library(tidyverse)
path = "./data/lexicon/"
files = list.files(path)
y0_df <- read_feather(paste0(path, files[8])) %>% as_tibble()
y1_df <- read_feather(paste0(path, files[9])) %>% as_tibble() |
library(shiny)
library(UsingR)
library(caret)
data(reaction.time)
process<-function(features) {
#reaction<-reaction.time[,c(as.numeric(features),4)]
reaction<-subset(reaction.time,select=c(features,"time"))
set.seed(123)
nsample<-sample(1:nrow(reaction), 18)
train_set<-reaction[-nsample,]
test_set<-react... | /server.R | no_license | JOSE-PASILLAS/ddp | R | false | false | 989 | r | library(shiny)
library(UsingR)
library(caret)
data(reaction.time)
process<-function(features) {
#reaction<-reaction.time[,c(as.numeric(features),4)]
reaction<-subset(reaction.time,select=c(features,"time"))
set.seed(123)
nsample<-sample(1:nrow(reaction), 18)
train_set<-reaction[-nsample,]
test_set<-react... |
library(VaRES)
### Name: genbeta
### Title: Generalized beta distribution
### Aliases: dgenbeta pgenbeta vargenbeta esgenbeta
### Keywords: Value at risk, expected shortfall
### ** Examples
x=runif(10,min=0,max=1)
dgenbeta(x)
pgenbeta(x)
vargenbeta(x)
esgenbeta(x)
| /data/genthat_extracted_code/VaRES/examples/genbeta.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 270 | r | library(VaRES)
### Name: genbeta
### Title: Generalized beta distribution
### Aliases: dgenbeta pgenbeta vargenbeta esgenbeta
### Keywords: Value at risk, expected shortfall
### ** Examples
x=runif(10,min=0,max=1)
dgenbeta(x)
pgenbeta(x)
vargenbeta(x)
esgenbeta(x)
|
###############################################################################
## 0005WriteMaterialToGlobal.r -- Alan Lenarcic
##
## 01-09-2019
##
## Saves imporant variable settings to Global Environment
##
##
##
## LICENSE INFO: R CODE
# This program is free software; you can redistribute it and/or modi... | /TwoSimR5/R/0006GenerateDefaultSimulationFunctions.R | no_license | lenarcica/SimulationStackForBayesSpike | R | false | false | 23,607 | r | ###############################################################################
## 0005WriteMaterialToGlobal.r -- Alan Lenarcic
##
## 01-09-2019
##
## Saves imporant variable settings to Global Environment
##
##
##
## LICENSE INFO: R CODE
# This program is free software; you can redistribute it and/or modi... |
##' @export
`heavytail` <- function(x,...) UseMethod("heavytail")
##' @export
"heavytail<-" <- function(x,...,value) UseMethod("heavytail<-")
##' @export
"heavytail<-.lvm" <- function(x,...,value) {
if (inherits(value,"formula")) {
return(heavytail(x,all.vars(value),...))
}
heavytail(x, value, ...)... | /R/heavytail.R | no_license | cran/lava | R | false | false | 1,613 | r | ##' @export
`heavytail` <- function(x,...) UseMethod("heavytail")
##' @export
"heavytail<-" <- function(x,...,value) UseMethod("heavytail<-")
##' @export
"heavytail<-.lvm" <- function(x,...,value) {
if (inherits(value,"formula")) {
return(heavytail(x,all.vars(value),...))
}
heavytail(x, value, ...)... |
Twoby <- d16 %>%
count(Gender, AcadStatus) %>%
spread(Gender, n, fill = 0) %>%
mutate(
pctFem = Female / sum(Female) * 100,
pctMal = Male / sum(Male) * 100)
huxtable::as_hux(Twoby)
Twobytab <- function(x, y){
}
| /ignore/Twoby_play.R | no_license | bduckles/Edamame | R | false | false | 239 | r |
Twoby <- d16 %>%
count(Gender, AcadStatus) %>%
spread(Gender, n, fill = 0) %>%
mutate(
pctFem = Female / sum(Female) * 100,
pctMal = Male / sum(Male) * 100)
huxtable::as_hux(Twoby)
Twobytab <- function(x, y){
}
|
# A utility script to find all the data system R scripts in a directory
# tree, parse them one by one, and fill in a template form to generate
# one chunk per script. We write these to files in the outputs/ dir
library(tibble)
PATTERNFILE <- "chunk-generator/sample-pattern.R"
DOMAIN_MAP <- c("AGLU" = "aglu/",
... | /chunk-generator/chunk-generator.R | no_license | shaohuizhang/gcamdata | R | false | false | 17,254 | r | # A utility script to find all the data system R scripts in a directory
# tree, parse them one by one, and fill in a template form to generate
# one chunk per script. We write these to files in the outputs/ dir
library(tibble)
PATTERNFILE <- "chunk-generator/sample-pattern.R"
DOMAIN_MAP <- c("AGLU" = "aglu/",
... |
require("tidyverse")
data("CampbellThistlewaite1960")
# Figures from the Campbell and Thistelwaite (1960)
filter(CampbellThistlewaite1960,
test_score %in% as.character(1:20)) %>%
mutate(test_score = as.integer(test_score)) %>%
select(test_score, certificate_of_merit,
scholarship, scholarship_150, g... | /examples/ex-CampbellThistlewaite1960.R | permissive | jrnold/datums | R | false | false | 1,547 | r | require("tidyverse")
data("CampbellThistlewaite1960")
# Figures from the Campbell and Thistelwaite (1960)
filter(CampbellThistlewaite1960,
test_score %in% as.character(1:20)) %>%
mutate(test_score = as.integer(test_score)) %>%
select(test_score, certificate_of_merit,
scholarship, scholarship_150, g... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/matrix.R
\name{qz}
\alias{qz}
\title{QZ decomposition}
\usage{
qz(A, E)
}
\arguments{
\item{A, E}{Square matrices of same size.}
}
\value{
QZ decomposition. See Note for additional information.
}
\description{
Real QZ decomposition. Weakly st... | /man/qz.Rd | no_license | kenjisato/lrem | R | false | true | 787 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/matrix.R
\name{qz}
\alias{qz}
\title{QZ decomposition}
\usage{
qz(A, E)
}
\arguments{
\item{A, E}{Square matrices of same size.}
}
\value{
QZ decomposition. See Note for additional information.
}
\description{
Real QZ decomposition. Weakly st... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/basicVariables.R
\name{VPA_B1}
\alias{VPA_B1}
\title{Summarises bouts of Vigorous Physical Activity (VPA, >6METs) such as jogging or running.
Criteria: 1-min-bout with >80% of VPA, treashold ENMO <500mg.}
\usage{
VPA_B1(df, limInf = 40... | /R/man/VPA_B1.Rd | no_license | fjbaron/accelerator | R | false | true | 659 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/basicVariables.R
\name{VPA_B1}
\alias{VPA_B1}
\title{Summarises bouts of Vigorous Physical Activity (VPA, >6METs) such as jogging or running.
Criteria: 1-min-bout with >80% of VPA, treashold ENMO <500mg.}
\usage{
VPA_B1(df, limInf = 40... |
# Chapter 3 - Random Variables and Distributions, Section - 3.8 (Functions of a Random Variable), Page No. - 171
y<-function(x)
{
2*(1-((1-x)^0.5))
}
# Let the three generated values be stored in the variable 'x'.
x<-c(0.4125,0.0894,0.8302)
for(i in 1:length(x))
{
print(y(x[i]))
}
# The answer ma... | /Probability_And_Statistics,_4th_Edition_by_Morris_H._Degroot,_Carnegie-Mellon_University_&_Mark_J._Schervish,_Carnegie-Mellon_University/CH3/EX3.8.6/Ex3_8_6.R | permissive | prashantsinalkar/R_TBC_Uploads | R | false | false | 363 | r | # Chapter 3 - Random Variables and Distributions, Section - 3.8 (Functions of a Random Variable), Page No. - 171
y<-function(x)
{
2*(1-((1-x)^0.5))
}
# Let the three generated values be stored in the variable 'x'.
x<-c(0.4125,0.0894,0.8302)
for(i in 1:length(x))
{
print(y(x[i]))
}
# The answer ma... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tables.R
\name{DataTableWithRItemFormat}
\alias{DataTableWithRItemFormat}
\title{\code{DataTableWithRItemFormat}}
\usage{
DataTableWithRItemFormat(dd, caption = NULL, header.alignments = NULL,
allow.length.change = TRUE, length.menu = c(10,... | /man/DataTableWithRItemFormat.Rd | no_license | gkalnytskyi/flipFormat | R | false | true | 1,793 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tables.R
\name{DataTableWithRItemFormat}
\alias{DataTableWithRItemFormat}
\title{\code{DataTableWithRItemFormat}}
\usage{
DataTableWithRItemFormat(dd, caption = NULL, header.alignments = NULL,
allow.length.change = TRUE, length.menu = c(10,... |
# Load packages ----------------------------------------------------------
library(tidyverse)
library(googlesheets)
library(janitor)
library(ggthemes)
library(extrafont)
library(plotly)
loadfonts()
##Only need to run if fonts haven't been added to your computer yet (Windows)
# font_import()
#
# Import survey dat... | /campus_bird_window_survey_page/R-Scripts/02_survey_report.R | no_license | aluro2/aluro2.github.io | R | false | false | 11,198 | r |
# Load packages ----------------------------------------------------------
library(tidyverse)
library(googlesheets)
library(janitor)
library(ggthemes)
library(extrafont)
library(plotly)
loadfonts()
##Only need to run if fonts haven't been added to your computer yet (Windows)
# font_import()
#
# Import survey dat... |
utils::globalVariables("density")
#' @title Plot frequencies of variables
#' @name plot_frq
#'
#' @description Plot frequencies of a variable as bar graph, histogram, box plot etc.
#'
#' @note This function only works with variables with integer values (or numeric
#' factor levels), i.e. scales / centered vari... | /R/plot_frq.R | no_license | suukit/maksPlot | R | false | false | 25,685 | r | utils::globalVariables("density")
#' @title Plot frequencies of variables
#' @name plot_frq
#'
#' @description Plot frequencies of a variable as bar graph, histogram, box plot etc.
#'
#' @note This function only works with variables with integer values (or numeric
#' factor levels), i.e. scales / centered vari... |
suppressPackageStartupMessages(library(gmailr))
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(purrr))
library(readr)
library(formattable)
## edit line below to reflect YOUR json credential filename
use_secret_file("sm-secret.json")
load("~/Dropbox/R-wd/learniat_variables")
d$tb... | /bulk-emailing/tutorial.R | no_license | rashmimehrotra/learniatR | R | false | false | 1,577 | r | suppressPackageStartupMessages(library(gmailr))
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(purrr))
library(readr)
library(formattable)
## edit line below to reflect YOUR json credential filename
use_secret_file("sm-secret.json")
load("~/Dropbox/R-wd/learniat_variables")
d$tb... |
setwd("C:/Users/kotha020/Dropbox/PostdocProjects/FreshLeafModels")
library(spectrolab)
library(pls)
library(reshape2)
library(ggplot2)
library(RColorBrewer)
library(patchwork)
## download VIP.R from Bjorn-Helge Mevik's website:
## https://mevik.net/work/software/pls.html
source("Scripts/VIP.R")
source("Scripts/CABO-t... | /05C build_models_abs.R | no_license | ShanKothari/CABO-trait-models | R | false | false | 78,108 | r | setwd("C:/Users/kotha020/Dropbox/PostdocProjects/FreshLeafModels")
library(spectrolab)
library(pls)
library(reshape2)
library(ggplot2)
library(RColorBrewer)
library(patchwork)
## download VIP.R from Bjorn-Helge Mevik's website:
## https://mevik.net/work/software/pls.html
source("Scripts/VIP.R")
source("Scripts/CABO-t... |
"error.crosses" <-
function (x,y,labels=NULL,main=NULL,xlim=NULL,ylim= NULL,xlab=NULL,ylab=NULL,pos=NULL,offset=1,arrow.len=.2,alpha=.05,sd=FALSE,add=FALSE,...) # x and y are data frame or descriptive stats
{if(is.vector(x)) {x <- describe(x)}
xmin <- min(x$mean)
xmax <- max(x$mean)
if(sd) {max.sex... | /psych/R/error.crosses.R | no_license | ingted/R-Examples | R | false | false | 2,208 | r | "error.crosses" <-
function (x,y,labels=NULL,main=NULL,xlim=NULL,ylim= NULL,xlab=NULL,ylab=NULL,pos=NULL,offset=1,arrow.len=.2,alpha=.05,sd=FALSE,add=FALSE,...) # x and y are data frame or descriptive stats
{if(is.vector(x)) {x <- describe(x)}
xmin <- min(x$mean)
xmax <- max(x$mean)
if(sd) {max.sex... |
# Libraries
# Tidyverse resources
library(package = "tidyverse") # Multiple Tidyverse Resources
library(package = "lubridate") # Date-Time Control
# NCAR Libraries
# Pulling Hucs for Zone Lookup Tables
HUC_LUT_URL = "http://kyrill.ias.sdsmt.edu/wjc/eduresources/HUC08_Missouri_River_Basin.Rdata"
l... | /repair_loca_Rdata.R | no_license | wjcapehart/LOCA_Percentile_Processing | R | false | false | 8,092 | r |
# Libraries
# Tidyverse resources
library(package = "tidyverse") # Multiple Tidyverse Resources
library(package = "lubridate") # Date-Time Control
# NCAR Libraries
# Pulling Hucs for Zone Lookup Tables
HUC_LUT_URL = "http://kyrill.ias.sdsmt.edu/wjc/eduresources/HUC08_Missouri_River_Basin.Rdata"
l... |
#' Title
#'
#' @param structure.chain
#' @param cluster
#'
#' @return
#' @export
#'
#' @examples
seq_cluster <- function(structure.chain, cluster = 40){
# http://www.rcsb.org/pdb/rest/sequenceCluster?cluster=40&structureId=4hhb.A
# structure_id <- check_current(structure_id)
if(!any(grepl('\\.', sturcture.chain)))... | /R/seq_cluster.R | no_license | cangfengzhe/RCSB.pdb | R | false | false | 1,086 | r | #' Title
#'
#' @param structure.chain
#' @param cluster
#'
#' @return
#' @export
#'
#' @examples
seq_cluster <- function(structure.chain, cluster = 40){
# http://www.rcsb.org/pdb/rest/sequenceCluster?cluster=40&structureId=4hhb.A
# structure_id <- check_current(structure_id)
if(!any(grepl('\\.', sturcture.chain)))... |
##################################################
###### SIMULATION EXPERIMENTS ######
##################################################
# Simulation provides a straightforward way of
# approximating probabilities.One simulates a
# particular random experiment a large number
# of times, and a... | /section_3_4/scripts/Simulation-Experiments.R | no_license | rCarlNU/r_programming_for_simulation_and_monte_carlo_methods | R | false | false | 20,196 | r | ##################################################
###### SIMULATION EXPERIMENTS ######
##################################################
# Simulation provides a straightforward way of
# approximating probabilities.One simulates a
# particular random experiment a large number
# of times, and a... |
library(httr) # for GET(...)
library(rjson) # for fromJSON(...)
library(miniUI)
library(shiny)
set_config( config( ssl_verifypeer = 0L ) )
set_config( config( ssl_verifyhost = 0L ) )
#CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_SSL_VERIFYHOST => 0,
setwd("c:/Users/ndevert/Documents/INRA/repo/R/micromic/")
rmarkdown::ren... | /serveur.R | no_license | NicolasDevert/micromic_r_scripts | R | false | false | 1,190 | r | library(httr) # for GET(...)
library(rjson) # for fromJSON(...)
library(miniUI)
library(shiny)
set_config( config( ssl_verifypeer = 0L ) )
set_config( config( ssl_verifyhost = 0L ) )
#CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_SSL_VERIFYHOST => 0,
setwd("c:/Users/ndevert/Documents/INRA/repo/R/micromic/")
rmarkdown::ren... |
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/join_map_files.R
\name{join_map_files}
\alias{join_map_files}
\title{join_map_files}
\usage{
join_map_files(assessment_results, students_by_school)
}
\arguments{
\item{assessment_results}{}
\item{students_by_school}{}
}
\description{... | /man/join_map_files.Rd | no_license | almartin82/MAP-visuals | R | false | false | 394 | rd | % Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/join_map_files.R
\name{join_map_files}
\alias{join_map_files}
\title{join_map_files}
\usage{
join_map_files(assessment_results, students_by_school)
}
\arguments{
\item{assessment_results}{}
\item{students_by_school}{}
}
\description{... |
# Jake Yeung
# Date of Creation: 2020-09-03
# File: ~/projects/scchic/scripts/rstudioserver_analysis/celltyping_with_chix/1-get_bins_from_cleaned_data.again.R
#
rm(list=ls())
library(dplyr)
library(tidyr)
library(ggplot2)
library(data.table)
library(Matrix)
# Load data -------------------------------------------... | /scripts/rstudioserver_analysis/celltyping_with_chix/1-get_bins_from_cleaned_data.again.R | no_license | jakeyeung/sortchicAllScripts | R | false | false | 3,200 | r | # Jake Yeung
# Date of Creation: 2020-09-03
# File: ~/projects/scchic/scripts/rstudioserver_analysis/celltyping_with_chix/1-get_bins_from_cleaned_data.again.R
#
rm(list=ls())
library(dplyr)
library(tidyr)
library(ggplot2)
library(data.table)
library(Matrix)
# Load data -------------------------------------------... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get.R
\name{RemoveBackticks}
\alias{RemoveBackticks}
\title{\code{RemoveBackticks}}
\usage{
RemoveBackticks(nms)
}
\arguments{
\item{nms}{Vector of variable names.}
}
\description{
Removes backticks surrounding variable names (first and last ... | /man/RemoveBackticks.Rd | no_license | Displayr/flipData | R | false | true | 334 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get.R
\name{RemoveBackticks}
\alias{RemoveBackticks}
\title{\code{RemoveBackticks}}
\usage{
RemoveBackticks(nms)
}
\arguments{
\item{nms}{Vector of variable names.}
}
\description{
Removes backticks surrounding variable names (first and last ... |
library(zoo)
#png("inflation.png",width=640)
plot(compact.df$Date, compact.df$USD,
xlab="Date",ylab="NZD to USD conversion rate",main="NZD value over time")
abline(h=1)
for(i2 in 2:length(nzp$Col)) {
i = i2 - 1
xl = nzp$Year[i]
xr = nzp$Year[i2]
y1 = par("usr")[3]
y2 = par("usr")[4]
rect(xl,y1,xr,y2,col=nzp$C... | /Inflation/plotter.r | no_license | christopear/UoA-Studentship | R | false | false | 641 | r | library(zoo)
#png("inflation.png",width=640)
plot(compact.df$Date, compact.df$USD,
xlab="Date",ylab="NZD to USD conversion rate",main="NZD value over time")
abline(h=1)
for(i2 in 2:length(nzp$Col)) {
i = i2 - 1
xl = nzp$Year[i]
xr = nzp$Year[i2]
y1 = par("usr")[3]
y2 = par("usr")[4]
rect(xl,y1,xr,y2,col=nzp$C... |
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 4.04956162694753e+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_alpha/AFL_communities_individual_based_sampling_alpha/communities_individual_based_sampling_alpha_valgrind_files/1615771241-test.R | no_license | akhikolla/updatedatatype-list2 | R | false | false | 362 | r | testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 4.04956162694753e+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_... |
comp <- my_csv %>%
filter(doc_id %in% c("doc42", "doc44"))
comp <- bind_rows(doc42_44, cs, aor)
comp_words <- comp %>%
unnest_tokens(word, text) %>%
count(doc_id, word, sort = TRUE)
comp_total_words <- comp_words %>%
group_by(doc_id) %>%
summarize(total = sum(n))
comp_words <- left_join(comp_words, com... | /doc_comparison.R | no_license | kstinso/cli02_final | R | false | false | 5,113 | r | comp <- my_csv %>%
filter(doc_id %in% c("doc42", "doc44"))
comp <- bind_rows(doc42_44, cs, aor)
comp_words <- comp %>%
unnest_tokens(word, text) %>%
count(doc_id, word, sort = TRUE)
comp_total_words <- comp_words %>%
group_by(doc_id) %>%
summarize(total = sum(n))
comp_words <- left_join(comp_words, com... |
rm(list=ls())
setwd("C:/Users/xswang/HAB Research/")
#####################################################################################
##Read in data
testpred = read.csv('testpred_cross_SMOTE.csv')
testpred$X = NULL
####################################################################################
##Get ... | /metrics cross SMOTE.R | no_license | mfli-ml/WFS_ML | R | false | false | 3,498 | r | rm(list=ls())
setwd("C:/Users/xswang/HAB Research/")
#####################################################################################
##Read in data
testpred = read.csv('testpred_cross_SMOTE.csv')
testpred$X = NULL
####################################################################################
##Get ... |
context("ncdc_locs")
test_that("ncdc_locs returns the correct class", {
skip_on_cran()
vcr::use_cassette("ncdc_locs", {
tt <- ncdc_locs(datasetid='NORMAL_DLY', startdate='20100101')
uu <- ncdc_locs(locationcategoryid='ST', limit=52)
})
# class
expect_is(tt, "ncdc_locs")
expect_is(uu, "ncdc_lo... | /tests/testthat/test-ncdc_locs.r | permissive | ropensci/rnoaa | R | false | false | 1,208 | r | context("ncdc_locs")
test_that("ncdc_locs returns the correct class", {
skip_on_cran()
vcr::use_cassette("ncdc_locs", {
tt <- ncdc_locs(datasetid='NORMAL_DLY', startdate='20100101')
uu <- ncdc_locs(locationcategoryid='ST', limit=52)
})
# class
expect_is(tt, "ncdc_locs")
expect_is(uu, "ncdc_lo... |
rm(list = ls())
source("../setpath.R")
library(e1071)
df = read.csv(file.path(out_data_path,"MLDB_medium.csv"),check.names = FALSE)
condition = read.csv(file.path(out_data_path,"CultureCondition.csv"),check.names = FALSE,
stringsAsFactors = FALSE)
ss = paste(colnames(condition), condition[1,], ... | /3_ML/src/predictions/SVM_pred.R | permissive | IBPA/MutationDB | R | false | false | 1,109 | r | rm(list = ls())
source("../setpath.R")
library(e1071)
df = read.csv(file.path(out_data_path,"MLDB_medium.csv"),check.names = FALSE)
condition = read.csv(file.path(out_data_path,"CultureCondition.csv"),check.names = FALSE,
stringsAsFactors = FALSE)
ss = paste(colnames(condition), condition[1,], ... |
# Define regions to query in multi alignment ###################################
# Author: Miguel Angel Garcia-Campos https://github.com/AngelCampos ############
# Functions ####################################################################
# Saves tab separated table
mytable <- function(X, fileName){
write.table(... | /m6A/1.0_sampleTestPeaks.R | permissive | AngelCampos/seq_conservation | R | false | false | 709 | r | # Define regions to query in multi alignment ###################################
# Author: Miguel Angel Garcia-Campos https://github.com/AngelCampos ############
# Functions ####################################################################
# Saves tab separated table
mytable <- function(X, fileName){
write.table(... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/biounit.R
\name{biounit}
\alias{biounit}
\title{Biological Units Construction}
\usage{
biounit(pdb, biomat = NULL, multi = FALSE, ncore = NULL)
}
\arguments{
\item{pdb}{an object of class \code{pdb} as obtained from
function \code{\link{read.... | /ver_devel/bio3d/man/biounit.Rd | no_license | Grantlab/bio3d | R | false | true | 2,097 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/biounit.R
\name{biounit}
\alias{biounit}
\title{Biological Units Construction}
\usage{
biounit(pdb, biomat = NULL, multi = FALSE, ncore = NULL)
}
\arguments{
\item{pdb}{an object of class \code{pdb} as obtained from
function \code{\link{read.... |
\docType{methods}
\name{aSnpMatrix-methods}
\alias{[}
\alias{[,aSnpMatrix,ANY,ANY,missing-method}
\alias{[,aSnpMatrix,ANY,missing,missing-method}
\alias{[,aSnpMatrix,missing,ANY,missing-method}
\alias{[,aXSnpMatrix,ANY,ANY,missing-method}
\alias{[,aXSnpMatrix,ANY,missing,missing-method}
\alias{[,aXSnpMatrix,missing,ANY... | /man/aSnpMatrix-methods.Rd | no_license | nicholasjcooper/annotSnpStats | R | false | false | 1,803 | rd | \docType{methods}
\name{aSnpMatrix-methods}
\alias{[}
\alias{[,aSnpMatrix,ANY,ANY,missing-method}
\alias{[,aSnpMatrix,ANY,missing,missing-method}
\alias{[,aSnpMatrix,missing,ANY,missing-method}
\alias{[,aXSnpMatrix,ANY,ANY,missing-method}
\alias{[,aXSnpMatrix,ANY,missing,missing-method}
\alias{[,aXSnpMatrix,missing,ANY... |
#' @title Add custom identifier to an existing item
#'
#' @template manipulate_item
#' @param scheme The identifier scheme
#' @param type The identifier type
#' @param key The identifier key
#'
#' @description
#' Adds or updates an item's alternative identifier. This can add
#' additional identifiers or update th... | /R/item_update_identifier.R | permissive | PatrickEslick/sbtools | R | false | false | 2,533 | r | #' @title Add custom identifier to an existing item
#'
#' @template manipulate_item
#' @param scheme The identifier scheme
#' @param type The identifier type
#' @param key The identifier key
#'
#' @description
#' Adds or updates an item's alternative identifier. This can add
#' additional identifiers or update th... |
"otu.plots.fig2" <- function(input_traits, input_otutable, input_otuscontributing, input_map, input_taxonomy){
#define inputs
traits <- input_traits
otu_table <- input_otutable
otus_contributing <- input_otuscontributing
map <- input_map
taxonomy <- input_taxonomy
map_column <- "HMPBODYSUBSITE"
#Convert to ... | /bin/otu.plots.fig2.r | no_license | TonyaWard/BugBase_Manuscript | R | false | false | 7,111 | r | "otu.plots.fig2" <- function(input_traits, input_otutable, input_otuscontributing, input_map, input_taxonomy){
#define inputs
traits <- input_traits
otu_table <- input_otutable
otus_contributing <- input_otuscontributing
map <- input_map
taxonomy <- input_taxonomy
map_column <- "HMPBODYSUBSITE"
#Convert to ... |
# check forest argument for problems
checkForest <- function(forest) {
if (typeof(forest) != "list") {
stop("'forest' is not of the correct type")
} else if (!any(c("randomForest", "ranger", "rfsrc", "quantregForest") %in% class(forest))) {
stop("'forest' is not of the correct class")
} else if (is.null(f... | /R/checkargs.R | no_license | vathymut/forestError | R | false | false | 4,263 | r | # check forest argument for problems
checkForest <- function(forest) {
if (typeof(forest) != "list") {
stop("'forest' is not of the correct type")
} else if (!any(c("randomForest", "ranger", "rfsrc", "quantregForest") %in% class(forest))) {
stop("'forest' is not of the correct class")
} else if (is.null(f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.