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 |
|---|---|---|---|---|---|---|---|---|---|
#' @title Non-partial correlation analysis
#' @description A method that integrates differential expression (DE) analysis and differential
#' network (DN) analysis to select biomarker candidates for cancer studies. non_partial_cor is
#' a one step function for users to perform the typical correlation analysis... | /R/non_partial_cor.R | permissive | ressomlab/INDEED | R | false | false | 6,821 | r | #' @title Non-partial correlation analysis
#' @description A method that integrates differential expression (DE) analysis and differential
#' network (DN) analysis to select biomarker candidates for cancer studies. non_partial_cor is
#' a one step function for users to perform the typical correlation analysis... |
# Descriptives using the survey package
#
source('lib/reload.R'); reload()
load(file.path(datadir, 'data','rda','data.rda'))
# see http://faculty.washington.edu/tlumley/old-survey/exmample-lonely.html for the following
options(survey.lonely.psu = 'remove')
all_data <- all_data %>%
mutate(key = as.character(key),
... | /svy_descriptives.R | no_license | webbedfeet/SLE_Infection | R | false | false | 2,660 | r | # Descriptives using the survey package
#
source('lib/reload.R'); reload()
load(file.path(datadir, 'data','rda','data.rda'))
# see http://faculty.washington.edu/tlumley/old-survey/exmample-lonely.html for the following
options(survey.lonely.psu = 'remove')
all_data <- all_data %>%
mutate(key = as.character(key),
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spec_parity.R
\name{spec_parity}
\alias{spec_parity}
\title{Specificity parity}
\usage{
spec_parity(
data,
outcome,
group,
probs = NULL,
preds = NULL,
preds_levels = NULL,
outcome_base = NULL,
cutoff = 0.5,
base = NULL
)
}
\... | /man/spec_parity.Rd | permissive | vankesteren/fairness | R | false | true | 2,635 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spec_parity.R
\name{spec_parity}
\alias{spec_parity}
\title{Specificity parity}
\usage{
spec_parity(
data,
outcome,
group,
probs = NULL,
preds = NULL,
preds_levels = NULL,
outcome_base = NULL,
cutoff = 0.5,
base = NULL
)
}
\... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/flatten_dimension.R
\name{flatten_dimension}
\alias{flatten_dimension}
\title{flatten_dimension}
\usage{
flatten_dimension(data)
}
\arguments{
\item{data}{multi-dimensional data to be flattened/reduced by a single dimension}
}
\value{
data th... | /man/flatten_dimension.Rd | permissive | epongpipat/eepR | R | false | true | 429 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/flatten_dimension.R
\name{flatten_dimension}
\alias{flatten_dimension}
\title{flatten_dimension}
\usage{
flatten_dimension(data)
}
\arguments{
\item{data}{multi-dimensional data to be flattened/reduced by a single dimension}
}
\value{
data th... |
rm(list=ls())
setwd('/Users/wenpinhou/Dropbox/covid/')
rdir <- 'pred/xgboost_survivalDynamic/result/'
pdir <- 'pred/xgboost_survivalDynamic/plot/'
source('/Users/wenpinhou/Dropbox/trajectory_variability/function/mySTIP2.R')
d.pt <- readRDS('/Users/wenpinhou/Dropbox/covid/pred/data/data/sample_info_pb_opt.rds')
rownam... | /pred/xgboost_survivalDynamic_5foldRandomSplitSample/code/06_plot_hm_sharedFeature_average_by_window.R | no_license | Winnie09/COVID_integrative | R | false | false | 4,439 | r | rm(list=ls())
setwd('/Users/wenpinhou/Dropbox/covid/')
rdir <- 'pred/xgboost_survivalDynamic/result/'
pdir <- 'pred/xgboost_survivalDynamic/plot/'
source('/Users/wenpinhou/Dropbox/trajectory_variability/function/mySTIP2.R')
d.pt <- readRDS('/Users/wenpinhou/Dropbox/covid/pred/data/data/sample_info_pb_opt.rds')
rownam... |
# functions for ABCRF
library(abcrf)
# function for weighted histogram
suppressMessages(library(weights, quietly=T))
# functions for CARTs
library(tree)
target <- readRDS(file="data/target.RDS")
ref_table_1 <- readRDS(file="data/ref_table_1.RDS")
ref_table_2 <- readRDS(file="data/ref_table_2.RDS")
## Classific... | /6.ABCRFcont.R | no_license | mnavascues/ABCRFtutorial | R | false | false | 5,671 | r | # functions for ABCRF
library(abcrf)
# function for weighted histogram
suppressMessages(library(weights, quietly=T))
# functions for CARTs
library(tree)
target <- readRDS(file="data/target.RDS")
ref_table_1 <- readRDS(file="data/ref_table_1.RDS")
ref_table_2 <- readRDS(file="data/ref_table_2.RDS")
## Classific... |
##install.packages("tseries")
library(tseries)
##data input
SandPIn <- get.hist.quote('^gspc',quote="Close")
##log data
SandPLog <- log(lag(SandPIn)) - log(SandPIn)
##Volatility measure
SNPvol <- sd(SandPLog) * sqrt(250) * 100
##loop
Vol <- function(d, logrets)
{
var = 0
lam = 0
varlist <- c()
... | /code.R | no_license | murtadaa/11 | R | false | false | 683 | r | ##install.packages("tseries")
library(tseries)
##data input
SandPIn <- get.hist.quote('^gspc',quote="Close")
##log data
SandPLog <- log(lag(SandPIn)) - log(SandPIn)
##Volatility measure
SNPvol <- sd(SandPLog) * sqrt(250) * 100
##loop
Vol <- function(d, logrets)
{
var = 0
lam = 0
varlist <- c()
... |
# Reading data
setClass("myDate")
setAs("character","myDate", function(from) as.Date(from, format="%d/%m/%Y"))
power_data <- read.table("household_power_consumption.txt", stringsAsFactors = FALSE,
nrows = 300000, header = TRUE, sep = ";",
colClasses = c("myDate", "ch... | /plot4.R | no_license | ivanshuer/ExData_Plotting1 | R | false | false | 1,747 | r | # Reading data
setClass("myDate")
setAs("character","myDate", function(from) as.Date(from, format="%d/%m/%Y"))
power_data <- read.table("household_power_consumption.txt", stringsAsFactors = FALSE,
nrows = 300000, header = TRUE, sep = ";",
colClasses = c("myDate", "ch... |
library(glmnet)
mydata = read.table("./TrainingSet/AvgRank/liver.csv",head=T,sep=",")
x = as.matrix(mydata[,4:ncol(mydata)])
y = as.matrix(mydata[,1])
set.seed(123)
glm = cv.glmnet(x,y,nfolds=10,type.measure="mse",alpha=0.8,family="gaussian",standardize=FALSE)
sink('./Model/EN/AvgRank/liver/liver_082.txt',append=TRUE)
... | /Model/EN/AvgRank/liver/liver_082.R | no_license | leon1003/QSMART | R | false | false | 349 | r | library(glmnet)
mydata = read.table("./TrainingSet/AvgRank/liver.csv",head=T,sep=",")
x = as.matrix(mydata[,4:ncol(mydata)])
y = as.matrix(mydata[,1])
set.seed(123)
glm = cv.glmnet(x,y,nfolds=10,type.measure="mse",alpha=0.8,family="gaussian",standardize=FALSE)
sink('./Model/EN/AvgRank/liver/liver_082.txt',append=TRUE)
... |
## PROJECT: ANALISIS DE DATOS
## PROGRAM: pca_fa.r
## PROGRAM TASK: ANOVA ANALYSIS
## AUTHOR: RODRIGO TABORDA
## AUTHOR: JUAN PABLO MONTENEGRO
## DATE CREATEC: 2020/05/20
## DATE REVISION 1:
## DATE REVISION #:
####################################################################;
## #0 PROGRAM SETUP
##################... | /r/scripts/pca_fa.R | no_license | sergioduranm/project_ad_analisis_datos | R | false | false | 2,387 | r | ## PROJECT: ANALISIS DE DATOS
## PROGRAM: pca_fa.r
## PROGRAM TASK: ANOVA ANALYSIS
## AUTHOR: RODRIGO TABORDA
## AUTHOR: JUAN PABLO MONTENEGRO
## DATE CREATEC: 2020/05/20
## DATE REVISION 1:
## DATE REVISION #:
####################################################################;
## #0 PROGRAM SETUP
##################... |
features <- read.table("UCI HAR Dataset/features.txt", col.names = c("n","functions"))
activities <- read.table("UCI HAR Dataset/activity_labels.txt", col.names = c("code", "activity"))
subject_test <- read.table("UCI HAR Dataset/test/subject_test.txt", col.names = "subject")
x_test <- read.table("UCI HAR Dataset/te... | /run_Analysis.R | no_license | Sehhy/Getting-and-cleaning-data-course | R | false | false | 1,980 | r | features <- read.table("UCI HAR Dataset/features.txt", col.names = c("n","functions"))
activities <- read.table("UCI HAR Dataset/activity_labels.txt", col.names = c("code", "activity"))
subject_test <- read.table("UCI HAR Dataset/test/subject_test.txt", col.names = "subject")
x_test <- read.table("UCI HAR Dataset/te... |
### Complete Multiple Regressions on Brand Preference and Grocery Retailer Datasets ###
## Brand Preference Data ##
brand <- read.table("http://users.stat.ufl.edu/~rrandles/sta4210/Rclassnotes/data/textdatasets/KutnerData/Chapter%20%206%20Data%20Sets/CH06PR05.txt", header=F)
names(brand) <- c("Y", "X1", "X2")
... | /complete_multiple_regression.R | no_license | grantgasser/Complete-Multiple-Regression | R | false | false | 4,017 | r | ### Complete Multiple Regressions on Brand Preference and Grocery Retailer Datasets ###
## Brand Preference Data ##
brand <- read.table("http://users.stat.ufl.edu/~rrandles/sta4210/Rclassnotes/data/textdatasets/KutnerData/Chapter%20%206%20Data%20Sets/CH06PR05.txt", header=F)
names(brand) <- c("Y", "X1", "X2")
... |
context("Response")
test_that("application/json responses parsed as lists", {
test_user_agent <- function(user_agent = NULL) {
response <- GET("http://httpbin.org/user-agent",
add_headers("user-agent" = user_agent))
expect_equal(response$status_code, 200)
expected_reply = list("user-... | /tests/testthat/test-response.r | no_license | Pixel81/httr | R | false | false | 749 | r | context("Response")
test_that("application/json responses parsed as lists", {
test_user_agent <- function(user_agent = NULL) {
response <- GET("http://httpbin.org/user-agent",
add_headers("user-agent" = user_agent))
expect_equal(response$status_code, 200)
expected_reply = list("user-... |
rpart.control <-
function(minsplit = 20L, minbucket = round(minsplit/3), cp = 0.01,
maxcompete = 4L, maxsurrogate = 5L, usesurrogate = 2L, xval = 10L,
surrogatestyle = 0L, maxdepth = 30L, ...)
{
if (maxcompete < 0L) {
warning(gettextf("The value of '%s' supplied is < 0; the value 0 was used inste... | /Recommended/rpart/R/rpart.control.R | no_license | lukaszdaniel/ivory | R | false | false | 1,606 | r | rpart.control <-
function(minsplit = 20L, minbucket = round(minsplit/3), cp = 0.01,
maxcompete = 4L, maxsurrogate = 5L, usesurrogate = 2L, xval = 10L,
surrogatestyle = 0L, maxdepth = 30L, ...)
{
if (maxcompete < 0L) {
warning(gettextf("The value of '%s' supplied is < 0; the value 0 was used inste... |
#!/usr/bin/env Rscript
# Author: Eva Linehan
# Date: October 2018
# Desc: Script to plot Girko's Law simulation and save as pdf.
#clear environments
rm(list=ls())
build_ellipse <- function(hradius, vradius){
npoints = 250
a <- seq(0, 2 * pi, length = npoints + 1)
x <- hradius * cos(a)
y <- vradius * sin(a) ... | /Week3/Code/Girko.R | no_license | EvalImperialforces/CMEECourseWork | R | false | false | 1,214 | r | #!/usr/bin/env Rscript
# Author: Eva Linehan
# Date: October 2018
# Desc: Script to plot Girko's Law simulation and save as pdf.
#clear environments
rm(list=ls())
build_ellipse <- function(hradius, vradius){
npoints = 250
a <- seq(0, 2 * pi, length = npoints + 1)
x <- hradius * cos(a)
y <- vradius * sin(a) ... |
library(readr)
library(dplyr)
dat <- read_csv("https://raw.githubusercontent.com/ianhandel/test_data/master/test.csv", )
dat <- dplyr::bind_rows(dat, data.frame(date = date())) %>%
select(date)
write_csv(dat, "test.csv")
| /update.R | no_license | ianhandel/test_data | R | false | false | 228 | r | library(readr)
library(dplyr)
dat <- read_csv("https://raw.githubusercontent.com/ianhandel/test_data/master/test.csv", )
dat <- dplyr::bind_rows(dat, data.frame(date = date())) %>%
select(date)
write_csv(dat, "test.csv")
|
## analysis.R
## You should create one R script called run_analysis.R
## that does the following:
## 1. Merges the training and the test sets to create one data set.
## 2. Extracts only the measurements on the mean and standard deviation for
## each measurement.
## 3. Uses descriptive activity names to name the... | /run_analysis.R | no_license | rberangi/week3project | R | false | false | 3,848 | r | ## analysis.R
## You should create one R script called run_analysis.R
## that does the following:
## 1. Merges the training and the test sets to create one data set.
## 2. Extracts only the measurements on the mean and standard deviation for
## each measurement.
## 3. Uses descriptive activity names to name the... |
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#@@ Create discrete legend for plotting
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
legrank <- function(inputdf, ntiles, colname, inraster = NULL) {
if (!is.null(inraster)) {
griddf <- data.frame(coordinates(inraster), as.data.frame(inraster))
griddf <... | /functions/legrank.R | no_license | drmarcogir/lepidopteraglobalinventories | R | false | false | 1,325 | r |
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#@@ Create discrete legend for plotting
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
legrank <- function(inputdf, ntiles, colname, inraster = NULL) {
if (!is.null(inraster)) {
griddf <- data.frame(coordinates(inraster), as.data.frame(inraster))
griddf <... |
### Read the full file
readhpc<-read.table("household_power_consumption.txt",sep=";",header=TRUE)
### Convert the date field from factor to Date
readhpc$Date<-as.Date(readhpc$Date,format="%d/%m/%Y")
### Subset the data for the required date range
readhpcsub<-subset(readhpc,Date >= as.Date("2007-02-01",format="%Y-%m-%... | /hpc_plot4.R | no_license | ds84in/ExData_Plotting1 | R | false | false | 2,448 | r | ### Read the full file
readhpc<-read.table("household_power_consumption.txt",sep=";",header=TRUE)
### Convert the date field from factor to Date
readhpc$Date<-as.Date(readhpc$Date,format="%d/%m/%Y")
### Subset the data for the required date range
readhpcsub<-subset(readhpc,Date >= as.Date("2007-02-01",format="%Y-%m-%... |
setwd("/Users/waterman/Documents/Data Science Courses/Exploratory Data Analysis/Project1/ExData_Plotting1")
## load the Electric Power Consuption Data into a dataframe
allconsumption <- read.table ("./data/household_power_consumption.txt", header=TRUE, fill=T, sep = ";", na.strings ="?")
## create the DateTime variab... | /plot4.R | no_license | rh2oman/ExData_Plotting1 | R | false | false | 2,234 | r | setwd("/Users/waterman/Documents/Data Science Courses/Exploratory Data Analysis/Project1/ExData_Plotting1")
## load the Electric Power Consuption Data into a dataframe
allconsumption <- read.table ("./data/household_power_consumption.txt", header=TRUE, fill=T, sep = ";", na.strings ="?")
## create the DateTime variab... |
# Pre step: Clear out workspace
rm(list = ls())
# Create the variables r and R
r <- 2
R <- 6
# Calculate the volume of the donut: vol_donut
pisquared <- pi^2
rsquared <- r^2
vol_donut <- 2*pisquared*rsquared*R
# Remove all intermediary variables that you've used with rm()
rm(pisquared)
rm(rsquared)
rm(r)
rm(R)
# Li... | /ch1_1_R_the_true_basics_6_build_and_destroy.R | no_license | tsaomao/edX--MSDS-Curriculum--DAT204x | R | false | false | 358 | r | # Pre step: Clear out workspace
rm(list = ls())
# Create the variables r and R
r <- 2
R <- 6
# Calculate the volume of the donut: vol_donut
pisquared <- pi^2
rsquared <- r^2
vol_donut <- 2*pisquared*rsquared*R
# Remove all intermediary variables that you've used with rm()
rm(pisquared)
rm(rsquared)
rm(r)
rm(R)
# Li... |
library(mlr3)
library(mlr3learners)
library(mlr3tuning)
library(mlr3filters)
library(paradox)
library(mlr3tuning)
library(fastDummies)
library(mlr3pipelines)
library(data.table)
library(mlrintermbo)
# requireNamespace("lgr")
# data
# specify datasets on which should be trained on
# path = 'datasets/'
# datasets = c('a... | /code/module_functions.R | no_license | JSchweisthal/automl | R | false | false | 6,970 | r | library(mlr3)
library(mlr3learners)
library(mlr3tuning)
library(mlr3filters)
library(paradox)
library(mlr3tuning)
library(fastDummies)
library(mlr3pipelines)
library(data.table)
library(mlrintermbo)
# requireNamespace("lgr")
# data
# specify datasets on which should be trained on
# path = 'datasets/'
# datasets = c('a... |
install.packages("sp")
install.packages("raster")
install.packages("rgdal")
install.packages("ggplot2")
install.packages("agricolae")
install.packages("reshape2")
install.packages("devtools")
install.packages("ggrepel")
install.packages("lme4")
install.packages("plyr")
install.packages("DescTools")
install.packages("do... | /install.R | no_license | filipematias23/FIELDimageR-Workshop-12 | R | false | false | 669 | r | install.packages("sp")
install.packages("raster")
install.packages("rgdal")
install.packages("ggplot2")
install.packages("agricolae")
install.packages("reshape2")
install.packages("devtools")
install.packages("ggrepel")
install.packages("lme4")
install.packages("plyr")
install.packages("DescTools")
install.packages("do... |
#' Change, rearrange or consolidate the values of an existing or new variable. Inspired by the RECODE command from SPSS.
#'
#' \code{recode} change, rearrange or consolidate the values of an existing
#' variable based on conditions. Design of this function inspired by RECODE from
#' SPSS. Sequence of recodings provid... | /R/recode.R | no_license | johnfrombluff/expss | R | false | false | 23,798 | r | #' Change, rearrange or consolidate the values of an existing or new variable. Inspired by the RECODE command from SPSS.
#'
#' \code{recode} change, rearrange or consolidate the values of an existing
#' variable based on conditions. Design of this function inspired by RECODE from
#' SPSS. Sequence of recodings provid... |
library(glmnet)
mydata = read.table("./TrainingSet/RF/haematopoietic.csv",head=T,sep=",")
x = as.matrix(mydata[,4:ncol(mydata)])
y = as.matrix(mydata[,1])
set.seed(123)
glm = cv.glmnet(x,y,nfolds=10,type.measure="mse",alpha=0.5,family="gaussian",standardize=TRUE)
sink('./Model/EN/Classifier/haematopoietic/haematopoieti... | /Model/EN/Classifier/haematopoietic/haematopoietic_057.R | no_license | leon1003/QSMART | R | false | false | 373 | r | library(glmnet)
mydata = read.table("./TrainingSet/RF/haematopoietic.csv",head=T,sep=",")
x = as.matrix(mydata[,4:ncol(mydata)])
y = as.matrix(mydata[,1])
set.seed(123)
glm = cv.glmnet(x,y,nfolds=10,type.measure="mse",alpha=0.5,family="gaussian",standardize=TRUE)
sink('./Model/EN/Classifier/haematopoietic/haematopoieti... |
\name{cdbkVar-class}
\docType{class}
\alias{cdbkVar-class}
\title{Class for variable description objects}
\description{Virtual class for objects containing variable-level
documentation.}
\section{Extends}{
Class \code{"\linkS4class{cdbkObject}"}, directly.
}
\section{Methods}{
No methods defined with class ... | /man/cdbkVar-class.Rd | no_license | mbojan/cdbk-old | R | false | false | 534 | rd | \name{cdbkVar-class}
\docType{class}
\alias{cdbkVar-class}
\title{Class for variable description objects}
\description{Virtual class for objects containing variable-level
documentation.}
\section{Extends}{
Class \code{"\linkS4class{cdbkObject}"}, directly.
}
\section{Methods}{
No methods defined with class ... |
#' Reads the DESTATIS GV100 Format
#'
#' The GV100 format is used by DESTATIS to publish the German municipality register
#'
#'
#' @param file path to file
#' @param stzrt integer to select the administrative level (see details)
#' @param version which GV100 version. If NULL the version is guessed based on the file ... | /R/read_gv100.R | no_license | jh3863/wiesbaden | R | false | false | 2,653 | r | #' Reads the DESTATIS GV100 Format
#'
#' The GV100 format is used by DESTATIS to publish the German municipality register
#'
#'
#' @param file path to file
#' @param stzrt integer to select the administrative level (see details)
#' @param version which GV100 version. If NULL the version is guessed based on the file ... |
### Define working directory ---------------------------------------------
#
rm(list = ls())
#
library(magrittr)
library(dendextend)
library(ggplot2)
my_plots <- list()
my_cols <- c("#387eb8", "#d1d2d4", "#e21e25", "#fbaf3f", "#3B3B3B", "#834F96")
#
my_pg_f <- "H:/data/Synechocystis_6frame/Kopf_2014_TU/Transcri... | /tools/Rscripts/Clustering_heatmap_uncharacterised_TU.R | no_license | nnalpas/Proteogenomics_reannotation | R | false | false | 9,055 | r |
### Define working directory ---------------------------------------------
#
rm(list = ls())
#
library(magrittr)
library(dendextend)
library(ggplot2)
my_plots <- list()
my_cols <- c("#387eb8", "#d1d2d4", "#e21e25", "#fbaf3f", "#3B3B3B", "#834F96")
#
my_pg_f <- "H:/data/Synechocystis_6frame/Kopf_2014_TU/Transcri... |
## shoule change tolerance, set it as argument
findComps.sigma <- function(object,tolerance=1) {
## we assume that the peaks are sorted by sample
components <- by(object@peaks, object@peaks[,"sample"],
find_components,tolerance=tolerance)
comp_list <- lapply(components, "[[", "comps")
comps ... | /R/findComps-alg.R | no_license | mariev/chromatoplots | R | false | false | 8,252 | r | ## shoule change tolerance, set it as argument
findComps.sigma <- function(object,tolerance=1) {
## we assume that the peaks are sorted by sample
components <- by(object@peaks, object@peaks[,"sample"],
find_components,tolerance=tolerance)
comp_list <- lapply(components, "[[", "comps")
comps ... |
rm(list=ls(all=TRUE))
########
library(readr)
df <- read_delim("~/mitoclub/human-global-tree/Body/1Raw/CancerDataFromCampbell/mtDNA_snv_Oct2016.txt",
"\t", escape_double = FALSE, trim_ws = TRUE)
# ALL Total number of mutations (rows in table) - 7611
nrow(df)
########
# ALL - All mut... | /Head/2Scripts/validation/CancerMutFreqs.R | no_license | mitoclub/human-global-tree | R | false | false | 19,932 | r | rm(list=ls(all=TRUE))
########
library(readr)
df <- read_delim("~/mitoclub/human-global-tree/Body/1Raw/CancerDataFromCampbell/mtDNA_snv_Oct2016.txt",
"\t", escape_double = FALSE, trim_ws = TRUE)
# ALL Total number of mutations (rows in table) - 7611
nrow(df)
########
# ALL - All mut... |
## Plot 2
# Reades file into data frame
fulldata<-read.table("household_power_consumption.txt", header=TRUE, sep=";", dec=".", na.string="?")
# Read Relevant Data
febdata<-fulldata[with(fulldata, Date=="1/2/2007"|Date=="2/2/2007"), ]
# Creates Plot 2
dateTime <- strptime( paste(febdata$Date,dados2$Time), format="%... | /Plot2.R | no_license | dipeshtech/ExData_Plotting1 | R | false | false | 491 | r | ## Plot 2
# Reades file into data frame
fulldata<-read.table("household_power_consumption.txt", header=TRUE, sep=";", dec=".", na.string="?")
# Read Relevant Data
febdata<-fulldata[with(fulldata, Date=="1/2/2007"|Date=="2/2/2007"), ]
# Creates Plot 2
dateTime <- strptime( paste(febdata$Date,dados2$Time), format="%... |
# load and format public data on cases in each state
load_aus_timeseries <- function() {
# load data from covid19data.org.au (scraped by Chris Baker) with cases by
# source for some states.
source_data <- load_cases_by_source_and_state()
# subset the case data to Aus states
aus <- load_cases_and_deaths... | /functions/load_data.R | no_license | emmamcbryde/australia_covid_ascertainment | R | false | false | 4,112 | r | # load and format public data on cases in each state
load_aus_timeseries <- function() {
# load data from covid19data.org.au (scraped by Chris Baker) with cases by
# source for some states.
source_data <- load_cases_by_source_and_state()
# subset the case data to Aus states
aus <- load_cases_and_deaths... |
require('kernlab')
kfunction <- function(linear =0, quadratic=0)
{
k <- function (x,y)
{
linear*sum((x)*(y)) + quadratic*sum((x^2)*(y^2))
}
class(k) <- "kernel"
k
}
n = 20
r = runif(n)
a = 2*pi*runif(n)
a1 = r*sin(a)
a2 = r*cos(a)
r = 2+runif(n)
a = 2*pi*runif(n)
b1 = r*sin(a)
b2 = r*cos(a)
x = rbind(mat... | /KernelSVM/CustomKernelSVM.R | no_license | agamat/blog | R | false | false | 2,433 | r | require('kernlab')
kfunction <- function(linear =0, quadratic=0)
{
k <- function (x,y)
{
linear*sum((x)*(y)) + quadratic*sum((x^2)*(y^2))
}
class(k) <- "kernel"
k
}
n = 20
r = runif(n)
a = 2*pi*runif(n)
a1 = r*sin(a)
a2 = r*cos(a)
r = 2+runif(n)
a = 2*pi*runif(n)
b1 = r*sin(a)
b2 = r*cos(a)
x = rbind(mat... |
# function to simulate data:
#
#
# n - number of samples
# p - number of features
# sig_p - number of significant features, predictive of response
# d - difference between 2 groups in the significant features
# no correlation structure (for now)
# all gaussian
library("tidyverse")
source("functions/simcor.r")
create_... | /functions/create_data.R | no_license | StevenWallaert/masterthesis | R | false | false | 1,778 | r | # function to simulate data:
#
#
# n - number of samples
# p - number of features
# sig_p - number of significant features, predictive of response
# d - difference between 2 groups in the significant features
# no correlation structure (for now)
# all gaussian
library("tidyverse")
source("functions/simcor.r")
create_... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gbeta.R
\name{GBeta}
\alias{GBeta}
\alias{dgbeta}
\alias{pgbeta}
\alias{rgbeta}
\alias{qgbeta}
\title{Generalized Beta distribution}
\usage{
dgbeta(u, c, d, kappa, tau, log = FALSE)
pgbeta(q, c, d, kappa, tau)
rgbeta(n, c, d, kappa, tau, me... | /gbeta/man/GBeta.Rd | no_license | akhikolla/TestedPackages-NoIssues | R | false | true | 1,652 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gbeta.R
\name{GBeta}
\alias{GBeta}
\alias{dgbeta}
\alias{pgbeta}
\alias{rgbeta}
\alias{qgbeta}
\title{Generalized Beta distribution}
\usage{
dgbeta(u, c, d, kappa, tau, log = FALSE)
pgbeta(q, c, d, kappa, tau)
rgbeta(n, c, d, kappa, tau, me... |
# source("C:\\R Toolbox\\backtestKernel.R")
backtestKernel <- function(dateList, univList, factors, rebalFreq="1 months", returnFreq=1, implementationLag="1 days", spreadBuckets=5, factorTable="factor_scores"){
# Instantiate results matrices
spreads <- matrix(NA, length(dateList), length(factors))
dimname... | /backtestKernel20100603.R | no_license | AdamGrealish/R-Quant | R | false | false | 2,297 | r | # source("C:\\R Toolbox\\backtestKernel.R")
backtestKernel <- function(dateList, univList, factors, rebalFreq="1 months", returnFreq=1, implementationLag="1 days", spreadBuckets=5, factorTable="factor_scores"){
# Instantiate results matrices
spreads <- matrix(NA, length(dateList), length(factors))
dimname... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pvdiv_gwas.R
\name{dots}
\alias{dots}
\alias{advanced...}
\title{Set an advanced argument}
\usage{
dots(name, value, ...)
}
\arguments{
\item{name}{Name of the advanced argument to look for in \code{...}}
\item{value}{The default value of th... | /man/dots.Rd | no_license | Alice-MacQueen/switchgrassGWAS | R | false | true | 1,733 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pvdiv_gwas.R
\name{dots}
\alias{dots}
\alias{advanced...}
\title{Set an advanced argument}
\usage{
dots(name, value, ...)
}
\arguments{
\item{name}{Name of the advanced argument to look for in \code{...}}
\item{value}{The default value of th... |
# load packages to read, write and manipulate data
library(rgeos)
library(sp)
library(rgdal)
library(raster)
library(ggplot2)
library(ggiraph)
library(sp)
library(leaflet)
# read data
billboards <- read.csv("billboards_all.csv")
dma <- readOGR("dma_join","dma_join")
roads <- readOGR("2017_us_primaryroads","tl_2017_u... | /data/map_2.R | no_license | j221-dataviz/catherine-schuknecht | R | false | false | 1,564 | r |
# load packages to read, write and manipulate data
library(rgeos)
library(sp)
library(rgdal)
library(raster)
library(ggplot2)
library(ggiraph)
library(sp)
library(leaflet)
# read data
billboards <- read.csv("billboards_all.csv")
dma <- readOGR("dma_join","dma_join")
roads <- readOGR("2017_us_primaryroads","tl_2017_u... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/trunc-digits.R
\name{trunc_digits}
\alias{trunc_digits}
\title{truncation with digits}
\usage{
trunc_digits(x, digits = 1)
}
\arguments{
\item{x}{a numeric}
\item{digits}{an integer}
}
\description{
like \code{trunc}, but with digits specifi... | /man/trunc_digits.Rd | no_license | renlund/ucR | R | false | true | 355 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/trunc-digits.R
\name{trunc_digits}
\alias{trunc_digits}
\title{truncation with digits}
\usage{
trunc_digits(x, digits = 1)
}
\arguments{
\item{x}{a numeric}
\item{digits}{an integer}
}
\description{
like \code{trunc}, but with digits specifi... |
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/ccb.fpc.R
\name{ccb.fpc}
\alias{ccb.fpc}
\title{Corrected confidence bands using functional principal components}
\usage{
ccb.fpc(Y, argvals = NULL, nbasis = 10, pve = 0.99, n.boot = 100,
simul = FALSE, sim.alpha = 0.95)
}
\argument... | /man/ccb.fpc.Rd | no_license | jihuilee/refund | R | false | false | 4,244 | rd | % Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/ccb.fpc.R
\name{ccb.fpc}
\alias{ccb.fpc}
\title{Corrected confidence bands using functional principal components}
\usage{
ccb.fpc(Y, argvals = NULL, nbasis = 10, pve = 0.99, n.boot = 100,
simul = FALSE, sim.alpha = 0.95)
}
\argument... |
# The emails vector has already been defined for you
emails <- c("john.doe@ivyleague.edu", "education@world.gov", "dalai.lama@peace.org",
"invalid.edu", "quant@bigdatacollege.edu", "cookie.monster@sesame.tv")
# Use grepl() to match for .edu addresses more robustly
grepl("@.*\\.edu$", emails)
# Use ... | /datacamp/intermediate-r/utilities/8.r | no_license | pausanchezv/R | R | false | false | 473 | r | # The emails vector has already been defined for you
emails <- c("john.doe@ivyleague.edu", "education@world.gov", "dalai.lama@peace.org",
"invalid.edu", "quant@bigdatacollege.edu", "cookie.monster@sesame.tv")
# Use grepl() to match for .edu addresses more robustly
grepl("@.*\\.edu$", emails)
# Use ... |
Preprocess.MC <-
function(Nsi, Wi)
{
# n_i
Ni <- colSums(Nsi)
# p_si
Psi <- Nsi %*% diag(1/Ni)
dimnames(Psi) <- dimnames(Nsi)
# p_s
Ps <- apply(Psi %*% diag(Wi), 1, sum)
# n is by choice the sum of ni. Avoid integer overflow.
N <- sum(as.numeric(Ni))
# n_s
Ns <- Ps * N
MC <- l... | /R/Preprocess.MC.R | no_license | yangxhcaf/entropart | R | false | false | 672 | r | Preprocess.MC <-
function(Nsi, Wi)
{
# n_i
Ni <- colSums(Nsi)
# p_si
Psi <- Nsi %*% diag(1/Ni)
dimnames(Psi) <- dimnames(Nsi)
# p_s
Ps <- apply(Psi %*% diag(Wi), 1, sum)
# n is by choice the sum of ni. Avoid integer overflow.
N <- sum(as.numeric(Ni))
# n_s
Ns <- Ps * N
MC <- l... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/WGCNA.R
\name{WGCNA_GeneModuleTraitCoorelation}
\alias{WGCNA_GeneModuleTraitCoorelation}
\title{Genes correlated with both traits an modules.}
\usage{
WGCNA_GeneModuleTraitCoorelation(datExpr, MEs_col, geneTraitCor, traitData,
net, corType ... | /man/WGCNA_GeneModuleTraitCoorelation.Rd | permissive | babyding/YSX | R | false | true | 2,696 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/WGCNA.R
\name{WGCNA_GeneModuleTraitCoorelation}
\alias{WGCNA_GeneModuleTraitCoorelation}
\title{Genes correlated with both traits an modules.}
\usage{
WGCNA_GeneModuleTraitCoorelation(datExpr, MEs_col, geneTraitCor, traitData,
net, corType ... |
# ---------------------------------------------------------------------------- #
# This script examplifies how to run parallel processes in R and compares #
# parallel to serial performance in a simple counting scenario #
# Author Leon Eyrich Jessen March 2017 ... | /R/02_parallelr.R | no_license | DTU-advR/DTU-advR-2017-12-15 | R | false | false | 2,377 | r | # ---------------------------------------------------------------------------- #
# This script examplifies how to run parallel processes in R and compares #
# parallel to serial performance in a simple counting scenario #
# Author Leon Eyrich Jessen March 2017 ... |
coupling_1_update <- function(data, n, m, k, incidence_MCMC, iterations, step_save, a_1, T_0, a_2, V){
# We initialize a list to store the sampled incidence matrices.
MCMC <- list()
scaling_stored <- c()
# We fix a number of hyperparameters.
v <- 1
mu <- numeric(n)
dof <- a_2
prec <- V
step_counter <-... | /GitHub/coupling_1_update.R | no_license | bluttikhuizen/masterthesis | R | false | false | 4,039 | r | coupling_1_update <- function(data, n, m, k, incidence_MCMC, iterations, step_save, a_1, T_0, a_2, V){
# We initialize a list to store the sampled incidence matrices.
MCMC <- list()
scaling_stored <- c()
# We fix a number of hyperparameters.
v <- 1
mu <- numeric(n)
dof <- a_2
prec <- V
step_counter <-... |
submit_mp3.transcription <- function(...) {
# ... = file paths (various number of files allowed)
# Returns file names as shown in S3
files <- list(...)
commands <- unlist(files) %>%
paste('aws s3 cp raw_data/', ., ' s3://sang.math110', sep = '')
for(i in commands) system(i)
return(unlist(fi... | /R/analysis.R | no_license | sangddn/Using-AWS-to-Transcribe-and-Translate-Churchill-1944-Speech | R | false | false | 5,210 | r | submit_mp3.transcription <- function(...) {
# ... = file paths (various number of files allowed)
# Returns file names as shown in S3
files <- list(...)
commands <- unlist(files) %>%
paste('aws s3 cp raw_data/', ., ' s3://sang.math110', sep = '')
for(i in commands) system(i)
return(unlist(fi... |
library(dplyr)
library(ggplot2)
library(readr)
creditcard <- read_csv("creditcard.csv")
#View(creditcard)
library(caTools)
#install.packages('caTools')
set.seed(123)
split=sample.split(creditcard$Class, SplitRatio = 0.8)
training_set=subset(creditcard,split==TRUE)
test_set=subset(creditcard,split==FALSE)
regressor = lm... | /All Files/Project.R | no_license | ADHIKSHA/R_scripts | R | false | false | 3,326 | r | library(dplyr)
library(ggplot2)
library(readr)
creditcard <- read_csv("creditcard.csv")
#View(creditcard)
library(caTools)
#install.packages('caTools')
set.seed(123)
split=sample.split(creditcard$Class, SplitRatio = 0.8)
training_set=subset(creditcard,split==TRUE)
test_set=subset(creditcard,split==FALSE)
regressor = lm... |
library(dplyr)
library(lubridate)
#Load dataset
data = read.table(file='household_power_consumption.txt', sep=';', header = TRUE)
#subset to wanted dates - also convert to numeric
data_subset = filter(data, Date %in% c('1/2/2007', '2/2/2007'))
data_subset$Global_active_power = as.numeric(data_subset$Global_active_po... | /plot4.R | no_license | dalibor49/ExData_Plotting1 | R | false | false | 1,638 | r | library(dplyr)
library(lubridate)
#Load dataset
data = read.table(file='household_power_consumption.txt', sep=';', header = TRUE)
#subset to wanted dates - also convert to numeric
data_subset = filter(data, Date %in% c('1/2/2007', '2/2/2007'))
data_subset$Global_active_power = as.numeric(data_subset$Global_active_po... |
#' Compute the R2-mtch indicator from Shang et al.
#' @title Modified tchebyscheff R2-indicator
#' @param dataPoints The Points coordinate. Each column contains a single point (column major).
#' @param reference The reference point for computing R2-mtch (similar as reference for HV)
#' @param weights The weights/direct... | /R/R2mtch.R | no_license | dots26/MaOEA | R | false | false | 10,850 | r | #' Compute the R2-mtch indicator from Shang et al.
#' @title Modified tchebyscheff R2-indicator
#' @param dataPoints The Points coordinate. Each column contains a single point (column major).
#' @param reference The reference point for computing R2-mtch (similar as reference for HV)
#' @param weights The weights/direct... |
### ============================================================================
### Self-defined constructor for AlignedConsensusSet
### ============================================================================
#' @description the wrapper function for SangerAlignment
#'
#' @param inputSource The input source of the... | /R/Constructors.R | permissive | ukaraoz/sangeranalyseR | R | false | false | 26,562 | r | ### ============================================================================
### Self-defined constructor for AlignedConsensusSet
### ============================================================================
#' @description the wrapper function for SangerAlignment
#'
#' @param inputSource The input source of the... |
load("models/CPAT/dat/Human_logitModel.RData")
test <- read.table(file="results/CPAT_outfile.dat",sep="\t",col.names=c("ID","mRNA","ORF","Fickett","Hexamer"),quote = "")
test$prob <- predict(mylogit,newdata=test,type="response")
attach(test)
output <- cbind("mRNA_size"=mRNA,"ORF_size"=ORF,"Fickett_score"=Fickett,"Hexam... | /results/CPAT_outfile.r | no_license | LittleHannah/ezLncPred | R | false | false | 441 | r | load("models/CPAT/dat/Human_logitModel.RData")
test <- read.table(file="results/CPAT_outfile.dat",sep="\t",col.names=c("ID","mRNA","ORF","Fickett","Hexamer"),quote = "")
test$prob <- predict(mylogit,newdata=test,type="response")
attach(test)
output <- cbind("mRNA_size"=mRNA,"ORF_size"=ORF,"Fickett_score"=Fickett,"Hexam... |
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
## Total emissions for each year
totalPerYear <- aggregate(Emissions ~ year, NEI, sum)
png(filename = "plot1.png", width = 480, height = 480)
plot(totalPerYear, type = "l", col = "darkblue",
xlab = "Year", ylab = "Total Emiss... | /plot1.R | no_license | srajasek/ExploratoryDataAnalysis | R | false | false | 382 | r | NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
## Total emissions for each year
totalPerYear <- aggregate(Emissions ~ year, NEI, sum)
png(filename = "plot1.png", width = 480, height = 480)
plot(totalPerYear, type = "l", col = "darkblue",
xlab = "Year", ylab = "Total Emiss... |
## Libraries required
library(tidyverse)
library(here)
## Function required
## x is the input list, d is the distance allowed between coordinates between each time point
dfret <- function(x, d) {
# Select columns of interest from dataframe
y <- x %>%
select('WellName', 'Field', 'Timepoint', 'X', 'Y', 'TrackedC... | /single_cell_FRET.R | no_license | ryan4martin/FRET_analysis | R | false | false | 4,662 | r | ## Libraries required
library(tidyverse)
library(here)
## Function required
## x is the input list, d is the distance allowed between coordinates between each time point
dfret <- function(x, d) {
# Select columns of interest from dataframe
y <- x %>%
select('WellName', 'Field', 'Timepoint', 'X', 'Y', 'TrackedC... |
testlist <- list(n = 168440576L)
result <- do.call(breakfast:::setBitNumber,testlist)
str(result) | /breakfast/inst/testfiles/setBitNumber/libFuzzer_setBitNumber/setBitNumber_valgrind_files/1609961964-test.R | no_license | akhikolla/updated-only-Issues | R | false | false | 97 | r | testlist <- list(n = 168440576L)
result <- do.call(breakfast:::setBitNumber,testlist)
str(result) |
library(shiny)
library(shinydashboard)
library(pracma)
server <- function(input, output) {
# read-in util functions
source("util.R")
# Data table code
{
# Create data table of p-values and test metrics
pvaldata <- function(y, p) {
d <- data.frame(
"Tests" = c(
"Bernoulli dis... | /server.R | no_license | warwickdatasciencesociety/random-coin-flips | R | false | false | 4,594 | r | library(shiny)
library(shinydashboard)
library(pracma)
server <- function(input, output) {
# read-in util functions
source("util.R")
# Data table code
{
# Create data table of p-values and test metrics
pvaldata <- function(y, p) {
d <- data.frame(
"Tests" = c(
"Bernoulli dis... |
# Han Nguyen
# BU ID: U00194394
# Assignment 1
## Try R
x <- scan()
# Enter numbers: 2 0 9 7 1 5 2 2 3 3 2 2 2 3 2 8 0 1 3 4 6
# how long is x? 21
length(x)
# what is the sum of the values in x? 67
sum(x)
# what is the mean of x? 3.190476
mean(x)
# what else can you do with scan?
?scan()
# read txt into spreadsh... | /Han Nguyen Assignment 1.R | no_license | hannahng97/MA-415 | R | false | false | 1,657 | r | # Han Nguyen
# BU ID: U00194394
# Assignment 1
## Try R
x <- scan()
# Enter numbers: 2 0 9 7 1 5 2 2 3 3 2 2 2 3 2 8 0 1 3 4 6
# how long is x? 21
length(x)
# what is the sum of the values in x? 67
sum(x)
# what is the mean of x? 3.190476
mean(x)
# what else can you do with scan?
?scan()
# read txt into spreadsh... |
# load packages ----
library(tidyverse)
library(DBI)
library(odbc)
# connect to database ----
iquizoo_online <- dbConnect(odbc(), "iquizoo-old", database = "eval_core")
# fetch data ----
raw_data <- dbGetQuery(
iquizoo_online,
read_file("test/current_data.sql")
)
users <- dbGetQuery(
iquizoo_online,
read_file... | /scripts/extract_test_data.R | no_license | psychelzh/cognitive-training | R | false | false | 890 | r | # load packages ----
library(tidyverse)
library(DBI)
library(odbc)
# connect to database ----
iquizoo_online <- dbConnect(odbc(), "iquizoo-old", database = "eval_core")
# fetch data ----
raw_data <- dbGetQuery(
iquizoo_online,
read_file("test/current_data.sql")
)
users <- dbGetQuery(
iquizoo_online,
read_file... |
#' Make COVID map
#'
#' @param file File to save to.
#'
#' @export
make_covid_map <- function(file) {
data_cases <- readr::read_csv(
"https://od.cdc.gov.tw/eic/Day_Confirmation_Age_County_Gender_19CoV.csv",
col_names = c(NA, "date", "county", "town", NA, NA, NA, "cases")
) |>
dplyr::slice(-1) |>
dplyr::... | /R/make_covid_map.R | permissive | ythlev/covidmaptw | R | false | false | 1,691 | r | #' Make COVID map
#'
#' @param file File to save to.
#'
#' @export
make_covid_map <- function(file) {
data_cases <- readr::read_csv(
"https://od.cdc.gov.tw/eic/Day_Confirmation_Age_County_Gender_19CoV.csv",
col_names = c(NA, "date", "county", "town", NA, NA, NA, "cases")
) |>
dplyr::slice(-1) |>
dplyr::... |
#-------------------------------------------------
#--------------- use of list in R ----------------
#-------------------------------------------------
rm(list = ls())
w <- list()
w[[1]] <- c(1:12) # insert vectors or matrices into a list (cell)
w[[2]] <- matrix(0,2,3)
w
a <... | /old R exercises/try3.R | no_license | WeiyiDeng/R_data | R | false | false | 3,056 | r | #-------------------------------------------------
#--------------- use of list in R ----------------
#-------------------------------------------------
rm(list = ls())
w <- list()
w[[1]] <- c(1:12) # insert vectors or matrices into a list (cell)
w[[2]] <- matrix(0,2,3)
w
a <... |
library(countrycode)
contact <- read.csv('/Users/qidiwang1/Desktop/contact.csv')
vaccine <- read.csv('/Users/qidiwang1/Desktop/vaccine.csv')
contact$iso3_name <- countrycode(contact$Country, origin = 'country.name', destination = 'iso3c')
vaccine$iso3_name <- countrycode(vaccine$Country, origin = 'country.name', destin... | /10月24号为止的r code/融合google trend信息.R | no_license | qidiwang1/Rstudio | R | false | false | 2,500 | r | library(countrycode)
contact <- read.csv('/Users/qidiwang1/Desktop/contact.csv')
vaccine <- read.csv('/Users/qidiwang1/Desktop/vaccine.csv')
contact$iso3_name <- countrycode(contact$Country, origin = 'country.name', destination = 'iso3c')
vaccine$iso3_name <- countrycode(vaccine$Country, origin = 'country.name', destin... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ebswhitetheme.R
\name{ebs_white}
\alias{ebs_white}
\title{ebswhitetheme}
\usage{
ebs_white(base_size = 12, base_family = "")
}
\arguments{
\item{base_size}{base font size}
\item{base_family}{base font family}
}
\description{
create a plot th... | /ebsthemes/man/ebs_white.Rd | no_license | ebsmith01/PastProjectsTROVE | R | false | true | 526 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ebswhitetheme.R
\name{ebs_white}
\alias{ebs_white}
\title{ebswhitetheme}
\usage{
ebs_white(base_size = 12, base_family = "")
}
\arguments{
\item{base_size}{base font size}
\item{base_family}{base font family}
}
\description{
create a plot th... |
###############
#LIBS
###############
library(lme4)
library(reshape)
library(foreign)
library(ggplot2)
library(plyr)
library(data.table)
library(reshape2)
library(Hmisc)
library(mgcv)
library(gdata)
####GAM formula
m4.formula<-as.formula(resm3~s(tden,popden)+s(pcturban)+s(elev)+s(dist_pemis)+s(dist_A1)+s(tden,pbl)+s... | /Uni/Projects/code/P031.MIAC_PM/cn0026_m4.R | no_license | zeltak/org | R | false | false | 38,729 | r | ###############
#LIBS
###############
library(lme4)
library(reshape)
library(foreign)
library(ggplot2)
library(plyr)
library(data.table)
library(reshape2)
library(Hmisc)
library(mgcv)
library(gdata)
####GAM formula
m4.formula<-as.formula(resm3~s(tden,popden)+s(pcturban)+s(elev)+s(dist_pemis)+s(dist_A1)+s(tden,pbl)+s... |
#RでのROC解析:ROCRパッケージを使ったROC曲線とAUCの求め方
#http://www.nemotos.net/?p=836
install.packages("ROCR")
library("ROCR")
rocdata <- read.table("roc_data.txt")
#ROCR ステップ1: prediction
#ROCRのステップ1はpredictionで、値と属するグループを指定します。
pred <- prediction(rocdata[,1], rocdata[,2])
#ROCR ステップ2: performance
#ROCRのステップ2はperforman... | /ROCRパッケージを使ったROC曲線とAUCの求め方08242018.R | no_license | ytomogane/data_analysis_codes | R | false | false | 1,715 | r | #RでのROC解析:ROCRパッケージを使ったROC曲線とAUCの求め方
#http://www.nemotos.net/?p=836
install.packages("ROCR")
library("ROCR")
rocdata <- read.table("roc_data.txt")
#ROCR ステップ1: prediction
#ROCRのステップ1はpredictionで、値と属するグループを指定します。
pred <- prediction(rocdata[,1], rocdata[,2])
#ROCR ステップ2: performance
#ROCRのステップ2はperforman... |
#' set_group_lines - determines coordinates for the separating lines
#'
#' @description
#' Calculates coordinates for separating lines between the treatment groups
#'
#' @param patients patient dataset
#' @param height number of circles on the vertical axis
#'
#' @keywords internal
set_group_lines <- functio... | /R/set_group_lines.R | no_license | cran/adepro | R | false | false | 829 | r | #' set_group_lines - determines coordinates for the separating lines
#'
#' @description
#' Calculates coordinates for separating lines between the treatment groups
#'
#' @param patients patient dataset
#' @param height number of circles on the vertical axis
#'
#' @keywords internal
set_group_lines <- functio... |
library(KEGGgraph)
library(KEGG.db)
library(KEGGREST)
library(gage)
library(readxl)
# library(dplyr)
library(ggplot2)
### GLOBAL ###
use_local_kegg <- TRUE
local_kegg_dir <- 'kegg_data'
min_genes <- 5 # min number of genes in the pathway to cutoff
### FUNCTIONS ###
# parsing KEGG graphs
# using local files from lo... | /diff_expression.r | no_license | kirill-varchenko/Dif_expression_profiles_project | R | false | false | 7,117 | r | library(KEGGgraph)
library(KEGG.db)
library(KEGGREST)
library(gage)
library(readxl)
# library(dplyr)
library(ggplot2)
### GLOBAL ###
use_local_kegg <- TRUE
local_kegg_dir <- 'kegg_data'
min_genes <- 5 # min number of genes in the pathway to cutoff
### FUNCTIONS ###
# parsing KEGG graphs
# using local files from lo... |
/home/hlh/private-gravity/ext_lib/CoinIpopt/Ipopt/contrib/RInterface/man/ipoptr.Rd | /private-gravity/ext_lib/CoinIpopt/build/Ipopt/contrib/RInterface/man/ipoptr.Rd | permissive | arunveeramany/GridOpt | R | false | false | 82 | rd | /home/hlh/private-gravity/ext_lib/CoinIpopt/Ipopt/contrib/RInterface/man/ipoptr.Rd |
## Put comments here that give an overall description of what your
## functions do
## Write a short comment describing this function
## Caching the Inverse of a Matrix
## Matrix inversion is usually a costly computation.
## There may be some benefit to caching the inverse of
## a matrix rather than compute it... | /cachematrix.R | no_license | diamond456/R | R | false | false | 1,338 | r | ## Put comments here that give an overall description of what your
## functions do
## Write a short comment describing this function
## Caching the Inverse of a Matrix
## Matrix inversion is usually a costly computation.
## There may be some benefit to caching the inverse of
## a matrix rather than compute it... |
# 137 time series hw3
# read data
lake = read.table(file = "/home/yunzheli/class/sta137/lake.dat")
# find the trend line
# convert data to R time series objects
lakeModel = ts(lake, start = 1985)
# set variabe t
t = 1 : length(lakeModel)
# simple linear regression
lsfit = lm(lakeModel~t)
# plotting
plot(t, lakeMo... | /homework/hw3.R | no_license | Jacksoften/STA137 | R | false | false | 1,220 | r | # 137 time series hw3
# read data
lake = read.table(file = "/home/yunzheli/class/sta137/lake.dat")
# find the trend line
# convert data to R time series objects
lakeModel = ts(lake, start = 1985)
# set variabe t
t = 1 : length(lakeModel)
# simple linear regression
lsfit = lm(lakeModel~t)
# plotting
plot(t, lakeMo... |
test_that("ff_starters returns a tibble of starters", {
local_mock_api()
dlf <- mfl_connect(2020, 37920)
dlf_starters <- ff_starters(dlf, week = c(1:3), year = 2020)
expect_tibble(dlf_starters, min.rows = 100)
jml_conn <- sleeper_connect(league_id = "522458773317046272", season = 2020)
jml_starters <- ff... | /tests/testthat/test-ff_starters.R | permissive | jfontestad/ffscrapr | R | false | false | 1,265 | r | test_that("ff_starters returns a tibble of starters", {
local_mock_api()
dlf <- mfl_connect(2020, 37920)
dlf_starters <- ff_starters(dlf, week = c(1:3), year = 2020)
expect_tibble(dlf_starters, min.rows = 100)
jml_conn <- sleeper_connect(league_id = "522458773317046272", season = 2020)
jml_starters <- ff... |
#--------------------------------------------------------------------
# EA
#--------------------------------------------------------------------
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=
# Handling visibility
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=
observeEvent(input... | /inst/app/server/eaplot.R | no_license | BioinformaticsFMRP/TCGAbiolinksGUI | R | false | false | 7,404 | r | #--------------------------------------------------------------------
# EA
#--------------------------------------------------------------------
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=
# Handling visibility
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=
observeEvent(input... |
## By Marius Hofert and Alexander McNeil
## Generate and transform multivariate data (with the probability and quantile
## transformations)
### Setup ######################################################################
library(mvtnorm) # for sampling from N(0, P)
library(copula) # for pairs2()
library(qrmtools) #... | /code/07_Copulas_and_Dependence/07_First_principles.R | no_license | fat-tail/qrm | R | false | false | 2,830 | r | ## By Marius Hofert and Alexander McNeil
## Generate and transform multivariate data (with the probability and quantile
## transformations)
### Setup ######################################################################
library(mvtnorm) # for sampling from N(0, P)
library(copula) # for pairs2()
library(qrmtools) #... |
##### New analyses based on Ecological Monographs Reviews #####
##### Set working directory, read in data #####
## Working directory
setwd('C:/Users/jmuehlbauer/Documents/Projects/Stream Signature/Stream Signature Analysis')
## Load packages and functions
source('C:/Users/jmuehlbauer/Documents/Misc/Trainings & Info/... | /Stream_Signature_Analysis/R Code & Input Data/R Code- Predator Stream Signatures Revision Analysis.r | no_license | jmuehlbauer-usgs/StreamSignatureFieldAnalysis | R | false | false | 16,215 | r | ##### New analyses based on Ecological Monographs Reviews #####
##### Set working directory, read in data #####
## Working directory
setwd('C:/Users/jmuehlbauer/Documents/Projects/Stream Signature/Stream Signature Analysis')
## Load packages and functions
source('C:/Users/jmuehlbauer/Documents/Misc/Trainings & Info/... |
function (y, dim, W, D, iter, tol)
{
e <- get("data.env", .GlobalEnv)
e[["constrained_stress_major"]][[length(e[["constrained_stress_major"]]) +
1]] <- list(y = y, dim = dim, W = W, D = D, iter = iter,
tol = tol)
.Call("_graphlayouts_constrained_stress_major", y, dim, W,
D, iter,... | /valgrind_test_dir/constrained_stress_major-test.R | no_license | akhikolla/RcppDeepStateTest | R | false | false | 328 | r | function (y, dim, W, D, iter, tol)
{
e <- get("data.env", .GlobalEnv)
e[["constrained_stress_major"]][[length(e[["constrained_stress_major"]]) +
1]] <- list(y = y, dim = dim, W = W, D = D, iter = iter,
tol = tol)
.Call("_graphlayouts_constrained_stress_major", y, dim, W,
D, iter,... |
library(tidyverse)
library(rpart)
library(rpart.plot)
library(caret)
#Cargando el csv de datos
ed <- read.csv("data/education.csv")
#cambiando el tipo por factor "class(ed$region)" ya que es entero
ed$region <- factor(ed$region)
##Creando la particion de datos
set.seed(1000)
t.idx <- createDataPartition(ed$expens... | /arbol-regresion-predictores-categoricos.R | no_license | wparedesgt/Regresiones | R | false | false | 585 | r | library(tidyverse)
library(rpart)
library(rpart.plot)
library(caret)
#Cargando el csv de datos
ed <- read.csv("data/education.csv")
#cambiando el tipo por factor "class(ed$region)" ya que es entero
ed$region <- factor(ed$region)
##Creando la particion de datos
set.seed(1000)
t.idx <- createDataPartition(ed$expens... |
library(dplyr)
library(lubridate)
raw <- read.csv(
"household_power_consumption.txt",
sep = ";",
header = TRUE,
na.strings = "?",
stringsAsFactors = FALSE,
colClasses = c("character", "character", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric"))
allData <- tbl_df... | /plot2.R | no_license | scheuchzer/ExData_Plotting1 | R | false | false | 660 | r | library(dplyr)
library(lubridate)
raw <- read.csv(
"household_power_consumption.txt",
sep = ";",
header = TRUE,
na.strings = "?",
stringsAsFactors = FALSE,
colClasses = c("character", "character", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric"))
allData <- tbl_df... |
#-----------------------------
# GIE of Cambodia Public Infrastructure and Local Governance Program
# For SIDA / EBA
# Matching shape data provided by ODC and their GIS Analyst with administrative
# data from the National Gazetteer
# The resulting shape data (along with a Geoquery extract) will be merged with treatment... | /match_script.R | no_license | aiddata/cambodia_eba_gie | R | false | false | 8,141 | r | #-----------------------------
# GIE of Cambodia Public Infrastructure and Local Governance Program
# For SIDA / EBA
# Matching shape data provided by ODC and their GIS Analyst with administrative
# data from the National Gazetteer
# The resulting shape data (along with a Geoquery extract) will be merged with treatment... |
\alias{gtkUIManagerRemoveUi}
\name{gtkUIManagerRemoveUi}
\title{gtkUIManagerRemoveUi}
\description{Unmerges the part of \code{self}s content identified by \code{merge.id}.}
\usage{gtkUIManagerRemoveUi(object, merge.id)}
\arguments{
\item{\verb{object}}{a \code{\link{GtkUIManager}} object}
\item{\verb{merge.id}}{a merge... | /RGtk2/man/gtkUIManagerRemoveUi.Rd | no_license | lawremi/RGtk2 | R | false | false | 475 | rd | \alias{gtkUIManagerRemoveUi}
\name{gtkUIManagerRemoveUi}
\title{gtkUIManagerRemoveUi}
\description{Unmerges the part of \code{self}s content identified by \code{merge.id}.}
\usage{gtkUIManagerRemoveUi(object, merge.id)}
\arguments{
\item{\verb{object}}{a \code{\link{GtkUIManager}} object}
\item{\verb{merge.id}}{a merge... |
library(XML)
library(lubridate)
library(dbConnect)
library(raster)
analyzer <- setRefClass("analyzer", fields = list(addedFile="data.frame", userLogin = "character"))
dbConnection = dbConnect(MySQL(), user='admin', password='admin', dbname='analyzer_db_2', host='localhost')
analyzer$methods(
setNextPointValue = ... | /Analyzer.R | no_license | KatiePi/praca_inzynierska | R | false | false | 7,134 | r | library(XML)
library(lubridate)
library(dbConnect)
library(raster)
analyzer <- setRefClass("analyzer", fields = list(addedFile="data.frame", userLogin = "character"))
dbConnection = dbConnect(MySQL(), user='admin', password='admin', dbname='analyzer_db_2', host='localhost')
analyzer$methods(
setNextPointValue = ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lrt.R
\name{lrt}
\alias{lrt}
\alias{lrt.mds_ts}
\alias{lrt.default}
\title{Likelihood Ratio Rest}
\usage{
lrt(df, ...)
\method{lrt}{mds_ts}(df, ts_event = c(Count = "nA"), analysis_of = NA, ...)
\method{lrt}{default}(
df,
analysis_of = ... | /man/lrt.Rd | no_license | gchung05/mdsstat | R | false | true | 5,518 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lrt.R
\name{lrt}
\alias{lrt}
\alias{lrt.mds_ts}
\alias{lrt.default}
\title{Likelihood Ratio Rest}
\usage{
lrt(df, ...)
\method{lrt}{mds_ts}(df, ts_event = c(Count = "nA"), analysis_of = NA, ...)
\method{lrt}{default}(
df,
analysis_of = ... |
debugSource("Blocos.R")
debugSource("buscaDesinformada.R")
debugSource("buscaInformada.R")
#(B,B,B,W,W,W,E)
inicial <- Blocos(desc = c('B','B','B','W','W','W','E'))
#(E,W,W,W,B,B,B)
objetivo <- Blocos()
objetivo$desc <- c('E','W','W','W','B','B','B')
cat("====\tBusca em Largura\t====\n")
print(unlist(buscaEmLargura(i... | /exemplosBlocos.R | no_license | FranksonTeotonho/T1_IA_2017 | R | false | false | 722 | r | debugSource("Blocos.R")
debugSource("buscaDesinformada.R")
debugSource("buscaInformada.R")
#(B,B,B,W,W,W,E)
inicial <- Blocos(desc = c('B','B','B','W','W','W','E'))
#(E,W,W,W,B,B,B)
objetivo <- Blocos()
objetivo$desc <- c('E','W','W','W','B','B','B')
cat("====\tBusca em Largura\t====\n")
print(unlist(buscaEmLargura(i... |
library(stringr)
library(dplyr)
library(tidyr)
#Checkpoint 1
companies <- read.delim('companies.txt',stringsAsFactors=F)
#str(companies)
round2 <- read.csv('rounds2.csv',stringsAsFactors=F)
#str(round2)
#count unique companies in Round2
nrow(distinct(round2,str_to_lower(company_permalink)))
#count... | /InvestmentCaseStudy.R | no_license | AbhineshMishra/FundsAllocation | R | false | false | 5,330 | r | library(stringr)
library(dplyr)
library(tidyr)
#Checkpoint 1
companies <- read.delim('companies.txt',stringsAsFactors=F)
#str(companies)
round2 <- read.csv('rounds2.csv',stringsAsFactors=F)
#str(round2)
#count unique companies in Round2
nrow(distinct(round2,str_to_lower(company_permalink)))
#count... |
## These functions are meant to calculate the inverse a matrix object, in case the inverse
## has already being calculated, it just return it from the cache.
## This function creates an object which is a list with functions to set and get a matrix
## and functions to set and get the inverse of the matrix
makeCacheMat... | /cachematrix.R | no_license | mabevalle/ProgrammingAssignment2 | R | false | false | 937 | r | ## These functions are meant to calculate the inverse a matrix object, in case the inverse
## has already being calculated, it just return it from the cache.
## This function creates an object which is a list with functions to set and get a matrix
## and functions to set and get the inverse of the matrix
makeCacheMat... |
# In R, a matrix is a collection of elements of the same data type (numeric, character, or logical) arranged into a fixed number of rows and columns. Since you are only working with rows and columns, a matrix is called two-dimensional.
#
# You can construct a matrix in R with the matrix() function. Consider the foll... | /Matrix.R | no_license | srajan95/Rbasics-2 | R | false | false | 3,888 | r | # In R, a matrix is a collection of elements of the same data type (numeric, character, or logical) arranged into a fixed number of rows and columns. Since you are only working with rows and columns, a matrix is called two-dimensional.
#
# You can construct a matrix in R with the matrix() function. Consider the foll... |
#For single file:
#Read into R
# TMP45<-read.csv("TMP45flip2shapeXqs.csv", header=TRUE)
# str(TMP45)
# #Strip all but the last 3 digits from the grid code
# library(stringr)
# #x <- "some text in a string"
# #str_sub(x,-3,-1)
# TMP45$gridcodeB<-str_sub(TMP45$gridcode,-3,-1)
# #Assign to forest stand based on the first ... | /1_script/0_gettingNRVrecastinghabitatperQS.R | no_license | borealbirds/Patchworks-NRV-cure4insect | R | false | false | 4,770 | r | #For single file:
#Read into R
# TMP45<-read.csv("TMP45flip2shapeXqs.csv", header=TRUE)
# str(TMP45)
# #Strip all but the last 3 digits from the grid code
# library(stringr)
# #x <- "some text in a string"
# #str_sub(x,-3,-1)
# TMP45$gridcodeB<-str_sub(TMP45$gridcode,-3,-1)
# #Assign to forest stand based on the first ... |
Sys.setenv(CONDA_BUILD_SYSROOT="/")
console_log <- file(snakemake@log[["console"]], open = "wt")
sink(console_log)
sink(console_log, type = "message")
# library(devtools)
# devtools::install_github("GreenleafLab/ArchR@2be1294eb1fbff364fb538d71f4f545ee4384d09", ref="master", repos = BiocManager::repositories(), depen... | /workflow/scripts/build_archr_project.R | no_license | austintwang/ENCODE_scATAC_bingren_raw | R | false | false | 6,052 | r | Sys.setenv(CONDA_BUILD_SYSROOT="/")
console_log <- file(snakemake@log[["console"]], open = "wt")
sink(console_log)
sink(console_log, type = "message")
# library(devtools)
# devtools::install_github("GreenleafLab/ArchR@2be1294eb1fbff364fb538d71f4f545ee4384d09", ref="master", repos = BiocManager::repositories(), depen... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/missing.R
\name{remove_na}
\alias{remove_na}
\title{Remove all NA values for a vector}
\usage{
remove_na(x)
}
\arguments{
\item{x}{vector}
}
\value{
vector with all NA values removed
}
\description{
Remove all NA values for a vector
}
\exampl... | /man/remove_na.Rd | no_license | alexpghayes/hayeslib | R | false | true | 354 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/missing.R
\name{remove_na}
\alias{remove_na}
\title{Remove all NA values for a vector}
\usage{
remove_na(x)
}
\arguments{
\item{x}{vector}
}
\value{
vector with all NA values removed
}
\description{
Remove all NA values for a vector
}
\exampl... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/last-quote.R
\name{last_quote}
\alias{last_quote}
\title{Get the last quote index}
\usage{
last_quote()
}
\description{
Get the last quote index
}
| /man/last_quote.Rd | permissive | tbradley1013/dundermifflin | R | false | true | 225 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/last-quote.R
\name{last_quote}
\alias{last_quote}
\title{Get the last quote index}
\usage{
last_quote()
}
\description{
Get the last quote index
}
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/signal-6.R
\name{fillGap}
\alias{fillGap}
\title{Signal processing}
\usage{
fillGap(x, sp = 1/60, max = 50, type = "linear")
}
\arguments{
\item{x}{signal}
\item{sp}{sampling period}
\item{max}{maximum gape length (to be interpolated)}
}
\d... | /man/fillGap.Rd | no_license | Losses/mlisi | R | false | true | 497 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/signal-6.R
\name{fillGap}
\alias{fillGap}
\title{Signal processing}
\usage{
fillGap(x, sp = 1/60, max = 50, type = "linear")
}
\arguments{
\item{x}{signal}
\item{sp}{sampling period}
\item{max}{maximum gape length (to be interpolated)}
}
\d... |
setwd ("/home/ben/workspace/timeCourse/data")
source("../code/R/tools.R")
library("preprocessCore")
datafile="cornellGenomeModelTH-TCFrequencyMatrix.csv"
psadatafile="psaGenome-TCFrequencyMatrix.csv"
## load data into rawCounts
rawCounts = read.table( datafile,sep=",", header=TRUE,row.names=1 , stringsAsFactors = FA... | /correlation.R | no_license | tirohia/timecourseR | R | false | false | 2,762 | r | setwd ("/home/ben/workspace/timeCourse/data")
source("../code/R/tools.R")
library("preprocessCore")
datafile="cornellGenomeModelTH-TCFrequencyMatrix.csv"
psadatafile="psaGenome-TCFrequencyMatrix.csv"
## load data into rawCounts
rawCounts = read.table( datafile,sep=",", header=TRUE,row.names=1 , stringsAsFactors = FA... |
## Put comments here that give an overall description of what your
## functions do
## Write a short comment describing this function
makeCacheMatrix <- function(x = matrix()) {
inverse<- NULL
set <- function(y){
x <<- y
inverse <<- NULL
}
get <- function() x
setinverse <- function(solveMatrix) invers... | /cachematrix.R | no_license | Ni140638/ProgrammingAssignment2- | R | false | false | 736 | 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()) {
inverse<- NULL
set <- function(y){
x <<- y
inverse <<- NULL
}
get <- function() x
setinverse <- function(solveMatrix) invers... |
#### WEB SCRAPPING FUNCTION FOR BETSTARS####
# Load and install the necessary packages:
library(tidyverse)
library(jsonlite)
library(rvest)
library(httr)
library(dplyr)
# Here we are going to use the javascript scrape_final.js to load the website with the headless browser phantomejs, which will use a delay of 5 seco... | /betstars_events.R | no_license | GokitaU/webscraping | R | false | false | 2,781 | r | #### WEB SCRAPPING FUNCTION FOR BETSTARS####
# Load and install the necessary packages:
library(tidyverse)
library(jsonlite)
library(rvest)
library(httr)
library(dplyr)
# Here we are going to use the javascript scrape_final.js to load the website with the headless browser phantomejs, which will use a delay of 5 seco... |
## Load data set
df <- read.table(file = "household_power_consumption.txt", sep=";", na.strings = c(NA, "?"),
dec = ".", header = TRUE)
## Coercing date and time vectors in data frame
df$Date <- as.Date(df$Date, "%d/%m/%Y")
df$Time <- strptime(paste(df$Date, df$Time), "%Y-%m-%d %H:%M:%S")
## Subs... | /Project-1/plot2.R | no_license | skandarora/ExData_Plotting1 | R | false | false | 753 | r | ## Load data set
df <- read.table(file = "household_power_consumption.txt", sep=";", na.strings = c(NA, "?"),
dec = ".", header = TRUE)
## Coercing date and time vectors in data frame
df$Date <- as.Date(df$Date, "%d/%m/%Y")
df$Time <- strptime(paste(df$Date, df$Time), "%Y-%m-%d %H:%M:%S")
## Subs... |
source("http://bioconductor.org/biocLite.R")
biocLite(c("csaw", "edgeR", "TxDb.Hsapiens.UCSC.hg38.knownGene", "org.Hs.eg.db", "locfit", "statmod"))
| /build/csaw/runCsaw_dependencies.R | no_license | FadelBerakdar/RNA_mapping | R | false | false | 148 | r | source("http://bioconductor.org/biocLite.R")
biocLite(c("csaw", "edgeR", "TxDb.Hsapiens.UCSC.hg38.knownGene", "org.Hs.eg.db", "locfit", "statmod"))
|
danger <- function(x, k) {
(x != k) & (k / 2 <= x)
}
bsmote <- function(df, var, k = 5, over_ratio = 1, all_neighbors = FALSE) {
majority_count <- max(table(df[[var]]))
ratio_target <- majority_count * over_ratio
which_upsample <- which(table(df[[var]]) < ratio_target)
samples_needed <- ratio_target - table(... | /R/bsmote_impl.R | permissive | yadevi/themis | R | false | false | 1,562 | r | danger <- function(x, k) {
(x != k) & (k / 2 <= x)
}
bsmote <- function(df, var, k = 5, over_ratio = 1, all_neighbors = FALSE) {
majority_count <- max(table(df[[var]]))
ratio_target <- majority_count * over_ratio
which_upsample <- which(table(df[[var]]) < ratio_target)
samples_needed <- ratio_target - table(... |
#:# libraries
library(digest)
library(mlr)
library(OpenML)
library(farff)
#:# config
set.seed(1)
#:# data
dataset <- getOMLDataSet(data.name = "heart-statlog")
head(dataset$data)
#:# preprocessing
head(dataset$data)
#:# model
task = makeClassifTask(id = "task", data = dataset$data, target = "class")
lrn = makeLearn... | /models/openml_heart-statlog/classification_class/cbc7937d089697c70e8e367c2cd91d6b/code.R | no_license | pysiakk/CaseStudies2019S | R | false | false | 690 | r | #:# libraries
library(digest)
library(mlr)
library(OpenML)
library(farff)
#:# config
set.seed(1)
#:# data
dataset <- getOMLDataSet(data.name = "heart-statlog")
head(dataset$data)
#:# preprocessing
head(dataset$data)
#:# model
task = makeClassifTask(id = "task", data = dataset$data, target = "class")
lrn = makeLearn... |
# Download all needed ACS data.
require(acs)
require(stringr)
require(e1071)
require(psych)
require(DMwR)
require(randomcoloR)
require(corrplot)
require(ggplot2)
require(lavaan)
require(scales)
require(RColorBrewer)
require(GPArotation)
setwd("/Volumes/T1000/Analysis/kclary/Neighborhood_Analysis/Tract")
source("R/func... | /download_ACS_data.R | no_license | kforthman/neighborhood_analysis | R | false | false | 801 | r | # Download all needed ACS data.
require(acs)
require(stringr)
require(e1071)
require(psych)
require(DMwR)
require(randomcoloR)
require(corrplot)
require(ggplot2)
require(lavaan)
require(scales)
require(RColorBrewer)
require(GPArotation)
setwd("/Volumes/T1000/Analysis/kclary/Neighborhood_Analysis/Tract")
source("R/func... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rearlist-utils.R
\name{seqJunctionNearTx}
\alias{seqJunctionNearTx}
\title{Evaluates whether sequence junction of a rearrangement is within 5000bp of a transcript}
\usage{
seqJunctionNearTx(rlist, build, maxgap = 5000)
}
\arguments{
\item{rli... | /man/seqJunctionNearTx.Rd | no_license | cancer-genomics/trellis | R | false | true | 917 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rearlist-utils.R
\name{seqJunctionNearTx}
\alias{seqJunctionNearTx}
\title{Evaluates whether sequence junction of a rearrangement is within 5000bp of a transcript}
\usage{
seqJunctionNearTx(rlist, build, maxgap = 5000)
}
\arguments{
\item{rli... |
setwd("C:/Code/RStudio/SEM II/Lab 7")
rm(list=ls())
data<- read.csv("USArrests.csv",row.names=1)
library(dplyr)
data1<- sample_n(data,30)
df<- scale(data1)
set.seed(112)
fit<- kmeans(df,3)
fit$size
fit$withinss
fit$tot.withinss # Within Cluster Sum of Squares (WCSS)
Kmax<- 15
WCSS <- rep(NA,Kmax)
nClust<- list()
... | /RStudio/SEM II/Lab 7/7.R | no_license | r-harini/Code | R | false | false | 908 | r | setwd("C:/Code/RStudio/SEM II/Lab 7")
rm(list=ls())
data<- read.csv("USArrests.csv",row.names=1)
library(dplyr)
data1<- sample_n(data,30)
df<- scale(data1)
set.seed(112)
fit<- kmeans(df,3)
fit$size
fit$withinss
fit$tot.withinss # Within Cluster Sum of Squares (WCSS)
Kmax<- 15
WCSS <- rep(NA,Kmax)
nClust<- list()
... |
func <- function(x) {
return(-x^2*exp(-3*x))source
}
opt <- optimize(func,c(0.,5.))
cat(opt$minimum,opt$objective)
plot(func,0.,5.)
abline(h=opt$objective,col=2)
abline(v=opt$minimum,col=2) | /func.R | no_license | alexsaxberg/chem160module10 | R | false | false | 198 | r | func <- function(x) {
return(-x^2*exp(-3*x))source
}
opt <- optimize(func,c(0.,5.))
cat(opt$minimum,opt$objective)
plot(func,0.,5.)
abline(h=opt$objective,col=2)
abline(v=opt$minimum,col=2) |
library(ape)
testtree <- read.tree("12695_0.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="12695_0_unrooted.txt") | /codeml_files/newick_trees_processed/12695_0/rinput.R | no_license | DaniBoo/cyanobacteria_project | R | false | false | 137 | r | library(ape)
testtree <- read.tree("12695_0.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="12695_0_unrooted.txt") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.