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 |
|---|---|---|---|---|---|---|---|---|---|
# Install and load packages
package_names <- c("survey","dplyr","foreign","devtools")
lapply(package_names, function(x) if(!x %in% installed.packages()) install.packages(x))
lapply(package_names, require, character.only=T)
install_github("e-mitchell/meps_r_pkg/MEPS")
library(MEPS)
options(survey.lonely.ps... | /mepstrends/hc_use/json/code/r/meanEXP__sex__sop__.r | permissive | RandomCriticalAnalysis/MEPS-summary-tables | R | false | false | 1,698 | r | # Install and load packages
package_names <- c("survey","dplyr","foreign","devtools")
lapply(package_names, function(x) if(!x %in% installed.packages()) install.packages(x))
lapply(package_names, require, character.only=T)
install_github("e-mitchell/meps_r_pkg/MEPS")
library(MEPS)
options(survey.lonely.ps... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/readArgSummary.R
\name{readArgSummary}
\alias{readArgSummary}
\title{Read arg-sample summary file}
\usage{
readArgSummary(file, burnin = NULL)
}
\arguments{
\item{file}{A character string, either the name of the stats file or
the directory wh... | /R/argweaver/man/readArgSummary.Rd | permissive | CshlSiepelLab/argweaver | R | false | true | 744 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/readArgSummary.R
\name{readArgSummary}
\alias{readArgSummary}
\title{Read arg-sample summary file}
\usage{
readArgSummary(file, burnin = NULL)
}
\arguments{
\item{file}{A character string, either the name of the stats file or
the directory wh... |
shorten_names = function(x, n) {
x = head(x ,n)
bn = basename(x)
here = paste0(normalizePath("."), .Platform$file.sep, bn)
clean = gsub("\"", "", bn)
if (any(x != here))
paste0("[...]", .Platform$file.sep, clean)
else
clean
}
#' @export
print.stars_proxy = function(x, ..., n = 1e5, nfiles = 10, simplify = TR... | /R/proxy.R | permissive | ntag1618/stars | R | false | false | 19,845 | r | shorten_names = function(x, n) {
x = head(x ,n)
bn = basename(x)
here = paste0(normalizePath("."), .Platform$file.sep, bn)
clean = gsub("\"", "", bn)
if (any(x != here))
paste0("[...]", .Platform$file.sep, clean)
else
clean
}
#' @export
print.stars_proxy = function(x, ..., n = 1e5, nfiles = 10, simplify = TR... |
# using sql to get specific data points rather than the whole dataset
# thanks for helpf from discussion group
#loading proper subset of data
library(sqldf)
sub1 <- read.csv2.sql("household_power_consumption.txt",sql="SELECT * FROM file WHERE Date='1/2/2007' OR Date='2/2/2007'",sep=";",na.strings="?" )
png("plot2.pn... | /plot2.R | no_license | jababu3/ExData_Plotting1 | R | false | false | 490 | r | # using sql to get specific data points rather than the whole dataset
# thanks for helpf from discussion group
#loading proper subset of data
library(sqldf)
sub1 <- read.csv2.sql("household_power_consumption.txt",sql="SELECT * FROM file WHERE Date='1/2/2007' OR Date='2/2/2007'",sep=";",na.strings="?" )
png("plot2.pn... |
## Put comments here that give an overall description of what your
## functions do
## Write a short comment describing this function
makeCacheMatrix <- function(x = matrix()) {
m <- NULL
set <- function(y) {
x <<- y
m <<- NULL
}
get <- function() x
setInverseMatrix <- function(solve) m <<- solve
g... | /cachematrix.R | no_license | WHolz/ProgrammingAssignment2 | R | false | false | 777 | r | ## Put comments here that give an overall description of what your
## functions do
## Write a short comment describing this function
makeCacheMatrix <- function(x = matrix()) {
m <- NULL
set <- function(y) {
x <<- y
m <<- NULL
}
get <- function() x
setInverseMatrix <- function(solve) m <<- solve
g... |
library(readr)
library(dplyr)
df <- read_delim("household_power_consumption.txt", ";", col_types = list(
Date = col_character(),
Time = col_character(),
Global_active_power = col_numeric(),
Global_reactive_power = col_numeric(),
Voltage = col_numeric(),
Global_intensity = col_numeric(),
Sub_metering_1 ... | /plot4.R | no_license | msonnabaum/ExData_Plotting1 | R | false | false | 1,358 | r | library(readr)
library(dplyr)
df <- read_delim("household_power_consumption.txt", ";", col_types = list(
Date = col_character(),
Time = col_character(),
Global_active_power = col_numeric(),
Global_reactive_power = col_numeric(),
Voltage = col_numeric(),
Global_intensity = col_numeric(),
Sub_metering_1 ... |
#' Download Federal Reserve Data
#'
#' \code{fred} downloads data from the Federal Reserve Economic Database
#' (FRED).
#'
#' @param ... vector of FRED codes as character strings (use quotations).
#' @param names vector of characters to replace column names in final dataframe. The length must be equal to the numb... | /R/functions.R | no_license | cmann3/econ311 | R | false | false | 11,357 | r | #' Download Federal Reserve Data
#'
#' \code{fred} downloads data from the Federal Reserve Economic Database
#' (FRED).
#'
#' @param ... vector of FRED codes as character strings (use quotations).
#' @param names vector of characters to replace column names in final dataframe. The length must be equal to the numb... |
##############################################################################
##### BF testing for meta-analysis based on Van Aert & Mulder (in prep.) #####
##### via the metafor package #####
##############################################################################
#'... | /R/BFmeta.R | no_license | cran/BFpack | R | false | false | 15,487 | r | ##############################################################################
##### BF testing for meta-analysis based on Van Aert & Mulder (in prep.) #####
##### via the metafor package #####
##############################################################################
#'... |
#' Internal fynction used by app to load parameters and generate forms dynamically, stored inside a .json file format
#'
#' @param condfir A character string (default : "src/Rsnakeconf.json")
#'
#' @return A list of elements for each parameters (see src/Rsnakeconf.json)
#'
#'
#' @examples
#' conf <- Rsnakeconf.jsonC... | /src/Rsnakeconf_functions.R | no_license | rochevin/Rsnakeconf | R | false | false | 8,804 | r | #' Internal fynction used by app to load parameters and generate forms dynamically, stored inside a .json file format
#'
#' @param condfir A character string (default : "src/Rsnakeconf.json")
#'
#' @return A list of elements for each parameters (see src/Rsnakeconf.json)
#'
#'
#' @examples
#' conf <- Rsnakeconf.jsonC... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bd_do_inference.R
\name{bd_do_inference}
\alias{bd_do_inference}
\title{Do Demographic Bayesian Inference}
\usage{
bd_do_inference(prob)
}
\arguments{
\item{prob}{List with the fields \code{phi_m} (vector of radiocarbon measurements as fracti... | /man/bd_do_inference.Rd | permissive | ercrema/baydem | R | false | true | 1,714 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bd_do_inference.R
\name{bd_do_inference}
\alias{bd_do_inference}
\title{Do Demographic Bayesian Inference}
\usage{
bd_do_inference(prob)
}
\arguments{
\item{prob}{List with the fields \code{phi_m} (vector of radiocarbon measurements as fracti... |
x<-read.table('pseudocounts_westcoast.txt',sep='\t',header=TRUE,row.names=1)
exp2<-c("control","control", "control","control","control","EE2","EE2","EE2","EE2","EE2","Mix","Mix","Mix","Mix","Mix","Cd","Cd","Cd","Cd","BNF","BNF","BNF","BNF")
exp2<-t(exp2)
exp2<-t(exp2)
calc.var2<-function(x,exp2){
varmat<-matrix(... | /analyzePercaVar.R | no_license | tobbeost/perca | R | false | false | 1,073 | r | x<-read.table('pseudocounts_westcoast.txt',sep='\t',header=TRUE,row.names=1)
exp2<-c("control","control", "control","control","control","EE2","EE2","EE2","EE2","EE2","Mix","Mix","Mix","Mix","Mix","Cd","Cd","Cd","Cd","BNF","BNF","BNF","BNF")
exp2<-t(exp2)
exp2<-t(exp2)
calc.var2<-function(x,exp2){
varmat<-matrix(... |
mutate_OH_no_evol <- function(players) {
for (i in 1:nrow(players)) {
player <- players[i,]
rnd <- runif(1)
gene <- floor(16*rnd[1])
player[4 + gene] <- 1 - player[4 + gene]
players[i,] <- player
}
return(players)
}
| /Old code/mutate_OH_no_evol.R | no_license | XtremeCurling/evol_pris_dilem | R | false | false | 232 | r | mutate_OH_no_evol <- function(players) {
for (i in 1:nrow(players)) {
player <- players[i,]
rnd <- runif(1)
gene <- floor(16*rnd[1])
player[4 + gene] <- 1 - player[4 + gene]
players[i,] <- player
}
return(players)
}
|
library(sensitivity)
### Name: support
### Title: Support index functions: Measuring the effect of input variables
### over their support
### Aliases: support
### ** Examples
# -----------------
# ishigami function
# -----------------
n <- 5000
n.points <- 1000
d <- 3
set.seed(0)
X <- matrix(runif(d*n, min = -p... | /data/genthat_extracted_code/sensitivity/examples/support.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 1,156 | r | library(sensitivity)
### Name: support
### Title: Support index functions: Measuring the effect of input variables
### over their support
### Aliases: support
### ** Examples
# -----------------
# ishigami function
# -----------------
n <- 5000
n.points <- 1000
d <- 3
set.seed(0)
X <- matrix(runif(d*n, min = -p... |
#' Get list of all committees for a given chamber along with their subcommittees.
#' @import RJSONIO RCurl
#' @param chamber House, Senate, or Joint
#' @param url the PLoS API url for the function (should be left to default)
#' @param key your SunlightLabs API key; loads from .Rprofile
#' @param ... optional additional... | /R/sll_cg_getcommitteeslist.R | no_license | cran/govdat | R | false | false | 1,135 | r | #' Get list of all committees for a given chamber along with their subcommittees.
#' @import RJSONIO RCurl
#' @param chamber House, Senate, or Joint
#' @param url the PLoS API url for the function (should be left to default)
#' @param key your SunlightLabs API key; loads from .Rprofile
#' @param ... optional additional... |
best <- function(state, outcome) {
isValidOutcome <- function(outcome) {
OK <- FALSE
for (i in 1:length(validOutcome)) {
if (outcome == validOutcome[i]) {OK <- TRUE; break}
}
OK
}
isValidState <- function(stateAbbr)... | /best.R | no_license | wkstuart/JH_R_Course | R | false | false | 2,322 | r | best <- function(state, outcome) {
isValidOutcome <- function(outcome) {
OK <- FALSE
for (i in 1:length(validOutcome)) {
if (outcome == validOutcome[i]) {OK <- TRUE; break}
}
OK
}
isValidState <- function(stateAbbr)... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simr.R
\docType{package}
\name{simr-package}
\alias{simr-package}
\title{simr: Simulation-based power calculations for mixed models.}
\description{
\code{simr} is a package that makes it easy to run simulation-based power analyses
wit... | /man/simr-package.Rd | no_license | cran/simr | R | false | true | 339 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simr.R
\docType{package}
\name{simr-package}
\alias{simr-package}
\title{simr: Simulation-based power calculations for mixed models.}
\description{
\code{simr} is a package that makes it easy to run simulation-based power analyses
wit... |
# This function writes the data frame into a csv file
write.csv <- function(ob,filename){
write.table(ob, filename, quote=FALSE, sep=",", row.names=FALSE)
}
# This function reads the file or the address, and downloads the data, and then ultimately inputs into a data frame
readIt <- function(address) {
web_page <... | /playerdata.R | no_license | ankit481/NBAStatistics | R | false | false | 24,091 | r |
# This function writes the data frame into a csv file
write.csv <- function(ob,filename){
write.table(ob, filename, quote=FALSE, sep=",", row.names=FALSE)
}
# This function reads the file or the address, and downloads the data, and then ultimately inputs into a data frame
readIt <- function(address) {
web_page <... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sdp_supply.R
\name{sdp_supply}
\alias{sdp_supply}
\title{Stochastic Dynamic Programming for water supply reservoirs}
\usage{
sdp_supply(Q, capacity, target, surface_area, max_depth, evap, S_disc = 1000,
R_disc = 10, Q_disc = c(0, 0.2375, 0.... | /man/sdp_supply.Rd | no_license | pslota/reservoir | R | false | true | 3,521 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sdp_supply.R
\name{sdp_supply}
\alias{sdp_supply}
\title{Stochastic Dynamic Programming for water supply reservoirs}
\usage{
sdp_supply(Q, capacity, target, surface_area, max_depth, evap, S_disc = 1000,
R_disc = 10, Q_disc = c(0, 0.2375, 0.... |
# Load data and packages
work_dir <- "C:/research/transform_fun/vbet_validation/vbet_validation"
setwd(work_dir)
evidence <-read.csv("vbet_evidence_03.csv")
library(ggplot2)
library(DBI)
library(tidyverse)
library(RSQLite)
# Change data type of category to factor
evidence$categoryid = as.factor(evidence$categoryid)
... | /vbet_evidence_02.R | no_license | shelbysawyer/vbet_validation | R | false | false | 14,423 | r | # Load data and packages
work_dir <- "C:/research/transform_fun/vbet_validation/vbet_validation"
setwd(work_dir)
evidence <-read.csv("vbet_evidence_03.csv")
library(ggplot2)
library(DBI)
library(tidyverse)
library(RSQLite)
# Change data type of category to factor
evidence$categoryid = as.factor(evidence$categoryid)
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/QstFstComp.R
\name{QstFstComp}
\alias{QstFstComp}
\title{Compare Qst to Fst}
\usage{
QstFstComp(fst.dat, qst.dat, numpops, nsim = 1000, AFLP = FALSE,
breeding.design, dam.offspring.relatedness = 0.25, output = "concise")
}
\arguments{
\item... | /man/QstFstComp.Rd | no_license | kjgilbert/QstFstComp | R | false | true | 5,765 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/QstFstComp.R
\name{QstFstComp}
\alias{QstFstComp}
\title{Compare Qst to Fst}
\usage{
QstFstComp(fst.dat, qst.dat, numpops, nsim = 1000, AFLP = FALSE,
breeding.design, dam.offspring.relatedness = 0.25, output = "concise")
}
\arguments{
\item... |
install.packages("wru", dependencies = T)
install.packages("Rfacebook", dependencies = T)
install.packages("gender", dependencies = T)
install.packages("tidyr", dependencies = T)
install.packages("plyr", dependencies = T)
install.packages("stringr", dependencies = T)
install.packages("devtools", dependencies = T)
insta... | /SensitivityAnalysis_FacebookUsersProfiles_BreastCancer.R | no_license | ckineza/Portfolio | R | false | false | 39,678 | r | install.packages("wru", dependencies = T)
install.packages("Rfacebook", dependencies = T)
install.packages("gender", dependencies = T)
install.packages("tidyr", dependencies = T)
install.packages("plyr", dependencies = T)
install.packages("stringr", dependencies = T)
install.packages("devtools", dependencies = T)
insta... |
setClass("relFits", contains = "list")
`relFits` <-
function (object, FUN, applyFUN2X = function(X, FUN, ...) FUN(X,
...), refName = "Ref", ...)
{
return(new("relFits",
lapply(object, function(i) {
index.Ref.relFits <- which(names(i) == refName)
if (is.numeric(refName))
... | /R/relFits.R | no_license | cran/similarityRichards | R | false | false | 748 | r | setClass("relFits", contains = "list")
`relFits` <-
function (object, FUN, applyFUN2X = function(X, FUN, ...) FUN(X,
...), refName = "Ref", ...)
{
return(new("relFits",
lapply(object, function(i) {
index.Ref.relFits <- which(names(i) == refName)
if (is.numeric(refName))
... |
/第8章 判别分析.R | no_license | yyleon/data-mining-r-in-action | R | false | false | 5,279 | r | ||
### merge results
library(tidyverse)
library(tidyr)
### work flow
## upload time stats
## converge all nodes per species
## converge all species
## calculate suitability per node position
## calculate suitability per node (if 1 position suitable, node is suitable)
## format
# TimePeriod position water_year Probabilit... | /scripts/results/migration_in_velocity_results.R | no_license | ksirving/flow_eco_mech | R | false | false | 8,321 | r | ### merge results
library(tidyverse)
library(tidyr)
### work flow
## upload time stats
## converge all nodes per species
## converge all species
## calculate suitability per node position
## calculate suitability per node (if 1 position suitable, node is suitable)
## format
# TimePeriod position water_year Probabilit... |
\alias{cairoGlyphExtents}
\name{cairoGlyphExtents}
\title{cairoGlyphExtents}
\description{Gets the extents for a list of glyphs. The extents describe a
user-space rectangle that encloses the "inked" portion of the
glyphs, (as they would be drawn by \code{\link{cairoShowGlyphs}}).
Additionally, the x\_advance and y\_adv... | /man/cairoGlyphExtents.Rd | no_license | cran/RGtk2.10 | R | false | false | 1,011 | rd | \alias{cairoGlyphExtents}
\name{cairoGlyphExtents}
\title{cairoGlyphExtents}
\description{Gets the extents for a list of glyphs. The extents describe a
user-space rectangle that encloses the "inked" portion of the
glyphs, (as they would be drawn by \code{\link{cairoShowGlyphs}}).
Additionally, the x\_advance and y\_adv... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/xtractor.R
\name{Xtractor}
\alias{Xtractor}
\title{R6 Object for Feature Extraction.}
\format{
\code{\link{R6Class}} object.
}
\description{
\code{Xtractor} calculates features from raw data for each ID of a grouping variable individually. Th... | /man/Xtractor.Rd | no_license | stjordanis/fxtract | R | false | true | 5,353 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/xtractor.R
\name{Xtractor}
\alias{Xtractor}
\title{R6 Object for Feature Extraction.}
\format{
\code{\link{R6Class}} object.
}
\description{
\code{Xtractor} calculates features from raw data for each ID of a grouping variable individually. Th... |
#fix endpoint
#croissant
size=30
kbt=1
lattice_cho1=matrix(nrow=size, ncol=size)
lattice_cho2=matrix(nrow=size, ncol=size)
totalcho=2
centerarea=1
lengthofchoarray=c(11,6,8,5)
totallengthofcho=sum(lengthofchoarray)
#record coordinace
choi=matrix(nrow=totalcho, ncol=sum(lengthofchoarray))
choj=matrix(nrow... | /test_freq_of_encounter.R | no_license | MikawaFumika/Lattice_KMC_Polymerase-DNA-movement-simulation | R | false | false | 38,421 | r |
#fix endpoint
#croissant
size=30
kbt=1
lattice_cho1=matrix(nrow=size, ncol=size)
lattice_cho2=matrix(nrow=size, ncol=size)
totalcho=2
centerarea=1
lengthofchoarray=c(11,6,8,5)
totallengthofcho=sum(lengthofchoarray)
#record coordinace
choi=matrix(nrow=totalcho, ncol=sum(lengthofchoarray))
choj=matrix(nrow... |
library(plyr)
library(tidyverse)
library(janitor)
library(lubridate)
library(plotly)
library(shiny)
library(shinythemes)
library(shinycssloaders)
library(DT)
library(readxl)
library(shinyBS)
library(auth0)
library(aws.s3)
library(shinydisconnect)
library(shinyjs)
library(shinyWidgets)
library(ggthemes)
# ---- Loading ... | /app.R | no_license | shreykhetrapal/big_mac_analysis | R | false | false | 9,492 | r | library(plyr)
library(tidyverse)
library(janitor)
library(lubridate)
library(plotly)
library(shiny)
library(shinythemes)
library(shinycssloaders)
library(DT)
library(readxl)
library(shinyBS)
library(auth0)
library(aws.s3)
library(shinydisconnect)
library(shinyjs)
library(shinyWidgets)
library(ggthemes)
# ---- Loading ... |
#' Accumulated variation in year
#'
#' @description
#' cuminyear calculates an accumulated variation in year of a index.
#' Data must be start in january, use start to set this,
#' if you data don't start in january and you need
#' use this values, consider complete the previous months with 0.
#'
#' @param d... | /R/cuminyear.R | no_license | cran/metools | R | false | false | 2,632 | r | #' Accumulated variation in year
#'
#' @description
#' cuminyear calculates an accumulated variation in year of a index.
#' Data must be start in january, use start to set this,
#' if you data don't start in january and you need
#' use this values, consider complete the previous months with 0.
#'
#' @param d... |
library("future.apply")
source("incl/start,load-only.R")
| /tests/incl/start.R | no_license | HenrikBengtsson/future.apply | R | false | false | 57 | r | library("future.apply")
source("incl/start,load-only.R")
|
createMeasureFilename <- function(m_name, geo_level = "lsoa") {
g_lev <- ifelse(geo_level == "lsoa", "lsoa", "site")
return(paste0("measures/", m_name, " measure - ", g_lev, " - ", format(Sys.time(), "%Y-%m-%d %H.%M"), ".Rda"))
}
fillDataPoints <- function(data, count_data = TRUE, lsoa_level = TRUE, crop = TRUE)... | /R/auxillary functions.R | no_license | tony-stone/rclosed | R | false | false | 12,526 | r | createMeasureFilename <- function(m_name, geo_level = "lsoa") {
g_lev <- ifelse(geo_level == "lsoa", "lsoa", "site")
return(paste0("measures/", m_name, " measure - ", g_lev, " - ", format(Sys.time(), "%Y-%m-%d %H.%M"), ".Rda"))
}
fillDataPoints <- function(data, count_data = TRUE, lsoa_level = TRUE, crop = TRUE)... |
weight<-c(72.2,67.8,78.0,64.4,76.3,72.3,73.1,71.7,66.2,63.3,85.4,67.4,
66.3,76.3,57.7,50.3,77.4,63.1,73.9,67.4,74.7,68.2,87.4,86.4,
69.4,58.0,63.3,72.7,73.6,68.8,63.3,63.3,73.0,64.8,73.1,70.9,
85.9,74.4,75.9,72.3,84.3,61.8,79.2,64.3,65.4,66.7,77.2,50.0,
70.3,90.4,63.9,62.1,68.2,55.1,52.6,68.5,55.2,73.5,53.7,61.7,
... | /Miller_And_Freund_S_Probability_And_Statistics_For_Engineers_by_Richard_A._Johnson/CH5/EX5.8/EX5_8.R | permissive | FOSSEE/R_TBC_Uploads | R | false | false | 967 | r | weight<-c(72.2,67.8,78.0,64.4,76.3,72.3,73.1,71.7,66.2,63.3,85.4,67.4,
66.3,76.3,57.7,50.3,77.4,63.1,73.9,67.4,74.7,68.2,87.4,86.4,
69.4,58.0,63.3,72.7,73.6,68.8,63.3,63.3,73.0,64.8,73.1,70.9,
85.9,74.4,75.9,72.3,84.3,61.8,79.2,64.3,65.4,66.7,77.2,50.0,
70.3,90.4,63.9,62.1,68.2,55.1,52.6,68.5,55.2,73.5,53.7,61.7,
... |
######################################################################
# Population growth of structured population: Matrix Model
#
# Dec 1, 2020
#
######################################################################
#setwd("/YC_THU_MAC/Teaching_talk/Fall_2020/Biological_modeling/Lecture/Matrix_model/Lab")
## Cre... | /lab_matrix_model.R | no_license | yichingtree/Matrix_model | R | false | false | 2,327 | r | ######################################################################
# Population growth of structured population: Matrix Model
#
# Dec 1, 2020
#
######################################################################
#setwd("/YC_THU_MAC/Teaching_talk/Fall_2020/Biological_modeling/Lecture/Matrix_model/Lab")
## Cre... |
library(Rfast2)
### Name: Sample quantiles and col/row wise quantiles
### Title: Sample quantiles and col/row wise quantiles
### Aliases: Quantile colQuantile rowQuantile
### Keywords: Sample Quantiles and col - row wise Quantiles
### ** Examples
x<-rnorm(1000)
probs<-runif(10)
sum( quantile(x, probs = probs) - Qua... | /data/genthat_extracted_code/Rfast2/examples/Quantile.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 341 | r | library(Rfast2)
### Name: Sample quantiles and col/row wise quantiles
### Title: Sample quantiles and col/row wise quantiles
### Aliases: Quantile colQuantile rowQuantile
### Keywords: Sample Quantiles and col - row wise Quantiles
### ** Examples
x<-rnorm(1000)
probs<-runif(10)
sum( quantile(x, probs = probs) - Qua... |
## Caching the Inverse of a Matrix:
## Matrix inversion is usually a costly computation and there may be some
## benefit to caching the inverse of a matrix rather than compute it repeatedly.
## Below are a pair of functions that are used to create a special object that
## stores a matrix and caches its inverse.
... | /cachematrix.R | no_license | bk47124/ProgrammingAssignment2 | R | false | false | 1,203 | r | ## Caching the Inverse of a Matrix:
## Matrix inversion is usually a costly computation and there may be some
## benefit to caching the inverse of a matrix rather than compute it repeatedly.
## Below are a pair of functions that are used to create a special object that
## stores a matrix and caches its inverse.
... |
#' A data frame with per-game team season summary data from the 2017 NBA season
#'
#' This data frame contains one row for each team in the 2016-17
#' NBA season. Features of this dataset include win-loss record,
#' shooting statistics, rebounds, assists, blocks, steals, fouls,
#' and points, averaged out on a per-game... | /R/seasonStats2017_perGame.R | no_license | kitliu5/nbamodelR | R | false | false | 407 | r | #' A data frame with per-game team season summary data from the 2017 NBA season
#'
#' This data frame contains one row for each team in the 2016-17
#' NBA season. Features of this dataset include win-loss record,
#' shooting statistics, rebounds, assists, blocks, steals, fouls,
#' and points, averaged out on a per-game... |
testlist <- list(x = structure(c(1.38425385697535e-101, 0, 0, 0, 0), .Dim = c(5L, 1L)))
result <- do.call(multivariance:::doubleCenterBiasCorrectedUpper,testlist)
str(result) | /multivariance/inst/testfiles/doubleCenterBiasCorrectedUpper/libFuzzer_doubleCenterBiasCorrectedUpper/doubleCenterBiasCorrectedUpper_valgrind_files/1612884386-test.R | no_license | akhikolla/updatedatatype-list3 | R | false | false | 175 | r | testlist <- list(x = structure(c(1.38425385697535e-101, 0, 0, 0, 0), .Dim = c(5L, 1L)))
result <- do.call(multivariance:::doubleCenterBiasCorrectedUpper,testlist)
str(result) |
testlist <- list(rates = numeric(0), thresholds = numeric(0), x = c(2261634.50980392, 6.31088822361473e-28, NaN, 6.51876482064315e-311, NaN, 8.6221612017154e-308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
result <- d... | /grattan/inst/testfiles/IncomeTax/libFuzzer_IncomeTax/IncomeTax_valgrind_files/1610125453-test.R | no_license | akhikolla/updated-only-Issues | R | false | false | 367 | r | testlist <- list(rates = numeric(0), thresholds = numeric(0), x = c(2261634.50980392, 6.31088822361473e-28, NaN, 6.51876482064315e-311, NaN, 8.6221612017154e-308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
result <- d... |
rm(list = ls())
setwd(dirname(parent.frame(2)$ofile))
library(ggplot2)
library(plyr)
library(dplyr)
library(tidyr)
library(readr)
source('./_function_task_expand_name.r')
source('./_function_task_table.r')
best.range = 5000
best.model.step.fn = function (errors) {
best.step = max(length(errors) - best.range, 0) + ... | /export/function_task_static_ablation.r | permissive | AndreasMadsen/stable-nalu | R | false | false | 3,641 | r | rm(list = ls())
setwd(dirname(parent.frame(2)$ofile))
library(ggplot2)
library(plyr)
library(dplyr)
library(tidyr)
library(readr)
source('./_function_task_expand_name.r')
source('./_function_task_table.r')
best.range = 5000
best.model.step.fn = function (errors) {
best.step = max(length(errors) - best.range, 0) + ... |
###.............................................................................
# (c) Miguel Camacho Sánchez
# miguelcamachosanchez@gmail.com // miguelcamachosanchez.weebly.com
# https://scholar.google.co.uk/citations?user=1M02-S4AAAAJ&hl=en
# June 2019
###................................................................. | /code/Figures/15-map_diversity.R | no_license | csmiguel/usat_snp | R | false | false | 6,251 | r | ###.............................................................................
# (c) Miguel Camacho Sánchez
# miguelcamachosanchez@gmail.com // miguelcamachosanchez.weebly.com
# https://scholar.google.co.uk/citations?user=1M02-S4AAAAJ&hl=en
# June 2019
###................................................................. |
#### IF ####
# simple if call without else and empty body
test_that("flow_data works with simple if and empty body",{
fun <- function(x) {
if(x) {}
}
data <- flow_data(fun)
# flow_data(fun)
# dput2(data$nodes[1:4])
# dput2(data$edges)
expect_equal(
data$nodes[1:4],
data.frame(
id = c(0... | /tests/testthat/test-02_flow_data_if.R | no_license | yuewangpanda/flow | R | false | false | 5,888 | r |
#### IF ####
# simple if call without else and empty body
test_that("flow_data works with simple if and empty body",{
fun <- function(x) {
if(x) {}
}
data <- flow_data(fun)
# flow_data(fun)
# dput2(data$nodes[1:4])
# dput2(data$edges)
expect_equal(
data$nodes[1:4],
data.frame(
id = c(0... |
library(ape)
testtree <- read.tree("7028_0.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="7028_0_unrooted.txt") | /codeml_files/newick_trees_processed/7028_0/rinput.R | no_license | DaniBoo/cyanobacteria_project | R | false | false | 135 | r | library(ape)
testtree <- read.tree("7028_0.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="7028_0_unrooted.txt") |
\name{summary.randomLCA}
\alias{summary.randomLCA}
\title{Summary for randomLCA object}
\description{
Summarises the fit of a randomLCA object.
}
\usage{
\method{summary}{randomLCA}(object, \ldots)
}
\arguments{
\item{object}{randomLCA object}
\item{\dots}{ additional argument; currently none is used. }
}
\value{
... | /man/summary.randomLCA.Rd | no_license | agisga/randomLCA | R | false | false | 1,063 | rd | \name{summary.randomLCA}
\alias{summary.randomLCA}
\title{Summary for randomLCA object}
\description{
Summarises the fit of a randomLCA object.
}
\usage{
\method{summary}{randomLCA}(object, \ldots)
}
\arguments{
\item{object}{randomLCA object}
\item{\dots}{ additional argument; currently none is used. }
}
\value{
... |
# an example from the last class:
# file: Advertising.csv
ads = read.csv('Advertising.csv')
names(ads)
# use TV, Radio, Newspaper as predictors for Sales:
ads.lm1 = lm(Sales~., data=ads)
ads.lm1 = step(ads.lm1)
summary(ads.lm1)
# Multiple R-squared: 0.8972,
# so, only Radio and TV are (very) good predictors!
# ... | /25-09-19-Regression-2.R | no_license | tush99m/R-Code | R | false | false | 4,119 | r |
# an example from the last class:
# file: Advertising.csv
ads = read.csv('Advertising.csv')
names(ads)
# use TV, Radio, Newspaper as predictors for Sales:
ads.lm1 = lm(Sales~., data=ads)
ads.lm1 = step(ads.lm1)
summary(ads.lm1)
# Multiple R-squared: 0.8972,
# so, only Radio and TV are (very) good predictors!
# ... |
# $Id: dea.direct.R 219 2020-05-21 23:58:50Z lao $
dea.direct <- function(X,Y, DIRECT, RTS="vrs", ORIENTATION="in",
XREF=NULL, YREF=NULL, FRONT.IDX=NULL, SLACK=FALSE,
param=NULL, TRANSPOSE=FALSE) {
orientation <- c("in-out","in","out","graph")
if ( is.numeric(OR... | /Benchmarking/R/dea.direct.R | no_license | akhikolla/InformationHouse | R | false | false | 2,533 | r | # $Id: dea.direct.R 219 2020-05-21 23:58:50Z lao $
dea.direct <- function(X,Y, DIRECT, RTS="vrs", ORIENTATION="in",
XREF=NULL, YREF=NULL, FRONT.IDX=NULL, SLACK=FALSE,
param=NULL, TRANSPOSE=FALSE) {
orientation <- c("in-out","in","out","graph")
if ( is.numeric(OR... |
\name{loss}
\alias{loss}
\title{Loss function}
\usage{
loss(vector1, vector2)
}
\arguments{
\item{vector1}{first vector}
\item{vector2}{second vector}
}
\description{
Computes the root mean squared difference or percentage
difference of two numeric or two two-level factors
respectively.
}
\details{
The f... | /man/loss.Rd | no_license | austian/Blend | R | false | false | 574 | rd | \name{loss}
\alias{loss}
\title{Loss function}
\usage{
loss(vector1, vector2)
}
\arguments{
\item{vector1}{first vector}
\item{vector2}{second vector}
}
\description{
Computes the root mean squared difference or percentage
difference of two numeric or two two-level factors
respectively.
}
\details{
The f... |
#Reading data
power <- read.table("household_power_consumption.txt",skip=1,sep=";")
# Naming power
names(power) <- c("Date","Time","Global_active_power","Global_reactive_power",
"Voltage","Global_intensity","Sub_metering_1","Sub_metering_2","Sub_metering_3")
# Selecting from power
subpower <- ... | /plot1.R | no_license | JLandion/ExData_Plotting1 | R | false | false | 614 | r | #Reading data
power <- read.table("household_power_consumption.txt",skip=1,sep=";")
# Naming power
names(power) <- c("Date","Time","Global_active_power","Global_reactive_power",
"Voltage","Global_intensity","Sub_metering_1","Sub_metering_2","Sub_metering_3")
# Selecting from power
subpower <- ... |
library(ggplot2)
library(dplyr)
library(tidyr)
# Create variable 'log' that contains the paths of the scripts and workspaces (.RData)
source("./paths.R")
z<-data.frame(row.names=c("Especialista","Generalista"))
z1<-data.frame()
z2<-data.frame()
w<-data.frame(row.names=c("Desktop","Mobile","Desktop e Mobile"))
w1<-da... | /graficos/GenEsp_MobDes.R | no_license | danieldlmt/bib | R | false | false | 3,869 | r | library(ggplot2)
library(dplyr)
library(tidyr)
# Create variable 'log' that contains the paths of the scripts and workspaces (.RData)
source("./paths.R")
z<-data.frame(row.names=c("Especialista","Generalista"))
z1<-data.frame()
z2<-data.frame()
w<-data.frame(row.names=c("Desktop","Mobile","Desktop e Mobile"))
w1<-da... |
## source functions for analysis
#source("/Users/ewhalen/Rscripts/ModAnFun.R")
#source("/Users/ewhalen/Rscripts/Preprocessing.R")
## path for file locations
#path<-"/Users/ewhalen/Software/ModuleMap/ModuleAnalysis/"
params <- commandArgs(trailingOnly = T)
workdir <- params[1]
scriptdir <- paste(workdir, "/scripts", se... | /ModuleAnalysis.R | permissive | BenaroyaResearch/gxrscripts | R | false | false | 5,764 | r | ## source functions for analysis
#source("/Users/ewhalen/Rscripts/ModAnFun.R")
#source("/Users/ewhalen/Rscripts/Preprocessing.R")
## path for file locations
#path<-"/Users/ewhalen/Software/ModuleMap/ModuleAnalysis/"
params <- commandArgs(trailingOnly = T)
workdir <- params[1]
scriptdir <- paste(workdir, "/scripts", se... |
\name{BOD}
\alias{BOD}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Benthic oxygen demand
%% ~~function to do ... ~~
}
\description{
Calculate the benthic oxygen demand of a coastal sediment for given conditions.
%% ~~ A concise (1-5 lines) description of what the function does. ~~
}
\usage{... | /man/BOD.Rd | no_license | DanielReedOcean/COOLBEANS | R | false | false | 2,094 | rd | \name{BOD}
\alias{BOD}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Benthic oxygen demand
%% ~~function to do ... ~~
}
\description{
Calculate the benthic oxygen demand of a coastal sediment for given conditions.
%% ~~ A concise (1-5 lines) description of what the function does. ~~
}
\usage{... |
library(freestats)
### Name: classify
### Title: Generic classify function
### Aliases: classify
### ** Examples
set.seed(1024)
z <- runif(n=5)
mydata <- fakedata(w=z,n=100)
X<- mydata$S[,1:4]
y <- mydata$y
w <- rep(1/100,100)
pars <- decisionStump(X=X,w=w,y=y)
classify(pars,X)
| /data/genthat_extracted_code/freestats/examples/classify.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 286 | r | library(freestats)
### Name: classify
### Title: Generic classify function
### Aliases: classify
### ** Examples
set.seed(1024)
z <- runif(n=5)
mydata <- fakedata(w=z,n=100)
X<- mydata$S[,1:4]
y <- mydata$y
w <- rep(1/100,100)
pars <- decisionStump(X=X,w=w,y=y)
classify(pars,X)
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Mode.R
\name{Mode}
\alias{Mode}
\title{Mode}
\usage{
Mode(x, na.rm = FALSE)
}
\arguments{
\item{x}{A vector.}
\item{na.rm}{A single logical value; should NAs be removed before proceeding?}
}
\value{
The mode of x. If there are several modes,... | /man/Mode.Rd | no_license | eheinzen/Ethan | R | false | true | 602 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Mode.R
\name{Mode}
\alias{Mode}
\title{Mode}
\usage{
Mode(x, na.rm = FALSE)
}
\arguments{
\item{x}{A vector.}
\item{na.rm}{A single logical value; should NAs be removed before proceeding?}
}
\value{
The mode of x. If there are several modes,... |
## Practice using data.table
library(data.table)
DT <- data.table(x=rnorm(9),y=rep(c("a","b","c"),each=3),z=rnorm(9))
DT
DT[2,]
DT[2]
DT[2:4]
DT[2:4,]
DT[,2]
DT[,x]
DT[,y]
DT[,table(y)]
DT[,sum(z)]
DT[,summary(z)]
DT[,list(summary(x),summary(z))]
DT[,w:=z^2]
DT1 <- data.table(x=c('a','a','b','dt1'),y=1:4)
DT1
DT2 <- d... | /Week1.R | no_license | Wondamike7/Coursera-GettingAndCleaningData | R | false | false | 443 | r | ## Practice using data.table
library(data.table)
DT <- data.table(x=rnorm(9),y=rep(c("a","b","c"),each=3),z=rnorm(9))
DT
DT[2,]
DT[2]
DT[2:4]
DT[2:4,]
DT[,2]
DT[,x]
DT[,y]
DT[,table(y)]
DT[,sum(z)]
DT[,summary(z)]
DT[,list(summary(x),summary(z))]
DT[,w:=z^2]
DT1 <- data.table(x=c('a','a','b','dt1'),y=1:4)
DT1
DT2 <- d... |
library(lmerTest)
library(tidyverse)
pron_fra %>%
filter(participant == 'CHI') %>%
mutate(share = share*100) %>%
# mutate(pronoun = ifelse(pronoun=='1sg'|pronoun=='1pl','1', pronoun)) %>%
# filter(pronoun == '2' | pronoun == '1' | pronoun == '3') %>%
mutate(language = 'fra') %>%
select(-path, -languge)... | /linear mixed comparison.R | no_license | flying-bear/FLA | R | false | false | 7,474 | r | library(lmerTest)
library(tidyverse)
pron_fra %>%
filter(participant == 'CHI') %>%
mutate(share = share*100) %>%
# mutate(pronoun = ifelse(pronoun=='1sg'|pronoun=='1pl','1', pronoun)) %>%
# filter(pronoun == '2' | pronoun == '1' | pronoun == '3') %>%
mutate(language = 'fra') %>%
select(-path, -languge)... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{quadHSIC}
\alias{quadHSIC}
\title{Determines the quadratic form of the HSIC unbiased estimator}
\usage{
quadHSIC(K)
}
\arguments{
\item{K}{kernel similarity matrix}
}
\value{
the matrix of the HSIC estimator quadratic form... | /man/quadHSIC.Rd | no_license | EpiSlim/kernelPSI | R | false | true | 747 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{quadHSIC}
\alias{quadHSIC}
\title{Determines the quadratic form of the HSIC unbiased estimator}
\usage{
quadHSIC(K)
}
\arguments{
\item{K}{kernel similarity matrix}
}
\value{
the matrix of the HSIC estimator quadratic form... |
##### Header #####
# Author: Matthew H. Grinnell
# Affiliation: Pacific Biological Station, Fisheries and Oceans Canada (DFO)
# Group: Quantitative Assessment Methods Section
# Address: 3190 Hammond Bay Road, Nanaimo, BC, Canada, V9T 6N7
# Contact: e-mail: Matthew.Grinnell@dfo-mpo.gc.ca | tel: (... | /R/example.R | no_license | Shawkshaw/csas-style-sr | R | false | false | 6,727 | r | ##### Header #####
# Author: Matthew H. Grinnell
# Affiliation: Pacific Biological Station, Fisheries and Oceans Canada (DFO)
# Group: Quantitative Assessment Methods Section
# Address: 3190 Hammond Bay Road, Nanaimo, BC, Canada, V9T 6N7
# Contact: e-mail: Matthew.Grinnell@dfo-mpo.gc.ca | tel: (... |
# Multiple Linear Regression
# Importing the dataset
dataset = read.csv('50_Startups.csv')
# Encoding categorical data
dataset$State = factor(dataset$State,
levels = c('New York', 'California', 'Florida'),
labels = c(1, 2, 3))
# Splitting the dataset into the Training set and Test set
# instal... | /Part 2 - Regression/Multiple Linear Regression/multiple_linear_regression.R | no_license | niharika-cnr/Machine-Learning-A-Z | R | false | false | 1,521 | r | # Multiple Linear Regression
# Importing the dataset
dataset = read.csv('50_Startups.csv')
# Encoding categorical data
dataset$State = factor(dataset$State,
levels = c('New York', 'California', 'Florida'),
labels = c(1, 2, 3))
# Splitting the dataset into the Training set and Test set
# instal... |
# ------------------------------------------------------------------------------------------------------------------------
# P L O T - 1
#
# Histogram by Global Active Power
#
# ------------------------------------------------------------------------------------------------------------------------
# Load the data
sour... | /plot1.R | no_license | eduardogtc/ExData_Plotting1 | R | false | false | 523 | r | # ------------------------------------------------------------------------------------------------------------------------
# P L O T - 1
#
# Histogram by Global Active Power
#
# ------------------------------------------------------------------------------------------------------------------------
# Load the data
sour... |
#' @details
#' \code{rec}: Epi Info file via \code{foreign::\link[foreign]{read.epiinfo}}
#'
#' @usage NULL
#' @rdname reader
#' @export
reader.dataformat.epiinfo <- function(x, ...)
{
.require.package('foreign')
read_atomic(x, .f = foreign::read.epiinfo)
}
| /R/reader.epiinfo.R | no_license | krlmlr/LoadMyData | R | false | false | 262 | r | #' @details
#' \code{rec}: Epi Info file via \code{foreign::\link[foreign]{read.epiinfo}}
#'
#' @usage NULL
#' @rdname reader
#' @export
reader.dataformat.epiinfo <- function(x, ...)
{
.require.package('foreign')
read_atomic(x, .f = foreign::read.epiinfo)
}
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{possible_langs}
\alias{possible_langs}
\title{Languages codes synthesisr can recognize}
\format{A database with 53 rows of 4 variables:
\describe{
\item{Short}{the short form language code}
\item{Language}{the ... | /man/possible_langs.Rd | no_license | dhofstetter/synthesisr | R | false | true | 730 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{possible_langs}
\alias{possible_langs}
\title{Languages codes synthesisr can recognize}
\format{A database with 53 rows of 4 variables:
\describe{
\item{Short}{the short form language code}
\item{Language}{the ... |
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31640717091006e+77, 9.53818252170339e+295, 1.22810536108214e+146, 4.12396251261199e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(8L, 3L)))
result <- do.call(CNull:::communities_individual_based_sampling_alpha,testlist)
st... | /CNull/inst/testfiles/communities_individual_based_sampling_alpha/AFL_communities_individual_based_sampling_alpha/communities_individual_based_sampling_alpha_valgrind_files/1615784190-test.R | no_license | akhikolla/updatedatatype-list2 | R | false | false | 329 | r | testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31640717091006e+77, 9.53818252170339e+295, 1.22810536108214e+146, 4.12396251261199e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(8L, 3L)))
result <- do.call(CNull:::communities_individual_based_sampling_alpha,testlist)
st... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{spat_summary}
\alias{spat_summary}
\title{spat_summary}
\usage{
spat_summary(
rasts,
shp,
attr_id = NULL,
name_to = "timescale",
fun,
as_spatial = FALSE,
...
)
}
\arguments{
\item{rasts}{A \code{terra::rast} that z... | /man/spat_summary.Rd | permissive | mt-climate-office/mt-normals | R | false | true | 1,090 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{spat_summary}
\alias{spat_summary}
\title{spat_summary}
\usage{
spat_summary(
rasts,
shp,
attr_id = NULL,
name_to = "timescale",
fun,
as_spatial = FALSE,
...
)
}
\arguments{
\item{rasts}{A \code{terra::rast} that z... |
library(pdftools)
library(dplyr, warn.conflicts = F)
library(readr)
# regexpr utile
rrracine <- '[0-9]{2}[A-Z][0-9]{2}[1234ABCDZTEJ]?'
# Télécharger le pdf du jo, 2017 ici
# https://www.legifrance.gouv.fr/jo_pdf.do?id=JORFTEXT000034203360
# 2017
pdf_text('pdf/mco//joe_20170317_0065_0016.pdf') -> u
# 2018
# pdf_text('... | /pgm/mco/prog_ghs.R | permissive | GuillaumePressiat/scrapatih | R | false | false | 6,669 | r | library(pdftools)
library(dplyr, warn.conflicts = F)
library(readr)
# regexpr utile
rrracine <- '[0-9]{2}[A-Z][0-9]{2}[1234ABCDZTEJ]?'
# Télécharger le pdf du jo, 2017 ici
# https://www.legifrance.gouv.fr/jo_pdf.do?id=JORFTEXT000034203360
# 2017
pdf_text('pdf/mco//joe_20170317_0065_0016.pdf') -> u
# 2018
# pdf_text('... |
#-----------------------------------------------------------------------
#import
library(ggplot2)
library(lme4)
load("exp_data_with_correctness.Rdata")
#---------------------------------------------------------------------
#filter to relevant data
#remove unnecessary columns
exp.data <- filtered.data[, ! names(fi... | /analysis.R | no_license | lukavdplas/expl-analysis | R | false | false | 7,897 | r | #-----------------------------------------------------------------------
#import
library(ggplot2)
library(lme4)
load("exp_data_with_correctness.Rdata")
#---------------------------------------------------------------------
#filter to relevant data
#remove unnecessary columns
exp.data <- filtered.data[, ! names(fi... |
data(mtcars)
mtcars = apply_labels(mtcars,
mpg = "Miles/(US) gallon",
cyl = "Number of cylinders",
disp = "Displacement (cu.in.)",
hp = "Gross horsepower",
drat = "Rear axle ratio",
wt = "... | /tests/testthat/test_significance_means.R | no_license | bookman900/expss | R | false | false | 12,837 | r | data(mtcars)
mtcars = apply_labels(mtcars,
mpg = "Miles/(US) gallon",
cyl = "Number of cylinders",
disp = "Displacement (cu.in.)",
hp = "Gross horsepower",
drat = "Rear axle ratio",
wt = "... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lightsail_operations.R
\name{lightsail_delete_instance_snapshot}
\alias{lightsail_delete_instance_snapshot}
\title{Deletes a specific snapshot of a virtual private server (or instance)}
\usage{
lightsail_delete_instance_snapshot(instanceSnaps... | /cran/paws.compute/man/lightsail_delete_instance_snapshot.Rd | permissive | paws-r/paws | R | false | true | 637 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lightsail_operations.R
\name{lightsail_delete_instance_snapshot}
\alias{lightsail_delete_instance_snapshot}
\title{Deletes a specific snapshot of a virtual private server (or instance)}
\usage{
lightsail_delete_instance_snapshot(instanceSnaps... |
\name{DSFP}
\alias{DSFP}
\title{Abstract Class for Frequent Pattern Mining Algorithms for Data Streams}
\description{Abstract class for frequent pattern mining algorithms for data
streams. Currently,
\pkg{stream} does not implement frequent pattern mining algorithms.
}
%\details{
%}
\seealso{
\code{\link{DST}}
}
... | /stream/man/DSFP.Rd | no_license | akhikolla/TestedPackages-NoIssues | R | false | false | 352 | rd | \name{DSFP}
\alias{DSFP}
\title{Abstract Class for Frequent Pattern Mining Algorithms for Data Streams}
\description{Abstract class for frequent pattern mining algorithms for data
streams. Currently,
\pkg{stream} does not implement frequent pattern mining algorithms.
}
%\details{
%}
\seealso{
\code{\link{DST}}
}
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/delete-metadata.R
\name{sf_delete_metadata}
\alias{sf_delete_metadata}
\title{Delete Object or Field Metadata in Salesforce}
\usage{
sf_delete_metadata(metadata_type, object_names, control = list(...), ...,
verbose = FALSE)
}
\arguments{
\i... | /man/sf_delete_metadata.Rd | permissive | TonyWhiteSMS/salesforcer | R | false | true | 1,313 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/delete-metadata.R
\name{sf_delete_metadata}
\alias{sf_delete_metadata}
\title{Delete Object or Field Metadata in Salesforce}
\usage{
sf_delete_metadata(metadata_type, object_names, control = list(...), ...,
verbose = FALSE)
}
\arguments{
\i... |
library(ape)
testtree <- read.tree("1539_1.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="1539_1_unrooted.txt") | /codeml_files/newick_trees_processed/1539_1/rinput.R | no_license | DaniBoo/cyanobacteria_project | R | false | false | 135 | r | library(ape)
testtree <- read.tree("1539_1.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="1539_1_unrooted.txt") |
#' Generalized Method of Moments Valid Moment Combinations for Longitudinal Proportion Responses, User-Defined Types
#'
#' This function calculates the values of valid moment combinations for two-step Generalized Method of Moments with user-defined types of time-dependent covariates, applied to longitudinal data wit... | /R/validMCBeta_Types.R | no_license | lalondetl/GMM | R | false | false | 5,142 | r |
#' Generalized Method of Moments Valid Moment Combinations for Longitudinal Proportion Responses, User-Defined Types
#'
#' This function calculates the values of valid moment combinations for two-step Generalized Method of Moments with user-defined types of time-dependent covariates, applied to longitudinal data wit... |
library(nc)
library(testthat)
context("alternatives")
test_that("error for no arguments to alternatives", {
expect_error({
alternatives()
}, "alternatives should have at least two arguments")
})
test_that("error for one argument to alternatives", {
expect_error({
alternatives("pattern")
}, "alternativ... | /tests/testthat/test-CRAN-alternatives.R | no_license | MichaelChirico/nc | R | false | false | 1,512 | r | library(nc)
library(testthat)
context("alternatives")
test_that("error for no arguments to alternatives", {
expect_error({
alternatives()
}, "alternatives should have at least two arguments")
})
test_that("error for one argument to alternatives", {
expect_error({
alternatives("pattern")
}, "alternativ... |
library(xts)
library(xtable)
library(lubridate)
library(readxl)
WMT <- read_excel("../data/WMT.xlsx",
col_types = c("date", "numeric", "numeric", "numeric", "numeric", "numeric"))
# use the relative path
# data statistics
WMT = WMT[-1763:-1764,]
lgreturn = diff(log(WMT$close))*100
WMT = WMT[-1,]
yea... | /code/statistics_WMT.R | no_license | xuning28/FDA_project_group_XN | R | false | false | 1,318 | r | library(xts)
library(xtable)
library(lubridate)
library(readxl)
WMT <- read_excel("../data/WMT.xlsx",
col_types = c("date", "numeric", "numeric", "numeric", "numeric", "numeric"))
# use the relative path
# data statistics
WMT = WMT[-1763:-1764,]
lgreturn = diff(log(WMT$close))*100
WMT = WMT[-1,]
yea... |
library(tidyverse)
plant_height <- data.frame(
Day = 1:5,
A = c(0.7, 1.0, 1.5, 1.8, 2.2),
B = c(0.5, 0.7, 0.9, 1.3, 1.8),
C = c(0.3, 0.6, 1.0, 1.2, 2.2),
D = c(0.4, 0.7, 1.2, 1.5, 3.2)
)
plant_height
# plant_height %>%
# filter( ___ >= 0.8)
# filter(plant_height,___>=0.8)
# plant_height %>%
# ggplot(ae... | /第 8 章 数据规整.R | no_license | chenbingshun98/bsdzp | R | false | false | 2,990 | r | library(tidyverse)
plant_height <- data.frame(
Day = 1:5,
A = c(0.7, 1.0, 1.5, 1.8, 2.2),
B = c(0.5, 0.7, 0.9, 1.3, 1.8),
C = c(0.3, 0.6, 1.0, 1.2, 2.2),
D = c(0.4, 0.7, 1.2, 1.5, 3.2)
)
plant_height
# plant_height %>%
# filter( ___ >= 0.8)
# filter(plant_height,___>=0.8)
# plant_height %>%
# ggplot(ae... |
library(systemPipeR)
library(edgeR)
countDFmiR <- read.delim("./results/countDFmiR.xls", row.names=1, check.names=FALSE)
targets <- read.delim("targets.txt", comment="#")
cmp <- readComp(file="targets.txt", format="matrix", delim="-")
#Running edgeR
edgeDF <- run_edgeR(countDF=countDFmiR, targets=targets, cmp=cmp[[1]]... | /Small RNA/small_RNA_edgeR.R | no_license | MessaoudiLab/RNA-Seq-Analysis | R | false | false | 739 | r | library(systemPipeR)
library(edgeR)
countDFmiR <- read.delim("./results/countDFmiR.xls", row.names=1, check.names=FALSE)
targets <- read.delim("targets.txt", comment="#")
cmp <- readComp(file="targets.txt", format="matrix", delim="-")
#Running edgeR
edgeDF <- run_edgeR(countDF=countDFmiR, targets=targets, cmp=cmp[[1]]... |
## File Name: se.R
## File Version: 0.02
se <- function(object)
{
res <- sqrt(diag(vcov(object)))
return(res)
}
| /R/se.R | no_license | alexanderrobitzsch/BIFIEsurvey | R | false | false | 121 | r | ## File Name: se.R
## File Version: 0.02
se <- function(object)
{
res <- sqrt(diag(vcov(object)))
return(res)
}
|
#' AS event annotation
#'
#' This function converts information of AS events into ASpedia format.
#'
#' @param ASlist a list of AS events
#' @param gtf a GRanges object representing GTF
#' @return A list of annotated AS events
#' @keywords internal
#' @importFrom limma strsplit2
#' @noRd
annotate <- function(ASlist, gt... | /R/annotate.R | no_license | nachoryu/ASpediaFI | R | false | false | 6,461 | r | #' AS event annotation
#'
#' This function converts information of AS events into ASpedia format.
#'
#' @param ASlist a list of AS events
#' @param gtf a GRanges object representing GTF
#' @return A list of annotated AS events
#' @keywords internal
#' @importFrom limma strsplit2
#' @noRd
annotate <- function(ASlist, gt... |
title: "homework 4"
author: "Diep Luu"
date: "09/30/2021"
attach(acs2017_ny)
use_varb <- (AGE >= 25) & (AGE <= 55) & (LABFORCE == 2) & (WKSWORK2 > 4) & (UHRSWORK >= 35)
dat_use <- subset(acs2017_ny,use_varb) #
detach()
attach(dat_use)
summary(dat_use)
model_temp1 <- lm(INCWAGE ~ AGE + female + AfAm + Asian + Amindi... | /homework4.R | no_license | luudiep/Homework-4 | R | false | false | 2,037 | r | title: "homework 4"
author: "Diep Luu"
date: "09/30/2021"
attach(acs2017_ny)
use_varb <- (AGE >= 25) & (AGE <= 55) & (LABFORCE == 2) & (WKSWORK2 > 4) & (UHRSWORK >= 35)
dat_use <- subset(acs2017_ny,use_varb) #
detach()
attach(dat_use)
summary(dat_use)
model_temp1 <- lm(INCWAGE ~ AGE + female + AfAm + Asian + Amindi... |
### Paquetes ----
library(pacman)
p_load(ggrepel, janitor, lubridate, scales, readxl, tidyverse, treemapify, wesanderson, zoo)
### Setup ----
Sys.setlocale("LC_ALL", "es_ES.UTF-8") # Cambiar locale para prevenir problemas con caracteres especiales
options(scipen=999) # Prevenir notación científica
### Definir tema ... | /02_codigo/analisis_produccion.R | no_license | segasi/analisis_gasolina | R | false | false | 10,573 | r | ### Paquetes ----
library(pacman)
p_load(ggrepel, janitor, lubridate, scales, readxl, tidyverse, treemapify, wesanderson, zoo)
### Setup ----
Sys.setlocale("LC_ALL", "es_ES.UTF-8") # Cambiar locale para prevenir problemas con caracteres especiales
options(scipen=999) # Prevenir notación científica
### Definir tema ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/radialgo.R
\name{server}
\alias{server}
\title{Shiny app server function}
\usage{
server(input, output)
}
\arguments{
\item{input}{The input object}
\item{output}{The output object}
}
\description{
Shiny app server function
}
| /man/server.Rd | permissive | brucosper/RadialGO | R | false | true | 305 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/radialgo.R
\name{server}
\alias{server}
\title{Shiny app server function}
\usage{
server(input, output)
}
\arguments{
\item{input}{The input object}
\item{output}{The output object}
}
\description{
Shiny app server function
}
|
# Estimation Approach to Statistical Inference
## Plausibility Plots
### Plausibility Plot
.plausible <- function(results) {
out <- density(0,from=-4.5,to=4.5,bw=1,kernel="gaussian")
out$x <- (out$x*results[2])+results[1]
return(out)
}
plotPlausible <- function(x,...)
UseMethod("plotPlausible")
plotPlausib... | /R/xPlausible.R | permissive | cwendorf/EASI | R | false | false | 1,949 | r | # Estimation Approach to Statistical Inference
## Plausibility Plots
### Plausibility Plot
.plausible <- function(results) {
out <- density(0,from=-4.5,to=4.5,bw=1,kernel="gaussian")
out$x <- (out$x*results[2])+results[1]
return(out)
}
plotPlausible <- function(x,...)
UseMethod("plotPlausible")
plotPlausib... |
### run.R ---
## Filename: run.R
## Description: Run models with year as indicator variable
## Author: Noah Peart
## Created: Tue Apr 7 11:46:16 2015 (-0400)
## Last-Updated: Tue Apr 7 11:46:33 2015 (-0400)
## By: Noah Peart
######################################################################
| /year/run.R | no_license | nverno/hh | R | false | false | 309 | r | ### run.R ---
## Filename: run.R
## Description: Run models with year as indicator variable
## Author: Noah Peart
## Created: Tue Apr 7 11:46:16 2015 (-0400)
## Last-Updated: Tue Apr 7 11:46:33 2015 (-0400)
## By: Noah Peart
######################################################################
|
ModelHeston<- function(x,x0,del,param,args){
output <- 0
if (args$mode=='option')
{
e<- 1e-5
S<-exp(x[1])
rho <- param[1]
kappa <- param[2]
theta <- param[3]
sigma <- param[4]
objfun<-function(vega){
objfun<- abs(HestonCOS(S,S,T_0,rate,q,sigma,kappa... | /drivers/ModelU2.R | no_license | SmithaShivakumar/MLEMVD | R | false | false | 2,348 | r |
ModelHeston<- function(x,x0,del,param,args){
output <- 0
if (args$mode=='option')
{
e<- 1e-5
S<-exp(x[1])
rho <- param[1]
kappa <- param[2]
theta <- param[3]
sigma <- param[4]
objfun<-function(vega){
objfun<- abs(HestonCOS(S,S,T_0,rate,q,sigma,kappa... |
#PCA on Boston Data set
boston <- Boston
#Now we are removing the boston$chas since its a factor
boston <- Boston[,c(1:3,5:14)]
head(boston)
str(boston)
#linear model before PCA
model_b_pca <- lm(medv~.,data=boston)
summary(model_b_pca)
#PCA for boston
new.boston <- boston[,-13]
#we are removing the medv s... | /PCA_using_boston.R | no_license | aka7h/Analytics_in_R | R | false | false | 1,915 | r | #PCA on Boston Data set
boston <- Boston
#Now we are removing the boston$chas since its a factor
boston <- Boston[,c(1:3,5:14)]
head(boston)
str(boston)
#linear model before PCA
model_b_pca <- lm(medv~.,data=boston)
summary(model_b_pca)
#PCA for boston
new.boston <- boston[,-13]
#we are removing the medv s... |
#Graficos
carros <- mtcars[, c(1,2,9)]
#Histograma
hist(carros$mpg)
#Dispersao
plot(carros$mpg, carros$cyl)
#Utilizando ggplot2
library(ggplot2)
ggplot(carros, aes(am))+
geom_bar()
| /Modulo_2/Modulo 2 - Graficos.R | no_license | victoresende19/R_AnaliseDados_EVG | R | false | false | 203 | r | #Graficos
carros <- mtcars[, c(1,2,9)]
#Histograma
hist(carros$mpg)
#Dispersao
plot(carros$mpg, carros$cyl)
#Utilizando ggplot2
library(ggplot2)
ggplot(carros, aes(am))+
geom_bar()
|
library(shiny)
shinyApp(
ui = fluidPage(
useShinyjs(), # Set up shinyjs
actionButton("btn", "Click me"),
disabled(
textInput("element", NULL, "I was born disabled")
)
),
server = function(input, output) {
observeEvent(input$btn, {
enable("element")
})
}
) | /testing-disabled/app.R | no_license | jyuu/shiny-apps | R | false | false | 300 | r | library(shiny)
shinyApp(
ui = fluidPage(
useShinyjs(), # Set up shinyjs
actionButton("btn", "Click me"),
disabled(
textInput("element", NULL, "I was born disabled")
)
),
server = function(input, output) {
observeEvent(input$btn, {
enable("element")
})
}
) |
#' Lead levels from tap water sampling in Flint, MI
#'
#' Results of tap water lead testing conducted in Flint, MI in 2015.
#'
#' In 2014, the city of Flint, Michigan switched its drinking water supply
#' from Detroit's system to the Flint River to reduce costs.
#'
#' In 2015, students and scientists at Virginia Tech... | /R/flint.R | no_license | TKosfeld/fosdata | R | false | false | 1,552 | r | #' Lead levels from tap water sampling in Flint, MI
#'
#' Results of tap water lead testing conducted in Flint, MI in 2015.
#'
#' In 2014, the city of Flint, Michigan switched its drinking water supply
#' from Detroit's system to the Flint River to reduce costs.
#'
#' In 2015, students and scientists at Virginia Tech... |
load("homework-0/rdas/results.rda")
library(tidyverse)
library(dslabs)
Bayesian_results%>%
ggplot(aes(avg, posterior_mean, size = n)) +
geom_point(alpha = 0.5, show.legend = FALSE) +
geom_abline(slope = 1, intercept = 0, lty = "dotted")
ggsave("figs/Bayesian-results-scatter-plot.png")
data.frame(clinton_EV, ... | /analysis.R | no_license | hyunsang57/homework-0 | R | false | false | 1,766 | r | load("homework-0/rdas/results.rda")
library(tidyverse)
library(dslabs)
Bayesian_results%>%
ggplot(aes(avg, posterior_mean, size = n)) +
geom_point(alpha = 0.5, show.legend = FALSE) +
geom_abline(slope = 1, intercept = 0, lty = "dotted")
ggsave("figs/Bayesian-results-scatter-plot.png")
data.frame(clinton_EV, ... |
## This function creates a special "matrix" object that can cache its inverse
makeCacheMatrix <- function(x = matrix()) {
# inv will store the cached inverse matrix
inv<-NULL
# set the value of the matrix
set<-function(y){
x<<-y
inv<<-NULL
}
# get the value of the matrix
get<-function() x
# set... | /cachematrix.R | no_license | alfysamuel/ProgrammingAssignment2 | R | false | false | 1,330 | r |
## This function creates a special "matrix" object that can cache its inverse
makeCacheMatrix <- function(x = matrix()) {
# inv will store the cached inverse matrix
inv<-NULL
# set the value of the matrix
set<-function(y){
x<<-y
inv<<-NULL
}
# get the value of the matrix
get<-function() x
# set... |
#Before run the program, please specify the location where your raw data is
#and where you want to store the PNG files.
RawDataDirectory<-"C:/Users/mosimtec/Desktop/Learning/ExploratoryDataAnalysis"
ScriptAndPlotDirectory<-"C:/Users/mosimtec/Desktop/Learning/ExploratoryDataAnalysis/CourseProject"
setwd(RawDataDirecto... | /plot3.R | no_license | LiangyiHu/CourseProject | R | false | false | 1,204 | r | #Before run the program, please specify the location where your raw data is
#and where you want to store the PNG files.
RawDataDirectory<-"C:/Users/mosimtec/Desktop/Learning/ExploratoryDataAnalysis"
ScriptAndPlotDirectory<-"C:/Users/mosimtec/Desktop/Learning/ExploratoryDataAnalysis/CourseProject"
setwd(RawDataDirecto... |
#' chinaWeather
#'
#' @name chinaWeather
#' @docType package
NULL
| /R/chinaWeather-package.r | no_license | zdkj/chinaWeather | R | false | false | 66 | r | #' chinaWeather
#'
#' @name chinaWeather
#' @docType package
NULL
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/minhash_v2.R
\name{compare_buckets}
\alias{compare_buckets}
\title{Function that creates a similarity graph and divides it into communities (or blocks) for entity resolution}
\usage{
compare_buckets(hashed_signatures, max_bucket_size = 1000)
... | /man/compare_buckets.Rd | no_license | cran/tlsh | R | false | true | 957 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/minhash_v2.R
\name{compare_buckets}
\alias{compare_buckets}
\title{Function that creates a similarity graph and divides it into communities (or blocks) for entity resolution}
\usage{
compare_buckets(hashed_signatures, max_bucket_size = 1000)
... |
sva.id <-
function(dat, n.u.treatment, lm.fm, B = 500, sv.sig = 0.05)
{
#message("Number of complete variables (and samples) used in SVD")
#message(dim(dat))
n = ncol(dat)
ncomp = n.u.treatment
# message("Number of treatment groups (in svd.id): ", ncomp)
# should be true for either case and can be used ... | /R/sva.id.R | no_license | kravneet/xmsPANDA | R | false | false | 2,179 | r | sva.id <-
function(dat, n.u.treatment, lm.fm, B = 500, sv.sig = 0.05)
{
#message("Number of complete variables (and samples) used in SVD")
#message(dim(dat))
n = ncol(dat)
ncomp = n.u.treatment
# message("Number of treatment groups (in svd.id): ", ncomp)
# should be true for either case and can be used ... |
testlist <- list(Beta = 0, CVLinf = 86341236051411296, FM = 1.53632495265886e-311, L50 = 0, L95 = 0, LenBins = c(2.0975686864138e+162, -2.68131210337361e-144, -1.11215735981244e+199, -4.48649879577108e+143, 1.6611802228813e+218, 900371.947279558, 1.07063092954708e+238, 2.88003257377011e-142, 1.29554... | /DLMtool/inst/testfiles/LBSPRgen/AFL_LBSPRgen/LBSPRgen_valgrind_files/1615837659-test.R | no_license | akhikolla/updatedatatype-list2 | R | false | false | 2,048 | r | testlist <- list(Beta = 0, CVLinf = 86341236051411296, FM = 1.53632495265886e-311, L50 = 0, L95 = 0, LenBins = c(2.0975686864138e+162, -2.68131210337361e-144, -1.11215735981244e+199, -4.48649879577108e+143, 1.6611802228813e+218, 900371.947279558, 1.07063092954708e+238, 2.88003257377011e-142, 1.29554... |
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/tabbedDataRetrievals.R
\docType{package}
\name{dataRetrieval-package}
\alias{dataRetrieval-package}
\title{Retrieval functions for USGS and EPA data}
\description{
\tabular{ll}{
Package: \tab dataRetrieval\cr
Type: \tab Package\cr
Ver... | /man/dataRetrieval-package.Rd | permissive | lawinslow/dataRetrieval | R | false | false | 1,109 | rd | % Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/tabbedDataRetrievals.R
\docType{package}
\name{dataRetrieval-package}
\alias{dataRetrieval-package}
\title{Retrieval functions for USGS and EPA data}
\description{
\tabular{ll}{
Package: \tab dataRetrieval\cr
Type: \tab Package\cr
Ver... |
#===============================================================================
# gscp_3_get_parameters.R
#===============================================================================
# Dummy function to build parameters list if tzar was not run.
# This is just meant as a place... | /projects/rdvPackages/biodivprobgen/R/gscp_3_get_parameters.R | no_license | river-jade/rdv-framework | R | false | false | 2,609 | r | #===============================================================================
# gscp_3_get_parameters.R
#===============================================================================
# Dummy function to build parameters list if tzar was not run.
# This is just meant as a place... |
gifts = read.csv("../input/gifts.csv")
library(geosphere)
library(aspace)
# Create longitudinal intervals in degrees
j_step <- 10
gifts$j <- ceil(gifts$Longitude/j_step)*j_step
gifts$TripId <- rep(0,nrow(gifts))
# Shift the interval indices (for tuning)
j_shift <- 35 # degrees
gifts$j <- ifelse(gifts$j+j_shift>180, ... | /scripts/create_good_clusters.R | permissive | codebender/kaggle-santas-stolen-sleigh | R | false | false | 1,539 | r | gifts = read.csv("../input/gifts.csv")
library(geosphere)
library(aspace)
# Create longitudinal intervals in degrees
j_step <- 10
gifts$j <- ceil(gifts$Longitude/j_step)*j_step
gifts$TripId <- rep(0,nrow(gifts))
# Shift the interval indices (for tuning)
j_shift <- 35 # degrees
gifts$j <- ifelse(gifts$j+j_shift>180, ... |
###################################################################
### Analysis clusters feedback ###
###################################################################
library(R.matlab)
####################################
## Determine + and - clusters ##
#####################... | /Reversal_learning/EEG/Cluster_analyses/Power/Interactions/clustering_checkout_2_2.R | no_license | psy-bin/PieterV_public | R | false | false | 6,645 | r | ###################################################################
### Analysis clusters feedback ###
###################################################################
library(R.matlab)
####################################
## Determine + and - clusters ##
#####################... |
GetSNPPosHapMap<-function(singlesnpname,showurl=FALSE,build="27_B36",rsOnly=TRUE)
{
if(build!="3r2_B36" & build!="27_B36")
stop("NCBI2R GetSNPPosHapMap error: Unknown build specified. Function has failed")
if(length(singlesnpname)>1)
stop("NCBI2R GetSNPPosHapMap Error: Only one SNP at a time please... | /R/GetSNPPosHapmap.r | no_license | DuyDN/NCBI2R | R | false | false | 1,242 | r | GetSNPPosHapMap<-function(singlesnpname,showurl=FALSE,build="27_B36",rsOnly=TRUE)
{
if(build!="3r2_B36" & build!="27_B36")
stop("NCBI2R GetSNPPosHapMap error: Unknown build specified. Function has failed")
if(length(singlesnpname)>1)
stop("NCBI2R GetSNPPosHapMap Error: Only one SNP at a time please... |
rm(list = ls())
setwd("E:/gitperso/introduction-hmm/")
#setwd("E:/to/your/directory/")
source("helpers/sample_XY.R")
source("helpers/transition_matrices.R")
source("helpers/alpha_beta.R") # forward and backward decomposition
source("helpers/letter_and_int.R") # conversion between A, B, C and 1, 2, 3
source("helpers/del... | /main.R | permissive | ahstat/introduction-hmm | R | false | false | 7,096 | r | rm(list = ls())
setwd("E:/gitperso/introduction-hmm/")
#setwd("E:/to/your/directory/")
source("helpers/sample_XY.R")
source("helpers/transition_matrices.R")
source("helpers/alpha_beta.R") # forward and backward decomposition
source("helpers/letter_and_int.R") # conversion between A, B, C and 1, 2, 3
source("helpers/del... |
#' Find a sample common to two sets
#' @export
find_sample <- function(
new_vec,
old_sample = list(vec = NULL, sample = NULL),
size_pct = 0.002
){
if (!exists(deparse(substitute(old_sample)))){
old_sample <- list(vec = NULL, sample = NULL)
}
old_vec <- old_sample[["vec"]]
old_samp <- old_sample[["sa... | /R/sampling.R | no_license | IndianaCHE/IndianaCHEmisc | R | false | false | 1,723 | r | #' Find a sample common to two sets
#' @export
find_sample <- function(
new_vec,
old_sample = list(vec = NULL, sample = NULL),
size_pct = 0.002
){
if (!exists(deparse(substitute(old_sample)))){
old_sample <- list(vec = NULL, sample = NULL)
}
old_vec <- old_sample[["vec"]]
old_samp <- old_sample[["sa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.