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
caterplot <- function (mcmcout, parms=NULL, regex=NULL, random=NULL, leaf.marker="[\\[_]", quantiles=list(), collapse=TRUE, denstrip = FALSE, add = FALSE, labels=NULL, labels.loc="axis", las = NULL, cex.labels=NULL, greek = FALSE, horizontal=TRUE, val.lim=NULL, lab.lim=NULL, lwd=c(1, 2), pch=16, eps=0.1, width=NULL, co...
/mcmcplots/R/caterplot.R
no_license
mbjoseph/mcmcplots
R
false
false
6,341
r
caterplot <- function (mcmcout, parms=NULL, regex=NULL, random=NULL, leaf.marker="[\\[_]", quantiles=list(), collapse=TRUE, denstrip = FALSE, add = FALSE, labels=NULL, labels.loc="axis", las = NULL, cex.labels=NULL, greek = FALSE, horizontal=TRUE, val.lim=NULL, lab.lim=NULL, lwd=c(1, 2), pch=16, eps=0.1, width=NULL, co...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/optimize-PBN.R \name{bestPartialA} \alias{bestPartialA} \title{Optimize a subset of threshold parameters.} \usage{ bestPartialA(ts.multi, net, g, i, subset) } \arguments{ \item{ts.multi}{A list of timeseries.} \item{net}{A network.} \item{g...
/man/bestPartialA.Rd
no_license
davidkwca/inferTPBN
R
false
true
876
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/optimize-PBN.R \name{bestPartialA} \alias{bestPartialA} \title{Optimize a subset of threshold parameters.} \usage{ bestPartialA(ts.multi, net, g, i, subset) } \arguments{ \item{ts.multi}{A list of timeseries.} \item{net}{A network.} \item{g...
# # 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/ # list.of.packages <- c("shiny","shinythemes","rintrojs","shinycustomloader","plotly","dygrap...
/Narrative Visualisation/ui.R
no_license
abhiGambhir0914/vehicular_stoppages_R_proj
R
false
false
10,816
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/ # list.of.packages <- c("shiny","shinythemes","rintrojs","shinycustomloader","plotly","dygrap...
setwd("/home/colinge/kinase-network") library(SparseM) library(RBGL) library(Rgraphviz) library(plotrix) source("/home/colinge/net-r/expandGraph.R") # Reference PPI network alldb <- read.csv("ppi-20140211.txt",sep="\t",check.names=FALSE,stringsAsFactors=F) l.no.self <- as.vector(alldb[["source"]]) != as.v...
/analysis/kinaseTopology.R
no_license
acesarrazquin/kinase_network
R
false
false
16,870
r
setwd("/home/colinge/kinase-network") library(SparseM) library(RBGL) library(Rgraphviz) library(plotrix) source("/home/colinge/net-r/expandGraph.R") # Reference PPI network alldb <- read.csv("ppi-20140211.txt",sep="\t",check.names=FALSE,stringsAsFactors=F) l.no.self <- as.vector(alldb[["source"]]) != as.v...
# Coronavirus analysis rm(list=ls()) setwd("~/R/coronavirus") # 1.1 Data Source # The data source used for this analysis is the 2019 Novel Coronavirus COVID-19 (2019-nCoV) # Data Repository1 # built the Center for Systems Science and Engineering, Johns Hopkins University. # 1.2 R Packages library(m...
/cor05.R
no_license
Joshuariver/Time-Series-Analysis
R
false
false
10,996
r
# Coronavirus analysis rm(list=ls()) setwd("~/R/coronavirus") # 1.1 Data Source # The data source used for this analysis is the 2019 Novel Coronavirus COVID-19 (2019-nCoV) # Data Repository1 # built the Center for Systems Science and Engineering, Johns Hopkins University. # 1.2 R Packages library(m...
library(rstan) rstan_options(auto_write = TRUE) options(mc.cores = parallel::detectCores()) data <- read_rdump("eight_schools.data.R") fit <- stan(file='v0.stan', data=data, seed = 194838, iter = 1000, warmup = FALSE)
/eight_schools/eight_schools.R
no_license
ganesh-krishnan/glmm-experiments
R
false
false
219
r
library(rstan) rstan_options(auto_write = TRUE) options(mc.cores = parallel::detectCores()) data <- read_rdump("eight_schools.data.R") fit <- stan(file='v0.stan', data=data, seed = 194838, iter = 1000, warmup = FALSE)
library(tidyverse) library(readxl) #####Salinity##### salinity<-readRDS("rds/mean_daily_salinity2010_2018.rds") a<-salinity %>% filter(!date=="2014-03-16") %>% filter(!date=="2014-03-15") %>% filter(!date=="2013-09-30") %>% filter(!date=="2013-10-01") %>% filter(!date=="2013-10-02") %>% filter(!date=="20...
/13_figures_for_manuscript.R
permissive
marinereilly/2018_dominion_report
R
false
false
5,899
r
library(tidyverse) library(readxl) #####Salinity##### salinity<-readRDS("rds/mean_daily_salinity2010_2018.rds") a<-salinity %>% filter(!date=="2014-03-16") %>% filter(!date=="2014-03-15") %>% filter(!date=="2013-09-30") %>% filter(!date=="2013-10-01") %>% filter(!date=="2013-10-02") %>% filter(!date=="20...
## OPENCYTO PACKAGE PROCESSING FACS FILES ######################################### rm(list=ls()) library(openCyto) library(flowCore) ## READ IN T CELL GATING TEMPLATES ################################## tcell.gating.template.control <- gatingTemplate("/home/niclas/Dropbox/facs/flowR/tcellgatingtemplate_control.csv"...
/scripts/openCyto_v1.2.R
no_license
zl6y19/FCS_scripts
R
false
false
5,506
r
## OPENCYTO PACKAGE PROCESSING FACS FILES ######################################### rm(list=ls()) library(openCyto) library(flowCore) ## READ IN T CELL GATING TEMPLATES ################################## tcell.gating.template.control <- gatingTemplate("/home/niclas/Dropbox/facs/flowR/tcellgatingtemplate_control.csv"...
\name{nucleolus} \alias{nucleolus} \title{ Nucleolus} \description{ This function gives the nucleolus described in Schmeidler (1969).} \usage{ nucleolus(characteristic_function, game = c("profit", "cost")) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{characteristic_function}...
/man/nucleolus.Rd
no_license
cran/GameTheoryAllocation
R
false
false
1,203
rd
\name{nucleolus} \alias{nucleolus} \title{ Nucleolus} \description{ This function gives the nucleolus described in Schmeidler (1969).} \usage{ nucleolus(characteristic_function, game = c("profit", "cost")) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{characteristic_function}...
library(Boruta) library(glmnet) library(stringr) library(randomForest) library(MASS) library(geoR) library(car) library(caret) library(DMwR) library(ROSE) library(pROC) library(ROCR) library(plyr) library(mlbench) library(smotefamily) library(readxl) #install.packages("dbscan") #library(formattable) r...
/Thyroid_Public_ReSamplePCABoruta3.R
no_license
hatwib/ThyroidRCode
R
false
false
4,441
r
library(Boruta) library(glmnet) library(stringr) library(randomForest) library(MASS) library(geoR) library(car) library(caret) library(DMwR) library(ROSE) library(pROC) library(ROCR) library(plyr) library(mlbench) library(smotefamily) library(readxl) #install.packages("dbscan") #library(formattable) r...
# Download USGS CAWSC stage and tidally-filtered discharge at Rio Vista Bridge (SRV) #daily mean (bc tidally filtered discharge is only availble for dv retrieval) library(glue) library(dataRetrieval) library(dplyr) library(ggplot2) library(janitor) # get data function - data retrieval is in Pacific Standard Time f_ge...
/scripts/functions/f_get_flow_usgs_11455420.R
no_license
Delta-Stewardship-Council/swg-21-connectivity
R
false
false
991
r
# Download USGS CAWSC stage and tidally-filtered discharge at Rio Vista Bridge (SRV) #daily mean (bc tidally filtered discharge is only availble for dv retrieval) library(glue) library(dataRetrieval) library(dplyr) library(ggplot2) library(janitor) # get data function - data retrieval is in Pacific Standard Time f_ge...
#' The jacobian function to estimate the latent variables #' @inheritParams derivLagrangianLatentVars #' @param Jac an empty jacobian matrix #' @param ... arguments to the jacobian function, currently ignored #' @param distributions,links,compositional,data,meanVarTrends,offsets,numVars,numSets,paramMats,paramEsts,varP...
/R/deriv2LagrangianLatentVars.R
no_license
CenterForStatistics-UGent/combi
R
false
false
1,471
r
#' The jacobian function to estimate the latent variables #' @inheritParams derivLagrangianLatentVars #' @param Jac an empty jacobian matrix #' @param ... arguments to the jacobian function, currently ignored #' @param distributions,links,compositional,data,meanVarTrends,offsets,numVars,numSets,paramMats,paramEsts,varP...
calc_HMM_class_probs_given_log_obs_probs <- function(T, S, log_obs_probs, log_initial_state_distn, log_trans_matrix, log = FALSE) { # S is the number of elements in the state space # initial_state_distn is a vector of length S containing the probability distribution for the initial state of the hidden Markov chain ...
/R/calcHMMClassProbs.R
no_license
elray1/PACwithDDM
R
false
false
4,819
r
calc_HMM_class_probs_given_log_obs_probs <- function(T, S, log_obs_probs, log_initial_state_distn, log_trans_matrix, log = FALSE) { # S is the number of elements in the state space # initial_state_distn is a vector of length S containing the probability distribution for the initial state of the hidden Markov chain ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/CyclopsSettings.R \name{setLassoLogisticRegression} \alias{setLassoLogisticRegression} \title{Create setting for lasso logistic regression} \usage{ setLassoLogisticRegression( variance = 0.01, seed = NULL, includeCovariateIds = c(), n...
/man/setLassoLogisticRegression.Rd
permissive
anthonysena/PatientLevelPrediction
R
false
true
1,452
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/CyclopsSettings.R \name{setLassoLogisticRegression} \alias{setLassoLogisticRegression} \title{Create setting for lasso logistic regression} \usage{ setLassoLogisticRegression( variance = 0.01, seed = NULL, includeCovariateIds = c(), n...
# Run idealstan model on the combined dataset # Create a severity index from the policies # Robert Kubinec # April 4th, 2020 require(idealstan) require(ggplot2) require(tidyr) require(dplyr) require(lubridate) # load cleaned file clean <- readRDS("data/CoronaNet/coranaNetData_clean.rds") %>% filter(Finished,valid...
/RCode/run_severity_index.R
no_license
joanbarcelosoler/corona_tscs
R
false
false
2,511
r
# Run idealstan model on the combined dataset # Create a severity index from the policies # Robert Kubinec # April 4th, 2020 require(idealstan) require(ggplot2) require(tidyr) require(dplyr) require(lubridate) # load cleaned file clean <- readRDS("data/CoronaNet/coranaNetData_clean.rds") %>% filter(Finished,valid...
library(tfestimators) mtcars_input_fn <- function(data) { input_fn(data, features = c("disp", "cyl"), response = "mpg") } cols <- feature_columns( column_numeric("disp", "cyl") ) model <- linear_regressor(feature_columns = cols) indices <- sample(1:nrow(mtcars), size = 0.80 * nrow(mtcars))...
/dev/mtcars/r/model.R
no_license
dfalbel/cloudml
R
false
false
376
r
library(tfestimators) mtcars_input_fn <- function(data) { input_fn(data, features = c("disp", "cyl"), response = "mpg") } cols <- feature_columns( column_numeric("disp", "cyl") ) model <- linear_regressor(feature_columns = cols) indices <- sample(1:nrow(mtcars), size = 0.80 * nrow(mtcars))...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/analyse-penalty.R \name{analyse_penalty} \alias{analyse_penalty} \title{Penalty analysis of sensory data} \usage{ analyse_penalty(.data, reference_value) } \arguments{ \item{.data}{a sensory table} \item{reference_value}{a score used as JAR ...
/man/analyse_penalty.Rd
permissive
ZucaRol/sensehubr
R
false
true
639
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/analyse-penalty.R \name{analyse_penalty} \alias{analyse_penalty} \title{Penalty analysis of sensory data} \usage{ analyse_penalty(.data, reference_value) } \arguments{ \item{.data}{a sensory table} \item{reference_value}{a score used as JAR ...
rm(list=ls()) #library(tidyverse) library(sf) library(raster) library(lubridate) library(tmap) library(fasterize) library(tidyverse) library(rgdal) library(grid) library(gridExtra) ## define data directory datadir <- '/Users/dhardy/Dropbox/r_data/sapelo' ## import community boundaries df <- st_read(file.path(datadir...
/scripts/hh.v.rb-inundation-figure.R
no_license
deanhardy/sapelo
R
false
false
2,935
r
rm(list=ls()) #library(tidyverse) library(sf) library(raster) library(lubridate) library(tmap) library(fasterize) library(tidyverse) library(rgdal) library(grid) library(gridExtra) ## define data directory datadir <- '/Users/dhardy/Dropbox/r_data/sapelo' ## import community boundaries df <- st_read(file.path(datadir...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/storagegateway_operations.R \name{storagegateway_create_storedi_scsi_volume} \alias{storagegateway_create_storedi_scsi_volume} \title{Creates a volume on a specified gateway} \usage{ storagegateway_create_storedi_scsi_volume( GatewayARN, ...
/cran/paws.storage/man/storagegateway_create_storedi_scsi_volume.Rd
permissive
paws-r/paws
R
false
true
3,343
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/storagegateway_operations.R \name{storagegateway_create_storedi_scsi_volume} \alias{storagegateway_create_storedi_scsi_volume} \title{Creates a volume on a specified gateway} \usage{ storagegateway_create_storedi_scsi_volume( GatewayARN, ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/linearReg.R \name{summary_linearReg} \alias{summary_linearReg} \title{Print the summary of the linear model} \usage{ summary_linearReg(lm) } \arguments{ \item{lm}{The object returned by the function linearReg.} } \value{ F-statistic of the fi...
/man/summary_linearReg.Rd
permissive
LitianZhou/linearReg
R
false
true
658
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/linearReg.R \name{summary_linearReg} \alias{summary_linearReg} \title{Print the summary of the linear model} \usage{ summary_linearReg(lm) } \arguments{ \item{lm}{The object returned by the function linearReg.} } \value{ F-statistic of the fi...
outlierKD <- function(dt, var) { var_name <- eval(substitute(var),eval(dt)) na1 <- sum(is.na(var_name)) m1 <- mean(var_name, na.rm = T) par(mfrow=c(2, 2), oma=c(0,0,3,0)) boxplot(var_name, main="With outliers") hist(var_name, main="With outliers", xlab=NA, ylab=NA) outlie...
/Outliers.R
no_license
sandeshregmi/Machine_Learning_In_R
R
false
false
1,497
r
outlierKD <- function(dt, var) { var_name <- eval(substitute(var),eval(dt)) na1 <- sum(is.na(var_name)) m1 <- mean(var_name, na.rm = T) par(mfrow=c(2, 2), oma=c(0,0,3,0)) boxplot(var_name, main="With outliers") hist(var_name, main="With outliers", xlab=NA, ylab=NA) outlie...
# Load the keras library needed for the entirety of this script library(keras) #### Generate Data #### # Set the seed for reproducibility set.seed(17) # Specify the number of samples (this can be changed later) n_sample <- 1000 # Create a (n_sample x 1) matrix where the values are # integers between [0,...
/5_deep_learning/mnist_live.R
no_license
PhilChodrow/cos_2018
R
false
false
1,964
r
# Load the keras library needed for the entirety of this script library(keras) #### Generate Data #### # Set the seed for reproducibility set.seed(17) # Specify the number of samples (this can be changed later) n_sample <- 1000 # Create a (n_sample x 1) matrix where the values are # integers between [0,...
\name{Omega} \alias{Omega} \title{calculate Omega for a return series} \usage{ Omega(R, L = 0, method = c("simple", "interp", "binomial", "blackscholes"), output = c("point", "full"), Rf = 0, ...) } \arguments{ \item{R}{an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns} \item{L}{L i...
/man/Omega.Rd
no_license
guillermozbta/portafolio-master
R
false
false
3,328
rd
\name{Omega} \alias{Omega} \title{calculate Omega for a return series} \usage{ Omega(R, L = 0, method = c("simple", "interp", "binomial", "blackscholes"), output = c("point", "full"), Rf = 0, ...) } \arguments{ \item{R}{an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns} \item{L}{L i...
testlist <- list(A = structure(NaN, .Dim = c(1L, 1L)), B = structure(0, .Dim = c(1L, 1L))) result <- do.call(multivariance:::match_rows,testlist) str(result)
/multivariance/inst/testfiles/match_rows/AFL_match_rows/match_rows_valgrind_files/1613108471-test.R
no_license
akhikolla/updatedatatype-list3
R
false
false
158
r
testlist <- list(A = structure(NaN, .Dim = c(1L, 1L)), B = structure(0, .Dim = c(1L, 1L))) result <- do.call(multivariance:::match_rows,testlist) str(result)
library("crayon", lib.loc = "/exports/csce/eddie/inf/groups/mamode_prendergast/R_packages/") library("rstudioapi", lib.loc = "/exports/csce/eddie/inf/groups/mamode_prendergast/R_packages/") library("cli", lib.loc = "/exports/csce/eddie/inf/groups/mamode_prendergast/R_packages/") library("withr", lib.loc = "/exports/csc...
/old/caret_parrallel_v4.R
permissive
HIM003/edinburgh-university-dissertation
R
false
false
4,892
r
library("crayon", lib.loc = "/exports/csce/eddie/inf/groups/mamode_prendergast/R_packages/") library("rstudioapi", lib.loc = "/exports/csce/eddie/inf/groups/mamode_prendergast/R_packages/") library("cli", lib.loc = "/exports/csce/eddie/inf/groups/mamode_prendergast/R_packages/") library("withr", lib.loc = "/exports/csc...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/helpers-survey-code.R \name{multipaged_ui} \alias{multipaged_ui} \title{Place survey questions on multiple pages} \usage{ multipaged_ui(df) } \arguments{ \item{df}{The data frame of questions supplied by the user} } \value{ UI for all pages }...
/man/multipaged_ui.Rd
no_license
echole2022/shinysurveys-2
R
false
true
397
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/helpers-survey-code.R \name{multipaged_ui} \alias{multipaged_ui} \title{Place survey questions on multiple pages} \usage{ multipaged_ui(df) } \arguments{ \item{df}{The data frame of questions supplied by the user} } \value{ UI for all pages }...
############################################################################## ### ### MST ### ### Generate Main Confluence OR ### ############################################################################## ### Copyright (c) 2015-2018, The TRONCO Team (www.troncopackage.org) ### email: tronco@disco.unimib.it ### All...
/experiment_1/generate.main_confluence_OR.R
no_license
BIMIB-DISCo/MST
R
false
false
3,152
r
############################################################################## ### ### MST ### ### Generate Main Confluence OR ### ############################################################################## ### Copyright (c) 2015-2018, The TRONCO Team (www.troncopackage.org) ### email: tronco@disco.unimib.it ### All...
% Generated by roxygen2 (4.0.1): do not edit by hand \docType{methods} \name{RasterLayerNamed} \alias{RasterLayerNamed} \alias{RasterLayerNamed,RasterLayer-method} \title{Create a new \code{RasterLayerNamed} object.} \usage{ RasterLayerNamed(..., name) \S4method{RasterLayerNamed}{RasterLayer}(..., name) } \arguments{ ...
/SpaDES-master/man/RasterLayerNamed-method.Rd
no_license
B-Ron12/RCodeSK
R
false
false
622
rd
% Generated by roxygen2 (4.0.1): do not edit by hand \docType{methods} \name{RasterLayerNamed} \alias{RasterLayerNamed} \alias{RasterLayerNamed,RasterLayer-method} \title{Create a new \code{RasterLayerNamed} object.} \usage{ RasterLayerNamed(..., name) \S4method{RasterLayerNamed}{RasterLayer}(..., name) } \arguments{ ...
expected_values[[runno]] <- list(lik = c(-12120.74, 24251.49, 24280.14), param = c(1.3665, 4.206, 0.19789), stdev_param = c(0.30287, 0.26988, NA), sigma = c(prop.err = 0.19789), parFixedDf = structure(list(Estimate = c(lCl = 1.36646703835103, lVc = 4.2059673004377, prop.err = 0.1978873796565), SE = c(lCl = 0...
/inst/models/values-1.1.1.3-U001_focei-unix.R
no_license
nlmixrdevelopment/nlmixr.examples
R
false
false
1,438
r
expected_values[[runno]] <- list(lik = c(-12120.74, 24251.49, 24280.14), param = c(1.3665, 4.206, 0.19789), stdev_param = c(0.30287, 0.26988, NA), sigma = c(prop.err = 0.19789), parFixedDf = structure(list(Estimate = c(lCl = 1.36646703835103, lVc = 4.2059673004377, prop.err = 0.1978873796565), SE = c(lCl = 0...
################################## # 10_DNA.shape.prediction.R ################################# library(MASS) library(ggplot2) library(dplyr) summary.merge <- read.table(paste("results/", "summary_overlap.anno.bed", sep=""), header=TRUE) summary.merge.crop <- summary.merge[,3:6] summary.merge.crop$star...
/code/09_DNA.shape.prediction.R
no_license
saneglaz/shape-screen
R
false
false
5,887
r
################################## # 10_DNA.shape.prediction.R ################################# library(MASS) library(ggplot2) library(dplyr) summary.merge <- read.table(paste("results/", "summary_overlap.anno.bed", sep=""), header=TRUE) summary.merge.crop <- summary.merge[,3:6] summary.merge.crop$star...
library(shiny) library(tidyverse) ## Data upload module dataInputUI <- function(id, dataInputChoices = list("Copy & Paste"="pasted", "File Upload"="fileUpload", "Sample Data"="sampleData"), ...
/2-data-upload.R
no_license
jpmarindiaz/learn-shiny-modules
R
false
false
2,670
r
library(shiny) library(tidyverse) ## Data upload module dataInputUI <- function(id, dataInputChoices = list("Copy & Paste"="pasted", "File Upload"="fileUpload", "Sample Data"="sampleData"), ...
##' @rdname pRolocVis-pRolocComp ##' @aliases pRolocVis ##' @aliases pRolocComp ##' @title pRolocVis/pRolocComp ##' @author Thomas Naake <naake@@stud.uni-heidelberg.de> ##' @usage pRolocVis(object) ##' @usage pRolocComp(object) ##' @param object an object of class \code{MSnSet} or a list of \code{MSnSet}s ##' (pRolocV...
/R/pRolocVis.R
no_license
pierremj/pRolocGUI
R
false
false
32,690
r
##' @rdname pRolocVis-pRolocComp ##' @aliases pRolocVis ##' @aliases pRolocComp ##' @title pRolocVis/pRolocComp ##' @author Thomas Naake <naake@@stud.uni-heidelberg.de> ##' @usage pRolocVis(object) ##' @usage pRolocComp(object) ##' @param object an object of class \code{MSnSet} or a list of \code{MSnSet}s ##' (pRolocV...
## ## I simply set the input x as a matrix ## ## I simply set the input x as a matrix ## and then set the solved value "s" as a null ## then I changed every reference to "mean" to "solve" makeCacheMatrix <- function(x = matrix(sample(1:100,9),3,3)) { s <- NULL set <- function(y) { x <<- y s <<- NULL } g...
/cachematrix.R
no_license
RenuPrasadsugasi/ProgrammingAssignment2
R
false
false
747
r
## ## I simply set the input x as a matrix ## ## I simply set the input x as a matrix ## and then set the solved value "s" as a null ## then I changed every reference to "mean" to "solve" makeCacheMatrix <- function(x = matrix(sample(1:100,9),3,3)) { s <- NULL set <- function(y) { x <<- y s <<- NULL } g...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utilities_fsvdraws.R \name{predcov} \alias{predcov} \title{Predicts covariance matrix} \usage{ predcov(x, ahead = 1, each = 1) } \arguments{ \item{x}{Object of class \code{'fsvdraws'}, usually resulting from a call to \code{\link{fsvsample}}....
/fuzzedpackages/factorstochvol/man/predcov.Rd
no_license
akhikolla/testpackages
R
false
true
1,721
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utilities_fsvdraws.R \name{predcov} \alias{predcov} \title{Predicts covariance matrix} \usage{ predcov(x, ahead = 1, each = 1) } \arguments{ \item{x}{Object of class \code{'fsvdraws'}, usually resulting from a call to \code{\link{fsvsample}}....
#!/usr/bin/env Rscript arguments <- commandArgs(trailingOnly = TRUE) if(length(arguments) < 3){ cat("This script assume that your class labels are in \"class\" column. All other columns will be considered as features. \n Usage: csvToLibSVM.R inputFilename positiveClassName outputFilename\n") } else if (length(argumen...
/csvToLibSVM.R
no_license
wangchengww/Utility-codes
R
false
false
919
r
#!/usr/bin/env Rscript arguments <- commandArgs(trailingOnly = TRUE) if(length(arguments) < 3){ cat("This script assume that your class labels are in \"class\" column. All other columns will be considered as features. \n Usage: csvToLibSVM.R inputFilename positiveClassName outputFilename\n") } else if (length(argumen...
\name{deviate} \alias{deviate} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Deviate points so they can be seen while plotted. } \description{ TODO } \usage{ t.conf(xs) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{xs}{ %% ~~Describe \code{xs} here~~ } } \de...
/man/t.conf.Rd
no_license
haberdashPI/wright.lab.util
R
false
false
1,251
rd
\name{deviate} \alias{deviate} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Deviate points so they can be seen while plotted. } \description{ TODO } \usage{ t.conf(xs) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{xs}{ %% ~~Describe \code{xs} here~~ } } \de...
# This file is generated by make.paws. Please do not edit here. #' @importFrom paws.common populate #' @include mediapackagevod_service.R NULL .mediapackagevod$create_asset_input <- function(...) { args <- c(as.list(environment()), list(...)) shape <- structure(list(Id = structure(logical(0), tags = list(locationN...
/paws/R/mediapackagevod_interfaces.R
permissive
TWarczak/paws
R
false
false
48,004
r
# This file is generated by make.paws. Please do not edit here. #' @importFrom paws.common populate #' @include mediapackagevod_service.R NULL .mediapackagevod$create_asset_input <- function(...) { args <- c(as.list(environment()), list(...)) shape <- structure(list(Id = structure(logical(0), tags = list(locationN...
ash_words <- c("ash", "flash", "mash", "smash", "vash", "fash", "succotash", "truncash", "cash", "dash", "mn-mash") library(CorShrink) data("sample_by_feature_data") donor_by_tissue_PLIN1 <- sample_by_feature_data donor_by_tissue_PLIN1[1:5,1:5] length(which(is.na(donor_by_tissue_PLIN1)))/length(dono...
/talk/codes.R
no_license
kkdey/CorShrink-pages
R
false
false
746
r
ash_words <- c("ash", "flash", "mash", "smash", "vash", "fash", "succotash", "truncash", "cash", "dash", "mn-mash") library(CorShrink) data("sample_by_feature_data") donor_by_tissue_PLIN1 <- sample_by_feature_data donor_by_tissue_PLIN1[1:5,1:5] length(which(is.na(donor_by_tissue_PLIN1)))/length(dono...
library(openxlsx) A <- read.xlsx(file.choose(),2) View(A) a <- A[,-1] View(a) ################# K-means clustering ######################### norm_a <- scale(a) View(norm_a) wss=(nrow(norm_a)-1)*sum(apply(norm_a,2,var)) for(i in 2:8)wss[i]=sum(kmeans(norm_a,centers = i)$withinss) plot(1:8,wss,type = "o",xlab = "number o...
/east west airlines
no_license
VERMAVIVEKKR/clustering
R
false
false
1,484
library(openxlsx) A <- read.xlsx(file.choose(),2) View(A) a <- A[,-1] View(a) ################# K-means clustering ######################### norm_a <- scale(a) View(norm_a) wss=(nrow(norm_a)-1)*sum(apply(norm_a,2,var)) for(i in 2:8)wss[i]=sum(kmeans(norm_a,centers = i)$withinss) plot(1:8,wss,type = "o",xlab = "number o...
utils::globalVariables(c("%>%", "..p.format..", "xend", "x", "y", "AlignSubspace", "CaseMatch", "CreateSeuratObject", "F...
/R/globalVariables.R
no_license
Lelouchzhu/iCellR
R
false
false
2,278
r
utils::globalVariables(c("%>%", "..p.format..", "xend", "x", "y", "AlignSubspace", "CaseMatch", "CreateSeuratObject", "F...
library(tools) datasetFile <-"ensemble/datasets/exp1/2-Gram-dbpedia-types-enriquecimento-info-q1-not-null_info_entidades.Rda" fileExpName <- "svm" expName <- "exp1" source(file_path_as_absolute("microaverage/exps.R"))
/microaverage/svm/exp1.R
no_license
MarcosGrzeca/drunktweets
R
false
false
220
r
library(tools) datasetFile <-"ensemble/datasets/exp1/2-Gram-dbpedia-types-enriquecimento-info-q1-not-null_info_entidades.Rda" fileExpName <- "svm" expName <- "exp1" source(file_path_as_absolute("microaverage/exps.R"))
#' Wrapper function to call random forests function. #' #' Provides an interface to different parallel implementations of the random #' forest algorithm. Currently, only the \code{ranger} package is #' supported. #' #' @param x matrix or data.frame of predictor variables with variables in #' columns and samples in r...
/R/variable_selection.R
no_license
whcsu/Pomona
R
false
false
5,986
r
#' Wrapper function to call random forests function. #' #' Provides an interface to different parallel implementations of the random #' forest algorithm. Currently, only the \code{ranger} package is #' supported. #' #' @param x matrix or data.frame of predictor variables with variables in #' columns and samples in r...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tia.R \name{tia_tables} \alias{tia_tables} \title{Simple test-item analysis} \usage{ tia_tables( dataSrc, predicate = NULL, type = c("raw", "averaged", "compared"), max_scores = c("observed", "theoretical"), distractor = ...
/man/tia_tables.Rd
no_license
cran/dexter
R
false
true
1,725
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tia.R \name{tia_tables} \alias{tia_tables} \title{Simple test-item analysis} \usage{ tia_tables( dataSrc, predicate = NULL, type = c("raw", "averaged", "compared"), max_scores = c("observed", "theoretical"), distractor = ...
GaUpdU <- function(alpha, beta, c.r, lambda.r) { f.umat <- GaPrU(alpha, beta, c.r, lambda.r) K <- length(lambda.r) u.r <- rep(0, K - 1) for(i in 1:(K - 1)) { u.r[i] <- sample(x = 0:100, size = 1, prob = f.umat[, i]) } return(u.r) }
/BGPhazard/R/GaUpdU.R
no_license
ingted/R-Examples
R
false
false
258
r
GaUpdU <- function(alpha, beta, c.r, lambda.r) { f.umat <- GaPrU(alpha, beta, c.r, lambda.r) K <- length(lambda.r) u.r <- rep(0, K - 1) for(i in 1:(K - 1)) { u.r[i] <- sample(x = 0:100, size = 1, prob = f.umat[, i]) } return(u.r) }
as.SparseSimilarityMatrix.matrix <- function(s, lower=-Inf) { if (!is(s, "matrix")) { s <- try(as(s, "matrix")) if (is(s, "try-error")) stop("cannot cast 's' (class '", class(s), "') to class 'matrix'") } if (nrow(s) != ncol(s) && ncol(s) != 3) stop("matr...
/R/conversions.R
no_license
UBod/apcluster
R
false
false
4,005
r
as.SparseSimilarityMatrix.matrix <- function(s, lower=-Inf) { if (!is(s, "matrix")) { s <- try(as(s, "matrix")) if (is(s, "try-error")) stop("cannot cast 's' (class '", class(s), "') to class 'matrix'") } if (nrow(s) != ncol(s) && ncol(s) != 3) stop("matr...
\name{Kmark} \alias{Kmark} \alias{markcorrint} \title{Mark-Weighted K Function} \description{ Estimates the mark-weighted \eqn{K} function of a marked point pattern. } \usage{ Kmark(X, f = NULL, r = NULL, correction = c("isotropic", "Ripley", "translate"), ..., f1 = NULL, normalise = TRUE, returnL...
/man/Kmark.Rd
no_license
cuulee/spatstat
R
false
false
6,345
rd
\name{Kmark} \alias{Kmark} \alias{markcorrint} \title{Mark-Weighted K Function} \description{ Estimates the mark-weighted \eqn{K} function of a marked point pattern. } \usage{ Kmark(X, f = NULL, r = NULL, correction = c("isotropic", "Ripley", "translate"), ..., f1 = NULL, normalise = TRUE, returnL...
### functions # this way we can easily add / change covariates # and reevaluate models bild_model <- function(dataset, dependence, summary = FALSE, time = "shot_age") { model <- bild( makes_shot ~ shot_age + quarter + score_diff + distance, data = dataset, trace = TRUE, aggr...
/R/individual_games_bild_analysis.R
no_license
johnWilshire/basketball_analysis
R
false
false
2,713
r
### functions # this way we can easily add / change covariates # and reevaluate models bild_model <- function(dataset, dependence, summary = FALSE, time = "shot_age") { model <- bild( makes_shot ~ shot_age + quarter + score_diff + distance, data = dataset, trace = TRUE, aggr...
/v_democracy/scripts/democracy.R
permissive
RRMaximiliano/data-viz-nicaragua
R
false
false
9,842
r
qT <- function (p, df, ncp = 0, lower.tail = TRUE, log.p = FALSE, max.terms = 1e+05, num.terms.inc = 20, rel.tol = .Machine$double.eps) { if (missing(ncp)) { q <- stats::qt(p = p, df = df, lower.tail = lower.tail, log.p = log.p) } else if (all(ncp == 0 | is.na(ncp))) { ...
/R/qT.R
no_license
markocherrie/EnvStats
R
false
false
3,199
r
qT <- function (p, df, ncp = 0, lower.tail = TRUE, log.p = FALSE, max.terms = 1e+05, num.terms.inc = 20, rel.tol = .Machine$double.eps) { if (missing(ncp)) { q <- stats::qt(p = p, df = df, lower.tail = lower.tail, log.p = log.p) } else if (all(ncp == 0 | is.na(ncp))) { ...
# # Session 8 # Multiple Linear Regression # Diagnostics & Transformations # #****************************************************** #load data source("AccidentInput.R") setwd(traindir) my.path <- getwd() setwd(my.path) acts <- file.inputl(my.path) sapply(acts, dim) dim(acts[[12]]) setdiff(colnames(...
/Heping/S8MLR3.R
no_license
hpzheng/sys6021_codes
R
false
false
5,634
r
# # Session 8 # Multiple Linear Regression # Diagnostics & Transformations # #****************************************************** #load data source("AccidentInput.R") setwd(traindir) my.path <- getwd() setwd(my.path) acts <- file.inputl(my.path) sapply(acts, dim) dim(acts[[12]]) setdiff(colnames(...
# Script to plot the heatmaps for phenotypic data from the genomic prediction # experiment. # Define a function to build a matrix of phenotypic data phenotype_map <- function(yl, dat, adj, variable) { # Trim the data down to just the year-location we are interested in year_loc <- dat[dat$trial == yl, c...
/Analysis_Scripts/Plotting/Adjusted_Phenotypic_Data_Heatmaps.R
no_license
MorrellLAB/Deleterious_GP
R
false
false
4,946
r
# Script to plot the heatmaps for phenotypic data from the genomic prediction # experiment. # Define a function to build a matrix of phenotypic data phenotype_map <- function(yl, dat, adj, variable) { # Trim the data down to just the year-location we are interested in year_loc <- dat[dat$trial == yl, c...
ExtractTagSummary <- function (sInputFile,sLocation="RECEIVERID") { TransmitterList <- ExtractUniqueValues(sInputFile, 2) fExtractsummaryid <- function(i) { T1 <- ExtractData(sInputFile, sQueryTransmitterList = TransmitterList[i]) row.names(T1) <- NULL TRANSMITTERID <- T1[1, 2] STARTDATE <...
/R/ExtractTagSummary.R
no_license
RossDwyer/VTrack
R
false
false
758
r
ExtractTagSummary <- function (sInputFile,sLocation="RECEIVERID") { TransmitterList <- ExtractUniqueValues(sInputFile, 2) fExtractsummaryid <- function(i) { T1 <- ExtractData(sInputFile, sQueryTransmitterList = TransmitterList[i]) row.names(T1) <- NULL TRANSMITTERID <- T1[1, 2] STARTDATE <...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/metaX.R \docType{methods} \name{normalize} \alias{normalize} \title{Normalisation of peak intensity} \usage{ normalize(para, method = "sum", valueID = "value", norFactor = NULL, useClass = FALSE, ...) } \arguments{ \item{para}{A metaXpara o...
/man/normalize.Rd
no_license
wenbostar/metaX
R
false
true
1,660
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/metaX.R \docType{methods} \name{normalize} \alias{normalize} \title{Normalisation of peak intensity} \usage{ normalize(para, method = "sum", valueID = "value", norFactor = NULL, useClass = FALSE, ...) } \arguments{ \item{para}{A metaXpara o...
if(!require('deSolve')) install.packages('deSolve'); library(deSolve) if(!require('plotly')) install.packages('plotly'); library(plotly) if(!require('dplyr')) install.packages('dplyr'); library(dplyr) if(!require('reshape')) install.packages('reshape'); library(reshape) if(!require('htmltools')) install.packages('htmlt...
/runSpread.R
no_license
kvfairchild/SEIR_COVID19
R
false
false
5,731
r
if(!require('deSolve')) install.packages('deSolve'); library(deSolve) if(!require('plotly')) install.packages('plotly'); library(plotly) if(!require('dplyr')) install.packages('dplyr'); library(dplyr) if(!require('reshape')) install.packages('reshape'); library(reshape) if(!require('htmltools')) install.packages('htmlt...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/MotifSetup-class.R \docType{class} \name{MotifSetup-class} \alias{MotifSetup} \alias{MotifSetup-class} \title{MotifSetup Reference Class} \description{ This class is used to initialize motif plots and mix them with track plots. } \details{ Us...
/script/mcclintock_analysis_code/seqplots-master/man/MotifSetup-class.Rd
no_license
Intro-Sci-Comp-UIowa/biol-4386-project-pfothergill
R
false
true
1,387
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/MotifSetup-class.R \docType{class} \name{MotifSetup-class} \alias{MotifSetup} \alias{MotifSetup-class} \title{MotifSetup Reference Class} \description{ This class is used to initialize motif plots and mix them with track plots. } \details{ Us...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utility_functions.R \name{pull_field_levels} \alias{pull_field_levels} \title{Pull field levels} \usage{ pull_field_levels(sheet_name, field_name, tibble_list) } \arguments{ \item{sheet_name}{a string} \item{field_name}{programmatic field na...
/man/pull_field_levels.Rd
no_license
ebi-ait/ranglr
R
false
true
548
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utility_functions.R \name{pull_field_levels} \alias{pull_field_levels} \title{Pull field levels} \usage{ pull_field_levels(sheet_name, field_name, tibble_list) } \arguments{ \item{sheet_name}{a string} \item{field_name}{programmatic field na...
Distance<-function (CoorX, CoorY) { geodata <- as.matrix(cbind(CoorX, CoorY)) u <- as.vector(dist(geodata)) DistMin <- min(u) DistMax <- max(u) Dist_Max_Min <- cbind(DistMax, DistMin) colnames(Dist_Max_Min) <- c("DMaxima", "DMinima") return(Dist_Max_Min) }
/Distance.R
no_license
vargaslab/temporal-univariate-Latin-Hypercube
R
false
false
271
r
Distance<-function (CoorX, CoorY) { geodata <- as.matrix(cbind(CoorX, CoorY)) u <- as.vector(dist(geodata)) DistMin <- min(u) DistMax <- max(u) Dist_Max_Min <- cbind(DistMax, DistMin) colnames(Dist_Max_Min) <- c("DMaxima", "DMinima") return(Dist_Max_Min) }
fix0101 <- function (x, alpha = 4, beta = 4, iter = 60, converge = 1e-05) { if (var(x[, 2]) > 1e-10) { cat("warning - censoring values are not all the same", "\n") } realvalues <- x[x[, 2] < x[, 1], 1] pqlvalues <- x[x[, 2] >= x[, 1], 2] if (length(realvalues) == 0) ...
/R/fix0101.R
no_license
padilla410/EnvStats
R
false
false
3,318
r
fix0101 <- function (x, alpha = 4, beta = 4, iter = 60, converge = 1e-05) { if (var(x[, 2]) > 1e-10) { cat("warning - censoring values are not all the same", "\n") } realvalues <- x[x[, 2] < x[, 1], 1] pqlvalues <- x[x[, 2] >= x[, 1], 2] if (length(realvalues) == 0) ...
# Read in Data setwd("~/exdata-data-household_power_consumption") dat <- read.table("household_power_consumption.txt", sep = ";", na.strings = "?", head = TRUE) # Classify Date/Time Data dat$Date <- as.Date(dat$Date, format = "%d/%m/%Y") dat$DateTime <- strptime(paste(dat$Date, as.character(dat$Time), sep=" "), "%Y-%...
/plot2.R
no_license
hwickenden/ExData_Plotting1
R
false
false
641
r
# Read in Data setwd("~/exdata-data-household_power_consumption") dat <- read.table("household_power_consumption.txt", sep = ";", na.strings = "?", head = TRUE) # Classify Date/Time Data dat$Date <- as.Date(dat$Date, format = "%d/%m/%Y") dat$DateTime <- strptime(paste(dat$Date, as.character(dat$Time), sep=" "), "%Y-%...
import_dcm <- function(nsets = 5, path_to_train_data = 'data/train') { require(oro.dicom) function(env) { fullpath <- file.path(options('proj.root')[[1]], path_to_train_data) fn <- list.dirs(fullpath, recursive = TRUE, full.names = TRUE) keep <- vapply(fn , function(f) length(list.files(f, patte...
/src/stages/import.R
no_license
davluangu/diagnose_heart_disease
R
false
false
512
r
import_dcm <- function(nsets = 5, path_to_train_data = 'data/train') { require(oro.dicom) function(env) { fullpath <- file.path(options('proj.root')[[1]], path_to_train_data) fn <- list.dirs(fullpath, recursive = TRUE, full.names = TRUE) keep <- vapply(fn , function(f) length(list.files(f, patte...
#Dimensionality Reduction # Importing the dataset dataset = read.csv('Wine.csv') # Encoding the target feature as factor #dataset$Purchased = factor(dataset$Purchased, levels = c(0, 1)) # Splitting the dataset into the Training set and Test set # install.packages('caTools') library(caTools) set.seed(123) split = sam...
/MyPCA.R
no_license
antonio2505/SuperDataScience_Projects_ML
R
false
false
2,782
r
#Dimensionality Reduction # Importing the dataset dataset = read.csv('Wine.csv') # Encoding the target feature as factor #dataset$Purchased = factor(dataset$Purchased, levels = c(0, 1)) # Splitting the dataset into the Training set and Test set # install.packages('caTools') library(caTools) set.seed(123) split = sam...
library(forecast) library(stats) library(tseries) library(readxl) library(tidyverse) library(evir) library(ismev) library(copula) library(VineCopula) #1 Set the directory to save files e.g images, excel etc path = "C:/Users/Zvinodashe/Desktop/Stock_Analysis_Final" setwd(path) #2 Retrieve exel file to get PriceData a...
/Stock_Analysis_Part3_Extreme_Value.R
no_license
MatricksDeCoder/Stock_Analysis_Econometrics_R
R
false
false
6,469
r
library(forecast) library(stats) library(tseries) library(readxl) library(tidyverse) library(evir) library(ismev) library(copula) library(VineCopula) #1 Set the directory to save files e.g images, excel etc path = "C:/Users/Zvinodashe/Desktop/Stock_Analysis_Final" setwd(path) #2 Retrieve exel file to get PriceData a...
mat = list(c(0.3,0.6,0.1), c(0.2,0.4,0.4), c(0.1,0.6,0.3), c(0.7,0.2,0.1), c(0.4,0.6,0)) max_min_relation <<- function(l1,l2){ num = 0 dnm = 0 for(i in 1:(length(l1))){ num = num + min(l1[i],l2[i]) dnm = dnm + max(l1[i],l2[i]) } return(num/dnm) } get_cos...
/min_max.R
no_license
harish-ganesh/SC
R
false
false
677
r
mat = list(c(0.3,0.6,0.1), c(0.2,0.4,0.4), c(0.1,0.6,0.3), c(0.7,0.2,0.1), c(0.4,0.6,0)) max_min_relation <<- function(l1,l2){ num = 0 dnm = 0 for(i in 1:(length(l1))){ num = num + min(l1[i],l2[i]) dnm = dnm + max(l1[i],l2[i]) } return(num/dnm) } get_cos...
x=seq( from = -3 , to = 3 , by = 0.1) y=x^3 plot(x, y, type="l")
/R/save_plot_as_eps/setup.R
no_license
dnuffer/dpcode
R
false
false
65
r
x=seq( from = -3 , to = 3 , by = 0.1) y=x^3 plot(x, y, type="l")
# 1. data$group 컬럼에 A조~C조 랜덤으로 160명씩 고르게 분포시키시오. #data_new = data.frame('group', 'A', 'B', 'C') #data_new$A = runif(n=160, mind = 10101, max = ) data$group = sample(c('A조', 'B조', 'c조'), size=nrow(data), replace=T) #2. fibonacci.R 파일을 작성하고 console에서 실행하시오. source('fibonacci.R') #3. apply를 이용하여 smdt에 과목별 (총)평균점수 행을 추가...
/try_this_5th_of_March.R
no_license
larryback/helloR
R
false
false
1,754
r
# 1. data$group 컬럼에 A조~C조 랜덤으로 160명씩 고르게 분포시키시오. #data_new = data.frame('group', 'A', 'B', 'C') #data_new$A = runif(n=160, mind = 10101, max = ) data$group = sample(c('A조', 'B조', 'c조'), size=nrow(data), replace=T) #2. fibonacci.R 파일을 작성하고 console에서 실행하시오. source('fibonacci.R') #3. apply를 이용하여 smdt에 과목별 (총)평균점수 행을 추가...
# Run only on CI skip_on_cran() temp_file <- list.files(pkg_file_template(), recursive = TRUE, pattern = "template.tex$", full.names = TRUE) # Rjournal template has another name temp_file[grep("rjournal", temp_file)] <- pkg_file_template("rjournal", "resources", "RJwrapper.tex") expect_contains <- function(file, pat...
/tests/testthat/test-check-template.R
no_license
Sumidu/rticles
R
false
false
1,888
r
# Run only on CI skip_on_cran() temp_file <- list.files(pkg_file_template(), recursive = TRUE, pattern = "template.tex$", full.names = TRUE) # Rjournal template has another name temp_file[grep("rjournal", temp_file)] <- pkg_file_template("rjournal", "resources", "RJwrapper.tex") expect_contains <- function(file, pat...
library(raster) library(rgdal) db <- "cusa.sqlite" # list the subdatasets and split on equal sign # e.g. SUBDATASET_2_NAME=RASTERLITE:cusa.sqlite,table=agc_crop maps <- function() { unlist( lapply( strsplit( grep( "NAME", ...
/code/cusa.R
no_license
nbest937/thesis
R
false
false
3,497
r
library(raster) library(rgdal) db <- "cusa.sqlite" # list the subdatasets and split on equal sign # e.g. SUBDATASET_2_NAME=RASTERLITE:cusa.sqlite,table=agc_crop maps <- function() { unlist( lapply( strsplit( grep( "NAME", ...
Data=read.table("simulated_data_ZINB_PL.txt",header=TRUE) attach(Data) head(Data) y=Data[,1:10] y=as.matrix(y) n2=length(y[,1]) m=length(y[1,]) ################################################### rateobs=rep(m,n2) ID=X1=X2=Time=matrix(NA,n2,m) for(i in 1:n2){ X1[i,1:rateobs[i]]=rep(x1[i],rateobs[i]) ...
/INLA-ZINB-PL-B-spline.R
no_license
tbaghfalaki/INLA-JM-of-ZI-event-time
R
false
false
7,513
r
Data=read.table("simulated_data_ZINB_PL.txt",header=TRUE) attach(Data) head(Data) y=Data[,1:10] y=as.matrix(y) n2=length(y[,1]) m=length(y[1,]) ################################################### rateobs=rep(m,n2) ID=X1=X2=Time=matrix(NA,n2,m) for(i in 1:n2){ X1[i,1:rateobs[i]]=rep(x1[i],rateobs[i]) ...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/robustDigest.R \name{.removeCacheAtts} \alias{.removeCacheAtts} \title{Remove attributes that are highly varying} \usage{ .removeCacheAtts(x) } \arguments{ \item{x}{Any arbitrary R object that could have attributes} } \description{ Remove att...
/man/dot-removeCacheAtts.Rd
no_license
PredictiveEcology/reproducible
R
false
true
354
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/robustDigest.R \name{.removeCacheAtts} \alias{.removeCacheAtts} \title{Remove attributes that are highly varying} \usage{ .removeCacheAtts(x) } \arguments{ \item{x}{Any arbitrary R object that could have attributes} } \description{ Remove att...
library(rtweet) my_tweets <- stream_tweets( "#giletjaunes", n = 500, include_rts = FALSE ) rt <- stream_tweets(geocode = "37.78,-122.40,100mi", timeout = 30)
/ecollect_search.R
no_license
cecconifederico/ecollect
R
false
false
173
r
library(rtweet) my_tweets <- stream_tweets( "#giletjaunes", n = 500, include_rts = FALSE ) rt <- stream_tweets(geocode = "37.78,-122.40,100mi", timeout = 30)
install.packages("XML") ##last update (2013/12/29 2:50) ###system.time is #user system elapsed #173.133 1.408 173.813 test1 #160.490 1.108 161.218 test2 library(XML) getwd() setwd("") ###input file_name, home team name and away team name with double quotation ("") xml_csv_convertβ <- function(f...
/XML_Convert_Funciton_β.R
no_license
ngskyuki/AmiscoProcessing
R
false
false
8,802
r
install.packages("XML") ##last update (2013/12/29 2:50) ###system.time is #user system elapsed #173.133 1.408 173.813 test1 #160.490 1.108 161.218 test2 library(XML) getwd() setwd("") ###input file_name, home team name and away team name with double quotation ("") xml_csv_convertβ <- function(f...
library(shiny) library(tidyverse) # Define UI for application that draws a histogram ui <- fluidPage( # Application title titlePanel("Old Faithful Geyser Data"), # Sidebar with a slider input for number of bins sidebarLayout( sidebarPanel( sliderInput(inputId = "bins", label ...
/old_faithful_app/app.R
no_license
kuba1016/old_faithful_app
R
false
false
1,796
r
library(shiny) library(tidyverse) # Define UI for application that draws a histogram ui <- fluidPage( # Application title titlePanel("Old Faithful Geyser Data"), # Sidebar with a slider input for number of bins sidebarLayout( sidebarPanel( sliderInput(inputId = "bins", label ...
#' Shiny module for OCEO header information #' #' Shiny module for OCEO header information #' #' @name mod_headers #' #' @param id character used to specify namespace, see \code{\link[shiny]{NS}} #' @param col.width integer; column width of column of UI widgets #' #' @export mod_headers_ui <- function(id, col.width = 7...
/R/mod_headers.R
no_license
us-amlr/amlrOceo
R
false
false
4,325
r
#' Shiny module for OCEO header information #' #' Shiny module for OCEO header information #' #' @name mod_headers #' #' @param id character used to specify namespace, see \code{\link[shiny]{NS}} #' @param col.width integer; column width of column of UI widgets #' #' @export mod_headers_ui <- function(id, col.width = 7...
# Libraries ---- library(tidyverse) library(magrittr) library(doParallel) library(corrplot) library(GGally) library(caret) source('../week5/R/outliers.R') # Prepare clusters ================================= cl <- makeCluster(3) registerDoParallel(cl) # import data knownDiamonds <- readRDS('./input/train.rds') # Y...
/Diamonds/R/knn.R
no_license
Taros007/ubiqum_projects
R
false
false
3,912
r
# Libraries ---- library(tidyverse) library(magrittr) library(doParallel) library(corrplot) library(GGally) library(caret) source('../week5/R/outliers.R') # Prepare clusters ================================= cl <- makeCluster(3) registerDoParallel(cl) # import data knownDiamonds <- readRDS('./input/train.rds') # Y...
### Manage test data for validation # Constants ------------------------------------------------------------------- READ_TEST_DATA_DIR <- file.path("data") WRITE_TEST_DATA_DIR <- file.path("tests", "testthat", "data") API_PAUSE_TIME <- 1 # Commons COMMONS_TEST_DATE <- "2017-02-08" COMMONS_DIVISION_ID <- 219 COMMONS_...
/tests/testthat/validate.R
no_license
houseofcommonslibrary/clvotes
R
false
false
1,592
r
### Manage test data for validation # Constants ------------------------------------------------------------------- READ_TEST_DATA_DIR <- file.path("data") WRITE_TEST_DATA_DIR <- file.path("tests", "testthat", "data") API_PAUSE_TIME <- 1 # Commons COMMONS_TEST_DATE <- "2017-02-08" COMMONS_DIVISION_ID <- 219 COMMONS_...
#' dataone.R #' #' Helpers for the DataONE R package. #' Test whether a token is set. #' #' @param node (MNode|CNode) The CN or MN you want to find a token for. #' #' @return (boolean) #' @export #' #' @examples is_token_set <- function(node) { token <- tryCatch(get_token(node), error = function(...
/R/dataone.R
permissive
eodean/arcticdatautils
R
false
false
3,410
r
#' dataone.R #' #' Helpers for the DataONE R package. #' Test whether a token is set. #' #' @param node (MNode|CNode) The CN or MN you want to find a token for. #' #' @return (boolean) #' @export #' #' @examples is_token_set <- function(node) { token <- tryCatch(get_token(node), error = function(...
#' Search Catalogue of Life for for direct children of a particular taxon. #' #' @export #' @param name The string to search for. Only exact matches found the name given #' will be returned, unless one or wildcards are included in the search #' string. An * (asterisk) character denotes a wildcard; a % (percentage)...
/R/col_children.R
permissive
vijaybarve/taxize
R
false
false
3,783
r
#' Search Catalogue of Life for for direct children of a particular taxon. #' #' @export #' @param name The string to search for. Only exact matches found the name given #' will be returned, unless one or wildcards are included in the search #' string. An * (asterisk) character denotes a wildcard; a % (percentage)...
library(httr) library(tidyverse) library(lubridate) library(jsonlite) Foxnews <- read_csv("csvfiles/Fox_2020.csv") urls = Foxnews$Link[1:100] ########################################## # Get posts sharing the URLs by the link API ########################################## site_url = "https://api.crowdtangle.com/links...
/R_files/Crwaling_sharing_FoxNewsPosts.R
no_license
bluethou/COVID19_info_spread_Facebook
R
false
false
2,762
r
library(httr) library(tidyverse) library(lubridate) library(jsonlite) Foxnews <- read_csv("csvfiles/Fox_2020.csv") urls = Foxnews$Link[1:100] ########################################## # Get posts sharing the URLs by the link API ########################################## site_url = "https://api.crowdtangle.com/links...
##--------------------------------------------------------------- ## Load packages - ##--------------------------------------------------------------- library(tidyverse) library(gganimate) library(zoo) library(countrycode) library(wbstats) library(scales) ##------------...
/casesbycountry.R
no_license
avsaase/coronaplots
R
false
false
7,317
r
##--------------------------------------------------------------- ## Load packages - ##--------------------------------------------------------------- library(tidyverse) library(gganimate) library(zoo) library(countrycode) library(wbstats) library(scales) ##------------...
# Exercise 2 - Configure safetyGraphics for use with a non-standard labs dataset. # Update the custom mapping based on the column names in the custom data set provided. customLabs <- read.csv("https://raw.githubusercontent.com/SafetyGraphics/SafetyGraphics.github.io/master/pilot/SampleData_PartialADaM.csv") customMap...
/02_Exercise.R
permissive
GenomicsNX/RPharma2021-Workshop
R
false
false
675
r
# Exercise 2 - Configure safetyGraphics for use with a non-standard labs dataset. # Update the custom mapping based on the column names in the custom data set provided. customLabs <- read.csv("https://raw.githubusercontent.com/SafetyGraphics/SafetyGraphics.github.io/master/pilot/SampleData_PartialADaM.csv") customMap...
# Run slash pine simulations ---------------------------------------------- rm(list=ls()) setwd("C:/Users/Alicia/Documents/GitHub/FL_Carbon/Slash Remeasurement") # envdata<-read.csv("SlashEnvData1.csv", header=T, sep=",") # load("SlashAgeTotals.rdata") # load("SlashAgeTotalsEnd.rdata") # load("SlashDIATotalsEnd.rda...
/Slash Remeasurement/SlashUncertaintyProp.R
no_license
alformanack/FL_Carbon
R
false
false
6,793
r
# Run slash pine simulations ---------------------------------------------- rm(list=ls()) setwd("C:/Users/Alicia/Documents/GitHub/FL_Carbon/Slash Remeasurement") # envdata<-read.csv("SlashEnvData1.csv", header=T, sep=",") # load("SlashAgeTotals.rdata") # load("SlashAgeTotalsEnd.rdata") # load("SlashDIATotalsEnd.rda...
## Skąd wziąć dane o pogodzie w Polsce? ## Pory roku na przestrzeni lat # procentowy podział dni w roku na poszczególne pory roku # temperatura w marcu ## Czy klimat się ociepla? # różnice w temperaturze na przestrzeni lat # miesiące cieplejsze i zimniejsze od średniej # liczba dni cieplejszych i zimniejszych niż śre...
/analiza.R
no_license
ArturFracek/Dane-IMGW
R
false
false
17,625
r
## Skąd wziąć dane o pogodzie w Polsce? ## Pory roku na przestrzeni lat # procentowy podział dni w roku na poszczególne pory roku # temperatura w marcu ## Czy klimat się ociepla? # różnice w temperaturze na przestrzeni lat # miesiące cieplejsze i zimniejsze od średniej # liczba dni cieplejszych i zimniejszych niż śre...
# most of these functions are implemented manually for the same reason as their C counterpart # reason: var args, paste 'em together gtkMessageDialogNew <- function(parent = NULL, flags, type, buttons, ..., show = TRUE) { checkPtrType(parent, "GtkWindow", nullOk = T) w <- .RGtkCall("S_gtk_message_dialog_new",...
/RGtk2/R/gtkManuals.R
no_license
lawremi/RGtk2
R
false
false
28,335
r
# most of these functions are implemented manually for the same reason as their C counterpart # reason: var args, paste 'em together gtkMessageDialogNew <- function(parent = NULL, flags, type, buttons, ..., show = TRUE) { checkPtrType(parent, "GtkWindow", nullOk = T) w <- .RGtkCall("S_gtk_message_dialog_new",...
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ws_engine.R \name{parse_msg_data} \alias{parse_msg_data} \title{Parse msg$data, return data.frame} \usage{ parse_msg_data(msg) } \description{ Parse msg$data, return data.frame }
/man/parse_msg_data.Rd
no_license
jfontestad/bitmexws
R
false
true
257
rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ws_engine.R \name{parse_msg_data} \alias{parse_msg_data} \title{Parse msg$data, return data.frame} \usage{ parse_msg_data(msg) } \description{ Parse msg$data, return data.frame }
#Sampling parametric uncertainty by Latin Hypercube Sampling process #function input: model, sample number, sample range library(lhs) #Latin Hypercube Sampling parasample<-function(model,n,range){ paranum<-length(model$coefficients) #number of parameters in the model paramean<-rep(NA,paranum) #parameter means p...
/parameteruncertainty.R
no_license
yhaochen/Climate_CornYield
R
false
false
1,902
r
#Sampling parametric uncertainty by Latin Hypercube Sampling process #function input: model, sample number, sample range library(lhs) #Latin Hypercube Sampling parasample<-function(model,n,range){ paranum<-length(model$coefficients) #number of parameters in the model paramean<-rep(NA,paranum) #parameter means p...
#R0 and Re calculations local({r <- getOption("repos") r["CRAN"] <- "http://cran.r-project.org" options(repos=r) }) .libPaths('/home/nwenzel/intl') install.packages("ggplot2") install.packages("scales") install.packages("gridExtra") install.packages("ggthemes") install.packages("ggforce") install.packages("...
/fast_R0_graph.R
no_license
tajwenzel/IntlSens
R
false
false
21,890
r
#R0 and Re calculations local({r <- getOption("repos") r["CRAN"] <- "http://cran.r-project.org" options(repos=r) }) .libPaths('/home/nwenzel/intl') install.packages("ggplot2") install.packages("scales") install.packages("gridExtra") install.packages("ggthemes") install.packages("ggforce") install.packages("...
\name{alm} \alias{alm} \title{Retrieve PLoS article-level metrics (ALM).} \usage{ alm(doi = NULL, pmid = NULL, pmcid = NULL, mdid = NULL, url = "http://alm.plos.org/api/v3/articles", info = "totals", months = NULL, days = NULL, year = NULL, source = NULL, key = NULL, curl = getCurlHandle(), total_deta...
/man/alm.Rd
no_license
imclab/alm
R
false
false
4,704
rd
\name{alm} \alias{alm} \title{Retrieve PLoS article-level metrics (ALM).} \usage{ alm(doi = NULL, pmid = NULL, pmcid = NULL, mdid = NULL, url = "http://alm.plos.org/api/v3/articles", info = "totals", months = NULL, days = NULL, year = NULL, source = NULL, key = NULL, curl = getCurlHandle(), total_deta...
# A good starting point (before actually coding the algorithm) is always visualizing the # data. It helps you see any craziness, or if your underlying assumptions (Normal, etc) # are reasonable. # data on my github! train <- read.csv("train.csv", header = T) test <- read.csv("test.csv", header = T) library(ggplot2) ...
/Machine Learning/NaiveBayes/Algorithm.R
no_license
JakeJing/alexhwoods.com
R
false
false
5,854
r
# A good starting point (before actually coding the algorithm) is always visualizing the # data. It helps you see any craziness, or if your underlying assumptions (Normal, etc) # are reasonable. # data on my github! train <- read.csv("train.csv", header = T) test <- read.csv("test.csv", header = T) library(ggplot2) ...
# Exercise 1: Data Frame Practice # Install devtools package: allows installations from GitHub install.packages('devtools') # Install "fueleconomy" package from GitHub devtools::install_github("hadley/fueleconomy") # Require/library the fueleconomy package library(fueleconomy) # You should have have ac...
/ch10-dplyr/exercise-1/exercise.R
permissive
yprisma/INFO-201
R
false
false
1,389
r
# Exercise 1: Data Frame Practice # Install devtools package: allows installations from GitHub install.packages('devtools') # Install "fueleconomy" package from GitHub devtools::install_github("hadley/fueleconomy") # Require/library the fueleconomy package library(fueleconomy) # You should have have ac...
library(extrafont) library(Cairo) graphics.off() CairoPDF("outPlot.pdf",10,7.5) plot.new() trueData=read.table("threeFolder//trueOutPlot.txt",header=FALSE) fitData=read.table("threeFolder//fitData.txt",header=FALSE) par(family="CMU Serif") numDecay=5 numPlots=(length(trueData)-numDecay)/2+numDecay numParameterPlots=12 ...
/createParameterPlots.r
no_license
whitman103/PSO_ODE
R
false
false
1,325
r
library(extrafont) library(Cairo) graphics.off() CairoPDF("outPlot.pdf",10,7.5) plot.new() trueData=read.table("threeFolder//trueOutPlot.txt",header=FALSE) fitData=read.table("threeFolder//fitData.txt",header=FALSE) par(family="CMU Serif") numDecay=5 numPlots=(length(trueData)-numDecay)/2+numDecay numParameterPlots=12 ...
\name{approx.bf} \alias{approx.bf} \title{Internal function, approx.bf} \usage{ approx.bf(p, f, type, N, s, suffix) } \arguments{ \item{p}{p value} \item{f}{MAF} \item{type}{"quant" or "cc"} \item{N}{sample size} \item{s}{proportion of samples that are cases, ignored if type=="quant"} \item{suffix}...
/man/approx.bf.Rd
no_license
mdfortune/coloc
R
false
false
600
rd
\name{approx.bf} \alias{approx.bf} \title{Internal function, approx.bf} \usage{ approx.bf(p, f, type, N, s, suffix) } \arguments{ \item{p}{p value} \item{f}{MAF} \item{type}{"quant" or "cc"} \item{N}{sample size} \item{s}{proportion of samples that are cases, ignored if type=="quant"} \item{suffix}...
library(readr) library(randomForest) set.seed(1) cat("reading the train and test data\n") train <- read_csv("../input/train.csv") test <- read_csv("../input/test.csv") feature.names <- names(train)[2:ncol(train)-1] cat("assuming text variables are categorical & replacing them with numeric ids\n") for (f in feature...
/springleaf/examples/randomforest_example.r
no_license
marutiagarwal/kaggle
R
false
false
1,281
r
library(readr) library(randomForest) set.seed(1) cat("reading the train and test data\n") train <- read_csv("../input/train.csv") test <- read_csv("../input/test.csv") feature.names <- names(train)[2:ncol(train)-1] cat("assuming text variables are categorical & replacing them with numeric ids\n") for (f in feature...
# 20140429_103432 d.tpcc.1_of_3.xfs <- read.table('./L3_C018_1_of_3/m01-xfs/tpcc.p030.tp10s_trx1.jung'); d.tpcc.1_of_3.ext4 <- read.table('./L3_C018_1_of_3/m02-ext4/tpcc.p030.tp10s_trx1.jung'); d.tpcc.1_of_3.f2fs <- read.table('./L3_C018_1_of_3/m03-f2fs/tpcc.p030.tp10s_trx1.jung'); d.tpcc.2_of_3.xfs <- read.table(...
/log/log.gpgizeme/exp/star_parthenon/iowa/p7n.gwp/.parthenon.iowa.tools/.example.rcmd.parthenon.2014s1.tpcc_read_tp10s.r
no_license
blusjune/.bd
R
false
false
5,069
r
# 20140429_103432 d.tpcc.1_of_3.xfs <- read.table('./L3_C018_1_of_3/m01-xfs/tpcc.p030.tp10s_trx1.jung'); d.tpcc.1_of_3.ext4 <- read.table('./L3_C018_1_of_3/m02-ext4/tpcc.p030.tp10s_trx1.jung'); d.tpcc.1_of_3.f2fs <- read.table('./L3_C018_1_of_3/m03-f2fs/tpcc.p030.tp10s_trx1.jung'); d.tpcc.2_of_3.xfs <- read.table(...
library(shiny) # Define UI for application that draws a histogram shinyUI(fluidPage( tags$head( tags$style(HTML(" @import url('//fonts.googleapis.com/css?family=Lobster|Cabin:400,700'); h1 { ...
/TDS3301 - Data Mining/Assignment/Part 2/shiny/ui.R
permissive
jackwong95/MMURandomStuff
R
false
false
1,354
r
library(shiny) # Define UI for application that draws a histogram shinyUI(fluidPage( tags$head( tags$style(HTML(" @import url('//fonts.googleapis.com/css?family=Lobster|Cabin:400,700'); h1 { ...
library(drake) ### Name: cached ### Title: Enumerate cached targets or check if a target is cached. ### Aliases: cached ### ** Examples ## Not run: ##D test_with_dir("Quarantine side effects.", { ##D load_mtcars_example() # Load drake's canonical example. ##D make(my_plan) # Run the project, build all the targets....
/data/genthat_extracted_code/drake/examples/cached.Rd.R
no_license
surayaaramli/typeRrh
R
false
false
899
r
library(drake) ### Name: cached ### Title: Enumerate cached targets or check if a target is cached. ### Aliases: cached ### ** Examples ## Not run: ##D test_with_dir("Quarantine side effects.", { ##D load_mtcars_example() # Load drake's canonical example. ##D make(my_plan) # Run the project, build all the targets....
#' 1.1 List #' #' Returns a row with the latest price for a given stock. #' #' @param text source code of R. Required. #' @return ggplot object. #' @export #' baseball <- function(text= "a <- 1+1", keep.source = TRUE){ library(ggplot2) library(jsonlite) library(readr) writeLines(text, con="input.R") res...
/R/baseball.R
no_license
kruny1001/rRemoteSDSU
R
false
false
522
r
#' 1.1 List #' #' Returns a row with the latest price for a given stock. #' #' @param text source code of R. Required. #' @return ggplot object. #' @export #' baseball <- function(text= "a <- 1+1", keep.source = TRUE){ library(ggplot2) library(jsonlite) library(readr) writeLines(text, con="input.R") res...
# eem.R # # Computes the Stoyan-Grabarnik "exponential energy weights" # # $Revision: 1.4 $ $Date: 2008/07/25 19:51:05 $ # eem <- function(fit, check=TRUE) { verifyclass(fit, "ppm") lambda <- fitted.ppm(fit, check=check) Q <- quad.ppm(fit) Z <- is.data(Q) eemarks <- 1/lambda[Z] attr(eemarks, "type") <- "e...
/R/eem.R
no_license
rubak/spatstat
R
false
false
402
r
# eem.R # # Computes the Stoyan-Grabarnik "exponential energy weights" # # $Revision: 1.4 $ $Date: 2008/07/25 19:51:05 $ # eem <- function(fit, check=TRUE) { verifyclass(fit, "ppm") lambda <- fitted.ppm(fit, check=check) Q <- quad.ppm(fit) Z <- is.data(Q) eemarks <- 1/lambda[Z] attr(eemarks, "type") <- "e...
testit::assert("Strips input text of special chars and returns list", { input1 <- "{\"app_type\":\"patient_platform\",\"type\":\"advice\",\"module\":\"vancomycin_adults\",\"isEMR\":null,\"test_api\":true}\n" output1 <- parse_arg(input1) length(output1) == 5 class(output1) == "list" is.null(output1$isEMR)...
/tests/testit/test-parse_arg.R
permissive
karawoo/json2test
R
false
false
1,243
r
testit::assert("Strips input text of special chars and returns list", { input1 <- "{\"app_type\":\"patient_platform\",\"type\":\"advice\",\"module\":\"vancomycin_adults\",\"isEMR\":null,\"test_api\":true}\n" output1 <- parse_arg(input1) length(output1) == 5 class(output1) == "list" is.null(output1$isEMR)...
rm(list = ls()) library(ggplot2) library(gridExtra) library(dplyr) path <- "../data/" if (!dir.exists(path)) { path <- "../input/" } load_data <- function(file) { return(read.csv(paste0(path, file))) } train <- load_data("train.csv") test <- load_data("test.csv") test$Survived <- rep(NA, nrow(test)) comb <- rbi...
/src/r/kernels/pliptor-optimal-titanic-for-pclass-only-0-65550/script/optimal-titanic-for-pclass-only-0-65550.R
no_license
PRL-PRG/trustworthy-titanic
R
false
false
2,198
r
rm(list = ls()) library(ggplot2) library(gridExtra) library(dplyr) path <- "../data/" if (!dir.exists(path)) { path <- "../input/" } load_data <- function(file) { return(read.csv(paste0(path, file))) } train <- load_data("train.csv") test <- load_data("test.csv") test$Survived <- rep(NA, nrow(test)) comb <- rbi...
library("MASS") ##############################3(a)############################## # Assign values to parameters a = 2 b = 0 n = 500 sigma = matrix(c(1, 0, 0, 0, 1, 0, 0, 0, 1), nrow = 3, byrow = T) mju = c(0, 0, 0) set.seed(1) # Construct the complete dataset z = mvrnorm(n = n, mu = mju, Sigma = sigma) ...
/ida assignment1.R
no_license
yulisong/Coursework1_IDA
R
false
false
7,257
r
library("MASS") ##############################3(a)############################## # Assign values to parameters a = 2 b = 0 n = 500 sigma = matrix(c(1, 0, 0, 0, 1, 0, 0, 0, 1), nrow = 3, byrow = T) mju = c(0, 0, 0) set.seed(1) # Construct the complete dataset z = mvrnorm(n = n, mu = mju, Sigma = sigma) ...