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 |
|---|---|---|---|---|---|---|---|---|---|
readData <- function(file.xlsx) {
require(readxl)
require(stringr)
nms <- names(read_excel(file.xlsx, n_max=0))
datix <- which(grepl('Annotated Sequence|^Protein Accessions|File ID|Isolation Interference|Abundance', nms))
col_types_data <- ifelse(seq(length(nms)) %in% datix, 'guess', 'skip')
... | /SCMS.R | no_license | harvardinformatics/SingleCellProteomics | R | false | false | 3,210 | r | readData <- function(file.xlsx) {
require(readxl)
require(stringr)
nms <- names(read_excel(file.xlsx, n_max=0))
datix <- which(grepl('Annotated Sequence|^Protein Accessions|File ID|Isolation Interference|Abundance', nms))
col_types_data <- ifelse(seq(length(nms)) %in% datix, 'guess', 'skip')
... |
## ---- TrueValues ----------------------------------------
trueValue <- sim_obj %>%
group_by(design, replicate, id) %>%
transmute(
p = map_dbl(obj, "p"),
m = map_dbl(obj, "m"),
n = map_dbl(obj, "n"),
minerror = map(obj, "minerror"),
trueBeta = map(obj, "beta"),
tes... | /scripts/example1/06-true-values.r | no_license | therimalaya/simrel-m | R | false | false | 497 | r | ## ---- TrueValues ----------------------------------------
trueValue <- sim_obj %>%
group_by(design, replicate, id) %>%
transmute(
p = map_dbl(obj, "p"),
m = map_dbl(obj, "m"),
n = map_dbl(obj, "n"),
minerror = map(obj, "minerror"),
trueBeta = map(obj, "beta"),
tes... |
get_catalog_brfss <-
function( data_name = "brfss" , output_dir , ... ){
data_page <- readLines( "https://www.cdc.gov/brfss/annual_data/annual_data.htm" )
available_years <- sort( unique( gsub( "(.*)/brfss/annual_data/annual_([0-9][0-9][0-9][0-9]).htm(.*)" , "\\2" , grep( "annual_data/annual_([0-9][0-9][0-9][... | /R/brfss.R | no_license | jjsjaime/lodown | R | false | false | 10,849 | r | get_catalog_brfss <-
function( data_name = "brfss" , output_dir , ... ){
data_page <- readLines( "https://www.cdc.gov/brfss/annual_data/annual_data.htm" )
available_years <- sort( unique( gsub( "(.*)/brfss/annual_data/annual_([0-9][0-9][0-9][0-9]).htm(.*)" , "\\2" , grep( "annual_data/annual_([0-9][0-9][0-9][... |
try(library(bindrcpp))
try(library(conveniencefunctions))
try(library(magrittr))
try(library(forcats))
try(library(dplyr))
try(library(purrr))
try(library(readr))
try(library(tidyr))
try(library(tibble))
try(library(ggplot2))
try(library(tidyverse))
try(library(stringr))
try(library(dMod))
try(library(cOde))
try(librar... | /fit/limaxfit/tmp_f3uew_1.R | no_license | matthiaskoenig/methacetin_fitting | R | false | false | 811 | r | try(library(bindrcpp))
try(library(conveniencefunctions))
try(library(magrittr))
try(library(forcats))
try(library(dplyr))
try(library(purrr))
try(library(readr))
try(library(tidyr))
try(library(tibble))
try(library(ggplot2))
try(library(tidyverse))
try(library(stringr))
try(library(dMod))
try(library(cOde))
try(librar... |
library(cure4insect)
load_common_data()
.c4if=cure4insect:::.c4if
.c4is=cure4insect:::.c4is
rpa <- raster(system.file("extdata/pAspen.tif", package="cure4insect"))
KT <- .c4if$KT
load("d:/abmi/AB_data_v2018/data/analysis/kgrid_table_km.Rdata")
load("d:/abmi/AB_data_v2019/misc/overlap/OverlapReg.RData")
rownames(Overla... | /birds/overlap-region.R | no_license | psolymos/abmianalytics | R | false | false | 1,101 | r | library(cure4insect)
load_common_data()
.c4if=cure4insect:::.c4if
.c4is=cure4insect:::.c4is
rpa <- raster(system.file("extdata/pAspen.tif", package="cure4insect"))
KT <- .c4if$KT
load("d:/abmi/AB_data_v2018/data/analysis/kgrid_table_km.Rdata")
load("d:/abmi/AB_data_v2019/misc/overlap/OverlapReg.RData")
rownames(Overla... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/triad-tallies.R
\name{triad_tallies}
\alias{triad_tallies}
\alias{triad_tallies}
\alias{connectedTriples}
\alias{oneTiedTriads}
\alias{twoTiedTriads}
\alias{threeTiedTriads}
\title{Triad tallies}
\usage{
connectedTriples(bigraph, graph = acto... | /man/triad_tallies.Rd | no_license | petershan1119/bitriad | R | false | true | 1,234 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/triad-tallies.R
\name{triad_tallies}
\alias{triad_tallies}
\alias{triad_tallies}
\alias{connectedTriples}
\alias{oneTiedTriads}
\alias{twoTiedTriads}
\alias{threeTiedTriads}
\title{Triad tallies}
\usage{
connectedTriples(bigraph, graph = acto... |
library('ggplot2')
values = c(c(0.025443, 0.005587),c(0.032057, 0.007040),c(0.0435947111, 0.00957403611),c(0.05449057777, 0.0119669277777),c(0.103089066666, 0.0226398666))
service=c(rep("0.25/0.5", 2),rep("0.5/1", 2),rep("1/2", 2),rep("2/4", 2), rep("4/8", 2))
resource=rep(c("vCPU", "memory"),5)
data=data.frame(servi... | /1_ellipsoids/fargate_price.R | no_license | burkat/paper | R | false | false | 715 | r | library('ggplot2')
values = c(c(0.025443, 0.005587),c(0.032057, 0.007040),c(0.0435947111, 0.00957403611),c(0.05449057777, 0.0119669277777),c(0.103089066666, 0.0226398666))
service=c(rep("0.25/0.5", 2),rep("0.5/1", 2),rep("1/2", 2),rep("2/4", 2), rep("4/8", 2))
resource=rep(c("vCPU", "memory"),5)
data=data.frame(servi... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spatial_interaction_spot.R
\name{do_permuttest_random_spot}
\alias{do_permuttest_random_spot}
\title{do_permuttest_random_spot}
\usage{
do_permuttest_random_spot(
sel_int,
other_ints,
select_ind,
other_ind,
name = "perm_1",
proxim... | /man/do_permuttest_random_spot.Rd | permissive | RubD/Giotto | R | false | true | 458 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spatial_interaction_spot.R
\name{do_permuttest_random_spot}
\alias{do_permuttest_random_spot}
\title{do_permuttest_random_spot}
\usage{
do_permuttest_random_spot(
sel_int,
other_ints,
select_ind,
other_ind,
name = "perm_1",
proxim... |
library(bfp)
set.seed (234)
## setting where the error occured
beta0 <- 1
alpha1 <- 1
alpha2 <- c (1, 1)
delta1 <- 1
sampleSize <- c (40, 100)
sigma2 <- c (4, 3, 2, 1)
hyperpara <- c (3.05, 3.4, 3.7, 3.95)
h <- 1
i <- 4
j <- 4
thisN <- sampleSize[h]
x <- matrix (runif (thisN * 3, 1, 4), nrow = thisN, ncol = 3) # ... | /fuzzedpackages/bfp/tests/testSimulation.R | no_license | akhikolla/testpackages | R | false | false | 1,058 | r | library(bfp)
set.seed (234)
## setting where the error occured
beta0 <- 1
alpha1 <- 1
alpha2 <- c (1, 1)
delta1 <- 1
sampleSize <- c (40, 100)
sigma2 <- c (4, 3, 2, 1)
hyperpara <- c (3.05, 3.4, 3.7, 3.95)
h <- 1
i <- 4
j <- 4
thisN <- sampleSize[h]
x <- matrix (runif (thisN * 3, 1, 4), nrow = thisN, ncol = 3) # ... |
% Generated by roxygen2 (4.0.0): do not edit by hand
\name{gtmPosteriorMode}
\alias{gtmPosteriorMode}
\title{Posterior-mode projection of the samples used for training the given GTM.}
\usage{
gtmPosteriorMode(model)
}
\arguments{
\item{model}{an instance of \code{gtm}}
}
\value{
a LxN matrix whose rows represent the pr... | /man/gtmPosteriorMode.Rd | no_license | afwlehmann/gentopmap | R | false | false | 527 | rd | % Generated by roxygen2 (4.0.0): do not edit by hand
\name{gtmPosteriorMode}
\alias{gtmPosteriorMode}
\title{Posterior-mode projection of the samples used for training the given GTM.}
\usage{
gtmPosteriorMode(model)
}
\arguments{
\item{model}{an instance of \code{gtm}}
}
\value{
a LxN matrix whose rows represent the pr... |
# ===================
# Tests for lav2nlsem
# ===================
library(nlsem)
# ordinary lms
# ============
lms_model <- '
xi1 =~ x1 + x2 + x3
xi2 =~ x4 + x5 + x6
eta1 =~ y1 + y2 + y3
eta2 =~ y4 + y5 + y6
eta1 ~ xi2 + xi1:xi2
eta2 ~ xi1 + eta1
'
lav2nlsem(lms_model)
# ordinary lms with different inp... | /tests/tests_for_lav2nlsem.R | no_license | cran/nlsem | R | false | false | 2,555 | r | # ===================
# Tests for lav2nlsem
# ===================
library(nlsem)
# ordinary lms
# ============
lms_model <- '
xi1 =~ x1 + x2 + x3
xi2 =~ x4 + x5 + x6
eta1 =~ y1 + y2 + y3
eta2 =~ y4 + y5 + y6
eta1 ~ xi2 + xi1:xi2
eta2 ~ xi1 + eta1
'
lav2nlsem(lms_model)
# ordinary lms with different inp... |
% Generated by roxygen2 (4.0.1): do not edit by hand
\name{list.clean}
\alias{list.clean}
\title{Clean a list by a function}
\usage{
list.clean(.data, fun = is.null, recursive = FALSE)
}
\arguments{
\item{.data}{\code{list}}
\item{fun}{A logical \code{function} for clean}
\item{recursive}{\code{logical}. Should the l... | /man/list.clean.Rd | permissive | timelyportfolio/rlist | R | false | false | 474 | rd | % Generated by roxygen2 (4.0.1): do not edit by hand
\name{list.clean}
\alias{list.clean}
\title{Clean a list by a function}
\usage{
list.clean(.data, fun = is.null, recursive = FALSE)
}
\arguments{
\item{.data}{\code{list}}
\item{fun}{A logical \code{function} for clean}
\item{recursive}{\code{logical}. Should the l... |
var1<-sample(5)
var2<-var1/10
var3<-c("My","Name","Is","Anthony","Gonsalvis")
res<-data.frame(var1,var2,var3)
names(res)<-c("var Int","var Float","var String")
write.csv(res,"imp.csv",row.names=FALSE)
res1<-read.csv("imp.csv")
print(res1) | /DataMining-Lab-Vatsa/R/1/impexp.R | no_license | sreevatsabellary/Data_Mining_Lab | R | false | false | 240 | r | var1<-sample(5)
var2<-var1/10
var3<-c("My","Name","Is","Anthony","Gonsalvis")
res<-data.frame(var1,var2,var3)
names(res)<-c("var Int","var Float","var String")
write.csv(res,"imp.csv",row.names=FALSE)
res1<-read.csv("imp.csv")
print(res1) |
### =========================================================================
### Variant QA (as opposed to the calling filters)
### -------------------------------------------------------------------------
qaVariants <- function(x, qa.filters = VariantQAFilters(...), ...)
{
softFilter(x, qa.filters)
}
VariantQAFil... | /R/qaVariants.R | no_license | gmbecker/VariantTools | R | false | false | 2,982 | r | ### =========================================================================
### Variant QA (as opposed to the calling filters)
### -------------------------------------------------------------------------
qaVariants <- function(x, qa.filters = VariantQAFilters(...), ...)
{
softFilter(x, qa.filters)
}
VariantQAFil... |
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/pls.R
\name{pls}
\alias{pls}
\title{Partial Least Squares regression}
\usage{
pls(x, y, ncomp = 15, center = T, scale = F, cv = NULL, x.test = NULL,
y.test = NULL, method = "simpls", alpha = 0.05, coeffs.ci = NULL,
coeffs.alpha = ... | /man/pls.Rd | no_license | zeehio/mdatools | R | false | false | 9,493 | rd | % Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/pls.R
\name{pls}
\alias{pls}
\title{Partial Least Squares regression}
\usage{
pls(x, y, ncomp = 15, center = T, scale = F, cv = NULL, x.test = NULL,
y.test = NULL, method = "simpls", alpha = 0.05, coeffs.ci = NULL,
coeffs.alpha = ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/discovr_data.R
\docType{data}
\name{zhang_sample}
\alias{zhang_sample}
\title{Zhang et al. (2013) (subsample)}
\format{
A tibble with 52 rows and 4 variables
}
\source{
\href{https://www.discovr.rocks/csv/zhang_2013_subsample.csv}{www.discovr... | /man/zhang_sample.Rd | no_license | KristenDowns/discovr | R | false | true | 2,061 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/discovr_data.R
\docType{data}
\name{zhang_sample}
\alias{zhang_sample}
\title{Zhang et al. (2013) (subsample)}
\format{
A tibble with 52 rows and 4 variables
}
\source{
\href{https://www.discovr.rocks/csv/zhang_2013_subsample.csv}{www.discovr... |
# data set https://data.cms.gov/Medicare-Inpatient/Inpatient-Prospective-Payment-System-IPPS-Provider/97k6-zzx3
library(shiny)
library(dplyr)
library(ggplot2)
library(plotly)
# read in data from same directory that app.R file is in
payments <- readr::read_csv("healthcare_payments.csv")
# get unique Medicare Severity... | /1_intro/D_boxplot/app.R | no_license | NateByers/shinytraining | R | false | false | 2,314 | r | # data set https://data.cms.gov/Medicare-Inpatient/Inpatient-Prospective-Payment-System-IPPS-Provider/97k6-zzx3
library(shiny)
library(dplyr)
library(ggplot2)
library(plotly)
# read in data from same directory that app.R file is in
payments <- readr::read_csv("healthcare_payments.csv")
# get unique Medicare Severity... |
#' Law-Watkinson model for projecting abundances,
#' with a global alpha and no covariate effects
#'
#' @param lambda numeric lambda value.
#' @param alpha_intra included for compatibility, not used in this model.
#' @param alpha_inter single numeric value.
#' @param lambda_cov included for compatibility, not used in ... | /R/LW_project_alpha_global_lambdacov_none_alphacov_none.R | permissive | RadicalCommEcol/cxr | R | false | false | 1,456 | r |
#' Law-Watkinson model for projecting abundances,
#' with a global alpha and no covariate effects
#'
#' @param lambda numeric lambda value.
#' @param alpha_intra included for compatibility, not used in this model.
#' @param alpha_inter single numeric value.
#' @param lambda_cov included for compatibility, not used in ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/update_study_annotations.R
\name{.update_view_data}
\alias{.update_view_data}
\title{Replace/update table contents = input data must have ROW_ID, ROW_VERSION, ETAG columns to update.}
\usage{
.update_view_data(table_id, new_data)
}
\arguments... | /man/dot-update_view_data.Rd | permissive | BrunoGrandePhD/nfportalutils | R | false | true | 531 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/update_study_annotations.R
\name{.update_view_data}
\alias{.update_view_data}
\title{Replace/update table contents = input data must have ROW_ID, ROW_VERSION, ETAG columns to update.}
\usage{
.update_view_data(table_id, new_data)
}
\arguments... |
#Cargar base de datos
library(readxl)
BD <- read_excel("Datos final.xlsx", sheet = "Datos")
#Creacion de periodo final
library(lubridate)
BD<-BD[order(BD$final_time),]
p=2
for (i in 1:length(BD$final_time)){
BD$Periodo_final[i]<-p
if(yday(BD$final_time[i+1])-yday(BD$final_time[i])==1 && wday(BD$final_tim... | /BD vacia.R | no_license | AngelicaValdes/Tesis | R | false | false | 2,141 | r | #Cargar base de datos
library(readxl)
BD <- read_excel("Datos final.xlsx", sheet = "Datos")
#Creacion de periodo final
library(lubridate)
BD<-BD[order(BD$final_time),]
p=2
for (i in 1:length(BD$final_time)){
BD$Periodo_final[i]<-p
if(yday(BD$final_time[i+1])-yday(BD$final_time[i])==1 && wday(BD$final_tim... |
### show data from table
showdata<-function(table, fields = ""){
conn<-conn()
sql<-ifelse(nchar(fields)==0, paste("select * from ", table, sep = ""),
paste("select ", fields, " from ", table, sep = ""))
#sql<-paste("select ", sl," from ", table, sep = "")
rs<-dbGetQuery(conn, sql)
dbDisconnect(... | /R/showdata.R | no_license | trinhdangmau/bio-labs | R | false | false | 343 | r | ### show data from table
showdata<-function(table, fields = ""){
conn<-conn()
sql<-ifelse(nchar(fields)==0, paste("select * from ", table, sep = ""),
paste("select ", fields, " from ", table, sep = ""))
#sql<-paste("select ", sl," from ", table, sep = "")
rs<-dbGetQuery(conn, sql)
dbDisconnect(... |
#########
# Function to run ODEs
# with random generation of parameters
# raina & christina
########
s1<- read.csv("sensitivity/lhc/lhc_humans_dd_R0vary_phi0.9.csv",header=T) # dataframe of random parameters
param.list <- apply(s1,1,as.list) #converting into a list
times <- seq(0, 20, by = 0.01) #time steps are cons... | /sensitivity/sensitivity_func_cluster_SI.R | no_license | cfaustus/core_matrix_publish | R | false | false | 2,716 | r | #########
# Function to run ODEs
# with random generation of parameters
# raina & christina
########
s1<- read.csv("sensitivity/lhc/lhc_humans_dd_R0vary_phi0.9.csv",header=T) # dataframe of random parameters
param.list <- apply(s1,1,as.list) #converting into a list
times <- seq(0, 20, by = 0.01) #time steps are cons... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/reorder.R
\name{ran}
\alias{ran}
\title{Derives the range of a vector}
\usage{
ran(x)
}
\arguments{
\item{x}{vector with unknown range}
}
\value{
the range of the vector
}
\description{
Derives the range of a vector
}
\examples{
custom_vector... | /man/ran.Rd | no_license | dzimmermann-tgm/yinyang | R | false | true | 358 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/reorder.R
\name{ran}
\alias{ran}
\title{Derives the range of a vector}
\usage{
ran(x)
}
\arguments{
\item{x}{vector with unknown range}
}
\value{
the range of the vector
}
\description{
Derives the range of a vector
}
\examples{
custom_vector... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/print.svyContTable.R
\name{print.svyContTable}
\alias{print.svyContTable}
\title{Format and print \code{svyContTable} class objects}
\usage{
\method{print}{svyContTable}(
x,
digits = 2,
pDigits = 3,
quote = FALSE,
missing = FALSE,
... | /man/print.svyContTable.Rd | no_license | JhuangLabTools/tableone | R | false | true | 2,608 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/print.svyContTable.R
\name{print.svyContTable}
\alias{print.svyContTable}
\title{Format and print \code{svyContTable} class objects}
\usage{
\method{print}{svyContTable}(
x,
digits = 2,
pDigits = 3,
quote = FALSE,
missing = FALSE,
... |
# Caching the inverse of a matrix. See test_cachematrix.R for some unit tests.
# This function creates a special "matrix" object that can cache its inverse.
makeCacheMatrix <- function(x = matrix()) {
# The variables x (formal argument) and x_inv below hold the matrix
# and its inverse, respectively. x_inv is... | /cachematrix.R | no_license | yasserglez/ProgrammingAssignment2 | R | false | false | 1,783 | r | # Caching the inverse of a matrix. See test_cachematrix.R for some unit tests.
# This function creates a special "matrix" object that can cache its inverse.
makeCacheMatrix <- function(x = matrix()) {
# The variables x (formal argument) and x_inv below hold the matrix
# and its inverse, respectively. x_inv is... |
## Put comments here that give an overall description of what your
## functions that cache the inverse of a matrix
## This function creates a special kind of matrix object that can cache its inverse
makeCacheMatrix <- function(x=matrix()){
## Initializing the inverse property
inv <- NULL
... | /cachematrix.R | no_license | pc1pranav/ProgrammingAssignment2 | R | false | false | 2,051 | r | ## Put comments here that give an overall description of what your
## functions that cache the inverse of a matrix
## This function creates a special kind of matrix object that can cache its inverse
makeCacheMatrix <- function(x=matrix()){
## Initializing the inverse property
inv <- NULL
... |
#' SPARQL As A Backend For DBI
#'
#' A simple implementation of R's DBI Interface. This provides access to SPARQL via DBI.
#'
#' @name SPARQLDBI
#' @docType package
#' @import methods DBI
#' @importFrom dplyr tbl_df
NULL
| /R/SPARQLDBI-package.R | no_license | yutannihilation/SPARQLDBI | R | false | false | 221 | r | #' SPARQL As A Backend For DBI
#'
#' A simple implementation of R's DBI Interface. This provides access to SPARQL via DBI.
#'
#' @name SPARQLDBI
#' @docType package
#' @import methods DBI
#' @importFrom dplyr tbl_df
NULL
|
# library required
library(data.tree)
##### Manual Data upload and target variable creation #####
# both test and train should be appended into a single dataset so that the format for both datasets is consistent
data<-read.csv("C:/Users/jasksing/Desktop/IN-orbit/adult-training.csv/adult-training.csv")
#### C... | /Calling_Function_rpart.R | no_license | sabihul/sabih-code | R | false | false | 1,793 | r | # library required
library(data.tree)
##### Manual Data upload and target variable creation #####
# both test and train should be appended into a single dataset so that the format for both datasets is consistent
data<-read.csv("C:/Users/jasksing/Desktop/IN-orbit/adult-training.csv/adult-training.csv")
#### C... |
#for
list.files()
exam <- read.csv("csv_exam.csv")
exam <- exam %>% mutate(avg = (math + english + science)/3)
exam
for ( i in min(exam$class):max(exam$class) )
{
print(exam %>% filter(class ==i) %>% filter(avg==max(avg)))
#전체 반에서 1등인 사람들 출력 #for문은 출력시 print() 필수
}
#group_by
exam %>% group_by(class)... | /basic_step/Data_graph.R | no_license | m-cahe/r | R | false | false | 2,931 | r | #for
list.files()
exam <- read.csv("csv_exam.csv")
exam <- exam %>% mutate(avg = (math + english + science)/3)
exam
for ( i in min(exam$class):max(exam$class) )
{
print(exam %>% filter(class ==i) %>% filter(avg==max(avg)))
#전체 반에서 1등인 사람들 출력 #for문은 출력시 print() 필수
}
#group_by
exam %>% group_by(class)... |
checkxes <- function(xes) {
if (class(xes)[1] != "jobjRef" ||
! xes %instanceof% "org.processmining.xestools.XEStools")
stop("wrong value of xes argument - should be object returned by xes.init")
}
#' Supporting function - transform map of traces into dataframe
#' @param res javaref object con... | /R/utilities.R | no_license | nicksi/rxes | R | false | false | 10,753 | r |
checkxes <- function(xes) {
if (class(xes)[1] != "jobjRef" ||
! xes %instanceof% "org.processmining.xestools.XEStools")
stop("wrong value of xes argument - should be object returned by xes.init")
}
#' Supporting function - transform map of traces into dataframe
#' @param res javaref object con... |
\name{zrecode}
\alias{zrecode}
\title{
recode lai bien chuoi ban dau
}
\description{
}
\usage{
zrecode(varName, dName, dtafile = NULL)
}
\arguments{
\item{varName}{ te^n bie^'n
}
\item{dName}{ te^n dataset
}
\item{dtafile}{te^n ta^.p tin csv (bo? underscore o+? dda^`u va` .csv
}
}
\details{
%% ~~ If neces... | /man/zrecode.Rd | no_license | gvdovandzung/thongke | R | false | false | 1,349 | rd | \name{zrecode}
\alias{zrecode}
\title{
recode lai bien chuoi ban dau
}
\description{
}
\usage{
zrecode(varName, dName, dtafile = NULL)
}
\arguments{
\item{varName}{ te^n bie^'n
}
\item{dName}{ te^n dataset
}
\item{dtafile}{te^n ta^.p tin csv (bo? underscore o+? dda^`u va` .csv
}
}
\details{
%% ~~ If neces... |
#training run
#call tfruns with a different working directory.
| /training-run.R | no_license | jlad521/melenoma_classifier | R | false | false | 67 | r | #training run
#call tfruns with a different working directory.
|
testlist <- list(A = structure(c(2.17107980817984e+205, 9.53801100427184e+295 ), .Dim = 1:2), B = structure(c(2.19477802979261e+294, 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, 0, 0, 0), .Dim = c(5L, 7L)))
result <- do.call(multivariance:::match_rows,testlist)
str(resu... | /multivariance/inst/testfiles/match_rows/AFL_match_rows/match_rows_valgrind_files/1613123497-test.R | no_license | akhikolla/updatedatatype-list3 | R | false | false | 323 | r | testlist <- list(A = structure(c(2.17107980817984e+205, 9.53801100427184e+295 ), .Dim = 1:2), B = structure(c(2.19477802979261e+294, 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, 0, 0, 0), .Dim = c(5L, 7L)))
result <- do.call(multivariance:::match_rows,testlist)
str(resu... |
con<-"household_power_consumption.txt"
library("data.table")
data<-fread(con,header=TRUE,sep=";",na.strings="?",colClasses="character")
dataset<-subset(data,Date=='1/2/2007' | Date == '2/2/2007',select=c(1:9))
x<-as.POSIXct(paste(as.Date(dataset$Date,format="%d/%m/%Y"), dataset$Time), format="%Y-%m-%d %H:%M:%S")
y<-da... | /plot2.R | no_license | karthiksaikumar/ExData_Plotting1 | R | false | false | 469 | r | con<-"household_power_consumption.txt"
library("data.table")
data<-fread(con,header=TRUE,sep=";",na.strings="?",colClasses="character")
dataset<-subset(data,Date=='1/2/2007' | Date == '2/2/2007',select=c(1:9))
x<-as.POSIXct(paste(as.Date(dataset$Date,format="%d/%m/%Y"), dataset$Time), format="%Y-%m-%d %H:%M:%S")
y<-da... |
#' Calculate plot-level distances to most recent common ancestors
#'
#' Given a picante-style community data matrix (sites are rows, species are columns),
#' and a phylogeny, calculate the distances of sets of taxa to their MRCA.
#'
#' @param samp A picante-style community data matrix with sites as rows, and
#' specie... | /R/distMRCA.R | no_license | eliotmiller/metricTester | R | false | false | 5,837 | r | #' Calculate plot-level distances to most recent common ancestors
#'
#' Given a picante-style community data matrix (sites are rows, species are columns),
#' and a phylogeny, calculate the distances of sets of taxa to their MRCA.
#'
#' @param samp A picante-style community data matrix with sites as rows, and
#' specie... |
library(datasets)
Sys.setlocale(category = "LC_ALL", locale = "English")
create_plot1 <- function(directory) {
#set the directory in parameter as the working folder
setwd(directory)
if(!file.exists("./data/household_power_consumption.txt")){
print("Directory not correct, please input the path where the... | /Plot1.R | no_license | jscaze/ExData_Plotting1 | R | false | false | 1,621 | r | library(datasets)
Sys.setlocale(category = "LC_ALL", locale = "English")
create_plot1 <- function(directory) {
#set the directory in parameter as the working folder
setwd(directory)
if(!file.exists("./data/household_power_consumption.txt")){
print("Directory not correct, please input the path where the... |
library(tidyverse)
# metadata
metadata <- read.csv("results/R1R2-EBPR-MAGs-table.csv")
# vitamin annotations
vitamin_list <- read.csv("results/2013_binning/annotations/vitamin-list.csv", header = FALSE)
colnames(vitamin_list) <- c("ko", "pathway")
vitamin_annotations <- read.delim("results/2013_binning/annotations/R1... | /scripts/AA-vitamin-count-expression-explore.R | no_license | elizabethmcd/EBPR-MAGs | R | false | false | 5,322 | r | library(tidyverse)
# metadata
metadata <- read.csv("results/R1R2-EBPR-MAGs-table.csv")
# vitamin annotations
vitamin_list <- read.csv("results/2013_binning/annotations/vitamin-list.csv", header = FALSE)
colnames(vitamin_list) <- c("ko", "pathway")
vitamin_annotations <- read.delim("results/2013_binning/annotations/R1... |
context("anatFDR")
gf = read.csv("/tmp/rminctestdata/CIVET_TEST.csv")
gf = civet.getAllFilenames(gf,"ID","POND","/tmp/rminctestdata/CIVET","TRUE","1.1.12")
gf = civet.readAllCivetFiles("/tmp/rminctestdata/AAL.csv",gf)
sink("/dev/null"); rmincLm = anatLm(~ Sex,gf,gf$lobeThickness); sink();
lobeThickness = gf$lobeThick... | /inst/tests/test_anatFDR.R | no_license | bcdarwin/RMINC | R | false | false | 5,005 | r | context("anatFDR")
gf = read.csv("/tmp/rminctestdata/CIVET_TEST.csv")
gf = civet.getAllFilenames(gf,"ID","POND","/tmp/rminctestdata/CIVET","TRUE","1.1.12")
gf = civet.readAllCivetFiles("/tmp/rminctestdata/AAL.csv",gf)
sink("/dev/null"); rmincLm = anatLm(~ Sex,gf,gf$lobeThickness); sink();
lobeThickness = gf$lobeThick... |
.init.exp.model.variogram = function(dist,gamma){
###############################################################################################
# cette fonction estime par moindres carres les parametres de lissage d'un semi variogram
# Le modele choisi est fixe (modele Exp)
# Ces parametres sont utilis... | /prevR/R/init.exp.model.variogram.r | no_license | ingted/R-Examples | R | false | false | 1,008 | r | .init.exp.model.variogram = function(dist,gamma){
###############################################################################################
# cette fonction estime par moindres carres les parametres de lissage d'un semi variogram
# Le modele choisi est fixe (modele Exp)
# Ces parametres sont utilis... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/binned_tabulate.R
\name{binned_tabulate}
\alias{binned_tabulate}
\alias{binned_tabulate.default}
\alias{binned_tabulate.ff}
\title{Fast tabulating in different bins}
\usage{
binned_tabulate(x, bin, nbins = max(bin), nlevels = nlevels(x), ...)... | /pkg/man/binned_tabulate.Rd | no_license | namanpaul/ffbase | R | false | true | 1,276 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/binned_tabulate.R
\name{binned_tabulate}
\alias{binned_tabulate}
\alias{binned_tabulate.default}
\alias{binned_tabulate.ff}
\title{Fast tabulating in different bins}
\usage{
binned_tabulate(x, bin, nbins = max(bin), nlevels = nlevels(x), ...)... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/loglikelihoods.R
\name{normal_ll}
\alias{normal_ll}
\title{Gaussian log likelihood}
\usage{
normal_ll(y, X, par)
}
\arguments{
\item{y}{binary outcome}
\item{X}{design matrix}
\item{par}{vector of gaussian scale parameter followed by model ... | /R/metropolis/man/normal_ll.Rd | no_license | alexpkeil1/mcmc | R | false | true | 490 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/loglikelihoods.R
\name{normal_ll}
\alias{normal_ll}
\title{Gaussian log likelihood}
\usage{
normal_ll(y, X, par)
}
\arguments{
\item{y}{binary outcome}
\item{X}{design matrix}
\item{par}{vector of gaussian scale parameter followed by model ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/preprocessing.R
\name{text_to_word_sequence}
\alias{text_to_word_sequence}
\title{Split a sentence into a list of words.}
\usage{
text_to_word_sequence(text,
filters = "!\\"#$\%&()*+,-./:;<=>?@[\\\\]^_`{|}~\\t\\n", lower = TRUE,
split = "... | /man/text_to_word_sequence.Rd | no_license | Yannael/kerasR | R | false | true | 1,000 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/preprocessing.R
\name{text_to_word_sequence}
\alias{text_to_word_sequence}
\title{Split a sentence into a list of words.}
\usage{
text_to_word_sequence(text,
filters = "!\\"#$\%&()*+,-./:;<=>?@[\\\\]^_`{|}~\\t\\n", lower = TRUE,
split = "... |
library(keras)
#
#load(file = "data/clean_data.RData")
clean_data = function(data) {
data$X = NULL
data$Date = NULL
data$Evaporation = NULL
data$Sunshine = NULL
data$WindDir3pm = NULL
data$WindDir9am = NULL
data$WindGustDir = NULL
data$RainTomorrow = NULL
data$RainToday = ifelse(da... | /p4/model/Darwin_LSTM_Classification.R | no_license | maxneuds/data_mining_lecture | R | false | false | 4,056 | r | library(keras)
#
#load(file = "data/clean_data.RData")
clean_data = function(data) {
data$X = NULL
data$Date = NULL
data$Evaporation = NULL
data$Sunshine = NULL
data$WindDir3pm = NULL
data$WindDir9am = NULL
data$WindGustDir = NULL
data$RainTomorrow = NULL
data$RainToday = ifelse(da... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/biglm_mapper.R
\name{update_levels}
\alias{update_levels}
\title{Standardize levels of factor variables.}
\usage{
update_levels(data, levels_union)
}
\arguments{
\item{data}{Dataset to standardize}
\item{levels_union}{Named list. Names shoul... | /man/update_levels.Rd | no_license | gregobad/biglm-mapper | R | false | true | 636 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/biglm_mapper.R
\name{update_levels}
\alias{update_levels}
\title{Standardize levels of factor variables.}
\usage{
update_levels(data, levels_union)
}
\arguments{
\item{data}{Dataset to standardize}
\item{levels_union}{Named list. Names shoul... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/px_build_index.R
\name{px_build_index}
\alias{px_build_index}
\title{Indexing function on bgzipped pairs file.}
\usage{
px_build_index(filename, preset = "", sc = 0, bc = 0, ec = 0, sc2 = 0,
bc2 = 0, ec2 = 0, delimiter = "\\t", comment_char... | /man/px_build_index.Rd | permissive | j1z0/Rpairix | R | false | true | 3,218 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/px_build_index.R
\name{px_build_index}
\alias{px_build_index}
\title{Indexing function on bgzipped pairs file.}
\usage{
px_build_index(filename, preset = "", sc = 0, bc = 0, ec = 0, sc2 = 0,
bc2 = 0, ec2 = 0, delimiter = "\\t", comment_char... |
#' Remove outliers/bad subjects
#'
#' This function takes as import two dataframes. The first dataframe is the original dataframe containing all IDs,
#' The second dataframe contains only those IDs to be removed.
#' @param x dataframe
#' @param remove the dataframe that contains subjects to be removed
#' @param output ... | /R/remove_save.R | no_license | dr-JT/datawrangling | R | false | false | 1,090 | r | #' Remove outliers/bad subjects
#'
#' This function takes as import two dataframes. The first dataframe is the original dataframe containing all IDs,
#' The second dataframe contains only those IDs to be removed.
#' @param x dataframe
#' @param remove the dataframe that contains subjects to be removed
#' @param output ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cadtools.R
\name{basindelin_big}
\alias{basindelin_big}
\title{Delineates hydrological basins for large datasets}
\usage{
basindelin_big(dem, dirout = NA, trace = TRUE)
}
\arguments{
\item{dem}{a raster object of elevations.}
\item{dirout}{a... | /man/basindelin_big.Rd | no_license | ackuyucu/microclima | R | false | true | 1,685 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cadtools.R
\name{basindelin_big}
\alias{basindelin_big}
\title{Delineates hydrological basins for large datasets}
\usage{
basindelin_big(dem, dirout = NA, trace = TRUE)
}
\arguments{
\item{dem}{a raster object of elevations.}
\item{dirout}{a... |
library(repo)
### Name: repo_tags
### Title: List all tags
### Aliases: repo_tags
### ** Examples
rp_path <- file.path(tempdir(), "example_repo")
rp <- repo_open(rp_path, TRUE)
## Putting two items with a few tags
rp$put(1, "item1", "Sample item 1",
c("repo_tags", "tag1"))
rp$put(2, "item2", "Sample item 2",
... | /data/genthat_extracted_code/repo/examples/repo_tags.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 428 | r | library(repo)
### Name: repo_tags
### Title: List all tags
### Aliases: repo_tags
### ** Examples
rp_path <- file.path(tempdir(), "example_repo")
rp <- repo_open(rp_path, TRUE)
## Putting two items with a few tags
rp$put(1, "item1", "Sample item 1",
c("repo_tags", "tag1"))
rp$put(2, "item2", "Sample item 2",
... |
#' Simulate from a Bernoulli distribution
#'
#'The sim_bern_mean function has the same general structure as sim_regression()
#'but simulates data from a Bernoulli distribution and returns the sample average.
#' @param n number of observations. If length(n) > 1, the length is taken to be the number required.
#' @param p... | /R/sim_bern_mean.R | no_license | jackyan0320/example.package | R | false | false | 641 | r | #' Simulate from a Bernoulli distribution
#'
#'The sim_bern_mean function has the same general structure as sim_regression()
#'but simulates data from a Bernoulli distribution and returns the sample average.
#' @param n number of observations. If length(n) > 1, the length is taken to be the number required.
#' @param p... |
setwd("osmFISH_AllenSSp/")
library(Seurat)
library(ggplot2)
osmFISH <- readRDS("data/seurat_objects/osmFISH_Cortex.rds")
osmFISH.imputed <- readRDS("data/seurat_objects/osmFISH_Cortex_imputed.rds")
allen <- readRDS("data/seurat_objects/allen_brain_SSp.rds")
genes.leaveout <- intersect(rownames(osmFISH),rownam... | /benchmark/osmFISH_AllenSSp/Seurat/osmFISH_integration.R | permissive | c4chow/SpaGE | R | false | false | 2,499 | r | setwd("osmFISH_AllenSSp/")
library(Seurat)
library(ggplot2)
osmFISH <- readRDS("data/seurat_objects/osmFISH_Cortex.rds")
osmFISH.imputed <- readRDS("data/seurat_objects/osmFISH_Cortex_imputed.rds")
allen <- readRDS("data/seurat_objects/allen_brain_SSp.rds")
genes.leaveout <- intersect(rownames(osmFISH),rownam... |
library(rvest)
library(XML)
library(magrittr)
# Amazon Reviews #############################
aurl <- "https://www.amazon.in/JBL-C100SI-Ear-Headphones-Black/product-reviews/B01DEWVZ2C/ref=cm_cr_getr_d_paging_btm_1?showViewpoints=1&pageNumber="
amazon_reviews <- NULL
for (i in 1:30){
murl <- read_html(as.chara... | /text_min2.R | no_license | MGPraveen07/Text-mining | R | false | false | 2,029 | r | library(rvest)
library(XML)
library(magrittr)
# Amazon Reviews #############################
aurl <- "https://www.amazon.in/JBL-C100SI-Ear-Headphones-Black/product-reviews/B01DEWVZ2C/ref=cm_cr_getr_d_paging_btm_1?showViewpoints=1&pageNumber="
amazon_reviews <- NULL
for (i in 1:30){
murl <- read_html(as.chara... |
library(lubridate)
library(magrittr)
library(ggplot2)
library(ggpubr)
library(grid)
library(gridExtra)
library(scales)
library(dplyr)
library(plyr)
library(tidyr)
library(zoo)
# Here we assess whether or not climatic factors act more generally to enhance transmission, rather than as specific triggers
# for epidemic on... | /supplementary information analysis scripts/mean climate over epidemic.R | no_license | m-vieira/australian_seasonal_flu | R | false | false | 13,312 | r | library(lubridate)
library(magrittr)
library(ggplot2)
library(ggpubr)
library(grid)
library(gridExtra)
library(scales)
library(dplyr)
library(plyr)
library(tidyr)
library(zoo)
# Here we assess whether or not climatic factors act more generally to enhance transmission, rather than as specific triggers
# for epidemic on... |
x <- 1
if (x == 1){
print("X is equal to one!")
}
if ( (x %% 2) == 0 ){
print("X is even")
} else {
print("X is Not even")
}
if (is.matrix(x) == TRUE){
print("X is a Matrix")
} else {
print("X is NOT a Matrix")
}
x <- c(3,7,1)
one <- x[1]
two <- x[2]
three <- x[3]
print(one)
print(two)
print(three)
... | /conditionals.R | no_license | dladowitz/R_examples | R | false | false | 666 | r | x <- 1
if (x == 1){
print("X is equal to one!")
}
if ( (x %% 2) == 0 ){
print("X is even")
} else {
print("X is Not even")
}
if (is.matrix(x) == TRUE){
print("X is a Matrix")
} else {
print("X is NOT a Matrix")
}
x <- c(3,7,1)
one <- x[1]
two <- x[2]
three <- x[3]
print(one)
print(two)
print(three)
... |
# Exercise 2: working with data frames
# Create a vector of 100 employees ("Employee 1", "Employee 2", ... "Employee 100")
# Hint: use the `paste()` function and vector recycling to add a number to the word
# "Employee"
employees <- paste("Employee", 1:100)
# Create a vector of 100 random salaries for the year 2017
#... | /chapter-10-exercises/exercise-2/exercise.R | permissive | LunaLan88/book-exercises | R | false | false | 2,504 | r | # Exercise 2: working with data frames
# Create a vector of 100 employees ("Employee 1", "Employee 2", ... "Employee 100")
# Hint: use the `paste()` function and vector recycling to add a number to the word
# "Employee"
employees <- paste("Employee", 1:100)
# Create a vector of 100 random salaries for the year 2017
#... |
#caching the inverse of a matric
## This function computes the inverse of the special "matrix" returned by makeCacheMatrix above.
#If the inverse has already been calculated (and the matrix has not changed), then the cachesolve
#should retrieve the inverse from the cache.
## This function creates a special "matrix" ... | /cachematrix.R | no_license | Chiranthi-Yasora/ProgrammingAssignment2 | R | false | false | 1,115 | r | #caching the inverse of a matric
## This function computes the inverse of the special "matrix" returned by makeCacheMatrix above.
#If the inverse has already been calculated (and the matrix has not changed), then the cachesolve
#should retrieve the inverse from the cache.
## This function creates a special "matrix" ... |
#' Takes weighted soil layers, creates stack, and sums values to create single soil raster for that parameter
#' @param raster_list a list of weighted soil rasters
#' @return a single raster layer that sums the soil values including the weights
#' for the velox extraction stage
#' @examples
#' \dontrun{stack_and_sum_... | /R/stack_and_sum_soil.R | permissive | liandi93/soilgrids | R | false | false | 730 | r | #' Takes weighted soil layers, creates stack, and sums values to create single soil raster for that parameter
#' @param raster_list a list of weighted soil rasters
#' @return a single raster layer that sums the soil values including the weights
#' for the velox extraction stage
#' @examples
#' \dontrun{stack_and_sum_... |
## This R file has two functions makeCacheMatrix and cacheSolve
## makeCacheMatrix - this function creates the matrix and set the values in the matrix as well as the inverse
makeCacheMatrix <- function(x = matrix()) {
#initialize inverse to NULL
inverseMatrix <- NULL
set <- function(y) {
x <<- y
inver... | /cachematrix.R | no_license | aseethar/ProgrammingAssignment2 | R | false | false | 1,236 | r | ## This R file has two functions makeCacheMatrix and cacheSolve
## makeCacheMatrix - this function creates the matrix and set the values in the matrix as well as the inverse
makeCacheMatrix <- function(x = matrix()) {
#initialize inverse to NULL
inverseMatrix <- NULL
set <- function(y) {
x <<- y
inver... |
library(plyr)
library(tidyverse)
library(magrittr)
library(ggplot2)
library(drc)
source("scripts/geom_indicator.R")
load("intermediate_data/image_scores.Rdata")
meta_well_scores <- image_scores %>%
dplyr::rename(master_plate_id = parent_plate_barcode) %>%
dplyr::distinct(
master_plate_id,
Co... | /SARS-CoV-2/scripts/4_dose_response_niclosamide.R | permissive | jilimcaoco/MPProjects | R | false | false | 5,137 | r |
library(plyr)
library(tidyverse)
library(magrittr)
library(ggplot2)
library(drc)
source("scripts/geom_indicator.R")
load("intermediate_data/image_scores.Rdata")
meta_well_scores <- image_scores %>%
dplyr::rename(master_plate_id = parent_plate_barcode) %>%
dplyr::distinct(
master_plate_id,
Co... |
\name{parse_and_save}
\alias{parse_and_save}
\title{Parse the input Rd file and save the roxygen documentation into a
file}
\usage{
parse_and_save(path, file, usage = FALSE)
}
\arguments{
\item{path}{the path of the Rd file}
\item{file}{the path to save the roxygen documentation}
\item{usage}{logical: whether t... | /man/parse_and_save.Rd | no_license | aalfons/Rd2roxygen | R | false | false | 635 | rd | \name{parse_and_save}
\alias{parse_and_save}
\title{Parse the input Rd file and save the roxygen documentation into a
file}
\usage{
parse_and_save(path, file, usage = FALSE)
}
\arguments{
\item{path}{the path of the Rd file}
\item{file}{the path to save the roxygen documentation}
\item{usage}{logical: whether t... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/SampleTau.r
\name{Sample_tau}
\alias{Sample_tau}
\title{Sample the dispersal parameter, tau}
\usage{
Sample_tau(tau, j, m, nT, r, lambda, K, coords, N, h_tau, h_lambda, mu_tau,
sigma_tau)
}
\arguments{
\item{tau}{dispersal parameter (vector... | /man/Sample_tau.Rd | no_license | pkuhnert/HSTMM | R | false | true | 935 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/SampleTau.r
\name{Sample_tau}
\alias{Sample_tau}
\title{Sample the dispersal parameter, tau}
\usage{
Sample_tau(tau, j, m, nT, r, lambda, K, coords, N, h_tau, h_lambda, mu_tau,
sigma_tau)
}
\arguments{
\item{tau}{dispersal parameter (vector... |
## File Name: tam_linking_2studies_create_M_SD.R
## File Version: 0.05
tam_linking_2studies_create_M_SD <- function(M1, SD1, M2, SD2, trafo_persons)
{
G1 <- length(M1)
G2 <- length(M2)
GT <- G1+G2
M_SD <- matrix( 0 , nrow=GT , ncol=2 )
colnames(M_SD) <- c("M", "SD")
# M_SD <- as.data.frame(M_SD)
rownames(M_SD)... | /R/tam_linking_2studies_create_M_SD.R | no_license | yaozeyang90/TAM | R | false | false | 753 | r | ## File Name: tam_linking_2studies_create_M_SD.R
## File Version: 0.05
tam_linking_2studies_create_M_SD <- function(M1, SD1, M2, SD2, trafo_persons)
{
G1 <- length(M1)
G2 <- length(M2)
GT <- G1+G2
M_SD <- matrix( 0 , nrow=GT , ncol=2 )
colnames(M_SD) <- c("M", "SD")
# M_SD <- as.data.frame(M_SD)
rownames(M_SD)... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/as_numeric.R
\name{as_numeric}
\alias{as_numeric}
\alias{to_numeric}
\alias{as_numeric.data.frame}
\title{Convert factors to numeric variables}
\usage{
as_numeric(x, ...)
to_numeric(x, ...)
\method{as_numeric}{data.frame}(x, ..., start.at =... | /man/as_numeric.Rd | no_license | strengejacke/sjlabelled | R | false | true | 3,716 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/as_numeric.R
\name{as_numeric}
\alias{as_numeric}
\alias{to_numeric}
\alias{as_numeric.data.frame}
\title{Convert factors to numeric variables}
\usage{
as_numeric(x, ...)
to_numeric(x, ...)
\method{as_numeric}{data.frame}(x, ..., start.at =... |
TwoSampleMean.Equivalence <-
function(alpha,beta,sigma,k,delta,margin){
n2<-(qnorm(1-alpha)+qnorm(1-beta/2))^2*sigma^2*(1+1/k)/(delta-abs(margin))^2
n2
n1<-k*n2
return(n1)
}
| /R/TwoSampleMean.Equivalence.R | no_license | cran/TrialSize | R | false | false | 197 | r | TwoSampleMean.Equivalence <-
function(alpha,beta,sigma,k,delta,margin){
n2<-(qnorm(1-alpha)+qnorm(1-beta/2))^2*sigma^2*(1+1/k)/(delta-abs(margin))^2
n2
n1<-k*n2
return(n1)
}
|
num = c(1,2,3,4)
v1 <- sample(num, 100, replace=TRUE)
v1_factor <- factor(v1)
v1
v1_factor
| /Lab3_exercise1.R | no_license | emilyOberH/R-language | R | false | false | 98 | r | num = c(1,2,3,4)
v1 <- sample(num, 100, replace=TRUE)
v1_factor <- factor(v1)
v1
v1_factor
|
library(eDMA)
### Name: SimulateDLM
### Title: Simulate from DLM of West and Harrison (1999).
### Aliases: SimulateDLM
### ** Examples
set.seed(7892)
iT <- 500
iK <- 3
dV <- 0.1
mW <- diag(iK + 1) * 0.01
dPhi <- 1
vBeta0 <- rep(0, iK + 1)
mX <- cbind(1, matrix(rnorm(iT * (iK)), iT, iK))
lOut <- SimulateDLM(iT,... | /data/genthat_extracted_code/eDMA/examples/SimulateDLM.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 365 | r | library(eDMA)
### Name: SimulateDLM
### Title: Simulate from DLM of West and Harrison (1999).
### Aliases: SimulateDLM
### ** Examples
set.seed(7892)
iT <- 500
iK <- 3
dV <- 0.1
mW <- diag(iK + 1) * 0.01
dPhi <- 1
vBeta0 <- rep(0, iK + 1)
mX <- cbind(1, matrix(rnorm(iT * (iK)), iT, iK))
lOut <- SimulateDLM(iT,... |
## link
bed1 = generateRandomBed(nr = 100)
bed1 = bed1[sample(nrow(bed1), 20), ]
bed2 = generateRandomBed(nr = 100)
bed2 = bed2[sample(nrow(bed2), 20), ]
circos.par("default.track.height" = 0.1, cell.padding = c(0, 0, 0, 0))
circos.initializeWithIdeogram()
circos.genomicLink(bed1, bed2, col = sample(1:5, 20, r... | /test/genomic_functions/test_genomicLink.R | permissive | jokergoo/circlize | R | false | false | 368 | r | ## link
bed1 = generateRandomBed(nr = 100)
bed1 = bed1[sample(nrow(bed1), 20), ]
bed2 = generateRandomBed(nr = 100)
bed2 = bed2[sample(nrow(bed2), 20), ]
circos.par("default.track.height" = 0.1, cell.padding = c(0, 0, 0, 0))
circos.initializeWithIdeogram()
circos.genomicLink(bed1, bed2, col = sample(1:5, 20, r... |
data <- read.table("household_power_consumption.txt", header = TRUE,
sep = ";", na.strings = "?", skip = 66636, nrows = 2880,
colClasses = c("character", "character","numeric","numeric","numeric","numeric","numeric","numeric","numeric"))
colnames(data) <- c("CDate","CTime","Globa... | /plot1.R | no_license | ngoc-hien/ExData_Plotting1 | R | false | false | 682 | r | data <- read.table("household_power_consumption.txt", header = TRUE,
sep = ";", na.strings = "?", skip = 66636, nrows = 2880,
colClasses = c("character", "character","numeric","numeric","numeric","numeric","numeric","numeric","numeric"))
colnames(data) <- c("CDate","CTime","Globa... |
source('code/clean.R')
attach(bodyfat.clean)
par(mfrow = c(1, 1))
#bodyfat.clean <- scale(bodyfat.clean)
#bodyfat.clean=bodyfat[-c(42,39),-1]
### Simple linear model
#bodyfat.clean <- bodyfat.clean[,-1]
#bodyfat.clean[,c(2:15)] <- scale(bodyfat.clean[,c(2:15)])
# Consider all variables and fit a simple linear ... | /code/model.R | no_license | Vesna0130/Data-Science-Practicum-BodyFat | R | false | false | 3,393 | r | source('code/clean.R')
attach(bodyfat.clean)
par(mfrow = c(1, 1))
#bodyfat.clean <- scale(bodyfat.clean)
#bodyfat.clean=bodyfat[-c(42,39),-1]
### Simple linear model
#bodyfat.clean <- bodyfat.clean[,-1]
#bodyfat.clean[,c(2:15)] <- scale(bodyfat.clean[,c(2:15)])
# Consider all variables and fit a simple linear ... |
#' Combine terms in a regression model
#'
#' The function combines terms from a regression model, and replaces the terms
#' with a single row in the output table. The p-value is calculated using
#' [stats::anova()].
#'
#' @param x a `tbl_regression` object
#' @param formula_update formula update passed to the [stats::... | /R/combine_terms.R | permissive | eliascrapa/gtsummary | R | false | false | 7,229 | r | #' Combine terms in a regression model
#'
#' The function combines terms from a regression model, and replaces the terms
#' with a single row in the output table. The p-value is calculated using
#' [stats::anova()].
#'
#' @param x a `tbl_regression` object
#' @param formula_update formula update passed to the [stats::... |
library(metRology)
### Name: gplot
### Title: Grouped plots of type "h"
### Aliases: gplot
### Keywords: hplot
### ** Examples
data(RMstudy)
h <- with(RMstudy, mandel.h(RMstudy[2:9], g=Lab))
gplot(h, las=2)
#Note the absence of indicator lines, title etc.
#compared to plot(h)
| /data/genthat_extracted_code/metRology/examples/gplot.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 303 | r | library(metRology)
### Name: gplot
### Title: Grouped plots of type "h"
### Aliases: gplot
### Keywords: hplot
### ** Examples
data(RMstudy)
h <- with(RMstudy, mandel.h(RMstudy[2:9], g=Lab))
gplot(h, las=2)
#Note the absence of indicator lines, title etc.
#compared to plot(h)
|
## check namespace.
detachem <- function(x){
NS <- loadedNamespaces()
if(any(NS==x)){
pkgn <- paste0("package:", x)
detach(pkgn, unload=TRUE, character.only=TRUE)
}
}
Pkgs <- c("MirhostDb.Hsapiens.v75.v20", "mirhostgenes", "ensembldb")
tmp <- sapply(Pkgs, detachem)
tmp <- sapply(Pkgs, librar... | /inst/test/testQueries.R | permissive | ctoste/mirhostgenes | R | false | false | 7,667 | r | ## check namespace.
detachem <- function(x){
NS <- loadedNamespaces()
if(any(NS==x)){
pkgn <- paste0("package:", x)
detach(pkgn, unload=TRUE, character.only=TRUE)
}
}
Pkgs <- c("MirhostDb.Hsapiens.v75.v20", "mirhostgenes", "ensembldb")
tmp <- sapply(Pkgs, detachem)
tmp <- sapply(Pkgs, librar... |
library(tidyverse)
library(raster)
library(ggspatial)
library(sf)
library(patchwork)
library(ggExtra)
library(cowplot)
chm <- raster("out/scaled_chm_mosaic.tif")
theme_set(theme_minimal() +
theme(panel.grid.minor = element_blank()))
test_preds <- read_csv("out/test-set-checks.csv") %>%
mutate(gamma_12... | /R/s05-visualize-test-set.R | permissive | PepSalehi/neuralecology | R | false | false | 2,709 | r | library(tidyverse)
library(raster)
library(ggspatial)
library(sf)
library(patchwork)
library(ggExtra)
library(cowplot)
chm <- raster("out/scaled_chm_mosaic.tif")
theme_set(theme_minimal() +
theme(panel.grid.minor = element_blank()))
test_preds <- read_csv("out/test-set-checks.csv") %>%
mutate(gamma_12... |
?auto.arima()
?sarima
library(forecast)
library(lmtest)
library(astsa)
library(fpp2)
library(ggplot2)
library(lubridate)
library(FitAR)
options(warn=-1)
auto.arima(PM10.ts.train,allowdrift = F) #ok
sarima(PM10.ts.train_2,3,0,1,1,1,0,52) #ok
auto.arima(PM10.ts.train_3) #ok
auto.arima(PM2.5.ts.train) #ok
... | /Time_Series_Analysis/auto_arima.R | no_license | ishmamshahid/Time-Series-Analysis-of-Particulate-Matter-of-Dhaka-city | R | false | false | 4,381 | r | ?auto.arima()
?sarima
library(forecast)
library(lmtest)
library(astsa)
library(fpp2)
library(ggplot2)
library(lubridate)
library(FitAR)
options(warn=-1)
auto.arima(PM10.ts.train,allowdrift = F) #ok
sarima(PM10.ts.train_2,3,0,1,1,1,0,52) #ok
auto.arima(PM10.ts.train_3) #ok
auto.arima(PM2.5.ts.train) #ok
... |
#' Convert a data.frame with one or more coordinate columns to an sf object
#'
#' @description
#' - [coords_to_sf()]: Convert a data frame with coordinates into a simple
#' feature object
#' - [check_coords()]: Check if a provided vector with coordinate column names
#' are valid for the provided data frame
#' - [separa... | /R/coords_to_sf.R | permissive | elipousson/sfext | R | false | false | 8,234 | r | #' Convert a data.frame with one or more coordinate columns to an sf object
#'
#' @description
#' - [coords_to_sf()]: Convert a data frame with coordinates into a simple
#' feature object
#' - [check_coords()]: Check if a provided vector with coordinate column names
#' are valid for the provided data frame
#' - [separa... |
options(digits=4)
generateData <- function(n){
w1 <- rbinom(n, size=1, prob=0.5)
w2 <- rbinom(n, size=1, prob=0.65)
w3 <- round(runif(n, min=0, max=4), digits=3)
w4 <- round(runif(n, min=0, max=5), digits=3)
A <- rbinom(n, size=1, prob= plogis(-0.4 + 0.2*w2 + 0.15*w3 + 0.2*w4 + 0.15*w2*w4))
Y <- rbinom(n,... | /src/tmle/generateData.r | no_license | gfrascadorio/gfrascadorio.github.io | R | false | false | 1,163 | r | options(digits=4)
generateData <- function(n){
w1 <- rbinom(n, size=1, prob=0.5)
w2 <- rbinom(n, size=1, prob=0.65)
w3 <- round(runif(n, min=0, max=4), digits=3)
w4 <- round(runif(n, min=0, max=5), digits=3)
A <- rbinom(n, size=1, prob= plogis(-0.4 + 0.2*w2 + 0.15*w3 + 0.2*w4 + 0.15*w2*w4))
Y <- rbinom(n,... |
\name{src}
\alias{is.src}
\alias{src}
\title{Create a "src" object}
\usage{
src(subclass, ...)
is.src(x)
}
\arguments{
\item{subclass}{name of subclass. "src" is an abstract
base class, so you must supply this value. \code{src_} is
automatically prepended to the class name}
\item{...}{fields used by object}
... | /dplyr/man/src.Rd | no_license | radfordneal/R-package-mods | R | false | false | 474 | rd | \name{src}
\alias{is.src}
\alias{src}
\title{Create a "src" object}
\usage{
src(subclass, ...)
is.src(x)
}
\arguments{
\item{subclass}{name of subclass. "src" is an abstract
base class, so you must supply this value. \code{src_} is
automatically prepended to the class name}
\item{...}{fields used by object}
... |
#Cleanup environment
rm(list = ls())
# free memory
gc()
setwd("C:/Users/gmanish/Downloads/openminds/code/R/")
library(magrittr)
foo_foo <- little_bunny()
#Intermediate Steps
foo_foo_1 <- hop(foo_foo, through = forest)
foo_foo_2 <- scoop(foo_foo_1, up = field_mice)
foo_foo_3 <- bop(foo_foo_2, on = head)
diamonds <- ... | /13.Pipes_with_magrittr.R | no_license | sumanth048/R | R | false | false | 1,763 | r | #Cleanup environment
rm(list = ls())
# free memory
gc()
setwd("C:/Users/gmanish/Downloads/openminds/code/R/")
library(magrittr)
foo_foo <- little_bunny()
#Intermediate Steps
foo_foo_1 <- hop(foo_foo, through = forest)
foo_foo_2 <- scoop(foo_foo_1, up = field_mice)
foo_foo_3 <- bop(foo_foo_2, on = head)
diamonds <- ... |
## Trials for Financial data
# source('~/Desktop/GERGM_Development/Financial_Data_Application.R')
#set year
YEAR = 1
#use this to open a shell in CentOS 6 that can be used to run the scripts
#scl enable devtoolset-1.1 bash
PKG_CPPFLAGS = "-std=c++0x"
Sys.setenv(PKG_CPPFLAGS = PKG_CPPFLAGS)
## This is working direct... | /Financial_Data_Application.R | no_license | matthewjdenny/GERGM_Development | R | false | false | 3,046 | r | ## Trials for Financial data
# source('~/Desktop/GERGM_Development/Financial_Data_Application.R')
#set year
YEAR = 1
#use this to open a shell in CentOS 6 that can be used to run the scripts
#scl enable devtoolset-1.1 bash
PKG_CPPFLAGS = "-std=c++0x"
Sys.setenv(PKG_CPPFLAGS = PKG_CPPFLAGS)
## This is working direct... |
basec <- read.csv("census.csv")
basec <- basec[-1]
#busca os valores categoricos existentes na coluna
table(basec$sex)
#troca os atributos de categoricos por numericos
basec$sex <- factor(basec$sex, levels = c(" Female", " Male"), labels = c(0, 1))
#basec$workclass <- factor(basec$workclass, levels = unique(basec$wo... | /curso_ML/naive_bayes_census.R | no_license | henrikots/dados-credito-curso | R | false | false | 4,601 | r | basec <- read.csv("census.csv")
basec <- basec[-1]
#busca os valores categoricos existentes na coluna
table(basec$sex)
#troca os atributos de categoricos por numericos
basec$sex <- factor(basec$sex, levels = c(" Female", " Male"), labels = c(0, 1))
#basec$workclass <- factor(basec$workclass, levels = unique(basec$wo... |
#This is the R code for Applied Unsupervised Learning with R, lesson 6
#load the dataset for US Arrests
data(USArrests)
head(USArrests)
#create a boxplot for rape arrests
boxplot(USArrests$Rape)
#find the highest values (in this case, the outliers)
highest<-USArrests[which(USArrests$Rape>40),]
print(highest)
#load ... | /lesson6.R | permissive | SmithaShivakumar/Unsupervised-Learning-with-R | R | false | false | 4,318 | r | #This is the R code for Applied Unsupervised Learning with R, lesson 6
#load the dataset for US Arrests
data(USArrests)
head(USArrests)
#create a boxplot for rape arrests
boxplot(USArrests$Rape)
#find the highest values (in this case, the outliers)
highest<-USArrests[which(USArrests$Rape>40),]
print(highest)
#load ... |
library(tidyverse)
library(haven)
# devtools::install_github("jlmelville/smallvis/smallvis")
library(smallvis)
try(dir.create("data/casen"))
url <- "http://observatorio.ministeriodesarrollosocial.gob.cl/casen-multidimensional/casen/docs/casen_2015_spss.rar"
file <- file.path("data", "casen", basename(url))
if(!file.... | /R/casen.R | no_license | jbkunst/intro-r-workshop | R | false | false | 3,964 | r | library(tidyverse)
library(haven)
# devtools::install_github("jlmelville/smallvis/smallvis")
library(smallvis)
try(dir.create("data/casen"))
url <- "http://observatorio.ministeriodesarrollosocial.gob.cl/casen-multidimensional/casen/docs/casen_2015_spss.rar"
file <- file.path("data", "casen", basename(url))
if(!file.... |
#Load data file "household_power_consumption.txt" stored in working directory
hpower <- read.table("household_power_consumption.txt", header=TRUE, sep=";", na.strings="?")
#subset to only 2007-02-01 and 2007-02-02
hpower <- hpower[as.Date(hpower$Date,"%d/%m/%Y") == "2007-02-01" | as.Date(hpower$Date,"%d/%m/%Y") == "20... | /plot2.R | no_license | briangill/ExData_Plotting1 | R | false | false | 709 | r | #Load data file "household_power_consumption.txt" stored in working directory
hpower <- read.table("household_power_consumption.txt", header=TRUE, sep=";", na.strings="?")
#subset to only 2007-02-01 and 2007-02-02
hpower <- hpower[as.Date(hpower$Date,"%d/%m/%Y") == "2007-02-01" | as.Date(hpower$Date,"%d/%m/%Y") == "20... |
library(lidR)
library(dplyr)
library(future)
library(e1071)
lasc <- readLAScatalog("C:/1_Work/2_Ciron/Data/ALS/norm/")
rs <- 30 #resolution of the grid
area_filt <- 810
#processing parameters
plan(multisession, workers = 6L)
opt_chunk_buffer(lasc) <- 0
opt_chunk_size(lasc) <- 0
opt_stop_early(lasc) <- FALSE
plot(... | /src/1_main_w_ar_filter.R | no_license | drkrd/grid_based_analysis_of_impact_of_scan_angles | R | false | false | 4,457 | r | library(lidR)
library(dplyr)
library(future)
library(e1071)
lasc <- readLAScatalog("C:/1_Work/2_Ciron/Data/ALS/norm/")
rs <- 30 #resolution of the grid
area_filt <- 810
#processing parameters
plan(multisession, workers = 6L)
opt_chunk_buffer(lasc) <- 0
opt_chunk_size(lasc) <- 0
opt_stop_early(lasc) <- FALSE
plot(... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gscp_10c_build_adj_and_cooccurrence_matrices.R
\name{create_adj_matrix_with_spp_rows_vs_PU_cols}
\alias{create_adj_matrix_with_spp_rows_vs_PU_cols}
\title{Create adjacency matrix with species rows vs planning unit columns}
\usage{
create_adj_... | /man/create_adj_matrix_with_spp_rows_vs_PU_cols.Rd | no_license | langfob/bdpg | R | false | true | 1,900 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gscp_10c_build_adj_and_cooccurrence_matrices.R
\name{create_adj_matrix_with_spp_rows_vs_PU_cols}
\alias{create_adj_matrix_with_spp_rows_vs_PU_cols}
\title{Create adjacency matrix with species rows vs planning unit columns}
\usage{
create_adj_... |
##XXXXXXXXXXXXXX##
## Chi-sqr Test ##
##XXXXXXXXXXXXXX##
arm_1 <- c(100,900) # i.e. Intervention
arm_2 <- c(10,990) # i.e. Control
exp_df <- data.frame(rbind(arm_1,arm_2)) #assimilate data into simple 2x2 table
names(exp_df) <- c("purchase", "no purchas... | /RCODE_Experiment_Evaluation.R | no_license | mshump/Experimentation_Overview | R | false | false | 2,062 | r | ##XXXXXXXXXXXXXX##
## Chi-sqr Test ##
##XXXXXXXXXXXXXX##
arm_1 <- c(100,900) # i.e. Intervention
arm_2 <- c(10,990) # i.e. Control
exp_df <- data.frame(rbind(arm_1,arm_2)) #assimilate data into simple 2x2 table
names(exp_df) <- c("purchase", "no purchas... |
\name{ahull.grid}
\alias{ahull.grid}
\docType{data}
\title{ahull grid}
\description{Label the closest point on the alpha hull of the data.}
\usage{"ahull.grid"}
| /man/ahull.grid.Rd | no_license | tdhock/directlabels | R | false | false | 166 | rd | \name{ahull.grid}
\alias{ahull.grid}
\docType{data}
\title{ahull grid}
\description{Label the closest point on the alpha hull of the data.}
\usage{"ahull.grid"}
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simple_math.R
\name{percent_cutoff}
\alias{percent_cutoff}
\title{Find percentage of numbers that are above given thresholds.}
\usage{
percent_cutoff(x, cutoffs = c(0.3, 0.5), digits = 2, below = F, inclusive = T)
}
\arguments{
\item{x}{(num ... | /man/percent_cutoff.Rd | permissive | Deleetdk/kirkegaard | R | false | true | 1,044 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simple_math.R
\name{percent_cutoff}
\alias{percent_cutoff}
\title{Find percentage of numbers that are above given thresholds.}
\usage{
percent_cutoff(x, cutoffs = c(0.3, 0.5), digits = 2, below = F, inclusive = T)
}
\arguments{
\item{x}{(num ... |
# install libraries
install.packages("nnet");
install.package("neuralnet");
install.packages("multicore");
install.packages("caret");
install.packages("nlme");
install.packages("R.utils");
library(multicore)
library(nnet)
library(neuralnet)
library(caret)
library(nlme)
library(R.utils)
# read data
setwd("C:/Users/Paav... | /R-Code-229.r | no_license | Paavni/CS-229-Predict-Rainfall | R | false | false | 10,236 | r | # install libraries
install.packages("nnet");
install.package("neuralnet");
install.packages("multicore");
install.packages("caret");
install.packages("nlme");
install.packages("R.utils");
library(multicore)
library(nnet)
library(neuralnet)
library(caret)
library(nlme)
library(R.utils)
# read data
setwd("C:/Users/Paav... |
library(tidyverse)
devtools::load_all("augur")
#load("cache/before_recode.RData")
#library(tidyverse)
cancers <- read_csv("cache/cancers_prerecode.csv.gz", progress = FALSE)
#cancers[["dx_code_count"]] <-
# ifelse(is.na(cancers[["dx_code_count"]]), 0, cancers[["dx_code_count"]])
... | /munge/recoding.R | permissive | mustafaascha/seerm-bevacizumab | R | false | false | 14,805 | r |
library(tidyverse)
devtools::load_all("augur")
#load("cache/before_recode.RData")
#library(tidyverse)
cancers <- read_csv("cache/cancers_prerecode.csv.gz", progress = FALSE)
#cancers[["dx_code_count"]] <-
# ifelse(is.na(cancers[["dx_code_count"]]), 0, cancers[["dx_code_count"]])
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/line2alias.R
\name{line2alias}
\alias{line2alias}
\title{Line 2 Alias}
\usage{
line2alias(df, strain.col, is.rix = F)
}
\arguments{
\item{df}{Input data frame which contains a column with new CC line designations}
\item{strain.col}{Character... | /man/line2alias.Rd | no_license | kenoll/cckit | R | false | true | 632 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/line2alias.R
\name{line2alias}
\alias{line2alias}
\title{Line 2 Alias}
\usage{
line2alias(df, strain.col, is.rix = F)
}
\arguments{
\item{df}{Input data frame which contains a column with new CC line designations}
\item{strain.col}{Character... |
# 500, 500, 3, 0.25 -> Magic L1 = 3.150
# 500, 500, 3, 0.50 -> Magic L1 = 3.335
# 500, 500, 3, 0.75 -> Magic L1 = 3.511
# 500, 500, 3, 1.00 -> Magic L1 = 3.673
# 500, 500, 3, 1.25 -> Magic L1 = 3.839
# 500, 500, 3, 1.50 -> Magic L1 = 3.980
# 500, 500, 3, 2.00 -> Magic L1 = 4.132
# 500, 500, 3, 2.25 -> Magic L1 = 4.208
... | /time-varying lasso.R | no_license | Kevindork/Time-Varying-High-Dimensional-Inference | R | false | false | 3,294 | r | # 500, 500, 3, 0.25 -> Magic L1 = 3.150
# 500, 500, 3, 0.50 -> Magic L1 = 3.335
# 500, 500, 3, 0.75 -> Magic L1 = 3.511
# 500, 500, 3, 1.00 -> Magic L1 = 3.673
# 500, 500, 3, 1.25 -> Magic L1 = 3.839
# 500, 500, 3, 1.50 -> Magic L1 = 3.980
# 500, 500, 3, 2.00 -> Magic L1 = 4.132
# 500, 500, 3, 2.25 -> Magic L1 = 4.208
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/co2_to_ca.R
\name{co2_to_ca}
\alias{co2_to_ca}
\title{co2_to_ca}
\usage{
co2_to_ca(co2, patm)
}
\arguments{
\item{co2}{annual atm. CO2 in ppm}
\item{patm}{atm.pressure in Pa}
}
\value{
ca in Pa
}
\description{
Converts ambient CO2 from ppm t... | /Practicals/Practical_B/Photosynthesis.Rcheck/00_pkg_src/Photosynthesis/man/co2_to_ca.Rd | no_license | femeunier/VegMod_course | R | false | true | 562 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/co2_to_ca.R
\name{co2_to_ca}
\alias{co2_to_ca}
\title{co2_to_ca}
\usage{
co2_to_ca(co2, patm)
}
\arguments{
\item{co2}{annual atm. CO2 in ppm}
\item{patm}{atm.pressure in Pa}
}
\value{
ca in Pa
}
\description{
Converts ambient CO2 from ppm t... |
context("mutate")
test_that("mutate computed before summarise", {
mf <- memdb_frame(x = c(1, 2, 3), y = c(9, 8, 7))
out <- mutate(mf, z = x + y) %>%
summarise(sum_z = sum(z, na.rm = TRUE)) %>%
collect()
expect_equal(out$sum_z, 30)
})
test_that("two mutates equivalent to one", {
mf <- memdb_frame(x =... | /tests/testthat/test-mutate.r | permissive | refik/dbplyr | R | false | false | 2,076 | r | context("mutate")
test_that("mutate computed before summarise", {
mf <- memdb_frame(x = c(1, 2, 3), y = c(9, 8, 7))
out <- mutate(mf, z = x + y) %>%
summarise(sum_z = sum(z, na.rm = TRUE)) %>%
collect()
expect_equal(out$sum_z, 30)
})
test_that("two mutates equivalent to one", {
mf <- memdb_frame(x =... |
# This file was generated by Rcpp::compileAttributes
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
bayesBLP_rcpp_loop <- function(IV, X, Z, share, J, T, v, R, sigmasqR, A, theta_hat, deltabar, Ad, nu0, s0_sq, VOmega, ssq, cand_cov, theta_bar_initial, r_initial, tau_sq_initial, Omega_initial, delta_initial, t... | /pkgs/bayesm/R/rcppexports.r | no_license | vaguiar/EDAV_Project_2017 | R | false | false | 8,080 | r | # This file was generated by Rcpp::compileAttributes
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
bayesBLP_rcpp_loop <- function(IV, X, Z, share, J, T, v, R, sigmasqR, A, theta_hat, deltabar, Ad, nu0, s0_sq, VOmega, ssq, cand_cov, theta_bar_initial, r_initial, tau_sq_initial, Omega_initial, delta_initial, t... |
#' prepare vi_c for compilation
#'
#' @description This function selects the tree-level data from vi_c (cardc) based on selected cluster/plot headers.
#' Additonally, the function calculates basal area and tree per ha factor.
#'
#' @param compilationType character, either \code{PSP} or \code{nonPSP}. If it... | /R/vicPrep.R | permissive | bcgov/FAIBCompiler | R | false | false | 8,302 | r | #' prepare vi_c for compilation
#'
#' @description This function selects the tree-level data from vi_c (cardc) based on selected cluster/plot headers.
#' Additonally, the function calculates basal area and tree per ha factor.
#'
#' @param compilationType character, either \code{PSP} or \code{nonPSP}. If it... |
###################################################################################
################## Exploration of USCG Emissions Data in Louisiana ################
######################### Joan Meiners 2018 #######################################
### This script is for Current YEAR (2018) emissions data. See sepa... | /Emissions_script_CY18.R | no_license | beecycles/USCG-Emissions | R | false | false | 3,693 | r | ###################################################################################
################## Exploration of USCG Emissions Data in Louisiana ################
######################### Joan Meiners 2018 #######################################
### This script is for Current YEAR (2018) emissions data. See sepa... |
dt = read.table('FrecoveryDiversity.txt', header=T)
dt$Group = ordered(dt$Group, levels=c('CK','E-liquid','Cigarette'))
result = kruskal.test(shannon ~ Group, data = dt)
kw_result = data.frame(unclass(result), check.names = FALSE, stringsAsFactors = FALSE)
write.table(kw_result,file = "Frecovery_kruskal_shannon.txt",... | /rat/Mshannon_KW.R | no_license | Nonewood/Bioinformatics | R | false | false | 1,961 | r |
dt = read.table('FrecoveryDiversity.txt', header=T)
dt$Group = ordered(dt$Group, levels=c('CK','E-liquid','Cigarette'))
result = kruskal.test(shannon ~ Group, data = dt)
kw_result = data.frame(unclass(result), check.names = FALSE, stringsAsFactors = FALSE)
write.table(kw_result,file = "Frecovery_kruskal_shannon.txt",... |
# Logical operators
5 > 3 # greater than
5 >= 3 # greater than or equal
5 < 3 # less than
5 <= 3 # less than or equal
5 == 3 # equal
5 != 3 # not equal
"B" == "A" # also for characters, depends on coding
!(TRUE) # NOT
TRUE | FALSE # OR
TRUE & FALSE # AND
| /Lecture/w2/code_examples/code_examples/ex_logical.R | no_license | tuananh8497/IDS_FOLDER | R | false | false | 258 | r | # Logical operators
5 > 3 # greater than
5 >= 3 # greater than or equal
5 < 3 # less than
5 <= 3 # less than or equal
5 == 3 # equal
5 != 3 # not equal
"B" == "A" # also for characters, depends on coding
!(TRUE) # NOT
TRUE | FALSE # OR
TRUE & FALSE # AND
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/oxy-db_basics.R
\name{openBaseDB}
\alias{openBaseDB}
\title{Create/open and prepare SQLite database}
\usage{
openBaseDB(outfolder, dbname)
}
\arguments{
\item{outfolder}{Which folder are you building your databases in?}
\item{dbname}{What is... | /man/openBaseDB.Rd | no_license | cran/MetaDBparse | R | false | true | 547 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/oxy-db_basics.R
\name{openBaseDB}
\alias{openBaseDB}
\title{Create/open and prepare SQLite database}
\usage{
openBaseDB(outfolder, dbname)
}
\arguments{
\item{outfolder}{Which folder are you building your databases in?}
\item{dbname}{What is... |
library(glmnet)
mydata = read.table("../../../../TrainingSet/FullSet/ReliefF/oesophagus.csv",head=T,sep=",")
x = as.matrix(mydata[,4:ncol(mydata)])
y = as.matrix(mydata[,1])
set.seed(123)
glm = cv.glmnet(x,y,nfolds=10,type.measure="mae",alpha=0.25,family="gaussian",standardize=FALSE)
sink('./oesophagus_040.txt',append=... | /Model/EN/ReliefF/oesophagus/oesophagus_040.R | no_license | esbgkannan/QSMART | R | false | false | 355 | r | library(glmnet)
mydata = read.table("../../../../TrainingSet/FullSet/ReliefF/oesophagus.csv",head=T,sep=",")
x = as.matrix(mydata[,4:ncol(mydata)])
y = as.matrix(mydata[,1])
set.seed(123)
glm = cv.glmnet(x,y,nfolds=10,type.measure="mae",alpha=0.25,family="gaussian",standardize=FALSE)
sink('./oesophagus_040.txt',append=... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.