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 |
|---|---|---|---|---|---|---|---|---|---|
# KAGGLE COMPETITION - Titanic: Machine Learning from Disaster
#Reads the training and test data and creates a merge data set
train = read.csv("train.csv", stringsAsFactors=FALSE)
test = read.csv("test.csv", stringsAsFactors=FALSE)
total = merge(train,test,all.x=TRUE, all.y=TRUE, sort= FALSE)
#Loads packages to use
l... | /Titanic Machine Learning from Disaster/titantic_pred.R | no_license | Anithaponnuru/Kaggle | R | false | false | 2,373 | r | # KAGGLE COMPETITION - Titanic: Machine Learning from Disaster
#Reads the training and test data and creates a merge data set
train = read.csv("train.csv", stringsAsFactors=FALSE)
test = read.csv("test.csv", stringsAsFactors=FALSE)
total = merge(train,test,all.x=TRUE, all.y=TRUE, sort= FALSE)
#Loads packages to use
l... |
tennis_csv <- c(
'https://raw.githubusercontent.com/cnsgcu/CS5567/master/hw2/split_ausopen.csv',
'https://raw.githubusercontent.com/cnsgcu/CS5567/master/hw2/split_usopen.csv'
)
tennis_players <- do.call(rbind,lapply(tennis_csv, read.csv))
won_players <- subset(tennis_players, Won == 1)
lost_players <- subset(tenn... | /hw2/feature_selection.R | no_license | cnsgcu/CS5567 | R | false | false | 577 | r | tennis_csv <- c(
'https://raw.githubusercontent.com/cnsgcu/CS5567/master/hw2/split_ausopen.csv',
'https://raw.githubusercontent.com/cnsgcu/CS5567/master/hw2/split_usopen.csv'
)
tennis_players <- do.call(rbind,lapply(tennis_csv, read.csv))
won_players <- subset(tennis_players, Won == 1)
lost_players <- subset(tenn... |
# script example for scraping CNN RSS feed using Rcurl and XML
# courtesy of: izahn https://gist.github.com/izahn/5785265
## This R script contains a simple screen scraping example,
## downloading the text of the articles in the CNN website
## rss feed.
library(RCurl)
library(XML)
options(stringsAsFactors = FALSE)
... | /R/cnnScrape.R | no_license | metamaden/brainfood | R | false | false | 1,772 | r | # script example for scraping CNN RSS feed using Rcurl and XML
# courtesy of: izahn https://gist.github.com/izahn/5785265
## This R script contains a simple screen scraping example,
## downloading the text of the articles in the CNN website
## rss feed.
library(RCurl)
library(XML)
options(stringsAsFactors = FALSE)
... |
##PlanetR search + Orders API for download
planet_order <- function(aoi_dir = "/Users/DataLab/Desktop/Wine Project/SMV2.geojson",
start_year = 2021,
start_doy = 158,
end_year = 2021,
end_doy = 160,
... | /R/planet_order.R | permissive | langdav/planetR | R | false | false | 3,920 | r | ##PlanetR search + Orders API for download
planet_order <- function(aoi_dir = "/Users/DataLab/Desktop/Wine Project/SMV2.geojson",
start_year = 2021,
start_doy = 158,
end_year = 2021,
end_doy = 160,
... |
library(magrittr)
to_key <- . %>% strsplit("") %>%
unlist %>%
sort %>%
paste0(collapse = "")
anagram <- function(subject, candidates) {
lc_subj <- tolower(subject)
key <- to_key(lc_subj)
# closure: determine if a candidate word is an anagram
# of the subject
... | /r/anagram/anagram.R | no_license | glennj/exercism.io | R | false | false | 828 | r | library(magrittr)
to_key <- . %>% strsplit("") %>%
unlist %>%
sort %>%
paste0(collapse = "")
anagram <- function(subject, candidates) {
lc_subj <- tolower(subject)
key <- to_key(lc_subj)
# closure: determine if a candidate word is an anagram
# of the subject
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/deepSNV-package.R
\docType{data}
\name{trueSNVs}
\alias{HIVmix}
\alias{trueSNVs}
\title{Example .bam data and true SNVs.}
\description{
Two .bam alignments as example data sets are downloaded remotely via http. Sequenced were a 1,512 nt fragm... | /man/trueSNVs.Rd | no_license | mg14/deepSNV | R | false | true | 587 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/deepSNV-package.R
\docType{data}
\name{trueSNVs}
\alias{HIVmix}
\alias{trueSNVs}
\title{Example .bam data and true SNVs.}
\description{
Two .bam alignments as example data sets are downloaded remotely via http. Sequenced were a 1,512 nt fragm... |
## 45 degrees in radians
FORTY_FIVE <- base::pi / 4
calc_slopes <- function(x, y, cull = FALSE) {
dx <- abs(diff(x))
dy <- diff(y)
s <- dy / dx
touse <- if (cull) {
abs(s) > 0 & is.finite(s)
} else {
is.finite(s)
}
list(s = s[touse],
dx = dx[touse],
dy = dy[touse],
Rx = diff(... | /R/banking.R | no_license | cran/ggthemes | R | false | false | 4,031 | r | ## 45 degrees in radians
FORTY_FIVE <- base::pi / 4
calc_slopes <- function(x, y, cull = FALSE) {
dx <- abs(diff(x))
dy <- diff(y)
s <- dy / dx
touse <- if (cull) {
abs(s) > 0 & is.finite(s)
} else {
is.finite(s)
}
list(s = s[touse],
dx = dx[touse],
dy = dy[touse],
Rx = diff(... |
model.analyses <- function(stan.model, nsamples = 1500, nweeks, nteams,
data.list, country, season, league, save.fits = TRUE){
# array to store simulated abilities in.
ability.simulations <- array(NA, c(nsamples, nweeks, nteams))
# now we run the models updated per week.
for(week... | /model_estimation.R | no_license | VeenDuco/Football | R | false | false | 2,526 | r | model.analyses <- function(stan.model, nsamples = 1500, nweeks, nteams,
data.list, country, season, league, save.fits = TRUE){
# array to store simulated abilities in.
ability.simulations <- array(NA, c(nsamples, nweeks, nteams))
# now we run the models updated per week.
for(week... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_turbSSC.R
\name{plot_turbSSC}
\alias{plot_turbSSC}
\title{plot_turbSSC. Create plots of sediment vs. turbidity.}
\usage{
plot_turbSSC(
x,
log.SSC = FALSE,
log.turb = FALSE,
siteSelect = NULL,
PDFout = NULL
)
}
\arguments{
\item... | /man/plot_turbSSC.Rd | no_license | cpenn-usgs/sedReview | R | false | true | 1,572 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_turbSSC.R
\name{plot_turbSSC}
\alias{plot_turbSSC}
\title{plot_turbSSC. Create plots of sediment vs. turbidity.}
\usage{
plot_turbSSC(
x,
log.SSC = FALSE,
log.turb = FALSE,
siteSelect = NULL,
PDFout = NULL
)
}
\arguments{
\item... |
#! /usr/bin/Rscript
library(plyr)
library(stringr)
library(tidyr)
library(dplyr)
##############################
## Read in data
##############################
usr <- readLines("users.txt")
sat <- readLines("satisfaction_ratings.txt")
org <- readLines("organizations.txt")
tic <- readLines("tickets.txt")
#############... | /ZEN/mine_zendesk.R | no_license | lromang/DC | R | false | false | 5,699 | r | #! /usr/bin/Rscript
library(plyr)
library(stringr)
library(tidyr)
library(dplyr)
##############################
## Read in data
##############################
usr <- readLines("users.txt")
sat <- readLines("satisfaction_ratings.txt")
org <- readLines("organizations.txt")
tic <- readLines("tickets.txt")
#############... |
################################
##
## Class: ChisqParameter
##
################################
## Access Methods
setMethod("df", "ChisqParameter", function(x, df1, df2, log = FALSE) x@df)
setMethod("ncp", "ChisqParameter", function(object) object@ncp)
## Replace Methods
setReplaceMethod("df", "ChisqParam... | /R/ChisquaredDistribution.R | no_license | cran/distr | R | false | false | 2,575 | r |
################################
##
## Class: ChisqParameter
##
################################
## Access Methods
setMethod("df", "ChisqParameter", function(x, df1, df2, log = FALSE) x@df)
setMethod("ncp", "ChisqParameter", function(object) object@ncp)
## Replace Methods
setReplaceMethod("df", "ChisqParam... |
as.qmatrix <- function(Q){
if (class(Q) != "matrix") Q <- as.matrix(Q)
if (min(Q) < 0) stop("Q contains negative elements.")
sumofq <- apply(Q, MARGIN = 1, sum)
sumofq <- round(sum(sumofq))
if (sumofq != nrow(Q)) stop("Input matrix is not an ancestry matrix: The sum of ancestry coefficients is not equal to on... | /R/as_qmatrix.R | no_license | frichote/LEA | R | false | false | 374 | r | as.qmatrix <- function(Q){
if (class(Q) != "matrix") Q <- as.matrix(Q)
if (min(Q) < 0) stop("Q contains negative elements.")
sumofq <- apply(Q, MARGIN = 1, sum)
sumofq <- round(sum(sumofq))
if (sumofq != nrow(Q)) stop("Input matrix is not an ancestry matrix: The sum of ancestry coefficients is not equal to on... |
#!/share/apps/R-3.2.2_gcc/bin/Rscript
#library(chron)
library(data.table)
library(dplyr)
# library(tidyverse)
data_dir = "/data/hydro/users/Hossein/codling_moth_new/local/processed/"
output_dir = "/data/hydro/users/Hossein/codling_moth_new/local/processed/section_46_Pest/"
name_pref = "combined_CMPOP_rcp"
models = c("... | /codling_moth/code/drivers/pest_window_code/400-14days_minimal/d_sub_4_pest_400F.R | permissive | HNoorazar/Ag | R | false | false | 1,142 | r | #!/share/apps/R-3.2.2_gcc/bin/Rscript
#library(chron)
library(data.table)
library(dplyr)
# library(tidyverse)
data_dir = "/data/hydro/users/Hossein/codling_moth_new/local/processed/"
output_dir = "/data/hydro/users/Hossein/codling_moth_new/local/processed/section_46_Pest/"
name_pref = "combined_CMPOP_rcp"
models = c("... |
#Association Rules Mining
# Loading the arules package
install.packages("arules")
library(arules)
# Loading arulesViz package which has methods of visualizing the rulesets generated by apriori()
install.packages("arulesViz")
library(arulesViz)
# Loading CSV reader
install.packages("readr")
library(readr)
getwd()
#... | /Apriori.R | no_license | jfahmy/DataModeling | R | false | false | 2,674 | r |
#Association Rules Mining
# Loading the arules package
install.packages("arules")
library(arules)
# Loading arulesViz package which has methods of visualizing the rulesets generated by apriori()
install.packages("arulesViz")
library(arulesViz)
# Loading CSV reader
install.packages("readr")
library(readr)
getwd()
#... |
library(tidyr)
library(tidyverse)
library(lubridate)
download_US_Los <- function(start_date, end_date) {
base_url <- "http://co2.aos.wisc.edu/data/cheas/lcreek/flux/current/ameriflux/US-Los_HH_"
start_year <- lubridate::year(start_date)
end_year <- lubridate::year(end_date)
# Reading in the data
data... | /modules/assim.sequential/inst/NEFI/US_Los/download_Los.R | permissive | PecanProject/pecan | R | false | false | 1,178 | r | library(tidyr)
library(tidyverse)
library(lubridate)
download_US_Los <- function(start_date, end_date) {
base_url <- "http://co2.aos.wisc.edu/data/cheas/lcreek/flux/current/ameriflux/US-Los_HH_"
start_year <- lubridate::year(start_date)
end_year <- lubridate::year(end_date)
# Reading in the data
data... |
#second pass of cleaning then combining
library(tidyverse)
library(lubridate)
source(file.path("scripts/helper_functions.R"))
source(file.path("scripts/find_replace.R"))
today <- as.Date("2019-05-09") #date i decided. I am an arbitrary dude.
end_date <- as.Date("2019-05-01")
training_2018 <- file.path("tidy_inputs/c... | /scripts/tidy_all_staff.R | permissive | martin-gleason/training_postgres_r | R | false | false | 7,703 | r | #second pass of cleaning then combining
library(tidyverse)
library(lubridate)
source(file.path("scripts/helper_functions.R"))
source(file.path("scripts/find_replace.R"))
today <- as.Date("2019-05-09") #date i decided. I am an arbitrary dude.
end_date <- as.Date("2019-05-01")
training_2018 <- file.path("tidy_inputs/c... |
#' @title functionjunction
#'
#' @description Return the first X rows and columns
#'
#' @param matrix
#'
#' @return dataframe
#'
#' @examples
#' functionjunction::first_five(mat)
#'
#' @export
first_five <- function(mat, rows = 5, columns = 5) {
# Confirm this is a matrix or dataframe
if (!(is.matrix(mat) | is.da... | /R/first_five.R | permissive | abaghela/functionjunction | R | false | false | 673 | r | #' @title functionjunction
#'
#' @description Return the first X rows and columns
#'
#' @param matrix
#'
#' @return dataframe
#'
#' @examples
#' functionjunction::first_five(mat)
#'
#' @export
first_five <- function(mat, rows = 5, columns = 5) {
# Confirm this is a matrix or dataframe
if (!(is.matrix(mat) | is.da... |
cur_dir = "C:/dev/R/Coursera/Proj2" #working directory where .rds files are located
setwd(cur_dir)
## This first line will likely take a few seconds. Be patient!
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
df.tot.emiss <- aggregate(NEI[, "Emissions"], list(Year = NEI$year), ... | /plot1.R | no_license | rofeld/ExData_Prjoj2 | R | false | false | 526 | r | cur_dir = "C:/dev/R/Coursera/Proj2" #working directory where .rds files are located
setwd(cur_dir)
## This first line will likely take a few seconds. Be patient!
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
df.tot.emiss <- aggregate(NEI[, "Emissions"], list(Year = NEI$year), ... |
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href='https://fonts.googleapis.com/css?family=Architects+Daughter' rel='stylesheet' type='... | /docs/index2.R | no_license | kkdey/aRchaic.site | R | false | false | 44,286 | r | <!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href='https://fonts.googleapis.com/css?family=Architects+Daughter' rel='stylesheet' type='... |
#Compute overlap test and visualize intersections between multiple sets
#Author: Minghui Wang
#minghui.wang@mssm.edu
#
#use barcode (character strings of 0/1) to denote the overlap/non-overlap sets
mkBarcode=function(n){
#n, number of sets
if(n<1) stop('n must be positive integer')
barcode=paste(rep('0',n),collapse='... | /R/miscellanea.R | no_license | mw201608/SuperExactTest | R | false | false | 1,782 | r | #Compute overlap test and visualize intersections between multiple sets
#Author: Minghui Wang
#minghui.wang@mssm.edu
#
#use barcode (character strings of 0/1) to denote the overlap/non-overlap sets
mkBarcode=function(n){
#n, number of sets
if(n<1) stop('n must be positive integer')
barcode=paste(rep('0',n),collapse='... |
library(SixSigma)
### Name: outProfiles
### Title: Get out-of-control profiles
### Aliases: outProfiles
### ** Examples
wby.phase1 <- ss.data.wby[, 1:35]
wb.limits <- climProfiles(profiles = wby.phase1,
x = ss.data.wbx,
smoothprof = TRUE,
smoothlim = TRUE)
wby.phase2 <- ss.data.wby[, 36:50]
wb.out.phase... | /data/genthat_extracted_code/SixSigma/examples/outProfiles.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 567 | r | library(SixSigma)
### Name: outProfiles
### Title: Get out-of-control profiles
### Aliases: outProfiles
### ** Examples
wby.phase1 <- ss.data.wby[, 1:35]
wb.limits <- climProfiles(profiles = wby.phase1,
x = ss.data.wbx,
smoothprof = TRUE,
smoothlim = TRUE)
wby.phase2 <- ss.data.wby[, 36:50]
wb.out.phase... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/reading.R
\name{read_lila_einzel}
\alias{read_lila_einzel}
\title{Lesen von Dateien im LILA-EINZELDATEI-Format}
\usage{
read_lila_einzel(file, filename_metainfo = FALSE, locale = "default",
n_max = Inf)
}
\arguments{
\item{file}{Pfad der zu... | /man/read_lila_einzel.Rd | no_license | matsei/lilatools | R | false | true | 1,794 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/reading.R
\name{read_lila_einzel}
\alias{read_lila_einzel}
\title{Lesen von Dateien im LILA-EINZELDATEI-Format}
\usage{
read_lila_einzel(file, filename_metainfo = FALSE, locale = "default",
n_max = Inf)
}
\arguments{
\item{file}{Pfad der zu... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/calendar-options.R
\name{cal_timezone}
\alias{cal_timezone}
\title{Calendar Timezone}
\usage{
cal_timezone(
cal,
timezoneName = NULL,
displayLabel = NULL,
tooltip = NULL,
extra_zones = NULL,
offsetCalculator = NULL
)
}
\arguments{... | /man/cal_timezone.Rd | permissive | jeanantoinedasilva/toastui | R | false | true | 1,780 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/calendar-options.R
\name{cal_timezone}
\alias{cal_timezone}
\title{Calendar Timezone}
\usage{
cal_timezone(
cal,
timezoneName = NULL,
displayLabel = NULL,
tooltip = NULL,
extra_zones = NULL,
offsetCalculator = NULL
)
}
\arguments{... |
context("mlr_learners_regr_featureless")
test_that("autotest", {
learner = mlr_learners$get("classif.featureless")
result = run_autotest(learner, exclude = "sanity")
expect_true(result, info = result$error)
})
test_that("Simple training/predict", {
task = mlr_tasks$get("iris")
learner = mlr_learners$get("cl... | /tests/testthat/test_mlr_learners_classif_featureless.R | permissive | longhua8800w/mlr3 | R | false | false | 1,126 | r | context("mlr_learners_regr_featureless")
test_that("autotest", {
learner = mlr_learners$get("classif.featureless")
result = run_autotest(learner, exclude = "sanity")
expect_true(result, info = result$error)
})
test_that("Simple training/predict", {
task = mlr_tasks$get("iris")
learner = mlr_learners$get("cl... |
#' Power distribution maximum likelihood estimation
#'
#' The maximum likelihood estimate of \code{alpha} is the maximum of \code{x} +
#' \code{epsilon} (see the details) and the maximum likelihood estimate of
#' \code{beta} is \code{1/(log(alpha)-mean(log(x)))}.
#'
#' For the density function of the power dist... | /R/mlpower.R | permissive | vbaliga/univariateML | R | false | false | 2,613 | r | #' Power distribution maximum likelihood estimation
#'
#' The maximum likelihood estimate of \code{alpha} is the maximum of \code{x} +
#' \code{epsilon} (see the details) and the maximum likelihood estimate of
#' \code{beta} is \code{1/(log(alpha)-mean(log(x)))}.
#'
#' For the density function of the power dist... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/probPlot.R
\name{probPlot.lcens}
\alias{probPlot.lcens}
\alias{probPlot.qw}
\alias{probPlot.qw}
\title{Probability Plot}
\usage{
\method{probPlot}{lcens}(x, truncate, FLIP = FALSE, distribution = "normal",
alpha = 0.4, Plot = list(name = "U... | /man/probPlot.lcens.Rd | permissive | Zhenglei-BCS/smwrQW | R | false | true | 3,226 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/probPlot.R
\name{probPlot.lcens}
\alias{probPlot.lcens}
\alias{probPlot.qw}
\alias{probPlot.qw}
\title{Probability Plot}
\usage{
\method{probPlot}{lcens}(x, truncate, FLIP = FALSE, distribution = "normal",
alpha = 0.4, Plot = list(name = "U... |
### Created by Mao Peng (m.peng@cbs.knaw.nl)on 12-01-2016
##pValues <- function (x) {return(tryCatch(t.test(x[exp],x[cont],var.equal=TRUE,paired=FALSE,conf.level=0.95)$p.value, error=function(e) NULL))}
TTest <- function (aData,numC,numE){
cont=1:(numC);
exp=((1+numC):(numC+numE)); #### this should be careful... | /ttest.r | no_license | maopeng2018/scripts | R | false | false | 1,412 | r | ### Created by Mao Peng (m.peng@cbs.knaw.nl)on 12-01-2016
##pValues <- function (x) {return(tryCatch(t.test(x[exp],x[cont],var.equal=TRUE,paired=FALSE,conf.level=0.95)$p.value, error=function(e) NULL))}
TTest <- function (aData,numC,numE){
cont=1:(numC);
exp=((1+numC):(numC+numE)); #### this should be careful... |
#' @title Draw of y when reject tree movement for bads version
#' @return Draws of yhat and ypred
#' @export
yhat.draw2.bads=function(btree_obj,x.test,Rj,tau,sigma2,rotate){
t_data=btree_obj$t_data
t_R<-lapply(t_data,function(x) Rj[x])
mean.draw<-lapply(t_R,function(x){
pmean=length(x)*mean(x)/sigma2/(leng... | /R/yhat_draw2_bads.R | no_license | DongyueXie/bCART | R | false | false | 950 | r | #' @title Draw of y when reject tree movement for bads version
#' @return Draws of yhat and ypred
#' @export
yhat.draw2.bads=function(btree_obj,x.test,Rj,tau,sigma2,rotate){
t_data=btree_obj$t_data
t_R<-lapply(t_data,function(x) Rj[x])
mean.draw<-lapply(t_R,function(x){
pmean=length(x)*mean(x)/sigma2/(leng... |
#' Convert to Seconds
#'
#' This function converts time in the format exported by the plate reader (H:MM:SS) to seconds
#' @param time a value or vector of strings for time points in the format "H:MM:SS"
#' @export
#' @examples
#' plate_reader_seconds(enzyme_assay.time)
plate_reader_seconds <- function(time){
... | /EnzymeAssay/R/plate_reader_seconds.R | no_license | alisandra/enzyme_assay | R | false | false | 684 | r | #' Convert to Seconds
#'
#' This function converts time in the format exported by the plate reader (H:MM:SS) to seconds
#' @param time a value or vector of strings for time points in the format "H:MM:SS"
#' @export
#' @examples
#' plate_reader_seconds(enzyme_assay.time)
plate_reader_seconds <- function(time){
... |
library(tidyverse)
library(dplyr)
library(readxl)
library(reshape2)
library(texreg)
library(lme4)
library(broom)
library(zoo)
library(htmlTable)
Full_Equity_Sample <- read_excel("Full Equity Sample.xlsx")
############################################################################
####################################... | /MBF Practitioner Seminar - Fidelity Group 9.R | no_license | TobiasWiest/MBF_Fidelity_Practitioner09 | R | false | false | 88,901 | r | library(tidyverse)
library(dplyr)
library(readxl)
library(reshape2)
library(texreg)
library(lme4)
library(broom)
library(zoo)
library(htmlTable)
Full_Equity_Sample <- read_excel("Full Equity Sample.xlsx")
############################################################################
####################################... |
hello2 <- function(fname, lname) {
cat(paste("Hello",fname,lname,"!"))
}
| /R/hello2.R | no_license | sharp18/rlab-package1 | R | false | false | 75 | r | hello2 <- function(fname, lname) {
cat(paste("Hello",fname,lname,"!"))
}
|
library( plyr )
library( data.table )
library( reshape2 )
library( stringr )
## define some constants
## We assume that the data was obtained from http://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+Using+Smartphones
## (or in our case, a coursera copy) and conforms to their organizational format
srcURL... | /Getting and Cleaning Data/run_analysis.R | no_license | RobinSmithCA/datasciencecoursera | R | false | false | 8,269 | r | library( plyr )
library( data.table )
library( reshape2 )
library( stringr )
## define some constants
## We assume that the data was obtained from http://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+Using+Smartphones
## (or in our case, a coursera copy) and conforms to their organizational format
srcURL... |
#setwd(system.file("extdata", package = "farsAJS", mustWork = TRUE))
#' Read FARS file
#'
#' Function that reads a csv file and converts it into a \code{tbl_df} table.
#'
#' @param filename A character string giving the name of the file to read/path to that file
#'
#' @return This function returns the selected file as... | /R/fars_functions.R | no_license | ajsarradin/farsAJS | R | false | false | 5,710 | r | #setwd(system.file("extdata", package = "farsAJS", mustWork = TRUE))
#' Read FARS file
#'
#' Function that reads a csv file and converts it into a \code{tbl_df} table.
#'
#' @param filename A character string giving the name of the file to read/path to that file
#'
#' @return This function returns the selected file as... |
rm(list=ls())
require(mapproj)
require(ggmap)
require(DeducerSpatial)
require(UScensus2010)
require("rgdal") # requires sp, will use proj.4 if installed
require("maptools")
require("ggplot2")
require("plyr")
require(acs)
require(plyr)
require(Hmisc)
require(doParallel)
setwd('//Users/TScott/Google Drive/duckabush')
so... | /add_county_data.R | no_license | tylerandrewscott/duckabush | R | false | false | 4,579 | r | rm(list=ls())
require(mapproj)
require(ggmap)
require(DeducerSpatial)
require(UScensus2010)
require("rgdal") # requires sp, will use proj.4 if installed
require("maptools")
require("ggplot2")
require("plyr")
require(acs)
require(plyr)
require(Hmisc)
require(doParallel)
setwd('//Users/TScott/Google Drive/duckabush')
so... |
args <- commandArgs(trailingOnly = TRUE)
cbind.fill <- function(...){
nm <- list(...)
nm <- lapply(nm, as.matrix)
n <- max(sapply(nm, nrow))
do.call(cbind, lapply(nm, function (x)
rbind(x, matrix(, n-nrow(x), ncol(x)))))
}
option = args[1]
args = args[2:length(args)]
count = 0
reading_files = ... | /src/cp1_gazebo/instructions/localization/graph_compare_options.R | no_license | miguelvelezmj25/turtlebot-monitoring-infrastructure | R | false | false | 2,265 | r | args <- commandArgs(trailingOnly = TRUE)
cbind.fill <- function(...){
nm <- list(...)
nm <- lapply(nm, as.matrix)
n <- max(sapply(nm, nrow))
do.call(cbind, lapply(nm, function (x)
rbind(x, matrix(, n-nrow(x), ncol(x)))))
}
option = args[1]
args = args[2:length(args)]
count = 0
reading_files = ... |
# Coursera - Johns Hopkinds Data Science #4, Exploratory Data Analysis
# Course Project - Plot #3
#
# 3. Of the four types of sources indicated by the type (point, nonpoint,
# onroad, nonroad) variable, which of these four sources have seen decreases
# in emissions from 1999–2008 for Baltimore City? Which have se... | /plot3.R | no_license | pbnelson/jhds04_repo | R | false | false | 1,672 | r | # Coursera - Johns Hopkinds Data Science #4, Exploratory Data Analysis
# Course Project - Plot #3
#
# 3. Of the four types of sources indicated by the type (point, nonpoint,
# onroad, nonroad) variable, which of these four sources have seen decreases
# in emissions from 1999–2008 for Baltimore City? Which have se... |
# leitura do arquivo
all_data <- read.csv("//home//nathana//AM//data1.csv")
# numero de colunas total
number_column <- ncol(all_data)
# numero de linhas total
number_row <- nrow(all_data)
# selecionando ultima coluna que contem classe
class <- all_data[number_column]
# dados originais sem ultima coluna
data_origin ... | /R Testes/exercicio1.r | no_license | nathanafacion/Aprendizado | R | false | false | 4,362 | r | # leitura do arquivo
all_data <- read.csv("//home//nathana//AM//data1.csv")
# numero de colunas total
number_column <- ncol(all_data)
# numero de linhas total
number_row <- nrow(all_data)
# selecionando ultima coluna que contem classe
class <- all_data[number_column]
# dados originais sem ultima coluna
data_origin ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/distmet.r
\name{distplot}
\alias{distplot}
\title{Plotting the distribution of the distance measure}
\usage{
distplot(dat, m = 20)
}
\arguments{
\item{dat}{output from \code{\link{distmet}}}
\item{m}{the number of plots in the lineup; m = 20... | /man/distplot.Rd | no_license | dicook/nullabor | R | false | true | 832 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/distmet.r
\name{distplot}
\alias{distplot}
\title{Plotting the distribution of the distance measure}
\usage{
distplot(dat, m = 20)
}
\arguments{
\item{dat}{output from \code{\link{distmet}}}
\item{m}{the number of plots in the lineup; m = 20... |
#' Time to Event Plot
#'
#' Generate a flexible KM plot with a risk table
#'
#' @param data a dataframe containing the input data to plot (dataframe)
#' @param group_by a column name containing a subgrouping factor to split the plot by (string)
#' @param param the time-to-event parameter to plot (e.g. "OS") (string)
#'... | /R/tteplot.R | no_license | melren/effiplot | R | false | false | 4,199 | r | #' Time to Event Plot
#'
#' Generate a flexible KM plot with a risk table
#'
#' @param data a dataframe containing the input data to plot (dataframe)
#' @param group_by a column name containing a subgrouping factor to split the plot by (string)
#' @param param the time-to-event parameter to plot (e.g. "OS") (string)
#'... |
# Install packages
install.packages("pwr")
library(pwr)
# Run power analysis - leave only ONE empty
# u = number of predictors (df)
# v = number of participants (df)
# f2 = effect size (0.02 is small, 0.15 is medium, 0.35 is large)
# sig.level = alpha, usually 0.05
# power = desired power, usually 0.8
power ... | /power_analysis.R | no_license | arishmr/stradl_infl-reward | R | false | false | 442 | r | # Install packages
install.packages("pwr")
library(pwr)
# Run power analysis - leave only ONE empty
# u = number of predictors (df)
# v = number of participants (df)
# f2 = effect size (0.02 is small, 0.15 is medium, 0.35 is large)
# sig.level = alpha, usually 0.05
# power = desired power, usually 0.8
power ... |
# 使用package
suppressMessages(library(readxl))
suppressMessages(library(dplyr))
suppressMessages(library(tidyverse))
suppressMessages(library(data.table))
library(curl)
file=curl("https://raw.githubusercontent.com/luka3117/toy/master/csv/iris.csv")
read.csv(file)
| /R/cur_example.r | no_license | luka3117/toy | R | false | false | 268 | r | # 使用package
suppressMessages(library(readxl))
suppressMessages(library(dplyr))
suppressMessages(library(tidyverse))
suppressMessages(library(data.table))
library(curl)
file=curl("https://raw.githubusercontent.com/luka3117/toy/master/csv/iris.csv")
read.csv(file)
|
################################################################################
# Same as in bigstatsr
CutBySize <- bigstatsr:::CutBySize
seq2 <- bigstatsr:::seq2
as_vec <- bigstatsr:::as_vec
################################################################################
# global variable definitions due t... | /R/utils.R | no_license | Alice-MacQueen/bigsnpr | R | false | false | 2,369 | r | ################################################################################
# Same as in bigstatsr
CutBySize <- bigstatsr:::CutBySize
seq2 <- bigstatsr:::seq2
as_vec <- bigstatsr:::as_vec
################################################################################
# global variable definitions due t... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils-pipe.R
\name{\%>\%}
\alias{\%>\%}
\alias{\%<>\%}
\alias{\%$\%}
\alias{\%T>\%}
\title{Pipe operator}
\usage{
lhs \%>\% rhs
}
\description{
See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details.
}
\keyword{internal}
| /man/pipe.Rd | permissive | MyKo101/mpipe | R | false | true | 305 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils-pipe.R
\name{\%>\%}
\alias{\%>\%}
\alias{\%<>\%}
\alias{\%$\%}
\alias{\%T>\%}
\title{Pipe operator}
\usage{
lhs \%>\% rhs
}
\description{
See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details.
}
\keyword{internal}
|
9f4a117339be72691b1c9c29173c916d tlc02-uniform-depth-142.qdimacs 32748 86364 | /code/dcnf-ankit-optimized/Results/QBFLIB-2018/E1+A1/Database/Miller-Marin/trafficlight-controller/tlc02-uniform-depth-142/tlc02-uniform-depth-142.R | no_license | arey0pushpa/dcnf-autarky | R | false | false | 76 | r | 9f4a117339be72691b1c9c29173c916d tlc02-uniform-depth-142.qdimacs 32748 86364 |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functions.R
\name{parseInteractionName}
\alias{parseInteractionName}
\title{Helper function used to build a correct interactionName based on the chosen
columns}
\usage{
parseInteractionName(interactionName)
}
\arguments{
\item{interactionNam... | /man/parseInteractionName.Rd | permissive | saracg-forks/microbiomeExplorer | R | false | true | 546 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functions.R
\name{parseInteractionName}
\alias{parseInteractionName}
\title{Helper function used to build a correct interactionName based on the chosen
columns}
\usage{
parseInteractionName(interactionName)
}
\arguments{
\item{interactionNam... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dplyr.R
\name{right_join.decorated}
\alias{right_join.decorated}
\title{Right_join Decorated}
\usage{
\method{right_join}{decorated}(x, y, by = NULL, copy = FALSE, suffix = c(".x", ".y"), ...)
}
\arguments{
\item{x}{A pair of data frames, dat... | /man/right_join.decorated.Rd | no_license | jimsforks/yamlet | R | false | true | 2,626 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dplyr.R
\name{right_join.decorated}
\alias{right_join.decorated}
\title{Right_join Decorated}
\usage{
\method{right_join}{decorated}(x, y, by = NULL, copy = FALSE, suffix = c(".x", ".y"), ...)
}
\arguments{
\item{x}{A pair of data frames, dat... |
# Robustness Helpers:
rob.union <- function(test_sol)
{
ts <- ""
for (i in 1:length(test_sol)){
if (is.null(test_sol[[i]]$i.sol)){
ts <- c(ts,test_sol[[i]]$solution[[1]])
}
else{
ts <- c(ts,test_sol[[i]]$i.sol$C1P1$solution[[1]])
}
}
ts <- paste(ts[2:length(ts)], collapse = "+")
... | /R/helper_rob.R | no_license | nenaoana/SetMethods | R | false | false | 9,070 | r | # Robustness Helpers:
rob.union <- function(test_sol)
{
ts <- ""
for (i in 1:length(test_sol)){
if (is.null(test_sol[[i]]$i.sol)){
ts <- c(ts,test_sol[[i]]$solution[[1]])
}
else{
ts <- c(ts,test_sol[[i]]$i.sol$C1P1$solution[[1]])
}
}
ts <- paste(ts[2:length(ts)], collapse = "+")
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/testing_generate_evaluation_questions.R
\name{generate_evaluation_questions}
\alias{generate_evaluation_questions}
\title{Generate the entities needed for the evaluation question, responses, and post button}
\usage{
generate_evaluation_questi... | /man/generate_evaluation_questions.Rd | permissive | Rukshani/r2vr | R | false | true | 1,039 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/testing_generate_evaluation_questions.R
\name{generate_evaluation_questions}
\alias{generate_evaluation_questions}
\title{Generate the entities needed for the evaluation question, responses, and post button}
\usage{
generate_evaluation_questi... |
# User Interface
# Data Downloader App
# Last edited 2-13-2016
# Manny
require(shinydashboard)
shinyUI(dashboardPage(
dashboardHeader(disable = TRUE),
dashboardSidebar(disable = TRUE),
dashboardBody(
tags$head(tags$style(".container-fluid {font-size: 13px; color: #2B547E; background-color: #ECF0F5;... | /datadl/ui.R | no_license | pbulsink/Apps | R | false | false | 2,670 | r | # User Interface
# Data Downloader App
# Last edited 2-13-2016
# Manny
require(shinydashboard)
shinyUI(dashboardPage(
dashboardHeader(disable = TRUE),
dashboardSidebar(disable = TRUE),
dashboardBody(
tags$head(tags$style(".container-fluid {font-size: 13px; color: #2B547E; background-color: #ECF0F5;... |
fortify.ts <- function(x){
time <- as.numeric(time(x))
if(is.matrix(x)){
df <- as.data.frame(x)
}
else {
x <- as.numeric(x)
df <- as.data.frame(x)
}
df$time <- time
return(df)
}
| /fortify-ts.r | no_license | cyrussafaie/TimeSeries | R | false | false | 216 | r | fortify.ts <- function(x){
time <- as.numeric(time(x))
if(is.matrix(x)){
df <- as.data.frame(x)
}
else {
x <- as.numeric(x)
df <- as.data.frame(x)
}
df$time <- time
return(df)
}
|
#-----------------
# Load libraries
#-----------------
library(dplyr)
library(tidyr)
library(stringr)
library(ggplot2)
library(scales)
library(grid)
library(Cairo)
library(pander)
#----------------
# Set variables
#----------------
# Denominators
num.country.responses <- length(na.omit(responses.countries$work.countr... | /R/summary_functions.R | no_license | tectronics/Human-trafficking-NGO-survey | R | false | false | 6,372 | r | #-----------------
# Load libraries
#-----------------
library(dplyr)
library(tidyr)
library(stringr)
library(ggplot2)
library(scales)
library(grid)
library(Cairo)
library(pander)
#----------------
# Set variables
#----------------
# Denominators
num.country.responses <- length(na.omit(responses.countries$work.countr... |
### LOOCV for different models----
loocv.lm1 <- function(md1) {
return(mean((residuals(md1)/(1-hatvalues(md1)))^2))
}
loocv.lm2 <- function(res, hat) {
return(mean((res/(1-hat))^2))
}
loocv.lm1(fit_poi)
loocv.lm1(fit_gamma_log)
loocv.lm1(lm_normal)
loocv.lm2(original_y-reduced_data$cnt, exp(lm_log... | /ModelSelection.R | no_license | zychen-Wilson/SS504_bike_sharing | R | false | false | 3,138 | r |
### LOOCV for different models----
loocv.lm1 <- function(md1) {
return(mean((residuals(md1)/(1-hatvalues(md1)))^2))
}
loocv.lm2 <- function(res, hat) {
return(mean((res/(1-hat))^2))
}
loocv.lm1(fit_poi)
loocv.lm1(fit_gamma_log)
loocv.lm1(lm_normal)
loocv.lm2(original_y-reduced_data$cnt, exp(lm_log... |
library(BETS)
### Name: bcbExpectM
### Title: bcbExpectM
### Aliases: bcbExpectM
### ** Examples
# bcbExpectM()
| /data/genthat_extracted_code/BETS/examples/bcbExpectM.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 123 | r | library(BETS)
### Name: bcbExpectM
### Title: bcbExpectM
### Aliases: bcbExpectM
### ** Examples
# bcbExpectM()
|
# Polynomial Regression
#Data Preprocessing
#Importing Dataset
dataset = read.csv("Position_Salaries.csv")
dataset = dataset[2:3]
#Missing Data
# dataset$Age = ifelse(is.na(dataset$Age),
# ave(dataset$Age, FUN = function(x) mean(x, na.rm = TRUE)),
# dataset$Age)
#
# data... | /Part2-Regression/Section 8 - Polynomial Regression/R/polynomial_regression2.R | no_license | GaneshMaurya/Machine-Learning-using-Python-and-R | R | false | false | 2,370 | r | # Polynomial Regression
#Data Preprocessing
#Importing Dataset
dataset = read.csv("Position_Salaries.csv")
dataset = dataset[2:3]
#Missing Data
# dataset$Age = ifelse(is.na(dataset$Age),
# ave(dataset$Age, FUN = function(x) mean(x, na.rm = TRUE)),
# dataset$Age)
#
# data... |
library(BSDA)
### Name: Backtoback
### Title: Illustrates inferences based on pooled t-test versus Wilcoxon
### rank sum test
### Aliases: Backtoback
### Keywords: datasets
### ** Examples
wilcox.test(score ~ group, data = Backtoback)
t.test(score ~ group, data = Backtoback)
| /data/genthat_extracted_code/BSDA/examples/Backtoback.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 287 | r | library(BSDA)
### Name: Backtoback
### Title: Illustrates inferences based on pooled t-test versus Wilcoxon
### rank sum test
### Aliases: Backtoback
### Keywords: datasets
### ** Examples
wilcox.test(score ~ group, data = Backtoback)
t.test(score ~ group, data = Backtoback)
|
patch_variance <- function(model="Beverton-Holt",alpha_heterogeneity=F,cap_heterogeneity=F,Npatches=16,alpha,alpha_p,metaK,k_p,magnitude_of_decline)
{
if(alpha_heterogeneity & model=="Ricker")
{
alpha_p <- rtruncnorm(N=Npatches,mean=alpha,sd=alpha/3,a=1.01,b=alpha*2+1.01)
beta_p <- -log(alpha_p)/k_p
}
... | /Functions/patch_variance.R | no_license | klwilson23/SpatialWatershed | R | false | false | 3,938 | r | patch_variance <- function(model="Beverton-Holt",alpha_heterogeneity=F,cap_heterogeneity=F,Npatches=16,alpha,alpha_p,metaK,k_p,magnitude_of_decline)
{
if(alpha_heterogeneity & model=="Ricker")
{
alpha_p <- rtruncnorm(N=Npatches,mean=alpha,sd=alpha/3,a=1.01,b=alpha*2+1.01)
beta_p <- -log(alpha_p)/k_p
}
... |
require(pacman)
p_load(sf, tidyverse, hexbin, geogrid, here)
"puntos_aleatorios/03_out"
colo <- st_read(here("puntos_aleatorios", "01_inp",
"muni_2018gw", "muni_2018gw.shp" ),
stringsAsFactors = FALSE, quiet = TRUE) %>%
st_transform(4326)
colo %>% pull(NOM_ENT)
dots <- fu... | /puntos_aleatorios/02_script/dots_function.R | no_license | hectorchavezgaro44/mapeo | R | false | false | 737 | r | require(pacman)
p_load(sf, tidyverse, hexbin, geogrid, here)
"puntos_aleatorios/03_out"
colo <- st_read(here("puntos_aleatorios", "01_inp",
"muni_2018gw", "muni_2018gw.shp" ),
stringsAsFactors = FALSE, quiet = TRUE) %>%
st_transform(4326)
colo %>% pull(NOM_ENT)
dots <- fu... |
# Search for matches between BBTI and Parsed Imprints
# Begin by loading the bbti.RData
# load("~/Desktop/Parsing the Imprint/estc_dates.rda")
# load("~/Desktop/Parsing the Imprint/estc_imps.rda")
# source("imprint cleanup script.R")
# source("Trim BBTI.R")
people = tcpPersons[12376:15582,]
range = 1:length(imps)
#s... | /bbti imprint matcher SUPER SCRIPT_estc.R | no_license | numskull/LSA_SNA | R | false | false | 5,032 | r | # Search for matches between BBTI and Parsed Imprints
# Begin by loading the bbti.RData
# load("~/Desktop/Parsing the Imprint/estc_dates.rda")
# load("~/Desktop/Parsing the Imprint/estc_imps.rda")
# source("imprint cleanup script.R")
# source("Trim BBTI.R")
people = tcpPersons[12376:15582,]
range = 1:length(imps)
#s... |
#
# Overfitter configuration for Conditional Inference Random Forest
#
# packages to use during learning (loaded into each cluster node)
packages=c('pROC', 'caret')
library('foreach')
library('doParallel')
library('parallel')
source('../functions.r')
for (pkg in packages) {
library(pkg, character.only=T)
}
# name ... | /Code/overfitter/configurations/conf_cforest.r | no_license | KnightofDawn/Kaggle-BCI-Challenge | R | false | false | 1,105 | r | #
# Overfitter configuration for Conditional Inference Random Forest
#
# packages to use during learning (loaded into each cluster node)
packages=c('pROC', 'caret')
library('foreach')
library('doParallel')
library('parallel')
source('../functions.r')
for (pkg in packages) {
library(pkg, character.only=T)
}
# name ... |
# Written by Kevin Surya.
# This code is part of the coronavirus-evolution project.
library(ape)
library(Cairo)
library(ggExtra)
library(ggplot2)
library(ggthemes)
# Read tree ----
tree <- read.nexus(file = "sarbecovirus_tree_mol_v2_59.nex")
# Define variance-covariance matrix ----
vcv <- vcv(phy = tree)
# Write ... | /surya_etal_front_virol_data_s2_sarbecovirus/sarbecovirus_code_r_run_diagnostics.r | no_license | ChrisOrgan/Covid_Analysis | R | false | false | 1,360 | r | # Written by Kevin Surya.
# This code is part of the coronavirus-evolution project.
library(ape)
library(Cairo)
library(ggExtra)
library(ggplot2)
library(ggthemes)
# Read tree ----
tree <- read.nexus(file = "sarbecovirus_tree_mol_v2_59.nex")
# Define variance-covariance matrix ----
vcv <- vcv(phy = tree)
# Write ... |
# Copyright 2001-10 by Roger Bivand, Markus Reder and Werner Mueller, 2015 Martin Gubri
#
nb2mat <- function(neighbours, glist=NULL, style="W", zero.policy=NULL)
{
if (is.null(zero.policy))
zero.policy <- get("zeroPolicy", envir = .spdepOptions)
stopifnot(is.logical(zero.policy))
if(!inhe... | /R/nb2mat.R | no_license | jeffcsauer/spdep | R | false | false | 6,651 | r | # Copyright 2001-10 by Roger Bivand, Markus Reder and Werner Mueller, 2015 Martin Gubri
#
nb2mat <- function(neighbours, glist=NULL, style="W", zero.policy=NULL)
{
if (is.null(zero.policy))
zero.policy <- get("zeroPolicy", envir = .spdepOptions)
stopifnot(is.logical(zero.policy))
if(!inhe... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tidysurv-package.R
\name{tidysurv.formula}
\alias{tidysurv.formula}
\title{Make a tidy survfit object from a formula}
\usage{
\method{tidysurv}{formula}(object, data, na.action = na.exclude,
time_period = NULL, max_num_levels = 200, ...)
}
... | /man/tidysurv.formula.Rd | no_license | jwdink/tidysurv | R | false | true | 1,308 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tidysurv-package.R
\name{tidysurv.formula}
\alias{tidysurv.formula}
\title{Make a tidy survfit object from a formula}
\usage{
\method{tidysurv}{formula}(object, data, na.action = na.exclude,
time_period = NULL, max_num_levels = 200, ...)
}
... |
library(finalfit)
### Name: hr_plot
### Title: Produce a hazard ratio table and plot
### Aliases: hr_plot
### ** Examples
# HR plot
library(finalfit)
library(dplyr)
library(ggplot2)
data(colon_s)
explanatory = c("age.factor", "sex.factor", "obstruct.factor", "perfor.factor")
dependent = "Surv(time, status)"
colon_... | /data/genthat_extracted_code/finalfit/examples/hr_plot.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 597 | r | library(finalfit)
### Name: hr_plot
### Title: Produce a hazard ratio table and plot
### Aliases: hr_plot
### ** Examples
# HR plot
library(finalfit)
library(dplyr)
library(ggplot2)
data(colon_s)
explanatory = c("age.factor", "sex.factor", "obstruct.factor", "perfor.factor")
dependent = "Surv(time, status)"
colon_... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/crossa.R
\name{crossa}
\alias{crossa}
\title{Cross Tabs with Shading Algorithms}
\usage{
crossa(data1a, lab1, data2a, lab2, cantgrade, title1 = "", footer = "",
title2 = "", ext.labels = NULL, cex = 1, PLOT = TRUE, mar = c(0, 0,
0, 0))
}
... | /man/crossa.Rd | no_license | rmtrane/QualityControl | R | false | true | 1,972 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/crossa.R
\name{crossa}
\alias{crossa}
\title{Cross Tabs with Shading Algorithms}
\usage{
crossa(data1a, lab1, data2a, lab2, cantgrade, title1 = "", footer = "",
title2 = "", ext.labels = NULL, cex = 1, PLOT = TRUE, mar = c(0, 0,
0, 0))
}
... |
# make_qc_dt.R
# Make nice data.table of QC metrics
#' Checks specified QC metrics and makes data.table for input to
#' \code{calc_pairwise_mmds}.
#'
#' Takes a \code{data.frame} of raw QC metrics, and makes a nice neat
#' \code{data.table} output that can be used in \pkg{SampleQC}. For example,
#' users with a \p... | /R/make_qc_dt.R | permissive | Yixf-Self/SampleQC | R | false | false | 15,577 | r | # make_qc_dt.R
# Make nice data.table of QC metrics
#' Checks specified QC metrics and makes data.table for input to
#' \code{calc_pairwise_mmds}.
#'
#' Takes a \code{data.frame} of raw QC metrics, and makes a nice neat
#' \code{data.table} output that can be used in \pkg{SampleQC}. For example,
#' users with a \p... |
# copied from: /home/yeung/projects/posttranscriptional_regulation/functions/CosSineFunctions.R
DelR.Dela <- function(a, b, n=4){
# R = sqrt(a^2 + b^2)
# derivative with respect to a
# n is constant factor to scale amplitude.
# Mod of Fourier transform gives 1/2 mean to peak. Set n=2 for mean to peak. n=4 for ... | /R/CosSineFunctions.R | no_license | jakeyeung/Circadian4Cseq | R | false | false | 2,615 | r | # copied from: /home/yeung/projects/posttranscriptional_regulation/functions/CosSineFunctions.R
DelR.Dela <- function(a, b, n=4){
# R = sqrt(a^2 + b^2)
# derivative with respect to a
# n is constant factor to scale amplitude.
# Mod of Fourier transform gives 1/2 mean to peak. Set n=2 for mean to peak. n=4 for ... |
## Class to describe an elastic net model
ADMM_Enet = setRefClass("ADMM_Enet",
fields = list(alpha = "numeric"),
contains = "ADMM_Lasso"
)
## Class to store fitting results of elastic net model
ADMM_Enet_fit = setRefClass("ADMM_Enet_fit", contains = "ADMM_Lasso_fit")
... | /R/40_admm_enet.R | no_license | RandomFeng/ADMM | R | false | false | 8,301 | r | ## Class to describe an elastic net model
ADMM_Enet = setRefClass("ADMM_Enet",
fields = list(alpha = "numeric"),
contains = "ADMM_Lasso"
)
## Class to store fitting results of elastic net model
ADMM_Enet_fit = setRefClass("ADMM_Enet_fit", contains = "ADMM_Lasso_fit")
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/project.R
\name{project}
\alias{project}
\title{Projection to submodels of selected sizes}
\usage{
project(object, nv = NULL, vind = NULL, ns = NULL, nc = NULL,
intercept = NULL, seed = NULL, return_fit = TRUE, ...)
}
\arguments{
\item{obje... | /man/project.Rd | no_license | bgoodri/glmproj | R | false | true | 1,628 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/project.R
\name{project}
\alias{project}
\title{Projection to submodels of selected sizes}
\usage{
project(object, nv = NULL, vind = NULL, ns = NULL, nc = NULL,
intercept = NULL, seed = NULL, return_fit = TRUE, ...)
}
\arguments{
\item{obje... |
# K-Means Clustering
# Importing the dataset
dataset_drugi = read.csv('output.csv')
dataset = read.csv('Mall_Customers.csv')
dataset = dataset[4:5]
# Splitting the dataset into the Training set and Test set
# install.packages('caTools')
# library(caTools)
# set.seed(123)
# split = sample.split(dataset$Depe... | /R-kodovi/ant_mall.R | no_license | pimaja/Ant-Colony-Optimization-Clustering | R | false | false | 1,312 | r | # K-Means Clustering
# Importing the dataset
dataset_drugi = read.csv('output.csv')
dataset = read.csv('Mall_Customers.csv')
dataset = dataset[4:5]
# Splitting the dataset into the Training set and Test set
# install.packages('caTools')
# library(caTools)
# set.seed(123)
# split = sample.split(dataset$Depe... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gstat.randtest.R
\name{gstat.randtest}
\alias{gstat.randtest}
\title{Goudet's G-statistic Monte Carlo test for genind object}
\usage{
gstat.randtest(x, pop = NULL, method = c("global", "within", "between"),
sup.pop = NULL, sub.pop = NULL, n... | /man/gstat.randtest.Rd | no_license | nmoran/hierfstat | R | false | true | 2,940 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gstat.randtest.R
\name{gstat.randtest}
\alias{gstat.randtest}
\title{Goudet's G-statistic Monte Carlo test for genind object}
\usage{
gstat.randtest(x, pop = NULL, method = c("global", "within", "between"),
sup.pop = NULL, sub.pop = NULL, n... |
# Generated by rstantools. Do not edit by hand.
# names of stan models
stanmodels <- c("nig_full", "nig")
# load each stan module
Rcpp::loadModule("stan_fit4nig_full_mod", what = TRUE)
Rcpp::loadModule("stan_fit4nig_mod", what = TRUE)
# instantiate each stanmodel object
stanmodels <- sapply(stanmodels, function(mod... | /rpackage/R/stanmodels.R | no_license | magnusmunch/NIG | R | false | false | 1,085 | r | # Generated by rstantools. Do not edit by hand.
# names of stan models
stanmodels <- c("nig_full", "nig")
# load each stan module
Rcpp::loadModule("stan_fit4nig_full_mod", what = TRUE)
Rcpp::loadModule("stan_fit4nig_mod", what = TRUE)
# instantiate each stanmodel object
stanmodels <- sapply(stanmodels, function(mod... |
source('./R/VAR_functions.R')
country <- "Chile"
forecast_exercise_year <- 2018
forecast_exercise_number <- 2
output_path <- paste0("./analysis/VAR_output/edd_exercises/",
forecast_exercise_year,
"_exercise_", forecast_exercise_number, "/")
read_compare_var_res <- function... | /analysis/VAR_scripts/new_vs_old_chile_autoprechosen.R | no_license | ricardomayerb/forecastmix | R | false | false | 9,803 | r | source('./R/VAR_functions.R')
country <- "Chile"
forecast_exercise_year <- 2018
forecast_exercise_number <- 2
output_path <- paste0("./analysis/VAR_output/edd_exercises/",
forecast_exercise_year,
"_exercise_", forecast_exercise_number, "/")
read_compare_var_res <- function... |
#Analyses using generalized additive models for location, scale and shape(GAMLSS)
#for manuscript titled: Light fuels while nitrogen suppresses symbiotic nitrogen fixation hotspots in Neotropical canopy gap seedlings
#published in New Phytologist 2021
#Packages####
library("tidyverse")
library("gamlss")
library("sjPl... | /McCulloch_NPH_2021_GAMLSS_clean.R | no_license | lmcculloch/LaSelva_NPH_LightSNF_2021 | R | false | false | 19,306 | r | #Analyses using generalized additive models for location, scale and shape(GAMLSS)
#for manuscript titled: Light fuels while nitrogen suppresses symbiotic nitrogen fixation hotspots in Neotropical canopy gap seedlings
#published in New Phytologist 2021
#Packages####
library("tidyverse")
library("gamlss")
library("sjPl... |
\name{simulglyph.vmf}
\alias{simulglyph.vmf}
\concept{Simulation}
\concept{ODF visualization}
\concept{Glyph mapping}
\title{Voxel Diffusion Profile Simulation and von Mises-Fisher Fibre Mapping}
\description{
The synthesized diffusion voxel profiles generated by \code{synthfiberss2z} are used to reconstruct ODF profil... | /man/simulglyph.vmf.Rd | no_license | cran/gdimap | R | false | false | 7,451 | rd | \name{simulglyph.vmf}
\alias{simulglyph.vmf}
\concept{Simulation}
\concept{ODF visualization}
\concept{Glyph mapping}
\title{Voxel Diffusion Profile Simulation and von Mises-Fisher Fibre Mapping}
\description{
The synthesized diffusion voxel profiles generated by \code{synthfiberss2z} are used to reconstruct ODF profil... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/calcKristCa.r
\name{calcKristCa}
\alias{calcKristCa}
\title{calcKristCa}
\usage{
calcKristCa(
shipType,
actualDisplacement,
tankerBulkCarrierGCargoShipTypes = c("tanker", "general.cargo", "chemical.tanker",
"liquified.gas.tanker", "... | /ShipPowerModel/man/calcKristCa.Rd | permissive | Misterfluff/Marine_Emissions_Tools | R | false | true | 2,741 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/calcKristCa.r
\name{calcKristCa}
\alias{calcKristCa}
\title{calcKristCa}
\usage{
calcKristCa(
shipType,
actualDisplacement,
tankerBulkCarrierGCargoShipTypes = c("tanker", "general.cargo", "chemical.tanker",
"liquified.gas.tanker", "... |
#' Remove objects associated with a strategy
#'
#' Remove the order_book, account, and portfolio of given \code{name}.
#' @param name name of the portfolio/account/order book to clean up. (Default='default')
#' @param silent silence warnings about trying to remove objects that do not exist. (Default=TRUE)
#' @return in... | /R/wrapup.R | no_license | cloudcell/quantstrat | R | false | false | 6,901 | r | #' Remove objects associated with a strategy
#'
#' Remove the order_book, account, and portfolio of given \code{name}.
#' @param name name of the portfolio/account/order book to clean up. (Default='default')
#' @param silent silence warnings about trying to remove objects that do not exist. (Default=TRUE)
#' @return in... |
library(data.table)
library(lme4)
library(MASS)
library(stringr)
data <- fread("dataset_alldata.csv")
str(data)
data$site_id<-as.character(data$site_id)
data$subsample<-as.character(data$subsample)
data$season<-as.character(data$season)
################################################################################
... | /modelling_code_and_data/modelling_code.R | no_license | alecchristie888/datasetreanalysiscode | R | false | false | 14,155 | r | library(data.table)
library(lme4)
library(MASS)
library(stringr)
data <- fread("dataset_alldata.csv")
str(data)
data$site_id<-as.character(data$site_id)
data$subsample<-as.character(data$subsample)
data$season<-as.character(data$season)
################################################################################
... |
options(error=recover)
generate_random_neighbours = function( lon, lat, id, max_distance = 10000, n_neighbours=10) {
browser()
my_revgeo = addMemoization(revgeo)
print(paste('id = ', id))
generate_random_points(lon, lat, max_distance = max_distance ) %>%
head(10) %>%
# mutate( neighbour_address = map2... | /debug.R | no_license | dewoller/greenspace_1km | R | false | false | 838 | r | options(error=recover)
generate_random_neighbours = function( lon, lat, id, max_distance = 10000, n_neighbours=10) {
browser()
my_revgeo = addMemoization(revgeo)
print(paste('id = ', id))
generate_random_points(lon, lat, max_distance = max_distance ) %>%
head(10) %>%
# mutate( neighbour_address = map2... |
#
# This is the user-interface definition of a Shiny web application. You can
# run the application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
# Define UI for application that draws a histogram
shinyUI(
tagList(
navbarPage(
... | /ui.R | no_license | LM-D/Movie | R | false | false | 12,724 | r | #
# This is the user-interface definition of a Shiny web application. You can
# run the application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
# Define UI for application that draws a histogram
shinyUI(
tagList(
navbarPage(
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/misc_and_utility.r
\name{umx_set_cores}
\alias{umx_set_cores}
\title{umx_set_cores}
\usage{
umx_set_cores(cores = NA, model = NULL)
}
\arguments{
\item{cores}{number of cores to use. NA (the default) returns current value. "-1" will set to de... | /man/umx_set_cores.Rd | no_license | mhunter1/umx | R | false | true | 1,476 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/misc_and_utility.r
\name{umx_set_cores}
\alias{umx_set_cores}
\title{umx_set_cores}
\usage{
umx_set_cores(cores = NA, model = NULL)
}
\arguments{
\item{cores}{number of cores to use. NA (the default) returns current value. "-1" will set to de... |
##Generic Fuction of Classify
#' @title Generic classify function
#' @aliases classify
#' @author Xiaoyao Yang
#' @description Returning classification result
#' @return An label obtained by classification method determined by pars
#' @details
#' Returning label for classification problem
#'
#' This is the S3 generic ... | /R/classify.R | no_license | xiaoyaoyang/freestats | R | false | false | 4,636 | r |
##Generic Fuction of Classify
#' @title Generic classify function
#' @aliases classify
#' @author Xiaoyao Yang
#' @description Returning classification result
#' @return An label obtained by classification method determined by pars
#' @details
#' Returning label for classification problem
#'
#' This is the S3 generic ... |
myfunction <- function() {
x<- rnorm(1000)
mean(x)
} | /CaseStudy/myfunc.r | no_license | ChangRBC/R-Projects | R | false | false | 57 | r | myfunction <- function() {
x<- rnorm(1000)
mean(x)
} |
library("testthat")
library("rco")
test_check("rco")
| /tests/testthat.R | no_license | jcrodriguez1989/rco | R | false | false | 54 | r | library("testthat")
library("rco")
test_check("rco")
|
testlist <- list(doy = c(2.34347651131544e-312, -8.60707280997573e+298, -Inf, 1.0320600067879e-310, 1.4502398105091e-309, 6.63371566942148e+144, 1.22034214522788e-321, 0, 3.20506244267395e-310, 1.65597681223101e-24, 2.77448001764254e+180, 2.14722732210463e-312, -2.36757568622891e-150, NaN, NaN, NaN, NaN, NaN, NaN, ... | /meteor/inst/testfiles/ET0_ThornthwaiteWilmott/libFuzzer_ET0_ThornthwaiteWilmott/ET0_ThornthwaiteWilmott_valgrind_files/1612736056-test.R | no_license | akhikolla/updatedatatype-list3 | R | false | false | 2,937 | r | testlist <- list(doy = c(2.34347651131544e-312, -8.60707280997573e+298, -Inf, 1.0320600067879e-310, 1.4502398105091e-309, 6.63371566942148e+144, 1.22034214522788e-321, 0, 3.20506244267395e-310, 1.65597681223101e-24, 2.77448001764254e+180, 2.14722732210463e-312, -2.36757568622891e-150, NaN, NaN, NaN, NaN, NaN, NaN, ... |
library(MASS)
E <- read.csv("C:/Users/Linna_hu/Desktop/AMS578_Group15/IDEgroup15.csv")
Y <- read.csv("C:/Users/Linna_hu/Desktop/AMS578_Group15/IDYgroup15.csv")
G <- read.csv("C:/Users/Linna_hu/Desktop/AMS578_Group15/IDGgroup15.csv")
merge1 <- merge(Y[,2:3],E[,2:8],by="ID")
ob <- merge(merge1, G[,2:27], by="ID")
... | /AMS_578/Group_15.R | no_license | linnahu/StonyBrook | R | false | false | 1,873 | r | library(MASS)
E <- read.csv("C:/Users/Linna_hu/Desktop/AMS578_Group15/IDEgroup15.csv")
Y <- read.csv("C:/Users/Linna_hu/Desktop/AMS578_Group15/IDYgroup15.csv")
G <- read.csv("C:/Users/Linna_hu/Desktop/AMS578_Group15/IDGgroup15.csv")
merge1 <- merge(Y[,2:3],E[,2:8],by="ID")
ob <- merge(merge1, G[,2:27], by="ID")
... |
\name{scca}
\alias{scca}
\alias{cca}
\title{Estimate Canonical Correlations and Directions (Shrinkage and Empirical Estimates)}
\usage{
scca(X, Y, lambda.cor, scale=TRUE, verbose=TRUE)
cca(X, Y, scale=TRUE)
}
\arguments{
\item{X}{First data matrix, with samples in rows and variables in columns.}
\item{Y}{Second ... | /man/scca.Rd | no_license | warrenmcg/whitening | R | false | false | 4,534 | rd | \name{scca}
\alias{scca}
\alias{cca}
\title{Estimate Canonical Correlations and Directions (Shrinkage and Empirical Estimates)}
\usage{
scca(X, Y, lambda.cor, scale=TRUE, verbose=TRUE)
cca(X, Y, scale=TRUE)
}
\arguments{
\item{X}{First data matrix, with samples in rows and variables in columns.}
\item{Y}{Second ... |
#' Reorders district numbers
#'
#' Ensures that for each column in the plans object, the first
#' district listed is 1, the second is 2, up to n districts. Assumes that all
#' columns have the same number of districts as the first.
#' @param plans A numeric vector (if only one map) or
#' matrix with one row for e... | /R/reindex.R | no_license | cran/redist | R | false | false | 1,808 | r | #' Reorders district numbers
#'
#' Ensures that for each column in the plans object, the first
#' district listed is 1, the second is 2, up to n districts. Assumes that all
#' columns have the same number of districts as the first.
#' @param plans A numeric vector (if only one map) or
#' matrix with one row for e... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/treatmentResponseDiallel.R
\name{batched.plotter}
\alias{batched.plotter}
\title{batched.plotter: Make batched dot plots}
\usage{
batched.plotter(data.frame, title, trt.string, ctrl.string, sexed = c(FALSE,
TRUE)[1], ...)
}
\arguments{
\ite... | /man/batched.plotter.Rd | no_license | mauriziopaul/treatmentResponseDiallel | R | false | true | 812 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/treatmentResponseDiallel.R
\name{batched.plotter}
\alias{batched.plotter}
\title{batched.plotter: Make batched dot plots}
\usage{
batched.plotter(data.frame, title, trt.string, ctrl.string, sexed = c(FALSE,
TRUE)[1], ...)
}
\arguments{
\ite... |
#################################################################
###
### This Script PLots boxplots of mutation frequency by ICR cluster
### based on RNASeq Data Consensus Clustering
###
### Input data :
### ./3 ANALISYS/CLUSTERING/RNAseq/...
### ./2 DATA/TCGA Mutations/...
### Data is saved :
### ./3 ANALISYS/Mutati... | /Deprecated seperate Cancer Code/Kidney - Clear cell/v1.Code/3.4.Mutation.analysis.KIRC.SA.WHX.R | no_license | dudious/QCRI-SIDRA-ICR | R | false | false | 6,658 | r | #################################################################
###
### This Script PLots boxplots of mutation frequency by ICR cluster
### based on RNASeq Data Consensus Clustering
###
### Input data :
### ./3 ANALISYS/CLUSTERING/RNAseq/...
### ./2 DATA/TCGA Mutations/...
### Data is saved :
### ./3 ANALISYS/Mutati... |
rasterFun <- function(xyz,resolution=7.5,fun=mean,locations=NULL){
#xyz - this is the longitude, latitude and variable of interest
#resolution (km) - to be gridded (note 7.5 is the default and the optimal resoution for the data)
#fun - this is the function used to aggregate multiple values per grid cell at th... | /code/rasterFun.R | no_license | rystanley/DalHerring_PopEnv | R | false | false | 4,562 | r | rasterFun <- function(xyz,resolution=7.5,fun=mean,locations=NULL){
#xyz - this is the longitude, latitude and variable of interest
#resolution (km) - to be gridded (note 7.5 is the default and the optimal resoution for the data)
#fun - this is the function used to aggregate multiple values per grid cell at th... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/with.R
\name{with.ffdf}
\alias{with.ffdf}
\title{Evaluate an expression in a ffdf data environment}
\usage{
\method{with}{ffdf}(data, expr, ...)
}
\arguments{
\item{data}{\code{\link{ffdf}} data object used as an environment for evaluation.}
... | /pkg/man/with.ffdf.Rd | no_license | namanpaul/ffbase | R | false | true | 1,195 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/with.R
\name{with.ffdf}
\alias{with.ffdf}
\title{Evaluate an expression in a ffdf data environment}
\usage{
\method{with}{ffdf}(data, expr, ...)
}
\arguments{
\item{data}{\code{\link{ffdf}} data object used as an environment for evaluation.}
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simpledb_operations.R
\name{simpledb_put_attributes}
\alias{simpledb_put_attributes}
\title{The PutAttributes operation creates or replaces attributes in an item}
\usage{
simpledb_put_attributes(DomainName, ItemName, Attributes, Expected)
}
\... | /paws/man/simpledb_put_attributes.Rd | permissive | peoplecure/paws | R | false | true | 3,188 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simpledb_operations.R
\name{simpledb_put_attributes}
\alias{simpledb_put_attributes}
\title{The PutAttributes operation creates or replaces attributes in an item}
\usage{
simpledb_put_attributes(DomainName, ItemName, Attributes, Expected)
}
\... |
## Title: DrainModule_Figs Outputter
##
## Interface/Abstraction: This object follows the "outputters"
## interface consisting of the methods; Write_z and Write_t
## Write_z: write depth (z) level data at each timestep (t)
## Write_t: writes t level data at each timestep (t)
## runOutput: does something
## closeCon: ... | /outputters/DrainModule_Figs.R | no_license | paulhegedus/SWSTM-1D | R | false | false | 2,992 | r | ## Title: DrainModule_Figs Outputter
##
## Interface/Abstraction: This object follows the "outputters"
## interface consisting of the methods; Write_z and Write_t
## Write_z: write depth (z) level data at each timestep (t)
## Write_t: writes t level data at each timestep (t)
## runOutput: does something
## closeCon: ... |
#' Derive the importance rank of all predictors used in the GRNN
#'
#' The function \code{grnn.imp} derives the importance rank of all predictors used in the GRNN
#' It essentially is a wrapper around the function \code{grnn.x_imp}.
#'
#' @param net The GRNN object generated by grnn.fit()
#' @param class TRUE or FA... | /R/grnn.imp.R | no_license | cran/yager | R | false | false | 1,462 | r | #' Derive the importance rank of all predictors used in the GRNN
#'
#' The function \code{grnn.imp} derives the importance rank of all predictors used in the GRNN
#' It essentially is a wrapper around the function \code{grnn.x_imp}.
#'
#' @param net The GRNN object generated by grnn.fit()
#' @param class TRUE or FA... |
# This file is auto-generated by h2o-3/h2o-bindings/bin/gen_R.py
# Copyright 2016 H2O.ai; Apache License Version 2.0 (see LICENSE for details)
#'
# -------------------------- H2O Stacked Ensemble -------------------------- #
#'
#' Builds a Stacked Ensemble
#'
#' Build a stacked ensemble (aka. Super Learner) using th... | /h2o-r/h2o-package/R/stackedensemble.R | permissive | robingood/h2o-3 | R | false | false | 10,536 | r | # This file is auto-generated by h2o-3/h2o-bindings/bin/gen_R.py
# Copyright 2016 H2O.ai; Apache License Version 2.0 (see LICENSE for details)
#'
# -------------------------- H2O Stacked Ensemble -------------------------- #
#'
#' Builds a Stacked Ensemble
#'
#' Build a stacked ensemble (aka. Super Learner) using th... |
# Correlated topic models
# There is an example in data folder "CTM30.RData"
# Install packages ################################################################################
# Use install.packages("package") to install packages which are needed in this program
install.packages("NLP")
install.packages("tm")
in... | /FINAL/4. Topic Monitoring/4.1 Topic Detection/CTM_Modeling_Lifei.R | permissive | o0oBluePhoenixo0o/AbbVie2017 | R | false | false | 4,240 | r |
# Correlated topic models
# There is an example in data folder "CTM30.RData"
# Install packages ################################################################################
# Use install.packages("package") to install packages which are needed in this program
install.packages("NLP")
install.packages("tm")
in... |
rankhospital <- function(state, outcome, num = "best") {
## Read outcome data
outcomeData <- read.csv(file = "outcome-of-care-measures.csv", colClasses = "character")
possibleOutcomes <- c("heart attack", "heart failure", "pneumonia")
## Check that state and outcome are valid
if(sum(outcomeData$State == state... | /rankhospital.R | no_license | geertendoornenbal/assignment3 | R | false | false | 1,530 | r | rankhospital <- function(state, outcome, num = "best") {
## Read outcome data
outcomeData <- read.csv(file = "outcome-of-care-measures.csv", colClasses = "character")
possibleOutcomes <- c("heart attack", "heart failure", "pneumonia")
## Check that state and outcome are valid
if(sum(outcomeData$State == state... |
test on rd
:term1
how about
continued
:term2
term2 desc
:term3
with white line
* l1
* l2
* l3 with white line
| /test/repo/t025.rd | permissive | fuminori-ido/juli | R | false | false | 122 | rd | test on rd
:term1
how about
continued
:term2
term2 desc
:term3
with white line
* l1
* l2
* l3 with white line
|
#' A probability function for Pij
#'
#' Calculates the probability of Pij, the output of a Rasch model
#'
#' @param raschObj An object of class Rasch
#' @param theta A proposed valie of theta_j
#'
#' @return A vector of length n that represents Pij for each question
#' @examples raschObj<-new(Class = "Rasch", name="... | /easyRasch/R/probability.R | no_license | zoeang/Midterm | R | false | false | 1,352 | r | #' A probability function for Pij
#'
#' Calculates the probability of Pij, the output of a Rasch model
#'
#' @param raschObj An object of class Rasch
#' @param theta A proposed valie of theta_j
#'
#' @return A vector of length n that represents Pij for each question
#' @examples raschObj<-new(Class = "Rasch", name="... |
.check_missing <- function(Group, ref) {
# all values in x should be in bins.
if (is.numeric(ref)) ref = names(ref)
are_missing = !Group %in% ref
err = 'Error: Returning missing name(s)...'
if (any(are_missing)) {
missing = Group[are_missing]
stop(cat(c(err, missing), sep = '\n'))
}
... | /R/score.R | permissive | jlaffy/scrabble | R | false | false | 6,579 | r | .check_missing <- function(Group, ref) {
# all values in x should be in bins.
if (is.numeric(ref)) ref = names(ref)
are_missing = !Group %in% ref
err = 'Error: Returning missing name(s)...'
if (any(are_missing)) {
missing = Group[are_missing]
stop(cat(c(err, missing), sep = '\n'))
}
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.