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 |
|---|---|---|---|---|---|---|---|---|---|
##' .. content for \description{} (no empty lines) ..
##'
##' .. content for \details{} ..
##'
##' @title
##' @param sim_null_split
##' @param quantile_prob
##' @param dist_ordered
##' @param nperm
##' @return
##' @author Sayani Gupta
##' @export
compute_mmpd_panel_grid <- function(sim_null_split, quantile_prob = seq(0... | /R/compute_mmpd_panel_grid.R | no_license | Sayani07/hakear-drake | R | false | false | 1,146 | r | ##' .. content for \description{} (no empty lines) ..
##'
##' .. content for \details{} ..
##'
##' @title
##' @param sim_null_split
##' @param quantile_prob
##' @param dist_ordered
##' @param nperm
##' @return
##' @author Sayani Gupta
##' @export
compute_mmpd_panel_grid <- function(sim_null_split, quantile_prob = seq(0... |
## **************************************************************************
##
## (c) 2010-2022 Guillaume Guénard
## Department de sciences biologiques,
## Université de Montréal
## Montreal, QC, Canada
##
## **Class and method for Phylogenetic Eigenvector maps**
##
## This file is part ... | /R/PEM-class.R | no_license | cran/MPSEM | R | false | false | 7,451 | r | ## **************************************************************************
##
## (c) 2010-2022 Guillaume Guénard
## Department de sciences biologiques,
## Université de Montréal
## Montreal, QC, Canada
##
## **Class and method for Phylogenetic Eigenvector maps**
##
## This file is part ... |
# Plotting code for 394N Final Project
library(ggplot2)
library(dplyr)
# Load data files
one_hot <- read.csv("../logs/results_one_hot.csv")
draam <- read.csv("../logs/results_draam.csv")
# Add model names and drop NaNs
one_hot$Model <- "RAAM"
draam$Model <- "DRAAM"
# Combine and turn into data frame
combined <- dat... | /logs/Data_Plot.R | no_license | WallyGuzman/RAAM | R | false | false | 787 | r | # Plotting code for 394N Final Project
library(ggplot2)
library(dplyr)
# Load data files
one_hot <- read.csv("../logs/results_one_hot.csv")
draam <- read.csv("../logs/results_draam.csv")
# Add model names and drop NaNs
one_hot$Model <- "RAAM"
draam$Model <- "DRAAM"
# Combine and turn into data frame
combined <- dat... |
setwd("~/Dropbox/Sphenomorphine_Gene_Flow/data/phylogeny/all_genomic_data/species_tree/")
t1 = read.tree("best_trees_tol1e-05_collapse30.tre")
t2 = read.tree("best_trees_tol1e-05_collapse50.tre")
t3 = read.tree("best_trees_tol1e-05_collapse80.tre")
d = read.csv('~/Dropbox/Sphenomorphine_Gene_Flow/data/metadata/sphenom... | /phylogeny/species_trees.R | no_license | singhal/Spheno_Gene_Flow | R | false | false | 2,152 | r | setwd("~/Dropbox/Sphenomorphine_Gene_Flow/data/phylogeny/all_genomic_data/species_tree/")
t1 = read.tree("best_trees_tol1e-05_collapse30.tre")
t2 = read.tree("best_trees_tol1e-05_collapse50.tre")
t3 = read.tree("best_trees_tol1e-05_collapse80.tre")
d = read.csv('~/Dropbox/Sphenomorphine_Gene_Flow/data/metadata/sphenom... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/users.R
\name{users}
\alias{users}
\alias{user}
\alias{users_list}
\alias{user_create}
\alias{user_activate}
\alias{user_delete}
\alias{user_update_email}
\alias{user_update_username}
\title{Work with users}
\usage{
user(username, ...)
users... | /man/users.Rd | permissive | sckott/discgolf | R | false | true | 1,710 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/users.R
\name{users}
\alias{users}
\alias{user}
\alias{users_list}
\alias{user_create}
\alias{user_activate}
\alias{user_delete}
\alias{user_update_email}
\alias{user_update_username}
\title{Work with users}
\usage{
user(username, ...)
users... |
source("~/Dropbox/Chido/convBase.R")
source("~/Dropbox/Chido/obtAtrGenIte.R")
source("~/Dropbox/Chido/plotAtr.R")
#Definiendo sistema
nodos <-c("Temperatura", "Presion", "Precipitacion", "Herbivoros", "Depredadores", "MaizG", "FrijolEG", "CalabazaG", "Maiz", "FrijolE", "Calabaza", "MaizJ", "CalabazaJ", "Polinizadores"... | /arvenses/mzfre_plaguiHerb_arvenses_1434.R | no_license | laparcela/modelo_red_booleana_milpa_rafa | R | false | false | 1,244 | r | source("~/Dropbox/Chido/convBase.R")
source("~/Dropbox/Chido/obtAtrGenIte.R")
source("~/Dropbox/Chido/plotAtr.R")
#Definiendo sistema
nodos <-c("Temperatura", "Presion", "Precipitacion", "Herbivoros", "Depredadores", "MaizG", "FrijolEG", "CalabazaG", "Maiz", "FrijolE", "Calabaza", "MaizJ", "CalabazaJ", "Polinizadores"... |
test_that("predict for location shift models runs without errors", {
ns <- 30
nobs <- 10
draws <- list(mu = matrix(rnorm(ns * nobs), ncol = nobs),
sigma = rchisq(ns, 3), nu = rgamma(ns, 4),
nsamples = ns)
i <- sample(nobs, 1)
draws$f$link <- "identity"
pred <- predict_gaus... | /tests/testthat/tests.predict.R | no_license | vmikk/brms | R | false | false | 8,785 | r | test_that("predict for location shift models runs without errors", {
ns <- 30
nobs <- 10
draws <- list(mu = matrix(rnorm(ns * nobs), ncol = nobs),
sigma = rchisq(ns, 3), nu = rgamma(ns, 4),
nsamples = ns)
i <- sample(nobs, 1)
draws$f$link <- "identity"
pred <- predict_gaus... |
#' WDI: World Development Indicators (World Bank)
#'
#' Downloads the requested data by using the World Bank's API, parses the resulting XML file, and formats it in long country-year format.
#'
#' @param country Vector of countries (ISO-2 character codes, e.g. "BR", "US", "CA") for which the data is needed. Using... | /R/WDI.R | no_license | MatthieuStigler/WDI | R | false | false | 6,567 | r | #' WDI: World Development Indicators (World Bank)
#'
#' Downloads the requested data by using the World Bank's API, parses the resulting XML file, and formats it in long country-year format.
#'
#' @param country Vector of countries (ISO-2 character codes, e.g. "BR", "US", "CA") for which the data is needed. Using... |
# Load a 5-Second OHLCV CSV file into a 5-Second SQLite Database file.
#
#
# Usage: Modify variables "fileNameIn", and "fileNameOut"
# Make sure the input does not have duplicate records.
# If the SQLite database file does not exist it will be created, and the schema will be added to it.
# Created: 3/12... | /src/main/R/load5SecToSqlite.R | no_license | stergnator/BTExecise | R | false | false | 3,554 | r | # Load a 5-Second OHLCV CSV file into a 5-Second SQLite Database file.
#
#
# Usage: Modify variables "fileNameIn", and "fileNameOut"
# Make sure the input does not have duplicate records.
# If the SQLite database file does not exist it will be created, and the schema will be added to it.
# Created: 3/12... |
library(sppmix)
### Name: plot2dPP
### Title: Plot a spatial point pattern
### Aliases: plot2dPP
### ** Examples
## No test:
mix1 <- rnormmix(5, sig0 = .01, df = 5, xlim=c(0, 5), ylim=c(0, 5))
intsurf1=to_int_surf(mix1, lambda = 40, win =spatstat::owin( c(0, 5),c(0, 5)))
pp1 <- rsppmix(intsurf1)
plot2dPP(pp1)
plot... | /data/genthat_extracted_code/sppmix/examples/plot2dPP.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 370 | r | library(sppmix)
### Name: plot2dPP
### Title: Plot a spatial point pattern
### Aliases: plot2dPP
### ** Examples
## No test:
mix1 <- rnormmix(5, sig0 = .01, df = 5, xlim=c(0, 5), ylim=c(0, 5))
intsurf1=to_int_surf(mix1, lambda = 40, win =spatstat::owin( c(0, 5),c(0, 5)))
pp1 <- rsppmix(intsurf1)
plot2dPP(pp1)
plot... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/load_excel.R
\name{load_excel}
\alias{load_excel}
\title{Load an Excel sheet from a workbook}
\usage{
load_excel(obj)
}
\arguments{
\item{obj}{A domain object.}
}
\value{
A tbl_df object containing the loaded data
}
\description{
Load an Exce... | /man/load_excel.Rd | no_license | qPharmetra/PMDatR | R | false | true | 617 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/load_excel.R
\name{load_excel}
\alias{load_excel}
\title{Load an Excel sheet from a workbook}
\usage{
load_excel(obj)
}
\arguments{
\item{obj}{A domain object.}
}
\value{
A tbl_df object containing the loaded data
}
\description{
Load an Exce... |
rm(list=ls())
setwd("D:/Bernhard/Documents/Experiments/ExperimentSHUF/English")
source("n-watch functions.R")
source("bnc_functions.R")
s <- read.csv2("boycow_short.csv", as.is = TRUE)
s$pos <- find_pos(s$word_no_pct)
s[s$word_no_pct == "carhop",]$pos <- "noun"
s[s$word_no_pct == "eggnog",]$pos <- "noun"... | /Write sentences/corpus/read_english_corpus.R | no_license | BUReadingLab/Cognates | R | false | false | 625 | r | rm(list=ls())
setwd("D:/Bernhard/Documents/Experiments/ExperimentSHUF/English")
source("n-watch functions.R")
source("bnc_functions.R")
s <- read.csv2("boycow_short.csv", as.is = TRUE)
s$pos <- find_pos(s$word_no_pct)
s[s$word_no_pct == "carhop",]$pos <- "noun"
s[s$word_no_pct == "eggnog",]$pos <- "noun"... |
spark_dependencies <- function(spark_version, scala_version, ...) {
mleap_version <- if (spark_version >= "2.4.0") {
"0.16.0"
} else if (spark_version >= "2.3.0") {
"0.13.0"
} else {
"0.11.0"
}
sparklyr::spark_dependency(
jars = c(
system.file(
sprintf("java/mleap-%s-%s.jar", ... | /R/dependencies.R | permissive | yitao-li/mleap | R | false | false | 861 | r | spark_dependencies <- function(spark_version, scala_version, ...) {
mleap_version <- if (spark_version >= "2.4.0") {
"0.16.0"
} else if (spark_version >= "2.3.0") {
"0.13.0"
} else {
"0.11.0"
}
sparklyr::spark_dependency(
jars = c(
system.file(
sprintf("java/mleap-%s-%s.jar", ... |
## File Name: immer_create_design_matrix_formula.R
## File Version: 0.19
immer_create_design_matrix_formula <- function( itemtable, formulaA )
{
#-- process table
has_rater <- c("rater") %in% colnames(itemtable)
itemtable <- as.data.frame(itemtable)
itemtable$index <- seq(1, nrow(itemtable))
... | /R/immer_create_design_matrix_formula.R | no_license | cran/immer | R | false | false | 6,823 | r | ## File Name: immer_create_design_matrix_formula.R
## File Version: 0.19
immer_create_design_matrix_formula <- function( itemtable, formulaA )
{
#-- process table
has_rater <- c("rater") %in% colnames(itemtable)
itemtable <- as.data.frame(itemtable)
itemtable$index <- seq(1, nrow(itemtable))
... |
plsca_gpls <- function(n,p,q,off.var,ncomp,plevel,qlevel,rho,data1,data2){
#create ind.block.x and ind.block.z
ind.block.x<-ind.block.z<-NULL
ind.block.x<-plevel[1]
ind.block.z<-qlevel[1]
for(i in 1:(p-2)){
ind.block.x=cbind(ind.block.x,sum(plevel[1:(i+1)]))
}
for(i in 1:(q-2)){
ind.b... | /VariableSel_PLSCA/PLSCA_GPLS.R | no_license | yifanjiang422/plsvariableselection | R | false | false | 2,058 | r | plsca_gpls <- function(n,p,q,off.var,ncomp,plevel,qlevel,rho,data1,data2){
#create ind.block.x and ind.block.z
ind.block.x<-ind.block.z<-NULL
ind.block.x<-plevel[1]
ind.block.z<-qlevel[1]
for(i in 1:(p-2)){
ind.block.x=cbind(ind.block.x,sum(plevel[1:(i+1)]))
}
for(i in 1:(q-2)){
ind.b... |
library(GB2)
### Name: CompoundIndicators
### Title: Indicators of Poverty and Social Exclusion under the Compound
### Distribution based on the GB2
### Aliases: CompoundIndicators arpt.cgb2 arpr.cgb2 rmpg.cgb2 qsr.cgb2
### main.cgb2
### Keywords: distribution
### ** Examples
# GB2 parameters
a <- 3.9
b <- 1887... | /data/genthat_extracted_code/GB2/examples/CompoundIndicators.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 731 | r | library(GB2)
### Name: CompoundIndicators
### Title: Indicators of Poverty and Social Exclusion under the Compound
### Distribution based on the GB2
### Aliases: CompoundIndicators arpt.cgb2 arpr.cgb2 rmpg.cgb2 qsr.cgb2
### main.cgb2
### Keywords: distribution
### ** Examples
# GB2 parameters
a <- 3.9
b <- 1887... |
library(data.table)
library(janitor)
setwd("C:/Users/zdobreva/Desktop/HPPF 2020/HPPF 2020/Summer project/Analysis in R")
load("Data/contact_all.rdata")
country<-"KEN"
m <- data.matrix(contact_all[[country]])
population_data_import<-read.csv("Data/Population data/Population data age bins.csv", header = TRUE)
st... | /extracting prem new matrices v6 - method 2.R | no_license | zdobreva/social-mixing-project | R | false | false | 2,690 | r | library(data.table)
library(janitor)
setwd("C:/Users/zdobreva/Desktop/HPPF 2020/HPPF 2020/Summer project/Analysis in R")
load("Data/contact_all.rdata")
country<-"KEN"
m <- data.matrix(contact_all[[country]])
population_data_import<-read.csv("Data/Population data/Population data age bins.csv", header = TRUE)
st... |
library(geomnet)
### Name: metro_map
### Title: Map of Washington DC Metro area
### Aliases: metro_map
### Keywords: datasets
### ** Examples
## Not run:
##D library(ggmap)
##D data(metro_map)
##D ggmap(metro_map)
## End(Not run)
| /data/genthat_extracted_code/geomnet/examples/metro_map.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 238 | r | library(geomnet)
### Name: metro_map
### Title: Map of Washington DC Metro area
### Aliases: metro_map
### Keywords: datasets
### ** Examples
## Not run:
##D library(ggmap)
##D data(metro_map)
##D ggmap(metro_map)
## End(Not run)
|
gerber = read.csv("/home/tony/data-science/MITx-The-Analytics-Edge/data-files/AnalyticsEdgeMIT/gerber.csv")
# Proportion of voters from dataset
prop.table(table(gerber$voting))
tapply(gerber$voting, gerber$civicduty, mean)
tapply(gerber$voting, gerber$hawthorne, mean)
tapply(gerber$voting, gerber$self, mean)
tapply(ge... | /gerber.R | no_license | saifahmadsaif/AnalyticsEdgeMIT | R | false | false | 3,456 | r | gerber = read.csv("/home/tony/data-science/MITx-The-Analytics-Edge/data-files/AnalyticsEdgeMIT/gerber.csv")
# Proportion of voters from dataset
prop.table(table(gerber$voting))
tapply(gerber$voting, gerber$civicduty, mean)
tapply(gerber$voting, gerber$hawthorne, mean)
tapply(gerber$voting, gerber$self, mean)
tapply(ge... |
pacman::p_load(readr, dplyr, tidyr, ggplot2)
population_germany_1_percent = 807834
#population_munich_100_percent = 4424800
purpose_order = c("HBW", "HBE", "HBS", "HBR", "HBO", "NHBW", "NHBO")
sd_model_path = "Z:/projects/2019/BASt/data/results/mito_sd/"
sd_trips = read_csv(paste(sd_model_path,
... | /summary_trip_rates_11-30.R | no_license | cllorca1/german_wide_analysis | R | false | false | 5,159 | r | pacman::p_load(readr, dplyr, tidyr, ggplot2)
population_germany_1_percent = 807834
#population_munich_100_percent = 4424800
purpose_order = c("HBW", "HBE", "HBS", "HBR", "HBO", "NHBW", "NHBO")
sd_model_path = "Z:/projects/2019/BASt/data/results/mito_sd/"
sd_trips = read_csv(paste(sd_model_path,
... |
## Assignment2
## A pair of functions that cache the inverse of a matrix.
## makeCacheMatrix: This function creates a special "matrix" object that can cache its inverse.
makeCacheMatrix <- function(x = matrix()) {
m <- NULL
set <- function(y) {
x <<- y
m <<- NULL
}
get <- function() x
setsolve <- function(so... | /cachematrix.R | no_license | jwenth47/ProgrammingAssignment2 | R | false | false | 774 | r | ## Assignment2
## A pair of functions that cache the inverse of a matrix.
## makeCacheMatrix: This function creates a special "matrix" object that can cache its inverse.
makeCacheMatrix <- function(x = matrix()) {
m <- NULL
set <- function(y) {
x <<- y
m <<- NULL
}
get <- function() x
setsolve <- function(so... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/project._pop.R
\name{project_pop}
\alias{project_pop}
\title{Population projection}
\usage{
project_pop(pup_counts, Sf, Sm, r = 0.05, begin = 1975, plot = TRUE,
span = 1/3)
}
\arguments{
\item{pup_counts}{vector of annual pup coun... | /ZcOSP/man/project_pop.Rd | no_license | jlaake/ZcOSP | R | false | true | 1,081 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/project._pop.R
\name{project_pop}
\alias{project_pop}
\title{Population projection}
\usage{
project_pop(pup_counts, Sf, Sm, r = 0.05, begin = 1975, plot = TRUE,
span = 1/3)
}
\arguments{
\item{pup_counts}{vector of annual pup coun... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{flast}
\alias{flast}
\title{Fast last}
\usage{
flast(x)
}
\arguments{
\item{x}{an R object.}
}
\value{
Returns the last element of a vector, factor, or any other R object
which has a method for the \code{length} function.
}
... | /man/flast.Rd | permissive | capellett/acresFSA | R | false | true | 397 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{flast}
\alias{flast}
\title{Fast last}
\usage{
flast(x)
}
\arguments{
\item{x}{an R object.}
}
\value{
Returns the last element of a vector, factor, or any other R object
which has a method for the \code{length} function.
}
... |
setwd("~/Desktop/job/JHDS/ExData_Plotting1/")
## preallocate memory to read huge file
t<-data.frame(cbind(character(2075259),character(2075259),numeric(2075259),numeric(2075259),numeric(2075259),numeric(2075259),numeric(2075259),numeric(2075259),numeric(2075259)))
t<-read.table("household_power_consumption.txt", head... | /plot4.R | no_license | achorton/ExData_Plotting1 | R | false | false | 3,895 | r | setwd("~/Desktop/job/JHDS/ExData_Plotting1/")
## preallocate memory to read huge file
t<-data.frame(cbind(character(2075259),character(2075259),numeric(2075259),numeric(2075259),numeric(2075259),numeric(2075259),numeric(2075259),numeric(2075259),numeric(2075259)))
t<-read.table("household_power_consumption.txt", head... |
#' Reverselog transform for the y scale.
#'
#' \code{xgx_scale_y_reverselog10} is designed to be used with data that approaches 100%.
#' A common example is receptor occupancy in drug development.
#' It is used when you want even spacing between 90, 99, 99.9, etc.
#'
#' @param ... other parameters passed to \code... | /Rlib/xgxr-master/R/xgx_scale_y_reverselog10.R | no_license | concertris/xgx | R | false | false | 1,036 | r | #' Reverselog transform for the y scale.
#'
#' \code{xgx_scale_y_reverselog10} is designed to be used with data that approaches 100%.
#' A common example is receptor occupancy in drug development.
#' It is used when you want even spacing between 90, 99, 99.9, etc.
#'
#' @param ... other parameters passed to \code... |
library(tidyverse)
source("../mcdi-setup.R")
DIF <- readRDS("lex_syn_DIF.rds") %>%
filter(
place == "load"
) %>%
select(-p, -place)
loadings <- DIF %>%
filter(
var == "intercept"
) %>%
select(-var, -est_se) %>%
group_by(score) %>%
nest() %>%
mutate(
data = map(data, ~mutate(.x, est_Z = ... | /code/MNLFA/aMNLFAvFA_plots.R | no_license | TrevorKMDay/MCDI-analysis | R | false | false | 4,307 | r |
library(tidyverse)
source("../mcdi-setup.R")
DIF <- readRDS("lex_syn_DIF.rds") %>%
filter(
place == "load"
) %>%
select(-p, -place)
loadings <- DIF %>%
filter(
var == "intercept"
) %>%
select(-var, -est_se) %>%
group_by(score) %>%
nest() %>%
mutate(
data = map(data, ~mutate(.x, est_Z = ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/outputFunctions.R
\name{igToGrViz}
\alias{igToGrViz}
\title{Exports Interaction graph to a GraphViz file}
\usage{
igToGrViz(ig, path = "", fName = "InteractionGraph")
}
\arguments{
\item{ig}{Interaction graph}
\item{path}{The fold... | /man/igToGrViz.Rd | no_license | cran/integr | R | false | true | 889 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/outputFunctions.R
\name{igToGrViz}
\alias{igToGrViz}
\title{Exports Interaction graph to a GraphViz file}
\usage{
igToGrViz(ig, path = "", fName = "InteractionGraph")
}
\arguments{
\item{ig}{Interaction graph}
\item{path}{The fold... |
#### Load data ####
unzip(zipfile="exdata_data_NEI_data.zip", exdir=as.character(getwd()))
NEI<-readRDS("summarySCC_PM25.rds",)
SCC<-readRDS("Source_Classification_Code.rds")
#### Question 4 ####
#Across the United States, how have emissions from coal
#combustion-related sources changed from 1999–2008?
#### merge ... | /EDA project2 plot4.R | no_license | katamwilliams/Exploratory-Data-Analysis | R | false | false | 817 | r | #### Load data ####
unzip(zipfile="exdata_data_NEI_data.zip", exdir=as.character(getwd()))
NEI<-readRDS("summarySCC_PM25.rds",)
SCC<-readRDS("Source_Classification_Code.rds")
#### Question 4 ####
#Across the United States, how have emissions from coal
#combustion-related sources changed from 1999–2008?
#### merge ... |
## Caching the Inverse of a Matrix:
## Below are a pair of functions that are used to create a special object that
## stores a matrix and caches its inverse.
## This function creates a special "matrix" object that can cache its inverse.
makeCacheMatrix <- function(x = matrix()) {
inv <- NULL
set <- function (y) ... | /cachematrix.R | no_license | RaktimGhosh/ProgrammingAssignment2 | R | false | false | 929 | r | ## Caching the Inverse of a Matrix:
## Below are a pair of functions that are used to create a special object that
## stores a matrix and caches its inverse.
## This function creates a special "matrix" object that can cache its inverse.
makeCacheMatrix <- function(x = matrix()) {
inv <- NULL
set <- function (y) ... |
#[export]
proptest <- function(x, n, p, alternative = "unequal", logged = FALSE) {
s <- sqrt( n * p * (1 - p) )
stat <- (x - n * p) / s
if ( alternative == "unequal" ) {
if ( !logged ) {
pvalue <- 2 * pnorm(abs(stat), lower.tail = FALSE)
} else pvalue <- log(2) + pnorm(abs(stat), lower.tail = FALS... | /R/proptest.R | no_license | RfastOfficial/Rfast | R | false | false | 834 | r | #[export]
proptest <- function(x, n, p, alternative = "unequal", logged = FALSE) {
s <- sqrt( n * p * (1 - p) )
stat <- (x - n * p) / s
if ( alternative == "unequal" ) {
if ( !logged ) {
pvalue <- 2 * pnorm(abs(stat), lower.tail = FALSE)
} else pvalue <- log(2) + pnorm(abs(stat), lower.tail = FALS... |
/old_src/image/AnnotatorTool.R | no_license | MFlores2021/PhotoAnnotator | R | false | false | 13,078 | r | ||
#library(ggplot2)
tienda_id <- unique(pv$ID_TIENDA)
dfs <- ls()[sapply(mget(ls(), .GlobalEnv), is.data.frame)]
agg <- function(tienda){
aggregate(tienda[,c("TOTAL")], by=list(tienda$CODIGO_SKU), "sum")
}
for(i in dfs[2:length(dfs)])
{
assign(paste("v_",i, sep = ""), agg(get(i)))
}
for(i in tienda_id){
rm(list ... | /Coach_Análisis_Relativo_Monto_Total_Tienda/total_sku_coach.R | no_license | pakinja/R-Data-Mining | R | false | false | 1,265 | r | #library(ggplot2)
tienda_id <- unique(pv$ID_TIENDA)
dfs <- ls()[sapply(mget(ls(), .GlobalEnv), is.data.frame)]
agg <- function(tienda){
aggregate(tienda[,c("TOTAL")], by=list(tienda$CODIGO_SKU), "sum")
}
for(i in dfs[2:length(dfs)])
{
assign(paste("v_",i, sep = ""), agg(get(i)))
}
for(i in tienda_id){
rm(list ... |
library(BAT)
### Name: sim.tree
### Title: Simulation of phylogenetic or functional tree.
### Aliases: sim.tree
### ** Examples
tree <- sim.tree(10)
plot(as.dendrogram(tree))
tree <- sim.tree(100,10)
plot(as.dendrogram(tree))
tree <- sim.tree(100,1000)
plot(as.dendrogram(tree))
| /data/genthat_extracted_code/BAT/examples/sim.tree.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 286 | r | library(BAT)
### Name: sim.tree
### Title: Simulation of phylogenetic or functional tree.
### Aliases: sim.tree
### ** Examples
tree <- sim.tree(10)
plot(as.dendrogram(tree))
tree <- sim.tree(100,10)
plot(as.dendrogram(tree))
tree <- sim.tree(100,1000)
plot(as.dendrogram(tree))
|
gen8ped <-
function(nfunnels=1, nperfam=50, nssdgen=6, nseeds=1, iripgen=0, seed=1)
{
# could allow nseeds to be a vector, in which case it should have length ? - one entry for each stage. if length 1, assume that
ped <- cbind(c(1:8), rep(0, 8), rep(0, 8))
# special circumstance is just the ABCDEFGH ... | /mpMap/R/gen8ped.R | no_license | ingted/R-Examples | R | false | false | 3,836 | r | gen8ped <-
function(nfunnels=1, nperfam=50, nssdgen=6, nseeds=1, iripgen=0, seed=1)
{
# could allow nseeds to be a vector, in which case it should have length ? - one entry for each stage. if length 1, assume that
ped <- cbind(c(1:8), rep(0, 8), rep(0, 8))
# special circumstance is just the ABCDEFGH ... |
## Build a random matrix
M <- matrix(rnorm(100), 10, 10)
## Take the mean of each row
RowMeans <- apply(M, 1, mean)
print (RowMeans)
## Now the variance
RowVars <- apply(M, 1, var)
print (RowVars)
## By column
ColMeans <- apply(M, 2, mean)
print (ColMeans)
| /Week3/Code/apply1.R | no_license | YuanZhang1203/CMEECourseWork | R | false | false | 260 | r | ## Build a random matrix
M <- matrix(rnorm(100), 10, 10)
## Take the mean of each row
RowMeans <- apply(M, 1, mean)
print (RowMeans)
## Now the variance
RowVars <- apply(M, 1, var)
print (RowVars)
## By column
ColMeans <- apply(M, 2, mean)
print (ColMeans)
|
# Make the 1976 summer video with no wind arrows
dates<-substr(basename(list.files("/scratch/hadpb/images/1976-summer",pattern='rd')),13,28)
current.step<-0
limit<-length(dates)
max.current<-900
while(current.step<limit) {
in.system<-system('squeue --user hadpb',intern=TRUE)
n.new.jobs<-max.current-length(in.sys... | /men_who_made_the_weather/1976_drought/multibatch_nowind.R | no_license | philip-brohan/weather.case.studies | R | false | false | 1,004 | r | # Make the 1976 summer video with no wind arrows
dates<-substr(basename(list.files("/scratch/hadpb/images/1976-summer",pattern='rd')),13,28)
current.step<-0
limit<-length(dates)
max.current<-900
while(current.step<limit) {
in.system<-system('squeue --user hadpb',intern=TRUE)
n.new.jobs<-max.current-length(in.sys... |
###============================================================================================#
###--- Hierarchical Bayesian species distribution modeling using a rangemap as a covariate ----
###============================================================================================#
### Sami Domisch, September... | /hSDM_rangemap_generic.R | no_license | domisch/species_distribution_models | R | false | false | 23,612 | r |
###============================================================================================#
###--- Hierarchical Bayesian species distribution modeling using a rangemap as a covariate ----
###============================================================================================#
### Sami Domisch, September... |
MapRateCard <- function(mergedOMSData, rateCardFilePath) {
suppressMessages({
require(dplyr)
require(tools)
require(magrittr)
require(methods)
require(futile.logger)
require(XLConnect)
})
functionName <- "MapRateCard"
flog.info(paste("Function", functionName, "started"), name = report... | /3_Script/1_Code/03_Processing/Pandu/Pandu_MapRateCard.R | no_license | datvuong/ID_JNE_Invoice_Checking | R | false | false | 3,020 | r | MapRateCard <- function(mergedOMSData, rateCardFilePath) {
suppressMessages({
require(dplyr)
require(tools)
require(magrittr)
require(methods)
require(futile.logger)
require(XLConnect)
})
functionName <- "MapRateCard"
flog.info(paste("Function", functionName, "started"), name = report... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{toy_data}
\alias{toy_data}
\title{Toy spatial data}
\format{
A data frame with 100 rows and 2 variables:
\describe{
\item{Y}{a binary dependent variable}
\item{X}{a continuous independent variable}
}
}
\usage{
... | /man/toy_data.Rd | no_license | ochyzh/lsgm | R | false | true | 419 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{toy_data}
\alias{toy_data}
\title{Toy spatial data}
\format{
A data frame with 100 rows and 2 variables:
\describe{
\item{Y}{a binary dependent variable}
\item{X}{a continuous independent variable}
}
}
\usage{
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/margin_of_error.R
\name{margin_of_error}
\alias{margin_of_error}
\alias{margin_of_error_}
\title{Calculate some estimates of the margin of error for weighted survey
results}
\usage{
margin_of_error(inputfile, response)
margin_of_error_(inpu... | /man/margin_of_error.Rd | permissive | heathermkrause/WWC | R | false | true | 1,794 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/margin_of_error.R
\name{margin_of_error}
\alias{margin_of_error}
\alias{margin_of_error_}
\title{Calculate some estimates of the margin of error for weighted survey
results}
\usage{
margin_of_error(inputfile, response)
margin_of_error_(inpu... |
###########################################################################
##
## Copyright 2013, 2014 Charles Danko and Minho Chae.
##
## This program is part of the groHMM R package
##
## groHMM is free software: you can redistribute it and/or modify it
## under the terms of the GNU General Public License as ... | /R/getTxDensity.R | no_license | Kraus-Lab/groHMM | R | false | false | 9,422 | r | ###########################################################################
##
## Copyright 2013, 2014 Charles Danko and Minho Chae.
##
## This program is part of the groHMM R package
##
## groHMM is free software: you can redistribute it and/or modify it
## under the terms of the GNU General Public License as ... |
library(dplyr)
ss.bounds <- readRDS("ss.bounds.rds")
alpha <- 0.025
method <- 'wn'
scenario <- 19
param <- 1
anal_type <- "sing"
ss <- ss.bounds%>%
dplyr::filter(method == "wn", scenario.id == scenario)
do_val <- 0.1
x1 <- parallel::mclapply(X = 1:10000,
mc.cores = parallel::detectCo... | /sim_pgms/wn/do10/2xcontH0_sc19_do10_sing.R | no_license | yuliasidi/nibinom_apply | R | false | false | 2,229 | r | library(dplyr)
ss.bounds <- readRDS("ss.bounds.rds")
alpha <- 0.025
method <- 'wn'
scenario <- 19
param <- 1
anal_type <- "sing"
ss <- ss.bounds%>%
dplyr::filter(method == "wn", scenario.id == scenario)
do_val <- 0.1
x1 <- parallel::mclapply(X = 1:10000,
mc.cores = parallel::detectCo... |
library(peacots)
### Name: evaluate.pm
### Title: Evaluate the periodogram maximum of a time series
### Aliases: evaluate.pm
### Keywords: statistics
### ** Examples
# In this example we generate a cyclic time series
# and analyse its periodogram using evaluate.pm
# Parameters
lambda = 1; # inverse corr... | /data/genthat_extracted_code/peacots/examples/evaluate.pm.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 1,163 | r | library(peacots)
### Name: evaluate.pm
### Title: Evaluate the periodogram maximum of a time series
### Aliases: evaluate.pm
### Keywords: statistics
### ** Examples
# In this example we generate a cyclic time series
# and analyse its periodogram using evaluate.pm
# Parameters
lambda = 1; # inverse corr... |
testlist <- list(lims = structure(c(0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(4L, 2L)), points = structure(c(2.98302031348083e-313, 35740566642812256256, 8.62758926694869e-308, 8.29550952405012e-316, 27597764530107584512, 7.81981645079075e-148), .Dim = c(6L, 1L)))
result <- do.call(palm:::pbc_distances,testlist)
str(result) | /palm/inst/testfiles/pbc_distances/libFuzzer_pbc_distances/pbc_distances_valgrind_files/1612988737-test.R | no_license | akhikolla/updatedatatype-list2 | R | false | false | 320 | r | testlist <- list(lims = structure(c(0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(4L, 2L)), points = structure(c(2.98302031348083e-313, 35740566642812256256, 8.62758926694869e-308, 8.29550952405012e-316, 27597764530107584512, 7.81981645079075e-148), .Dim = c(6L, 1L)))
result <- do.call(palm:::pbc_distances,testlist)
str(result) |
\name{ProbReg}
\alias{ProbReg}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Estimator of small tail probability in regression
}
\description{
Estimator of small tail probability \eqn{1-F_i(q)} in the regression case where \eqn{\gamma} is constant and the regression modelling is thus only solel... | /man/ProbReg.Rd | no_license | TReynkens/ReIns | R | false | false | 2,407 | rd | \name{ProbReg}
\alias{ProbReg}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Estimator of small tail probability in regression
}
\description{
Estimator of small tail probability \eqn{1-F_i(q)} in the regression case where \eqn{\gamma} is constant and the regression modelling is thus only solel... |
#f(x)=2e^(-2x) for x>0#is PDF
#MEAN
#f(x)=xf(x)
options(digits = 3)
f=function(x) 2*x*exp(1)^(-2*x)
mean <- integrate(f, lower =0, upper =Inf)
cat("Mean for PDF is",mean$value)
#variance
#var=E(X^2)-E(X)^2
E=function(x) 2*(x^2)*exp(1)^(-2*x)#E(X^2)
E1=integrate(E, lower =0, upper =Inf)
var=E1$value-((mean$va... | /Miller_And_Freund_S_Probability_And_Statistics_For_Engineers_by_Richard_A._Johnson/CH5/EX5.4/EX5_4.R | permissive | FOSSEE/R_TBC_Uploads | R | false | false | 362 | r | #f(x)=2e^(-2x) for x>0#is PDF
#MEAN
#f(x)=xf(x)
options(digits = 3)
f=function(x) 2*x*exp(1)^(-2*x)
mean <- integrate(f, lower =0, upper =Inf)
cat("Mean for PDF is",mean$value)
#variance
#var=E(X^2)-E(X)^2
E=function(x) 2*(x^2)*exp(1)^(-2*x)#E(X^2)
E1=integrate(E, lower =0, upper =Inf)
var=E1$value-((mean$va... |
#' samplesPlot
#'
#' Plot the snv distribution for each sample
#' @import ggplot2
#' @param count Output total counts instead of frequency if set [Default no]
#' @keywords spectrum
#' @export
samplesPlot <- function(..., snv_data=NULL, count=FALSE, write=FALSE, tricounts=NULL){
if(missing(snv_data)){
snv_data<-g... | /R/samplesPlot.R | no_license | nriddiford/mutationProfiles | R | false | false | 1,699 | r | #' samplesPlot
#'
#' Plot the snv distribution for each sample
#' @import ggplot2
#' @param count Output total counts instead of frequency if set [Default no]
#' @keywords spectrum
#' @export
samplesPlot <- function(..., snv_data=NULL, count=FALSE, write=FALSE, tricounts=NULL){
if(missing(snv_data)){
snv_data<-g... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/propmiss.R
\name{propmiss}
\alias{propmiss}
\title{Missing stats}
\usage{
propmiss(df)
}
\arguments{
\item{df}{A data.frame.}
}
\value{
A data.frame with missingness stats.
}
\description{
Returns the number of missing values, total length, a... | /man/propmiss.Rd | no_license | 95teza/Tmisc | R | false | true | 485 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/propmiss.R
\name{propmiss}
\alias{propmiss}
\title{Missing stats}
\usage{
propmiss(df)
}
\arguments{
\item{df}{A data.frame.}
}
\value{
A data.frame with missingness stats.
}
\description{
Returns the number of missing values, total length, a... |
#' scr5_4
#' @description
#' The solution to the Rizzo's book exercise 5_4.
#'
#' Write a function to compute a Monte Carlo estimate of the Beta(3, 3) cdf,
#' and use the function to estimate F(x) for x = 0.1, 0.2, . . ., 0.9.
#' Compare the estimates with the values returned by the pbeta function in R.
#'
#' @referenc... | /SCR/R/scr5_4.R | no_license | Creatran/SCR | R | false | false | 990 | r | #' scr5_4
#' @description
#' The solution to the Rizzo's book exercise 5_4.
#'
#' Write a function to compute a Monte Carlo estimate of the Beta(3, 3) cdf,
#' and use the function to estimate F(x) for x = 0.1, 0.2, . . ., 0.9.
#' Compare the estimates with the values returned by the pbeta function in R.
#'
#' @referenc... |
# 0-library.R
library(BGTools)
library(dplyr)
library(stringr)
library(lubridate)
library(tidyr)
library(tibble)
library(purrr)
source("0-dirs.R")
gzip_files(dir.patients)
# gzip_files(dir.exclude)
gzip_files(dir.data)
#' Determine if patient is new to warfarin therapy
#'
#' @param therapy Character vector indicat... | /0-library.R | no_license | bgulbis/Warfarin_Dosing_Service | R | false | false | 861 | r | # 0-library.R
library(BGTools)
library(dplyr)
library(stringr)
library(lubridate)
library(tidyr)
library(tibble)
library(purrr)
source("0-dirs.R")
gzip_files(dir.patients)
# gzip_files(dir.exclude)
gzip_files(dir.data)
#' Determine if patient is new to warfarin therapy
#'
#' @param therapy Character vector indicat... |
python_dir <- "/Applications/anaconda3/bin/python3"
working_dir <- "~/Documents/projects/spatial-genomics"
setwd(working_dir) # set your working directory
# your working directory should contain a `./data`` folder and a `./result` folder to save figures and csvs.
result_dir <- "./result"
data_dir <- "./data"
# 1. load... | /notebooks/gene.module/depreciated/liver_rank_tuning_v1.R | no_license | yelabucsf/spatial | R | false | false | 4,612 | r | python_dir <- "/Applications/anaconda3/bin/python3"
working_dir <- "~/Documents/projects/spatial-genomics"
setwd(working_dir) # set your working directory
# your working directory should contain a `./data`` folder and a `./result` folder to save figures and csvs.
result_dir <- "./result"
data_dir <- "./data"
# 1. load... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AQSearch.Slope.R
\name{AQSearch.Slope}
\alias{AQSearch.Slope}
\title{Search function for ATPS Systems data}
\usage{
\method{AQSearch}{Slope}(
db = LLSR::llsr_data,
db.CompA = NULL,
db.CompB = NULL,
db.CompC = NULL,
db.Tem... | /man/AQSearch.Slope.Rd | no_license | cran/LLSR | R | false | true | 1,877 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AQSearch.Slope.R
\name{AQSearch.Slope}
\alias{AQSearch.Slope}
\title{Search function for ATPS Systems data}
\usage{
\method{AQSearch}{Slope}(
db = LLSR::llsr_data,
db.CompA = NULL,
db.CompB = NULL,
db.CompC = NULL,
db.Tem... |
/Indicador de Regressão Linear.R | no_license | lucianofbn/Quantitative-Finance | R | false | false | 3,168 | r | ||
data <- read.table("E:/Coursera/EDA/Assig1/household_power_consumption.txt",sep=";",header=T,na.strings="?",stringsAsFactors=F)
data$Date <- as.Date(data$Date, format="%d/%m/%Y")
data <- subset(data, subset=(Date >= "2007-02-01" & Date <= "2007-02-02"))
datetime <- paste(as.Date(data$Date), data$Time)
data$Dateti... | /plot1.R | no_license | ashutosgupta/ExData_Plotting1 | R | false | false | 550 | r |
data <- read.table("E:/Coursera/EDA/Assig1/household_power_consumption.txt",sep=";",header=T,na.strings="?",stringsAsFactors=F)
data$Date <- as.Date(data$Date, format="%d/%m/%Y")
data <- subset(data, subset=(Date >= "2007-02-01" & Date <= "2007-02-02"))
datetime <- paste(as.Date(data$Date), data$Time)
data$Dateti... |
#' Plot model trees deepness
#'
#' Visualizes distributions related to depth of tree leafs.
#' \code{xgb.plot.deepness} uses base R graphics, while \code{xgb.ggplot.deepness} uses the ggplot backend.
#'
#' @param model either an \code{xgb.Booster} model generated by the \code{xgb.train} function
#' or a data.tab... | /R-package/R/xgb.plot.deepness.R | permissive | rapidsai/xgboost | R | false | false | 6,227 | r | #' Plot model trees deepness
#'
#' Visualizes distributions related to depth of tree leafs.
#' \code{xgb.plot.deepness} uses base R graphics, while \code{xgb.ggplot.deepness} uses the ggplot backend.
#'
#' @param model either an \code{xgb.Booster} model generated by the \code{xgb.train} function
#' or a data.tab... |
makeMARSandPredict<-function(employment_series,monthCounters,nAhead=24){
#Subset to remove month counter
theEmployment.ts<-ts(employment_series,frequency=12)
#do season + trend extraction using stl() function
st<-stl(theEmployment.ts,s.window = "periodic")
trnd<-st$time.series[,"trend"]
theSeries<-as.data.f... | /R/makeMARS.R | no_license | joshoberman/backtest | R | false | false | 1,171 | r | makeMARSandPredict<-function(employment_series,monthCounters,nAhead=24){
#Subset to remove month counter
theEmployment.ts<-ts(employment_series,frequency=12)
#do season + trend extraction using stl() function
st<-stl(theEmployment.ts,s.window = "periodic")
trnd<-st$time.series[,"trend"]
theSeries<-as.data.f... |
library(ggplot2)
library(readxl)
tecator = read_excel("D:/Desktop/Machine Learning/Machine Learning/lab01/tecator.xlsx")
plotMoistureVsProtein = function() {
regressor = lm(formula = Protein ~ Moisture, data = tecator)
y_predict = predict(regressor, newdata = tecator)
ggplot(tecator, aes(x = tec... | /testmodit.R | no_license | abkw/ML-Lab01 | R | false | false | 2,656 | r | library(ggplot2)
library(readxl)
tecator = read_excel("D:/Desktop/Machine Learning/Machine Learning/lab01/tecator.xlsx")
plotMoistureVsProtein = function() {
regressor = lm(formula = Protein ~ Moisture, data = tecator)
y_predict = predict(regressor, newdata = tecator)
ggplot(tecator, aes(x = tec... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Cluster_actions.R
\name{luOutlier}
\alias{luOutlier}
\title{luOutlier}
\usage{
luOutlier(x, min.size = 3)
}
\arguments{
\item{x}{Numeric vector of cluster membership (1st item (named \code{class})
in list returned by \code{\link{mclustRestric... | /man/luOutlier.Rd | no_license | DeprezM/scDD | R | false | true | 1,164 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Cluster_actions.R
\name{luOutlier}
\alias{luOutlier}
\title{luOutlier}
\usage{
luOutlier(x, min.size = 3)
}
\arguments{
\item{x}{Numeric vector of cluster membership (1st item (named \code{class})
in list returned by \code{\link{mclustRestric... |
\name{count.ancestral.alleles}
\alias{count.ancestral.alleles}
\title{Count ancestral alleles along a chromosome}
\usage{
count.ancestral.alleles(clusters)
}
\note{
This function can only be run from inside a clusthaplo context as returned by clusthaplo(...).
}
\arguments{
\item{clusters}{
pairwise simi... | /man/count.ancestral.alleles.Rd | no_license | cran/clusthaplo | R | false | false | 1,191 | rd | \name{count.ancestral.alleles}
\alias{count.ancestral.alleles}
\title{Count ancestral alleles along a chromosome}
\usage{
count.ancestral.alleles(clusters)
}
\note{
This function can only be run from inside a clusthaplo context as returned by clusthaplo(...).
}
\arguments{
\item{clusters}{
pairwise simi... |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Load libraries
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
library(data.table)
#install.packages("openxlsx")
#install.packages("patchwork")
#install.packages("platus", rebuild = TRUE)
library(openxlsx)
libra... | /_drafts/functions.R | permissive | mpmendespt/mpmendespt.github.io | R | false | false | 7,732 | r | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Load libraries
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
library(data.table)
#install.packages("openxlsx")
#install.packages("patchwork")
#install.packages("platus", rebuild = TRUE)
library(openxlsx)
libra... |
library(dplyr)
file.cleanR <- function(cnv_file) {
clean_file <- filter(cnv_file, is.finite(log2) )
cat("Filtering on number of reads per window (each window must have more than 10 reads in tum & cont)", "\n")
clean_file <- filter(clean_file, test > 10 & ref > 10)
}
cnv.print <- function(cnv, fi... | /CNV-Seq/script/cnv-seq.R | no_license | nriddiford/Investigating-structural-variation-in-cancer-genomes | R | false | false | 1,888 | r |
library(dplyr)
file.cleanR <- function(cnv_file) {
clean_file <- filter(cnv_file, is.finite(log2) )
cat("Filtering on number of reads per window (each window must have more than 10 reads in tum & cont)", "\n")
clean_file <- filter(clean_file, test > 10 & ref > 10)
}
cnv.print <- function(cnv, fi... |
library(plyr)
library(dplyr)
library(tidyr)
library(ggplot2)
library(reshape2)
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
# [1]
# Have total emissions from PM2.5 decreased in the United States from 1999 to 2008?
# Using the base plotting system, make a plot ... | /plot1.r | no_license | poc1673/Exploratory-Data-Analysis-Assignment-2 | R | false | false | 843 | r |
library(plyr)
library(dplyr)
library(tidyr)
library(ggplot2)
library(reshape2)
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
# [1]
# Have total emissions from PM2.5 decreased in the United States from 1999 to 2008?
# Using the base plotting system, make a plot ... |
# Prep environment --------------------------------------------------------
setwd('Z:/Jeremy/GOBACK/')
require(dplyr); require(survival)
# Load in data ------------------------------------------------------------
load("./Datasets/goback.cox.ph.top.hits.v20180223.1.rdata")
#' Create vectors of defects and cancers... | /Cox regression models - exclude children under 1 in top hits.R | permissive | schrawj/GOBACK | R | false | false | 13,068 | r |
# Prep environment --------------------------------------------------------
setwd('Z:/Jeremy/GOBACK/')
require(dplyr); require(survival)
# Load in data ------------------------------------------------------------
load("./Datasets/goback.cox.ph.top.hits.v20180223.1.rdata")
#' Create vectors of defects and cancers... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/daily_soil_temp_mean.R
\name{daily.soil.temp.mean}
\alias{daily.soil.temp.mean}
\title{Return daily soil temperature means by horizon}
\usage{
daily.soil.temp.mean(site, bgn.date, end.date)
}
\arguments{
\item{site}{Parameter of class charact... | /Z10/man/daily.soil.temp.mean.Rd | no_license | rhlee12/Z10-Package | R | false | true | 1,129 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/daily_soil_temp_mean.R
\name{daily.soil.temp.mean}
\alias{daily.soil.temp.mean}
\title{Return daily soil temperature means by horizon}
\usage{
daily.soil.temp.mean(site, bgn.date, end.date)
}
\arguments{
\item{site}{Parameter of class charact... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/exec.R, R/indexing.R
\name{re_exec}
\alias{re_exec}
\alias{$.rematch_records}
\alias{$.rematch_allrecords}
\title{Extract Data From First Regular Expression Match Into a Data Frame}
\usage{
re_exec(text, pattern, perl = TRUE, ...)
\method{$}... | /man/re_exec.Rd | permissive | r-lib/rematch2 | R | false | true | 3,126 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/exec.R, R/indexing.R
\name{re_exec}
\alias{re_exec}
\alias{$.rematch_records}
\alias{$.rematch_allrecords}
\title{Extract Data From First Regular Expression Match Into a Data Frame}
\usage{
re_exec(text, pattern, perl = TRUE, ...)
\method{$}... |
DF<- read.table("household_power_consumption.txt",sep=";", header=TRUE)
DF$datetime <- strptime(paste(DF$Date, DF$Time), "%d/%m/%Y %H:%M:%S")
DFplot <- subset(DF, datetime >= "2007-02-01 00:00:00" & datetime < "2007-02-03 00:01:00")
for(i in 3:9) {
DFplot[,i] <- as.numeric(as.character(DFplot[,i]))
}
daterange <-... | /Plot3.R | no_license | McTuff/ExData_Plotting1 | R | false | false | 1,014 | r | DF<- read.table("household_power_consumption.txt",sep=";", header=TRUE)
DF$datetime <- strptime(paste(DF$Date, DF$Time), "%d/%m/%Y %H:%M:%S")
DFplot <- subset(DF, datetime >= "2007-02-01 00:00:00" & datetime < "2007-02-03 00:01:00")
for(i in 3:9) {
DFplot[,i] <- as.numeric(as.character(DFplot[,i]))
}
daterange <-... |
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/zzz.R
\name{extractSubstStrings}
\alias{extractSubstStrings}
\title{extract strings for substitution from template for checking etc}
\usage{
extractSubstStrings(template, string.prefix = "@@",
string.suffix = string.prefix)
}
\argum... | /man/extractSubstStrings.Rd | no_license | queebles/dryworkflow | R | false | false | 1,052 | rd | % Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/zzz.R
\name{extractSubstStrings}
\alias{extractSubstStrings}
\title{extract strings for substitution from template for checking etc}
\usage{
extractSubstStrings(template, string.prefix = "@@",
string.suffix = string.prefix)
}
\argum... |
v <- c(2,5.5,6,9)
t <- c(8,2.5,14,9)
print(v < t)
| /vasavi/lesser-vectors.R | no_license | tactlabs/r-samples | R | false | false | 50 | r | v <- c(2,5.5,6,9)
t <- c(8,2.5,14,9)
print(v < t)
|
#' Squares the input
#'
#' @param x A number
#' @return The square of \code{x}
#' @examples
#' @export
#' square(4)
#' square(3321.6516512)
#' square(-845)
square <- function(x) {x^2}
| /powers.Rcheck/00_pkg_src/powers/R/square.R | no_license | j-schaub/stat547_participation | R | false | false | 185 | r | #' Squares the input
#'
#' @param x A number
#' @return The square of \code{x}
#' @examples
#' @export
#' square(4)
#' square(3321.6516512)
#' square(-845)
square <- function(x) {x^2}
|
library(ggplot2)
#reading data from rds-files
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
#get names of coal combustion-related sources
coalCombustionSource<-grep("*Coal",levels(SCC$EI.Sector), ignore.case = T, value = T)
#get data of emissions for coal combustion-related so... | /plot4.R | no_license | AlexanderNap/ExData_Plotting2 | R | false | false | 1,058 | r | library(ggplot2)
#reading data from rds-files
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
#get names of coal combustion-related sources
coalCombustionSource<-grep("*Coal",levels(SCC$EI.Sector), ignore.case = T, value = T)
#get data of emissions for coal combustion-related so... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MixGGM.R
\name{glasso_cv_mixture}
\alias{glasso_cv_mixture}
\title{A function to}
\usage{
glasso_cv_mixture(W, ts, k, rholist = NULL, verbose = T)
}
\arguments{
\item{rholist}{}
\item{verbose}{}
}
\value{
make.positive.definite(Sigma_emp ,to... | /man/glasso_cv_mixture.Rd | no_license | sahatava/MixGGM | R | false | true | 360 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MixGGM.R
\name{glasso_cv_mixture}
\alias{glasso_cv_mixture}
\title{A function to}
\usage{
glasso_cv_mixture(W, ts, k, rholist = NULL, verbose = T)
}
\arguments{
\item{rholist}{}
\item{verbose}{}
}
\value{
make.positive.definite(Sigma_emp ,to... |
#Main Hipp directory
xHIPP.PATH = "C:\\Users\\avell\\Desktop\\xHiPP";
#TCP port where shiny server will works. Change in RUN_CLIENT.bat, as well.
SERVER.TCP.PORT = 4907
pkg.dependences = function()
{
p = installed.packages()
p = rownames(p)
needed.packages = c("jsonlite", "mp", "umap", "doParallel", "tm", "top... | /run/_run.R | no_license | fabiofelix/xHiPP | R | false | false | 625 | r |
#Main Hipp directory
xHIPP.PATH = "C:\\Users\\avell\\Desktop\\xHiPP";
#TCP port where shiny server will works. Change in RUN_CLIENT.bat, as well.
SERVER.TCP.PORT = 4907
pkg.dependences = function()
{
p = installed.packages()
p = rownames(p)
needed.packages = c("jsonlite", "mp", "umap", "doParallel", "tm", "top... |
setwd("~/Teaching/Bio144/data_examples/anova/Hafer/")
d.hafer <- read.table("hafer.dat",header=T)
boxplot(YIELD ~ GROUP, d.hafer)
plot(d.hafer$GROUP,d.hafer$YIELD,xlim=c(0.5,3.5),
xaxt="n",xlab="",ylab="YIELD")
axis(1,at=c(1,2,3),labels=c("Group 1","Group 2","Check"))
text(d.hafer$GROUP+0.08,d.hafer$YIELD,labels... | /5_some_examples/data_examples/anova/Hafer/hafer.r | no_license | opetchey/BIO144 | R | false | false | 508 | r | setwd("~/Teaching/Bio144/data_examples/anova/Hafer/")
d.hafer <- read.table("hafer.dat",header=T)
boxplot(YIELD ~ GROUP, d.hafer)
plot(d.hafer$GROUP,d.hafer$YIELD,xlim=c(0.5,3.5),
xaxt="n",xlab="",ylab="YIELD")
axis(1,at=c(1,2,3),labels=c("Group 1","Group 2","Check"))
text(d.hafer$GROUP+0.08,d.hafer$YIELD,labels... |
## Kernel density estimation for M44 (Praesepe) with Gaia data
## Earl Patrick Bellinger
## earlbellinger@gmail.com
## August 4, 2018
#setwd("D:/Praesepe")
library(FITSio)
library(ks)
library(magicaxis)
P <- readFITS(file = 'Praesepe_cut.fits')
DF <- data.frame(P$col)
names(DF) <- P$colNames
ra <- ... | /Praesepe.R | permissive | stephtdouglas/M44_subcluster | R | false | false | 2,164 | r | ## Kernel density estimation for M44 (Praesepe) with Gaia data
## Earl Patrick Bellinger
## earlbellinger@gmail.com
## August 4, 2018
#setwd("D:/Praesepe")
library(FITSio)
library(ks)
library(magicaxis)
P <- readFITS(file = 'Praesepe_cut.fits')
DF <- data.frame(P$col)
names(DF) <- P$colNames
ra <- ... |
\name{OBsMD-internal}
\title{Internal OBsMD objects}
\alias{.First.lib}
\description{Internal OBsMD objects.}
\details{These are not to be called by the user.}
\keyword{internal} | /man/OBsMD-internal.Rd | no_license | cran/OBsMD | R | false | false | 183 | rd | \name{OBsMD-internal}
\title{Internal OBsMD objects}
\alias{.First.lib}
\description{Internal OBsMD objects.}
\details{These are not to be called by the user.}
\keyword{internal} |
feedforward <- function(object, data){
object <- new("feedforward", object);
L <- length(object@neurons)
accumulations <- 1;
i <- 1;
j <- 1;
## input-layer
data <- t(array(data)); attr(data, "dimnames") <- NULL;
object@feedforwards[[1]] <... | /feedforward.R | no_license | 610311101/Ann | R | false | false | 1,616 | r |
feedforward <- function(object, data){
object <- new("feedforward", object);
L <- length(object@neurons)
accumulations <- 1;
i <- 1;
j <- 1;
## input-layer
data <- t(array(data)); attr(data, "dimnames") <- NULL;
object@feedforwards[[1]] <... |
# functions for categorical variables
#' Perform significance testing on categorical data
#'
#' @param df data frame
#' @param y column which contains the corresponding groups, as a string or
#' symbol
#' @param ... selection of column(s) with the data values, supports dplyr
#' selection rules
#' @param subgrp opt... | /R/categorical.R | no_license | bgulbis/resultr | R | false | false | 4,616 | r | # functions for categorical variables
#' Perform significance testing on categorical data
#'
#' @param df data frame
#' @param y column which contains the corresponding groups, as a string or
#' symbol
#' @param ... selection of column(s) with the data values, supports dplyr
#' selection rules
#' @param subgrp opt... |
#载入的包
library(tidyverse)
library(Seurat)
#10X Genomics 单细胞测序标准下游分析流程
#########################################
# 1_PREPROCESS,进行文件的分组
fs=list.files('./data/GSE135927_RAW/','^GSM')
fs
# Split up a string into pieces;simplify = T 返回矩阵
samples=str_split(fs,'_',simplify = T)[,1]
lapply(unique(samples),function(x){
y=fs[g... | /script/1_preprocess.R | no_license | Farewellznm/10XGenomics_scRNAseq_workflow | R | false | false | 998 | r | #载入的包
library(tidyverse)
library(Seurat)
#10X Genomics 单细胞测序标准下游分析流程
#########################################
# 1_PREPROCESS,进行文件的分组
fs=list.files('./data/GSE135927_RAW/','^GSM')
fs
# Split up a string into pieces;simplify = T 返回矩阵
samples=str_split(fs,'_',simplify = T)[,1]
lapply(unique(samples),function(x){
y=fs[g... |
library(ks)
### Name: kcde
### Title: Kernel cumulative distribution/survival function estimate
### Aliases: kcde Hpi.kcde Hpi.diag.kcde hpi.kcde predict.kcde
### Keywords: smooth
### ** Examples
library(MASS)
data(iris)
Fhat <- kcde(iris[,1:2])
predict(Fhat, x=as.matrix(iris[,1:2]))
## See other examples in ? p... | /data/genthat_extracted_code/ks/examples/kcde.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 332 | r | library(ks)
### Name: kcde
### Title: Kernel cumulative distribution/survival function estimate
### Aliases: kcde Hpi.kcde Hpi.diag.kcde hpi.kcde predict.kcde
### Keywords: smooth
### ** Examples
library(MASS)
data(iris)
Fhat <- kcde(iris[,1:2])
predict(Fhat, x=as.matrix(iris[,1:2]))
## See other examples in ? p... |
library(httr)
library(jsonlite)
source("set_environment.R")
#######################
##
## Computer Vision
##
## https://westus.dev.cognitive.microsoft.com/docs/services/56f91f2d778daf23d8ec6739/operations/56f91f2e778daf14a499e1fc
##
#######################
headers = add_headers(c(
"Content-Type" = "application/oct... | /cognitive_services_ocr.R | no_license | yafernandes/azure_integration | R | false | false | 2,567 | r | library(httr)
library(jsonlite)
source("set_environment.R")
#######################
##
## Computer Vision
##
## https://westus.dev.cognitive.microsoft.com/docs/services/56f91f2d778daf23d8ec6739/operations/56f91f2e778daf14a499e1fc
##
#######################
headers = add_headers(c(
"Content-Type" = "application/oct... |
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/theme_nice.R
\name{theme_nice}
\alias{theme_nice}
\title{ggplot2 theme with pretty default settings}
\usage{
theme_nice(base_size = 20, base_family = "")
}
\arguments{
\item{base_size}{reference font size. Default is 20.}
\item{base... | /man/theme_nice.Rd | no_license | brianwonch/mediamunger | R | false | false | 551 | rd | % Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/theme_nice.R
\name{theme_nice}
\alias{theme_nice}
\title{ggplot2 theme with pretty default settings}
\usage{
theme_nice(base_size = 20, base_family = "")
}
\arguments{
\item{base_size}{reference font size. Default is 20.}
\item{base... |
library(readr)
library(tidyverse)
# load in data
mortality_life_expectancy <- read_csv("~/Documents/Classes/Fall 2020/IST 707/Final Project/archive/mortality_life_expectancy.csv")
midyear_population_age_sex <- read_csv("~/Documents/Classes/Fall 2020/IST 707/Final Project/archive/midyear_population_age_sex.csv")
midyear... | /IST7070_FinalProject_CensusDataMunge_wwith_GDP_data.R | no_license | ankowalc/IST707 | R | false | false | 8,856 | r | library(readr)
library(tidyverse)
# load in data
mortality_life_expectancy <- read_csv("~/Documents/Classes/Fall 2020/IST 707/Final Project/archive/mortality_life_expectancy.csv")
midyear_population_age_sex <- read_csv("~/Documents/Classes/Fall 2020/IST 707/Final Project/archive/midyear_population_age_sex.csv")
midyear... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cfb_recruiting_team.R
\name{cfb_recruiting_team}
\alias{cfb_recruiting_team}
\title{CFB Recruiting Information - Team Rankings}
\usage{
cfb_recruiting_team(year = NULL, team = NULL)
}
\arguments{
\item{year}{(\emph{Integer} optional): Recruit... | /man/cfb_recruiting_team.Rd | permissive | sabinanalytics/cfbscrapR | R | false | true | 1,269 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cfb_recruiting_team.R
\name{cfb_recruiting_team}
\alias{cfb_recruiting_team}
\title{CFB Recruiting Information - Team Rankings}
\usage{
cfb_recruiting_team(year = NULL, team = NULL)
}
\arguments{
\item{year}{(\emph{Integer} optional): Recruit... |
# Version 1 - Simple Square root
somenum <- -9
retval <- sqrt(somenum)
myfunc <- function(somenum) {
retval <- sqrt(somenum)
return(retval)
}
# Version 2 - Square root and complex numbers
myfunc <- function(somenum) {
if (somenum < 0 ) {
retval <- sqrt(as.complex(somenum))
} else {
retval <- sqrt(s... | /SUPP.DIR/functions_part1.R | no_license | pittardsp/pittardsp.github.io | R | false | false | 20,478 | r | # Version 1 - Simple Square root
somenum <- -9
retval <- sqrt(somenum)
myfunc <- function(somenum) {
retval <- sqrt(somenum)
return(retval)
}
# Version 2 - Square root and complex numbers
myfunc <- function(somenum) {
if (somenum < 0 ) {
retval <- sqrt(as.complex(somenum))
} else {
retval <- sqrt(s... |
context("decrypt service token")
test_that("token works", {
skip_if_offline()
skip_if_no_auth()
expect_error_free(
token <- credentials_service_account(
scopes = "https://www.googleapis.com/auth/userinfo.email",
path = rawToChar(secret_read("gargle", "gargle-testing.json"))
)
)
email <- ... | /tests/testthat/test-aaa.R | permissive | MarkEdmondson1234/gargle | R | false | false | 416 | r | context("decrypt service token")
test_that("token works", {
skip_if_offline()
skip_if_no_auth()
expect_error_free(
token <- credentials_service_account(
scopes = "https://www.googleapis.com/auth/userinfo.email",
path = rawToChar(secret_read("gargle", "gargle-testing.json"))
)
)
email <- ... |
\name{Pearson}
\alias{Pearson}
\title{Pearson test for dependence}
\description{
Pearson test for linear dependence. Note that test statistic returned is the pivot t that follows Student's t distribution.
}
| /testforDEP/man/Pearson.Rd | no_license | akhikolla/TestedPackages-NoIssues | R | false | false | 221 | rd | \name{Pearson}
\alias{Pearson}
\title{Pearson test for dependence}
\description{
Pearson test for linear dependence. Note that test statistic returned is the pivot t that follows Student's t distribution.
}
|
# -----------------------------------------
# TOPIC: COURSERA DATASCIENCE GETTING DATA PROJECT
# AUTHOR: WESLEY SMALL
#
# SYNOPSIS:
# THE RUN ANALYSIS SCRIPT PERFORMS THE NECESSARY ACTIONS TO
# LOAD THE UCI HAR DATASET AND MERGE MULTIPLE FILES OF MEASURED
# CONTENT INTO A SINGLE DATASET
#
# THE OVERALL OBJECTIVE IS... | /run_analysis.R | no_license | smallwesley/getdata_tidy_data_project | R | false | false | 7,200 | r | # -----------------------------------------
# TOPIC: COURSERA DATASCIENCE GETTING DATA PROJECT
# AUTHOR: WESLEY SMALL
#
# SYNOPSIS:
# THE RUN ANALYSIS SCRIPT PERFORMS THE NECESSARY ACTIONS TO
# LOAD THE UCI HAR DATASET AND MERGE MULTIPLE FILES OF MEASURED
# CONTENT INTO A SINGLE DATASET
#
# THE OVERALL OBJECTIVE IS... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/OptPartitioning2D.R
\name{GenData2D}
\alias{GenData2D}
\title{GenData2D}
\usage{
GenData2D(n, changepoints, means1, means2, noise1 = 1, noise2 = 1)
}
\arguments{
\item{n}{number of data point.}
\item{changepoints}{a vector of increasing chan... | /man/GenData2D.Rd | no_license | lpishchagina/OptPartitioning2D | R | false | true | 968 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/OptPartitioning2D.R
\name{GenData2D}
\alias{GenData2D}
\title{GenData2D}
\usage{
GenData2D(n, changepoints, means1, means2, noise1 = 1, noise2 = 1)
}
\arguments{
\item{n}{number of data point.}
\item{changepoints}{a vector of increasing chan... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/image.R
\name{checkImg}
\alias{checkImg}
\title{checkImg}
\usage{
checkImg(im, edges, nodes, tiles)
}
\description{
checkImg
}
| /man/checkImg.Rd | permissive | js2264/mondrianaRt | R | false | true | 205 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/image.R
\name{checkImg}
\alias{checkImg}
\title{checkImg}
\usage{
checkImg(im, edges, nodes, tiles)
}
\description{
checkImg
}
|
get_catalog_pirls <-
function( data_name = "pirls" , output_dir , ... ){
catalog <-
data.frame(
year = seq( 2001 , 2011 , 5 ) ,
stringsAsFactors = FALSE
)
catalog$output_folder <- paste0( output_dir , "/" , catalog$year , "/" )
catalog
}
lodown_pirls <-
function( data_name = "pirls" , cat... | /R/pirls.R | no_license | jjsjaime/lodown | R | false | false | 7,534 | r | get_catalog_pirls <-
function( data_name = "pirls" , output_dir , ... ){
catalog <-
data.frame(
year = seq( 2001 , 2011 , 5 ) ,
stringsAsFactors = FALSE
)
catalog$output_folder <- paste0( output_dir , "/" , catalog$year , "/" )
catalog
}
lodown_pirls <-
function( data_name = "pirls" , cat... |
# Plotting Excercise 1
get_heights <- function(x){
heights<- rnorm(x, 69, 10)
return(mean(heights))
}
mean_heights_100 <- rep(0,1000)
for(i in 1:1000){
mean_heights_100[i] <- get_heights(100)
}
mean_heights_1000 <- rep(0,1000)
for(i in 1:1000){
mean_heights_1000[i] <- get_heights(1000)
}
bins <- seq(65, 73, by ... | /Day_1_Homework/Plotting_Excercise_1.R | no_license | lalsmith/UCLA-QBC | R | false | false | 786 | r | # Plotting Excercise 1
get_heights <- function(x){
heights<- rnorm(x, 69, 10)
return(mean(heights))
}
mean_heights_100 <- rep(0,1000)
for(i in 1:1000){
mean_heights_100[i] <- get_heights(100)
}
mean_heights_1000 <- rep(0,1000)
for(i in 1:1000){
mean_heights_1000[i] <- get_heights(1000)
}
bins <- seq(65, 73, by ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/language_objects.R
\name{Sentiment}
\alias{Sentiment}
\title{Sentiment Object}
\usage{
Sentiment(polarity = NULL, magnitude = NULL)
}
\arguments{
\item{polarity}{Polarity of the sentiment in the [-1}
\item{magnitude}{A non-negative number in... | /googlelanguagev1beta1.auto/man/Sentiment.Rd | permissive | Phippsy/autoGoogleAPI | R | false | true | 582 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/language_objects.R
\name{Sentiment}
\alias{Sentiment}
\title{Sentiment Object}
\usage{
Sentiment(polarity = NULL, magnitude = NULL)
}
\arguments{
\item{polarity}{Polarity of the sentiment in the [-1}
\item{magnitude}{A non-negative number in... |
library(ape)
testtree <- read.tree("2241_0.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="2241_0_unrooted.txt") | /codeml_files/newick_trees_processed/2241_0/rinput.R | no_license | DaniBoo/cyanobacteria_project | R | false | false | 135 | r | library(ape)
testtree <- read.tree("2241_0.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="2241_0_unrooted.txt") |
## Explanatory data analysis
##------- assignment 2
## --------- Question 6 -----------
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
## Baltimor emissions
motorindex <- grep("motor", SCC$Short.Name, ignore.case = TRUE)
motorsource <- SCC[motorindex, ]
SCCID <- as.character(... | /Plot6.R | no_license | rberangi/coursera-exploratory-data-analysis-course-project-2 | R | false | false | 1,302 | r | ## Explanatory data analysis
##------- assignment 2
## --------- Question 6 -----------
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
## Baltimor emissions
motorindex <- grep("motor", SCC$Short.Name, ignore.case = TRUE)
motorsource <- SCC[motorindex, ]
SCCID <- as.character(... |
#' Compare word frequencies
#'
#' This function compares frequencies of different words used in the comments
#' of two different pages.
#'
#' @param page_one
#' @param page_two
#' @param posts
#'
#' @return A dataframe with some variables
#'
#' @export
compare_frequencies <- function(..., posts) {
page... | /R/compare_frequencies.R | no_license | sahbantariq/airlines | R | false | false | 729 | r | #' Compare word frequencies
#'
#' This function compares frequencies of different words used in the comments
#' of two different pages.
#'
#' @param page_one
#' @param page_two
#' @param posts
#'
#' @return A dataframe with some variables
#'
#' @export
compare_frequencies <- function(..., posts) {
page... |
extrunc <- function( spec, a = -Inf, b = Inf, ... )
{
###
### This function computes the expected value of a truncated random variable
### with the given specification over the truncated domain using
### numerical integration
###
### Arguments
### spec = a character value to specify the distribution
### a = a ... | /R/extrunc.R | no_license | cran/truncdist | R | false | false | 730 | r | extrunc <- function( spec, a = -Inf, b = Inf, ... )
{
###
### This function computes the expected value of a truncated random variable
### with the given specification over the truncated domain using
### numerical integration
###
### Arguments
### spec = a character value to specify the distribution
### a = a ... |
find_osquery <- function() {
osq <- Sys.which("osqueryi")
if (osq == "") stop("osqueryi not found. please install osquery.")
return(unname(osq))
}
osquery_help <- function() {
cat(call_osquery("--help"))
}
call_osquery <- function(args) { # TODO this needs massive edge case detection
res <- sys::exec_intern... | /R/utils.R | no_license | hrbrmstr/osqueryr | R | false | false | 856 | r | find_osquery <- function() {
osq <- Sys.which("osqueryi")
if (osq == "") stop("osqueryi not found. please install osquery.")
return(unname(osq))
}
osquery_help <- function() {
cat(call_osquery("--help"))
}
call_osquery <- function(args) { # TODO this needs massive edge case detection
res <- sys::exec_intern... |
#' A summary method for multi-arm crtpwr objects (crtpwr.ma)
#'
#' @param object A crtpwr.ma object
#' @param ... other arguments passed to the summary method
#'
#' @noRd
setMethod(
"summary",
signature(object = "crtpwr.ma"),
definition = function(object, ...)
{
cat(paste0("\n", object[['overv... | /R/summary.method.crtpwr.ma.R | no_license | cran/clusterPower | R | false | false | 884 | r | #' A summary method for multi-arm crtpwr objects (crtpwr.ma)
#'
#' @param object A crtpwr.ma object
#' @param ... other arguments passed to the summary method
#'
#' @noRd
setMethod(
"summary",
signature(object = "crtpwr.ma"),
definition = function(object, ...)
{
cat(paste0("\n", object[['overv... |
## ------------------------------------------------------------------------
data(iris)
iris_model <- lm(Sepal.Length ~ Sepal.Width, data=iris)
summary(iris_model)
## ------------------------------------------------------------------------
my_function <- function(first_argument, second_argument, ...) {
# do some st... | /slides/lecture5_functions.R | no_license | giacombi/Bios6301 | R | false | false | 7,278 | r |
## ------------------------------------------------------------------------
data(iris)
iris_model <- lm(Sepal.Length ~ Sepal.Width, data=iris)
summary(iris_model)
## ------------------------------------------------------------------------
my_function <- function(first_argument, second_argument, ...) {
# do some st... |
#--------------------------------------------#
#---# Working with Data in the Tidyverse #---#
#--------------------------------------------#
#---------------------------#
#---# Explore your data #---#
#---------------------------#
library(readr)
library(dplyr)
library(skimr)
library(ggplot2)
# Create bakeoff but sk... | /WorkingDataTidyverse.R | no_license | DanaeMirel/TidyverseR | R | false | false | 5,773 | r |
#--------------------------------------------#
#---# Working with Data in the Tidyverse #---#
#--------------------------------------------#
#---------------------------#
#---# Explore your data #---#
#---------------------------#
library(readr)
library(dplyr)
library(skimr)
library(ggplot2)
# Create bakeoff but sk... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.