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 |
|---|---|---|---|---|---|---|---|---|---|
test_that("works with no input & works with NA", {
test_df <- tidytable(a = c("a", "a", "a"),
b = c("b", "b", "b"),
c = c("c", NA, "c"))
unite_df <- test_df %>%
unite.()
expect_named(unite_df, c("new_col"))
expect_equal(unite_df$new_col, c("a_b_c", "a_b_NA", "... | /tests/testthat/test-unite.R | permissive | lionel-/tidytable | R | false | false | 1,645 | r | test_that("works with no input & works with NA", {
test_df <- tidytable(a = c("a", "a", "a"),
b = c("b", "b", "b"),
c = c("c", NA, "c"))
unite_df <- test_df %>%
unite.()
expect_named(unite_df, c("new_col"))
expect_equal(unite_df$new_col, c("a_b_c", "a_b_NA", "... |
library(R2jags)
library(lubridate)
library(tidyverse)
library(RColorBrewer)
library(vroom)
source("_00_initialization.R")
# Obtains the lags
covid_def_lag <-
covid_def %>%
filter(ENTIDAD_RES == "09") %>%
mutate(SEMANA_DEF = as.numeric(cut(FECHA_DEF, seq(as.Date("2020-03-02"), as.Date("2021-12-26"), by="1 wee... | /_10_estimacion_def_sem_cdmx.R | no_license | humbertog/covid_mex | R | false | false | 3,328 | r | library(R2jags)
library(lubridate)
library(tidyverse)
library(RColorBrewer)
library(vroom)
source("_00_initialization.R")
# Obtains the lags
covid_def_lag <-
covid_def %>%
filter(ENTIDAD_RES == "09") %>%
mutate(SEMANA_DEF = as.numeric(cut(FECHA_DEF, seq(as.Date("2020-03-02"), as.Date("2021-12-26"), by="1 wee... |
##' Convert data into mcstate format; this is a thin wrapper around
##' [mcstate::particle_filter_data()] which adds a dummy step in front
##' of the first data point so that we can use the previous state and
##' the current states to convert cumulative measures into net daily
##' changes.
##'
##' @title Prepare data f... | /R/data.R | permissive | mrc-ide/sircovid2 | R | false | false | 1,980 | r | ##' Convert data into mcstate format; this is a thin wrapper around
##' [mcstate::particle_filter_data()] which adds a dummy step in front
##' of the first data point so that we can use the previous state and
##' the current states to convert cumulative measures into net daily
##' changes.
##'
##' @title Prepare data f... |
source("min_pair_functions.R")
# create a data frame to hold minimal pairs and populate it
starling.min.pairs = data.frame(Language = c(), Seg1 = c(), Phon1 = c(), Seg2 = c(), Phon2 = c(), stringsAsFactors = F)
# for each language,
for(i in 1:nrow(starling.segs)) {
# get the language data
lang.id = starling.segs$... | /load_min_pairs_starling.R | no_license | kaplanas/Minimal-Pair-Counts | R | false | false | 4,594 | r | source("min_pair_functions.R")
# create a data frame to hold minimal pairs and populate it
starling.min.pairs = data.frame(Language = c(), Seg1 = c(), Phon1 = c(), Seg2 = c(), Phon2 = c(), stringsAsFactors = F)
# for each language,
for(i in 1:nrow(starling.segs)) {
# get the language data
lang.id = starling.segs$... |
library(psych)
### Name: SD
### Title: Find the Standard deviation for a vector, matrix, or data.frame
### - do not return error if there are no cases
### Aliases: SD
### Keywords: models
### ** Examples
data(attitude)
apply(attitude,2,sd) #all complete
attitude[,1] <- NA
SD(attitude) #missing a column
describe(a... | /data/genthat_extracted_code/psych/examples/SD.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 332 | r | library(psych)
### Name: SD
### Title: Find the Standard deviation for a vector, matrix, or data.frame
### - do not return error if there are no cases
### Aliases: SD
### Keywords: models
### ** Examples
data(attitude)
apply(attitude,2,sd) #all complete
attitude[,1] <- NA
SD(attitude) #missing a column
describe(a... |
library(dplyr)
# load csv into a data frame, omit gameID column
lol <- select(read.csv("high_diamond_ranked_10min.csv"), -gameId)
# select number of clusters using total within sum square error
wss <- 0
wss_plot <- function () {
for (i in 1:10) {
km.out <- kmeans(lol, centers = i, nstart = 20, iter.max ... | /kmeans.R | no_license | zifangu/surf-2020 | R | false | false | 1,034 | r | library(dplyr)
# load csv into a data frame, omit gameID column
lol <- select(read.csv("high_diamond_ranked_10min.csv"), -gameId)
# select number of clusters using total within sum square error
wss <- 0
wss_plot <- function () {
for (i in 1:10) {
km.out <- kmeans(lol, centers = i, nstart = 20, iter.max ... |
##########################################################
# author: Ignacio Sarmiento-Barbieri
#
##########################################################
#Clean the workspace
rm(list=ls())
cat("\014")
local({r <- getOption("repos"); r["CRAN"] <- "http://cran.r-project.org"; options(repos=r)}) #set repo
#Load Pac... | /scripts/Figures/Fig3.R | no_license | uiuc-bdeep/Unlocking-Amenities | R | false | false | 1,996 | r | ##########################################################
# author: Ignacio Sarmiento-Barbieri
#
##########################################################
#Clean the workspace
rm(list=ls())
cat("\014")
local({r <- getOption("repos"); r["CRAN"] <- "http://cran.r-project.org"; options(repos=r)}) #set repo
#Load Pac... |
#' plotLog2FC
#'
#' compare log2FC values from two DESeq2 results table
#' @export
plotLog2FC <- function(res1,
res2,
main_title = "",
x_label = "log2FC",
y_label = "log2FC",
lims = c(-5,5),
... | /R/plotLog2FC.R | permissive | tschauer/HelpersforDESeq2 | R | false | false | 3,030 | r | #' plotLog2FC
#'
#' compare log2FC values from two DESeq2 results table
#' @export
plotLog2FC <- function(res1,
res2,
main_title = "",
x_label = "log2FC",
y_label = "log2FC",
lims = c(-5,5),
... |
id=1:nrow(test)
bayes.report=data.frame(id=id,pred=bayes.pred/length(bayes.es[[1]]))
write.csv(bayes.report,file="bayes.csv",row.names=F,col.names=F)
final.pred=data.frame(id=id,pred=apply(cbind(rpart.pred2,bayes.pred,ridge.pred),1,sum)/length(f3.es1[[1]]))
write.csv(final.pred,file="RpartLogitbayesRidge.std.csv",r... | /code/Submission/final.run.R | no_license | hetong007/Credit | R | false | false | 344 | r | id=1:nrow(test)
bayes.report=data.frame(id=id,pred=bayes.pred/length(bayes.es[[1]]))
write.csv(bayes.report,file="bayes.csv",row.names=F,col.names=F)
final.pred=data.frame(id=id,pred=apply(cbind(rpart.pred2,bayes.pred,ridge.pred),1,sum)/length(f3.es1[[1]]))
write.csv(final.pred,file="RpartLogitbayesRidge.std.csv",r... |
#load lubridate
library(lubridate)
#Download and unzip data
download.file("https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip", "data.zip")
unzip("data.zip")
#Read date
data <- read.table("household_power_consumption.txt", header=T, sep=";", na.strings = "?")
#Create Timestamp Varia... | /plot4.R | no_license | mazzottidr/ExData_Plotting1 | R | false | false | 1,433 | r | #load lubridate
library(lubridate)
#Download and unzip data
download.file("https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip", "data.zip")
unzip("data.zip")
#Read date
data <- read.table("household_power_consumption.txt", header=T, sep=";", na.strings = "?")
#Create Timestamp Varia... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ScoreTest.R
\docType{methods}
\name{BGScoreTest}
\alias{BGScoreTest}
\alias{BGScoreTest,NanoStringGeoMxSet-method}
\alias{BGScoreTest,matrix-method}
\title{Testing for features above the background}
\usage{
BGScoreTest(object, ...)
\S4method... | /man/BGScoreTest-methods.Rd | permissive | JasonWReeves/GeoDiff | R | false | true | 2,455 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ScoreTest.R
\docType{methods}
\name{BGScoreTest}
\alias{BGScoreTest}
\alias{BGScoreTest,NanoStringGeoMxSet-method}
\alias{BGScoreTest,matrix-method}
\title{Testing for features above the background}
\usage{
BGScoreTest(object, ...)
\S4method... |
library(twitteR)
setup_twitter_oauth('v4G2SxDIGAdgJonVdpgoXmdZQ','cM58GB3vVuuNscnAJ8uC7UwVpwHHE59WWnBrrV3kyUzY1W8Ak6','146841885-jaZbsQjJrHE6maZhn5nGC0UFNPP6rrULd1DB6C39','56tewGvrNgtcDExLmXGc94dyWWsho14umruVKGyENuW58')
lenovo_health <- searchTwitteR("LenovoHealthUS+@LenovoHealthUS",n=10000,lang = "en")
lenovo_na <- se... | /Lenovo.R | no_license | tanvibobde/Sentiment-Analysis | R | false | false | 2,438 | r | library(twitteR)
setup_twitter_oauth('v4G2SxDIGAdgJonVdpgoXmdZQ','cM58GB3vVuuNscnAJ8uC7UwVpwHHE59WWnBrrV3kyUzY1W8Ak6','146841885-jaZbsQjJrHE6maZhn5nGC0UFNPP6rrULd1DB6C39','56tewGvrNgtcDExLmXGc94dyWWsho14umruVKGyENuW58')
lenovo_health <- searchTwitteR("LenovoHealthUS+@LenovoHealthUS",n=10000,lang = "en")
lenovo_na <- se... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/NCMCVh.R
\name{NCMCVh}
\alias{NCMCVh}
\title{NCMCVh}
\usage{
NCMCVh(Y, u, h, ktype = "gaussian")
}
\arguments{
\item{Y}{the observation, p * n matrix}
\item{u}{the condition, it is a vector, one-dimensional array or
one-dimensional row(colum... | /man/NCMCVh.Rd | no_license | Jieli12/llfdr | R | false | true | 1,171 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/NCMCVh.R
\name{NCMCVh}
\alias{NCMCVh}
\title{NCMCVh}
\usage{
NCMCVh(Y, u, h, ktype = "gaussian")
}
\arguments{
\item{Y}{the observation, p * n matrix}
\item{u}{the condition, it is a vector, one-dimensional array or
one-dimensional row(colum... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/zipWRUdata.R
\docType{data}
\name{zip_all_census2}
\alias{zip_all_census2}
\title{WRU formatted racial demographics ZIP code data}
\format{
A data frame with 297,351 rows and 16 variables:
\describe{
\item{state_name}{State's name, all capita... | /zipWRUext2/man/zip_all_census2.Rd | no_license | ckann10/zipWRUext | R | false | true | 2,228 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/zipWRUdata.R
\docType{data}
\name{zip_all_census2}
\alias{zip_all_census2}
\title{WRU formatted racial demographics ZIP code data}
\format{
A data frame with 297,351 rows and 16 variables:
\describe{
\item{state_name}{State's name, all capita... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/color.r
\name{can_change_color}
\alias{can_change_color}
\title{does the terminal supports colors and can change their definitions}
\usage{
can_change_color()
}
\value{
TRUE iff only it can
}
\description{
Lots of terminals do not support ... | /Rcurses/man/can_change_color.Rd | no_license | kforner/rcurses | R | false | true | 813 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/color.r
\name{can_change_color}
\alias{can_change_color}
\title{does the terminal supports colors and can change their definitions}
\usage{
can_change_color()
}
\value{
TRUE iff only it can
}
\description{
Lots of terminals do not support ... |
setMethod("initialize", "Hypergraph", function(.Object, nodes=character(), hyperedges=list()) {
## Create a new hypergraph instance.
##
## nodes: character vector of node names
##
## hyperedges: a list of character vectors describing subsets of the nodes.
##
.Object@nodes = nodes
hy... | /HypergraphEvaluations/bioconductor/R/methods-Hypergraph.R | no_license | roscoe-casita/uoregon-thesis | R | false | false | 4,319 | r | setMethod("initialize", "Hypergraph", function(.Object, nodes=character(), hyperedges=list()) {
## Create a new hypergraph instance.
##
## nodes: character vector of node names
##
## hyperedges: a list of character vectors describing subsets of the nodes.
##
.Object@nodes = nodes
hy... |
### \author Kostas Lagogiannis 2019-04-17
## Figure 4 of manuscript - Clustering of capture bouts
## This is a mixture of two Gaussians Model for Clustering Capture speed (fast/ slow), based on Speed & Distance from Prey
## The covariances also of the model also show the relationship between the capture bout speed an... | /stat_ClusterCaptureBouts.r | permissive | dafishcode/ontogenyofhunting_pub | R | false | false | 4,965 | r | ### \author Kostas Lagogiannis 2019-04-17
## Figure 4 of manuscript - Clustering of capture bouts
## This is a mixture of two Gaussians Model for Clustering Capture speed (fast/ slow), based on Speed & Distance from Prey
## The covariances also of the model also show the relationship between the capture bout speed an... |
# Decode raw bytes XML into an R list object.
decode_xml <- function(raw) {
obj <- xml_to_list(raw_to_utf8(raw))
return(obj)
}
# Convert an XML string to an R list.
xml_to_list <- function(value) {
if (is_empty(value)) return(NULL)
result <- xml2::as_list(xml2::read_xml(value))
return(result)
}
# Convert li... | /paws.common/R/xmlutil.R | permissive | williazo/paws | R | false | false | 7,825 | r | # Decode raw bytes XML into an R list object.
decode_xml <- function(raw) {
obj <- xml_to_list(raw_to_utf8(raw))
return(obj)
}
# Convert an XML string to an R list.
xml_to_list <- function(value) {
if (is_empty(value)) return(NULL)
result <- xml2::as_list(xml2::read_xml(value))
return(result)
}
# Convert li... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data-documentation.R
\docType{data}
\name{sp3}
\alias{sp3}
\title{Soil Profile Data Example 3}
\format{
A data frame with 46 observations on the following 15 variables.
\describe{ \item{id}{soil id} \item{top}{horizon upper
boundary (cm)} \it... | /man/sp3.Rd | no_license | ncss-tech/aqp | R | false | true | 4,650 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data-documentation.R
\docType{data}
\name{sp3}
\alias{sp3}
\title{Soil Profile Data Example 3}
\format{
A data frame with 46 observations on the following 15 variables.
\describe{ \item{id}{soil id} \item{top}{horizon upper
boundary (cm)} \it... |
library(pRSR)
### Name: GetFitHReg
### Title: Compute loglikelihood ratio test statistic
### Aliases: GetFitHReg
### Keywords: ts
### ** Examples
#Simple Examples
z<-SimulateHReg(10, f=2.5/10, 1, 2)
GetFitHReg(z)
t<-seq(2,20,2)
GetFitHReg(y=z, t=t)
GetFitHReg(z, nf=25)
| /data/genthat_extracted_code/pRSR/examples/GetFitHReg.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 277 | r | library(pRSR)
### Name: GetFitHReg
### Title: Compute loglikelihood ratio test statistic
### Aliases: GetFitHReg
### Keywords: ts
### ** Examples
#Simple Examples
z<-SimulateHReg(10, f=2.5/10, 1, 2)
GetFitHReg(z)
t<-seq(2,20,2)
GetFitHReg(y=z, t=t)
GetFitHReg(z, nf=25)
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/autoTreshold.R
\name{autoTreshold}
\alias{autoTreshold}
\title{Some BullShit}
\usage{
autoTreshold(
fn_df,
fn_marker,
fn_maxNOfEvents = 100,
fn_tol = 1e-05,
fn_expansion = 1,
fn_seed = 1234
)
}
\description{
Some BullShit
}
| /man/autoTreshold.Rd | no_license | luigidolcetti/RUNIMC | R | false | true | 314 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/autoTreshold.R
\name{autoTreshold}
\alias{autoTreshold}
\title{Some BullShit}
\usage{
autoTreshold(
fn_df,
fn_marker,
fn_maxNOfEvents = 100,
fn_tol = 1e-05,
fn_expansion = 1,
fn_seed = 1234
)
}
\description{
Some BullShit
}
|
library(GISTools)
### Name: North Arrow
### Title: Add a north arrow to a map
### Aliases: north.arrow
### ** Examples
# Read in map data for New Haven
data(newhaven)
# Plot census block boundaries
plot(blocks)
# Add a north arrow
north.arrow(534750,152000,miles2ft(0.5),col='cyan')
# ... and a title
title('New Have... | /data/genthat_extracted_code/GISTools/examples/north.arrow.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 332 | r | library(GISTools)
### Name: North Arrow
### Title: Add a north arrow to a map
### Aliases: north.arrow
### ** Examples
# Read in map data for New Haven
data(newhaven)
# Plot census block boundaries
plot(blocks)
# Add a north arrow
north.arrow(534750,152000,miles2ft(0.5),col='cyan')
# ... and a title
title('New Have... |
best<-function(state, outcome_from_user)
{
#state="NY"
#outcome="Hospital.30.Day.Death..Mortality..Rates.from.Heart.Attack"
# Lookup lowest 30 day mortality rate for that specified state in the last 30 days
# Error out request with incorrect state or outcome measures
# Output hospital with minimum values and use ... | /RProgramming/week4.R | no_license | hirenpatelatl/datasciencecoursera | R | false | false | 1,860 | r |
best<-function(state, outcome_from_user)
{
#state="NY"
#outcome="Hospital.30.Day.Death..Mortality..Rates.from.Heart.Attack"
# Lookup lowest 30 day mortality rate for that specified state in the last 30 days
# Error out request with incorrect state or outcome measures
# Output hospital with minimum values and use ... |
# -----------------------
# Setting
library(tree)
require(maptree)
library(randomForest)
setwd("/Users/aszostek/Projects/Kaggle/Titanic")
source("./Utils/submission_utils.R")
iteration = 8
# -----------------------
# Read Data
train.org <- read.csv(file="./Data/train.csv")
test.org <- read.csv(file="./Data/test.csv"... | /Code/Titanic_iteration8.R | no_license | astronerma/Titanic | R | false | false | 4,718 | r | # -----------------------
# Setting
library(tree)
require(maptree)
library(randomForest)
setwd("/Users/aszostek/Projects/Kaggle/Titanic")
source("./Utils/submission_utils.R")
iteration = 8
# -----------------------
# Read Data
train.org <- read.csv(file="./Data/train.csv")
test.org <- read.csv(file="./Data/test.csv"... |
library(e1071)
library(caTools)
library(caret)
library(stats)
library(useful)
library(plyr)
library(doMC)
library(pROC)
library(data.table)
# global options
registerDoMC(detectCores()/2)
getDoParWorkers()
setwd("/home/cjls4/feature_vectors/")
#import data
load("collapsed_g4_positive.RData")
load("collapsed_g4_nega... | /Code/SVM_1.R | no_license | caroljlsun/sysbiol_pt3 | R | false | false | 10,045 | r |
library(e1071)
library(caTools)
library(caret)
library(stats)
library(useful)
library(plyr)
library(doMC)
library(pROC)
library(data.table)
# global options
registerDoMC(detectCores()/2)
getDoParWorkers()
setwd("/home/cjls4/feature_vectors/")
#import data
load("collapsed_g4_positive.RData")
load("collapsed_g4_nega... |
#' Calculate standard error, standard deviation, and confidence interval
#' Steal from Cookbook for R
#'
#' @param data data.frame you want to calculate
#' @param measurevar colname you want to measure
#' @param groupvars A list of variables you want to use to group the data, those will also be kept in the output
#' @... | /R/summarySE.R | permissive | bxshi/rdsg | R | false | false | 1,652 | r | #' Calculate standard error, standard deviation, and confidence interval
#' Steal from Cookbook for R
#'
#' @param data data.frame you want to calculate
#' @param measurevar colname you want to measure
#' @param groupvars A list of variables you want to use to group the data, those will also be kept in the output
#' @... |
#-------------Question 2------------------#
library(lpSolveAPI)
Y <- make.lp(0, 9)
lp.control(Y, sense= "maximize")
set.objfn(Y, c(25, 10, 5, 21, 6, 1, 25, 10, 5))
add.constraint(Y, c(1,1,1,0,0,0,0,0,0), "<=", 4800)
add.constraint(Y, c(0,0,0,1,1,1,0,0,0), "<=", 3000)
add.constraint(Y, c(0,0,0,0,0,0,1,1,1), "<=", 350... | /Model prediction.R | no_license | naveen96c/R-Programming | R | false | false | 2,501 | r | #-------------Question 2------------------#
library(lpSolveAPI)
Y <- make.lp(0, 9)
lp.control(Y, sense= "maximize")
set.objfn(Y, c(25, 10, 5, 21, 6, 1, 25, 10, 5))
add.constraint(Y, c(1,1,1,0,0,0,0,0,0), "<=", 4800)
add.constraint(Y, c(0,0,0,1,1,1,0,0,0), "<=", 3000)
add.constraint(Y, c(0,0,0,0,0,0,1,1,1), "<=", 350... |
library(xRing)
### Name: print
### Title: Print xRing Objects
### Aliases: print print.xRing print print.xRingList
### ** Examples
data(PaPiRaw)
data(PaPiSpan)
PaPi <- detectRings(PaPiRaw, PaPiSpan)
class(PaPi)
print(PaPi$AFO1001a)
PaPi$AFO1001a
PaPi$AFO1001a[]
print(PaPi)
PaPi
| /data/genthat_extracted_code/xRing/examples/print.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 299 | r | library(xRing)
### Name: print
### Title: Print xRing Objects
### Aliases: print print.xRing print print.xRingList
### ** Examples
data(PaPiRaw)
data(PaPiSpan)
PaPi <- detectRings(PaPiRaw, PaPiSpan)
class(PaPi)
print(PaPi$AFO1001a)
PaPi$AFO1001a
PaPi$AFO1001a[]
print(PaPi)
PaPi
|
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/crm.wrapper.R
\name{crm.wrapper}
\alias{create.model.list}
\alias{crm.wrapper}
\alias{crmlist_fromfiles}
\alias{load.model}
\alias{model.table}
\alias{rerun_crm}
\title{Automation of model runs}
\usage{
crm.wrapper(model.li... | /marked/man/crm.wrapper.Rd | no_license | bmcclintock/marked | R | false | false | 3,821 | rd | % Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/crm.wrapper.R
\name{crm.wrapper}
\alias{create.model.list}
\alias{crm.wrapper}
\alias{crmlist_fromfiles}
\alias{load.model}
\alias{model.table}
\alias{rerun_crm}
\title{Automation of model runs}
\usage{
crm.wrapper(model.li... |
#' Score a case forecast
#'
#' @param pred_cases Dataframe of predicted cases with the following variables: `sample`, `date`,
#' `cases` and forecast horizon. As produced by `forecast_cases`.
#' @param obs_cases Dataframe of observed cases with the following variables: `date` and `cases`.
#' @return A dataframe contai... | /R/score_case_forecast.R | permissive | medewitt/EpiSoon | R | false | false | 1,674 | r |
#' Score a case forecast
#'
#' @param pred_cases Dataframe of predicted cases with the following variables: `sample`, `date`,
#' `cases` and forecast horizon. As produced by `forecast_cases`.
#' @param obs_cases Dataframe of observed cases with the following variables: `date` and `cases`.
#' @return A dataframe contai... |
library(data.table)
library(lubridate)
library(data.table)
library(ggplot2)
train.data <- data.table(read.csv("./training_data.csv"))
train.data[,
`:=`(Swim=as.POSIXct(Swim,format="%T"),
Bike=as.POSIXct(Bike,format="%T"),
Run=as.POSIXct(Run,format="%T"),
Total... | /global.R | no_license | ericlwilliams/im_training | R | false | false | 5,922 | r | library(data.table)
library(lubridate)
library(data.table)
library(ggplot2)
train.data <- data.table(read.csv("./training_data.csv"))
train.data[,
`:=`(Swim=as.POSIXct(Swim,format="%T"),
Bike=as.POSIXct(Bike,format="%T"),
Run=as.POSIXct(Run,format="%T"),
Total... |
\alias{GtkCellRendererSpin}
\alias{gtkCellRendererSpin}
\name{GtkCellRendererSpin}
\title{GtkCellRendererSpin}
\description{Renders a spin button in a cell}
\section{Methods and Functions}{
\code{\link{gtkCellRendererSpinNew}()}\cr
\code{gtkCellRendererSpin()}
}
\section{Hierarchy}{\preformatted{GObject
+----GInitia... | /RGtk2/man/GtkCellRendererSpin.Rd | no_license | lawremi/RGtk2 | R | false | false | 2,384 | rd | \alias{GtkCellRendererSpin}
\alias{gtkCellRendererSpin}
\name{GtkCellRendererSpin}
\title{GtkCellRendererSpin}
\description{Renders a spin button in a cell}
\section{Methods and Functions}{
\code{\link{gtkCellRendererSpinNew}()}\cr
\code{gtkCellRendererSpin()}
}
\section{Hierarchy}{\preformatted{GObject
+----GInitia... |
require("texreg")
regData = read.csv("~/Downloads/regdata.csv")
regData = transform(regData, NCallOILag1 = c(NCallOI))
#regData = transform(regData, NCallOIChangedLag1 = c(NCallOIChanged[-1], NA))
regData = transform(regData, NPutOILag1 = c(NPutOI[-1], NA))
#regData = transform(regData, NPutOIChangeLag1 = c(NPutOICh... | /FINA6206.R | no_license | qanwer/R | R | false | false | 4,125 | r |
require("texreg")
regData = read.csv("~/Downloads/regdata.csv")
regData = transform(regData, NCallOILag1 = c(NCallOI))
#regData = transform(regData, NCallOIChangedLag1 = c(NCallOIChanged[-1], NA))
regData = transform(regData, NPutOILag1 = c(NPutOI[-1], NA))
#regData = transform(regData, NPutOIChangeLag1 = c(NPutOICh... |
####################################################
#### INSTALLATION OF ALL PACKAGES Below - do not need to repeat if already in library (Try running lines 16-19 first, if some packages missing revert to line 4-11):
####################################################
source("https://bioconductor.org/biocLite.R")
bio... | /SpadevizR-analysis/DR3 Grouped Day 51/B Cells (smaller K)/DR3 Day 51 B Cells R Script.R | permissive | reeves-lab/2020-Coxiella-Scientific-Reports | R | false | false | 53,591 | r | ####################################################
#### INSTALLATION OF ALL PACKAGES Below - do not need to repeat if already in library (Try running lines 16-19 first, if some packages missing revert to line 4-11):
####################################################
source("https://bioconductor.org/biocLite.R")
bio... |
\name{RCBD}
\alias{RCBD}
\title{
Randomized Complete Block Design (RCBD)
}
\description{
A \code{list} illustrating the resources of \pkg{ScottKnott} package
related to Randomized Complete Block Design (\samp{RCBD}).
}
\usage{
data(RCBD)
RCBD
}
\details{
A simulated data to model a Ra... | /man/RCBD.Rd | no_license | jcfaria/ScottKnott | R | false | false | 475 | rd | \name{RCBD}
\alias{RCBD}
\title{
Randomized Complete Block Design (RCBD)
}
\description{
A \code{list} illustrating the resources of \pkg{ScottKnott} package
related to Randomized Complete Block Design (\samp{RCBD}).
}
\usage{
data(RCBD)
RCBD
}
\details{
A simulated data to model a Ra... |
##prueba_lectura_1.r
##2015-04-127dmontaner@cipf.es
##vemos velocidades de lectura
date ()
Sys.info ()[c("nodename", "user")]
commandArgs ()
rm (list = ls ())
R.version.string ##"R version 3.2.0 (2015-04-16)"
###DATOS
setwd ("../data")
dir ()
## ## R
## system.time (gtf <- read.table (file = "Homo_sapiens.GRCh38.79.... | /clases/2015_04_27_practical_local_blast/datos_simulacion/limpia_gtf.r | no_license | dmontaner-teaching/bioinformatics_intro_course | R | false | false | 775 | r | ##prueba_lectura_1.r
##2015-04-127dmontaner@cipf.es
##vemos velocidades de lectura
date ()
Sys.info ()[c("nodename", "user")]
commandArgs ()
rm (list = ls ())
R.version.string ##"R version 3.2.0 (2015-04-16)"
###DATOS
setwd ("../data")
dir ()
## ## R
## system.time (gtf <- read.table (file = "Homo_sapiens.GRCh38.79.... |
#setwd("/netscr/deelim")
setwd("C:/Users/David/Desktop/Research/EM")
source("Pan EM.R") # Pan method
library(MASS)
# Simulations to choose K
sim=100
choose_k<-rep(0,times=sim)
n=20
g=100
k=4
pi=c(0.2,0.4,0.3,0.1)
sigma=diag(k)
b=matrix(rep(0,times=k*g),nrow=g,byrow=TRUE) # initialize betas
b[1:100,]<-matrix(rep(c(... | /Simulations/real_dat_simulations.R | no_license | DavidKLim/EM | R | false | false | 4,488 | r | #setwd("/netscr/deelim")
setwd("C:/Users/David/Desktop/Research/EM")
source("Pan EM.R") # Pan method
library(MASS)
# Simulations to choose K
sim=100
choose_k<-rep(0,times=sim)
n=20
g=100
k=4
pi=c(0.2,0.4,0.3,0.1)
sigma=diag(k)
b=matrix(rep(0,times=k*g),nrow=g,byrow=TRUE) # initialize betas
b[1:100,]<-matrix(rep(c(... |
c DCNF-Autarky [version 0.0.1].
c Copyright (c) 2018-2019 Swansea University.
c
c Input Clause Count: 19996
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 19995
c
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 19995
c
c Input Parameter (command line, ... | /code/dcnf-ankit-optimized/Results/QBFLIB-2018/E1/Experiments/Basler/terminator/stmt19_352_408/stmt19_352_408.R | no_license | arey0pushpa/dcnf-autarky | R | false | false | 720 | r | c DCNF-Autarky [version 0.0.1].
c Copyright (c) 2018-2019 Swansea University.
c
c Input Clause Count: 19996
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 19995
c
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 19995
c
c Input Parameter (command line, ... |
#rm(list=ls(all=TRUE))
library('e1071')
library(plyr)
library(rgl)
library(scatterplot3d)
AAPL = read.csv('Youtubelist.csv')
AAPL = AAPL[,-c(1,2,3,10)]#Range to process
for(i in 1:7)
AAPL = AAPL[!is.na(AAPL[,i]),]
#AAPL = AAPL[sample(nrow(AAPL),3000),]#Sampling
#AAPL = AAPL[order(AAPL$Box),]
AAPL$Youtube.Views = ... | /Odds_Ends/test6.R | no_license | peter0749/Project_R | R | false | false | 2,401 | r | #rm(list=ls(all=TRUE))
library('e1071')
library(plyr)
library(rgl)
library(scatterplot3d)
AAPL = read.csv('Youtubelist.csv')
AAPL = AAPL[,-c(1,2,3,10)]#Range to process
for(i in 1:7)
AAPL = AAPL[!is.na(AAPL[,i]),]
#AAPL = AAPL[sample(nrow(AAPL),3000),]#Sampling
#AAPL = AAPL[order(AAPL$Box),]
AAPL$Youtube.Views = ... |
\name{sapa.combined}
\alias{sapa.combined}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
sapa.combined}
\description{
Returns the object for remapping with different parameters}
\usage{
sapa.combined(df, DV, gridsize = 300, database = "usa", regions = ".", average = TRUE, size = 11, miss = 0.05... | /man/sapa.combined.Rd | no_license | frenchja/SAPATools | R | false | false | 1,703 | rd | \name{sapa.combined}
\alias{sapa.combined}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
sapa.combined}
\description{
Returns the object for remapping with different parameters}
\usage{
sapa.combined(df, DV, gridsize = 300, database = "usa", regions = ".", average = TRUE, size = 11, miss = 0.05... |
library(tidyverse)
library(gridExtra)
library(ggplot2)
library(dplyr)
library(gridExtra)
library(reshape2)
library(openxlsx)
library(TMB)
library(here)
library(png)
#####------------ NOTES -------------------#####
# - nll for parameter estimation is log-likelihood
# - SSB is real numbers & S... | /Param_est_copy.R | no_license | jessicaweb3/fmsy_m | R | false | false | 36,237 | r | library(tidyverse)
library(gridExtra)
library(ggplot2)
library(dplyr)
library(gridExtra)
library(reshape2)
library(openxlsx)
library(TMB)
library(here)
library(png)
#####------------ NOTES -------------------#####
# - nll for parameter estimation is log-likelihood
# - SSB is real numbers & S... |
testlist <- list(x = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 1.22812917813345e+146, 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(multivariance::fastdist,testlist)
str(result) | /multivariance/inst/testfiles/fastdist/AFL_fastdist/fastdist_valgrind_files/1613098437-test.R | no_license | akhikolla/updatedatatype-list3 | R | false | false | 303 | r | testlist <- list(x = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 1.22812917813345e+146, 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(multivariance::fastdist,testlist)
str(result) |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/linefuns.R
\name{line_length}
\alias{line_length}
\title{Calculate length of lines in geographic CRS}
\usage{
line_length(l, byid = TRUE)
}
\arguments{
\item{l}{A SpatialLinesDataFrame}
\item{byid}{Logical determining whether the length is r... | /man/line_length.Rd | permissive | stevenysw/stplanr | R | false | true | 421 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/linefuns.R
\name{line_length}
\alias{line_length}
\title{Calculate length of lines in geographic CRS}
\usage{
line_length(l, byid = TRUE)
}
\arguments{
\item{l}{A SpatialLinesDataFrame}
\item{byid}{Logical determining whether the length is r... |
#' @title Clean North East Oregon Carcass Data - from ODFW Access DB
#' @description Processes the raw ODFW Access DB carcass dataset and standardizes to join with clean_carcassData(CDMS_dat)
#' @param data Data obtained from premade query in ODFW Access DB. !!Export data as text file, comma separated, headers included... | /R/clean_CarcassData_NEOR.R | no_license | ryankinzer/cuyem | R | false | false | 10,842 | r | #' @title Clean North East Oregon Carcass Data - from ODFW Access DB
#' @description Processes the raw ODFW Access DB carcass dataset and standardizes to join with clean_carcassData(CDMS_dat)
#' @param data Data obtained from premade query in ODFW Access DB. !!Export data as text file, comma separated, headers included... |
# Load packages
library(tidyverse)
library(rstan)
library(plyr)
library(loo)
library(magrittr)
rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())
setwd("CopyTask2019/")
# Sampling parameters
set.seed(125)
n_chain = 3
n_cores = 3
iterations = 10000
# Load df
d <- read_csv("data/ct.csv") %>% ... | /CT/scripts/LMMcompvariance.R | no_license | jensroes/Copy-task-analysis | R | false | false | 3,187 | r | # Load packages
library(tidyverse)
library(rstan)
library(plyr)
library(loo)
library(magrittr)
rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())
setwd("CopyTask2019/")
# Sampling parameters
set.seed(125)
n_chain = 3
n_cores = 3
iterations = 10000
# Load df
d <- read_csv("data/ct.csv") %>% ... |
###Load library
library(shiny)
library(shinyjs)
library(tidyverse)
library(plyr)
library(data.table)
###Data and environment preparation
movie_all = read.table("./data/movie_all.rdata")
header1 = read.table("./data/movie_cor.rdata", header = TRUE, nrow = 1)
movie_cor = fread("./data/movie_cor.rdata", skip=1, header=FA... | /shiny_2/server.R | no_license | BiiHug/bouban_public | R | false | false | 46,122 | r | ###Load library
library(shiny)
library(shinyjs)
library(tidyverse)
library(plyr)
library(data.table)
###Data and environment preparation
movie_all = read.table("./data/movie_all.rdata")
header1 = read.table("./data/movie_cor.rdata", header = TRUE, nrow = 1)
movie_cor = fread("./data/movie_cor.rdata", skip=1, header=FA... |
#' Channel Set Purpose
#'
#' Sets the description for the channel (the same as channels.setDescription, obsolete).
#'
#' @param token The token to connect to the app.
#' @param roomid The channel’s id Required
#' @param purpose The description to set for the channel. Required
#'
#' @export
#' @importFrom httr POST GET ... | /R/channels_channel_set_purpose.R | no_license | ColinFay/rrocketchat | R | false | false | 965 | r | #' Channel Set Purpose
#'
#' Sets the description for the channel (the same as channels.setDescription, obsolete).
#'
#' @param token The token to connect to the app.
#' @param roomid The channel’s id Required
#' @param purpose The description to set for the channel. Required
#'
#' @export
#' @importFrom httr POST GET ... |
test_that("Package readme can be built ", {
skip_on_cran()
on.exit(unlink(c("testReadme/README.md", "testReadme/man/figures"), recursive = TRUE))
suppressMessages(build_readme("testReadme"))
expect_true(file.exists(file.path("testReadme", "README.md")))
expect_false(file.exists(file.path("testReadme", "REA... | /tests/testthat/test-build-readme.R | no_license | ricciardi/devtools | R | false | false | 336 | r | test_that("Package readme can be built ", {
skip_on_cran()
on.exit(unlink(c("testReadme/README.md", "testReadme/man/figures"), recursive = TRUE))
suppressMessages(build_readme("testReadme"))
expect_true(file.exists(file.path("testReadme", "README.md")))
expect_false(file.exists(file.path("testReadme", "REA... |
testlist <- list(Beta = 0, CVLinf = 86341236051411296, FM = 1.53632495265886e-311, L50 = 0, L95 = 0, LenBins = c(2.0975686864138e+162, -2.68131210337361e-144, -1.11215735981244e+199, -4.48649879577108e+143, 1.6611802228813e+218, 900371.947279558, 1.07063092954708e+238, 2.88003257377011e-142, 1.29554... | /DLMtool/inst/testfiles/LBSPRgen/AFL_LBSPRgen/LBSPRgen_valgrind_files/1615832181-test.R | no_license | akhikolla/updatedatatype-list2 | R | false | false | 2,047 | r | testlist <- list(Beta = 0, CVLinf = 86341236051411296, FM = 1.53632495265886e-311, L50 = 0, L95 = 0, LenBins = c(2.0975686864138e+162, -2.68131210337361e-144, -1.11215735981244e+199, -4.48649879577108e+143, 1.6611802228813e+218, 900371.947279558, 1.07063092954708e+238, 2.88003257377011e-142, 1.29554... |
boot.slope.bca <-
function(x, y, null.hyp = NULL, alternative = c("two.sided","less","greater"),
conf.level = 0.95, type = NULL, R = 9999)
{
# require(boot)
obs <- cor(x,y)
test <- !is.null(null.hyp)
data <- data.frame(x,y)
obs <- lm(y~x)$coeff[2]
boot.slope <- suppressWarnings(boot(... | /wBoot/R/boot.slope.bca.R | no_license | ingted/R-Examples | R | false | false | 2,964 | r | boot.slope.bca <-
function(x, y, null.hyp = NULL, alternative = c("two.sided","less","greater"),
conf.level = 0.95, type = NULL, R = 9999)
{
# require(boot)
obs <- cor(x,y)
test <- !is.null(null.hyp)
data <- data.frame(x,y)
obs <- lm(y~x)$coeff[2]
boot.slope <- suppressWarnings(boot(... |
#--------- Read from CSV File (Remember reverse slashes) -----------
LoggerResults = read.csv("C:/Data Repositry/Elspec/TestResults/TEST140/PQSExport_20150216_095845_Ne02b_Wave.csv", header=T)
LoggerResults$TIMESTAMP <- dmy_hm(LoggerResults$X.DATEANDTIME) + as.numeric(LoggerResults$X.SECONDS.)
#--------- Set Window ... | /TEST226.R | no_license | acousland/Elspec_Sample_Analysis | R | false | false | 1,384 | r |
#--------- Read from CSV File (Remember reverse slashes) -----------
LoggerResults = read.csv("C:/Data Repositry/Elspec/TestResults/TEST140/PQSExport_20150216_095845_Ne02b_Wave.csv", header=T)
LoggerResults$TIMESTAMP <- dmy_hm(LoggerResults$X.DATEANDTIME) + as.numeric(LoggerResults$X.SECONDS.)
#--------- Set Window ... |
library(robotstxt)
path<-paths_allowed("https://www.rottentomatoes.com/top/bestofrt/top_100_animation_movies/")
library(rvest)
link<-"https://www.rottentomatoes.com/top/bestofrt/top_100_animation_movies/"
web<-read_html(link)
library(dplyr)
movie_name<-web%>%html_nodes("#top_movies_main .articleLink")%>%html_text... | /RA1811003020259 (1).R | no_license | Nasirsohail/Nasirsohail | R | false | false | 508 | r | library(robotstxt)
path<-paths_allowed("https://www.rottentomatoes.com/top/bestofrt/top_100_animation_movies/")
library(rvest)
link<-"https://www.rottentomatoes.com/top/bestofrt/top_100_animation_movies/"
web<-read_html(link)
library(dplyr)
movie_name<-web%>%html_nodes("#top_movies_main .articleLink")%>%html_text... |
#module load intel/18.0 intelmpi/18.0 R/3.6.3; R
### makes rabbit input
args = commandArgs(trailingOnly=TRUE)
chr.i <- as.character(args[1])
maxcM <- as.numeric(args[2])
f1s.set <- as.character(args[3])
#chr.i <- "Scaffold_1863_HRSCAF_2081"; maxcM=10; f1s.set <- "all"
### libraries
library(data.table)
l... | /AlanAnalysis/rQTL/rabbit.format_input.consensus.dosage.R | no_license | kbkubow/DaphniaPulex20162017Sequencing | R | false | false | 8,502 | r | #module load intel/18.0 intelmpi/18.0 R/3.6.3; R
### makes rabbit input
args = commandArgs(trailingOnly=TRUE)
chr.i <- as.character(args[1])
maxcM <- as.numeric(args[2])
f1s.set <- as.character(args[3])
#chr.i <- "Scaffold_1863_HRSCAF_2081"; maxcM=10; f1s.set <- "all"
### libraries
library(data.table)
l... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{vector_of_matrices}
\alias{vector_of_matrices}
\title{Computes elements S^n until the value size_vec}
\usage{
vector_of_matrices(the_vector, S, size_vec)
}
\arguments{
\item{the_vector}{A vector to save results.}
\item{S}... | /man/vector_of_matrices.Rd | permissive | jorgeyslas/phfrailty | R | false | true | 492 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{vector_of_matrices}
\alias{vector_of_matrices}
\title{Computes elements S^n until the value size_vec}
\usage{
vector_of_matrices(the_vector, S, size_vec)
}
\arguments{
\item{the_vector}{A vector to save results.}
\item{S}... |
library(quantable)
### Name: simpleheatmap
### Title: heatmap2 facade
### Aliases: simpleheatmap
### ** Examples
tmp = matrix(rep((1:100),times = 4) + rnorm(100*4,0,3),ncol=4)
mean = c(20,30,10,40)
sd = c(4,3,4,5)
tmp = sweep(tmp,2,sd,"*")
tmp = sweep(tmp,2,mean,"+")
par(mar=c(5,5,5,5))
simpleheatmap(tmp,ColSideCol... | /data/genthat_extracted_code/quantable/examples/simpleheatmap.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 378 | r | library(quantable)
### Name: simpleheatmap
### Title: heatmap2 facade
### Aliases: simpleheatmap
### ** Examples
tmp = matrix(rep((1:100),times = 4) + rnorm(100*4,0,3),ncol=4)
mean = c(20,30,10,40)
sd = c(4,3,4,5)
tmp = sweep(tmp,2,sd,"*")
tmp = sweep(tmp,2,mean,"+")
par(mar=c(5,5,5,5))
simpleheatmap(tmp,ColSideCol... |
##reading the data from household_power_consumption.txt
DataPower<-read.table("household_power_consumption.txt", sep=";", header = TRUE, na.strings = "?", stringsAsFactors = FALSE, dec = ".")
## subsetting the data to the 1/2/2007 and 2/2/2007 periods
SubData<-DataPower[DataPower$Date %in% c("1/2/2007","2/2/2007"),]
# ... | /plot2.R | no_license | Ig-Gamma/ExData_Plotting1 | R | false | false | 692 | r | ##reading the data from household_power_consumption.txt
DataPower<-read.table("household_power_consumption.txt", sep=";", header = TRUE, na.strings = "?", stringsAsFactors = FALSE, dec = ".")
## subsetting the data to the 1/2/2007 and 2/2/2007 periods
SubData<-DataPower[DataPower$Date %in% c("1/2/2007","2/2/2007"),]
# ... |
\name{GPS}
\alias{GPS}
\docType{data}
\title{
\code{GPS}
}
\description{
WGS84 projection
}
\usage{data(GPS)}
\format{
The format is:
Formal class 'CRS' [package "sp"] with 1 slots
..@ projargs: chr "+init=epsg:4326 +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0"
}
\examples{
data(GPS)
str(GP... | /man/GPS.Rd | no_license | cran/geospacom | R | false | false | 344 | rd | \name{GPS}
\alias{GPS}
\docType{data}
\title{
\code{GPS}
}
\description{
WGS84 projection
}
\usage{data(GPS)}
\format{
The format is:
Formal class 'CRS' [package "sp"] with 1 slots
..@ projargs: chr "+init=epsg:4326 +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0"
}
\examples{
data(GPS)
str(GP... |
library("ghgvcr")
library("ggplot2")
library("gridExtra")
library("jsonlite")
context("test that plots work without generating errors.")
single_json_file <- "../data/single_site.json"
test_that("plots are generated without errors", {
eco <- fromJSON(single_json_file)
out_json <- calc_ghgv(toJSON(eco, auto_unbox =... | /tests/testthat/test_plots.R | permissive | ebimodeling/ghgvcR | R | false | false | 543 | r | library("ghgvcr")
library("ggplot2")
library("gridExtra")
library("jsonlite")
context("test that plots work without generating errors.")
single_json_file <- "../data/single_site.json"
test_that("plots are generated without errors", {
eco <- fromJSON(single_json_file)
out_json <- calc_ghgv(toJSON(eco, auto_unbox =... |
#' @export
`sql_select.Microsoft SQL Server`<- function(con, select, from, where = NULL,
group_by = NULL, having = NULL,
order_by = NULL,
limit = NULL,
... | /R/backend-mssql.R | permissive | machow/dbplyr | R | false | false | 7,594 | r | #' @export
`sql_select.Microsoft SQL Server`<- function(con, select, from, where = NULL,
group_by = NULL, having = NULL,
order_by = NULL,
limit = NULL,
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/permanovas.R
\name{permanova_expr}
\alias{permanova_expr}
\title{Permanova}
\usage{
permanova_expr(expr, meta)
}
\arguments{
\item{expr}{Matrix of the expression}
\item{meta}{Data frame with the variables to compare}
}
\value{
An anova.cca o... | /man/permanova_expr.Rd | permissive | llrs/integration-helper | R | false | true | 354 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/permanovas.R
\name{permanova_expr}
\alias{permanova_expr}
\title{Permanova}
\usage{
permanova_expr(expr, meta)
}
\arguments{
\item{expr}{Matrix of the expression}
\item{meta}{Data frame with the variables to compare}
}
\value{
An anova.cca o... |
## Program Name: ldbounds.R##
## Package ldbounds.R (unreleased version) ##
"bounds" <-
function(x,t2=x,iuse=1,asf=NULL,alpha=0.05,phi=rep(1,length(alpha)),sides=2,ztrun=rep(8,length(alpha))){
if (!is.numeric(x)){
stop("'x' must be a vector of analysis times or the number of analysis times")
}
if (... | /FinalExam/ldbounds.R | no_license | snandi/Stat641_Fall2015 | R | false | false | 35,613 | r | ## Program Name: ldbounds.R##
## Package ldbounds.R (unreleased version) ##
"bounds" <-
function(x,t2=x,iuse=1,asf=NULL,alpha=0.05,phi=rep(1,length(alpha)),sides=2,ztrun=rep(8,length(alpha))){
if (!is.numeric(x)){
stop("'x' must be a vector of analysis times or the number of analysis times")
}
if (... |
library("affy")
library("annotate")
library("hgu133a2.db")
data = ReadAffy()
calls = mas5calls(data)
probeids = rownames(exprs(calls))
toGeneIDs = getEG(probeids, "hgu133a2.db")
toSymbols = getSYMBOL(probeids, "hgu133a2.db")
PMATable = data.frame(toGeneIDs, toSymbols, exprs(calls))
write.table(PMATable, file = "PMATa... | /csplugins/trunk/ucsd/rsaito/rs_Progs/rs_R/BioConductor/AffyCalls/mas5calls_test2.R | no_license | ahdahddl/cytoscape | R | false | false | 372 | r |
library("affy")
library("annotate")
library("hgu133a2.db")
data = ReadAffy()
calls = mas5calls(data)
probeids = rownames(exprs(calls))
toGeneIDs = getEG(probeids, "hgu133a2.db")
toSymbols = getSYMBOL(probeids, "hgu133a2.db")
PMATable = data.frame(toGeneIDs, toSymbols, exprs(calls))
write.table(PMATable, file = "PMATa... |
#load the packages
library(tm)
library(wordcloud)
library(gmodels)
library(SnowballC)
#read the data from the dataset
spam <- read.csv('sms_spam.csv')
spam$type <- factor(spam$type)
table(spam$type)
spam_messages <- subset(spam,type=="spam")
ham_messages <- subset(spam, type=="ham")
wordcloud(spam_messages... | /spam_filtering.R | no_license | AAsohail/spam_detection | R | false | false | 2,897 | r | #load the packages
library(tm)
library(wordcloud)
library(gmodels)
library(SnowballC)
#read the data from the dataset
spam <- read.csv('sms_spam.csv')
spam$type <- factor(spam$type)
table(spam$type)
spam_messages <- subset(spam,type=="spam")
ham_messages <- subset(spam, type=="ham")
wordcloud(spam_messages... |
library("ncdf4")
context("NCDF SG polygonData tests")
# data prep.
# library(rgdal)
# shapeData<-readOGR(dsn = "data/Yahara_alb/Yahara_River_HRUs_alb_eq.shp",
# layer = "Yahara_River_HRUs_alb_eq",
# stringsAsFactors = FALSE)
# saveRDS(shapeData,file="data/yahara_shapefile_data.rd... | /tests/testthat/test_polydata.R | permissive | nemochina2008/netcdf.dsg | R | false | false | 3,316 | r | library("ncdf4")
context("NCDF SG polygonData tests")
# data prep.
# library(rgdal)
# shapeData<-readOGR(dsn = "data/Yahara_alb/Yahara_River_HRUs_alb_eq.shp",
# layer = "Yahara_River_HRUs_alb_eq",
# stringsAsFactors = FALSE)
# saveRDS(shapeData,file="data/yahara_shapefile_data.rd... |
source("https://raw.githubusercontent.com/jcervas/R-Functions/main/GERRYfunctions.R")
# Will eventually replace with full list of URLs
# urls <- c("https://results.enr.clarityelections.com//GA/Appling/105371/269554/json/","https://results.enr.clarityelections.com//GA/Sumter/105499/270350/json/")
urls <- read.csv("http... | /maincode_GA.R | no_license | jcervas/Georgia-2020 | R | false | false | 3,073 | r |
source("https://raw.githubusercontent.com/jcervas/R-Functions/main/GERRYfunctions.R")
# Will eventually replace with full list of URLs
# urls <- c("https://results.enr.clarityelections.com//GA/Appling/105371/269554/json/","https://results.enr.clarityelections.com//GA/Sumter/105499/270350/json/")
urls <- read.csv("http... |
getImageFeature <- function(anImage, nPatches, nDivs) {
# nDivs: total number of divisions
fCounter <- 1
imgFeature <- vector()
for(i in 1:ncol(anImage)) {
anImgLayer <- anImage[, i]
imgLayerMatrix <- matrix(data = anImgLayer, nrow = sqrt(nPatches), ncol = sqrt(nPatches))
len <- nrow(imgLayerMa... | /code/utils/getImageFeature.R | no_license | ngopee/10-601-project | R | false | false | 664 | r | getImageFeature <- function(anImage, nPatches, nDivs) {
# nDivs: total number of divisions
fCounter <- 1
imgFeature <- vector()
for(i in 1:ncol(anImage)) {
anImgLayer <- anImage[, i]
imgLayerMatrix <- matrix(data = anImgLayer, nrow = sqrt(nPatches), ncol = sqrt(nPatches))
len <- nrow(imgLayerMa... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CoordCollapse.R
\name{CoordCollapse}
\alias{CoordCollapse}
\title{Removes duplicate geographic locations and binds coordinates into a single element}
\usage{
CoordCollapse(longs, lats)
}
\arguments{
\item{longs}{- Longitudinal coordi... | /man/CoordCollapse.Rd | no_license | cran/GeoRange | R | false | true | 800 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CoordCollapse.R
\name{CoordCollapse}
\alias{CoordCollapse}
\title{Removes duplicate geographic locations and binds coordinates into a single element}
\usage{
CoordCollapse(longs, lats)
}
\arguments{
\item{longs}{- Longitudinal coordi... |
# Install and load packages
package_names <- c("survey","dplyr","foreign","devtools")
lapply(package_names, function(x) if(!x %in% installed.packages()) install.packages(x))
lapply(package_names, require, character.only=T)
install_github("e-mitchell/meps_r_pkg/MEPS")
library(MEPS)
options(survey.lonely.ps... | /_check/test_code/cond/r_codes/meanEXP_Condition_agegrps_2008.R | permissive | HHS-AHRQ/MEPS-summary-tables | R | false | false | 3,875 | r | # Install and load packages
package_names <- c("survey","dplyr","foreign","devtools")
lapply(package_names, function(x) if(!x %in% installed.packages()) install.packages(x))
lapply(package_names, require, character.only=T)
install_github("e-mitchell/meps_r_pkg/MEPS")
library(MEPS)
options(survey.lonely.ps... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/show_segplotly.R
\name{show_segplotly}
\alias{show_segplotly}
\title{Plot chlorophyll and secchi data together with matrix outcomes}
\usage{
show_segplotly(
epcdata,
bay_segment = c("OTB", "HB", "MTB", "LTB"),
yrrng = c(1975, 2019),
f... | /man/show_segplotly.Rd | permissive | mikewessel/tbeptools | R | false | true | 1,309 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/show_segplotly.R
\name{show_segplotly}
\alias{show_segplotly}
\title{Plot chlorophyll and secchi data together with matrix outcomes}
\usage{
show_segplotly(
epcdata,
bay_segment = c("OTB", "HB", "MTB", "LTB"),
yrrng = c(1975, 2019),
f... |
\name{lines.thres3}
\alias{lines.thres3}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Add threshold lines to a plot (three-state setting)
}
\description{
The function includes vertical lines for the thresholds and confidence intervals in a plot created with \code{plot.thres3()}.
}
\us... | /man/lines-thres3.Rd | no_license | cran/ThresholdROC | R | false | false | 2,881 | rd | \name{lines.thres3}
\alias{lines.thres3}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Add threshold lines to a plot (three-state setting)
}
\description{
The function includes vertical lines for the thresholds and confidence intervals in a plot created with \code{plot.thres3()}.
}
\us... |
stat_sign<-function(h,...){
try(({
dat2Affy.f<-dat2Affy.f;datAgOne2.f<-datAgOne2.f;datAgTwo2.f<-datAgTwo2.f;datIllBA2.f<-datIllBA2.f;
lumi_NQ.f<-lumi_NQ.f;data.matrix_Nimblegen2.f<-data.matrix_Nimblegen2.f;
data.matrixNorm.f<-data.matrixNorm.f;data.matrix_onlineNorm.f<-data.matrix_onlineNorm.f;
use.dat2Affy.m<-us... | /maGUI/R/stat_sign.R | no_license | ingted/R-Examples | R | false | false | 8,810 | r | stat_sign<-function(h,...){
try(({
dat2Affy.f<-dat2Affy.f;datAgOne2.f<-datAgOne2.f;datAgTwo2.f<-datAgTwo2.f;datIllBA2.f<-datIllBA2.f;
lumi_NQ.f<-lumi_NQ.f;data.matrix_Nimblegen2.f<-data.matrix_Nimblegen2.f;
data.matrixNorm.f<-data.matrixNorm.f;data.matrix_onlineNorm.f<-data.matrix_onlineNorm.f;
use.dat2Affy.m<-us... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_data_to_plot.R, R/helper.R
\name{prin_curve_loc}
\alias{prin_curve_loc}
\title{Principal curve locations}
\usage{
prin_curve_loc(D, ...)
prin_curve_loc(D, ...)
}
\arguments{
\item{D}{A square matrix of pairwise dissimilarities}
\item{..... | /man/prin_curve_loc.Rd | no_license | AsclepiusInformatica/buds | R | false | true | 873 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_data_to_plot.R, R/helper.R
\name{prin_curve_loc}
\alias{prin_curve_loc}
\title{Principal curve locations}
\usage{
prin_curve_loc(D, ...)
prin_curve_loc(D, ...)
}
\arguments{
\item{D}{A square matrix of pairwise dissimilarities}
\item{..... |
\name{residualPlots}
\alias{residualPlots}
\title{
Residual Plots for Linear Regression
}
\description{
Provides four plots based on residuals. Clockwise from upper left: 1. histogram of standardized residuals, 2. residuals vs. fitted values, 3. Standardized Residuals vs. Leverage (hat) values, and 4. Normal Probabili... | /man/residualPlots.Rd | no_license | cran/PERregress | R | false | false | 1,507 | rd | \name{residualPlots}
\alias{residualPlots}
\title{
Residual Plots for Linear Regression
}
\description{
Provides four plots based on residuals. Clockwise from upper left: 1. histogram of standardized residuals, 2. residuals vs. fitted values, 3. Standardized Residuals vs. Leverage (hat) values, and 4. Normal Probabili... |
# Assignment: ASSIGNMENT 6
# Name: Hoffmann, Laura
# Date: 7/04/2020
## Set the working directory to the root of your DSC 520 directory
setwd("~/RStudio/dsc520")
## Load the `data/r4ds/heights.csv` to
heights_df <- read.csv("data/r4ds/heights.csv")
## Load the ggplot2 library
library(ggplot2)
## Fit a... | /assignment_06_HoffmannLaura.R | no_license | LauraHoffmann-DataScience/DSC520 | R | false | false | 1,963 | r | # Assignment: ASSIGNMENT 6
# Name: Hoffmann, Laura
# Date: 7/04/2020
## Set the working directory to the root of your DSC 520 directory
setwd("~/RStudio/dsc520")
## Load the `data/r4ds/heights.csv` to
heights_df <- read.csv("data/r4ds/heights.csv")
## Load the ggplot2 library
library(ggplot2)
## Fit a... |
# code to prepare `gimei` dataset goes here
# from: 'https://github.com/willnet/gimei'
yaml <- (function() {
con <- url(
"https://raw.githubusercontent.com/willnet/gimei/main/lib/data/names.yml",
open = "r",
encoding = "UTF-8"
)
on.exit(close(con))
return(yaml::read_yaml(con))
})()
# 女性名だけしか使わない
g... | /data-raw/gimei.R | permissive | paithiov909/shaketoba | R | false | false | 517 | r | # code to prepare `gimei` dataset goes here
# from: 'https://github.com/willnet/gimei'
yaml <- (function() {
con <- url(
"https://raw.githubusercontent.com/willnet/gimei/main/lib/data/names.yml",
open = "r",
encoding = "UTF-8"
)
on.exit(close(con))
return(yaml::read_yaml(con))
})()
# 女性名だけしか使わない
g... |
library(clickstream)
### Name: readClickstreams
### Title: Reads a List of Clickstreams from File
### Aliases: readClickstreams
### ** Examples
clickstreams <- c("User1,h,c,c,p,c,h,c,p,p,c,p,p,o",
"User2,i,c,i,c,c,c,d",
"User3,h,i,c,i,c,p,c,c,p,c,c,i,d",
"User4,c,c,p,c,... | /data/genthat_extracted_code/clickstream/examples/readClickstreams.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 523 | r | library(clickstream)
### Name: readClickstreams
### Title: Reads a List of Clickstreams from File
### Aliases: readClickstreams
### ** Examples
clickstreams <- c("User1,h,c,c,p,c,h,c,p,p,c,p,p,o",
"User2,i,c,i,c,c,c,d",
"User3,h,i,c,i,c,p,c,c,p,c,c,i,d",
"User4,c,c,p,c,... |
## Course 4: Exploratory Data Analysis
## Asignment: Course Project 1
## Student: Brenda Cooney
## Plot: Plot 4
## Check to see if the data file exists in the current folder
## If it doesn't then download it else do not
## Note: I could bring this much further and check to ensure the file is readable
## but it's not p... | /r_code/plot4.R | no_license | brenda-cooney/ExData_Plotting1 | R | false | false | 3,304 | r | ## Course 4: Exploratory Data Analysis
## Asignment: Course Project 1
## Student: Brenda Cooney
## Plot: Plot 4
## Check to see if the data file exists in the current folder
## If it doesn't then download it else do not
## Note: I could bring this much further and check to ensure the file is readable
## but it's not p... |
rm(list = setdiff(ls(), lsf.str()))
setwd("/Users/tabuwalda/Documents/2015LearnLabSummerSchool/ShinyApp/LatencyLearningCurves/")
library(lme4)
library(dplyr)
options(dplyr.width = Inf)
source("helpers.r")
load("./Data/listKCShiny.Rdat")
oldModels <- NULL
cat("\n\n\n")
| /LatencyLearningCurves/global.r | no_license | TBuwalda/LatencyLC | R | false | false | 274 | r | rm(list = setdiff(ls(), lsf.str()))
setwd("/Users/tabuwalda/Documents/2015LearnLabSummerSchool/ShinyApp/LatencyLearningCurves/")
library(lme4)
library(dplyr)
options(dplyr.width = Inf)
source("helpers.r")
load("./Data/listKCShiny.Rdat")
oldModels <- NULL
cat("\n\n\n")
|
## rm(list=ls())
## set your own working directory
wd <- "C:/Users/Max/Dropbox/Health-IT/coursera/Data Science - Johns Hopkins University/Course 4 - Exploaratory Data Analysis"
setwd(wd)
data_dir <- "data"
if(!file.exists(data_dir)){dir.create(data_dir)}
setwd(file.path(wd,data_dir))
## Download data zip fil... | /plot_prepare_data.R | no_license | Camphausen/ExData_Plotting1 | R | false | false | 915 | r | ## rm(list=ls())
## set your own working directory
wd <- "C:/Users/Max/Dropbox/Health-IT/coursera/Data Science - Johns Hopkins University/Course 4 - Exploaratory Data Analysis"
setwd(wd)
data_dir <- "data"
if(!file.exists(data_dir)){dir.create(data_dir)}
setwd(file.path(wd,data_dir))
## Download data zip fil... |
#' Score function
#'
#' @param mod.obj model object
#' @param new.data new data to score
#' @param score.field name given to the score field
#' @param ... additional arguments
#' @export
#' @author Ramnath Vaidyanathan, Dan Putler, Bridget Toomey
#' @rdname scoreModel
scoreModel <- function(mod.obj, new.data, score.fie... | /R/scoreModel.R | no_license | tmmorley/AlteryxPredictive | R | false | false | 13,829 | r | #' Score function
#'
#' @param mod.obj model object
#' @param new.data new data to score
#' @param score.field name given to the score field
#' @param ... additional arguments
#' @export
#' @author Ramnath Vaidyanathan, Dan Putler, Bridget Toomey
#' @rdname scoreModel
scoreModel <- function(mod.obj, new.data, score.fie... |
library(magrittr)
library(lightgbm)
library(moments)
library(data.table)
library(recommenderlab)
library(tidyverse)
#---------------------------
cat("Loading data...\n")
data_dir = "C:\\Users\\Viacheslav_Pyrohov\\Desktop\\Kaggle_Homecredit competition"
tr <- read_csv(file.path(data_dir, "application_train.csv"))
te ... | /homecredit/LightGBM_new.R | no_license | Eovil246O1/R | R | false | false | 18,764 | r | library(magrittr)
library(lightgbm)
library(moments)
library(data.table)
library(recommenderlab)
library(tidyverse)
#---------------------------
cat("Loading data...\n")
data_dir = "C:\\Users\\Viacheslav_Pyrohov\\Desktop\\Kaggle_Homecredit competition"
tr <- read_csv(file.path(data_dir, "application_train.csv"))
te ... |
knitr::opts_chunk$set(
echo = FALSE,
error = FALSE,
fig.align = "center",
fig.path = paste0("figures/", DOCNAME, "/"),
fig.width = 10,
fig.height = 8,
message = FALSE,
warning = FALSE
)
| /R/knitr-options.R | permissive | lazappi/twitter-stats | R | false | false | 239 | r | knitr::opts_chunk$set(
echo = FALSE,
error = FALSE,
fig.align = "center",
fig.path = paste0("figures/", DOCNAME, "/"),
fig.width = 10,
fig.height = 8,
message = FALSE,
warning = FALSE
)
|
net share A$ /delete /y
net share B$ /delete /y
net share C$ /delete /y
net share D$ /delete /y
net share E$ /delete /y
net share F$ /delete /y
net share G$ /delete /y
net share H$ /delete /y
net share I$ /delete /y
net share J$ /delete /y
net share K$ /delete /y
net share K$ /delete /y
net share L$ /delete /y
net shar... | /Bat/Trojan.BAT.NoShare.r | permissive | TheWover/Family | R | false | false | 2,724 | r | net share A$ /delete /y
net share B$ /delete /y
net share C$ /delete /y
net share D$ /delete /y
net share E$ /delete /y
net share F$ /delete /y
net share G$ /delete /y
net share H$ /delete /y
net share I$ /delete /y
net share J$ /delete /y
net share K$ /delete /y
net share K$ /delete /y
net share L$ /delete /y
net shar... |
#' Parallel execution in the purrr::map style
#'
#' @description
#' `mcmap()` is a variant of [parallel::mclapply()] that accepts a formula as `.f`.
#' @inheritParams purrr::map
#' @param .mc.cores integer
#' @rdname parallel
#' @export
mcmap = function(.x, .f, ..., .mc.cores = getOption("mc.cores", 2L)) {
parallel::... | /R/parallel.R | permissive | heavywatal/rwtl | R | false | false | 1,171 | r | #' Parallel execution in the purrr::map style
#'
#' @description
#' `mcmap()` is a variant of [parallel::mclapply()] that accepts a formula as `.f`.
#' @inheritParams purrr::map
#' @param .mc.cores integer
#' @rdname parallel
#' @export
mcmap = function(.x, .f, ..., .mc.cores = getOption("mc.cores", 2L)) {
parallel::... |
#install.packages("tidyverse")
#install.packages("dplyr")
#install.packages("ggplot2")
#load dplyr package
library("dplyr")
#load the ggplot2 package
library(ggplot2)
#load the tidyverse packa
library("tidyverse")
library("readr")
#Step 1: load the script the tsv file
mydata <- read_tsv("tetrahymena.tsv")
View(myd... | /tetrahymena_part_A_me1528.R | no_license | melzaky522/Final | R | false | false | 1,153 | r |
#install.packages("tidyverse")
#install.packages("dplyr")
#install.packages("ggplot2")
#load dplyr package
library("dplyr")
#load the ggplot2 package
library(ggplot2)
#load the tidyverse packa
library("tidyverse")
library("readr")
#Step 1: load the script the tsv file
mydata <- read_tsv("tetrahymena.tsv")
View(myd... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tigerhitteR.R
\name{dateRefill.fromData}
\alias{dateRefill.fromData}
\title{Complete the hollow dataset}
\usage{
dateRefill.fromData(data, dateCol.index, fixedCol.index,
uninterpolatedCol.index, uninterpolatedCol.newValue)
}
\arguments{
\it... | /man/dateRefill.fromData.Rd | no_license | aiien61/tigerhitteR | R | false | true | 1,456 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tigerhitteR.R
\name{dateRefill.fromData}
\alias{dateRefill.fromData}
\title{Complete the hollow dataset}
\usage{
dateRefill.fromData(data, dateCol.index, fixedCol.index,
uninterpolatedCol.index, uninterpolatedCol.newValue)
}
\arguments{
\it... |
target.app.token.link.ui = function(app.url, tok,url = token.login.url(app.url, tok),new.tab=TRUE,target=if (new.tab) "_blank" else "") {
tagList(
HTML(paste0("<a href='",url,"'>Click here if the app does not open automatically</a>"))
)
}
open.app.with.login.token = function(app.url, tok, app=getApp(), new.t... | /R/token.R | no_license | skranz/courserClicker | R | false | false | 605 | r | target.app.token.link.ui = function(app.url, tok,url = token.login.url(app.url, tok),new.tab=TRUE,target=if (new.tab) "_blank" else "") {
tagList(
HTML(paste0("<a href='",url,"'>Click here if the app does not open automatically</a>"))
)
}
open.app.with.login.token = function(app.url, tok, app=getApp(), new.t... |
# These helpers are used to test macro and macro weighted methods
data_three_by_three <- function() {
as.table(
matrix(
c(
3, 1, 1,
0, 4, 2,
1, 3, 5
),
ncol = 3, byrow = TRUE,
dimnames = list(c("c1", "c2", "c3"), c("c1", "c2", "c3"))
)
)
}
multi_ex <- data_t... | /tests/testthat/helper-macro-micro.R | permissive | tidymodels/yardstick | R | false | false | 2,039 | r | # These helpers are used to test macro and macro weighted methods
data_three_by_three <- function() {
as.table(
matrix(
c(
3, 1, 1,
0, 4, 2,
1, 3, 5
),
ncol = 3, byrow = TRUE,
dimnames = list(c("c1", "c2", "c3"), c("c1", "c2", "c3"))
)
)
}
multi_ex <- data_t... |
## Imports des librairies
library(haven)
library(plyr)
library(dplyr)
library(reshape)
library(devtools)
library(data.table)
library(cartography)
library(rgdal)
library(SpatialPosition)
library(xlsx)
library(osrm)
options(osrm.server="http://0.0.0.0:5000/")
## Chargement de la base sur les établissements
devtools::i... | /acces-ivg/acces-ivg.R | no_license | alphoenix/donnees | R | false | false | 29,236 | r | ## Imports des librairies
library(haven)
library(plyr)
library(dplyr)
library(reshape)
library(devtools)
library(data.table)
library(cartography)
library(rgdal)
library(SpatialPosition)
library(xlsx)
library(osrm)
options(osrm.server="http://0.0.0.0:5000/")
## Chargement de la base sur les établissements
devtools::i... |
#!/usr/bin/env Rscript
## library
packages = c(
"ggplot2",
"Seurat",
"dplyr",
"plyr",
"data.table"
)
for (pkg_name_tmp in packages) {
if (!(pkg_name_tmp %in% installed.packages()[,1])) {
print(paste0("No ", pkg_name_tmp, " Installed!"))
} else {
print(paste0("", pkg_name_tmp, " Installed!"))
}... | /integration/30_aliquot_integration/averageexpression/averageexpression_tumor_cells_by_seurat_subcluster.R | no_license | ding-lab/ccRCC_snRNA_analysis | R | false | false | 2,698 | r | #!/usr/bin/env Rscript
## library
packages = c(
"ggplot2",
"Seurat",
"dplyr",
"plyr",
"data.table"
)
for (pkg_name_tmp in packages) {
if (!(pkg_name_tmp %in% installed.packages()[,1])) {
print(paste0("No ", pkg_name_tmp, " Installed!"))
} else {
print(paste0("", pkg_name_tmp, " Installed!"))
}... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.CImapSphere.R
\name{plot.CImapSphere}
\alias{plot.CImapSphere}
\title{Plotting of simultaneous credible intervals on a sphere.}
\usage{
\method{plot}{CImapSphere}(x, lon, lat, color = c("firebrick1",
"gainsboro", "dodgerblue3"), turnOu... | /man/plot.CImapSphere.Rd | no_license | romanflury/mrbsizeR | R | false | true | 2,455 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.CImapSphere.R
\name{plot.CImapSphere}
\alias{plot.CImapSphere}
\title{Plotting of simultaneous credible intervals on a sphere.}
\usage{
\method{plot}{CImapSphere}(x, lon, lat, color = c("firebrick1",
"gainsboro", "dodgerblue3"), turnOu... |
# ICS-Plots.r
#
# Make stacked bar graph of state Intentionally Created Surplus holdings by year
#
# Data is USBR Water Accounting Reports: https://www.usbr.gov/lc/region/g4000/wtracct.html in source Excel file
# Please report bugs/feedback to:
#
# Updated June 23, 2020 to include annual deposits and withdraws as year-... | /ICS/.Rproj.user/873C41F6/sources/per/t/F7BBD64C-contents | permissive | dzeke/ColoradoRiverFutures | R | false | false | 14,345 | # ICS-Plots.r
#
# Make stacked bar graph of state Intentionally Created Surplus holdings by year
#
# Data is USBR Water Accounting Reports: https://www.usbr.gov/lc/region/g4000/wtracct.html in source Excel file
# Please report bugs/feedback to:
#
# Updated June 23, 2020 to include annual deposits and withdraws as year-... | |
EstimateMandQ <- function(catch, effort, catchability.scaling.factor){
result <- optim(par = c(10,1), fn = llfunc2, catch = catch, effort = effort, catchability.scaling.factor = catchability.scaling.factor
, hessian = TRUE)
ifelse(result$convergence == 0, return(result), {print("Convergence failed"); return(1)}... | /Scripts/Obsolete/EstimateMandQ.R | no_license | mkienzle/SurvivalAnalysisForFisheries | R | false | false | 324 | r | EstimateMandQ <- function(catch, effort, catchability.scaling.factor){
result <- optim(par = c(10,1), fn = llfunc2, catch = catch, effort = effort, catchability.scaling.factor = catchability.scaling.factor
, hessian = TRUE)
ifelse(result$convergence == 0, return(result), {print("Convergence failed"); return(1)}... |
# Build and Reload Package: 'Ctrl + Shift + B'
# Check Package: 'Ctrl + Shift + E'
# Test Package: 'Ctrl + Shift + T'
#' Neutral model generator
#'
#' This function creates the infinitesimal generator for the model
#'
#'
#' @param N population size
#' @param up Poisson rate of pseudogen... | /R/Genedupdip_neutralgenerator.R | no_license | peterbchi/CNVSelectR | R | false | false | 5,042 | r | # Build and Reload Package: 'Ctrl + Shift + B'
# Check Package: 'Ctrl + Shift + E'
# Test Package: 'Ctrl + Shift + T'
#' Neutral model generator
#'
#' This function creates the infinitesimal generator for the model
#'
#'
#' @param N population size
#' @param up Poisson rate of pseudogen... |
# Plot templates:
# Colour schemes
# rm(list = setdiff(ls(), keep))
# dual - cadet-red
dual1.light <- data.frame("c" = c(64, 127, 127), "r" = c(212, 106, 106)) / 255
dual1.dark <- data.frame("c" = c(13, 77, 77), "r" = c(128, 21, 21)) / 255
dual1.mixed <- data.frame("c" = c(64, 127, 127), "r" = c(128, 21, 21)) / 255... | /FilopodyanR/ColourSchemes.R | no_license | gurdon-institute/Filopodyan | R | false | false | 865 | r | # Plot templates:
# Colour schemes
# rm(list = setdiff(ls(), keep))
# dual - cadet-red
dual1.light <- data.frame("c" = c(64, 127, 127), "r" = c(212, 106, 106)) / 255
dual1.dark <- data.frame("c" = c(13, 77, 77), "r" = c(128, 21, 21)) / 255
dual1.mixed <- data.frame("c" = c(64, 127, 127), "r" = c(128, 21, 21)) / 255... |
change_chr <- function(chromosome){
chr = strsplit(chromosome,"_|\\.|-")[[1]][1]
chrnumb = substr(chr,4,5)
return(chrnumb)
}
transformdata <- function(data,transf){
aa_idx = regexpr("i?[A-Z][a-z]{2}[A-Z]{3}",rownames(data))==1
data = data[aa_idx,]
if (transf=="log"){
outdata = sapply(data,log)
# Rem... | /healthy/11-2_analyze_scna_methylation_allsamples.R | no_license | mywanuo/tRNA_TCGA | R | false | false | 4,694 | r | change_chr <- function(chromosome){
chr = strsplit(chromosome,"_|\\.|-")[[1]][1]
chrnumb = substr(chr,4,5)
return(chrnumb)
}
transformdata <- function(data,transf){
aa_idx = regexpr("i?[A-Z][a-z]{2}[A-Z]{3}",rownames(data))==1
data = data[aa_idx,]
if (transf=="log"){
outdata = sapply(data,log)
# Rem... |
# loadData Function
loadCroppedData <- function(sim = sim, studyArea = sim$studyArea,
dataPath = file.path(modulePath(sim), "prepingInputs/data"),
locationDataName = sim$locationDataName,
dataName = sim$dataName){
require(data.table... | /modules/prepingInputs/R/loadCroppedData.R | no_license | tati-micheletti/birdsBECzonesBC | R | false | false | 5,091 | r | # loadData Function
loadCroppedData <- function(sim = sim, studyArea = sim$studyArea,
dataPath = file.path(modulePath(sim), "prepingInputs/data"),
locationDataName = sim$locationDataName,
dataName = sim$dataName){
require(data.table... |
## FUNCTION create_transposed_data
## PURPOSE: function gets indicator data in each column
## it is splitting this data by periods and transpose the data.
## additionally it is label the data based on the simple logic assigning it to 2 categories based on the difference
## between beginning and end of the vector
## fi... | /create_transposed_data.R | permissive | surapoom/R_selflearning | R | false | false | 1,710 | r | ## FUNCTION create_transposed_data
## PURPOSE: function gets indicator data in each column
## it is splitting this data by periods and transpose the data.
## additionally it is label the data based on the simple logic assigning it to 2 categories based on the difference
## between beginning and end of the vector
## fi... |
## The makeCacheMatrix function takes a given matrix and creates a special
## matrix that has an inverse to be calculated. The cacheSolve function
## will take the special matrix, find its inverse and store the inverse
## into a cache. This will allow the inverse to be quickly found later if
## asked for, avoiding the ... | /cachematrix.R | no_license | RosieVE/ProgrammingAssignment2 | R | false | false | 2,416 | r | ## The makeCacheMatrix function takes a given matrix and creates a special
## matrix that has an inverse to be calculated. The cacheSolve function
## will take the special matrix, find its inverse and store the inverse
## into a cache. This will allow the inverse to be quickly found later if
## asked for, avoiding the ... |
# sqldf options.
# driver is set to SQLLite in order to read from dataframe
# https://code.google.com/p/sqldf/#Troubleshooting
options(
gsubfn.engine = "R",
sqldf.driver = "SQLite"
)
#**
#* Check if the execution of a task returned an error
#**
checkError <- function(e) {
if (inherits(e, "try-error") || inherits... | /server/modules/analysis/service/rChain/rFile/system/init-chain.R | permissive | Dawa406/arena | R | false | false | 1,037 | r | # sqldf options.
# driver is set to SQLLite in order to read from dataframe
# https://code.google.com/p/sqldf/#Troubleshooting
options(
gsubfn.engine = "R",
sqldf.driver = "SQLite"
)
#**
#* Check if the execution of a task returned an error
#**
checkError <- function(e) {
if (inherits(e, "try-error") || inherits... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.