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
## archivist package for R ## #' @title Copy an Existing Repository into Another Repository #' #' @description #' \code{copy*Repo} copies artifacts from one \code{Repository} into another \code{Repository}. #' It adds new files to existing \code{gallery} folder in \code{repoTo} \code{Repository}. #' \code{copyLocal...
/R/copyToRepo.R
no_license
eliotmcintire/archivist
R
false
false
10,255
r
## archivist package for R ## #' @title Copy an Existing Repository into Another Repository #' #' @description #' \code{copy*Repo} copies artifacts from one \code{Repository} into another \code{Repository}. #' It adds new files to existing \code{gallery} folder in \code{repoTo} \code{Repository}. #' \code{copyLocal...
airports <- read.csv("http://openflights.svn.sourceforge.net/viewvc/openflights/openflights/data/airports.dat", header = FALSE) colnames(airports) <- c("ID", "name", "city", "country", "IATA_FAA", "ICAO", "lat", "lon", "altitude", "timezone", "DST") head(airports) library(rworldmap) newmap <- getMap(resolution = "low"...
/airports.r
no_license
acarp52/datafest
R
false
false
2,054
r
airports <- read.csv("http://openflights.svn.sourceforge.net/viewvc/openflights/openflights/data/airports.dat", header = FALSE) colnames(airports) <- c("ID", "name", "city", "country", "IATA_FAA", "ICAO", "lat", "lon", "altitude", "timezone", "DST") head(airports) library(rworldmap) newmap <- getMap(resolution = "low"...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/estimateDistances.R \name{estimateDistances} \alias{estimateDistances} \title{Estimate distances between oscillators} \usage{ estimateDistances( odenet, equilibrium, distGround = c("combined", "individual", "fixed", c("A", "B",...
/man/estimateDistances.Rd
no_license
cran/ODEnetwork
R
false
true
1,933
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/estimateDistances.R \name{estimateDistances} \alias{estimateDistances} \title{Estimate distances between oscillators} \usage{ estimateDistances( odenet, equilibrium, distGround = c("combined", "individual", "fixed", c("A", "B",...
\name{stat} \alias{stat} \title{ Evaluates a function feature per feature. } \description{ Evaluates function FUN feature per feature for input classes: matrix, xprnSet, XprnSet, xprnSetPair. } \usage{ stat(x, y = numeric(0), FUN = mean, na.rm = TRUE, ...) } \arguments{ \item{x}{ input data of class matrix, xprnSet,...
/man/stat.Rd
no_license
cran/Statomica
R
false
false
2,555
rd
\name{stat} \alias{stat} \title{ Evaluates a function feature per feature. } \description{ Evaluates function FUN feature per feature for input classes: matrix, xprnSet, XprnSet, xprnSetPair. } \usage{ stat(x, y = numeric(0), FUN = mean, na.rm = TRUE, ...) } \arguments{ \item{x}{ input data of class matrix, xprnSet,...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Widget.R \name{report_widgets} \alias{report_widgets} \title{Returns details of the widgets that make up a specific report.} \usage{ report_widgets( wufoo_name = auth_name(NULL), domain = "wufoo.com", formIdentifier = NULL, showReques...
/man/report_widgets.Rd
permissive
dmpe/WufooR
R
false
true
1,229
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Widget.R \name{report_widgets} \alias{report_widgets} \title{Returns details of the widgets that make up a specific report.} \usage{ report_widgets( wufoo_name = auth_name(NULL), domain = "wufoo.com", formIdentifier = NULL, showReques...
######################### # Coding Object to link ethnic groups to languages ######################### ###################### # Automatic matching to tree ###################### ## Get names of language nodes #' @name get_ethno_names #' @title Get names of language nodes #' @keywords internal #' @importFrom stats ...
/R/coder_link_lang.R
no_license
carl-mc/LEDA
R
false
false
5,927
r
######################### # Coding Object to link ethnic groups to languages ######################### ###################### # Automatic matching to tree ###################### ## Get names of language nodes #' @name get_ethno_names #' @title Get names of language nodes #' @keywords internal #' @importFrom stats ...
library(readr) library(keras) library(purrr) library(dplyr) # params for further tuning FLAGS <- flags( flag_integer("vocab_size", 50000), flag_integer("max_len_padding", 20), #word embedding size, i. e. vector dimension flag_integer("embedding_size", 300), flag_numeric("regularization", 0.0001), flag_in...
/quora1.R
no_license
martinvita/duplicateQuestionsQuoraR
R
false
false
5,410
r
library(readr) library(keras) library(purrr) library(dplyr) # params for further tuning FLAGS <- flags( flag_integer("vocab_size", 50000), flag_integer("max_len_padding", 20), #word embedding size, i. e. vector dimension flag_integer("embedding_size", 300), flag_numeric("regularization", 0.0001), flag_in...
## This is plot2 generated from 'Electric power consumption' dataset for course project1 #Read data data <- read.table("household_power_consumption.txt", sep = ";", header = TRUE) #Convert date data$Date <- as.Date(data$Date, format= "%d/%m/%Y") #Subset data from 2007/1/2 to 2007/2/2 and convert time testdata <- da...
/Course Project 1/plot3.R
no_license
Fancy-Xi/Coursera-Exploratory-Data-Analysis
R
false
false
1,037
r
## This is plot2 generated from 'Electric power consumption' dataset for course project1 #Read data data <- read.table("household_power_consumption.txt", sep = ";", header = TRUE) #Convert date data$Date <- as.Date(data$Date, format= "%d/%m/%Y") #Subset data from 2007/1/2 to 2007/2/2 and convert time testdata <- da...
){ print(y) write.table(y, file="mappedsnps.tmp", sep=", ", row.names = FALSE, col.names = FALSE, append = TRUE) } }
/rscripts/secondhalf_testsnps.R
no_license
ltcrod/branchsnps
R
false
false
144
r
){ print(y) write.table(y, file="mappedsnps.tmp", sep=", ", row.names = FALSE, col.names = FALSE, append = TRUE) } }
library(tidyverse) library(lubridate) library(grid) library(sf) library(maptools) library(ggrepel) #Path to local drive root <- "~/GitHub/Summer_Fall_Action" setwd(root) data_root<-file.path(root,"data-raw") code_root <- file.path(root,"R") output_root <- file.path(root,"output") End_year=2020 #Code from Sam Bashev...
/R/R_DeltaSmelt.R
no_license
bmahardja/Summer_Fall_Action
R
false
false
6,696
r
library(tidyverse) library(lubridate) library(grid) library(sf) library(maptools) library(ggrepel) #Path to local drive root <- "~/GitHub/Summer_Fall_Action" setwd(root) data_root<-file.path(root,"data-raw") code_root <- file.path(root,"R") output_root <- file.path(root,"output") End_year=2020 #Code from Sam Bashev...
#' A function to update R without losing packages, intended for Macs. #' #' @examples #' \dontrun{ #' updateR() #' } #' #' @export updateR <- function() { cat("You need a working directory to save and load all your packages. \n\n") # 1 if yes, 2 if not useCur <- utils::menu(c("Yes", "No"), title = cat("Is this ok...
/R/updateR.R
no_license
bryandmartin/WSC
R
false
false
2,941
r
#' A function to update R without losing packages, intended for Macs. #' #' @examples #' \dontrun{ #' updateR() #' } #' #' @export updateR <- function() { cat("You need a working directory to save and load all your packages. \n\n") # 1 if yes, 2 if not useCur <- utils::menu(c("Yes", "No"), title = cat("Is this ok...
\name{make_url} \alias{make_url} \title{Make url with url base appended} \usage{ make_url(x) } \arguments{ \item{x}{frament of url} } \description{ Make url with url base appended }
/man/make_url.Rd
no_license
jverzani/gWidgetsWWW2.rapache
R
false
false
189
rd
\name{make_url} \alias{make_url} \title{Make url with url base appended} \usage{ make_url(x) } \arguments{ \item{x}{frament of url} } \description{ Make url with url base appended }
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Col and pal.R \name{get_cyberpunk_colors} \alias{get_cyberpunk_colors} \title{Extract a list of color codes} \usage{ get_cyberpunk_colors(c(color1, color2)) } \value{ A list of color codes } \description{ Mostly an internal function, it serve...
/man/get_cyberpunk_colors.Rd
no_license
piyush-ahuja/ggCyberPunk
R
false
true
384
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Col and pal.R \name{get_cyberpunk_colors} \alias{get_cyberpunk_colors} \title{Extract a list of color codes} \usage{ get_cyberpunk_colors(c(color1, color2)) } \value{ A list of color codes } \description{ Mostly an internal function, it serve...
library(ade4) data(USArrests) pca1 <- dudi.pca(USArrests,scannf=FALSE,nf=3) pca1 score(pca1) s.corcircle(pca1$co) s.label(pca1$li) #Distance matrices data(yanomama) gen <- quasieuclid(as.dist(yanomama$gen)) geo <- quasieuclid(as.dist(yanomama$geo)) ant <- quasieuclid(as.dist(yanomama$ant))...
/rnews2004-1.R
no_license
goal1234/practice
R
false
false
2,053
r
library(ade4) data(USArrests) pca1 <- dudi.pca(USArrests,scannf=FALSE,nf=3) pca1 score(pca1) s.corcircle(pca1$co) s.label(pca1$li) #Distance matrices data(yanomama) gen <- quasieuclid(as.dist(yanomama$gen)) geo <- quasieuclid(as.dist(yanomama$geo)) ant <- quasieuclid(as.dist(yanomama$ant))...
rm(list=ls()) #========================== # UN SEMPLICE PROBLEMA-TIPO #========================== #--------------- # yesterday data #--------------- library(readr) PATH <- "http://azzalini.stat.unipd.it/Book-DM/yesterday.dat" df <- read_table(PATH) train <- data.frame(x=df$x, y=df$y.yesterday) test <- data.frame(x=df...
/docs/RCODE/Simpleproblem.R
no_license
aldosolari/DM
R
false
false
2,372
r
rm(list=ls()) #========================== # UN SEMPLICE PROBLEMA-TIPO #========================== #--------------- # yesterday data #--------------- library(readr) PATH <- "http://azzalini.stat.unipd.it/Book-DM/yesterday.dat" df <- read_table(PATH) train <- data.frame(x=df$x, y=df$y.yesterday) test <- data.frame(x=df...
# Liberty Case for Clustering custid = 1:12 trans = c(5,10,15,2,18,9,14,8,7,9,1,6) totpurch = c(450,800,900,50, 900, 200, 500, 300, 250, 1000, 30, 700) income = c(90,82,77,30, 60, 45, 82, 22, 90, 80,60, 80) df = data.frame(custid, trans, totpurch, income) apply(df, 2, FUN=length) #Right no of clusters #Centeriod for t...
/61-clust/clust-case-liberty.R
no_license
DUanalytics/rAnalytics
R
false
false
334
r
# Liberty Case for Clustering custid = 1:12 trans = c(5,10,15,2,18,9,14,8,7,9,1,6) totpurch = c(450,800,900,50, 900, 200, 500, 300, 250, 1000, 30, 700) income = c(90,82,77,30, 60, 45, 82, 22, 90, 80,60, 80) df = data.frame(custid, trans, totpurch, income) apply(df, 2, FUN=length) #Right no of clusters #Centeriod for t...
web_scraping <- function(working_directory, name, number){ ########## ## CVPR ## ########## if(name == "CVPR"){ setwd(working_directory) if(!require("RCurl")) install.packages("RCurl") ; library(RCurl) if(!require("XML")) install.packages("XML") ; library(XML) # Setting URL url <-...
/Scraping_with_Visualizing.R
no_license
Justin-A/Scraping_Paper
R
false
false
21,490
r
web_scraping <- function(working_directory, name, number){ ########## ## CVPR ## ########## if(name == "CVPR"){ setwd(working_directory) if(!require("RCurl")) install.packages("RCurl") ; library(RCurl) if(!require("XML")) install.packages("XML") ; library(XML) # Setting URL url <-...
HFAM <- function(X,Y,k=ncol(X),th=0){ su_ic <- SU(X,Y) m <- which.max(su_ic) S <- names(su_ic)[m] L <- names(su_ic)[-m] su_ij <- matrix(SU(X[L],X[S]),byrow=T) rownames(su_ij) <- L repeat{ L <- L[which(su_ij[,1] - su_ic[L] < th)] if(length(L) == 0 || length(S)==k) break m <- which.max(su_ic[L] - apply(su_ij...
/Filter/HFAM.R
no_license
kimjeongtae/feature_selection-R
R
false
false
478
r
HFAM <- function(X,Y,k=ncol(X),th=0){ su_ic <- SU(X,Y) m <- which.max(su_ic) S <- names(su_ic)[m] L <- names(su_ic)[-m] su_ij <- matrix(SU(X[L],X[S]),byrow=T) rownames(su_ij) <- L repeat{ L <- L[which(su_ij[,1] - su_ic[L] < th)] if(length(L) == 0 || length(S)==k) break m <- which.max(su_ic[L] - apply(su_ij...
# fields is a package for analysis of spatial data written for # the R software environment . # Copyright (C) 2016 # University Corporation for Atmospheric Research (UCAR) # Contact: Douglas Nychka, nychka@ucar.edu, # National Center for Atmospheric Research, PO Box 3000, Boulder, CO 80307-3000 # # This program is fre...
/fields/R/plot.surface.R
no_license
ingted/R-Examples
R
false
false
3,553
r
# fields is a package for analysis of spatial data written for # the R software environment . # Copyright (C) 2016 # University Corporation for Atmospheric Research (UCAR) # Contact: Douglas Nychka, nychka@ucar.edu, # National Center for Atmospheric Research, PO Box 3000, Boulder, CO 80307-3000 # # This program is fre...
singleParamTest <- function(model1, model2, return.fit = FALSE, method = "satorra.bentler.2001") { # Check nested models without any swaps if(model1@Fit@test[[1]]$df > model2@Fit@test[[1]]$df) { fit0 <- model1 fit1 <- model2 } else { fit0 <- model2 fit1 <- model1 } # ...
/semTools/R/singleParamTest.R
no_license
ingted/R-Examples
R
false
false
6,127
r
singleParamTest <- function(model1, model2, return.fit = FALSE, method = "satorra.bentler.2001") { # Check nested models without any swaps if(model1@Fit@test[[1]]$df > model2@Fit@test[[1]]$df) { fit0 <- model1 fit1 <- model2 } else { fit0 <- model2 fit1 <- model1 } # ...
#' get timings for imports #' #' Given a package name, attempts to time how long it takes to load the package #' via library, and then the time for each of the imported packages (see \code{\link{get_imports}}). #' This should provide some estimate of which package might be making your package take #' a while to load. #...
/R/timings.R
permissive
rmflight/importedPackageTimings
R
false
false
4,283
r
#' get timings for imports #' #' Given a package name, attempts to time how long it takes to load the package #' via library, and then the time for each of the imported packages (see \code{\link{get_imports}}). #' This should provide some estimate of which package might be making your package take #' a while to load. #...
# This set of functions can cache the inverse of a matrix from its # computation for the first time, and be retrieved quickly for future use. # This function creates a matrix object for which the calculated inverse # can be cached. makeCacheMatrix <- function(x = matrix()){ m <- NULL # m is the inverse of the mat...
/cachematrix.R
no_license
floralo40/ProgrammingAssignment2
R
false
false
1,252
r
# This set of functions can cache the inverse of a matrix from its # computation for the first time, and be retrieved quickly for future use. # This function creates a matrix object for which the calculated inverse # can be cached. makeCacheMatrix <- function(x = matrix()){ m <- NULL # m is the inverse of the mat...
# used for permutations library(gtools) # used for maxNR library(maxLik) generateRandomMatrix = function(randomGenerator, b, k) { A = matrix(randomGenerator(b * k), b, k) A = A - apply(A, 1, mean) A = A / sqrt(mean(A ^ 2)) } getb = function(A) dim(A)[1] getk = function(A) dim(A)[2] perm = function(A, i) { k...
/1.R
no_license
mnaoumov/Rcalc
R
false
false
6,081
r
# used for permutations library(gtools) # used for maxNR library(maxLik) generateRandomMatrix = function(randomGenerator, b, k) { A = matrix(randomGenerator(b * k), b, k) A = A - apply(A, 1, mean) A = A / sqrt(mean(A ^ 2)) } getb = function(A) dim(A)[1] getk = function(A) dim(A)[2] perm = function(A, i) { k...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/orca_interface.R \name{count_graphlets_per_node} \alias{count_graphlets_per_node} \title{Count graphlets for each node in a graph} \usage{ count_graphlets_per_node(graph, max_graphlet_size) } \arguments{ \item{graph}{A connected, undirected, ...
/man/count_graphlets_per_node.Rd
permissive
vishalbelsare/network-comparison
R
false
true
807
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/orca_interface.R \name{count_graphlets_per_node} \alias{count_graphlets_per_node} \title{Count graphlets for each node in a graph} \usage{ count_graphlets_per_node(graph, max_graphlet_size) } \arguments{ \item{graph}{A connected, undirected, ...
context("Checking rm_non_words") test_that("rm_non_words is removing non-words",{ x <- c( "I like 56 dogs!", "It's seventy-two feet from the px290.", NA, "What", "that1is2a3way4to5go6.", "What do you*% want? For real%; I think you'll see.", "Oh some <html>c...
/tests/testthat/test-rm_non_words.R
no_license
trinker/qdapRegex
R
false
false
1,319
r
context("Checking rm_non_words") test_that("rm_non_words is removing non-words",{ x <- c( "I like 56 dogs!", "It's seventy-two feet from the px290.", NA, "What", "that1is2a3way4to5go6.", "What do you*% want? For real%; I think you'll see.", "Oh some <html>c...
########## # PCA - combined with external data # Usage: R --args config.file < pca_combined.R ########## library(GWASTools) library(QCpipeline) library(SNPRelate) sessionInfo() # read configuration args <- commandArgs(trailingOnly=TRUE) if (length(args) < 1) stop("missing configuration file") config <- readConfig(arg...
/R/pca_combined.R
no_license
HuaLing1/QCpipeline
R
false
false
3,362
r
########## # PCA - combined with external data # Usage: R --args config.file < pca_combined.R ########## library(GWASTools) library(QCpipeline) library(SNPRelate) sessionInfo() # read configuration args <- commandArgs(trailingOnly=TRUE) if (length(args) < 1) stop("missing configuration file") config <- readConfig(arg...
## install sql library install.packages("sqldf") library(sqldf) fname <- "household_power_consumption.txt" # read the records from data file where records are on date : '1/2/2007' OR Date = '2/2/2007'" my_sql <- "SELECT * from file WHERE Date = '1/2/2007' OR Date = '2/2/2007'" household_data <- read.csv2.sql(fname, ...
/plot4.R
no_license
upcomingnewton/ExData_Plotting1
R
false
false
1,397
r
## install sql library install.packages("sqldf") library(sqldf) fname <- "household_power_consumption.txt" # read the records from data file where records are on date : '1/2/2007' OR Date = '2/2/2007'" my_sql <- "SELECT * from file WHERE Date = '1/2/2007' OR Date = '2/2/2007'" household_data <- read.csv2.sql(fname, ...
library(data.table) cp01.wd <- getwd() fname <- "household_power_consumption.txt" fimport <- paste(cp01.wd, "//", fname, sep = "") ## Use the fread function from the data.table library to decrease time ## to import into memory the raw data file. power.data.raw <- fread(fimport, sep = ";", header = TRUE, ...
/plot4.R
no_license
TMCdmv/ExData_Plotting1
R
false
false
3,295
r
library(data.table) cp01.wd <- getwd() fname <- "household_power_consumption.txt" fimport <- paste(cp01.wd, "//", fname, sep = "") ## Use the fread function from the data.table library to decrease time ## to import into memory the raw data file. power.data.raw <- fread(fimport, sep = ";", header = TRUE, ...
getwd() setwd(".\\Getting and Cleaning Data") library(data.table, jpeg, knitr) # Fix URL reading for knitr. See [Stackoverflow](http://stackoverflow.com/a/20003380). setInternet2(TRUE) # Question 1 # ---------- # The American Community Survey distributes downloadable data about United States communities. Downl...
/GettingCleaningData/Week3/quiz3.R
no_license
Griffin-D/datasciencecoursera
R
false
false
4,710
r
getwd() setwd(".\\Getting and Cleaning Data") library(data.table, jpeg, knitr) # Fix URL reading for knitr. See [Stackoverflow](http://stackoverflow.com/a/20003380). setInternet2(TRUE) # Question 1 # ---------- # The American Community Survey distributes downloadable data about United States communities. Downl...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/caretEnsemble.R \name{extractModRes} \alias{extractModRes} \title{Extract the model accuracy metrics of the individual models in an ensemble object.} \usage{ extractModRes(ensemble) } \arguments{ \item{ensemble}{a caretEnsemble to make predic...
/man/extractModRes.Rd
permissive
Malhadas/caretEnsemble
R
false
true
435
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/caretEnsemble.R \name{extractModRes} \alias{extractModRes} \title{Extract the model accuracy metrics of the individual models in an ensemble object.} \usage{ extractModRes(ensemble) } \arguments{ \item{ensemble}{a caretEnsemble to make predic...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/as-term.R \name{as_term.mcmc} \alias{as_term.mcmc} \title{Coerce to a Term Vector} \usage{ \method{as_term}{mcmc}(x, ...) } \arguments{ \item{x}{An object.} \item{...}{Unused.} } \description{ Coerce to a Term Vector } \examples{ as_term(as_...
/man/as_term.mcmc.Rd
permissive
poissonconsulting/nlist
R
false
true
584
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/as-term.R \name{as_term.mcmc} \alias{as_term.mcmc} \title{Coerce to a Term Vector} \usage{ \method{as_term}{mcmc}(x, ...) } \arguments{ \item{x}{An object.} \item{...}{Unused.} } \description{ Coerce to a Term Vector } \examples{ as_term(as_...
\name{kmci.object} \alias{kmci.object} \alias{kmci} \title{ Kaplan-Meier (Survival Curve) Confidence Interval Object } \description{ The \code{kmci} class is returned by the functions \code{\link{kmciTG}} or \code{\link{kmciSW}}. The class represents a fitted survival curve with pointwise confidence int...
/man/kmci.object.Rd
no_license
cran/bpcp
R
false
false
1,445
rd
\name{kmci.object} \alias{kmci.object} \alias{kmci} \title{ Kaplan-Meier (Survival Curve) Confidence Interval Object } \description{ The \code{kmci} class is returned by the functions \code{\link{kmciTG}} or \code{\link{kmciSW}}. The class represents a fitted survival curve with pointwise confidence int...
#' Build Numeric Data #' @param n A number. This specifies the number of values to be generated. #' @param st A number. This defines the starting value of the number of data points. #' @param en A number. This defines the ending value of the number of data points. #' @param disp A number between \eqn{-(pi/2)} and \eqn...
/R/buildNum.R
permissive
SidharthMacherla/conjurer
R
false
false
3,407
r
#' Build Numeric Data #' @param n A number. This specifies the number of values to be generated. #' @param st A number. This defines the starting value of the number of data points. #' @param en A number. This defines the ending value of the number of data points. #' @param disp A number between \eqn{-(pi/2)} and \eqn...
filename = commandArgs(TRUE)[1] data = read.table(filename) x = data[,1] y = data[,2] m = lm(y ~ x + I(x^2)) write.table(m$coefficients, col.names=FALSE, row.names=FALSE)
/compute_date_coeffs.R
no_license
also/hubway-viz
R
false
false
171
r
filename = commandArgs(TRUE)[1] data = read.table(filename) x = data[,1] y = data[,2] m = lm(y ~ x + I(x^2)) write.table(m$coefficients, col.names=FALSE, row.names=FALSE)
#' Dispatch a HTTP request for Airtable API #' #' @param air_options A list #' @param table A length-one character vector #' @param resource_id An optional length-one character vector. The default is NULL. #' @param fields An optional list to dispatch(as JSON object) #' @param method A length-one character vector. e.g...
/R/dispatch_request.R
no_license
zapier/AirtableR
R
false
false
721
r
#' Dispatch a HTTP request for Airtable API #' #' @param air_options A list #' @param table A length-one character vector #' @param resource_id An optional length-one character vector. The default is NULL. #' @param fields An optional list to dispatch(as JSON object) #' @param method A length-one character vector. e.g...
# Custom range input. Like built-in slider, but with appropiate styles. # see `www/range-input/binding.js` rangeInput = function(inputId, value = 20, min = 0, max = 100, step = 1) { form = tags$div( class = "range-input", id = inputId, tags$div( tags$div( class = "range-input-controls", ...
/src/app/inputs/range-input.R
no_license
tomicapretto/samplingdistributions
R
false
false
704
r
# Custom range input. Like built-in slider, but with appropiate styles. # see `www/range-input/binding.js` rangeInput = function(inputId, value = 20, min = 0, max = 100, step = 1) { form = tags$div( class = "range-input", id = inputId, tags$div( tags$div( class = "range-input-controls", ...
library(shiny) shinyServer(function(input, output, session) { colSch <- reactiveValues(pc = "rainbow") output$eFrac <- renderPlot({ top <- input$num * input$mult bot <- input$den * input$mult if (colSch$pc == "rainbow") { mycols <- rainbow(input$den, start = 0, end = 0.8) } else if (colSc...
/server.R
no_license
danhan52/fractionVisualizer
R
false
false
3,364
r
library(shiny) shinyServer(function(input, output, session) { colSch <- reactiveValues(pc = "rainbow") output$eFrac <- renderPlot({ top <- input$num * input$mult bot <- input$den * input$mult if (colSch$pc == "rainbow") { mycols <- rainbow(input$den, start = 0, end = 0.8) } else if (colSc...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/cruise_info.R \name{get_cruise_variables} \alias{get_cruise_variables} \title{Returns a dataframe containing all registered variables (at Simons CMAP) during a cruise.} \usage{ get_cruise_variables(cruiseName) } \arguments{ \item{cruiseName}{...
/cmap4r/man/get_cruise_variables.Rd
no_license
simonscmap/cmap4r
R
false
true
550
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/cruise_info.R \name{get_cruise_variables} \alias{get_cruise_variables} \title{Returns a dataframe containing all registered variables (at Simons CMAP) during a cruise.} \usage{ get_cruise_variables(cruiseName) } \arguments{ \item{cruiseName}{...
#------------------------------------------------------------- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under...
/src/test/scripts/functions/binary/matrix/UaggOuterChainLessEqualsRowIndexMin.R
permissive
apache/systemds
R
false
false
1,230
r
#------------------------------------------------------------- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under...
context("test-cosine-similarities") test_that("non-musical examples", { x <- rnorm(10) y <- rnorm(10) expect_equal( cosine_similarity(x, y), hrep::cosine_similarity(x, y) ) z <- matrix(rnorm(100), ncol = 10) expect_equal( apply(z, 2, cosine_similarity, x), cosine_similarities(x, z) ) })...
/tests/testthat/test-cosine-similarities.R
permissive
pmcharrison/hvr
R
false
false
742
r
context("test-cosine-similarities") test_that("non-musical examples", { x <- rnorm(10) y <- rnorm(10) expect_equal( cosine_similarity(x, y), hrep::cosine_similarity(x, y) ) z <- matrix(rnorm(100), ncol = 10) expect_equal( apply(z, 2, cosine_similarity, x), cosine_similarities(x, z) ) })...
plot2 <- function() { # Exploratory Data Analysis # Course Project 1 # Download the file and extract the portion needed url <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" download.file(url, destfile = ".\\data\\power.zip", mode = "...
/plot2.R
no_license
finishim/ExData_Plotting1
R
false
false
1,364
r
plot2 <- function() { # Exploratory Data Analysis # Course Project 1 # Download the file and extract the portion needed url <- "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip" download.file(url, destfile = ".\\data\\power.zip", mode = "...
library( "ape" ) library( "geiger" ) library( "expm" ) library( "nloptr" ) source( "masternegloglikeeps1.R" ) source( "Qmatrixwoodherb2.R" ) source("Pruning2.R") sim.tree<-read.tree("tree50time77.txt") sim.chrom<-read.table("chrom50time77.txt", header=FALSE) last.state=50 x.0<- log(c(0.12, 0.001, 0.25, 0.002,0.036, ...
/Simulations tree height/50 my/optim50tree77.R
no_license
roszenil/Bichromdryad
R
false
false
821
r
library( "ape" ) library( "geiger" ) library( "expm" ) library( "nloptr" ) source( "masternegloglikeeps1.R" ) source( "Qmatrixwoodherb2.R" ) source("Pruning2.R") sim.tree<-read.tree("tree50time77.txt") sim.chrom<-read.table("chrom50time77.txt", header=FALSE) last.state=50 x.0<- log(c(0.12, 0.001, 0.25, 0.002,0.036, ...
library("ggplot2") library("ggpubr") library("tikzDevice") extract.legend<-function(plot){ tmp <- ggplot_gtable(ggplot_build(plot)) leg <- which(sapply(tmp$grobs, function(x) x$name) == "guide-box") legend <- tmp$grobs[[leg]] return (legend) } samples <- data.frame(n=1:100) samples$lin <- samples$n * 4 samples$n...
/measurement_stability/plots/stability-illustration.r
no_license
janbuchar/MT
R
false
false
1,832
r
library("ggplot2") library("ggpubr") library("tikzDevice") extract.legend<-function(plot){ tmp <- ggplot_gtable(ggplot_build(plot)) leg <- which(sapply(tmp$grobs, function(x) x$name) == "guide-box") legend <- tmp$grobs[[leg]] return (legend) } samples <- data.frame(n=1:100) samples$lin <- samples$n * 4 samples$n...
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/assign_model.R \name{assign_model} \alias{assign_model} \title{Choose a model to fit} \usage{ assign_model(Mobs, Y, X, model_options, silent = TRUE) } \arguments{ \item{Mobs}{See \code{\link{nplcm}} function.} \item{Y}{See \code{\lin...
/man/assign_model.Rd
permissive
swihart/nplcm
R
false
false
1,687
rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/assign_model.R \name{assign_model} \alias{assign_model} \title{Choose a model to fit} \usage{ assign_model(Mobs, Y, X, model_options, silent = TRUE) } \arguments{ \item{Mobs}{See \code{\link{nplcm}} function.} \item{Y}{See \code{\lin...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/model.R \name{as.matrices.records} \alias{as.matrices.records} \title{Coerce to List of Matrices from Records} \usage{ \method{as.matrices}{records}(x, ...) } \arguments{ \item{x}{object of dispatch} \item{...}{dots} } \description{ Coerces ...
/man/as.matrices.records.Rd
no_license
romainfrancois/nonmemica
R
false
true
466
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/model.R \name{as.matrices.records} \alias{as.matrices.records} \title{Coerce to List of Matrices from Records} \usage{ \method{as.matrices}{records}(x, ...) } \arguments{ \item{x}{object of dispatch} \item{...}{dots} } \description{ Coerces ...
library(REAT) ### Name: shift ### Title: Shift-share analysis ### Aliases: shift ### ** Examples # Example from Farhauer/Kroell (2013): region_A_t <- c(90,20,10,60) region_A_t1 <- c(100,40,10,55) # data for region A (time t and t+1) nation_X_t <- c(400,150,150,400) nation_X_t1 <- c(440,210,135,480) # data for the n...
/data/genthat_extracted_code/REAT/examples/shift.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
1,044
r
library(REAT) ### Name: shift ### Title: Shift-share analysis ### Aliases: shift ### ** Examples # Example from Farhauer/Kroell (2013): region_A_t <- c(90,20,10,60) region_A_t1 <- c(100,40,10,55) # data for region A (time t and t+1) nation_X_t <- c(400,150,150,400) nation_X_t1 <- c(440,210,135,480) # data for the n...
#install package #install.packages("dplyr") #install.packages("tidytext") #install.packages("textstem") #install.packages("readr") #install.packages("text2vec") #install.packages("stringr") #install.packages("magrittr") #install.packages("stopwords") #install.packages("textstem") #install.packages("tm") #install.pac...
/shinyapp/shinyapp/syllabus_20.R
no_license
wangzai-c/SyllabusAnalyzer
R
false
false
2,804
r
#install package #install.packages("dplyr") #install.packages("tidytext") #install.packages("textstem") #install.packages("readr") #install.packages("text2vec") #install.packages("stringr") #install.packages("magrittr") #install.packages("stopwords") #install.packages("textstem") #install.packages("tm") #install.pac...
library(glmnet) mydata = read.table("./TrainingSet/RF/stomach.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=TRUE) sink('./Model/EN/Classifier/stomach/stomach_081.txt',append=TRU...
/Model/EN/Classifier/stomach/stomach_081.R
no_license
leon1003/QSMART
R
false
false
352
r
library(glmnet) mydata = read.table("./TrainingSet/RF/stomach.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=TRUE) sink('./Model/EN/Classifier/stomach/stomach_081.txt',append=TRU...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/raws_leaflet.R \name{raws_leaflet} \alias{raws_leaflet} \title{Create a map of RAWS stations} \usage{ raws_leaflet( meta = NULL, radius = 3.5, stroke = TRUE, color = "blue", opacity = 0.5, fillColor = "blue", fillOpacity = 0.5, ...
/man/raws_leaflet.Rd
no_license
mgjust/RAWSmet
R
false
true
1,343
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/raws_leaflet.R \name{raws_leaflet} \alias{raws_leaflet} \title{Create a map of RAWS stations} \usage{ raws_leaflet( meta = NULL, radius = 3.5, stroke = TRUE, color = "blue", opacity = 0.5, fillColor = "blue", fillOpacity = 0.5, ...
library(dplyr) library(data.table) library(readxl) library(ggplot2) library(ggthemes) library(forcats) # Archivos ---- file_cct <- "D:/jmendoza.INEE/Desktop/r_wd/catalogo_centros_trabajo/cct.csv" file_loc <- "D:/jmendoza.INEE/Desktop/r_wd/pueblos_hablantes/catalogo_de_localidades_indigenas_2010.xlsx" file_ce...
/cct_localidades.R
no_license
jboscomendoza/rpubs
R
false
false
1,765
r
library(dplyr) library(data.table) library(readxl) library(ggplot2) library(ggthemes) library(forcats) # Archivos ---- file_cct <- "D:/jmendoza.INEE/Desktop/r_wd/catalogo_centros_trabajo/cct.csv" file_loc <- "D:/jmendoza.INEE/Desktop/r_wd/pueblos_hablantes/catalogo_de_localidades_indigenas_2010.xlsx" file_ce...
## Put comments here that give an overall description of what your ## functions do # makeCacheMatrix receives a matrix as an input, sets the value of the matrix, # gets the value of the matrix, sets the inverse Matrix and get it. # The matrix object can cache its own object. # The '<<-' operator is used to assign a...
/cacheMatrix.R
no_license
gmaldonado23/ProgrammingAssignment2
R
false
false
1,790
r
## Put comments here that give an overall description of what your ## functions do # makeCacheMatrix receives a matrix as an input, sets the value of the matrix, # gets the value of the matrix, sets the inverse Matrix and get it. # The matrix object can cache its own object. # The '<<-' operator is used to assign a...
sapevom<-function(criteriaEvaluations, alternativesEvaluations){ if(!inherits(criteriaEvaluations, "list")) stop("criteriaEvaluations must be a list") if(!all(sapply(criteriaEvaluations, is.matrix))) stop("criteriaEvaluations must be a list of matrices") if(!all(sapply(criteriaEvaluations, diag)=...
/R/sapevom.R
no_license
cran/sapevom
R
false
false
3,275
r
sapevom<-function(criteriaEvaluations, alternativesEvaluations){ if(!inherits(criteriaEvaluations, "list")) stop("criteriaEvaluations must be a list") if(!all(sapply(criteriaEvaluations, is.matrix))) stop("criteriaEvaluations must be a list of matrices") if(!all(sapply(criteriaEvaluations, diag)=...
#! /usr/bin/env Rscript d<-scan("stdin", quiet=TRUE) cat(min(d), max(d), median(d), mean(d), sd(d), sep="\n") png("fitness_histograma.png") h<-hist(d, breaks = 30, main = "Histograma del mejor fitness de cada ejecución para CH04", xlab = "Mejor fitness", ylab = "Frecuencia de ejecuciones") xfit<-seq(min(d)-3000,ma...
/mmmm_fitness.r
no_license
bryant1410/trsh
R
false
false
463
r
#! /usr/bin/env Rscript d<-scan("stdin", quiet=TRUE) cat(min(d), max(d), median(d), mean(d), sd(d), sep="\n") png("fitness_histograma.png") h<-hist(d, breaks = 30, main = "Histograma del mejor fitness de cada ejecución para CH04", xlab = "Mejor fitness", ylab = "Frecuencia de ejecuciones") xfit<-seq(min(d)-3000,ma...
##oos launch ##for using the test_prior function ################################ ##author:USERNAME ##date: 3/30/2017 ##Had to recover 6/5, not re-built for new system # # rm(list=ls()) os <- .Platform$OS.type if (os=="windows") { lib_path <- "FILEPATH" j<- "FILEPATH" h<-"FILEPATH" } else { ...
/risk_factors_code/metab_cholesterol/covariate_selection_code/launch_oos.R
no_license
Nermin-Ghith/ihme-modeling
R
false
false
3,319
r
##oos launch ##for using the test_prior function ################################ ##author:USERNAME ##date: 3/30/2017 ##Had to recover 6/5, not re-built for new system # # rm(list=ls()) os <- .Platform$OS.type if (os=="windows") { lib_path <- "FILEPATH" j<- "FILEPATH" h<-"FILEPATH" } else { ...
library(shiny) library(ComplexHeatmap) library(circlize) server <- function(input, output, session){ # file upload filedata <- reactive({ infile <- input$filename if (is.null(infile)){ return(NULL) } read.csv(infile$datapath,sep = ",", header = T, row.names = 1) }) # choose the max ...
/ComplexHeatmap/server.R
no_license
jonason91/Shiny
R
false
false
5,678
r
library(shiny) library(ComplexHeatmap) library(circlize) server <- function(input, output, session){ # file upload filedata <- reactive({ infile <- input$filename if (is.null(infile)){ return(NULL) } read.csv(infile$datapath,sep = ",", header = T, row.names = 1) }) # choose the max ...
#' Start a New Biostatistics project #' #' Creates a directory with the essential files for a new project. #' The function can be used on existing project directories as well. #' This is a thin wrapper for `starter::create_project()` that #' sets the default template to `template = hotfun::project_template` #' #' @para...
/R/create_biostat_project.R
permissive
jfontestad/bstfun
R
false
false
2,340
r
#' Start a New Biostatistics project #' #' Creates a directory with the essential files for a new project. #' The function can be used on existing project directories as well. #' This is a thin wrapper for `starter::create_project()` that #' sets the default template to `template = hotfun::project_template` #' #' @para...
#Loaad dplyr package library(dplyr) # Import and read csv MechaCar_mpg_table <- read.csv(file='MechaCar_mpg.csv') # Perform linear regression lm(mpg ~ vehicle_length + vehicle_weight + spoiler_angle + ground_clearance +AWD, data= MechaCar_mpg_table) # Create Summary summary(lm(mpg ~ vehicle_length + vehicl...
/MechaCarChallenge.R
no_license
Pandas-Friend/MechaCar_Statistical_Analysis
R
false
false
853
r
#Loaad dplyr package library(dplyr) # Import and read csv MechaCar_mpg_table <- read.csv(file='MechaCar_mpg.csv') # Perform linear regression lm(mpg ~ vehicle_length + vehicle_weight + spoiler_angle + ground_clearance +AWD, data= MechaCar_mpg_table) # Create Summary summary(lm(mpg ~ vehicle_length + vehicl...
library(tidyverse) library(Biostrings) # set query and genome genome_path <- "~/Genomes/Reptiles/Aipysurus_laevis/kmer_49.pilon_x2.sorted.fasta" query_repeat <- "~/Analysis/Snake/HT_Workflow/Proto2-Snek/Proto2-Snek.fasta" # perform blastn search blastn <- read_tsv(system(paste0("blastn -num_threads 4 -dust yes -query...
/coverage_plotter.R
no_license
jamesdgalbraith/ElapidRepeats
R
false
false
2,923
r
library(tidyverse) library(Biostrings) # set query and genome genome_path <- "~/Genomes/Reptiles/Aipysurus_laevis/kmer_49.pilon_x2.sorted.fasta" query_repeat <- "~/Analysis/Snake/HT_Workflow/Proto2-Snek/Proto2-Snek.fasta" # perform blastn search blastn <- read_tsv(system(paste0("blastn -num_threads 4 -dust yes -query...
source("DataPrep.R") png(filename = "plot2.png", width = 480, height = 480, units = "px", bg = "transparent") plot(DateTime, Global_active_power, type = "l", xlab = "", ylab = "Global Active Power (kilowatts)") dev.off()
/Plot 2.R
no_license
GOliveira10/ExData_Plotting1
R
false
false
245
r
source("DataPrep.R") png(filename = "plot2.png", width = 480, height = 480, units = "px", bg = "transparent") plot(DateTime, Global_active_power, type = "l", xlab = "", ylab = "Global Active Power (kilowatts)") dev.off()
#' @@slot: document the slots of a S4 class. #' #' Many S4 slots are considered internal implementation details, so slots #' (unlike params) are not documented by default. You can use the \code{@@slot} #' and \code{@@autoSlots} tags to document them. An example of the output is #' include below. #' #' If a name but no ...
/R/tag-slot.r
no_license
kashenfelter/roxygen3
R
false
false
2,551
r
#' @@slot: document the slots of a S4 class. #' #' Many S4 slots are considered internal implementation details, so slots #' (unlike params) are not documented by default. You can use the \code{@@slot} #' and \code{@@autoSlots} tags to document them. An example of the output is #' include below. #' #' If a name but no ...
############################################################################## # title : Pest_maps.R; # purpose : Map insect injury data from PRISM; # producer : prepared by A. Sparks; # last update : in Los Baños, Philippines, Nov. 2014; # inputs : Aggregated PRISM data; # outputs : M...
/National Map Scripts/Pest_maps.R
no_license
prabinrs/PRISM-Crop-Health-Data-Filter-and-Visualize
R
false
false
8,455
r
############################################################################## # title : Pest_maps.R; # purpose : Map insect injury data from PRISM; # producer : prepared by A. Sparks; # last update : in Los Baños, Philippines, Nov. 2014; # inputs : Aggregated PRISM data; # outputs : M...
\name{pis.fit.boots} \alias{pis.fit.boots} \title{Bootstrap estimates of the output in \code{pis.fit}} \description{ This function creates bootstrap estimates of the output of \code{pis.fit} by creating bootstrap samples } \usage{ pis.fit.boots(data,postinfect=c("LN","WB","GM"),theta,n.boots=1000,collective=100)...
/man/pis.fit.boots.Rd
no_license
cran/postinfectious
R
false
false
1,937
rd
\name{pis.fit.boots} \alias{pis.fit.boots} \title{Bootstrap estimates of the output in \code{pis.fit}} \description{ This function creates bootstrap estimates of the output of \code{pis.fit} by creating bootstrap samples } \usage{ pis.fit.boots(data,postinfect=c("LN","WB","GM"),theta,n.boots=1000,collective=100)...
DAAGtheme <- function (fontsize = list(text = 10, points = 6), box = "gray40", sides = list(tck = 0.6, pad1 = 0.75, pad2 = 0.75), ...) { theme <- list(axis.line = list(alpha = 1, col = box, fill = "transparent", lty = 1, lwd = 0.5), strip.border = list(alpha = 1, col = rep(box, 6), lty...
/R/DAAGtheme.R
no_license
cran/DAAG
R
false
false
669
r
DAAGtheme <- function (fontsize = list(text = 10, points = 6), box = "gray40", sides = list(tck = 0.6, pad1 = 0.75, pad2 = 0.75), ...) { theme <- list(axis.line = list(alpha = 1, col = box, fill = "transparent", lty = 1, lwd = 0.5), strip.border = list(alpha = 1, col = rep(box, 6), lty...
# function printing a ggplot2 graph to a png file plot2png <- function(theplot, name, ...) { name <- paste0(name, ".png") png(filename=name) print(theplot) dev.off() } #plotting function
/ExploratoryAnalysis/Project2/plot2png.R
no_license
mmbsow/Coursera_DataScience_Spe
R
false
false
203
r
# function printing a ggplot2 graph to a png file plot2png <- function(theplot, name, ...) { name <- paste0(name, ".png") png(filename=name) print(theplot) dev.off() } #plotting function
all_arch_data <- NA for(vine_id in 1:9){ temp_arch <- read_csv(paste0("input/architecture/kiwimac_data_vine", vine_id, ".csv")) %>% mutate(ShootUUID = ifelse(!is.na(to_shoot_id), paste(vine_id, to_shoot_id, sep = "-"), NA), CaneUUID = ifelse(!is.na(cane_id), paste(vine_id, cane_id, sep = "-"), NA),...
/code/data_import/architecture_data_import_and_merge.R
no_license
KKRichards/kiwifruit-graph-theory
R
false
false
2,045
r
all_arch_data <- NA for(vine_id in 1:9){ temp_arch <- read_csv(paste0("input/architecture/kiwimac_data_vine", vine_id, ".csv")) %>% mutate(ShootUUID = ifelse(!is.na(to_shoot_id), paste(vine_id, to_shoot_id, sep = "-"), NA), CaneUUID = ifelse(!is.na(cane_id), paste(vine_id, cane_id, sep = "-"), NA),...
testlist <- list(Beta = 0, CVLinf = -1.37672045511449e-268, FM = 3.81959242373749e-313, L50 = 0, L95 = 0, LenBins = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), LenMids = numeric(0), Linf = 0, MK = 0, Ml = numeric(0), Prob = structure(0, .Dim = c(1L, 1L)), SL50 = 1.3899...
/DLMtool/inst/testfiles/LBSPRgen/AFL_LBSPRgen/LBSPRgen_valgrind_files/1615828019-test.R
no_license
akhikolla/updatedatatype-list2
R
false
false
487
r
testlist <- list(Beta = 0, CVLinf = -1.37672045511449e-268, FM = 3.81959242373749e-313, L50 = 0, L95 = 0, LenBins = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), LenMids = numeric(0), Linf = 0, MK = 0, Ml = numeric(0), Prob = structure(0, .Dim = c(1L, 1L)), SL50 = 1.3899...
# Introduction ## ══════════════ # • Learning objectives: ## • Learn the R formula interface ## • Specify factor contrasts to test specific hypotheses ## • Perform model comparisons ## • Run and interpret variety of regression models in R ## Set working directory ## ───────────────────────── ## ...
/linear_regression.R
no_license
steviekwonder/Linear-Regression-Exercise
R
false
false
9,524
r
# Introduction ## ══════════════ # • Learning objectives: ## • Learn the R formula interface ## • Specify factor contrasts to test specific hypotheses ## • Perform model comparisons ## • Run and interpret variety of regression models in R ## Set working directory ## ───────────────────────── ## ...
# Setting ----------------------------------------------------------------- source("config/config_pj.R") data_raw <- fread("data/processed/bombing.csv") data_raw[, msndate := ymd(msndate)] # Class varid = c("thor_data_viet_id", "id", "sourceid", "sourcerecord") varclass <- lapply(data_raw, class) %>% unlist() %>% ...
/archives/old_code.R
no_license
hoanghapham/vietnam_war_bombing
R
false
false
10,883
r
# Setting ----------------------------------------------------------------- source("config/config_pj.R") data_raw <- fread("data/processed/bombing.csv") data_raw[, msndate := ymd(msndate)] # Class varid = c("thor_data_viet_id", "id", "sourceid", "sourcerecord") varclass <- lapply(data_raw, class) %>% unlist() %>% ...
testlist <- list(a = 0L, b = 0L, x = c(905969664L, 0L, 0L, 0L)) result <- do.call(grattan:::anyOutside,testlist) str(result)
/grattan/inst/testfiles/anyOutside/libFuzzer_anyOutside/anyOutside_valgrind_files/1610131064-test.R
no_license
akhikolla/updated-only-Issues
R
false
false
124
r
testlist <- list(a = 0L, b = 0L, x = c(905969664L, 0L, 0L, 0L)) result <- do.call(grattan:::anyOutside,testlist) str(result)
language_graphs( lang_data = get_language_data(key_topics = c("biology", "conservation", "ecology")), no_return = 15, key_topics = c("biology", "conservation", "ecology") )
/inst/examples/language_graphs.R
no_license
benjaminschwetz/litsearchr
R
false
false
179
r
language_graphs( lang_data = get_language_data(key_topics = c("biology", "conservation", "ecology")), no_return = 15, key_topics = c("biology", "conservation", "ecology") )
format_range = function(item) { l = item$lower u = item$upper str = sprintf("%s%s, %s%s", if (is.finite(l)) "[" else "(", if (is.finite(l)) c(l, l) else c("-\\infty", "-Inf"), if (is.finite(u)) c(u, u) else c("\\infty", "Inf"), if (is.finite(u)) "]" else ")") paste0("\\eqn{", str[1L], "}{", str...
/R/helper.R
no_license
damirpolat/mlr3cluster
R
false
false
333
r
format_range = function(item) { l = item$lower u = item$upper str = sprintf("%s%s, %s%s", if (is.finite(l)) "[" else "(", if (is.finite(l)) c(l, l) else c("-\\infty", "-Inf"), if (is.finite(u)) c(u, u) else c("\\infty", "Inf"), if (is.finite(u)) "]" else ")") paste0("\\eqn{", str[1L], "}{", str...
get_nonspecial_terms <- function(formula) { trms <- terms(formula, specials="poly.shrink") trms_labels <- attr(trms, "term.labels") is_response <- attr(trms, "response") special_idxs <- attr(trms, "specials")$poly.shrink if(length(special_idxs) == length(trms_labels)) { resp_nm <- .get_response_name(formu...
/formula_parsers.R
no_license
madrury/poly-ridge-regressor
R
false
false
1,501
r
get_nonspecial_terms <- function(formula) { trms <- terms(formula, specials="poly.shrink") trms_labels <- attr(trms, "term.labels") is_response <- attr(trms, "response") special_idxs <- attr(trms, "specials")$poly.shrink if(length(special_idxs) == length(trms_labels)) { resp_nm <- .get_response_name(formu...
# Jinliang Yang # extract reads from bam file # updated: 8/29/2014 ############# extractReads <- function(pwd="", sh="my_program.sh", bedfile="~/DBcenter/CB_FROs/fro_arabidopsis.fasta", bamfiles=c("Bri-57-1_GTCCGC.trimmed.fq", "CB_CCGTCC.trimmed.fq")){ setwd(pwd)...
/lib/extractReads.R
permissive
jyanglab/bd_cold
R
false
false
1,159
r
# Jinliang Yang # extract reads from bam file # updated: 8/29/2014 ############# extractReads <- function(pwd="", sh="my_program.sh", bedfile="~/DBcenter/CB_FROs/fro_arabidopsis.fasta", bamfiles=c("Bri-57-1_GTCCGC.trimmed.fq", "CB_CCGTCC.trimmed.fq")){ setwd(pwd)...
# # Get a coronal slice with overlaid contour of the mask for the specific slice index in all temporal images. # temporal_coronal_with_overlay <- function(coronal_slice_index, images, masks, label, window_min, window_max) { # Extract the 2D images and masks. slices <- lapply(images, function(img, slc) img[,slc,...
/R/registration_utilities.R
permissive
InsightSoftwareConsortium/SimpleITK-Notebooks
R
false
false
4,101
r
# # Get a coronal slice with overlaid contour of the mask for the specific slice index in all temporal images. # temporal_coronal_with_overlay <- function(coronal_slice_index, images, masks, label, window_min, window_max) { # Extract the 2D images and masks. slices <- lapply(images, function(img, slc) img[,slc,...
##################### Getting the Data####################### PackageList =c('MASS','gbm','tree','randomForest','rpart','caret','ROCR','readxl','data.table','R.utils') NewPackages=PackageList[!(PackageList %in% installed.packages()[,"Package"])] if(length(NewPackages)) install.packages(N...
/homework3/Q1_StarterScript.R
no_license
nmatare/machine_learning
R
false
false
3,792
r
##################### Getting the Data####################### PackageList =c('MASS','gbm','tree','randomForest','rpart','caret','ROCR','readxl','data.table','R.utils') NewPackages=PackageList[!(PackageList %in% installed.packages()[,"Package"])] if(length(NewPackages)) install.packages(N...
pollutantmean <- function(directory, pollutant, id = 1:332) { ## 'directory' is a character vector of length 1 indicating ## the location of the CSV files ## 'pollutant' is a character vector of length 1 indicating ## the name of the pollutant for which we will calculate the ## mean; either "sulfate" or "n...
/R prog/W2/R prog/specdata/pollutantmean.R
no_license
petruf/datasciencecoursera
R
false
false
758
r
pollutantmean <- function(directory, pollutant, id = 1:332) { ## 'directory' is a character vector of length 1 indicating ## the location of the CSV files ## 'pollutant' is a character vector of length 1 indicating ## the name of the pollutant for which we will calculate the ## mean; either "sulfate" or "n...
# TODO Could be an exported function order_around_position <- function(data, col, position, decreasing_before, decreasing_after){ # Check arguments #### assert_collection <- checkmate::makeAssertCollection() checkmate::assert_data_frame(data, min.rows = 2, add = assert_collection) checkmate::assert_string(co...
/R/order_around_position.R
permissive
Ravindra-Raut/rearrr
R
false
false
1,611
r
# TODO Could be an exported function order_around_position <- function(data, col, position, decreasing_before, decreasing_after){ # Check arguments #### assert_collection <- checkmate::makeAssertCollection() checkmate::assert_data_frame(data, min.rows = 2, add = assert_collection) checkmate::assert_string(co...
\name{H.mean} \alias{H.mean} \title{Harmonic mean} \description{Calculates the harmonic mean.} \usage{H.mean(x)} \arguments{ \item{x}{Vector of quantitative data.} } \value{ Returns the harmonic mean. } \seealso{\code{\link{G.mean}}, \code{\link{HL.mean}}} \author{Ken Aho} \examples{ x<-c(2,1,4,5,6,2.4,...
/man/H.mean.Rd
no_license
cran/asbio
R
false
false
360
rd
\name{H.mean} \alias{H.mean} \title{Harmonic mean} \description{Calculates the harmonic mean.} \usage{H.mean(x)} \arguments{ \item{x}{Vector of quantitative data.} } \value{ Returns the harmonic mean. } \seealso{\code{\link{G.mean}}, \code{\link{HL.mean}}} \author{Ken Aho} \examples{ x<-c(2,1,4,5,6,2.4,...
#------------------------------------------------------------------------------- # This is the non-interactive PE Calculator script used by Condor. # It takes no arguments but a counterparty environment variable and outputs # its results to a pdf picture file. #---------------------------------------------------------...
/R Extension/RMG/Energy/VaR/PE/Condor/PECalculatorCondor.R
no_license
uhasan1/QLExtension-backup
R
false
false
1,868
r
#------------------------------------------------------------------------------- # This is the non-interactive PE Calculator script used by Condor. # It takes no arguments but a counterparty environment variable and outputs # its results to a pdf picture file. #---------------------------------------------------------...
library(nnet) dataset_path<-"~/ParkinsonBayes/dataset_real2_elastic_loocv_logbyT/dataset_real2_loocv.rds" result_path<-"~/ParkinsonBayes/dataset_real2_elastic_loocv_logbyT/" ##################################################################### setwd(result_path) one_dataset<-readRDS(dataset_path) dataset <- one_datase...
/Codes for ML models/dataset_real2_elastic_loocv_logbyT/__Rcodes/choose_lambda_alpha.R
no_license
Cm744/Prediction-of-Parkinson-Disease-from-Gut-Microbial-Data
R
false
false
1,737
r
library(nnet) dataset_path<-"~/ParkinsonBayes/dataset_real2_elastic_loocv_logbyT/dataset_real2_loocv.rds" result_path<-"~/ParkinsonBayes/dataset_real2_elastic_loocv_logbyT/" ##################################################################### setwd(result_path) one_dataset<-readRDS(dataset_path) dataset <- one_datase...
# Util functions # # Author: Patrick Flick ############################################################################### # a function that enables LHS list assignments # source1: http://stackoverflow.com/questions/1826519/function-returning-more-than-one-value # source2: https://stat.ethz.ch/pipermail/r-help/200...
/analysis/utils.R
permissive
gattofrancesco/tsppi
R
false
false
765
r
# Util functions # # Author: Patrick Flick ############################################################################### # a function that enables LHS list assignments # source1: http://stackoverflow.com/questions/1826519/function-returning-more-than-one-value # source2: https://stat.ethz.ch/pipermail/r-help/200...
library(TSDT) ### Name: bootstrap ### Title: bootstrap ### Aliases: bootstrap ### ** Examples ## Generate example data frame containing response and treatment N <- 20 x <- data.frame( runif( N ) ) names( x ) <- "response" x$treatment <- factor( sample( c("Control","Experimental"), size = N, p...
/data/genthat_extracted_code/TSDT/examples/bootstrap.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
1,061
r
library(TSDT) ### Name: bootstrap ### Title: bootstrap ### Aliases: bootstrap ### ** Examples ## Generate example data frame containing response and treatment N <- 20 x <- data.frame( runif( N ) ) names( x ) <- "response" x$treatment <- factor( sample( c("Control","Experimental"), size = N, p...
#STREET ART MAP ATHENS - JANUARY 2018 ### load libraries library(leaflet) library(mapview) ### load data df=read.csv2("streetArtUpdate1.csv",stringsAsFactors =F,header = T) ### change coordinates to numeric values df$Longitude=as.numeric(df$Longitude) df$Latitude=as.numeric(df$Latitude) ### create local and remote ...
/streetArtJanMap.R
no_license
PeerChristensen/StreetArtAthens
R
false
false
1,446
r
#STREET ART MAP ATHENS - JANUARY 2018 ### load libraries library(leaflet) library(mapview) ### load data df=read.csv2("streetArtUpdate1.csv",stringsAsFactors =F,header = T) ### change coordinates to numeric values df$Longitude=as.numeric(df$Longitude) df$Latitude=as.numeric(df$Latitude) ### create local and remote ...
wkt <- "POLYGON((13.26349675655365 52.53991761181831,18.36115300655365 54.11445544219924, 21.87677800655365 53.80418956368524,24.68927800655365 54.217364774722455,28.20490300655365 54.320018299365124,30.49005925655365 52.85948216284084,34.70880925655365 52.753220564427814, 35.93927800655365 50.46131871049754,39.6306842...
/tests/testthat/test-wkt_parse.R
permissive
ropensci/rgbif
R
false
false
3,903
r
wkt <- "POLYGON((13.26349675655365 52.53991761181831,18.36115300655365 54.11445544219924, 21.87677800655365 53.80418956368524,24.68927800655365 54.217364774722455,28.20490300655365 54.320018299365124,30.49005925655365 52.85948216284084,34.70880925655365 52.753220564427814, 35.93927800655365 50.46131871049754,39.6306842...
##The functions that I have written cache the inverse of a matrix ##This function takes the argument matrix, and we assume that the matrix we supply here is invertible. We set the value of the matrix, get the value of the matrix, set the value of the inverse and get the value of the inverse makeCacheMatrix <- funct...
/cachematrix.R
no_license
ozairtariq/ProgrammingAssignment2
R
false
false
1,595
r
##The functions that I have written cache the inverse of a matrix ##This function takes the argument matrix, and we assume that the matrix we supply here is invertible. We set the value of the matrix, get the value of the matrix, set the value of the inverse and get the value of the inverse makeCacheMatrix <- funct...
X <- as.matrix(fread("~/development/cvxopt/hwk7/sep3way_data/X.csv")) Y <- as.matrix(fread("~/development/cvxopt/hwk7/sep3way_data/Y.csv")) Z <- as.matrix(fread("~/development/cvxopt/hwk7/sep3way_data/Z.csv")) a1 <- c(0.28329478, 0.16652294); a2 <- c(-0.20192124, 0.18983291); a3 <- c(-0.10444152, -0.30423805) b1 <- 0....
/hwk7/sep3way.R
no_license
PalaceChan/cvxopt
R
false
false
586
r
X <- as.matrix(fread("~/development/cvxopt/hwk7/sep3way_data/X.csv")) Y <- as.matrix(fread("~/development/cvxopt/hwk7/sep3way_data/Y.csv")) Z <- as.matrix(fread("~/development/cvxopt/hwk7/sep3way_data/Z.csv")) a1 <- c(0.28329478, 0.16652294); a2 <- c(-0.20192124, 0.18983291); a3 <- c(-0.10444152, -0.30423805) b1 <- 0....
library(mcsm) ### Name: Braking ### Title: Quadratic regression on the car braking dataset ### Aliases: Braking ### Keywords: hplot ### ** Examples Braking(10^4)
/data/genthat_extracted_code/mcsm/examples/Braking.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
169
r
library(mcsm) ### Name: Braking ### Title: Quadratic regression on the car braking dataset ### Aliases: Braking ### Keywords: hplot ### ** Examples Braking(10^4)
\name{bootstrap_xmin} \alias{bootstrap_xmin} \alias{estimate_xmin} \alias{get_KS_statistic} \title{Estimates the lower bound (xmin)} \usage{ bootstrap_xmin(m, xmins = NULL, pars = NULL, no_of_sims = 100, threads = 1) get_KS_statistic(m) estimate_xmin(m, xmins = NULL, pars = NULL) } \arguments{ \item{threa...
/man/estimate_xmin.Rd
no_license
pmavrodiev/poweRlaw
R
false
false
2,068
rd
\name{bootstrap_xmin} \alias{bootstrap_xmin} \alias{estimate_xmin} \alias{get_KS_statistic} \title{Estimates the lower bound (xmin)} \usage{ bootstrap_xmin(m, xmins = NULL, pars = NULL, no_of_sims = 100, threads = 1) get_KS_statistic(m) estimate_xmin(m, xmins = NULL, pars = NULL) } \arguments{ \item{threa...
#' The application User-Interface #' #' @param request Internal parameter for `{shiny}`. #' DO NOT REMOVE. #' @import shiny #' @noRd app_ui <- function(request) { tagList( # Leave this function for adding external resources golem_add_external_resources(), # Your application UI logic ### the def...
/R/app_ui.R
no_license
taiawu/titanmockup
R
false
false
2,595
r
#' The application User-Interface #' #' @param request Internal parameter for `{shiny}`. #' DO NOT REMOVE. #' @import shiny #' @noRd app_ui <- function(request) { tagList( # Leave this function for adding external resources golem_add_external_resources(), # Your application UI logic ### the def...
install.packages("tidyverse") # Data Wrangling in R # 3.2 Importing CSV Files into R # First, I need to load the tidyverse library(tidyverse) # Convert CO2 from dataframe to tibble CO2 co2_tibble <- as_tibble(CO2) co2_tibble # filter() function of 'tidyverse' package filter(co2_tibble, Type == 'Mississipp...
/Exercise Files/Ch03/03_02/csv_complete.r
no_license
srk-apts/Data-Wrangling-in-R
R
false
false
1,607
r
install.packages("tidyverse") # Data Wrangling in R # 3.2 Importing CSV Files into R # First, I need to load the tidyverse library(tidyverse) # Convert CO2 from dataframe to tibble CO2 co2_tibble <- as_tibble(CO2) co2_tibble # filter() function of 'tidyverse' package filter(co2_tibble, Type == 'Mississipp...
fig06x001<-function(){ mass<-c(5.9,32.0,40.0,51.5,70.0,100.0,78.0,80.0,85.0,85.0, 110.0,115.0,125.0,130.0,120.0,120.0,130.0,135.0,110.0,130.0, 150.0,145.0,150.0,170.0,225.0,145.0,188.0,180.0,197.0,218.0, 300.0,260.0,265.0,250.0,250.0,300.0,320.0,514.0,556.0,840.0, 685.0,700.0,700.0,690.0,900.0,650.0,820.0,850.0,90...
/graphicsforstatistics_2e_figures_scripts_r/Chapter 6/fig06x001.R
no_license
saqibarfeen/coding_time
R
false
false
694
r
fig06x001<-function(){ mass<-c(5.9,32.0,40.0,51.5,70.0,100.0,78.0,80.0,85.0,85.0, 110.0,115.0,125.0,130.0,120.0,120.0,130.0,135.0,110.0,130.0, 150.0,145.0,150.0,170.0,225.0,145.0,188.0,180.0,197.0,218.0, 300.0,260.0,265.0,250.0,250.0,300.0,320.0,514.0,556.0,840.0, 685.0,700.0,700.0,690.0,900.0,650.0,820.0,850.0,90...
# Yige Wu @WashU Apr 2020 ## finding differentially expressed gene for each cell type using integrared object # set up libraries and output directory ----------------------------------- ## getting the path to the current script thisFile <- function() { cmdArgs <- commandArgs(trailingOnly = FALSE) needle <- "--file...
/findmarkers/tumor_vs_normal/findmarker_roc_CPT0075720013_tumor_vs_normalpt_on_katmai.R
no_license
ding-lab/ccRCC_snRNA_analysis
R
false
false
3,539
r
# Yige Wu @WashU Apr 2020 ## finding differentially expressed gene for each cell type using integrared object # set up libraries and output directory ----------------------------------- ## getting the path to the current script thisFile <- function() { cmdArgs <- commandArgs(trailingOnly = FALSE) needle <- "--file...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/LogitFindK.R \name{LogitFindK} \alias{LogitFindK} \title{FUNCTION_TITLE} \usage{ LogitFindK(gbdval, pixelval, weightval, MaxIter = 40, MaxJump = 10, FunTol = 1e-05, approx_0_1) } \arguments{ \item{gbdval}{PARAM_DESCRIPTION} \item{pixelval}...
/mbg/mbg_core_code/mbg_central/LBDCore/man/LogitFindK.Rd
no_license
The-Oxford-GBD-group/typhi_paratyphi_modelling_code
R
false
true
710
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/LogitFindK.R \name{LogitFindK} \alias{LogitFindK} \title{FUNCTION_TITLE} \usage{ LogitFindK(gbdval, pixelval, weightval, MaxIter = 40, MaxJump = 10, FunTol = 1e-05, approx_0_1) } \arguments{ \item{gbdval}{PARAM_DESCRIPTION} \item{pixelval}...
testlist <- list(hi = 0, lo = 5.03946958758071e-322, mu = 0, sig = 0) result <- do.call(gjam:::tnormRcpp,testlist) str(result)
/gjam/inst/testfiles/tnormRcpp/libFuzzer_tnormRcpp/tnormRcpp_valgrind_files/1610047499-test.R
no_license
akhikolla/updated-only-Issues
R
false
false
126
r
testlist <- list(hi = 0, lo = 5.03946958758071e-322, mu = 0, sig = 0) result <- do.call(gjam:::tnormRcpp,testlist) str(result)
#setwd("C:/Users/graha/Dropbox/Graham/documents/GitHub/df2018") # mykey <- "AIzaSyDbTwdfJGvyiPpNJ_VaLj2TvLvimcV7AUQ" #graham packs <- c("dplyr","ggplot2","readr","magrittr","ggmap","lubridate") lapply(packs,library,character.only = TRUE) raw <- readr::read_csv("./data/datafest2018.csv") company <- summarise(...
/graham.R
permissive
gtpash/df2018
R
false
false
2,302
r
#setwd("C:/Users/graha/Dropbox/Graham/documents/GitHub/df2018") # mykey <- "AIzaSyDbTwdfJGvyiPpNJ_VaLj2TvLvimcV7AUQ" #graham packs <- c("dplyr","ggplot2","readr","magrittr","ggmap","lubridate") lapply(packs,library,character.only = TRUE) raw <- readr::read_csv("./data/datafest2018.csv") company <- summarise(...
guide1 <- Cicerone$ new()$ step( el = "viz-wrapper", title = "Visualization", description = HTML("Welcome to the visualization tour. First, let's take a closer look at what the plots are showing. Hit next."), position = "top" )$ step( el = "trendPlot", title = "Plo...
/cicerone.R
no_license
HuckleyLab/RShinyGrasshopper
R
false
false
4,320
r
guide1 <- Cicerone$ new()$ step( el = "viz-wrapper", title = "Visualization", description = HTML("Welcome to the visualization tour. First, let's take a closer look at what the plots are showing. Hit next."), position = "top" )$ step( el = "trendPlot", title = "Plo...
# es-at-https-githu-rdpeng-ProgrammingAssignment2- #R programming assignment2 ## Caching the Inverse of a Matrix: ## Matrix inversion is usually a costly computation and there may be some ## benefit to caching the inverse of a matrix rather than compute it repeatedly. ## Below are a pair of functions that are used to ...
/inverse.R
no_license
vishnupriyaO/es-at-https-githu-rdpeng-ProgrammingAssignment2-
R
false
false
1,298
r
# es-at-https-githu-rdpeng-ProgrammingAssignment2- #R programming assignment2 ## Caching the Inverse of a Matrix: ## Matrix inversion is usually a costly computation and there may be some ## benefit to caching the inverse of a matrix rather than compute it repeatedly. ## Below are a pair of functions that are used to ...
% Generated by roxygen2 (4.0.2): do not edit by hand \name{mordm.extract.attributes} \alias{mordm.extract.attributes} \title{Extracts the common attributes from the time series data.} \usage{ mordm.extract.attributes(data) } \arguments{ \item{data}{the time series data} } \description{ Reads the common attri...
/sup/OpenMORDM Supplemental Material Rev2/OpenMORDM/man/mordm.extract.attributes.Rd
no_license
pedroliman/ie-mordm
R
false
false
414
rd
% Generated by roxygen2 (4.0.2): do not edit by hand \name{mordm.extract.attributes} \alias{mordm.extract.attributes} \title{Extracts the common attributes from the time series data.} \usage{ mordm.extract.attributes(data) } \arguments{ \item{data}{the time series data} } \description{ Reads the common attri...
# a script to summarise snow samples. # takes device magic forms created by the weather station form and the aco ground truth form. # get dependencies library(dplyr) library(readr) library(ggplot2) library(tidyr) ##### get rov coords ##### # get coords converted to itrf 2014 from trx nad84 csrs <- itrf2014 ...
/Cruickshank/plot_avg_trip1.R
no_license
acebulsk/aco_scripts
R
false
false
8,650
r
# a script to summarise snow samples. # takes device magic forms created by the weather station form and the aco ground truth form. # get dependencies library(dplyr) library(readr) library(ggplot2) library(tidyr) ##### get rov coords ##### # get coords converted to itrf 2014 from trx nad84 csrs <- itrf2014 ...
# spamdata <- read.csv("SMSSPAM.csv") spamdata <- read.table("SMSSpamCollection.txt",sep="\t", stringsAsFactors = default.stringsAsFactors(), quote = "") # Preprare training and testing data -------------------------------------- samp <- sample.int(nrow(spamdata),as.integer(nrow(spamdata)*0.2),replace = F) spamTest ...
/Naive Bayes classification.R
no_license
h3luan/Bayesian-machine-learning
R
false
false
2,845
r
# spamdata <- read.csv("SMSSPAM.csv") spamdata <- read.table("SMSSpamCollection.txt",sep="\t", stringsAsFactors = default.stringsAsFactors(), quote = "") # Preprare training and testing data -------------------------------------- samp <- sample.int(nrow(spamdata),as.integer(nrow(spamdata)*0.2),replace = F) spamTest ...