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 |
|---|---|---|---|---|---|---|---|---|---|
# Function transparent_col
# Built upon https://www.dataanalytics.org.uk/make-transparent-colors-in-r/
transparent_col <- function(color, percent = 50, name = NULL) {
# color = color name
# percent = % transparency
# name = an optional name for the color
## Get RGB values for named color
rgb.va... | /code/R-functions/color_tools.r | no_license | TheAcetoLab/diamantopoulou-ctc-dynamics | R | false | false | 617 | r | # Function transparent_col
# Built upon https://www.dataanalytics.org.uk/make-transparent-colors-in-r/
transparent_col <- function(color, percent = 50, name = NULL) {
# color = color name
# percent = % transparency
# name = an optional name for the color
## Get RGB values for named color
rgb.va... |
#' Generic Proportions Method
#'
#' Access the proportions dataframes from select qdap outputs.
#'
#' @param x A qdap object (list) with a proportions dataframe (e.g.,
#' \code{\link[qdap]{termco}}).
#' @param \ldots Arguments passed to proportions method of other classes.
#' @export
#' @seealso \code{\link[qdap]{sc... | /R/proportions.R | no_license | craigcitro/qdap | R | false | false | 537 | r | #' Generic Proportions Method
#'
#' Access the proportions dataframes from select qdap outputs.
#'
#' @param x A qdap object (list) with a proportions dataframe (e.g.,
#' \code{\link[qdap]{termco}}).
#' @param \ldots Arguments passed to proportions method of other classes.
#' @export
#' @seealso \code{\link[qdap]{sc... |
# 1. build book normally to have images and proper tex file
# unlink("./_book_post/", recursive = TRUE)
# file.remove("./_book_post/")
# 2. generate *md file
bookdown::render_book('index.Rmd', output_format = "all", clean = FALSE, output_dir = "./_book_post/")
file.copy(from = "./liedboek.utf8.md", to = "./_book_post/l... | /_script.R | permissive | JacekPardyak/Liedboek | R | false | false | 2,681 | r | # 1. build book normally to have images and proper tex file
# unlink("./_book_post/", recursive = TRUE)
# file.remove("./_book_post/")
# 2. generate *md file
bookdown::render_book('index.Rmd', output_format = "all", clean = FALSE, output_dir = "./_book_post/")
file.copy(from = "./liedboek.utf8.md", to = "./_book_post/l... |
context("curatedMetagenomicData")
test_that("curatedMetagenomicData works", {
allds <- curatedMetagenomicData("*", dryrun = TRUE)
allstudies1 <- sub("\\..+", "", allds) %>%
gsub("-", "_", x = .) %>%
unique %>%
sort
data("combined_metadata")
allstudies2 <- unique(combined_metadat... | /tests/testthat/test-curatedMetagenomicData.R | permissive | jis958/curatedMetagenomicData | R | false | false | 1,535 | r | context("curatedMetagenomicData")
test_that("curatedMetagenomicData works", {
allds <- curatedMetagenomicData("*", dryrun = TRUE)
allstudies1 <- sub("\\..+", "", allds) %>%
gsub("-", "_", x = .) %>%
unique %>%
sort
data("combined_metadata")
allstudies2 <- unique(combined_metadat... |
"SimpsonInt"<- function(xin, h)
{
n<-length(xin)
nn<-1:n
int0<-xin[1]
int2n<-xin[n]
inteven<-xin[seq(3,n-1,by=2)]
intodd<-xin[seq(2,n-2,by=2)]
sumodd<-sum(intodd)
sumeven<-sum(inteven)
res<-(h/3)*(int0+4*sumodd+2*sumeven+int2n)
res
} | /R/SimpsonInt.R | no_license | cran/asymmetry.measures | R | false | false | 268 | r | "SimpsonInt"<- function(xin, h)
{
n<-length(xin)
nn<-1:n
int0<-xin[1]
int2n<-xin[n]
inteven<-xin[seq(3,n-1,by=2)]
intodd<-xin[seq(2,n-2,by=2)]
sumodd<-sum(intodd)
sumeven<-sum(inteven)
res<-(h/3)*(int0+4*sumodd+2*sumeven+int2n)
res
} |
fluidPage(
titlePanel("More Widgets"),
sidebarLayout(
sidebarPanel(
selectInput("dataset",
label="Choose a dataset:",
choices=c("rock","cars","pressure"),
selected="rock"),
br(),
numericInput("num",
label="Number of obser... | /ui.R | no_license | zhengpengzhang/hello_shiny | R | false | false | 790 | r | fluidPage(
titlePanel("More Widgets"),
sidebarLayout(
sidebarPanel(
selectInput("dataset",
label="Choose a dataset:",
choices=c("rock","cars","pressure"),
selected="rock"),
br(),
numericInput("num",
label="Number of obser... |
##' textSummary function
##'
##' A function to print a text description of the inferred paramerers beta and eta from a call to the function lgcpPredictSpatialPlusPars, lgcpPredictAggregateSpatialPlusPars, lgcpPredictSpatioTemporalPlusPars or lgcpPredictMultitypeSpatialPlusPars
##'
##' @param obj an object produced by a... | /R/outputSummary.R | no_license | cran/spatsurv | R | false | false | 12,039 | r | ##' textSummary function
##'
##' A function to print a text description of the inferred paramerers beta and eta from a call to the function lgcpPredictSpatialPlusPars, lgcpPredictAggregateSpatialPlusPars, lgcpPredictSpatioTemporalPlusPars or lgcpPredictMultitypeSpatialPlusPars
##'
##' @param obj an object produced by a... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/drop_get_metadata.R
\name{drop_get_metadata}
\alias{drop_get_metadata}
\title{Retrieve metadata for a file or folder.}
\usage{
drop_get_metadata(path, include_media_info = FALSE, include_deleted = FALSE,
include_has_explicit_shared_members ... | /man/drop_get_metadata.Rd | no_license | dholstius/rdrop2 | R | false | true | 1,529 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/drop_get_metadata.R
\name{drop_get_metadata}
\alias{drop_get_metadata}
\title{Retrieve metadata for a file or folder.}
\usage{
drop_get_metadata(path, include_media_info = FALSE, include_deleted = FALSE,
include_has_explicit_shared_members ... |
# Analysis of profilometer measurements for "blue magic" and "black magic" layups
# LV3 capstone
# Joe Shields
# 2016-5-24
#### BOOK KEEPING ####
pdf("profilometerPlot.pdf")
# setwd("~/Github/PSAS/lv3.0-airframe/test/profilometer")
files.txt <- system("ls *.txt", intern=T) #find all the files
datName.list <- as.list(f... | /test/profilometer/profilometerAnalysis.R | permissive | regundoo/lv3.0-airframe | R | false | false | 5,158 | r | # Analysis of profilometer measurements for "blue magic" and "black magic" layups
# LV3 capstone
# Joe Shields
# 2016-5-24
#### BOOK KEEPING ####
pdf("profilometerPlot.pdf")
# setwd("~/Github/PSAS/lv3.0-airframe/test/profilometer")
files.txt <- system("ls *.txt", intern=T) #find all the files
datName.list <- as.list(f... |
library(data.table)
library(sparkline)
library(shiny)
# ====準備部分====
source(file = "01_Settings/Path.R", local = T, encoding = "UTF-8")
# 感染者ソーステーブルを取得
byDate <- fread(paste0(DATA_PATH, "byDate.csv"), header = T)
byDate[is.na(byDate)] <- 0
byDate$date <- lapply(byDate[, 1], function(x) {
as.Date(as.character(x), for... | /00_System/CreateTable.R | permissive | uribo/2019-ncov-japan | R | false | false | 13,081 | r | library(data.table)
library(sparkline)
library(shiny)
# ====準備部分====
source(file = "01_Settings/Path.R", local = T, encoding = "UTF-8")
# 感染者ソーステーブルを取得
byDate <- fread(paste0(DATA_PATH, "byDate.csv"), header = T)
byDate[is.na(byDate)] <- 0
byDate$date <- lapply(byDate[, 1], function(x) {
as.Date(as.character(x), for... |
# Inverting matrices can be an risky computation to make.
# To reduce memory and time intensive processes,
# the following functions cache the inverse of a matrix
# instead of computing it each time. This saves both time
# and memory.
# The makeCacheMatrix function creates a special "matrix",
#which is really a list t... | /cachematrix.R | no_license | ClarkGH/ProgrammingAssignment2 | R | false | false | 1,481 | r | # Inverting matrices can be an risky computation to make.
# To reduce memory and time intensive processes,
# the following functions cache the inverse of a matrix
# instead of computing it each time. This saves both time
# and memory.
# The makeCacheMatrix function creates a special "matrix",
#which is really a list t... |
context("check null model logistic regression")
test_that("logistic", {
dat <- .testNullInputs(binary=TRUE)
nullmod <- .fitNullModel(dat$y, dat$X, family=binomial(), verbose=FALSE)
# Check for expected names.
expected_names <- c("model", "varComp", "varCompCov", "fixef",
"beta... | /tests/testthat/test_null_model_logistic_regression.R | no_license | Manigben/GENESIS | R | false | false | 2,138 | r | context("check null model logistic regression")
test_that("logistic", {
dat <- .testNullInputs(binary=TRUE)
nullmod <- .fitNullModel(dat$y, dat$X, family=binomial(), verbose=FALSE)
# Check for expected names.
expected_names <- c("model", "varComp", "varCompCov", "fixef",
"beta... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/atoms.R
\docType{class}
\name{LambdaMax-class}
\alias{LambdaMax-class}
\alias{.LambdaMax}
\alias{LambdaMax}
\alias{LambdaMax}
\alias{validate_args,LambdaMax-method}
\alias{to_numeric,LambdaMax-method}
\alias{size_from_args,LambdaMax-method}
\... | /man/LambdaMax-class.Rd | permissive | vishalbelsare/CVXR | R | false | true | 2,291 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/atoms.R
\docType{class}
\name{LambdaMax-class}
\alias{LambdaMax-class}
\alias{.LambdaMax}
\alias{LambdaMax}
\alias{LambdaMax}
\alias{validate_args,LambdaMax-method}
\alias{to_numeric,LambdaMax-method}
\alias{size_from_args,LambdaMax-method}
\... |
library(tidyverse)
library(darksky)
library(lubridate)
now <- get_current_forecast(33.754557, -84.390009)
print(now)
atl_2019_dates <- tibble(day = seq(ymd("2019-01-01"),
ymd("2019-12-31"),
by = "1 day")) %>%
mutate(when = paste0(day, "T12:00:00... | /R/get-weather.R | no_license | MSUDataAnalytics/SSC442 | R | false | false | 4,545 | r | library(tidyverse)
library(darksky)
library(lubridate)
now <- get_current_forecast(33.754557, -84.390009)
print(now)
atl_2019_dates <- tibble(day = seq(ymd("2019-01-01"),
ymd("2019-12-31"),
by = "1 day")) %>%
mutate(when = paste0(day, "T12:00:00... |
\name{Jtim}
\alias{Jtim}
\alias{JtimL}
\title{Decimal Julian Day}
\description{
convert JD, HR, MIN SEC to Decimal Julian Day
}
\usage{
Jtim(jj, hr = hr, mi = mi, sec = sec, yr=NULL)
JtimL(j)
}
\arguments{
\item{jj}{Julian day}
\item{hr}{Hour}
\item{mi}{Minute}
\item{sec}{Second}
\item{yr}{year, default ... | /man/Jtim.Rd | no_license | dp01101100/RSEIS | R | false | false | 829 | rd | \name{Jtim}
\alias{Jtim}
\alias{JtimL}
\title{Decimal Julian Day}
\description{
convert JD, HR, MIN SEC to Decimal Julian Day
}
\usage{
Jtim(jj, hr = hr, mi = mi, sec = sec, yr=NULL)
JtimL(j)
}
\arguments{
\item{jj}{Julian day}
\item{hr}{Hour}
\item{mi}{Minute}
\item{sec}{Second}
\item{yr}{year, default ... |
## Returns: Domain level density given,
## x, a data.frame of strat data, and
## merge_protected, a boolean indicating whether protected
## and unprotected areas should be merged together
domainDensity <- function(x, merge_protected){
## Arguments
args1 <- alist(x = list(NTOT = NTOT), aggBy("domain", "density", m... | /rvcstats/R/domainDensity.R | no_license | jeremiaheb/rvcstats | R | false | false | 1,298 | r | ## Returns: Domain level density given,
## x, a data.frame of strat data, and
## merge_protected, a boolean indicating whether protected
## and unprotected areas should be merged together
domainDensity <- function(x, merge_protected){
## Arguments
args1 <- alist(x = list(NTOT = NTOT), aggBy("domain", "density", m... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/matlist.R
\docType{methods}
\name{sigma}
\alias{SIGMA}
\alias{sigma}
\alias{smat}
\alias{smat,list-method}
\alias{smat,matrix-method}
\alias{smat,missing-method}
\alias{smat,mrgmod-method}
\alias{smat,mrgsims-method}
\alias{smat,sigmalist-met... | /rdev/man/sigma.Rd | no_license | curtisKJ/mrgsolve | R | false | true | 1,575 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/matlist.R
\docType{methods}
\name{sigma}
\alias{SIGMA}
\alias{sigma}
\alias{smat}
\alias{smat,list-method}
\alias{smat,matrix-method}
\alias{smat,missing-method}
\alias{smat,mrgmod-method}
\alias{smat,mrgsims-method}
\alias{smat,sigmalist-met... |
\name{CarbonDioxide}
\alias{CarbonDioxide}
\docType{data}
\title{
CO2
}
\description{
Atmospheric carbon dioxide levels by year
}
%\usage{data(Carbondioxide)}
\format{
A dataset with 11 observations on the following 2 variables.
\tabular{rl}{
\code{Year} \tab {Every five years from 1960-2010}\cr
\code{C02}... | /man/CarbonDioxide.Rd | no_license | statmanrobin/Lock5Data | R | false | false | 619 | rd | \name{CarbonDioxide}
\alias{CarbonDioxide}
\docType{data}
\title{
CO2
}
\description{
Atmospheric carbon dioxide levels by year
}
%\usage{data(Carbondioxide)}
\format{
A dataset with 11 observations on the following 2 variables.
\tabular{rl}{
\code{Year} \tab {Every five years from 1960-2010}\cr
\code{C02}... |
library(valaddin)
### Name: firmly
### Title: Apply a function firmly
### Aliases: firmly %checkin% loosely is_firm
### ** Examples
## Not run:
##D
##D dlog <- function(x, h) (log(x + h) - log(x)) / h
##D
##D # Require all arguments to be numeric (auto-generated error message)
##D dlog_fm <- firmly(dlog, ~is.num... | /data/genthat_extracted_code/valaddin/examples/firmly.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 4,577 | r | library(valaddin)
### Name: firmly
### Title: Apply a function firmly
### Aliases: firmly %checkin% loosely is_firm
### ** Examples
## Not run:
##D
##D dlog <- function(x, h) (log(x + h) - log(x)) / h
##D
##D # Require all arguments to be numeric (auto-generated error message)
##D dlog_fm <- firmly(dlog, ~is.num... |
## Scala scripting over TCP/IP
scala <- function(classpath=character(),classpath.packages=character(),serialize.output=.Platform$OS.type=="windows",scala.home=NULL,heap.maximum=NULL,command.line.options=NULL,row.major=TRUE,timeout=30,debug=FALSE,stdout=TRUE,stderr=TRUE,port=0,scala.info=NULL,major.release=c("2.11","2.... | /R/rscala/R/scala.R | no_license | kevinykuo/rscala | R | false | false | 41,569 | r | ## Scala scripting over TCP/IP
scala <- function(classpath=character(),classpath.packages=character(),serialize.output=.Platform$OS.type=="windows",scala.home=NULL,heap.maximum=NULL,command.line.options=NULL,row.major=TRUE,timeout=30,debug=FALSE,stdout=TRUE,stderr=TRUE,port=0,scala.info=NULL,major.release=c("2.11","2.... |
library(raster)
read_int_file <- function(in_file, dsize=1, nbands=1, s_flag=T, bsq_flag=F) {
## get the total dimensions of file = nrow*ncol*dsize*nbands
f_size <- file.info(in_file)$size
## open the file
f <- file(in_file,"rb")
## dsize should be an int() 2 bytes
tot_size <- (f_size/dsize)
## can deal ... | /INCA/INCA_PCA_MCD12Q2.R | no_license | jm-gray/pixel-forge | R | false | false | 9,871 | r | library(raster)
read_int_file <- function(in_file, dsize=1, nbands=1, s_flag=T, bsq_flag=F) {
## get the total dimensions of file = nrow*ncol*dsize*nbands
f_size <- file.info(in_file)$size
## open the file
f <- file(in_file,"rb")
## dsize should be an int() 2 bytes
tot_size <- (f_size/dsize)
## can deal ... |
## Pair of functions that cache the inverse of a matrix.
## Function creates variable 'x' with matrix from parameter and empty 'inv' for matrix inverse
## in parent environment
makeCacheMatrix <- function(x = matrix()) {
inv <- NULL
set <- function(y) {
x <<- y
inv <<- NULL
}
get <- function() x
set... | /cachematrix.R | no_license | zbig-u/ProgrammingAssignment2 | R | false | false | 850 | r | ## Pair of functions that cache the inverse of a matrix.
## Function creates variable 'x' with matrix from parameter and empty 'inv' for matrix inverse
## in parent environment
makeCacheMatrix <- function(x = matrix()) {
inv <- NULL
set <- function(y) {
x <<- y
inv <<- NULL
}
get <- function() x
set... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/thesis.R
\name{thesis_pdf}
\alias{thesis_pdf}
\title{Creates an R Markdown PDF Thesis document}
\usage{
thesis_pdf(toc = TRUE, toc_depth = 3, highlight = "default", ...)
}
\arguments{
\item{toc}{A Boolean (TRUE or FALSE) specifying whether ta... | /man/thesis_pdf.Rd | permissive | trblslp/unimelbdown | R | false | true | 951 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/thesis.R
\name{thesis_pdf}
\alias{thesis_pdf}
\title{Creates an R Markdown PDF Thesis document}
\usage{
thesis_pdf(toc = TRUE, toc_depth = 3, highlight = "default", ...)
}
\arguments{
\item{toc}{A Boolean (TRUE or FALSE) specifying whether ta... |
# installing packages using script, because when sharing codes with people,
# there are also able to see what packages are installed and install them as
# well.
install.packages('LiblineaR')
require("LiblineaR")
| /Tutorial_3.R | no_license | nazhimkalam/R-Programming | R | false | false | 214 | r | # installing packages using script, because when sharing codes with people,
# there are also able to see what packages are installed and install them as
# well.
install.packages('LiblineaR')
require("LiblineaR")
|
geno<-read.delim("Insertion_reseq_chr10_intersect_phenotypedata_9May.hmp.txt",header = F,sep="")
geno1<-t(geno)
geno2<-geno1[c(1,12:nrow(geno1)),]
#pheno<-read.delim("Inter_join_1089_pheno.txt",header = F,sep="")
#pheno1<-pheno[4:nrow(pheno),]
#write.csv(geno2,"haplotype_geno.csv")
#write.csv(pheno1,"haplotype_... | /prepare_for_haplotype.R | no_license | tjamann/LRS_all_src | R | false | false | 953 | r | geno<-read.delim("Insertion_reseq_chr10_intersect_phenotypedata_9May.hmp.txt",header = F,sep="")
geno1<-t(geno)
geno2<-geno1[c(1,12:nrow(geno1)),]
#pheno<-read.delim("Inter_join_1089_pheno.txt",header = F,sep="")
#pheno1<-pheno[4:nrow(pheno),]
#write.csv(geno2,"haplotype_geno.csv")
#write.csv(pheno1,"haplotype_... |
input <- read.table("household_power_consumption.txt", header = F, sep=";", skip = 66637, nrows = 2880);
colnames(input) <- c("Date","Time","Global_active_power",
"Global_reactive_power","Voltage","Global_intensity","Sub_metering_1","Sub_metering_2","Sub_metering_3");
DTime <- with(input, as.POSIXct(paste(in... | /plot1.R | no_license | Mohamed-Ahmed-Salem/ExData_Plotting1 | R | false | false | 551 | r | input <- read.table("household_power_consumption.txt", header = F, sep=";", skip = 66637, nrows = 2880);
colnames(input) <- c("Date","Time","Global_active_power",
"Global_reactive_power","Voltage","Global_intensity","Sub_metering_1","Sub_metering_2","Sub_metering_3");
DTime <- with(input, as.POSIXct(paste(in... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dplyr.R
\name{mutate.decorated}
\alias{mutate.decorated}
\title{Mutate Decorated}
\usage{
\method{mutate}{decorated}(.data, ...)
}
\arguments{
\item{.data}{A data frame, data frame extension (e.g. a tibble), or a
lazy data frame (e.... | /man/mutate.decorated.Rd | no_license | cran/yamlet | R | false | true | 1,467 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dplyr.R
\name{mutate.decorated}
\alias{mutate.decorated}
\title{Mutate Decorated}
\usage{
\method{mutate}{decorated}(.data, ...)
}
\arguments{
\item{.data}{A data frame, data frame extension (e.g. a tibble), or a
lazy data frame (e.... |
whole <- FindVariableFeatures(object = whole, selection.method = 'mean.var.plot', mean.cutoff = c(0.0125, 3), dispersion.cutoff = c(0.5, Inf))
| /templates/find_var_genes.R | no_license | mariafiruleva/automated_processing_scrnaseq | R | false | false | 143 | r | whole <- FindVariableFeatures(object = whole, selection.method = 'mean.var.plot', mean.cutoff = c(0.0125, 3), dispersion.cutoff = c(0.5, Inf))
|
# Server file for ShinyApp
# load the n-gram frequencies
initialPrediction <- readRDS("./data/start-word-prediction.RData")
freq2ngram <- readRDS("./data/bigram.RData")
freq3ngram <- readRDS("./data/trigram.RData")
freq4ngram <- readRDS("./data/quadgram.RData")
# load bad words file
badWordsFile <- "data/fu... | /ShinyApp/server.R | no_license | Yogithad/Capstone-Project | R | false | false | 4,847 | r | # Server file for ShinyApp
# load the n-gram frequencies
initialPrediction <- readRDS("./data/start-word-prediction.RData")
freq2ngram <- readRDS("./data/bigram.RData")
freq3ngram <- readRDS("./data/trigram.RData")
freq4ngram <- readRDS("./data/quadgram.RData")
# load bad words file
badWordsFile <- "data/fu... |
library(viridis)
library(RColorBrewer)
library(mapview)
load("rdata/sweden_landsdel.rdata")
# to make a pretty map
Landsdel <- sweden_landsdel
Landsdel$Landsdel <- c("Gotaland", "Norra Norrland", "Sodra Norrland", "Svealand")
# map with just the regions
mapview(Landsdel)
# ages of the stands
plots_sf$age <- as.nume... | /figures.r | no_license | ForModLabUHel/swedishRuns | R | false | false | 14,533 | r | library(viridis)
library(RColorBrewer)
library(mapview)
load("rdata/sweden_landsdel.rdata")
# to make a pretty map
Landsdel <- sweden_landsdel
Landsdel$Landsdel <- c("Gotaland", "Norra Norrland", "Sodra Norrland", "Svealand")
# map with just the regions
mapview(Landsdel)
# ages of the stands
plots_sf$age <- as.nume... |
library(foreign)
data <- read.dta("../data/restat_data.dta")
dim(data)
sub.data <- data[ ,c("state", "year", "income", "popdens")]
d <- sub.data[sub.data$year < 1980, ]
crisis.mat <- data[ ,c("crisis1", "crisis2", "crisis3")]
time.covariate(time, crisis.mat)
income.covariate(income)[1:50]
ddply(d, .(state), summar... | /src/predict.R | no_license | danhammer/water-forecast | R | false | false | 358 | r | library(foreign)
data <- read.dta("../data/restat_data.dta")
dim(data)
sub.data <- data[ ,c("state", "year", "income", "popdens")]
d <- sub.data[sub.data$year < 1980, ]
crisis.mat <- data[ ,c("crisis1", "crisis2", "crisis3")]
time.covariate(time, crisis.mat)
income.covariate(income)[1:50]
ddply(d, .(state), summar... |
## Create a special "matrix", which is a list containing
## a function to
## - set the value of the matrix
## - get the value of the matrix
## - set the value of the inverse matrix
## - get the value of the inverse matrix
makeCacheMatrix <- function(x = matrix()) {
i <- NULL
set <- function(y... | /cachematrix.R | no_license | lixuanzhang/ProgrammingAssignment2 | R | false | false | 955 | r | ## Create a special "matrix", which is a list containing
## a function to
## - set the value of the matrix
## - get the value of the matrix
## - set the value of the inverse matrix
## - get the value of the inverse matrix
makeCacheMatrix <- function(x = matrix()) {
i <- NULL
set <- function(y... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/audits.R
\name{audit_access_open}
\alias{audit_access_open}
\title{Audit Access Controls}
\usage{
audit_access_open(apps, type = "all")
}
\arguments{
\item{apps}{App list, see \code{cache_apps}}
\item{type}{One of "all" or "logged_in". If "a... | /man/audit_access_open.Rd | no_license | kevinykuo/connectapi | R | false | true | 709 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/audits.R
\name{audit_access_open}
\alias{audit_access_open}
\title{Audit Access Controls}
\usage{
audit_access_open(apps, type = "all")
}
\arguments{
\item{apps}{App list, see \code{cache_apps}}
\item{type}{One of "all" or "logged_in". If "a... |
logNormSlider <- manyParamSliderMaker(
minVal = -1, maxVal = 2, startVals = c(1), stepVal = .25, paramHTML = "β", multi = F)
logNormParamTransform <- function(p, xVals){p}
logNormPlotDistr <- function(param){
param <- param[1]
analyticalDistr <- data.frame(drawVal = 1:5000/500)
analyticalDistr <- analyt... | /DistributionSpecific/1_LogNormHelpers.R | no_license | CB-B/2k1-in-silico | R | false | false | 1,407 | r | logNormSlider <- manyParamSliderMaker(
minVal = -1, maxVal = 2, startVals = c(1), stepVal = .25, paramHTML = "β", multi = F)
logNormParamTransform <- function(p, xVals){p}
logNormPlotDistr <- function(param){
param <- param[1]
analyticalDistr <- data.frame(drawVal = 1:5000/500)
analyticalDistr <- analyt... |
#' Main function to estimate the efficiency maps used for search
#'
#' @param map_parameters
#' @param optim_params
#'
#' @return
#' @export
#' @import dplyr tidyr
#' @examples
estimate_efficiency_maps <- function(map_parameters, optim_params = list(n_cores = 1, maxit = 3000, tolerance = 1e-12, NP = NULL)) {
#max_r... | /R/estimate_efficiency_maps.R | no_license | calenwalshe/searchR | R | false | false | 5,845 | r | #' Main function to estimate the efficiency maps used for search
#'
#' @param map_parameters
#' @param optim_params
#'
#' @return
#' @export
#' @import dplyr tidyr
#' @examples
estimate_efficiency_maps <- function(map_parameters, optim_params = list(n_cores = 1, maxit = 3000, tolerance = 1e-12, NP = NULL)) {
#max_r... |
tarea1UI <- function(id){
ns <- NS(id)
tagList(
titlePanel("Generacion de datos con distribucion exponencial"),
sidebarLayout(
sidebarPanel(
sliderInput(ns("muestras"),"Muestras de tamano 10^n:",1,4,4),
sliderInput(ns("rate"),"Rate o promedio de exponencial:",1,5,1)
),
... | /Tarea1/tarea1_ui.R | no_license | raulzr/compstat2016 | R | false | false | 884 | r | tarea1UI <- function(id){
ns <- NS(id)
tagList(
titlePanel("Generacion de datos con distribucion exponencial"),
sidebarLayout(
sidebarPanel(
sliderInput(ns("muestras"),"Muestras de tamano 10^n:",1,4,4),
sliderInput(ns("rate"),"Rate o promedio de exponencial:",1,5,1)
),
... |
#날짜 : 2020/08/04
#이름 : 유효진
#내용 : 데이터프레임 파생변수 생성
df_exam <- read.csv('../file/exam.csv')
View(df_exam)
#파생변수 total
df_exam$total <- df_exam$math + df_exam$english + df_exam$science
View(df_exam)
#파생변수 mean
df_exam$mean <- (df_exam$total) / 3
df_exam
#파생변수 grade
df_exam$grade <- ifelse(df_exam$mean >= 90, 'A',
... | /Ch03/3-3.R | no_license | tsbslteisrhy/R | R | false | false | 549 | r | #날짜 : 2020/08/04
#이름 : 유효진
#내용 : 데이터프레임 파생변수 생성
df_exam <- read.csv('../file/exam.csv')
View(df_exam)
#파생변수 total
df_exam$total <- df_exam$math + df_exam$english + df_exam$science
View(df_exam)
#파생변수 mean
df_exam$mean <- (df_exam$total) / 3
df_exam
#파생변수 grade
df_exam$grade <- ifelse(df_exam$mean >= 90, 'A',
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data-migsaRes.R
\docType{data}
\name{migsaRes}
\alias{migsaRes}
\title{A MIGSA results object (MIGSAres) example}
\format{
A MIGSAres object
}
\source{
see \code{\link{MIGSA}}
}
\description{
A MIGSA results object (MIGSAres) obtained using t... | /man/migsaRes.Rd | no_license | zhangkaicr/MIGSA | R | false | true | 375 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data-migsaRes.R
\docType{data}
\name{migsaRes}
\alias{migsaRes}
\title{A MIGSA results object (MIGSAres) example}
\format{
A MIGSAres object
}
\source{
see \code{\link{MIGSA}}
}
\description{
A MIGSA results object (MIGSAres) obtained using t... |
# blank_theme
blank_theme <- theme_minimal()+
theme(
axis.title.x = element_blank(),
axis.title.y = element_blank(),
panel.border = element_blank(),
panel.grid=element_blank(),
axis.ticks = element_blank(),
plot.title=element_text(size=14, face="bold")
)
# heatmap_theme
theme_heatmap <- theme(axis.text... | /R/plot/themes.R | permissive | matahi/lib | R | false | false | 552 | r | # blank_theme
blank_theme <- theme_minimal()+
theme(
axis.title.x = element_blank(),
axis.title.y = element_blank(),
panel.border = element_blank(),
panel.grid=element_blank(),
axis.ticks = element_blank(),
plot.title=element_text(size=14, face="bold")
)
# heatmap_theme
theme_heatmap <- theme(axis.text... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/BSDA-package.R
\docType{data}
\name{Lifespan}
\alias{Lifespan}
\title{Life span of electronic components used in a spacecraft versus heat}
\format{A data frame/tibble with six observations two variables
\describe{
\item{heat}{temperature (in... | /man/Lifespan.Rd | no_license | nebsnave/BSDA | R | false | true | 740 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/BSDA-package.R
\docType{data}
\name{Lifespan}
\alias{Lifespan}
\title{Life span of electronic components used in a spacecraft versus heat}
\format{A data frame/tibble with six observations two variables
\describe{
\item{heat}{temperature (in... |
# for each row of dataframe
dat <- data.frame(x=c(1,2), y=c(3,4), z=c(5,6))
apply(dat[,c('x','z')], 1, function(x) sum(x) )
################################################################################
# 性能测试
################################################################################
insertSql <- function(myDa... | /genInserSqlFromDataFrame -V3-性能对比.R | no_license | liango2/lianxi-rstat | R | false | false | 2,468 | r | # for each row of dataframe
dat <- data.frame(x=c(1,2), y=c(3,4), z=c(5,6))
apply(dat[,c('x','z')], 1, function(x) sum(x) )
################################################################################
# 性能测试
################################################################################
insertSql <- function(myDa... |
### 1. Density, likelihood, gradient : This function affects BvZINB3, BvZINB4
dBvNB3 <- function(x, y, a0, a1, a2, b1, b2, log=FALSE) {
p1 = (b1 + b2 + 1) /(b1 + 1); p2 = (b1 + b2 + 1) /(b2 + 1)
adj = 0
l1 <- function(k, m) exp(lgamma(a1 + k) - lgamma(k+1) - lgamma(a1) + lgamma(x + y + a0 -m -k) - lgamma(x -k +1... | /F0101-BvNB3.R | no_license | Hunyong/SCdep | R | false | false | 10,982 | r | ### 1. Density, likelihood, gradient : This function affects BvZINB3, BvZINB4
dBvNB3 <- function(x, y, a0, a1, a2, b1, b2, log=FALSE) {
p1 = (b1 + b2 + 1) /(b1 + 1); p2 = (b1 + b2 + 1) /(b2 + 1)
adj = 0
l1 <- function(k, m) exp(lgamma(a1 + k) - lgamma(k+1) - lgamma(a1) + lgamma(x + y + a0 -m -k) - lgamma(x -k +1... |
# == title
# Visualize column after dimension reduction
#
# == description
# Visualize samples (the matrix columns) after dimension reduction
#
# == param
# -object A `ConsensusPartition-class` object.
# -k Number of subgroups.
# -top_n Top n rows to use. By default it uses all rows in the original matrix.
# -method W... | /R/dimension_reduction.R | permissive | mil2041/cola | R | false | false | 9,402 | r |
# == title
# Visualize column after dimension reduction
#
# == description
# Visualize samples (the matrix columns) after dimension reduction
#
# == param
# -object A `ConsensusPartition-class` object.
# -k Number of subgroups.
# -top_n Top n rows to use. By default it uses all rows in the original matrix.
# -method W... |
\encoding{UTF-8}
\name{modelInput}
\alias{forest2aboveground}
\alias{forest2belowground}
\alias{forest2growthInput}
\alias{forest2spwbInput}
\alias{growthInput}
\alias{spwbInput}
\title{
Input for simulation models
}
\description{
Functions \code{forest2spwbInput} and \code{forest2growthInput} take an object of class... | /man/forest2spwbInput.Rd | no_license | mdekauwe/medfate | R | false | false | 13,156 | rd | \encoding{UTF-8}
\name{modelInput}
\alias{forest2aboveground}
\alias{forest2belowground}
\alias{forest2growthInput}
\alias{forest2spwbInput}
\alias{growthInput}
\alias{spwbInput}
\title{
Input for simulation models
}
\description{
Functions \code{forest2spwbInput} and \code{forest2growthInput} take an object of class... |
test_that('estimateAWC/correctAWC', {
# test range of organic matter, loam FEF textures
base.awc <- estimateAWC(texcl = c("l","l","l"), omcl = c(3, 2, 1), na.rm = TRUE)
expect_equal(base.awc, c(0.21, 0.18, round(0.175, 2)))
# assume base AWC for testing corrections independently
base.expected <- c(0.21,... | /tests/testthat/test-estimateAWC.R | no_license | ncss-tech/aqp | R | false | false | 2,114 | r | test_that('estimateAWC/correctAWC', {
# test range of organic matter, loam FEF textures
base.awc <- estimateAWC(texcl = c("l","l","l"), omcl = c(3, 2, 1), na.rm = TRUE)
expect_equal(base.awc, c(0.21, 0.18, round(0.175, 2)))
# assume base AWC for testing corrections independently
base.expected <- c(0.21,... |
#' @export
ROCPlot <- function(frame, xvar, truthVar,title,...) {
checkArgs(frame=frame,xvar=xvar,yvar=truthVar,title=title,...)
outcol <- frame[[truthVar]]
predcol <- frame[[xvar]]
pred <- ROCR::prediction(predcol,outcol)
perf <- ROCR::performance(pred,'tpr','fpr')
auc <- as.numeric(ROCR::performance(pr... | /R/ROC.R | no_license | npp97-field/WVPlots | R | false | false | 1,205 | r |
#' @export
ROCPlot <- function(frame, xvar, truthVar,title,...) {
checkArgs(frame=frame,xvar=xvar,yvar=truthVar,title=title,...)
outcol <- frame[[truthVar]]
predcol <- frame[[xvar]]
pred <- ROCR::prediction(predcol,outcol)
perf <- ROCR::performance(pred,'tpr','fpr')
auc <- as.numeric(ROCR::performance(pr... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/check-parent-syn.R
\name{check_parent_syn}
\alias{check_parent_syn}
\title{Check synID of parent in manifest}
\usage{
check_parent_syn(
manifest,
success_msg = "All Synapse IDs in the manifest are valid",
fail_msg = "Some Synapse IDs in... | /man/check_parent_syn.Rd | permissive | Sage-Bionetworks/dccvalidator | R | false | true | 877 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/check-parent-syn.R
\name{check_parent_syn}
\alias{check_parent_syn}
\title{Check synID of parent in manifest}
\usage{
check_parent_syn(
manifest,
success_msg = "All Synapse IDs in the manifest are valid",
fail_msg = "Some Synapse IDs in... |
#########################################################
#
# Lab: SVM with German Credit Data
#
#########################################################
## Calling packages
library(e1071) #install.packages("e1071")
## Data reading
german = read.table("germandata.txt",header=T)
german$y = ifelse... | /ch12/Lab.SVM_Rcode_German(1).R | no_license | jason2133/data_mining | R | false | false | 5,032 | r | #########################################################
#
# Lab: SVM with German Credit Data
#
#########################################################
## Calling packages
library(e1071) #install.packages("e1071")
## Data reading
german = read.table("germandata.txt",header=T)
german$y = ifelse... |
\name{hook_movecode}
\alias{hook_movecode}
\title{A document hook function to move code out of floating environments}
\usage{
hook_movecode(x)
}
\arguments{
\item{x}{a character string (the content of the whole
document output)}
}
\value{
The post-processed document as a character string.
}
\description{
This i... | /man/hook_movecode.Rd | no_license | skyqin/knitr | R | false | false | 1,169 | rd | \name{hook_movecode}
\alias{hook_movecode}
\title{A document hook function to move code out of floating environments}
\usage{
hook_movecode(x)
}
\arguments{
\item{x}{a character string (the content of the whole
document output)}
}
\value{
The post-processed document as a character string.
}
\description{
This i... |
context("Facetting")
df <- data.frame(x = 1:3, y = 3:1, z = letters[1:3])
test_that("facets split up the data", {
l1 <- ggplot(df, aes(x, y)) + geom_point() + facet_wrap(~z)
d1 <- pdata(l1)[[1]]
expect_that(d1$PANEL, equals(factor(1:3)))
l2 <- ggplot(df, aes(x, y)) + geom_point() + facet_grid(. ~ z)
l3 <-... | /tests/testthat/test-facet-.r | no_license | bbolker/ggplot2 | R | false | false | 1,736 | r | context("Facetting")
df <- data.frame(x = 1:3, y = 3:1, z = letters[1:3])
test_that("facets split up the data", {
l1 <- ggplot(df, aes(x, y)) + geom_point() + facet_wrap(~z)
d1 <- pdata(l1)[[1]]
expect_that(d1$PANEL, equals(factor(1:3)))
l2 <- ggplot(df, aes(x, y)) + geom_point() + facet_grid(. ~ z)
l3 <-... |
options(rgl.useNULL=TRUE)
library(shinyRGL)
library(rgl)
shinyUI(fluidPage(title="K29 PCA Training Dataset",
sidebarLayout(
sidebarPanel(
h4("Training Data Controls"),
sliderInput("tpts",
"Number of background points:",
... | /plot3d/plot3d2/ui.R | permissive | leejz/meta-omics-scripts | R | false | false | 1,004 | r | options(rgl.useNULL=TRUE)
library(shinyRGL)
library(rgl)
shinyUI(fluidPage(title="K29 PCA Training Dataset",
sidebarLayout(
sidebarPanel(
h4("Training Data Controls"),
sliderInput("tpts",
"Number of background points:",
... |
rm(list=ls())
directory <- "workspace"
models <- list.files(path=directory, pattern= "*_model.RData",recursive=TRUE,full.names = TRUE)
ex<-c()
for(i in seq(1,length(models)))
{
load(models[[i]])
ex <- c(ex,is.na(model$performance_metric))
} | /scripts/temp_script.R | no_license | elefthcn/automl | R | false | false | 247 | r | rm(list=ls())
directory <- "workspace"
models <- list.files(path=directory, pattern= "*_model.RData",recursive=TRUE,full.names = TRUE)
ex<-c()
for(i in seq(1,length(models)))
{
load(models[[i]])
ex <- c(ex,is.na(model$performance_metric))
} |
#' Upgrading a usms.xml file to a newer version
#'
#' @param file Path of a usms.xml file
#' @param out_dir Output directory path of the generated file
#' @param param_gen_file Path of the param_gen.xml file corresponding
#' to the file version
#' @param obs_dir Directory path of the observation data files
#' @param st... | /R/upgrade_usms_xml.R | no_license | SticsRPacks/SticsRFiles | R | false | false | 4,178 | r | #' Upgrading a usms.xml file to a newer version
#'
#' @param file Path of a usms.xml file
#' @param out_dir Output directory path of the generated file
#' @param param_gen_file Path of the param_gen.xml file corresponding
#' to the file version
#' @param obs_dir Directory path of the observation data files
#' @param st... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tp_refs.R
\name{tp_refs}
\alias{tp_refs}
\title{Return all reference records for for a taxon name with a given id.}
\usage{
tp_refs(id, key = NULL, ...)
}
\arguments{
\item{id}{the taxon identifier code}
\item{key}{Your Tropicos API key; loa... | /man/tp_refs.Rd | permissive | ktargows/taxize | R | false | true | 566 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tp_refs.R
\name{tp_refs}
\alias{tp_refs}
\title{Return all reference records for for a taxon name with a given id.}
\usage{
tp_refs(id, key = NULL, ...)
}
\arguments{
\item{id}{the taxon identifier code}
\item{key}{Your Tropicos API key; loa... |
# add_stars() ------------------------------------------------------------------
#' Add stars to statistical estimate
#'
#' \code{add_stars} is a function that adds stars to statistical estimates for
#' easy addition in latex tables.
#' Used in scripts: {}
#' Robust function: FALSE
#'
#' @param estimates Numeric, vec... | /R/strings.R | permissive | AndreSjuve/dretools | R | false | false | 10,062 | r |
# add_stars() ------------------------------------------------------------------
#' Add stars to statistical estimate
#'
#' \code{add_stars} is a function that adds stars to statistical estimates for
#' easy addition in latex tables.
#' Used in scripts: {}
#' Robust function: FALSE
#'
#' @param estimates Numeric, vec... |
.onLoad <- function(libname, pkgname, ...) {
if ("knitr" %in% loadedNamespaces()) {
epoxy_set_knitr_engines()
}
setHook(
packageEvent("knitr", "onLoad"),
function(...) epoxy_set_knitr_engines()
)
invisible()
}
| /R/zzz.R | permissive | han-tun/epoxy | R | false | false | 235 | r | .onLoad <- function(libname, pkgname, ...) {
if ("knitr" %in% loadedNamespaces()) {
epoxy_set_knitr_engines()
}
setHook(
packageEvent("knitr", "onLoad"),
function(...) epoxy_set_knitr_engines()
)
invisible()
}
|
library(parallelMap)
parallelStartMulticore(20L,level="mlr.tuneParams")
library(mlr)
library(foreign)
data_rnd_CHARM = read.arff(file='~/ndethcmml/rnd_CHARM_D.S.OPOS_500_1.0_0.5.arff')
names.data<-paste('V',c(1:1059),sep='')
colnames(data_rnd_CHARM)<-make.names(c(names.data,'class'))
data_rnd_CHARM_SIFT_230 ... | /ndetchmml-dir/MachineLearning-mlr-R/initial/CHARM_SIFT230_CHARM-SIFT230.R | permissive | miroslavradojevic/advantra | R | false | false | 3,414 | r | library(parallelMap)
parallelStartMulticore(20L,level="mlr.tuneParams")
library(mlr)
library(foreign)
data_rnd_CHARM = read.arff(file='~/ndethcmml/rnd_CHARM_D.S.OPOS_500_1.0_0.5.arff')
names.data<-paste('V',c(1:1059),sep='')
colnames(data_rnd_CHARM)<-make.names(c(names.data,'class'))
data_rnd_CHARM_SIFT_230 ... |
# Data cleaning part 1
# create new column names for multi-column questions
rm(list = ls(all.names = TRUE))
library(dplyr)
## load surveydata.csv
dat <- read.csv("data/surveydata.csv", na = c("#NULL!", "", "Refused", "NA"))
## rename sub-columns
data_rename <- dat %>%
# Q7
rename("Q7_1_Bus" = Q7_1,
"Q7_... | /old_code/data_cleaning1.R | no_license | gloriakang/flu-survey | R | false | false | 6,105 | r | # Data cleaning part 1
# create new column names for multi-column questions
rm(list = ls(all.names = TRUE))
library(dplyr)
## load surveydata.csv
dat <- read.csv("data/surveydata.csv", na = c("#NULL!", "", "Refused", "NA"))
## rename sub-columns
data_rename <- dat %>%
# Q7
rename("Q7_1_Bus" = Q7_1,
"Q7_... |
# R Script for p-value calculation
arguments <- commandArgs(trailingOnly = TRUE)
filename <- arguments[1]
output <- arguments[2]
df <- read.table(filename, header = FALSE)
scores <- df$V3
transcript_labels <- df$V6
transcript = df$V1
resultsPval = numeric(length(scores))
for (i in 1:length(scores)) {
score = as.nu... | /kruskal_wallis.R | no_license | jchow32/exon_boundary | R | false | false | 688 | r | # R Script for p-value calculation
arguments <- commandArgs(trailingOnly = TRUE)
filename <- arguments[1]
output <- arguments[2]
df <- read.table(filename, header = FALSE)
scores <- df$V3
transcript_labels <- df$V6
transcript = df$V1
resultsPval = numeric(length(scores))
for (i in 1:length(scores)) {
score = as.nu... |
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/xpssSplitFileOff.R
\name{xpssSplitFileOff}
\alias{xpssSplitFileOff}
\title{Set the data split off}
\usage{
xpssSplitFileOff(x)
}
\arguments{
\item{x}{a (non-empty) data.frame or input data of class \code{"xpssFrame"}.}
}
\v... | /man/xpssSplitFileOff.Rd | no_license | cran/translateSPSS2R | R | false | false | 600 | rd | % Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/xpssSplitFileOff.R
\name{xpssSplitFileOff}
\alias{xpssSplitFileOff}
\title{Set the data split off}
\usage{
xpssSplitFileOff(x)
}
\arguments{
\item{x}{a (non-empty) data.frame or input data of class \code{"xpssFrame"}.}
}
\v... |
#' Function to deploy the bundle in RStudio Connect
#'
#' @param bundle_id Bundle identifier within RSC
#' @param content_guid The unique identifier of the desired content item
#'
#' @return httr response object
#' @keywords internal
deploy_bundle <- function(bundle_id, content_guid){
bundle_data <- paste0('{"bundl... | /R/deploy_bundle.R | permissive | ian-flores/metadata | R | false | false | 650 | r | #' Function to deploy the bundle in RStudio Connect
#'
#' @param bundle_id Bundle identifier within RSC
#' @param content_guid The unique identifier of the desired content item
#'
#' @return httr response object
#' @keywords internal
deploy_bundle <- function(bundle_id, content_guid){
bundle_data <- paste0('{"bundl... |
data_full <- read.csv("/Users/rodneyjoujoute/household_power_consumption.txt", header=T, sep=';', na.strings="?",
nrows=2075259, check.names=F, stringsAsFactors=F, comment.char="", quote='\"')
data_full$Date <- as.Date(data_full$Date, format="%d/%m/%Y")
data <- subset(data_full, subset=(Date >= "... | /plot2.R | no_license | rjoujoute/Exploratory-Data-Analysis-Course-Project-1 | R | false | false | 634 | r | data_full <- read.csv("/Users/rodneyjoujoute/household_power_consumption.txt", header=T, sep=';', na.strings="?",
nrows=2075259, check.names=F, stringsAsFactors=F, comment.char="", quote='\"')
data_full$Date <- as.Date(data_full$Date, format="%d/%m/%Y")
data <- subset(data_full, subset=(Date >= "... |
#' RGB manipulation
#'
#' @param input_img string, path to the input .png file
#' @param R int, a weight value, equal to or greater than 1, for red the filter
#' @param G int, a weight value, equal to or greater than 1, for green the filter
#' @param B int, a weight value, equal to or greater than 1, for blue the filt... | /R/RGB_manipulation.R | permissive | bettybhzhou/InstaRF | R | false | false | 617 | r |
#' RGB manipulation
#'
#' @param input_img string, path to the input .png file
#' @param R int, a weight value, equal to or greater than 1, for red the filter
#' @param G int, a weight value, equal to or greater than 1, for green the filter
#' @param B int, a weight value, equal to or greater than 1, for blue the filt... |
fit_log_nls_k <- function (x,y,col) {
if (sum(y)>0) {
#x <- h$mids
#y <- h$counts
x <- x[!is.na(y)]
y <- y[!is.na(y)]
x <- x[y!=0]
y <- y[y!=0]
x <- x[is.finite(y)]
y <- y[is.finite(y)]
df <- data.frame(x,y)
model <- nls(y ~ ( a1 * exp(-k*x) ), data=df, start=list(a1=max(y), k=1) )
dffit <- data.frame(x=seq(-5,2... | /functions/fit_log_nls_k.R | no_license | algyz200/R_portfolio | R | false | false | 538 | r | fit_log_nls_k <- function (x,y,col) {
if (sum(y)>0) {
#x <- h$mids
#y <- h$counts
x <- x[!is.na(y)]
y <- y[!is.na(y)]
x <- x[y!=0]
y <- y[y!=0]
x <- x[is.finite(y)]
y <- y[is.finite(y)]
df <- data.frame(x,y)
model <- nls(y ~ ( a1 * exp(-k*x) ), data=df, start=list(a1=max(y), k=1) )
dffit <- data.frame(x=seq(-5,2... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/trnlns.R
\docType{data}
\name{trnlns}
\alias{trnlns}
\title{Seagrass transect locations}
\format{
A \code{sf} LINESTRING object
}
\usage{
trnlns
}
\description{
Seagrass transect locations
}
\examples{
\dontrun{
library(sf)
library(dplyr)
tr... | /man/trnlns.Rd | permissive | tbep-tech/tbeptools | R | false | true | 888 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/trnlns.R
\docType{data}
\name{trnlns}
\alias{trnlns}
\title{Seagrass transect locations}
\format{
A \code{sf} LINESTRING object
}
\usage{
trnlns
}
\description{
Seagrass transect locations
}
\examples{
\dontrun{
library(sf)
library(dplyr)
tr... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/paws.quicksight_operations.R
\name{delete_group_membership}
\alias{delete_group_membership}
\title{Removes a user from a group so that the user is no longer a member of the group}
\usage{
delete_group_membership(MemberName, GroupName, AwsAcco... | /service/paws.quicksight/man/delete_group_membership.Rd | permissive | CR-Mercado/paws | R | false | true | 1,519 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/paws.quicksight_operations.R
\name{delete_group_membership}
\alias{delete_group_membership}
\title{Removes a user from a group so that the user is no longer a member of the group}
\usage{
delete_group_membership(MemberName, GroupName, AwsAcco... |
`reqMktDepth` <-
function (conn, Contract, tickerId = "1", numRows="20",
timeStamp=TRUE, playback=1,
file='', verbose=TRUE,
eventWrapper=eWrapper(),
CALLBACK=twsCALLBACK,...)
{
if (!is.twsConnection(conn))
stop("tws connection object required")
if(!is.twsPlaybac... | /R/reqMktDepth.R | no_license | joshuaulrich/IBrokers | R | false | false | 2,973 | r | `reqMktDepth` <-
function (conn, Contract, tickerId = "1", numRows="20",
timeStamp=TRUE, playback=1,
file='', verbose=TRUE,
eventWrapper=eWrapper(),
CALLBACK=twsCALLBACK,...)
{
if (!is.twsConnection(conn))
stop("tws connection object required")
if(!is.twsPlaybac... |
# fixing the biolsums
# created by Claudette Landry for the Biochem reboot project
# July 2019
# Edited by Reid Steele, August 11 2020
# Contains code to write to the shared drive or a local directory
# set the working directory
wd="C:/Users/steeler/Documents/Reid/BCD Creation/Fixed Station Biochem Reload/con... | /fixing_Biolsums_RS.R | no_license | reidsteele2/Fixed-Stations-BioChem-Reload | R | false | false | 2,444 | r | # fixing the biolsums
# created by Claudette Landry for the Biochem reboot project
# July 2019
# Edited by Reid Steele, August 11 2020
# Contains code to write to the shared drive or a local directory
# set the working directory
wd="C:/Users/steeler/Documents/Reid/BCD Creation/Fixed Station Biochem Reload/con... |
source("download.R")
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
combustionRelated <- grepl("comb", SCC$SCC.Level.One, ignore.case=TRUE)
coalRelated <- grepl("coal", SCC$SCC.Level.Four, ignore.case=TRUE)
coalCombustion <- (combustionRelated & coalRelated)
combustionSCC <- S... | /plot4.R | no_license | aleck7/exdata-project2 | R | false | false | 829 | r | source("download.R")
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
combustionRelated <- grepl("comb", SCC$SCC.Level.One, ignore.case=TRUE)
coalRelated <- grepl("coal", SCC$SCC.Level.Four, ignore.case=TRUE)
coalCombustion <- (combustionRelated & coalRelated)
combustionSCC <- S... |
#! /usr/bin/Rscript
# ---
# title: "Plot1"
# author: "phseven"
# date: "July 11, 2014"
# ---
# Input: household_power_consumption.txt (in same directory as the R script)
# Output: plot1.png (in same directory as the R script)
#
# Program requires some flavor of Unix (Mac OSX, linux) which supports grep
# and system() ... | /PA1_plot1.R | no_license | nishantsbi/ReproducibleResearch-3 | R | false | false | 1,606 | r | #! /usr/bin/Rscript
# ---
# title: "Plot1"
# author: "phseven"
# date: "July 11, 2014"
# ---
# Input: household_power_consumption.txt (in same directory as the R script)
# Output: plot1.png (in same directory as the R script)
#
# Program requires some flavor of Unix (Mac OSX, linux) which supports grep
# and system() ... |
#' Pipeline of pathway-based analysis.
#'
#' This is the pathway-based analysis pipeline.
#'
#' \code{df_user_mut} is a dataframe with 7 columns, which are "Hugo_Symbol",
#' "Chromosome", "Start_position", "End_position", "Reference_Allele",
#' "Tumor_Seq_Allele2", "Tumor_Sample_Barcode". \code{df_user_exp} is a
#... | /R/main_pathway.R | no_license | ys08/bionexr | R | false | false | 10,847 | r | #' Pipeline of pathway-based analysis.
#'
#' This is the pathway-based analysis pipeline.
#'
#' \code{df_user_mut} is a dataframe with 7 columns, which are "Hugo_Symbol",
#' "Chromosome", "Start_position", "End_position", "Reference_Allele",
#' "Tumor_Seq_Allele2", "Tumor_Sample_Barcode". \code{df_user_exp} is a
#... |
#!#!/usr/bin/env Rscript
#!#SBATCH --partition=milkun
#!#SBATCH --mail-type=FAIL
#!#SBATCH --mail-user=mirzaceng@gmail.com
#!#SBATCH --time=14-00:00:00
#!#SBATCH --output "/Logs/Distance_vars_calc.log"
#!#SBATCH --mem=64G
##########################################
#### Distance variables
############################... | /code/Data_processing/Distance_vars/Distance_variables.R | no_license | MirzaCengic/agriculture_suitability | R | false | false | 3,630 | r | #!#!/usr/bin/env Rscript
#!#SBATCH --partition=milkun
#!#SBATCH --mail-type=FAIL
#!#SBATCH --mail-user=mirzaceng@gmail.com
#!#SBATCH --time=14-00:00:00
#!#SBATCH --output "/Logs/Distance_vars_calc.log"
#!#SBATCH --mem=64G
##########################################
#### Distance variables
############################... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/save.R
\docType{methods}
\name{save_pipe}
\alias{save_pipe}
\alias{save_pipe,ConumeePipe-method}
\alias{save_pipe,MethylCNVPipe-method}
\alias{save_pipe,CwobPipe-method}
\title{Save an object of pipeline classes.}
\usage{
save_pipe(x, outdir,... | /man/save_pipe.Rd | no_license | markgene/yamatCN | R | false | true | 1,281 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/save.R
\docType{methods}
\name{save_pipe}
\alias{save_pipe}
\alias{save_pipe,ConumeePipe-method}
\alias{save_pipe,MethylCNVPipe-method}
\alias{save_pipe,CwobPipe-method}
\title{Save an object of pipeline classes.}
\usage{
save_pipe(x, outdir,... |
#Plot 1
hhpower<- read.table("household_power_consumption.txt", sep=";",header=TRUE,colClasses = "character")
hhpower$Date <- as.Date(hhpower$Date,format="%d/%m/%Y")
hhpower$Time <- strptime(hhpower$Time,format="%H:%M:%S")
hhpower2 <- hhpower[hhpower$Date == "2007-02-01"|hhpower$Date=="2007-02-02",]
hhpower2$Global_act... | /plot1.R | no_license | rmezera/ExData_Plotting1 | R | false | false | 559 | r | #Plot 1
hhpower<- read.table("household_power_consumption.txt", sep=";",header=TRUE,colClasses = "character")
hhpower$Date <- as.Date(hhpower$Date,format="%d/%m/%Y")
hhpower$Time <- strptime(hhpower$Time,format="%H:%M:%S")
hhpower2 <- hhpower[hhpower$Date == "2007-02-01"|hhpower$Date=="2007-02-02",]
hhpower2$Global_act... |
#' Download vein project
#'
#' \code{\link{get_project}} downloads a project for running vein.
#' The projects are available on Github.com/atmoschem/vein/projects
#'
#' @param directory Character; Path to an existing or a new directory to be created.
#' It needs absolute path.
#' @param case Character; One of of the f... | /R/get_project.R | no_license | gitter-badger/vein | R | false | false | 2,251 | r | #' Download vein project
#'
#' \code{\link{get_project}} downloads a project for running vein.
#' The projects are available on Github.com/atmoschem/vein/projects
#'
#' @param directory Character; Path to an existing or a new directory to be created.
#' It needs absolute path.
#' @param case Character; One of of the f... |
# Copyright 2021 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | /01_load.R | permissive | bcgov/land-designations-indicator | R | false | false | 2,112 | r | # Copyright 2021 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
df1 <- data.table(chr=rep("chr1",5),start=1:5,end=2:6,value=0)
df2 <- data.table(chr=rep("chr1",5),start=3:7,end=4:8,value=0)
df3 <- data.table(chr=rep("chr1",5),start=6:10,end=7:11,value=0)
df4 <- data.table(chr=rep("chr2",5),start=1:10,end=2:11,value=0)
files <- c("df1.bedgraph","df2.bedgraph","df3.bedgraph","df4.be... | /tests/testthat/test-scMethrix_operations.R | no_license | rajansiv/scMethrix | R | false | false | 3,615 | r | df1 <- data.table(chr=rep("chr1",5),start=1:5,end=2:6,value=0)
df2 <- data.table(chr=rep("chr1",5),start=3:7,end=4:8,value=0)
df3 <- data.table(chr=rep("chr1",5),start=6:10,end=7:11,value=0)
df4 <- data.table(chr=rep("chr2",5),start=1:10,end=2:11,value=0)
files <- c("df1.bedgraph","df2.bedgraph","df3.bedgraph","df4.be... |
#' Plotting observed vs. model biomass data
#'
#' `r lifecycle::badge("experimental")`
#' If biomass observations are available for at least some species via the
#' `biomass_observed` column in the species parameter data frame, this function
#' plots the biomass of each species in the model against the observed
#' biom... | /R/plotBiomassObservedVsModel.R | no_license | sizespectrum/mizer | R | false | false | 8,703 | r | #' Plotting observed vs. model biomass data
#'
#' `r lifecycle::badge("experimental")`
#' If biomass observations are available for at least some species via the
#' `biomass_observed` column in the species parameter data frame, this function
#' plots the biomass of each species in the model against the observed
#' biom... |
#' Wetland prediction model
#'
#' This function runs \code{\link[ModelMap]{model.build}} to build a wetland
#' model using training data attributed with predictor values, such as from
#' \code{\link{grid_values_at_sp}}.
#'
#' If an AOI has been used to prepare the training data, the model can be run
#' for each seperat... | /R/modelmap_processing.R | permissive | crgl-ca/wetlandmapR | R | false | false | 17,718 | r | #' Wetland prediction model
#'
#' This function runs \code{\link[ModelMap]{model.build}} to build a wetland
#' model using training data attributed with predictor values, such as from
#' \code{\link{grid_values_at_sp}}.
#'
#' If an AOI has been used to prepare the training data, the model can be run
#' for each seperat... |
library(huge)
# Convert precision matrix to partial correlation ---------------------
precision2partial = function(Omega) {
L = diag( diag(Omega)^(-0.5) )
R = L %*% (-Omega) %*% L
return(R)
}
# Get grid of lambdas for cross validation ----------------------------
get_lambda_grid = function(x, nlambd... | /experiments/methods/method_glasso.R | no_license | btaschler/scl_replicate | R | false | false | 1,180 | r |
library(huge)
# Convert precision matrix to partial correlation ---------------------
precision2partial = function(Omega) {
L = diag( diag(Omega)^(-0.5) )
R = L %*% (-Omega) %*% L
return(R)
}
# Get grid of lambdas for cross validation ----------------------------
get_lambda_grid = function(x, nlambd... |
require(caret)
# require(pROC)
# requireMethods(AUC)
# library(scmamp)
# library(ROCR)
set.seed(1234)
recall <- function(matrix) {
tp <- matrix[2, 2]
fn <- matrix[2, 1]
return (tp / (tp + fn))
}
cm_sanity_check <- function(matrix) {
if(dim(matrix)[2]==1){
matrix <- cbind(matrix, c(0,0))
colnames(matr... | /stat_analysis/R_analysis/R_codes/classification_glm_volume_only.R | no_license | suyanzhou626/BNN-for-Uncertainty-Estimation-of-Imaging-Biomarkers | R | false | false | 19,656 | r |
require(caret)
# require(pROC)
# requireMethods(AUC)
# library(scmamp)
# library(ROCR)
set.seed(1234)
recall <- function(matrix) {
tp <- matrix[2, 2]
fn <- matrix[2, 1]
return (tp / (tp + fn))
}
cm_sanity_check <- function(matrix) {
if(dim(matrix)[2]==1){
matrix <- cbind(matrix, c(0,0))
colnames(matr... |
options(shiny.deprecation.messages=FALSE)
shinyUI(
fluidPage(
#titlePanel("Predict-A-Tron 3000"),
#tags$div("Predict-A-Tron 3000", class='jumbotron'),
tags$div(
style='background-image: url("stone_dude.jpg"); background-size: 100%; background-repeat: n... | /ui.R | no_license | MaryLvV/Predict-A-Tron | R | false | false | 1,507 | r |
options(shiny.deprecation.messages=FALSE)
shinyUI(
fluidPage(
#titlePanel("Predict-A-Tron 3000"),
#tags$div("Predict-A-Tron 3000", class='jumbotron'),
tags$div(
style='background-image: url("stone_dude.jpg"); background-size: 100%; background-repeat: n... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/js_helpers.R
\name{qr_js_src_update}
\alias{qr_js_src_update}
\title{Update the JS source for \code{jsQR} from the upstream repo.}
\usage{
qr_js_src_update(local_path = getwd(), reset = FALSE)
}
\arguments{
\item{local_path}{The working folde... | /man/qr_js_src_update.Rd | permissive | brianwdavis/quadrangle | R | false | true | 814 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/js_helpers.R
\name{qr_js_src_update}
\alias{qr_js_src_update}
\title{Update the JS source for \code{jsQR} from the upstream repo.}
\usage{
qr_js_src_update(local_path = getwd(), reset = FALSE)
}
\arguments{
\item{local_path}{The working folde... |
library(tmaptools)
for_vis <- d %>%
mutate(final_del = case_when(game_of_chance != "no_tie" & final_del != reported_del_given ~ reported_del_given,
TRUE ~ final_del))
for_vis %>% filter(is_complete) %>%
group_by(candidate) %>%
summarize(diff = sum(final_del) - sum(reported_del_g... | /nevada_scripts/nevada_visualizations.R | no_license | GOliveira10/Nevada-Caucus-Monitoring | R | false | false | 3,072 | r | library(tmaptools)
for_vis <- d %>%
mutate(final_del = case_when(game_of_chance != "no_tie" & final_del != reported_del_given ~ reported_del_given,
TRUE ~ final_del))
for_vis %>% filter(is_complete) %>%
group_by(candidate) %>%
summarize(diff = sum(final_del) - sum(reported_del_g... |
---
title: "Old Faithful Initial"
author: "Bivin"
date: "4/4/2019"
output: html_document
runtime: shiny
---
library(shiny)
ui <- fluidPage(
# App title ----
titlePanel("Ole Faithful App!"),
# Sidebar layout with input and output definitions ----
sidebarLayout(
# Sidebar panel for inputs ---... | /Unit 12/NYT NB Classifier/Faithful2/ui.R | no_license | BivinSadler/MSDS_6306_Doing-Data-Science | R | false | false | 1,564 | r | ---
title: "Old Faithful Initial"
author: "Bivin"
date: "4/4/2019"
output: html_document
runtime: shiny
---
library(shiny)
ui <- fluidPage(
# App title ----
titlePanel("Ole Faithful App!"),
# Sidebar layout with input and output definitions ----
sidebarLayout(
# Sidebar panel for inputs ---... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/print.R
\name{cat_where}
\alias{cat_where}
\title{cat function for whereami}
\usage{
cat_where(
where,
type = c("rule", "boxx", "bullet", "line", "print"),
color = c("none", "black", "blue", "cyan", "green", "magenta", "red", "white",
... | /man/cat_where.Rd | permissive | yonicd/whereami | R | false | true | 897 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/print.R
\name{cat_where}
\alias{cat_where}
\title{cat function for whereami}
\usage{
cat_where(
where,
type = c("rule", "boxx", "bullet", "line", "print"),
color = c("none", "black", "blue", "cyan", "green", "magenta", "red", "white",
... |
# Packages =====
# Manually calling library on each package instead of lapply so that rsconnect
# picks up on the dependencies
# ChemmineR requires a different installation
# library("BiocManager")
# BiocManager::install("ChemmineR")
# BiocManager::repositories()
# getOption("repos")
if (!require("earth")) {
inst... | /functions.R | no_license | awqx/qsar-app | R | false | false | 19,310 | r | # Packages =====
# Manually calling library on each package instead of lapply so that rsconnect
# picks up on the dependencies
# ChemmineR requires a different installation
# library("BiocManager")
# BiocManager::install("ChemmineR")
# BiocManager::repositories()
# getOption("repos")
if (!require("earth")) {
inst... |
filter:
timestep: daily
output:
format: csv
path: "../out"
filename: "test_basin_daily"
basin:
ids: 1
variables: patch.total_water_in,
patch.streamflow,
hill.gw.Qout,
patch.transpiration_sat_zone,
patch.transpiration_unsat_zone,
patch.evaporation,
patch.evaporation_surf,
patch.exfiltration_sat_zone,
patch.... | /scripts/output_filter_test.yml.R | no_license | rachtorr/VegParamsSA | R | false | false | 1,050 | r | filter:
timestep: daily
output:
format: csv
path: "../out"
filename: "test_basin_daily"
basin:
ids: 1
variables: patch.total_water_in,
patch.streamflow,
hill.gw.Qout,
patch.transpiration_sat_zone,
patch.transpiration_unsat_zone,
patch.evaporation,
patch.evaporation_surf,
patch.exfiltration_sat_zone,
patch.... |
library(dplyr)
library(data.table)
zipURL <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip"
download.file(zipURL, ".data/UCI")
# Zip file was opened manually as I could not get unzip() to work
setwd("~.//data//Irvine")
# Read in the data
X_train <- read.ta... | /run_analysis.R | no_license | JoChoWS/Getting-Cleaning-Data | R | false | false | 2,146 | r | library(dplyr)
library(data.table)
zipURL <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip"
download.file(zipURL, ".data/UCI")
# Zip file was opened manually as I could not get unzip() to work
setwd("~.//data//Irvine")
# Read in the data
X_train <- read.ta... |
# Results 1
ofs<-function(x){var(x)/(mean(x)^2)}
Samples<-1000
set.seed(1)
Irs.m<-c()
Irs.f<-c()
for(i in 1:Samples){
Irs.m[i]<- ofs(sample(RS_males[which(Age_males >(45-11))], replace = TRUE))
Irs.f[i]<- ofs(sample(RS_females[which(Age_females >(45-11))], replace = TRUE))
... | /Code/ResultsRS.R | no_license | ctross/batemanpimbwe | R | false | false | 3,793 | r |
# Results 1
ofs<-function(x){var(x)/(mean(x)^2)}
Samples<-1000
set.seed(1)
Irs.m<-c()
Irs.f<-c()
for(i in 1:Samples){
Irs.m[i]<- ofs(sample(RS_males[which(Age_males >(45-11))], replace = TRUE))
Irs.f[i]<- ofs(sample(RS_females[which(Age_females >(45-11))], replace = TRUE))
... |
ao <- TwoSampleMR::available_outcomes()
library(dplyr)
source("utils.r")
load("../data/trait_id_master.rdata")
traits <- subset(ao, id %in% subset(master, !is.na(id_06))$id_mrb & access != "developer") %>% as_data_frame
instdat <- "/mnt/storage/private/mrcieu/research/GODMC_Analysis/godmc_phase2_analysis/06_mr-gwas-... | /neo4j/scripts/trait-cpg.r | no_license | csorianot/godmc-database | R | false | false | 4,063 | r | ao <- TwoSampleMR::available_outcomes()
library(dplyr)
source("utils.r")
load("../data/trait_id_master.rdata")
traits <- subset(ao, id %in% subset(master, !is.na(id_06))$id_mrb & access != "developer") %>% as_data_frame
instdat <- "/mnt/storage/private/mrcieu/research/GODMC_Analysis/godmc_phase2_analysis/06_mr-gwas-... |
get_sntemp_discharge = function(model_output_file, model_fabric_file){
model_output = read.csv(model_output_file, header = T, stringsAsFactors = F)
model_fabric = sf::read_sf(model_fabric_file)
seg_ids = tibble(seg_id_nat = as.character(model_fabric$seg_id_nat), model_idx = as.character(model_fabric$model_idx... | /4_model/src/get_sntemp_values.R | no_license | aappling-usgs/delaware-water-temp | R | false | false | 2,377 | r |
get_sntemp_discharge = function(model_output_file, model_fabric_file){
model_output = read.csv(model_output_file, header = T, stringsAsFactors = F)
model_fabric = sf::read_sf(model_fabric_file)
seg_ids = tibble(seg_id_nat = as.character(model_fabric$seg_id_nat), model_idx = as.character(model_fabric$model_idx... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/n3BiasFieldCorrection.R
\name{n3BiasFieldCorrection}
\alias{n3BiasFieldCorrection}
\title{N3 bias field correction}
\usage{
n3BiasFieldCorrection(img, downsampleFactor, ...)
}
\arguments{
\item{img}{antsImage to correct}
\item{downsampleFact... | /man/n3BiasFieldCorrection.Rd | permissive | ANTsX/ANTsRCore | R | false | true | 595 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/n3BiasFieldCorrection.R
\name{n3BiasFieldCorrection}
\alias{n3BiasFieldCorrection}
\title{N3 bias field correction}
\usage{
n3BiasFieldCorrection(img, downsampleFactor, ...)
}
\arguments{
\item{img}{antsImage to correct}
\item{downsampleFact... |
##compare proteomics to TCGA
source("../../bin/dermalNFData.R")
dermal.prots<-prot_normalized()
##now get TCGA data
#pancan.rppa<-read.table(synGet('syn1710429')@filePath,comment='',header=T,row.names=1)
pancan.rppa<-read.table(synGet('syn5908448')@filePath,sep=',',header=T)
#pancan.meta<-read.table('TCGA-PANCAN16-... | /analysis/2016-04-12/tcga_prot_comparison.R | no_license | allaway/dermalNF | R | false | false | 2,596 | r | ##compare proteomics to TCGA
source("../../bin/dermalNFData.R")
dermal.prots<-prot_normalized()
##now get TCGA data
#pancan.rppa<-read.table(synGet('syn1710429')@filePath,comment='',header=T,row.names=1)
pancan.rppa<-read.table(synGet('syn5908448')@filePath,sep=',',header=T)
#pancan.meta<-read.table('TCGA-PANCAN16-... |
#some additional vector functions
veC = c('Pune', 'Mumbai', 'Nashik', 'Nagpur', 'Delhi', 'Chennai', 'Kolkata', 'Noida')
#grepl
# ?grepl
grepl('n',veC)
#grepl gives true or false, if we index it to a vector, we get values
veC[grepl('n',veC)]
#ordering elements alphabetically
veC[order(veC)]
## addition,... | /vector functions.R | no_license | tailwind01/R-Basics | R | false | false | 693 | r | #some additional vector functions
veC = c('Pune', 'Mumbai', 'Nashik', 'Nagpur', 'Delhi', 'Chennai', 'Kolkata', 'Noida')
#grepl
# ?grepl
grepl('n',veC)
#grepl gives true or false, if we index it to a vector, we get values
veC[grepl('n',veC)]
#ordering elements alphabetically
veC[order(veC)]
## addition,... |
library(datasets)
#setwd("D:/doc/study/dataScientists/4-Exploratory Data Analysis/ExData_Plotting1")
rec<-read.table("household_power_consumption.txt",header=TRUE,sep=";",na.strings = "?",colClasses=c("character", "character",rep("numeric",7)))
dt<-rec[(rec$Date %in% c("1/2/2007","2/2/2007")), ]
Sys.setlocale("LC_TIM... | /courseProject1/plot2.R | no_license | gdwangh/coursera-dataScientists-4-ExploratoryDataAnalysis | R | false | false | 631 | r | library(datasets)
#setwd("D:/doc/study/dataScientists/4-Exploratory Data Analysis/ExData_Plotting1")
rec<-read.table("household_power_consumption.txt",header=TRUE,sep=";",na.strings = "?",colClasses=c("character", "character",rep("numeric",7)))
dt<-rec[(rec$Date %in% c("1/2/2007","2/2/2007")), ]
Sys.setlocale("LC_TIM... |
library(gridGraphics)
polygon1 <- function() {
x <- c(1:9, 8:1)
y <- c(1, 2*(5:3), 2, -1, 17, 9, 8, 2:9)
par(mfcol = c(3, 1))
for(xpd in c(FALSE, TRUE, NA)) {
plot(1:10, main = paste("xpd =", xpd))
box("figure", col = "pink", lwd = 3)
polygon(x, y, xpd = xpd, col = "orange", lt... | /gridGraphics/test-scripts/test-polygon.R | permissive | solgenomics/R_libs | R | false | false | 1,643 | r |
library(gridGraphics)
polygon1 <- function() {
x <- c(1:9, 8:1)
y <- c(1, 2*(5:3), 2, -1, 17, 9, 8, 2:9)
par(mfcol = c(3, 1))
for(xpd in c(FALSE, TRUE, NA)) {
plot(1:10, main = paste("xpd =", xpd))
box("figure", col = "pink", lwd = 3)
polygon(x, y, xpd = xpd, col = "orange", lt... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/OutlierFunctions.R
\name{Outlier}
\alias{Outlier}
\title{Outlier detection and outlier summary statistics}
\usage{
Outlier(x)
}
\arguments{
\item{x}{the variable of interest}
}
\value{
list of 6 objects (1:mild outliers, 2: extreme outliers, ... | /man/Outlier.Rd | permissive | sbbauer/automatic-data-explorer | R | false | true | 687 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/OutlierFunctions.R
\name{Outlier}
\alias{Outlier}
\title{Outlier detection and outlier summary statistics}
\usage{
Outlier(x)
}
\arguments{
\item{x}{the variable of interest}
}
\value{
list of 6 objects (1:mild outliers, 2: extreme outliers, ... |
=begin
Div can write Web application like GUI programming.
* Div overview. (English)
* ((<URL:http://www.jin.gr.jp/~nahi/RWiki/?cmd=view;name=Div>))
* Tofu memo. (Nihongo)
* ((<URL:http://www.jin.gr.jp/~nahi/RWiki/?cmd=view;name=Tofu>))
* Programming Web Application with Div. (Nihongo, div-0.3)
* ISBN4-7561... | /doc/Div.rd | permissive | seki/Tofu | R | false | false | 333 | rd | =begin
Div can write Web application like GUI programming.
* Div overview. (English)
* ((<URL:http://www.jin.gr.jp/~nahi/RWiki/?cmd=view;name=Div>))
* Tofu memo. (Nihongo)
* ((<URL:http://www.jin.gr.jp/~nahi/RWiki/?cmd=view;name=Tofu>))
* Programming Web Application with Div. (Nihongo, div-0.3)
* ISBN4-7561... |
context("Conjugate Gradient")
test_that("CG with different updates", {
res <- mize(rb0, rosenbrock_fg,
method = "cg", max_iter = 5,
cg_update = "fr", grad_tol = 1e-5
)
expect_equal(res$nf, 20)
expect_equal(res$ng, 20)
expect_equal(res$f, 3.117, tol = 1e-3)
expect_equal(res$g2n, 25.835, tol = 1e-3)
... | /tests/testthat/test_cg.R | permissive | jlmelville/mize | R | false | false | 6,811 | r | context("Conjugate Gradient")
test_that("CG with different updates", {
res <- mize(rb0, rosenbrock_fg,
method = "cg", max_iter = 5,
cg_update = "fr", grad_tol = 1e-5
)
expect_equal(res$nf, 20)
expect_equal(res$ng, 20)
expect_equal(res$f, 3.117, tol = 1e-3)
expect_equal(res$g2n, 25.835, tol = 1e-3)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.