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 |
|---|---|---|---|---|---|---|---|---|---|
Multi_RidgeRegression<-function(y,x,K){
#standardize x and y
for(i in 1:dim(x)[2]){
x[,i]=(x[,i]-mean(x[,i])/sd(x[,i]))
}
for(j in 1:dim(y)[2]){
y[,j]=(y[,j]-mean(y[,j])/sd(y[,j]))
}
#generate diagnal matrix as the desired size.
Is=diag(dim(y)[1])
Ir=diag(dim(x)[1])
... | /multi_ridge_regression.R | no_license | lidongrong/ridge-regression-in-multivariate-situations | R | false | false | 673 | r | Multi_RidgeRegression<-function(y,x,K){
#standardize x and y
for(i in 1:dim(x)[2]){
x[,i]=(x[,i]-mean(x[,i])/sd(x[,i]))
}
for(j in 1:dim(y)[2]){
y[,j]=(y[,j]-mean(y[,j])/sd(y[,j]))
}
#generate diagnal matrix as the desired size.
Is=diag(dim(y)[1])
Ir=diag(dim(x)[1])
... |
make_tsne_plot <- function(tsne_obj, cluster) { #, output = FALSE, filepath = 'viz/tsne_cluster.png'
tsne_data <- as.data.frame(tsne_obj$Y)
names(tsne_data) <- c('X', 'Y')
tsne_data$Group <- factor(paste0('Cluster', cluster))
p <- ggplot(aes(x = X, y = Y), data = tsne_data) +
geom_point(aes(color = Group)) +... | /misc/make_tsne_plot.R | no_license | uhoang/mec | R | false | false | 391 | r | make_tsne_plot <- function(tsne_obj, cluster) { #, output = FALSE, filepath = 'viz/tsne_cluster.png'
tsne_data <- as.data.frame(tsne_obj$Y)
names(tsne_data) <- c('X', 'Y')
tsne_data$Group <- factor(paste0('Cluster', cluster))
p <- ggplot(aes(x = X, y = Y), data = tsne_data) +
geom_point(aes(color = Group)) +... |
egos.file <- system.file("extdata", "egos_32.csv", package = "egonetR")
alteri.file <- system.file("extdata", "alteri_32.csv", package = "egonetR")
edges.file <- system.file("extdata", "edges_32.csv", package = "egonetR")
egos <- read.csv2(egos.file)
alteri <- read.csv2(alteri.file)
edges <- read.csv2(edges.file)
r... | /tests/testthat/test_read_three_files.r | no_license | tilltnet/egonetR | R | false | false | 392 | r | egos.file <- system.file("extdata", "egos_32.csv", package = "egonetR")
alteri.file <- system.file("extdata", "alteri_32.csv", package = "egonetR")
edges.file <- system.file("extdata", "edges_32.csv", package = "egonetR")
egos <- read.csv2(egos.file)
alteri <- read.csv2(alteri.file)
edges <- read.csv2(edges.file)
r... |
## ----setup, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
## -----------------------------------------------------------------------------
library(tokenizers)
options(max.print = 25)
james <- paste0(
"The question thus becomes a ver... | /vignettes/introduction-to-tokenizers.R | no_license | davebraze/tokenizers | R | false | false | 2,716 | r | ## ----setup, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
## -----------------------------------------------------------------------------
library(tokenizers)
options(max.print = 25)
james <- paste0(
"The question thus becomes a ver... |
\encoding{utf8}
\name{TBuildIrregularHisto}
\alias{TBuildIrregularHisto}
\title{
Irregular histogram estimator list constructor.
}
\description{
Given a sample X, builds the family of irregular histograms using the procedure described in the 'histogram' package.
}
\usage{
TBuildIrregularHisto(X,n=length(X),Dmax=NULL,gr... | /man/TBuildIrregularHisto.Rd | no_license | cran/Density.T.HoldOut | R | false | false | 2,669 | rd | \encoding{utf8}
\name{TBuildIrregularHisto}
\alias{TBuildIrregularHisto}
\title{
Irregular histogram estimator list constructor.
}
\description{
Given a sample X, builds the family of irregular histograms using the procedure described in the 'histogram' package.
}
\usage{
TBuildIrregularHisto(X,n=length(X),Dmax=NULL,gr... |
# Inspired by question from "rie" on Git Gud Science discord server
# TO-DO ########################################################################
# ::: p1
# allow for sampling of units and show how regression slope changes aross samples
library(MASS)
tri.data <- function(n, rho_xc)
{
# Generate ... | /vif-sim-viz.R | no_license | SALubanski/vif-viz | R | false | false | 1,744 | r |
# Inspired by question from "rie" on Git Gud Science discord server
# TO-DO ########################################################################
# ::: p1
# allow for sampling of units and show how regression slope changes aross samples
library(MASS)
tri.data <- function(n, rho_xc)
{
# Generate ... |
library(yorkr)
### Name: saveAllMatchesBetweenTeams
### Title: Saves all matches between 2 teams as dataframe
### Aliases: saveAllMatchesBetweenTeams
### ** Examples
## Not run:
##D saveAllMatchesBetweenTeams
## End(Not run)
| /data/genthat_extracted_code/yorkr/examples/saveAllMatchesBetweenTeams.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 233 | r | library(yorkr)
### Name: saveAllMatchesBetweenTeams
### Title: Saves all matches between 2 teams as dataframe
### Aliases: saveAllMatchesBetweenTeams
### ** Examples
## Not run:
##D saveAllMatchesBetweenTeams
## End(Not run)
|
#' @title Find the largest common connected subgraph (LCCS) of two graphs
#'
#' @description Find the largest common connected subgraphs of
#' two matched graphs, which is an induced connected subgraph of both graphs
#' that has as many vertices as possible.
#' The \code{largest_cc} function returns the largest connect... | /R/largest_common_cc.R | no_license | dpmcsuss/iGraphMatch | R | false | false | 3,127 | r | #' @title Find the largest common connected subgraph (LCCS) of two graphs
#'
#' @description Find the largest common connected subgraphs of
#' two matched graphs, which is an induced connected subgraph of both graphs
#' that has as many vertices as possible.
#' The \code{largest_cc} function returns the largest connect... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compute_functions.R
\name{disks.createSnapshot}
\alias{disks.createSnapshot}
\title{Creates a snapshot of a specified persistent disk.}
\usage{
disks.createSnapshot(Snapshot, project, zone, disk, guestFlush = NULL,
requestId = NULL)
}
\argu... | /googlecomputealpha.auto/man/disks.createSnapshot.Rd | permissive | GVersteeg/autoGoogleAPI | R | false | true | 1,405 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compute_functions.R
\name{disks.createSnapshot}
\alias{disks.createSnapshot}
\title{Creates a snapshot of a specified persistent disk.}
\usage{
disks.createSnapshot(Snapshot, project, zone, disk, guestFlush = NULL,
requestId = NULL)
}
\argu... |
# author: Tiffany Timbers
# date: 2020-01-15
"This script prints out docopt args.
Usage: demo.R <arg1> [<arg_two>] --arg2=<arg2> [--arg3=<arg3>]
Options:
<arg> Takes any value (this is a required positional argument)
[<arg_two>] Takes any value (this is an option positional argument)
--arg2=<arg2>... | /demo.R | no_license | syadk/docopt_demo | R | false | false | 626 | r | # author: Tiffany Timbers
# date: 2020-01-15
"This script prints out docopt args.
Usage: demo.R <arg1> [<arg_two>] --arg2=<arg2> [--arg3=<arg3>]
Options:
<arg> Takes any value (this is a required positional argument)
[<arg_two>] Takes any value (this is an option positional argument)
--arg2=<arg2>... |
zcs <-
function(cases,data2,
rev = c("neither", "rows", "columns", "both"),pctdig=1,digits=NULL) { # Hoi quy cho ca tiep xuc hcpx
if (is.null(digits)) {digits=getOption("digits")}
reverse <- match.arg(rev)
if (is.null(ncol(data2))) {
tab<-table(data2,cases)
t0<-c("====",tab.names(tab,rev=reverse)... | /R/zcs.R | no_license | gvdovandzung/thongke | R | false | false | 1,341 | r | zcs <-
function(cases,data2,
rev = c("neither", "rows", "columns", "both"),pctdig=1,digits=NULL) { # Hoi quy cho ca tiep xuc hcpx
if (is.null(digits)) {digits=getOption("digits")}
reverse <- match.arg(rev)
if (is.null(ncol(data2))) {
tab<-table(data2,cases)
t0<-c("====",tab.names(tab,rev=reverse)... |
## Below are two functions that are used to create a special object that stores
## a matrix and cache's the inverse of the matrix.
## The mackeCacheMatrix function creates a special "matrix" object that can
## cache its inverse.
makeCacheMatrix <- function(x = matrix()) {
m <- NULL
set <- function(y) {
... | /cachematrix.R | no_license | murmurlittle/ProgrammingAssignment2 | R | false | false | 1,053 | r | ## Below are two functions that are used to create a special object that stores
## a matrix and cache's the inverse of the matrix.
## The mackeCacheMatrix function creates a special "matrix" object that can
## cache its inverse.
makeCacheMatrix <- function(x = matrix()) {
m <- NULL
set <- function(y) {
... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | /R/pkg/R/RDD.R | permissive | bloomberg/apache-spark-on-k8s | R | false | false | 55,247 | r | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
setwd("Y:/WL/R")
library('xlsx')
pdf_file <- "2019-06-06-MA.pdf"
treatment <- c("DMSO", "Mithramycin A", "Terameprocol", "Betulinic acid")
file1 <- "2019-06-06A.xlsx"
conc <- c(0,0.46875,0.9375,1.875,3.75,7.5,15,30)
x<- read.xlsx(file1, sheetName = "Sheet1")
x1 <- x[1:8,2:4]
x1$treatment <- treatment[1]
x2 <- x[... | /2019-06-06MA.R | no_license | caipine/LUM | R | false | false | 2,905 | r | setwd("Y:/WL/R")
library('xlsx')
pdf_file <- "2019-06-06-MA.pdf"
treatment <- c("DMSO", "Mithramycin A", "Terameprocol", "Betulinic acid")
file1 <- "2019-06-06A.xlsx"
conc <- c(0,0.46875,0.9375,1.875,3.75,7.5,15,30)
x<- read.xlsx(file1, sheetName = "Sheet1")
x1 <- x[1:8,2:4]
x1$treatment <- treatment[1]
x2 <- x[... |
#' Read in a CSV file and convert it into a data frame
#'
#' @param filename a string - The name of a csv file to import
#' @return A data frame containing the information from the imported csv
#' @importFrom readr read_csv
#' @importFrom dplyr tbl_df
#' @note
#' This function will error out if the \code{filename} does... | /R/fars_functions.R | no_license | bhjagolinzer/Jags | R | false | false | 3,983 | r | #' Read in a CSV file and convert it into a data frame
#'
#' @param filename a string - The name of a csv file to import
#' @return A data frame containing the information from the imported csv
#' @importFrom readr read_csv
#' @importFrom dplyr tbl_df
#' @note
#' This function will error out if the \code{filename} does... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/overlap.R
\name{overl}
\alias{overl}
\title{Find if a single interval overlaps multiple intervals}
\usage{
overl(one_int, n_int)
}
\arguments{
\item{one_int}{a single lubridate::interval}
\item{n_int}{a vector of lubridate::intervals}
}
\val... | /man/overl.Rd | permissive | annam21/spaceNtime | R | false | true | 583 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/overlap.R
\name{overl}
\alias{overl}
\title{Find if a single interval overlaps multiple intervals}
\usage{
overl(one_int, n_int)
}
\arguments{
\item{one_int}{a single lubridate::interval}
\item{n_int}{a vector of lubridate::intervals}
}
\val... |
#' @title generateListing
#' @description Generate LaTeX code for job info
#' @details Given a subsetted dataset of just one job this generates LaTeX code. Given jobname and company name, print out the section.
#' @author Jared P. Lander
#' @export generateListing
#' @rdname generateListing
#' @importFrom dplyr ... | /resumer/R/ListingCreation.r | no_license | ingted/R-Examples | R | false | false | 3,588 | r | #' @title generateListing
#' @description Generate LaTeX code for job info
#' @details Given a subsetted dataset of just one job this generates LaTeX code. Given jobname and company name, print out the section.
#' @author Jared P. Lander
#' @export generateListing
#' @rdname generateListing
#' @importFrom dplyr ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_fns.R
\name{plot.totalCountFilt}
\alias{plot.totalCountFilt}
\title{Plot totalCountFilt Object}
\usage{
\method{plot}{totalCountFilt}(
x,
min_count = NULL,
interactive = FALSE,
x_lab = NULL,
y_lab = NULL,
x_lab_size = 11,
y... | /man/plot-totalCountFilt.Rd | permissive | pmartR/pmartR | R | false | true | 2,667 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_fns.R
\name{plot.totalCountFilt}
\alias{plot.totalCountFilt}
\title{Plot totalCountFilt Object}
\usage{
\method{plot}{totalCountFilt}(
x,
min_count = NULL,
interactive = FALSE,
x_lab = NULL,
y_lab = NULL,
x_lab_size = 11,
y... |
#!/usr/bin/env Rscript
source("common.manipulations.r")
psych.fits <- function(...) {
my.args <- list(...)
library(plyr)
library(ggplot2)
library(psyphy) #for glm.lambda, logit.2asym, etc.
load(my.args[[1]])
products <- file(my.args[[2]])
tryCatch(finally = close(products), {
#do the fit with a 5% ... | /psychfits.R | no_license | crowding/analysis | R | false | false | 5,987 | r | #!/usr/bin/env Rscript
source("common.manipulations.r")
psych.fits <- function(...) {
my.args <- list(...)
library(plyr)
library(ggplot2)
library(psyphy) #for glm.lambda, logit.2asym, etc.
load(my.args[[1]])
products <- file(my.args[[2]])
tryCatch(finally = close(products), {
#do the fit with a 5% ... |
pathway_order <- function(dta, scoreType = "pos", eps = 0){
BIOP <- gmtPathways('https://maayanlab.cloud/Enrichr/geneSetLibrary?mode=text&libraryName=BioPlanet_2019')
set.seed(1)
E <- fgseaMultilevel(BIOP, dta[!grepl('^RPL|^RPS|^RP[[:digit:]]|^MT-',names(dta))],
scoreType = scoreType, eps =... | /GSE137524/UMAP_order.R | no_license | guanxunli/sc_Tensor_time | R | false | false | 2,024 | r | pathway_order <- function(dta, scoreType = "pos", eps = 0){
BIOP <- gmtPathways('https://maayanlab.cloud/Enrichr/geneSetLibrary?mode=text&libraryName=BioPlanet_2019')
set.seed(1)
E <- fgseaMultilevel(BIOP, dta[!grepl('^RPL|^RPS|^RP[[:digit:]]|^MT-',names(dta))],
scoreType = scoreType, eps =... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/matlabColon.R
\name{matlabColon}
\alias{matlabColon}
\alias{SeqInc}
\title{Simulate Matlab's ':'}
\usage{
matlabColon(from, to)
SeqInc(from, to)
}
\arguments{
\item{from}{numeric. The start value}
\item{to}{numeric. The end value.}
}
\value... | /man/matlabColon.Rd | permissive | statisticsnorway/SSBtools | R | false | true | 914 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/matlabColon.R
\name{matlabColon}
\alias{matlabColon}
\alias{SeqInc}
\title{Simulate Matlab's ':'}
\usage{
matlabColon(from, to)
SeqInc(from, to)
}
\arguments{
\item{from}{numeric. The start value}
\item{to}{numeric. The end value.}
}
\value... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/classtable_function.R
\name{classtable}
\alias{classtable}
\title{Calculates several classification statistics from binary prediction and criterion (e.g.; truth) vectors}
\usage{
classtable(prediction.v, criterion.v)
}
\arguments{
\item{predi... | /man/classtable.Rd | no_license | ronypik/FFTrees | R | false | true | 694 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/classtable_function.R
\name{classtable}
\alias{classtable}
\title{Calculates several classification statistics from binary prediction and criterion (e.g.; truth) vectors}
\usage{
classtable(prediction.v, criterion.v)
}
\arguments{
\item{predi... |
utils::globalVariables(c("clinicalAttributeId", "value", "sampleId"))
#' @name cBioPortal-class
#'
#' @title A class for representing the cBioPortal API protocol
#'
#' @description The `cBioPortal` class is a representation of the cBioPortal
#' API protocol that directly inherits from the `Service` class in the
#'... | /R/cBioPortal.R | no_license | inodb/cBioPortalData | R | false | false | 17,902 | r | utils::globalVariables(c("clinicalAttributeId", "value", "sampleId"))
#' @name cBioPortal-class
#'
#' @title A class for representing the cBioPortal API protocol
#'
#' @description The `cBioPortal` class is a representation of the cBioPortal
#' API protocol that directly inherits from the `Service` class in the
#'... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/to_any_case.R
\name{to_any_case}
\alias{to_any_case}
\title{General case conversion}
\usage{
to_any_case(string, case = c("snake", "small_camel", "big_camel",
"screaming_snake", "parsed", "mixed", "lower_upper", "upper_lower",
"swap", "al... | /man/to_any_case.Rd | no_license | ktaranov/snakecase | R | false | true | 8,812 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/to_any_case.R
\name{to_any_case}
\alias{to_any_case}
\title{General case conversion}
\usage{
to_any_case(string, case = c("snake", "small_camel", "big_camel",
"screaming_snake", "parsed", "mixed", "lower_upper", "upper_lower",
"swap", "al... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/VarID_functions.R
\name{fitLogVarLogMean}
\alias{fitLogVarLogMean}
\title{Second order polynomial fit of mean-variance dependence
This function corrects for the systematic dependence of the variance on the mean by a local regression.}
\usage{... | /man/fitLogVarLogMean.Rd | no_license | dgrun/RaceID3_StemID2_package | R | false | true | 678 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/VarID_functions.R
\name{fitLogVarLogMean}
\alias{fitLogVarLogMean}
\title{Second order polynomial fit of mean-variance dependence
This function corrects for the systematic dependence of the variance on the mean by a local regression.}
\usage{... |
library(quickdraw)
library(tidyverse)
library(here)
bread <- qd_read("bread")
tree <- qd_read("tree")
duck <- qd_read("duck")
bread %>%
group_by(countrycode) %>%
summarise(count = n()) %>%
arrange(desc(count)) %>%
slice(1:50) %>%
rename(
country_bread = countrycode,
count_bread = coun... | /exploratory_analyses/05_physical_distances/countries.r | no_license | mllewis/conceptQD | R | false | false | 858 | r | library(quickdraw)
library(tidyverse)
library(here)
bread <- qd_read("bread")
tree <- qd_read("tree")
duck <- qd_read("duck")
bread %>%
group_by(countrycode) %>%
summarise(count = n()) %>%
arrange(desc(count)) %>%
slice(1:50) %>%
rename(
country_bread = countrycode,
count_bread = coun... |
## ---- initialise ----
# Main 'driver' script to create the unit sources
#
# Gareth Davies, Geoscience Australia 2015
#
suppressPackageStartupMessages(library(rptha))
suppressPackageStartupMessages(library(raster))
###############################################################################
#
# Main input paramet... | /scripts/03_produce_unit_sources.R | no_license | ryanign/StochasticEQModels_R-PTHA | R | false | false | 18,105 | r | ## ---- initialise ----
# Main 'driver' script to create the unit sources
#
# Gareth Davies, Geoscience Australia 2015
#
suppressPackageStartupMessages(library(rptha))
suppressPackageStartupMessages(library(raster))
###############################################################################
#
# Main input paramet... |
#' Transforms a dataset of individuals to a dataset of pairs
#'
#' The function \code{indToPair} takes a dataset of observations (such as individuals in an infectious
#' disease outbreak) and transforms it into a dataset of pairs.
#'
#' The function requires an id column: \code{indIDVar} to identify the individ... | /R/indToPair.R | no_license | cran/nbTransmission | R | false | false | 5,841 | r |
#' Transforms a dataset of individuals to a dataset of pairs
#'
#' The function \code{indToPair} takes a dataset of observations (such as individuals in an infectious
#' disease outbreak) and transforms it into a dataset of pairs.
#'
#' The function requires an id column: \code{indIDVar} to identify the individ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nn-pooling.R
\name{nn_lp_pool1d}
\alias{nn_lp_pool1d}
\title{Applies a 1D power-average pooling over an input signal composed of several input
planes.}
\usage{
nn_lp_pool1d(norm_type, kernel_size, stride = NULL, ceil_mode = FALSE)
}
\argument... | /man/nn_lp_pool1d.Rd | permissive | mlverse/torch | R | false | true | 1,508 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nn-pooling.R
\name{nn_lp_pool1d}
\alias{nn_lp_pool1d}
\title{Applies a 1D power-average pooling over an input signal composed of several input
planes.}
\usage{
nn_lp_pool1d(norm_type, kernel_size, stride = NULL, ceil_mode = FALSE)
}
\argument... |
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/Normal_sym_trunc_ab.R
\name{Normal_sym_trunc_ab}
\alias{Normal_sym_trunc_ab}
\alias{dNormal_sym_trunc_ab}
\alias{eNormal_sym_trunc_ab}
\alias{lNormal_sym_trunc_ab}
\alias{pNormal_sym_trunc_ab}
\alias{qNormal_sym_trunc_ab}
\al... | /man/Normal_sym_trunc_ab.Rd | no_license | palash6347/ExtDist | R | false | false | 2,512 | rd | % Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/Normal_sym_trunc_ab.R
\name{Normal_sym_trunc_ab}
\alias{Normal_sym_trunc_ab}
\alias{dNormal_sym_trunc_ab}
\alias{eNormal_sym_trunc_ab}
\alias{lNormal_sym_trunc_ab}
\alias{pNormal_sym_trunc_ab}
\alias{qNormal_sym_trunc_ab}
\al... |
mort_risk<- function(x,nn,p)
{# FUNCTION THAT RETURNS THE PROBABILITY OF
# A MORTALITY GIVEN THE NUMBER OF FISH IN
# THE TRANSPORT AND PREDICTED MORTALITY PROBABILITY
x<-1-pbinom(0,x[nn],prob=x[p])
return(x)
}
optimal<- function(mortWght=0.5,maxDens=200,maxEffort=200,location="Dexter Dam")
{
ms<- tables(... | /analysis/_R/2_functions.R | no_license | mcolvin/Transport-Mortality | R | false | false | 8,961 | r | mort_risk<- function(x,nn,p)
{# FUNCTION THAT RETURNS THE PROBABILITY OF
# A MORTALITY GIVEN THE NUMBER OF FISH IN
# THE TRANSPORT AND PREDICTED MORTALITY PROBABILITY
x<-1-pbinom(0,x[nn],prob=x[p])
return(x)
}
optimal<- function(mortWght=0.5,maxDens=200,maxEffort=200,location="Dexter Dam")
{
ms<- tables(... |
#----------------------------------------------------------------------------
## Copyright (c) 2012 University of Illinois, NCSA.
## All rights reserved. This program and the accompanying materials
## are made available under the terms of the
## University of Illinois/NCSA Open Source License
## which accompanies thi... | /settings/tests/testthat/test.read.settings.R | permissive | Viskari/pecan | R | false | false | 7,474 | r | #----------------------------------------------------------------------------
## Copyright (c) 2012 University of Illinois, NCSA.
## All rights reserved. This program and the accompanying materials
## are made available under the terms of the
## University of Illinois/NCSA Open Source License
## which accompanies thi... |
\docType{package}
\name{rWBclimate}
\alias{rWBclimate}
\alias{rWBclimate-package}
\title{rWBclimate}
\description{
rWBclimate
}
| /man/rWBclimate.Rd | no_license | dongh11/rWBclimate | R | false | false | 131 | rd | \docType{package}
\name{rWBclimate}
\alias{rWBclimate}
\alias{rWBclimate-package}
\title{rWBclimate}
\description{
rWBclimate
}
|
c DCNF-Autarky [version 0.0.1].
c Copyright (c) 2018-2019 Swansea University.
c
c Input Clause Count: 3424
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 3416
c
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 3416
c
c Input Parameter (command line, fil... | /code/dcnf-ankit-optimized/Results/QBFLIB-2018/E1/Experiments/Wintersteiger/RankingFunctions/rankfunc40_signed_32/rankfunc40_signed_32.R | no_license | arey0pushpa/dcnf-autarky | R | false | false | 783 | r | c DCNF-Autarky [version 0.0.1].
c Copyright (c) 2018-2019 Swansea University.
c
c Input Clause Count: 3424
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 3416
c
c Performing E1-Autarky iteration.
c Remaining clauses count after E-Reduction: 3416
c
c Input Parameter (command line, fil... |
world.cities$country.etc[world.cities$name == "berane"] <- "montenegro"
world.cities$country.etc[world.cities$name == "podgorica"] <- "montenegro"
world.cities$country.etc[world.cities$name == "niksic"] <- "montenegro"
world.cities$country.etc[world.cities$name == "pljevlja"] <- "montenegro"
world.cities$country.etc[wo... | /SmallScripts/CountryCleaninginCitySet.R | no_license | Leonardo2011/UrbanTerror | R | false | false | 6,421 | r | world.cities$country.etc[world.cities$name == "berane"] <- "montenegro"
world.cities$country.etc[world.cities$name == "podgorica"] <- "montenegro"
world.cities$country.etc[world.cities$name == "niksic"] <- "montenegro"
world.cities$country.etc[world.cities$name == "pljevlja"] <- "montenegro"
world.cities$country.etc[wo... |
rm(list=ls())
# setwd("~/Dropbox/FamosHydroModel/lowDim/")
setwd("/glade/u/home/sanjib/FamosHydroModel/lowDim/")
# Load data
load("output/modelRuns_projection.RData")
# process output
modelRuns<-matrix(NA,nrow=length(outputMat[1,]), ncol=length(unlist(outputMat[1,1])))
for(k in 1:length(outputMat[1,])){
modelRuns[k,]... | /lowDim/run/F_emulationProjection.R | no_license | benee55/SharmaEtAl22 | R | false | false | 1,205 | r | rm(list=ls())
# setwd("~/Dropbox/FamosHydroModel/lowDim/")
setwd("/glade/u/home/sanjib/FamosHydroModel/lowDim/")
# Load data
load("output/modelRuns_projection.RData")
# process output
modelRuns<-matrix(NA,nrow=length(outputMat[1,]), ncol=length(unlist(outputMat[1,1])))
for(k in 1:length(outputMat[1,])){
modelRuns[k,]... |
library(prefmod)
### Name: carconf
### Title: Data (partial rankings): Car Configurator
### Aliases: carconf
### Keywords: datasets
### ** Examples
head(carconf)
| /data/genthat_extracted_code/prefmod/examples/carconf.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 167 | r | library(prefmod)
### Name: carconf
### Title: Data (partial rankings): Car Configurator
### Aliases: carconf
### Keywords: datasets
### ** Examples
head(carconf)
|
library(googleVis)
### Name: renderGvis
### Title: renderGvis
### Aliases: renderGvis
### Keywords: shiny
### ** Examples
## Not run:
##D # To run this example:
##D shiny::runApp(system.file("shiny/", package="googleVis"))
##D # server.R
##D library(googleVis)
##D
##D shinyServer(function(input, output) {
##D ... | /data/genthat_extracted_code/googleVis/examples/renderGvis.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 967 | r | library(googleVis)
### Name: renderGvis
### Title: renderGvis
### Aliases: renderGvis
### Keywords: shiny
### ** Examples
## Not run:
##D # To run this example:
##D shiny::runApp(system.file("shiny/", package="googleVis"))
##D # server.R
##D library(googleVis)
##D
##D shinyServer(function(input, output) {
##D ... |
usePackage <- function(p)
{
if (!is.element(p, installed.packages()[,1]))
install.packages(p, dep = TRUE)
require(p, character.only = TRUE)
}
usePackage("WGCNA")
usePackage("openxlsx")
usePackage("readxl")
usePackage("flashClust")
usePackage("cluster")
usePackage("affy")
library(WGCNA)
library(openxlsx)
libra... | /R/exonID-mapto-geneID.R | permissive | teslajoy/hnscc-macOS | R | false | false | 5,150 | r | usePackage <- function(p)
{
if (!is.element(p, installed.packages()[,1]))
install.packages(p, dep = TRUE)
require(p, character.only = TRUE)
}
usePackage("WGCNA")
usePackage("openxlsx")
usePackage("readxl")
usePackage("flashClust")
usePackage("cluster")
usePackage("affy")
library(WGCNA)
library(openxlsx)
libra... |
get.fingerprint <- function(molecule, type = 'standard', fp.mode = 'bit', depth=6, size=1024, cfp_type=4, verbose=FALSE) {
if (is.null(attr(molecule, 'jclass'))) stop("Must supply an IAtomContainer or something coercable to it")
if (attr(molecule, "jclass") != "org/openscience/cdk/interfaces/IAtomContainer") {
... | /rcdk/R/fingerprint.R | no_license | paulboardman/cdkr | R | false | false | 4,487 | r | get.fingerprint <- function(molecule, type = 'standard', fp.mode = 'bit', depth=6, size=1024, cfp_type=4, verbose=FALSE) {
if (is.null(attr(molecule, 'jclass'))) stop("Must supply an IAtomContainer or something coercable to it")
if (attr(molecule, "jclass") != "org/openscience/cdk/interfaces/IAtomContainer") {
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/errorDistributions.R
\name{normalErrParm}
\alias{normalErrParm}
\title{normalErrParm}
\usage{
normalErrParm(..., sdLower = 0.5, sdUpper = 7)
}
\description{
Draw a random standard deviation for \code{normalErr}
}
| /man/normalErrParm.Rd | no_license | jlstiles/haltmle.sim | R | false | true | 291 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/errorDistributions.R
\name{normalErrParm}
\alias{normalErrParm}
\title{normalErrParm}
\usage{
normalErrParm(..., sdLower = 0.5, sdUpper = 7)
}
\description{
Draw a random standard deviation for \code{normalErr}
}
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/enrich_name_match.R
\name{GetMapTable}
\alias{GetMapTable}
\title{Get mapping table}
\usage{
GetMapTable(mSetObj = NA)
}
\arguments{
\item{mSetObj}{Input the name of the created mSetObj (see InitDataObjects)}
}
\description{
Return results fr... | /man/GetMapTable.Rd | permissive | xia-lab/MetaboAnalystR | R | false | true | 358 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/enrich_name_match.R
\name{GetMapTable}
\alias{GetMapTable}
\title{Get mapping table}
\usage{
GetMapTable(mSetObj = NA)
}
\arguments{
\item{mSetObj}{Input the name of the created mSetObj (see InitDataObjects)}
}
\description{
Return results fr... |
#' Sampler of the matrix variate confluent hypergometric kind one distribution
#'
#' Samples the matrix variate confluent hypergometric kind one distribution.
#'
#' @param n sample size, a positive integer
#' @param nu shape parameter, a positive number; if \code{nu < (p-1)/2},
#' where \code{p} is the dimension ... | /R/CHkindone.R | no_license | cran/matrixsampling | R | false | false | 2,826 | r | #' Sampler of the matrix variate confluent hypergometric kind one distribution
#'
#' Samples the matrix variate confluent hypergometric kind one distribution.
#'
#' @param n sample size, a positive integer
#' @param nu shape parameter, a positive number; if \code{nu < (p-1)/2},
#' where \code{p} is the dimension ... |
#' @rdname mlb_game_pace
#' @title **Retrieve game pace metrics for major and minor league**
#' @param season Year for which to return information (*Required*).
#' @param team_ids The team_id(s) for which to return information.
#' @param league_ids The league_id(s) for which to return information.
#' @param sport_ids T... | /R/mlb_game_pace.R | permissive | darh78/baseballr | R | false | false | 5,969 | r | #' @rdname mlb_game_pace
#' @title **Retrieve game pace metrics for major and minor league**
#' @param season Year for which to return information (*Required*).
#' @param team_ids The team_id(s) for which to return information.
#' @param league_ids The league_id(s) for which to return information.
#' @param sport_ids T... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/eth.R
\name{eth_sendTransaction}
\alias{eth_sendTransaction}
\title{New transaction}
\usage{
eth_sendTransaction(from, data = -1, to = -1, gas = 90000,
gas_price = -1, value = -1, nonce = -1)
}
\arguments{
\item{from}{Address - Ad... | /man/eth_sendTransaction.Rd | no_license | cran/gethr | R | false | true | 3,139 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/eth.R
\name{eth_sendTransaction}
\alias{eth_sendTransaction}
\title{New transaction}
\usage{
eth_sendTransaction(from, data = -1, to = -1, gas = 90000,
gas_price = -1, value = -1, nonce = -1)
}
\arguments{
\item{from}{Address - Ad... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sgdWt_convexLinCom.R
\name{sgdWt_convexLinCom}
\alias{sgdWt_convexLinCom}
\title{Perform first order stochastic gradient descent update of super learner
weights}
\usage{
sgdWt_convexLinCom(Y, slFit.t, p.t, tplus1, stepSize = NULL)
}
\argumen... | /man/sgdWt_convexLinCom.Rd | no_license | benkeser/onlinesl | R | false | true | 1,100 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sgdWt_convexLinCom.R
\name{sgdWt_convexLinCom}
\alias{sgdWt_convexLinCom}
\title{Perform first order stochastic gradient descent update of super learner
weights}
\usage{
sgdWt_convexLinCom(Y, slFit.t, p.t, tplus1, stepSize = NULL)
}
\argumen... |
make.overview.map.plot <- function(path){
oldpar <- par()
## California coast
CA <- matrix(c(-124.1829, 42.00354,
-123.2375, 42.00927,
-122.3036, 42.00927,
-120.0060, 42.00927,
-119.9946, 38.98978,
-119.8685, 38.90956,
... | /R/figures-overview-map.R | no_license | andrew-edwards/hake-assessment | R | false | false | 16,408 | r | make.overview.map.plot <- function(path){
oldpar <- par()
## California coast
CA <- matrix(c(-124.1829, 42.00354,
-123.2375, 42.00927,
-122.3036, 42.00927,
-120.0060, 42.00927,
-119.9946, 38.98978,
-119.8685, 38.90956,
... |
library(ape)
testtree <- read.tree("3982_20.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="3982_20_unrooted.txt") | /codeml_files/newick_trees_processed/3982_20/rinput.R | no_license | DaniBoo/cyanobacteria_project | R | false | false | 137 | r | library(ape)
testtree <- read.tree("3982_20.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="3982_20_unrooted.txt") |
#' Environment of loaded modules
#'
#' Each module is stored as an environment inside \code{.loaded_modules} with
#' the module’s code location path as its identifier. The path rather than the
#' module name is used because module names are not unique: two modules called
#' \code{a} can exist nested inside modules \cod... | /R/module_cache.r | permissive | gitter-badger/modules | R | false | false | 3,712 | r | #' Environment of loaded modules
#'
#' Each module is stored as an environment inside \code{.loaded_modules} with
#' the module’s code location path as its identifier. The path rather than the
#' module name is used because module names are not unique: two modules called
#' \code{a} can exist nested inside modules \cod... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Class-LociMap.R
\docType{class}
\name{TraitAE-class}
\alias{TraitAE-class}
\title{Additive and epistatic trait}
\description{
Extends \code{\link{TraitA-class}}
to add epistasis
}
\section{Slots}{
\describe{
\item{\code{epiEff}}... | /man/TraitAE-class.Rd | no_license | cran/AlphaSimR | R | false | true | 347 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Class-LociMap.R
\docType{class}
\name{TraitAE-class}
\alias{TraitAE-class}
\title{Additive and epistatic trait}
\description{
Extends \code{\link{TraitA-class}}
to add epistasis
}
\section{Slots}{
\describe{
\item{\code{epiEff}}... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gscp_12_write_network_to_marxan_files.R
\name{compute_marxan_species_penalty_factor}
\alias{compute_marxan_species_penalty_factor}
\title{Compute marxan species penalty factor}
\usage{
compute_marxan_species_penalty_factor(spf_rule_to_use, nu... | /man/compute_marxan_species_penalty_factor.Rd | no_license | langfob/bdpg | R | false | true | 3,573 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gscp_12_write_network_to_marxan_files.R
\name{compute_marxan_species_penalty_factor}
\alias{compute_marxan_species_penalty_factor}
\title{Compute marxan species penalty factor}
\usage{
compute_marxan_species_penalty_factor(spf_rule_to_use, nu... |
# bcdc_query_geodata ------------------------------------------------------
bcdc_query_geodata("municipalities-legally-defined-administrative-areas-of-bc")
# select ------------------------------------------------------------------
bcdc_query_geodata("municipalities-legally-defined-administrative-areas-of-bc") %>... | /2020-03-26_bcdata_lunch_and_learn/bcdata-code-break.R | permissive | bcgov/bcgov-rstats-public-presentations | R | false | false | 1,031 | r |
# bcdc_query_geodata ------------------------------------------------------
bcdc_query_geodata("municipalities-legally-defined-administrative-areas-of-bc")
# select ------------------------------------------------------------------
bcdc_query_geodata("municipalities-legally-defined-administrative-areas-of-bc") %>... |
# analyze
library(tidyverse)
tmp <- dirr::get_rds("data/tidy")
analyze_patients <- select(data_demographics, pie.id, age, sex, length.stay) %>%
inner_join(data_groups, by = "pie.id") %>%
inner_join(data_measures, by = "pie.id") %>%
inner_join(data_primary_diagnosis[c("pie.id", "diag.code", "icd.descripti... | /src/4-analyze.R | no_license | maxprofs-llcio/albuterol_continuous | R | false | false | 985 | r | # analyze
library(tidyverse)
tmp <- dirr::get_rds("data/tidy")
analyze_patients <- select(data_demographics, pie.id, age, sex, length.stay) %>%
inner_join(data_groups, by = "pie.id") %>%
inner_join(data_measures, by = "pie.id") %>%
inner_join(data_primary_diagnosis[c("pie.id", "diag.code", "icd.descripti... |
NewPost = function(title) {
r = httr::POST("http://slugify.net/get-slug", body = list(string = title))
slug = httr::content(r, as = "text")
rmarkdown::draft("_source/" %+% Sys.Date() %+% "-" %+% slug, "_templates/post", create_dir = F, edit = T)
}
| /_rscripts/newpost.R | permissive | DariusTG/dariustg.github.io | R | false | false | 261 | r | NewPost = function(title) {
r = httr::POST("http://slugify.net/get-slug", body = list(string = title))
slug = httr::content(r, as = "text")
rmarkdown::draft("_source/" %+% Sys.Date() %+% "-" %+% slug, "_templates/post", create_dir = F, edit = T)
}
|
# read the input household power consumption data
# assumes that the pwd is exploratoryAnalysis folder
data <- read.table("./exdata-data-household_power_consumption/household_power_consumption.txt",header = TRUE,sep = ";",na.strings = "?",stringsAsFactors = FALSE)
# subset only power consumption data for dates 1/2... | /plot1.R | no_license | ashokkumarj/ExData_Plotting1 | R | false | false | 1,042 | r |
# read the input household power consumption data
# assumes that the pwd is exploratoryAnalysis folder
data <- read.table("./exdata-data-household_power_consumption/household_power_consumption.txt",header = TRUE,sep = ";",na.strings = "?",stringsAsFactors = FALSE)
# subset only power consumption data for dates 1/2... |
ttest.func <-
function(x,y,s0=0, s=NULL){
n1 <- sum(y==1)
n2 <- sum(y==2)
p <- nrow(x)
m1 <- rowMeans(x[,y==1,drop=F])
m2 <- rowMeans(x[,y==2,drop=F])
if(is.null(s)){
s <- sqrt( ((n2-1) * varr(x[, y==2], meanx=m2) + (n1-1) * varr(x[, y==1], meanx=m1) )*(1/n1+1/n2)/(n1+n2-2) )
}
numer <- m... | /R/ttest.func.R | no_license | cran/DRI | R | false | false | 412 | r | ttest.func <-
function(x,y,s0=0, s=NULL){
n1 <- sum(y==1)
n2 <- sum(y==2)
p <- nrow(x)
m1 <- rowMeans(x[,y==1,drop=F])
m2 <- rowMeans(x[,y==2,drop=F])
if(is.null(s)){
s <- sqrt( ((n2-1) * varr(x[, y==2], meanx=m2) + (n1-1) * varr(x[, y==1], meanx=m1) )*(1/n1+1/n2)/(n1+n2-2) )
}
numer <- m... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/merList.R
\name{modelRandEffStats}
\alias{modelRandEffStats}
\title{Extract data.frame of random effect statistics from merMod List}
\usage{
modelRandEffStats(modList)
}
\arguments{
\item{modList}{a list of multilevel models}
}
\value{
a data... | /man/modelRandEffStats.Rd | no_license | jamesonquinn/merTools | R | false | true | 410 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/merList.R
\name{modelRandEffStats}
\alias{modelRandEffStats}
\title{Extract data.frame of random effect statistics from merMod List}
\usage{
modelRandEffStats(modList)
}
\arguments{
\item{modList}{a list of multilevel models}
}
\value{
a data... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/global.R
\name{global}
\alias{global}
\title{Global}
\description{
Declare global variables
}
| /man/global.Rd | no_license | giopogg/webSDM | R | false | true | 172 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/global.R
\name{global}
\alias{global}
\title{Global}
\description{
Declare global variables
}
|
library(caret)
library(tidyr)
library(plyr)
library(dplyr)
library(caTools)
library(reshape2)
library(gbm)
library(caTools)
library(randomForest)
library(ggplot2)
library(data.table)
library(xgboost)
library(Matrix)
library(lightgbm)
library(TeachingDemos)
library(Hmisc)
library(DMwR)
library(e1071)
library(glmnet)
li... | /EmployeeAttrition_Improved_LGBM_ValMatrix_Reg.R | no_license | abhinavnew/EmployeeAttProperties | R | false | false | 13,455 | r |
library(caret)
library(tidyr)
library(plyr)
library(dplyr)
library(caTools)
library(reshape2)
library(gbm)
library(caTools)
library(randomForest)
library(ggplot2)
library(data.table)
library(xgboost)
library(Matrix)
library(lightgbm)
library(TeachingDemos)
library(Hmisc)
library(DMwR)
library(e1071)
library(glmnet)
li... |
library('vtreat')
context("Weights")
test_that("testZW: Test Zero Weights Don't Crash", {
# categorical example
dTrainC <- data.frame(x=c('a','a','a','b','b',NA),
z=c(1,2,3,4,NA,6),y=c(FALSE,FALSE,TRUE,FALSE,TRUE,TRUE))
dTrainC <- rbind(dTrainC,dTrainC)
trainCWeights <- numeric(nrow(dT... | /vtreat/tests/testthat/testZW.R | no_license | ingted/R-Examples | R | false | false | 1,965 | r | library('vtreat')
context("Weights")
test_that("testZW: Test Zero Weights Don't Crash", {
# categorical example
dTrainC <- data.frame(x=c('a','a','a','b','b',NA),
z=c(1,2,3,4,NA,6),y=c(FALSE,FALSE,TRUE,FALSE,TRUE,TRUE))
dTrainC <- rbind(dTrainC,dTrainC)
trainCWeights <- numeric(nrow(dT... |
# source("./referenceObjects/targetMeasures.R")
# source("./referenceObjects/targetUnnormalisedDensities.R")
# source("./referenceObjects/targetLiangDensities.R")
# source("./referenceObjects/targetMatteoDensities.R")
# source("./referenceObjects/stateSpace.R")
# source("./referenceObjects/realStateSpace.R")
# source("... | /simulations/simulations.R | no_license | MatteoLacki/Parallel_Tempering | R | false | false | 9,476 | r | # source("./referenceObjects/targetMeasures.R")
# source("./referenceObjects/targetUnnormalisedDensities.R")
# source("./referenceObjects/targetLiangDensities.R")
# source("./referenceObjects/targetMatteoDensities.R")
# source("./referenceObjects/stateSpace.R")
# source("./referenceObjects/realStateSpace.R")
# source("... |
file_url<-'https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip'
#destination of data in a zip folder
download.file(file_url,'data.zip')
#downloads data and renames the zip folder to data
unzip('data.zip',list=TRUE)
#unzips data folder
newdir<-paste0(getwd(),'/','data/UCI HAR Dat... | /run_analysis.R | no_license | mdoster443/Getting_and_cleaning_data_programming_assignment | R | false | false | 9,682 | r | file_url<-'https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip'
#destination of data in a zip folder
download.file(file_url,'data.zip')
#downloads data and renames the zip folder to data
unzip('data.zip',list=TRUE)
#unzips data folder
newdir<-paste0(getwd(),'/','data/UCI HAR Dat... |
# GAUSSIAN PROCESS FUNCTIONS
update_b <- function(m, p, sigmas, zetas) {
return(ifelse(runif(m) > p, p / sigmas[zetas], -(1-p) / sigmas[zetas]))
}
update_f <- function(Y, M_X, K_XX, lambda, b) {
f <- rtmvnorm(
n = 1,
mean = as.vector(M_X + (lambda * K_XX) %*% b),
sigma = lambda * K_XX,
lower = ife... | /R/gaussian_process.R | no_license | opardo/GPDPQuantReg | R | false | false | 1,116 | r | # GAUSSIAN PROCESS FUNCTIONS
update_b <- function(m, p, sigmas, zetas) {
return(ifelse(runif(m) > p, p / sigmas[zetas], -(1-p) / sigmas[zetas]))
}
update_f <- function(Y, M_X, K_XX, lambda, b) {
f <- rtmvnorm(
n = 1,
mean = as.vector(M_X + (lambda * K_XX) %*% b),
sigma = lambda * K_XX,
lower = ife... |
## This script creates png plot of household global minute-averaged active power time dependence
## Data file 'household_power_consumption.txt' should be in current R directory
## Reading all data
data = read.table(file = 'household_power_consumption.txt', header = TRUE, sep = ';', colClasses = "character")
## Adding... | /plot2.R | no_license | belgraviton/ExData_Plotting1 | R | false | false | 1,079 | r | ## This script creates png plot of household global minute-averaged active power time dependence
## Data file 'household_power_consumption.txt' should be in current R directory
## Reading all data
data = read.table(file = 'household_power_consumption.txt', header = TRUE, sep = ';', colClasses = "character")
## Adding... |
% From SamplerCompare, (c) 2010 Madeleine Thompson
\name{make.cone.dist}
\alias{make.cone.dist}
\title{Create a cone distribution object}
\description{Create a cone distribution object as defined by Roberts
and Rosenthal}
\usage{make.cone.dist(ndim)}
\arguments{
\item{ndim}{The dimension of the distribution's... | /man/make.cone.dist.Rd | no_license | cran/SamplerCompare | R | false | false | 974 | rd | % From SamplerCompare, (c) 2010 Madeleine Thompson
\name{make.cone.dist}
\alias{make.cone.dist}
\title{Create a cone distribution object}
\description{Create a cone distribution object as defined by Roberts
and Rosenthal}
\usage{make.cone.dist(ndim)}
\arguments{
\item{ndim}{The dimension of the distribution's... |
library(rotl)
### Name: taxonomy_about
### Title: Information about the Open Tree Taxonomy
### Aliases: taxonomy_about
### ** Examples
## Not run:
##D taxonomy_about()
## End(Not run)
| /data/genthat_extracted_code/rotl/examples/taxonomy_about.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 192 | r | library(rotl)
### Name: taxonomy_about
### Title: Information about the Open Tree Taxonomy
### Aliases: taxonomy_about
### ** Examples
## Not run:
##D taxonomy_about()
## End(Not run)
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ses_operations.R
\name{ses_describe_receipt_rule}
\alias{ses_describe_receipt_rule}
\title{Returns the details of the specified receipt rule}
\usage{
ses_describe_receipt_rule(RuleSetName, RuleName)
}
\arguments{
\item{RuleSetName}{[required]... | /cran/paws.customer.engagement/man/ses_describe_receipt_rule.Rd | permissive | TWarczak/paws | R | false | true | 2,309 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ses_operations.R
\name{ses_describe_receipt_rule}
\alias{ses_describe_receipt_rule}
\title{Returns the details of the specified receipt rule}
\usage{
ses_describe_receipt_rule(RuleSetName, RuleName)
}
\arguments{
\item{RuleSetName}{[required]... |
testlist <- list(AgeVector = c(-4.73074171454048e-167, 2.2262381097027e-76, -9.12990429452974e-204, 5.97087417427845e-79, 4.7390525269307e-300, 6.58361441690132e-121, 3.58611068565168e-154, -2.94504776827523e-186, 2.62380314702636e-116, -6.78950518864266e+23, 6.99695749856012e-167, 86485.676793021, 1.11271562183704... | /myTAI/inst/testfiles/cpp_bootMatrix/AFL_cpp_bootMatrix/cpp_bootMatrix_valgrind_files/1615767979-test.R | no_license | akhikolla/updatedatatype-list3 | R | false | false | 1,803 | r | testlist <- list(AgeVector = c(-4.73074171454048e-167, 2.2262381097027e-76, -9.12990429452974e-204, 5.97087417427845e-79, 4.7390525269307e-300, 6.58361441690132e-121, 3.58611068565168e-154, -2.94504776827523e-186, 2.62380314702636e-116, -6.78950518864266e+23, 6.99695749856012e-167, 86485.676793021, 1.11271562183704... |
context("Error messages")
test_that("error messages", {
expect_error(
prior("uniform", 0),
"You must specify `min` and `max` for a uniform prior"
)
expect_error(
prior("normal", 0),
"You must specify `mean` and `sd` for a normal prior"
)
expect_warning(
prior("point"),
"Point value... | /tests/testthat/test-error_messages.R | permissive | ljcolling/bayesplay | R | false | false | 3,104 | r | context("Error messages")
test_that("error messages", {
expect_error(
prior("uniform", 0),
"You must specify `min` and `max` for a uniform prior"
)
expect_error(
prior("normal", 0),
"You must specify `mean` and `sd` for a normal prior"
)
expect_warning(
prior("point"),
"Point value... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/getShrinkedDispersions.R
\name{getShrinkedDispersions}
\alias{getShrinkedDispersions}
\title{Estimate Shrinked Overdispersions}
\usage{
getShrinkedDispersions(obs, shrinkTarget = NULL, delta = NULL)
}
\arguments{
\item{obs}{a numeric vector. ... | /man/getShrinkedDispersions.Rd | no_license | cran/NBLDA | R | false | true | 2,178 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/getShrinkedDispersions.R
\name{getShrinkedDispersions}
\alias{getShrinkedDispersions}
\title{Estimate Shrinked Overdispersions}
\usage{
getShrinkedDispersions(obs, shrinkTarget = NULL, delta = NULL)
}
\arguments{
\item{obs}{a numeric vector. ... |
library("spdep")
library("splm")
library("graphics")
library("numDeriv")
library("R.matlab")
rm(list=ls())
##################################################
rho<-0.5
r1 <- 6
c1 <- 4
n <- r1*c1
T <- 4
N <- n*T
m <- n*(T-1)
###### initialize parameters ######
beta <- 0
lambda <- 0.2
la... | /MC/Test_Nuisance/TestNuisance_Queen.R | no_license | ChaonanJiang/Sadd_Panel | R | false | false | 30,123 | r | library("spdep")
library("splm")
library("graphics")
library("numDeriv")
library("R.matlab")
rm(list=ls())
##################################################
rho<-0.5
r1 <- 6
c1 <- 4
n <- r1*c1
T <- 4
N <- n*T
m <- n*(T-1)
###### initialize parameters ######
beta <- 0
lambda <- 0.2
la... |
testlist <- list(A = structure(c(1.84397810628254e+169, 2.72584360242658e+197, 7.82108268643149e+272, 2.48556416753372e-31, 4.75430326651066e+58, 358636.261094578, 2.61892509003869e-253, 3.37612779625928e+103, 1.14981129990444e+253, 1.16806273601244e-205, 2.25642385438364e+140, 7.03906443040557e-208, 3.818500865241... | /issuestests/expperm/inst/testfiles/BG_cpp/BG_cpp_output/log_b26ec952ca1efa01a363bb26d623a6768d446963/BG_cpp-test.R | no_license | akhikolla/RcppDeepStateTest | R | false | false | 1,708 | r | testlist <- list(A = structure(c(1.84397810628254e+169, 2.72584360242658e+197, 7.82108268643149e+272, 2.48556416753372e-31, 4.75430326651066e+58, 358636.261094578, 2.61892509003869e-253, 3.37612779625928e+103, 1.14981129990444e+253, 1.16806273601244e-205, 2.25642385438364e+140, 7.03906443040557e-208, 3.818500865241... |
#' Create a train and test split of the novels dataset
#' @param data a data frame of literary texts in "Stonybrook" format
#' @param split specify a split ratio (default = .8)
#' @export
createSplit <- function(data, split = .8) {
stopifnot('data.frame' %in% class(data) && 'author' %in% names(data))
all_ids <- uni... | /R/createSplit.R | no_license | John-Poplett/novels | R | false | false | 885 | r | #' Create a train and test split of the novels dataset
#' @param data a data frame of literary texts in "Stonybrook" format
#' @param split specify a split ratio (default = .8)
#' @export
createSplit <- function(data, split = .8) {
stopifnot('data.frame' %in% class(data) && 'author' %in% names(data))
all_ids <- uni... |
# where your experiment is hosted
# substituting slashes, tildes, etc. with periods
experigen.sourceURL = "www.awesomeuniversity.edu.iamawesome.questionnaire"
# this information comes from your settings.js file
experigen.experimentName = "Default"
experigen.database = "http://db.phonologist.org/"
# check for usage of... | /getresults.R | no_license | FieldDB/experigen | R | false | false | 1,365 | r | # where your experiment is hosted
# substituting slashes, tildes, etc. with periods
experigen.sourceURL = "www.awesomeuniversity.edu.iamawesome.questionnaire"
# this information comes from your settings.js file
experigen.experimentName = "Default"
experigen.database = "http://db.phonologist.org/"
# check for usage of... |
supall=read.table(file="../data/supall.tab",sep="\t",header=FALSE)
supdrg=read.table(file="../data/supdrg.tab",sep="\t",header=FALSE)
names(supall)=c("state","spec","state_supply","state_cost")
names(supdrg)=c("state","spec","drg","supply","cost")
### Calculat Z-scores ###
all=merge(supdrg,supall,by=c("state","spec"... | /scripts/analysis.r | no_license | jpbida/partD | R | false | false | 5,059 | r | supall=read.table(file="../data/supall.tab",sep="\t",header=FALSE)
supdrg=read.table(file="../data/supdrg.tab",sep="\t",header=FALSE)
names(supall)=c("state","spec","state_supply","state_cost")
names(supdrg)=c("state","spec","drg","supply","cost")
### Calculat Z-scores ###
all=merge(supdrg,supall,by=c("state","spec"... |
## make a closure that can cache a matrix's inverse, assume x is an invertible matrix
makeCacheMatrix <- function(x = matrix()) {
inverse <- NULL
set <- function(y) {
x <<- y
inverse <<- NULL
}
get <- function() x
setinverse <- function(i) inverse <<- i
getinverse <- function() inverse
list(set = ... | /cachematrix.R | no_license | lonegunmanb/ProgrammingAssignment2 | R | false | false | 820 | r | ## make a closure that can cache a matrix's inverse, assume x is an invertible matrix
makeCacheMatrix <- function(x = matrix()) {
inverse <- NULL
set <- function(y) {
x <<- y
inverse <<- NULL
}
get <- function() x
setinverse <- function(i) inverse <<- i
getinverse <- function() inverse
list(set = ... |
#' @export
#' @importFrom stats setNames
#' @rdname sptable
sptable.SpatialPolygons <- function(x, ...) {
x <- setNames(as_tibble(rasterpoly(x)),
c("object_", "part_", "branch_", "island_", "x_", "y_"))
x[["part_"]] <- NULL
x[["order_"]] <- unlist(lapply(split(x[["branch_"]], x[["branch_"]]), se... | /R/sp.R | no_license | cran/spbabel | R | false | false | 5,232 | r |
#' @export
#' @importFrom stats setNames
#' @rdname sptable
sptable.SpatialPolygons <- function(x, ...) {
x <- setNames(as_tibble(rasterpoly(x)),
c("object_", "part_", "branch_", "island_", "x_", "y_"))
x[["part_"]] <- NULL
x[["order_"]] <- unlist(lapply(split(x[["branch_"]], x[["branch_"]]), se... |
context("test-afltables.R")
test_that("get_match_results works", {
expect_type(get_match_results(), "list")
expect_error(get_match_results("a"))
})
test_that("get_afltables_urls works", {
expect_type(get_afltables_urls("2018-01-01", "2018-06-01"), "character")
expect_type(get_afltables_urls("1930-01-01", "193... | /tests/testthat/test-afltables.R | no_license | Lingtax/fitzRoy | R | false | false | 951 | r | context("test-afltables.R")
test_that("get_match_results works", {
expect_type(get_match_results(), "list")
expect_error(get_match_results("a"))
})
test_that("get_afltables_urls works", {
expect_type(get_afltables_urls("2018-01-01", "2018-06-01"), "character")
expect_type(get_afltables_urls("1930-01-01", "193... |
##########################
### importing Libraries ###
##########################
library(ggplot2)
##########################
### importing data ###
##########################
df <- read.csv("fifa18_cleanData", encoding = "UTF-8")
##############################
### 2.2.VisualizingTeams ###
###########################... | /Code/2.2.VisualizingTeams.R | no_license | shabbir12hasan/the_best_of_EA_game_fifa_18 | R | false | false | 770 | r | ##########################
### importing Libraries ###
##########################
library(ggplot2)
##########################
### importing data ###
##########################
df <- read.csv("fifa18_cleanData", encoding = "UTF-8")
##############################
### 2.2.VisualizingTeams ###
###########################... |
# Author: Robert J. Hijmans
# Date : January 2009
# Version 0.9
# Licence GPL v3
.getGDALtransient <- function(r, filename, options, NAflag, ...) {
.GDALnodatavalue <- function(x){
if (x == 'Float32') return(-3.4E38)
if (x == 'Float64') return(-1.7E308)
if (x == 'Int32') return(-2147483647)
if ... | /R/GDALtransient.R | no_license | szanardo-rms/raster | R | false | false | 3,423 | r | # Author: Robert J. Hijmans
# Date : January 2009
# Version 0.9
# Licence GPL v3
.getGDALtransient <- function(r, filename, options, NAflag, ...) {
.GDALnodatavalue <- function(x){
if (x == 'Float32') return(-3.4E38)
if (x == 'Float64') return(-1.7E308)
if (x == 'Int32') return(-2147483647)
if ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/log.euclidean.R
\name{rie.exp.spd_LogEuclidean}
\alias{rie.exp.spd_LogEuclidean}
\title{Compute the Riemannian exponential map}
\usage{
\method{rie.exp}{spd_LogEuclidean}(mfd, p, v, ...)
}
\arguments{
\item{mfd}{the manifold object created by... | /man/rie.exp.spd_LogEuclidean.Rd | no_license | linulysses/matrix-manifold | R | false | true | 635 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/log.euclidean.R
\name{rie.exp.spd_LogEuclidean}
\alias{rie.exp.spd_LogEuclidean}
\title{Compute the Riemannian exponential map}
\usage{
\method{rie.exp}{spd_LogEuclidean}(mfd, p, v, ...)
}
\arguments{
\item{mfd}{the manifold object created by... |
\name{gof.update}
\alias{gof.update}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
GOODNESS OF FIT UPDATE
}
\description{
Updates the goodness of fit statistic.
}
\usage{
gof.update(i,ret)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{i}{segments which is to b... | /fuzzedpackages/ecp/man/gof.update.Rd | no_license | akhikolla/testpackages | R | false | false | 2,012 | rd | \name{gof.update}
\alias{gof.update}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
GOODNESS OF FIT UPDATE
}
\description{
Updates the goodness of fit statistic.
}
\usage{
gof.update(i,ret)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{i}{segments which is to b... |
#' @title Testing the random replacement imputation algorithm
#'
#' @description
#' \code{\link{test_random_imp}} tests the imputation accuracy of the random replacement imputation algorithm on matrices with various missing data patterns
#'
#' @details
#' This function tests the imputation accuracy of the random replac... | /R/test_random_imp.R | no_license | cran/missCompare | R | false | false | 4,533 | r | #' @title Testing the random replacement imputation algorithm
#'
#' @description
#' \code{\link{test_random_imp}} tests the imputation accuracy of the random replacement imputation algorithm on matrices with various missing data patterns
#'
#' @details
#' This function tests the imputation accuracy of the random replac... |
\name{datagenCircle}
\alias{datagenCircle}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
The circle generating function
}
\description{
Newton's circle
}
\usage{
datagenCircle(n)
}
\arguments{
\item{n}{
The sample size
}
}
\references{
Newton, M.A. (2009),
Introducing the ... | /man/datagenCircle.Rd | no_license | benmarwick/HHG_R | R | false | false | 496 | rd | \name{datagenCircle}
\alias{datagenCircle}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
The circle generating function
}
\description{
Newton's circle
}
\usage{
datagenCircle(n)
}
\arguments{
\item{n}{
The sample size
}
}
\references{
Newton, M.A. (2009),
Introducing the ... |
require(ggplot2)
data = read.table("fort.9",col.names = c("time","CFL","drag","lift","dragf","liftf"))
l = length(data$time)
n = 2000
j = round(seq(30,l,len=min(l,n)))
data = data[j,]
CFL = qplot(time,CFL,data=data,geom="line")
t = 0.5*(min(data$time)+max(data$time))
late = subset(data,time>t)
mdrag = mean(late$drag+la... | /array/postproc/stat.R | no_license | weymouth/lotus_projects | R | false | false | 1,404 | r | require(ggplot2)
data = read.table("fort.9",col.names = c("time","CFL","drag","lift","dragf","liftf"))
l = length(data$time)
n = 2000
j = round(seq(30,l,len=min(l,n)))
data = data[j,]
CFL = qplot(time,CFL,data=data,geom="line")
t = 0.5*(min(data$time)+max(data$time))
late = subset(data,time>t)
mdrag = mean(late$drag+la... |
library(natural)
### Name: nlasso_path
### Title: Fit a linear model with natural lasso
### Aliases: nlasso_path
### ** Examples
set.seed(123)
sim <- make_sparse_model(n = 50, p = 200, alpha = 0.6, rho = 0.6, snr = 2, nsim = 1)
nl_path <- nlasso_path(x = sim$x, y = sim$y[, 1])
| /data/genthat_extracted_code/natural/examples/nlasso_path.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 285 | r | library(natural)
### Name: nlasso_path
### Title: Fit a linear model with natural lasso
### Aliases: nlasso_path
### ** Examples
set.seed(123)
sim <- make_sparse_model(n = 50, p = 200, alpha = 0.6, rho = 0.6, snr = 2, nsim = 1)
nl_path <- nlasso_path(x = sim$x, y = sim$y[, 1])
|
\name{dist.from.cov}
\alias{dist.from.cov}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{Compute a squared distance matrix from a
covariance matrix.
%% ~~function to do ... ~~
}
\description{ This computes a squared distance matrix from a covariance
matrix, or other positive semi-definite m... | /man/dist.from.cov.Rd | no_license | cran/rwc | R | false | false | 1,988 | rd | \name{dist.from.cov}
\alias{dist.from.cov}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{Compute a squared distance matrix from a
covariance matrix.
%% ~~function to do ... ~~
}
\description{ This computes a squared distance matrix from a covariance
matrix, or other positive semi-definite m... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plotting_functions.r
\name{eng_log_breaks}
\alias{eng_log_breaks}
\title{Generate a set of breaks using the 'Engineer's log scale'}
\usage{
eng_log_breaks(x)
}
\arguments{
\item{x}{A vector of numeric data}
}
\value{
breaks A set of breaks su... | /man/eng_log_breaks.Rd | no_license | rdocking/amlpmpsupport | R | false | true | 431 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plotting_functions.r
\name{eng_log_breaks}
\alias{eng_log_breaks}
\title{Generate a set of breaks using the 'Engineer's log scale'}
\usage{
eng_log_breaks(x)
}
\arguments{
\item{x}{A vector of numeric data}
}
\value{
breaks A set of breaks su... |
library(shiny)
data(galton)
shinyServer(
function(input,output) {
output$newHist <- renderPlot({
hist(galton$child, xlab='child height', col='lightblue', main='Histogram')
mu <- input$mu
lines(c(mu, mu), c(0,200), col='red', lwd=5)
mse <- mean((galton$child ... | /jhds09_dataproducts/shiny_examples/shiny_ex_image/server.R | no_license | Treasaigh/jhds | R | false | false | 451 | r | library(shiny)
data(galton)
shinyServer(
function(input,output) {
output$newHist <- renderPlot({
hist(galton$child, xlab='child height', col='lightblue', main='Histogram')
mu <- input$mu
lines(c(mu, mu), c(0,200), col='red', lwd=5)
mse <- mean((galton$child ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/occData2timeList.R
\name{occData2timeList}
\alias{occData2timeList}
\title{Converting Occurrences Data to a timeList Data Object}
\usage{
occData2timeList(occList, intervalType = "dateRange")
}
\arguments{
\item{occList}{A list where every el... | /man/occData2timeList.Rd | permissive | KlausVigo/paleotree | R | false | true | 6,995 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/occData2timeList.R
\name{occData2timeList}
\alias{occData2timeList}
\title{Converting Occurrences Data to a timeList Data Object}
\usage{
occData2timeList(occList, intervalType = "dateRange")
}
\arguments{
\item{occList}{A list where every el... |
#' Link Normalization
#'
#' A function that take a URL _charachter_ as input, and transforms it into a canonical form.
#' @param link character, the URL to Normalize.
#' @param current character, The URL of the current page source of the link.
#' @return return the simhash as a nmeric value
#' @author salim khalil
#' @... | /R/LinkNormalization.R | permissive | khmerlee/SOFTX-D-16-00090 | R | false | false | 1,290 | r | #' Link Normalization
#'
#' A function that take a URL _charachter_ as input, and transforms it into a canonical form.
#' @param link character, the URL to Normalize.
#' @param current character, The URL of the current page source of the link.
#' @return return the simhash as a nmeric value
#' @author salim khalil
#' @... |
##Assignment 2 - for peer review
## Provide functionality to allow an inverse to be calulated once for a given matrix,
## and then cached for later retrieval
## Store values in parent environment to allow them to persist across calls
## Create a list object with methods to store and retrieve a matrix passed to ... | /cachematrix.R | no_license | Adroi/ProgrammingAssignment2 | R | false | false | 1,089 | r | ##Assignment 2 - for peer review
## Provide functionality to allow an inverse to be calulated once for a given matrix,
## and then cached for later retrieval
## Store values in parent environment to allow them to persist across calls
## Create a list object with methods to store and retrieve a matrix passed to ... |
#' @title FUNCTION_TITLE
#' @description FUNCTION_DESCRIPTION
#' @param xy PARAM_DESCRIPTION
#' @param i PARAM_DESCRIPTION
#' @param id PARAM_DESCRIPTION, Default: 1
#' @param ss PARAM_DESCRIPTION
#' @param target_ss PARAM_DESCRIPTION
#' @param min_in_bin PARAM_DESCRIPTION. Default: 5
#' @param rand PARAM_DESCRIPTION. ... | /mbg/mbg_core_code/mbg_central/LBDCore/R/quad2.R | no_license | The-Oxford-GBD-group/typhi_paratyphi_modelling_code | R | false | false | 1,284 | r | #' @title FUNCTION_TITLE
#' @description FUNCTION_DESCRIPTION
#' @param xy PARAM_DESCRIPTION
#' @param i PARAM_DESCRIPTION
#' @param id PARAM_DESCRIPTION, Default: 1
#' @param ss PARAM_DESCRIPTION
#' @param target_ss PARAM_DESCRIPTION
#' @param min_in_bin PARAM_DESCRIPTION. Default: 5
#' @param rand PARAM_DESCRIPTION. ... |
urlTblCols <- c("analystId", "siteTableId", "positionId", "startPage","endPage","stepPage",
"urlPeriod", "urlData", "nameCol", "whichTable", "playerLinkString", "siteUrl")
urlParameters <- c("{$WeekNo}", "{$Season}", "{$Segment}", "{$PgeID}", "{$YahooLeague}", "{$FFNKEY}", "{$SrcID}", "{$Pos}")
shar... | /R Package/ffanalytics/R/internalConstants.R | no_license | rajmohan27197/FantasyFootballAnalyticsR | R | false | false | 1,539 | r | urlTblCols <- c("analystId", "siteTableId", "positionId", "startPage","endPage","stepPage",
"urlPeriod", "urlData", "nameCol", "whichTable", "playerLinkString", "siteUrl")
urlParameters <- c("{$WeekNo}", "{$Season}", "{$Segment}", "{$PgeID}", "{$YahooLeague}", "{$FFNKEY}", "{$SrcID}", "{$Pos}")
shar... |
data <- read.table("household_power_consumption.txt", na.strings = c("?"), sep=";",header=TRUE)
# Subsetting by Date
data <- subset(data, data$Date %in% c("1/2/2007", "2/2/2007"))
# String to POSIXct
data$wDays <- strptime(paste(data$Date, data$Time), format='%d/%m/%Y %H:%M:%S')
data<-na.omit(data)
#Plot 4
png(filen... | /plot4.r | no_license | kostask777/ExData_Plotting1 | R | false | false | 949 | r | data <- read.table("household_power_consumption.txt", na.strings = c("?"), sep=";",header=TRUE)
# Subsetting by Date
data <- subset(data, data$Date %in% c("1/2/2007", "2/2/2007"))
# String to POSIXct
data$wDays <- strptime(paste(data$Date, data$Time), format='%d/%m/%Y %H:%M:%S')
data<-na.omit(data)
#Plot 4
png(filen... |
/gen_data/util/code2013.R | no_license | norival/internship_2017 | R | false | false | 7,152 | r | ||
'panel_decor' <- function(...) {
arglist <- list(...)
opR <- options(ursaPngAuto=TRUE)
isWeb <- getOption("ursaPngWebCartography")
ann <- getOption("ursaPngCopyright")
ann <- ((is.character(ann)[1])&&(nchar(ann[1])))
ann <- ((ann)&&(!.getPrm(arglist,name="coast",default=FALSE)))
isWeb <- (is.logica... | /R/panel_decor.R | no_license | nplatonov/ursa | R | false | false | 746 | r | 'panel_decor' <- function(...) {
arglist <- list(...)
opR <- options(ursaPngAuto=TRUE)
isWeb <- getOption("ursaPngWebCartography")
ann <- getOption("ursaPngCopyright")
ann <- ((is.character(ann)[1])&&(nchar(ann[1])))
ann <- ((ann)&&(!.getPrm(arglist,name="coast",default=FALSE)))
isWeb <- (is.logica... |
#install.packages(c("raster","sp","rgdal","rgeos","plyr"))
library(raster)
library(sp)
library(rgdal)
library(rgeos)
library(plyr)
#### Question 1 ####
#read in shapefiles
#readOGR in rgdal does this
g1966 <- readOGR("/Users/jeremybonte/Desktop/Geography/GEOG331/activity6/a06/GNPglaciers/GNPglaciers_1966.shp")
g1998... | /activity6/activty6_script.R | no_license | jbonte98/GEOG331 | R | false | false | 6,934 | r | #install.packages(c("raster","sp","rgdal","rgeos","plyr"))
library(raster)
library(sp)
library(rgdal)
library(rgeos)
library(plyr)
#### Question 1 ####
#read in shapefiles
#readOGR in rgdal does this
g1966 <- readOGR("/Users/jeremybonte/Desktop/Geography/GEOG331/activity6/a06/GNPglaciers/GNPglaciers_1966.shp")
g1998... |
# See j.mp/CEMweights for an explanation of weights
makeWeights <-
function(dataset, treatment){
strata <- getMahalStrata(rownames(dataset), dataset$matched.to)
num.treated <- sum(dataset[[treatment]] == 1)
num.control <- sum(dataset[[treatment]] == 0)
w <- rep(NA, nrow(dataset))
w[dataset[[treatme... | /R/makeWeights.R | no_license | DanielHadley/MatchingFrontier | R | false | false | 664 | r | # See j.mp/CEMweights for an explanation of weights
makeWeights <-
function(dataset, treatment){
strata <- getMahalStrata(rownames(dataset), dataset$matched.to)
num.treated <- sum(dataset[[treatment]] == 1)
num.control <- sum(dataset[[treatment]] == 0)
w <- rep(NA, nrow(dataset))
w[dataset[[treatme... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/founderPop.R
\name{runMacs2}
\alias{runMacs2}
\title{Alternative wrapper for MaCS}
\usage{
runMacs2(
nInd,
nChr = 1,
segSites = NULL,
Ne = 100,
bp = 1e+08,
genLen = 1,
mutRate = 2.5e-08,
histNe = c(500, 1500, 600... | /fuzzedpackages/AlphaSimR/man/runMacs2.Rd | no_license | akhikolla/testpackages | R | false | true | 2,420 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/founderPop.R
\name{runMacs2}
\alias{runMacs2}
\title{Alternative wrapper for MaCS}
\usage{
runMacs2(
nInd,
nChr = 1,
segSites = NULL,
Ne = 100,
bp = 1e+08,
genLen = 1,
mutRate = 2.5e-08,
histNe = c(500, 1500, 600... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.