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 |
|---|---|---|---|---|---|---|---|---|---|
#########################################################################
# par function
#View current setting
par()
# Assign the return value from the par() function to plot_pars
plot_pars <- par()
# Display the names of the par() function's list elements
names(plot_pars)
# Display the number of par() function... | /R Data Visualization/R_data_visualization_Plot_mfrow_mfcolumn.R | no_license | akaidkhan/Data_Science_with_R | R | false | false | 2,091 | r | #########################################################################
# par function
#View current setting
par()
# Assign the return value from the par() function to plot_pars
plot_pars <- par()
# Display the names of the par() function's list elements
names(plot_pars)
# Display the number of par() function... |
require(tseries)
require(RJSONIO)
hackZeroes <- function (x) {
for (i in which(x == 0)) {
if (i == 1) {
c = i
while (x[c] == 0) {
c = c + 1
}
x[i] <- x[c]
} else {
x[i] <- x[i - 1]
}
}
x
}
getLogReturns <- ... | /lib/portfolio.R | permissive | natngn/node-finance | R | false | false | 2,541 | r | require(tseries)
require(RJSONIO)
hackZeroes <- function (x) {
for (i in which(x == 0)) {
if (i == 1) {
c = i
while (x[c] == 0) {
c = c + 1
}
x[i] <- x[c]
} else {
x[i] <- x[i - 1]
}
}
x
}
getLogReturns <- ... |
#' Convert a 2D Space to Grid Coordinates
#'
#' Input the limits of a 2D space and the desired image resolution, then
#' the function outputs the appropriate grid/lattice coordinates.
#'
#' @param im.res A vector specifying the dimension/resolution of the image. The
#' first entry is the number of 'rows' in the ... | /R/generate_grid.R | no_license | cran/sim2Dpredictr | R | false | false | 1,488 | r | #' Convert a 2D Space to Grid Coordinates
#'
#' Input the limits of a 2D space and the desired image resolution, then
#' the function outputs the appropriate grid/lattice coordinates.
#'
#' @param im.res A vector specifying the dimension/resolution of the image. The
#' first entry is the number of 'rows' in the ... |
#read in data
power <- read.table("household_power_consumption.txt",
sep = ";",
stringsAsFactors= FALSE,
header=TRUE,
na.strings= "?")
#transform dates
library(lubridate)
power$Date <- dmy(power$Date)
#subset dates to 2007-02-01 and 200... | /plot3.R | no_license | jodanmo/ExData_Plotting1 | R | false | false | 991 | r | #read in data
power <- read.table("household_power_consumption.txt",
sep = ";",
stringsAsFactors= FALSE,
header=TRUE,
na.strings= "?")
#transform dates
library(lubridate)
power$Date <- dmy(power$Date)
#subset dates to 2007-02-01 and 200... |
#' Conversion to Sequence format
#'
#' Converts a data.frame to a \code{Sequence}.
#'
#' @param x a \code{"data.frame"}
#' @param input column id(s) of input parameters
#' @param target column id(s) of target parameters
#'
#' @return Sequence
#'
#'
#' @export
toSequence <- function(x, input, target, sequence=NULL, ...)... | /R/toSequence.R | permissive | brandmaier/bnnlib | R | false | false | 2,404 | r | #' Conversion to Sequence format
#'
#' Converts a data.frame to a \code{Sequence}.
#'
#' @param x a \code{"data.frame"}
#' @param input column id(s) of input parameters
#' @param target column id(s) of target parameters
#'
#' @return Sequence
#'
#'
#' @export
toSequence <- function(x, input, target, sequence=NULL, ...)... |
# summary
```{r}
#'summarise
summary(AM306.recurse$revisitStats)
#'hist of revisits
hist(AM306.recurse$revisits, breaks = 40, col = "grey", border = NA)
#'hsit fpt
fpt = as.numeric(AM306.recurse$revisitStats$timeInside[AM306.recurse$revisitStats$visitIdx == 1])
hist(fpt, breaks = 100, col = "grey", border = NA, xli... | /ele_code/elecode0xrecursemaps.R | no_license | pratikunterwegs/elephantTempKruger | R | false | false | 4,711 | r | # summary
```{r}
#'summarise
summary(AM306.recurse$revisitStats)
#'hist of revisits
hist(AM306.recurse$revisits, breaks = 40, col = "grey", border = NA)
#'hsit fpt
fpt = as.numeric(AM306.recurse$revisitStats$timeInside[AM306.recurse$revisitStats$visitIdx == 1])
hist(fpt, breaks = 100, col = "grey", border = NA, xli... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/semisupervised.R
\name{computeSemiSupervised}
\alias{computeSemiSupervised}
\title{Semi-supervised clustering}
\usage{
computeSemiSupervised(
data.sample,
ML,
CNL,
K = 0,
kmax = 20,
method.name = "Constrained_KM",
maxIter = 2,
... | /man/computeSemiSupervised.Rd | no_license | cran/RclusTool | R | false | true | 3,060 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/semisupervised.R
\name{computeSemiSupervised}
\alias{computeSemiSupervised}
\title{Semi-supervised clustering}
\usage{
computeSemiSupervised(
data.sample,
ML,
CNL,
K = 0,
kmax = 20,
method.name = "Constrained_KM",
maxIter = 2,
... |
library(rms)
### Name: plot.Predict
### Title: Plot Effects of Variables Estimated by a Regression Model Fit
### Aliases: plot.Predict pantext
### Keywords: models hplot htest
### ** Examples
n <- 1000 # define sample size
set.seed(17) # so can reproduce the results
age <- rnorm(n, 50, 10)
blood.press... | /data/genthat_extracted_code/rms/examples/plot.Predict.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 8,571 | r | library(rms)
### Name: plot.Predict
### Title: Plot Effects of Variables Estimated by a Regression Model Fit
### Aliases: plot.Predict pantext
### Keywords: models hplot htest
### ** Examples
n <- 1000 # define sample size
set.seed(17) # so can reproduce the results
age <- rnorm(n, 50, 10)
blood.press... |
ksLdist <-
function (n = 10, sims = 1000, alpha = 0.05)
{
Dn <- c()
DnL <- c()
for (i in 1:sims) {
x <- rnorm(n)
mu <- mean(x)
sig <- sd(x)
Dn[i] <- ks.test(x, pnorm)$statistic
DnL[i] <- ks.test(x, pnorm, mean = mu, sd = sig)$statistic
}
ys <- rang... | /PASWR/R/ksLdist.R | no_license | ingted/R-Examples | R | false | false | 1,185 | r | ksLdist <-
function (n = 10, sims = 1000, alpha = 0.05)
{
Dn <- c()
DnL <- c()
for (i in 1:sims) {
x <- rnorm(n)
mu <- mean(x)
sig <- sd(x)
Dn[i] <- ks.test(x, pnorm)$statistic
DnL[i] <- ks.test(x, pnorm, mean = mu, sd = sig)$statistic
}
ys <- rang... |
\name{collapseTree}
\alias{collapseTree}
\title{Interactive tree visualizer}
\usage{
collapseTree(tree, ...)
}
\arguments{
\item{tree}{an object of class \code{"phylo"}.}
\item{...}{optional arguments. These \emph{mostly} match the arguments of \code{\link{plotSimmap}}, but also include the argument \code{d... | /man/collapseTree.Rd | no_license | Phyo-Khine/phytools | R | false | false | 1,322 | rd | \name{collapseTree}
\alias{collapseTree}
\title{Interactive tree visualizer}
\usage{
collapseTree(tree, ...)
}
\arguments{
\item{tree}{an object of class \code{"phylo"}.}
\item{...}{optional arguments. These \emph{mostly} match the arguments of \code{\link{plotSimmap}}, but also include the argument \code{d... |
setwd('~/Dropbox/ecrc-data-science/2020.05.25_tidyverse-intro/')
library(tidyverse) # data science toolkit
library(magrittr) # tidy operators
library(lubridate) # simple date handling
library(ggsci) # custom color palettes
library(ggpubr) # publication-ready plots
# load the per-state longitudinal data f... | /2020.05.25-tidyverse-intro/me_tidyverse_covid.R | no_license | sxmorgan/ecrc-data-science | R | false | false | 4,132 | r | setwd('~/Dropbox/ecrc-data-science/2020.05.25_tidyverse-intro/')
library(tidyverse) # data science toolkit
library(magrittr) # tidy operators
library(lubridate) # simple date handling
library(ggsci) # custom color palettes
library(ggpubr) # publication-ready plots
# load the per-state longitudinal data f... |
#
# 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/
#
library(shiny)
library(shinydashboard)
# Define UI for application that draws a histogram... | /APPS/Boxplot/ui.R | no_license | smacneil1/genomicsAPI | R | false | false | 2,094 | 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/
#
library(shiny)
library(shinydashboard)
# Define UI for application that draws a histogram... |
# Change all __3_s, Download information, and edit the plot and ggplotly arguments below:
# Build Download Button and Output DataTable---------------
output$download__3_ <- downloadHandler(
filename = function(){"Boxplot2.csv"},
content = function(fname){
write.csv(dfB1(), fname)
}
)
output$table__3_ <- rend... | /Project_4/jeffspart/BoxPlot2Server.R | no_license | Arinze95/CS329DataViz | R | false | false | 1,965 | r | # Change all __3_s, Download information, and edit the plot and ggplotly arguments below:
# Build Download Button and Output DataTable---------------
output$download__3_ <- downloadHandler(
filename = function(){"Boxplot2.csv"},
content = function(fname){
write.csv(dfB1(), fname)
}
)
output$table__3_ <- rend... |
\name{Model eval and sensitivity}
\alias{model.eval}
\alias{sens}
\alias{msens}
\alias{mway.fact}
\alias{mway.samp}
\title{Model evaluation and sensitivity analysis}
\description{
Function model.eval provides calculation of errors between observed or reference values and simulated values.
Function sens provides sens... | /man/model.eval.sens.Rd | no_license | cran/seem | R | false | false | 9,297 | rd | \name{Model eval and sensitivity}
\alias{model.eval}
\alias{sens}
\alias{msens}
\alias{mway.fact}
\alias{mway.samp}
\title{Model evaluation and sensitivity analysis}
\description{
Function model.eval provides calculation of errors between observed or reference values and simulated values.
Function sens provides sens... |
#predicting whether s2 replicates given s1. Different Sample Size
library(tidyverse)
library(MASS)
library(ggplot2)
library(dplyr)
library(plyr)
library(reshape2)
#reading in data
filename<-"25035420_data_upbuilt_filtered_upbuilt.csv"
data<-read.csv(filename, sep=" ")
z_score <- qnorm(0.025,lower.tail =FALSE)
#ne... | /predicting real data/not useful anymore/scalingFactor.R | no_license | jzhou1011/replication | R | false | false | 947 | r | #predicting whether s2 replicates given s1. Different Sample Size
library(tidyverse)
library(MASS)
library(ggplot2)
library(dplyr)
library(plyr)
library(reshape2)
#reading in data
filename<-"25035420_data_upbuilt_filtered_upbuilt.csv"
data<-read.csv(filename, sep=" ")
z_score <- qnorm(0.025,lower.tail =FALSE)
#ne... |
# using tm was incredibly slow and couldn't handle a big chunk of data.. 3% was a stretch
# so I've moved that below and am trying out the stylo and slam package with 10% of the txt data
setwd("/Users/frankCorrigan/Desktop/en_US/")
# read news file
newsfile <- "en_US.news.txt"
# lineCount <- length(readLines(newsfile... | /Text_Prediction_App/working_analysis.R | no_license | FrankRuns/Datasciencecoursera | R | false | false | 3,066 | r | # using tm was incredibly slow and couldn't handle a big chunk of data.. 3% was a stretch
# so I've moved that below and am trying out the stylo and slam package with 10% of the txt data
setwd("/Users/frankCorrigan/Desktop/en_US/")
# read news file
newsfile <- "en_US.news.txt"
# lineCount <- length(readLines(newsfile... |
#A script to sequentically read in all the files in a driectory, combine to a large dataframe and merge on gene to a single dataframe
setwd('~/Documents/public-datasets/TCGA/expressionData/Expression-Genes/')
#a function to define files
map.func = function(masterFileList) { #takes a dataframe listing the files and re... | /PhD/120727-poolGeneExpressionTCGA-V2.R | no_license | dvbrown/Rscripts | R | false | false | 1,658 | r | #A script to sequentically read in all the files in a driectory, combine to a large dataframe and merge on gene to a single dataframe
setwd('~/Documents/public-datasets/TCGA/expressionData/Expression-Genes/')
#a function to define files
map.func = function(masterFileList) { #takes a dataframe listing the files and re... |
location <- read.csv(file="https://assets.datacamp.com/production/repositories/718/datasets/571628c39048df59c40c9dcfba146a2cf7a4a0e3/locations.csv")
str(location)
head(location)
tail(location)
is.na(crime)
##Basic EDA
location%>%
count(location)%>%
mutate(mean_diff=n-mean(n, na.rm= TRUE))%>%
mutate(fill=as.factor... | /ml3.R | no_license | Isuru657/Machine_Learning_R | R | false | false | 1,554 | r | location <- read.csv(file="https://assets.datacamp.com/production/repositories/718/datasets/571628c39048df59c40c9dcfba146a2cf7a4a0e3/locations.csv")
str(location)
head(location)
tail(location)
is.na(crime)
##Basic EDA
location%>%
count(location)%>%
mutate(mean_diff=n-mean(n, na.rm= TRUE))%>%
mutate(fill=as.factor... |
/BT10_BT11_duyet_cay_theo_thu_tu_truoc_va_sau.R | no_license | lethingoctham/DO_AN | R | false | false | 584 | r | ||
# CMEE 2020 HPC excercises R code HPC run code proforma
rm(list=ls()) # good practice
graphics.off()
# source("ks3020/ks3020_HPC_2020_main.R")
source("/rds/general/user/ks3020/home/ks3020_HPC_2020_main.R")
speciation_rate <- 0.0052497
# speciation_rate <- 0.0021255
community_size_vec <- c(500, 1000, 2500, 5000)
ite... | /Code/ks3020_HPC_2020_cluster.R | no_license | Kyle-J-Sun/CMEE_HPC | R | false | false | 893 | r | # CMEE 2020 HPC excercises R code HPC run code proforma
rm(list=ls()) # good practice
graphics.off()
# source("ks3020/ks3020_HPC_2020_main.R")
source("/rds/general/user/ks3020/home/ks3020_HPC_2020_main.R")
speciation_rate <- 0.0052497
# speciation_rate <- 0.0021255
community_size_vec <- c(500, 1000, 2500, 5000)
ite... |
# Author: Ian Lundberg (ilundberg@princeton.edu)
# Title: A causal approach to study interventions that close gaps across social categories
# Paper is a working draft. Code will be posted on the Harvard Dataverse when the paper is finalized for publication.
# To run this code, you will need the private files in ... | /gap_closing_estimand/class_gap_plots.R | no_license | SidoniaM7/replication | R | false | false | 18,662 | r |
# Author: Ian Lundberg (ilundberg@princeton.edu)
# Title: A causal approach to study interventions that close gaps across social categories
# Paper is a working draft. Code will be posted on the Harvard Dataverse when the paper is finalized for publication.
# To run this code, you will need the private files in ... |
# load a data set, from the pre-processed data matrix
geex.load.dataset<-function(cll, ds.longname) {
if (identical(cll, NA)) NA else {
smp<-cll$metadata$Sample;
ds<-cll$metadata$Dataset;
ds.id<-cll$mapping$longname2id[ds.longname];
ds.id<-as.vector(ds.id[ds.id %in% rownames(ds)][1]);
if (length(... | /geex/source/geex.load.collection.r | no_license | zhezhangsh/awsomics | R | false | false | 2,962 | r | # load a data set, from the pre-processed data matrix
geex.load.dataset<-function(cll, ds.longname) {
if (identical(cll, NA)) NA else {
smp<-cll$metadata$Sample;
ds<-cll$metadata$Dataset;
ds.id<-cll$mapping$longname2id[ds.longname];
ds.id<-as.vector(ds.id[ds.id %in% rownames(ds)][1]);
if (length(... |
suppressMessages(suppressWarnings(library(tidyverse)))
suppressMessages(suppressWarnings(library(VennDiagram)))
# root_dir <- "/home/yixin/Desktop/github_repo/de_novo_miRNA"
# ortholog_in <- "/home/yixin/Desktop/github_repo/de_novo_miRNA/external_resources/flybase/dmel_dsim_orthologs.csv"
# output_dir <- "."
root_dir... | /scripts/RNAseq/compare_misregulated_genes.R | no_license | EasyPiPi/de_novo_miRNA | R | false | false | 6,911 | r | suppressMessages(suppressWarnings(library(tidyverse)))
suppressMessages(suppressWarnings(library(VennDiagram)))
# root_dir <- "/home/yixin/Desktop/github_repo/de_novo_miRNA"
# ortholog_in <- "/home/yixin/Desktop/github_repo/de_novo_miRNA/external_resources/flybase/dmel_dsim_orthologs.csv"
# output_dir <- "."
root_dir... |
repfixt <- function(alpha, gamma, t, sigma_a, sigma_e)
{ r <- 1
power <- 0
nu1 <- t-1
while(power < gamma) {
r <- r+1
nu2 <- t*(r-1)
tau <- (sigma_a/sigma_e)^2
lambda <- sqrt(1+r*tau)
Fcr <- qf(1-alpha, nu1, nu2)
C <- (1/lambda^2)... | /tamu/design_exp/R/RepSizeRandEffectFixedt_Findr.R | no_license | sadepu1915/data-science | R | false | false | 455 | r |
repfixt <- function(alpha, gamma, t, sigma_a, sigma_e)
{ r <- 1
power <- 0
nu1 <- t-1
while(power < gamma) {
r <- r+1
nu2 <- t*(r-1)
tau <- (sigma_a/sigma_e)^2
lambda <- sqrt(1+r*tau)
Fcr <- qf(1-alpha, nu1, nu2)
C <- (1/lambda^2)... |
test_that("Set Repos", {
context("Repos")
r = getOption("repos")
set_repos(rprofile_test1 = "example.com", rprofile_test2 = "example.com")
expect_equal(length(getOption("repos")) - length(r), 2)
options(repos = r)
})
| /tests/testthat/test_repos.R | no_license | csgillespie/rprofile | R | false | false | 227 | r | test_that("Set Repos", {
context("Repos")
r = getOption("repos")
set_repos(rprofile_test1 = "example.com", rprofile_test2 = "example.com")
expect_equal(length(getOption("repos")) - length(r), 2)
options(repos = r)
})
|
# scatterplot
options(stringsAsFactors=FALSE) # for compatibile code between us
library(tidyverse)
library(gridExtra) # easy for putting graphs onto the same page (just use ggarrange(graph1, graph2, ncol = # of display
# columns, nrow = #row))
setwd("~/Documents/UCSC/Junior/Treehouse/OutlierRNAseq_Treehouse_Repo/c... | /ScatterPlotZerosAnd95thpctl.R | no_license | liammckay19/OutlierRNAseq_Treehouse_Repo | R | false | false | 1,151 | r | # scatterplot
options(stringsAsFactors=FALSE) # for compatibile code between us
library(tidyverse)
library(gridExtra) # easy for putting graphs onto the same page (just use ggarrange(graph1, graph2, ncol = # of display
# columns, nrow = #row))
setwd("~/Documents/UCSC/Junior/Treehouse/OutlierRNAseq_Treehouse_Repo/c... |
#' @title
#' The contestant now has the oppurtunity to switch their pick to the
#' other avalible door.
#'
#' @description
#' 'change_door()' will allow the contestant to switch their initial
#' pick to the other avalible door, after one goat door has been opened.
#'
#' @details
#' At this point in the game, one of the... | /R/change_door.R | no_license | nicolehillsmall/monty-hall | R | false | false | 1,422 | r | #' @title
#' The contestant now has the oppurtunity to switch their pick to the
#' other avalible door.
#'
#' @description
#' 'change_door()' will allow the contestant to switch their initial
#' pick to the other avalible door, after one goat door has been opened.
#'
#' @details
#' At this point in the game, one of the... |
library(shiny,verbose=FALSE)
library(shinyBS,verbose=FALSE) # for popup figures
shinyUI(
fluidPage(
# Application title
sidebarLayout(
sidebarPanel(
titlePanel("ShinyGO v0.41: Gene Ontology Enrichment Analysis + more"),
p(HTML("<div align=\"right\"> <A HREF=\"javascript:history.go(0)\">Re... | /shinyapps/go/ui.R | no_license | mlebeur/idep | R | false | false | 9,935 | r | library(shiny,verbose=FALSE)
library(shinyBS,verbose=FALSE) # for popup figures
shinyUI(
fluidPage(
# Application title
sidebarLayout(
sidebarPanel(
titlePanel("ShinyGO v0.41: Gene Ontology Enrichment Analysis + more"),
p(HTML("<div align=\"right\"> <A HREF=\"javascript:history.go(0)\">Re... |
#This version works will output base level information in a compact way. e.g., categorization will be done at gene level and feature configuration level.
# When generating base-level mutation rate and features, the 50-bp windows data.frame will be partitioned based on genename
# and each partition will be processed to ... | /lib/160202_temp.R | no_license | liu-genomics/ASD | R | false | false | 17,716 | r | #This version works will output base level information in a compact way. e.g., categorization will be done at gene level and feature configuration level.
# When generating base-level mutation rate and features, the 50-bp windows data.frame will be partitioned based on genename
# and each partition will be processed to ... |
if (interactive()) library(testthat)
test_that("cleandata functions work", {
expect_false(
any(sapply(membersurvey, has_dont_know))
)
expect_equal(
membersurvey$Q2,
remove_dont_know(membersurvey$Q2)
)
expect_equal(
membersurvey,
remove_all_dont_know(membersurvey)
)
exp... | /tests/testthat/test-10-cleandata.R | no_license | cran/surveydata | R | false | false | 879 | r | if (interactive()) library(testthat)
test_that("cleandata functions work", {
expect_false(
any(sapply(membersurvey, has_dont_know))
)
expect_equal(
membersurvey$Q2,
remove_dont_know(membersurvey$Q2)
)
expect_equal(
membersurvey,
remove_all_dont_know(membersurvey)
)
exp... |
###################################################
### code chunk number 6: sim3x3
###################################################
par(mfrow = c(3, 3))
sim.u <- -0.05 # growth rate
sim.Q <- 0.02 # process error variance
sim.R <- 0.05 # non-process error variance
nYr <- 50 # number of years of data to generate
frac... | /inst/userguide/figures/CS1--sim3x3.R | permissive | nwfsc-timeseries/MARSS | R | false | false | 1,202 | r | ###################################################
### code chunk number 6: sim3x3
###################################################
par(mfrow = c(3, 3))
sim.u <- -0.05 # growth rate
sim.Q <- 0.02 # process error variance
sim.R <- 0.05 # non-process error variance
nYr <- 50 # number of years of data to generate
frac... |
<?xml version="1.0" encoding="utf-8"?>
<serviceModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="WindowsAzureGumball" generation="1" functional="0" release="0" Id="69dd2914-2108-49d8-a1bc-5f0b3611c3b6" dslVersion="1.2.0.0" xmlns="http://schemas.microsoft.com... | /azure/vs2012/WindowsAzureGumball (V1)/WindowsAzureGumball/csx/Debug/ServiceDefinition.rd | no_license | vkotu/cmpe281 | R | false | false | 4,699 | rd | <?xml version="1.0" encoding="utf-8"?>
<serviceModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="WindowsAzureGumball" generation="1" functional="0" release="0" Id="69dd2914-2108-49d8-a1bc-5f0b3611c3b6" dslVersion="1.2.0.0" xmlns="http://schemas.microsoft.com... |
x <- sample(x = 1:100, size = 100, replace = TRUE)
x
mean(x)
grades <- c(95, 72, 87, 66)
weights <- c(1/2, 1/4, 1/8, 1/8)
mean(grades)
weighted.mean(x=grades, weights)
var(x)
sum((x -)mean(x))^2)/length(x)-1)
sqrt(var(x))
sd(x)
min(x)
max(x)
median(x)
summary(x)
quantile(x, probs = c(0.25,0.75))
| /Oct10 2015.r | no_license | FriendlyUser/Stats255-R | R | false | false | 304 | r | x <- sample(x = 1:100, size = 100, replace = TRUE)
x
mean(x)
grades <- c(95, 72, 87, 66)
weights <- c(1/2, 1/4, 1/8, 1/8)
mean(grades)
weighted.mean(x=grades, weights)
var(x)
sum((x -)mean(x))^2)/length(x)-1)
sqrt(var(x))
sd(x)
min(x)
max(x)
median(x)
summary(x)
quantile(x, probs = c(0.25,0.75))
|
#Trading Desk problem
#Deepansha Tiwari
#installing the required packages
install.packages("plyr")
library(plyr)
#set the working directory
setwd('~/Documents/Trading Desk')
#import data from given files
cab<-read.csv("CapitalAccountBalances.csv", header = TRUE)
tab<-read.csv("TradingAccountBalances.csv", header = ... | /trading.R | no_license | deepansha-tiwari/tradingDesk | R | false | false | 1,177 | r | #Trading Desk problem
#Deepansha Tiwari
#installing the required packages
install.packages("plyr")
library(plyr)
#set the working directory
setwd('~/Documents/Trading Desk')
#import data from given files
cab<-read.csv("CapitalAccountBalances.csv", header = TRUE)
tab<-read.csv("TradingAccountBalances.csv", header = ... |
##########################################
# ki longitudinal manuscripts
# stunting analysis
# plot mean LAZ by age
# by strata of age of incident stunting
# Inputs:
# - 0-config.R
# - meanlaz_age_incage.RDS
# - meanlaz_age_incage_monthly.RDS
# Outputs:
# - fig-meanlaz_age_incage.png
# - fig-meanlaz_age_in... | /5-visualizations/stunting/0-extra/fig3b-stunting-meanlaz-incage.R | no_license | child-growth/ki-longitudinal-growth | R | false | false | 4,344 | r | ##########################################
# ki longitudinal manuscripts
# stunting analysis
# plot mean LAZ by age
# by strata of age of incident stunting
# Inputs:
# - 0-config.R
# - meanlaz_age_incage.RDS
# - meanlaz_age_incage_monthly.RDS
# Outputs:
# - fig-meanlaz_age_incage.png
# - fig-meanlaz_age_in... |
#' @title List Available Feature Sets
#'
#' @description Lists all available feature sets w.r.t. certain restrictions.
#'
#' @param subset [\code{\link{character}}]\cr
#' Vector of feature sets, which should be considered. If not defined, all
#' features will be considered.
#'
#' @param allow.cellmapping [\code{\link{l... | /flacco/R/listAvailableFeatures.R | no_license | ingted/R-Examples | R | false | false | 1,993 | r | #' @title List Available Feature Sets
#'
#' @description Lists all available feature sets w.r.t. certain restrictions.
#'
#' @param subset [\code{\link{character}}]\cr
#' Vector of feature sets, which should be considered. If not defined, all
#' features will be considered.
#'
#' @param allow.cellmapping [\code{\link{l... |
#' Export content to target
#'
#' Determine the type and dispatch to that method to produce
#' files to serve up as the final viz
#'
#' Currently the publish phase is responsible for exporting,
#' but this could be separated in the future.
#'
#'
#' @param viz object to export
#' @return location to export or NULL if ex... | /R/export.R | permissive | USGS-VIZLAB/vizlab | R | false | false | 3,490 | r | #' Export content to target
#'
#' Determine the type and dispatch to that method to produce
#' files to serve up as the final viz
#'
#' Currently the publish phase is responsible for exporting,
#' but this could be separated in the future.
#'
#'
#' @param viz object to export
#' @return location to export or NULL if ex... |
library(shiny)
load("Newdata1.rda")
# Define UI for application that draws a histogram
ui <- fluidPage(
plotlyOutput("plot1"),
tableOutput("table1")
)
# Define server logic required to draw a histogram
server <- function(input, output) {
output$plot1 <- renderPlotly({
plot_ly(Newdata1, x = ~... | /Shiny_Plotly_app.R | no_license | anu87/PEPFAR_vl_wrangling_code | R | false | false | 766 | r | library(shiny)
load("Newdata1.rda")
# Define UI for application that draws a histogram
ui <- fluidPage(
plotlyOutput("plot1"),
tableOutput("table1")
)
# Define server logic required to draw a histogram
server <- function(input, output) {
output$plot1 <- renderPlotly({
plot_ly(Newdata1, x = ~... |
# R tips and little tidbits
# I don't know how I should structure all of this but it is swirl notes
#### Tips
# you can get random data sets with data()
# save entire workspace with save.image()
# You can edit data with a gui by using the edit command
# edit(mtcars) as an example. Remember you have to set the
# da... | /Learning/randomThingsandSwirl.R | no_license | davidrbright/r | R | false | false | 6,562 | r | # R tips and little tidbits
# I don't know how I should structure all of this but it is swirl notes
#### Tips
# you can get random data sets with data()
# save entire workspace with save.image()
# You can edit data with a gui by using the edit command
# edit(mtcars) as an example. Remember you have to set the
# da... |
# Install from CRAN
install.packages("lwgeom", repos = "https://cran.rstudio.com")
# Run example from the manual
library(lwgeom)
library(sf)
x = st_sfc(st_polygon(list(rbind(c(0,0),c(0.5,0),c(0.5,0.5),c(0.5,0),c(1,0),c(1,1),c(0,1),c(0,0)))))
y = lwgeom::st_make_valid(x) | /packages/lwgeom/test.R | permissive | d-sidd/shinyapps-package-dependencies | R | false | false | 278 | r | # Install from CRAN
install.packages("lwgeom", repos = "https://cran.rstudio.com")
# Run example from the manual
library(lwgeom)
library(sf)
x = st_sfc(st_polygon(list(rbind(c(0,0),c(0.5,0),c(0.5,0.5),c(0.5,0),c(1,0),c(1,1),c(0,1),c(0,0)))))
y = lwgeom::st_make_valid(x) |
# Get the data.
myurl <- "https://docs.google.com/spreadsheets/d/e/2PACX-1vSV4O64FOQthFtMQGxa9Z6bAjQ-gGG-a26PmiSVVrAKiL5O0aY-z37rwwMejueycckn8U3x9DQfG-If/pub?gid=915553877&single=true&output=csv"
x <- read.csv(url(myurl), header=TRUE)
# Set up plotting parameters.
thismin <- 1
thismax <- 5
thisstep <- 0.1
dotcex <- 1.... | /getData.R | no_license | pbgpg/MLT-Mock-Interview | R | false | false | 880 | r | # Get the data.
myurl <- "https://docs.google.com/spreadsheets/d/e/2PACX-1vSV4O64FOQthFtMQGxa9Z6bAjQ-gGG-a26PmiSVVrAKiL5O0aY-z37rwwMejueycckn8U3x9DQfG-If/pub?gid=915553877&single=true&output=csv"
x <- read.csv(url(myurl), header=TRUE)
# Set up plotting parameters.
thismin <- 1
thismax <- 5
thisstep <- 0.1
dotcex <- 1.... |
#' Condition on data
#'
#' Observe data and condition on it to obtain posterior probabilities
#' over models.
#'
#' @export
#'
observe <- function(...) UseMethod("observe")
#' @export
observe.bayesbb <- function(bb, x) {
x <- as.logical(x)
if (!bayesbb_has_evidence(bb)) {
bb$prior <- bb
}
bb... | /R/inference.R | permissive | pschulam-attic/bayesbb | R | false | false | 925 | r | #' Condition on data
#'
#' Observe data and condition on it to obtain posterior probabilities
#' over models.
#'
#' @export
#'
observe <- function(...) UseMethod("observe")
#' @export
observe.bayesbb <- function(bb, x) {
x <- as.logical(x)
if (!bayesbb_has_evidence(bb)) {
bb$prior <- bb
}
bb... |
getwd()
setwd("C:/Users/anshu/Desktop/UNCC Courses/Big data Analytics/project")
data <- read.csv("train1.csv", sep=",", header=T, strip.white = T, na.strings = c("NA","NaN","","?"))
data_new <- data %>% select(PolicyNo,
Vehicle_Make_Year,
Vehicle_Number_... | /RF on training data.R | no_license | anshusingh43/Auto-Insurance-Loss-ratio-Prediction | R | false | false | 1,835 | r | getwd()
setwd("C:/Users/anshu/Desktop/UNCC Courses/Big data Analytics/project")
data <- read.csv("train1.csv", sep=",", header=T, strip.white = T, na.strings = c("NA","NaN","","?"))
data_new <- data %>% select(PolicyNo,
Vehicle_Make_Year,
Vehicle_Number_... |
# rpennpractice
# 06/11/2020
# Mercedes Horn
### Packages
library(gapminder)
library(dplyr)
library(ggplot2)
library(tidyr)
### Question 1
# work
range(gapminder[3])
# answer
#### 1952 to 2007, ie 56 years
### Question 2
# answer
print(gapminder,n=20)
summary(gapminder)
### Question 3
# answer
gapmi... | /rpennpractice.R | permissive | mlkhorn/ftc_cosore | R | false | false | 1,588 | r | # rpennpractice
# 06/11/2020
# Mercedes Horn
### Packages
library(gapminder)
library(dplyr)
library(ggplot2)
library(tidyr)
### Question 1
# work
range(gapminder[3])
# answer
#### 1952 to 2007, ie 56 years
### Question 2
# answer
print(gapminder,n=20)
summary(gapminder)
### Question 3
# answer
gapmi... |
#' module_gcamusa_batch_resources_USA_xml
#'
#' Construct XML data structure for \code{resources_USA.xml}.
#'
#' @param command API command to execute
#' @param ... other optional parameters, depending on command
#' @return Depends on \code{command}: either a vector of required inputs,
#' a vector of output names, or (... | /input/gcamdata/R/zchunk_batch_resources_USA_xml.R | permissive | thuliuyang/gcam-core | R | false | false | 4,165 | r | #' module_gcamusa_batch_resources_USA_xml
#'
#' Construct XML data structure for \code{resources_USA.xml}.
#'
#' @param command API command to execute
#' @param ... other optional parameters, depending on command
#' @return Depends on \code{command}: either a vector of required inputs,
#' a vector of output names, or (... |
install.packages("e1071")
library(e1071)
## Load “ASW.dat”
data = read.table(file.choose(), header = TRUE)
## Run K-means clustering
m = kmeans(data, 3)
## The result of clustering is saved as factor “y”
y = as.factor(m$cluster)
## Run SVM (cost = .1)
data_svm = svm(y ~ Corrected.Por + TOC, scale=F, c... | /HW3.R | no_license | jeon2152/Data-Mining-for-PE | R | false | false | 2,348 | r | install.packages("e1071")
library(e1071)
## Load “ASW.dat”
data = read.table(file.choose(), header = TRUE)
## Run K-means clustering
m = kmeans(data, 3)
## The result of clustering is saved as factor “y”
y = as.factor(m$cluster)
## Run SVM (cost = .1)
data_svm = svm(y ~ Corrected.Por + TOC, scale=F, c... |
testlist <- list(x = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0), y = numeric(0))
result <- do.call(blorr:::blr_pairs_cpp,testlist)
str(result) | /blorr/inst/testfiles/blr_pairs_cpp/libFuzzer_blr_pairs_cpp/blr_pairs_cpp_valgrind_files/1609956752-test.R | no_license | akhikolla/updated-only-Issues | R | false | false | 131 | r | testlist <- list(x = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0), y = numeric(0))
result <- do.call(blorr:::blr_pairs_cpp,testlist)
str(result) |
calculate_BaySeq <-
function(project_name) {
Project <- project_name
message=paste("You are using the project: ",Project,sep="")
print(message)
openFile <- function(button,user.data) {
dialog <- gtkFileChooserDialog("Open File",window,c("open","modal","destroy-with-parent"),"gtk-cancel", GtkResponseType["cancel... | /R/calculate_BaySeq.R | no_license | drighelli/RNASeqGUI | R | false | false | 12,513 | r | calculate_BaySeq <-
function(project_name) {
Project <- project_name
message=paste("You are using the project: ",Project,sep="")
print(message)
openFile <- function(button,user.data) {
dialog <- gtkFileChooserDialog("Open File",window,c("open","modal","destroy-with-parent"),"gtk-cancel", GtkResponseType["cancel... |
################################################################################
# Joshua C. Fjelstul, Ph.D.
# codebookr R package
################################################################################
#' Create a PDF codebook
#'
#' This function generates \code{LaTeX} code (a \code{.tex} file) for a
#' nice... | /R/create_codebook.R | no_license | jfjelstul/codebookr | R | false | false | 9,302 | r | ################################################################################
# Joshua C. Fjelstul, Ph.D.
# codebookr R package
################################################################################
#' Create a PDF codebook
#'
#' This function generates \code{LaTeX} code (a \code{.tex} file) for a
#' nice... |
library(rJava);
library(Rwordseg);
#********************************************
#对文档进行分词操作
#选择文本进行读入
path <- "E:\\R-workspace\\Test4\\word" ##文件目录
fileNames <- dir(path) ##获取该路径下的文件名
for(i in 1:length(fileNames))
{
path<-paste0("E:\\R-workspace\\Test4\\word\\",fileNames[i])
lecture=read.table(path... | /main.R | no_license | TowerLoong/R-judge | R | false | false | 1,131 | r | library(rJava);
library(Rwordseg);
#********************************************
#对文档进行分词操作
#选择文本进行读入
path <- "E:\\R-workspace\\Test4\\word" ##文件目录
fileNames <- dir(path) ##获取该路径下的文件名
for(i in 1:length(fileNames))
{
path<-paste0("E:\\R-workspace\\Test4\\word\\",fileNames[i])
lecture=read.table(path... |
##########################################
#### Create processing mask
##########################################
#### | Project name: Agriculture modeling
#### | Creator: Mirza Cengic
#### | Contact: mirzaceng@gmail.com
##########################################
# Load packages ------------------------------------... | /code/Data_processing/Processing_mask.R | no_license | MirzaCengic/agriculture_suitability | R | false | false | 2,776 | r | ##########################################
#### Create processing mask
##########################################
#### | Project name: Agriculture modeling
#### | Creator: Mirza Cengic
#### | Contact: mirzaceng@gmail.com
##########################################
# Load packages ------------------------------------... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/print.R
\name{print.msdpdth}
\alias{print.msdpdth}
\title{Print method for msdpdth class}
\usage{
\method{print}{msdpdth}(x, ...)
}
\arguments{
\item{x}{msdpdth class}
\item{...}{other parameters}
}
\value{
A data.frame containing the coeffi... | /man/print.msdpdth.Rd | permissive | hayeszhou/sdpdth | R | false | true | 590 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/print.R
\name{print.msdpdth}
\alias{print.msdpdth}
\title{Print method for msdpdth class}
\usage{
\method{print}{msdpdth}(x, ...)
}
\arguments{
\item{x}{msdpdth class}
\item{...}{other parameters}
}
\value{
A data.frame containing the coeffi... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ftdoi_other.R
\name{ftd_prefixes}
\alias{ftd_prefixes}
\title{Prefixes}
\usage{
ftd_prefixes(id = NULL)
}
\arguments{
\item{id}{(character) a DOI prefix. Default is \code{NULL}, which
gets all}
}
\value{
named list of details of the publisher... | /man/ftd_prefixes.Rd | no_license | cran/fulltext | R | false | true | 690 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ftdoi_other.R
\name{ftd_prefixes}
\alias{ftd_prefixes}
\title{Prefixes}
\usage{
ftd_prefixes(id = NULL)
}
\arguments{
\item{id}{(character) a DOI prefix. Default is \code{NULL}, which
gets all}
}
\value{
named list of details of the publisher... |
#' @title Plot asb object
#'
#' @description
#' Plot 2 taxonomic levels using a sunburst visualization.
#'
#' @param x an object of class asb generatated with `as_biomonitor`.
#' @param parent name of the coarser taxonomic level.
#' @param child name of the finer taxonomic level.
#' @param type plot present-absence dat... | /R/plot_asb.R | no_license | TommasoCanc/biomonitoR | R | false | false | 2,994 | r | #' @title Plot asb object
#'
#' @description
#' Plot 2 taxonomic levels using a sunburst visualization.
#'
#' @param x an object of class asb generatated with `as_biomonitor`.
#' @param parent name of the coarser taxonomic level.
#' @param child name of the finer taxonomic level.
#' @param type plot present-absence dat... |
data<-read.csv('D:/Dropbox/studies/Data Science/2 R programming/Week 1/quiz1_data/hw1_data.csv',header=TRUE)
print(names(data))
head(data)
tail(data)
nrow(data)
data[47,1:3] #first 3 columns of row 47
sum(is.na(data[,1])) #number of missing values in 1st column
mean(na.omit(data[,1]))#mean values WITHOUT na
#OR
ozone... | /2 R programming/R basics.R | no_license | roeeorland/Data-Science | R | false | false | 459 | r | data<-read.csv('D:/Dropbox/studies/Data Science/2 R programming/Week 1/quiz1_data/hw1_data.csv',header=TRUE)
print(names(data))
head(data)
tail(data)
nrow(data)
data[47,1:3] #first 3 columns of row 47
sum(is.na(data[,1])) #number of missing values in 1st column
mean(na.omit(data[,1]))#mean values WITHOUT na
#OR
ozone... |
library(jpeg)
library(Hmisc)
library(plyr)
if(!file.exists(".data")) {
dir.create(".data")
}
if(!file.exists(".data/housing_hid.csv")) {
fileUrl <- "https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06hid.csv"
download.file(fileUrl, destfile=".data/housing_hid.csv", method="curl")
}
housing <- read.csv(... | /gandc_quiz3.R | no_license | ysusuk/datasciencecoursera | R | false | false | 2,000 | r | library(jpeg)
library(Hmisc)
library(plyr)
if(!file.exists(".data")) {
dir.create(".data")
}
if(!file.exists(".data/housing_hid.csv")) {
fileUrl <- "https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06hid.csv"
download.file(fileUrl, destfile=".data/housing_hid.csv", method="curl")
}
housing <- read.csv(... |
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307393727e+77, 2.42075311149161e-308, 1.22810536108214e+146, 4.12396251261199e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(10L, 3L)))
result <- do.call(CNull:::communities_individual_based_sampling... | /CNull/inst/testfiles/communities_individual_based_sampling_alpha/AFL_communities_individual_based_sampling_alpha/communities_individual_based_sampling_alpha_valgrind_files/1615780941-test.R | no_license | akhikolla/updatedatatype-list2 | R | false | false | 348 | r | testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307393727e+77, 2.42075311149161e-308, 1.22810536108214e+146, 4.12396251261199e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(10L, 3L)))
result <- do.call(CNull:::communities_individual_based_sampling... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_user_info.R
\name{get_user_info}
\alias{get_user_info}
\title{Predict gender using name word and character n-grams}
\usage{
get_user_info(user_ids, credential = NULL, rawdata = FALSE,
datadir = "", is_id = "")
}
\arguments{
\item{user_i... | /demographicDetection/man/get_user_info.Rd | no_license | ensoesie/digitalpophealth | R | false | true | 1,027 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_user_info.R
\name{get_user_info}
\alias{get_user_info}
\title{Predict gender using name word and character n-grams}
\usage{
get_user_info(user_ids, credential = NULL, rawdata = FALSE,
datadir = "", is_id = "")
}
\arguments{
\item{user_i... |
#' Fit the \code{aspic} biomass dynamic model.
#'
#' @description
#' Fits the aspic model to catch and catch per unit effort data
#'
#' @param object; an \code{aspic} object
#' @param dir; an optional \code{dir} where aspic text files used for fitting can be found
#' @return An aspic object with fitted values and p... | /R/aspic-exe.R | no_license | iagomosqueira/aspic | R | false | false | 12,097 | r | #' Fit the \code{aspic} biomass dynamic model.
#'
#' @description
#' Fits the aspic model to catch and catch per unit effort data
#'
#' @param object; an \code{aspic} object
#' @param dir; an optional \code{dir} where aspic text files used for fitting can be found
#' @return An aspic object with fitted values and p... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/SelectCSAFEDocs.R
\name{select_template_docs}
\alias{select_template_docs}
\title{select_template_docs}
\usage{
select_template_docs(num_writers, sessions, reps, prompts, seed)
}
\arguments{
\item{num_writers}{Integer number of writers to ran... | /man/select_template_docs.Rd | no_license | CSAFE-ISU/handwriter | R | false | true | 692 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/SelectCSAFEDocs.R
\name{select_template_docs}
\alias{select_template_docs}
\title{select_template_docs}
\usage{
select_template_docs(num_writers, sessions, reps, prompts, seed)
}
\arguments{
\item{num_writers}{Integer number of writers to ran... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/renamefiles.r
\name{renamefiles}
\alias{renamefiles}
\title{Rename a bunch of files in a directory with the same regex procedure.}
\usage{
renamefiles(dir, pattern, replacement)
}
\arguments{
\item{dir}{Path to directory for which you want to... | /man/renamefiles.Rd | no_license | sckott/sacbox | R | false | true | 801 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/renamefiles.r
\name{renamefiles}
\alias{renamefiles}
\title{Rename a bunch of files in a directory with the same regex procedure.}
\usage{
renamefiles(dir, pattern, replacement)
}
\arguments{
\item{dir}{Path to directory for which you want to... |
# nathan dot lazar at gmail dot com
make_cpg_shore <- function(cpg_island.gr, shore_size) {
########################################################
# Makes GRanges object of shores up to size <shore_size>
# that are not overlapping other CpG islands
########################################################
upstream... | /make_cpg_shore.R | no_license | yuzhenpeng/APE_METH_bin | R | false | false | 761 | r | # nathan dot lazar at gmail dot com
make_cpg_shore <- function(cpg_island.gr, shore_size) {
########################################################
# Makes GRanges object of shores up to size <shore_size>
# that are not overlapping other CpG islands
########################################################
upstream... |
#' calculate the correct rate of the result of sparse.choosekrl()
#'
#' calculate the correct rate of the result of sparse.choosekrl()
#' @param true true k, r, l
#' @param results result returned by sparse.choosekrl()
#'
#' @export
Calculate<-function(true,results){
real<-matrix(true,ncol=3)
percent<-0
for(i i... | /code/sparse tensor/previous version/tensorsparse_version2/R/Calculate.R | no_license | Miaoyanwang/tensor-clustering | R | false | false | 726 | r | #' calculate the correct rate of the result of sparse.choosekrl()
#'
#' calculate the correct rate of the result of sparse.choosekrl()
#' @param true true k, r, l
#' @param results result returned by sparse.choosekrl()
#'
#' @export
Calculate<-function(true,results){
real<-matrix(true,ncol=3)
percent<-0
for(i i... |
library(simPop)
### Name: ipu_step
### Title: Perform one step of iterative proportional updating
### Aliases: ipu_step combine_factors ipu_step ipu_step_ref ipu_step
### ipu_step_f
### ** Examples
############# one-dimensional ipu ##############
## create random data
nobs <- 10
classLabels <- letters[1:3]
dat ... | /data/genthat_extracted_code/simPop/examples/ipu_step.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 1,220 | r | library(simPop)
### Name: ipu_step
### Title: Perform one step of iterative proportional updating
### Aliases: ipu_step combine_factors ipu_step ipu_step_ref ipu_step
### ipu_step_f
### ** Examples
############# one-dimensional ipu ##############
## create random data
nobs <- 10
classLabels <- letters[1:3]
dat ... |
#!/usr/bin/env Rscript
library(argparse)
# input parameters
parser <- ArgumentParser(description='combine the secondary structure statistics of pdb files into 1 table')
parser$add_argument('--txtdir', help= 'absolute path to the directory of input txt files(with pdb ids as part of their names and suffix: "_stats.tx... | /pdb_corner/combine_dssp_statistics_to_table.R | permissive | olgatsiouri1996/biomisc_R | R | false | false | 1,402 | r | #!/usr/bin/env Rscript
library(argparse)
# input parameters
parser <- ArgumentParser(description='combine the secondary structure statistics of pdb files into 1 table')
parser$add_argument('--txtdir', help= 'absolute path to the directory of input txt files(with pdb ids as part of their names and suffix: "_stats.tx... |
library(tidyverse)
library(hrbrthemes)
#Authors:Aaron Brown, Daniel O'Neil
##########################
#SLURP CREATION FUNCTIONS#
#############################################################################################################################################################################################... | /wines.R | no_license | dmi3kno/PMMC_BayesAtLund19 | R | false | false | 9,927 | r | library(tidyverse)
library(hrbrthemes)
#Authors:Aaron Brown, Daniel O'Neil
##########################
#SLURP CREATION FUNCTIONS#
#############################################################################################################################################################################################... |
glimpse(bike)
model.matrix(~. -1, bike)
bike <- cbind(bike, model.matrix(~. -1, bike))
head(bike)
range(bike$windspeed)
colnames(bike)
bike$season <- factor(bike$season)
bike$holiday <- factor(bike$holiday)
bike$workingday <- factor(bike$workingday)
bike$weather <- factor(bike$weather)
bike$year <- f... | /Bike/Bike_Code/good.R | permissive | LegenDad/KaggleUXLog | R | false | false | 1,001 | r | glimpse(bike)
model.matrix(~. -1, bike)
bike <- cbind(bike, model.matrix(~. -1, bike))
head(bike)
range(bike$windspeed)
colnames(bike)
bike$season <- factor(bike$season)
bike$holiday <- factor(bike$holiday)
bike$workingday <- factor(bike$workingday)
bike$weather <- factor(bike$weather)
bike$year <- f... |
data1 = read.table("NYdata.txt", header=T, na.string="*")
x = data1$Age
y = data1$TLength
# data exploration
plot(x, y, type="p", main="plot", xlab="Age", ylab="Length")
hist(data1$eggwgt1)
boxplot(data1$eggwgt1)
boxplot(eggwgt1~Age, data1) # grouped by age
range(data1$Age)
qqnorm(data1$eggwgt1) # normality
plot(d... | /week4_exercise.r | no_license | snakepowerpoint/Introduction_to_Fisheries_Science_and_Management | R | false | false | 1,149 | r | data1 = read.table("NYdata.txt", header=T, na.string="*")
x = data1$Age
y = data1$TLength
# data exploration
plot(x, y, type="p", main="plot", xlab="Age", ylab="Length")
hist(data1$eggwgt1)
boxplot(data1$eggwgt1)
boxplot(eggwgt1~Age, data1) # grouped by age
range(data1$Age)
qqnorm(data1$eggwgt1) # normality
plot(d... |
library(parallel)
simRep <- 5000 # Replication times in one simulation
pvalue.true <- .05 # Testing type I error
b.var <- c(0.04) # The set of varaince of random covariates b as random slope
smooth <- 1 # measurement error is added to M if smooth = 0; no measurement error is added if sooth = 1
cores <- 4
r.sim <- b.va... | /full simulation/summer/hetero_power/variance0.04/seed4/heter_power_0.04_pca_s_seed4_20_50.R | no_license | wma9/FMRI-project | R | false | false | 9,195 | r | library(parallel)
simRep <- 5000 # Replication times in one simulation
pvalue.true <- .05 # Testing type I error
b.var <- c(0.04) # The set of varaince of random covariates b as random slope
smooth <- 1 # measurement error is added to M if smooth = 0; no measurement error is added if sooth = 1
cores <- 4
r.sim <- b.va... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_interactive_what_if.R
\name{plot_interactive}
\alias{plot_interactive}
\alias{plot_interactive.what_if_explainer}
\alias{plot_interactive.default}
\title{Plots Interactive What-If Explanations}
\usage{
\method{plot_interactive}{what_if_e... | /man/plot_interactive.Rd | no_license | Alex33261/ceterisParibus | R | false | true | 1,501 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_interactive_what_if.R
\name{plot_interactive}
\alias{plot_interactive}
\alias{plot_interactive.what_if_explainer}
\alias{plot_interactive.default}
\title{Plots Interactive What-If Explanations}
\usage{
\method{plot_interactive}{what_if_e... |
library("plyr")
library(dplyr)
library("ggplot2")
library(lubridate)
library("ape")
library("vegan")
library("microbiome")
library(data.table)
library(tidyr)
setwd("~/Desktop/SCCWRP")
#Read in algae data from SMC sites.
algaeDataSMCRaw <- read.table("AlgaeTax_dnaSites_SMC.csv", header=TRUE, sep=",",as.is=T,check.names... | /StreamAnalysis.R | no_license | levisimons/SCCWRP | R | false | false | 32,954 | r | library("plyr")
library(dplyr)
library("ggplot2")
library(lubridate)
library("ape")
library("vegan")
library("microbiome")
library(data.table)
library(tidyr)
setwd("~/Desktop/SCCWRP")
#Read in algae data from SMC sites.
algaeDataSMCRaw <- read.table("AlgaeTax_dnaSites_SMC.csv", header=TRUE, sep=",",as.is=T,check.names... |
#' export
testUtilCreateDMatrix <- function(size,
sigma,
psi) {
cat("\nTesting \'tests_02_createDMatrix\' \n")
Start <- Sys.time()
dMatrix <- createDMatrix(size = size,
sigma = sigma,
psi = p... | /product2/R/testUtilCreateDMatrix.R | no_license | Gograman/product2 | R | false | false | 794 | r | #' export
testUtilCreateDMatrix <- function(size,
sigma,
psi) {
cat("\nTesting \'tests_02_createDMatrix\' \n")
Start <- Sys.time()
dMatrix <- createDMatrix(size = size,
sigma = sigma,
psi = p... |
#I have put all chunks of code (until near the end) into functions with no arguments or return
#values so that all of the code can be run from a "control panel" at the end.
#Select all code up until beginning of SECTION 13 and run it, then can use control panel.
#The code is organized into the following order (I will m... | /trimmed_capstone_script.R | no_license | ekatzelnick/ekatzelnick.github.io | R | false | false | 69,059 | r | #I have put all chunks of code (until near the end) into functions with no arguments or return
#values so that all of the code can be run from a "control panel" at the end.
#Select all code up until beginning of SECTION 13 and run it, then can use control panel.
#The code is organized into the following order (I will m... |
## Copyright © 2013-2014 EMBL - European Bioinformatics Institute
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless require... | /Early adults stats pipeline/PhenStat/PhenStatPackage/PhenStat/R/RRFramework.R | permissive | mpi2/impc_stats_pipeline | R | false | false | 31,447 | r | ## Copyright © 2013-2014 EMBL - European Bioinformatics Institute
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless require... |
\name{entropy.based}
\alias{information.gain}
\alias{gain.ratio}
\alias{symmetrical.uncertainty}
\title{ Entropy-based filters }
\description{
The algorithms find weights of discrete attributes basing on their correlation with continous class attribute.
}
\usage{
information.gain(formula, data)
gain.ratio(formula, da... | /man/information.gain.Rd | no_license | iabrady/fselector | R | false | false | 1,604 | rd | \name{entropy.based}
\alias{information.gain}
\alias{gain.ratio}
\alias{symmetrical.uncertainty}
\title{ Entropy-based filters }
\description{
The algorithms find weights of discrete attributes basing on their correlation with continous class attribute.
}
\usage{
information.gain(formula, data)
gain.ratio(formula, da... |
# Author - Anupama Rajaram
# server.R file for showing Survivor statistics for Titanic passengers
# weblink = https://anurajaram.shinyapps.io/immi-sal/
# Displays 3 types of charts, based on selection
# (a) No. of Survivors by gender & passenger class
# (b) Salary by visa class - greencard, H1-B, etc.
# ... | /server.R | no_license | anurajaram/immi_sal_explorer | R | false | false | 2,289 | r | # Author - Anupama Rajaram
# server.R file for showing Survivor statistics for Titanic passengers
# weblink = https://anurajaram.shinyapps.io/immi-sal/
# Displays 3 types of charts, based on selection
# (a) No. of Survivors by gender & passenger class
# (b) Salary by visa class - greencard, H1-B, etc.
# ... |
# Basic text processing in R
# Install the necessary packages if not done yet
install.packages("tidyverse")
install.packages("tokenizers")
# Load the packages for use (must be done every time)
libary(tidyverse)
library(tokenizers)
# Paste some test to a variable called text (in this case, a paragraph from the openin... | /src/text-processing.R | permissive | michemcc/r-programming-examples | R | false | false | 4,861 | r | # Basic text processing in R
# Install the necessary packages if not done yet
install.packages("tidyverse")
install.packages("tokenizers")
# Load the packages for use (must be done every time)
libary(tidyverse)
library(tokenizers)
# Paste some test to a variable called text (in this case, a paragraph from the openin... |
rm(list = ls()) # clear workspace history
setwd("E:/ExcelR(per)/Wordcloud")
install.packages("rJava") # download Java 64 bit before installing the package
install.packages("tm")
install.packages("SnowballC")
install.packages("wordcloud")
install.packages("RWeka")
install.packages("igraph")
install.package... | /amazon_sentiment.R | no_license | Reet1992/Data_mining | R | false | false | 14,628 | r | rm(list = ls()) # clear workspace history
setwd("E:/ExcelR(per)/Wordcloud")
install.packages("rJava") # download Java 64 bit before installing the package
install.packages("tm")
install.packages("SnowballC")
install.packages("wordcloud")
install.packages("RWeka")
install.packages("igraph")
install.package... |
\name{Sequence}
\alias{Sequence}
\docType{data}
\title{A sequence with binding evidence.}
\description{A sequence with binding evidence}
\usage{data(Sequence)}
\format{
\describe{
\item{Sequence}{Binding sites sequence}
}
}
\author{Erola Pairo <epeiroatibec.pcb.ub.es> and Joan Maynou <joan.maynouatupc.edu>.}
\... | /man/Sequence.Rd | no_license | mikepipo/MEET | R | false | false | 339 | rd | \name{Sequence}
\alias{Sequence}
\docType{data}
\title{A sequence with binding evidence.}
\description{A sequence with binding evidence}
\usage{data(Sequence)}
\format{
\describe{
\item{Sequence}{Binding sites sequence}
}
}
\author{Erola Pairo <epeiroatibec.pcb.ub.es> and Joan Maynou <joan.maynouatupc.edu>.}
\... |
# Plot scenario.R
################################
# Date: 31/07/2014
# Author: CNM
# Project: TFM
# Description: Script to plot scenarios and bym, crossval, max, mean, wmean
# results.
# Clean workspace & set wd
rm(list=ls())
# setwd("~/GitHub/tfm")
filesDir <- "~/Dropbox/Claudio-Migue"
workDir <- "~/... | /plot_scenario.R | no_license | cnavarre/tfm | R | false | false | 10,191 | r | # Plot scenario.R
################################
# Date: 31/07/2014
# Author: CNM
# Project: TFM
# Description: Script to plot scenarios and bym, crossval, max, mean, wmean
# results.
# Clean workspace & set wd
rm(list=ls())
# setwd("~/GitHub/tfm")
filesDir <- "~/Dropbox/Claudio-Migue"
workDir <- "~/... |
library(networkDynamicData)
### Name: concurrencyComparisonNets
### Title: A synthetic dataset of three simulated dynamic networks with
### epidemic spread.
### Aliases: concurrencyComparisonNets base middle monog
### Keywords: datasets
### ** Examples
data(concurrencyComparisonNets)
## Not run:
##D
##D # comp... | /data/genthat_extracted_code/networkDynamicData/examples/concurrencyComparisonNets.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 5,140 | r | library(networkDynamicData)
### Name: concurrencyComparisonNets
### Title: A synthetic dataset of three simulated dynamic networks with
### epidemic spread.
### Aliases: concurrencyComparisonNets base middle monog
### Keywords: datasets
### ** Examples
data(concurrencyComparisonNets)
## Not run:
##D
##D # comp... |
library(dslabs)
data(heights)
options(digits = 3)
heights
#Q1. First, determine the average height in this dataset. Then create a logical vector ind with the indices for those individuals who are above average height.
#
# How many individuals in the dataset are above average height?
summary(heights)
#68.3
isCl... | /section3_assessment.R | permissive | RitRa/edx-Data-Science-Professional-Certificate | R | false | false | 3,351 | r | library(dslabs)
data(heights)
options(digits = 3)
heights
#Q1. First, determine the average height in this dataset. Then create a logical vector ind with the indices for those individuals who are above average height.
#
# How many individuals in the dataset are above average height?
summary(heights)
#68.3
isCl... |
## This is a set of functions that are able to cache the potentially
## time-consuming computations of the inverse of matrices.
##
## I solved this assignment with the help of DanieleP's tutorial linked to
## from the R Programming community site, and which is found at:
## https://github.com/DanieleP/PA2-clarifying_in... | /cachematrix.R | no_license | jengman02/ProgrammingAssignment2 | R | false | false | 1,478 | r | ## This is a set of functions that are able to cache the potentially
## time-consuming computations of the inverse of matrices.
##
## I solved this assignment with the help of DanieleP's tutorial linked to
## from the R Programming community site, and which is found at:
## https://github.com/DanieleP/PA2-clarifying_in... |
context('Test Primal Dual Algorithm')
#' @useDynLib GFORCE test_smoothed_gradient_S_base
test_that("GS_t Base",{
K <- 5
d <- 20
dat <- gforce.generator(K,d,d,3,graph='DeltaC',cov_gap_mult=4)
sh <- t(dat$X)%*%dat$X / d
initial_mixing <- 2/d
km_res <- gforce.kmeans(-sh,K,R_only=TRUE)
km_res ... | /data/genthat_extracted_code/GFORCE/tests/test_primal_dual.R | no_license | surayaaramli/typeRrh | R | false | false | 8,297 | r | context('Test Primal Dual Algorithm')
#' @useDynLib GFORCE test_smoothed_gradient_S_base
test_that("GS_t Base",{
K <- 5
d <- 20
dat <- gforce.generator(K,d,d,3,graph='DeltaC',cov_gap_mult=4)
sh <- t(dat$X)%*%dat$X / d
initial_mixing <- 2/d
km_res <- gforce.kmeans(-sh,K,R_only=TRUE)
km_res ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/assess_has_website.R
\name{metric_score.pkg_metric_has_website}
\alias{metric_score.pkg_metric_has_website}
\title{Score a package for inclusion of an associated website url}
\usage{
\method{metric_score}{pkg_metric_has_website}(x, ...)
}
\ar... | /man/metric_score.pkg_metric_has_website.Rd | permissive | marlycormar/riskmetric | R | false | true | 1,407 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/assess_has_website.R
\name{metric_score.pkg_metric_has_website}
\alias{metric_score.pkg_metric_has_website}
\title{Score a package for inclusion of an associated website url}
\usage{
\method{metric_score}{pkg_metric_has_website}(x, ...)
}
\ar... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/loom.R
\name{compress_gzb64}
\alias{compress_gzb64}
\title{open_loom}
\usage{
compress_gzb64(c)
}
\arguments{
\item{file.path}{The file path to the .loom file.}
}
\description{
Open loom file and return a .loom file handler.
}
| /man/compress_gzb64.Rd | permissive | aertslab/SCopeLoomR | R | false | true | 305 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/loom.R
\name{compress_gzb64}
\alias{compress_gzb64}
\title{open_loom}
\usage{
compress_gzb64(c)
}
\arguments{
\item{file.path}{The file path to the .loom file.}
}
\description{
Open loom file and return a .loom file handler.
}
|
library("ggplot2")
set.seed(1)
total.simulations <- 10000
m <- 100
n <- 20
results <- rep(NA, total.simulations)
for (i in 1:total.simulations)
{
x <- matrix(runif(m * n), nrow = m, ncol = n)
y <- runif(m)
p.values <- summary(lm(y ~ x))$coefficients[, 4]
results[i] <- sum(p.values < 0.05)
}
qplot(resul... | /article1/multiple_testing.R | no_license | johnmyleswhite/NHSTExamples | R | false | false | 374 | r | library("ggplot2")
set.seed(1)
total.simulations <- 10000
m <- 100
n <- 20
results <- rep(NA, total.simulations)
for (i in 1:total.simulations)
{
x <- matrix(runif(m * n), nrow = m, ncol = n)
y <- runif(m)
p.values <- summary(lm(y ~ x))$coefficients[, 4]
results[i] <- sum(p.values < 0.05)
}
qplot(resul... |
## Put comments here that give an overall description of what your
## functions do
## Write a short comment describing this function
makeCacheMatrix <- function(x = matrix()) {
m <- NULL
set <- function(y) {
x <<- y
m <<- NULL
}
get <- function() x
setinverse <- function(inverse) {m <<- inverse}
... | /ProgrammingAssignment2-master/cachematrix.R | no_license | edwardchome/datasciencecoursera | R | false | false | 795 | r | ## Put comments here that give an overall description of what your
## functions do
## Write a short comment describing this function
makeCacheMatrix <- function(x = matrix()) {
m <- NULL
set <- function(y) {
x <<- y
m <<- NULL
}
get <- function() x
setinverse <- function(inverse) {m <<- inverse}
... |
# TODO: Add comment
#
# Author: Vahid Nassiri
###############################################################################
#' performs MCT for non-flat profiles per subject
#' @param inputDataSubject
#' @param repeatedDose
#' @return
#'
#' @import multcomp
#' @import doParallel
#' @author Vahid Nassiri
#' @no... | /R/nonFlatMCTperSubject.R | no_license | cran/clustDRM | R | false | false | 811 | r | # TODO: Add comment
#
# Author: Vahid Nassiri
###############################################################################
#' performs MCT for non-flat profiles per subject
#' @param inputDataSubject
#' @param repeatedDose
#' @return
#'
#' @import multcomp
#' @import doParallel
#' @author Vahid Nassiri
#' @no... |
# License issued by BayesFusion Licensing Server
#
# This code must be executed before any other rSMILE object is created
rSMILE::License(paste(
"SMILE LICENSE 6bc07a0d 3773c5d1 49bc60e1 ",
"THIS IS AN ACADEMIC LICENSE AND CAN BE USED ",
"SOLELY FOR ACADEMIC RESEARCH AND TEACHING, ",
"AS DEFINED IN THE BAYE... | /jsmile/smile_license/License.R | no_license | mzdachuizhang/Decision_Making_Using_Bayesian-RoboSim | R | false | false | 881 | r | # License issued by BayesFusion Licensing Server
#
# This code must be executed before any other rSMILE object is created
rSMILE::License(paste(
"SMILE LICENSE 6bc07a0d 3773c5d1 49bc60e1 ",
"THIS IS AN ACADEMIC LICENSE AND CAN BE USED ",
"SOLELY FOR ACADEMIC RESEARCH AND TEACHING, ",
"AS DEFINED IN THE BAYE... |
contrastHeatmap <- function (mat, filename) {
require(magrittr)
require(reshape2)
require(ggplot2)
require(RColorBrewer)
mat[lower.tri(mat)] <- mat %>% t %>% .[lower.tri(mat)]
diag(mat) <- 1
mat %>%
as.matrix %>%
melt %>%
mutate(sig = cut(value, breaks = c(0, 0.001, 0.01, 0.05, 0.1, 1), inc... | /lib/contrastHeatmap.R | no_license | benjamin-chan/TeoSocialMediaVeterans | R | false | false | 799 | r | contrastHeatmap <- function (mat, filename) {
require(magrittr)
require(reshape2)
require(ggplot2)
require(RColorBrewer)
mat[lower.tri(mat)] <- mat %>% t %>% .[lower.tri(mat)]
diag(mat) <- 1
mat %>%
as.matrix %>%
melt %>%
mutate(sig = cut(value, breaks = c(0, 0.001, 0.01, 0.05, 0.1, 1), inc... |
testlist <- list(barrier = 0, ben = numeric(0), fee = 0, penalty = numeric(0), spot = c(-1.23553922836457e-178, 1.15097532855177e-319, 0, 0, 0, 0, 0))
result <- do.call(valuer::calc_account,testlist)
str(result) | /valuer/inst/testfiles/calc_account/libFuzzer_calc_account/calc_account_valgrind_files/1616985899-test.R | no_license | akhikolla/updatedatatype-list4 | R | false | false | 221 | r | testlist <- list(barrier = 0, ben = numeric(0), fee = 0, penalty = numeric(0), spot = c(-1.23553922836457e-178, 1.15097532855177e-319, 0, 0, 0, 0, 0))
result <- do.call(valuer::calc_account,testlist)
str(result) |
testlist <- list(x = c(1280061267L, -2687190L, -108L, -1802201964L, -1L, -1L, 855638015L, 13565951L, -1L, -1L, -65536L, 10751L, 695729996L, 1280114473L, 692857343L, 1291209758L, 704597247L, 1277765964L, 1291845631L, -59351L, -14024884L, 1280068650L, 1277820927L, -11776769L, -134225921L, -1L, -256L, 0L, 16777215L, -... | /diffrprojects/inst/testfiles/dist_mat_absolute/libFuzzer_dist_mat_absolute/dist_mat_absolute_valgrind_files/1609960645-test.R | no_license | akhikolla/updated-only-Issues | R | false | false | 927 | r | testlist <- list(x = c(1280061267L, -2687190L, -108L, -1802201964L, -1L, -1L, 855638015L, 13565951L, -1L, -1L, -65536L, 10751L, 695729996L, 1280114473L, 692857343L, 1291209758L, 704597247L, 1277765964L, 1291845631L, -59351L, -14024884L, 1280068650L, 1277820927L, -11776769L, -134225921L, -1L, -256L, 0L, 16777215L, -... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/subset_vegpar.R
\name{subset_vegpar}
\alias{subset_vegpar}
\title{Subset vegpar}
\usage{
subset_vegpar(indir, varname, classname, outdir, basin_mask, nt = 12)
}
\arguments{
\item{indir}{directory containing geotiff files with vegetation param... | /man/subset_vegpar.Rd | no_license | jschap1/vegpar | R | false | true | 1,225 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/subset_vegpar.R
\name{subset_vegpar}
\alias{subset_vegpar}
\title{Subset vegpar}
\usage{
subset_vegpar(indir, varname, classname, outdir, basin_mask, nt = 12)
}
\arguments{
\item{indir}{directory containing geotiff files with vegetation param... |
#===============================================================================
weight_byEffect_bin <- function(i, alpha, null, m, tail = 1L, delInterval,
filterEffectVec, datByNull)
{
et <- filterEffectVec [i]
m0 <- ceiling(m*null)
m1 <- m-m0
ranks... | /tests/testthat/weight_byEffect_bin.R | no_license | mshasan/OPWpaper | R | false | false | 1,126 | r |
#===============================================================================
weight_byEffect_bin <- function(i, alpha, null, m, tail = 1L, delInterval,
filterEffectVec, datByNull)
{
et <- filterEffectVec [i]
m0 <- ceiling(m*null)
m1 <- m-m0
ranks... |
# Author: Tony caine
# Date: May 10 2014
#
# there are 4 plots to embed in a 2* 2 panel
# simplest to understand if each in a function that returns the plot
# so functions get_plotX
# these are derivatives of the rest of the exercise
get_plot1 <- function() {
# plot Global Active Power (kilowatts) against dateti... | /plot4.R | no_license | tonycaine/ExData_Plotting1 | R | false | false | 2,214 | r | # Author: Tony caine
# Date: May 10 2014
#
# there are 4 plots to embed in a 2* 2 panel
# simplest to understand if each in a function that returns the plot
# so functions get_plotX
# these are derivatives of the rest of the exercise
get_plot1 <- function() {
# plot Global Active Power (kilowatts) against dateti... |
#Read in packages
library(ggplot2)
#Read in File
db_file="household_power_consumption.txt"
data <- read.table(db_file, header = TRUE, sep = ";", dec = ".", na.strings = "?", colClasses = c(NA, NA, rep ("numeric", 7)))
data<-subset(data,data$Date=="1/2/2007" | Date == "2/2/2007")
#Convert Date and Time
data$D... | /plot2.R | no_license | melange33/Exploratory-Analysis-Project-1 | R | false | false | 563 | r | #Read in packages
library(ggplot2)
#Read in File
db_file="household_power_consumption.txt"
data <- read.table(db_file, header = TRUE, sep = ";", dec = ".", na.strings = "?", colClasses = c(NA, NA, rep ("numeric", 7)))
data<-subset(data,data$Date=="1/2/2007" | Date == "2/2/2007")
#Convert Date and Time
data$D... |
##Build a special matrix that will calculate and cache the inverse of a given matrix
## Returns a Special matrix list that has the following methods
## set() sets given matrix
## get() returns the matrix
## setinversematrix() sets the inverse of the matrix
## returns the inverse of the matrix
makeCacheMatrix <- functi... | /cachematrix.R | no_license | kuralmanivannanganesh/ProgrammingAssignment2 | R | false | false | 991 | r | ##Build a special matrix that will calculate and cache the inverse of a given matrix
## Returns a Special matrix list that has the following methods
## set() sets given matrix
## get() returns the matrix
## setinversematrix() sets the inverse of the matrix
## returns the inverse of the matrix
makeCacheMatrix <- functi... |
## this is no test
## this is the code used to generate the example data
## simulate data-sets for testing and illustrating the software
set.seed(49)
height <- rnorm(100, mean = 175, sd = 5)
labvalue <- rgamma(100, shape = 1, scale = 1)
region <- factor(sample(c("US", "EU", "Japan"), 100, replace=TRUE))
smoke... | /tests/data-sets.R | no_license | cran/subtee | R | false | false | 1,022 | r | ## this is no test
## this is the code used to generate the example data
## simulate data-sets for testing and illustrating the software
set.seed(49)
height <- rnorm(100, mean = 175, sd = 5)
labvalue <- rgamma(100, shape = 1, scale = 1)
region <- factor(sample(c("US", "EU", "Japan"), 100, replace=TRUE))
smoke... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/graph-nodes.R
\name{graph.nodes}
\alias{graph.nodes}
\title{Return root, end, or branchpoints of an igraph object}
\usage{
graph.nodes(x, type = c("root", "end", "branch"), original.ids = "label",
exclude.isolated = TRUE)
}
\arguments{
\ite... | /man/graph.nodes.Rd | no_license | naveedst/nat | R | false | true | 773 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/graph-nodes.R
\name{graph.nodes}
\alias{graph.nodes}
\title{Return root, end, or branchpoints of an igraph object}
\usage{
graph.nodes(x, type = c("root", "end", "branch"), original.ids = "label",
exclude.isolated = TRUE)
}
\arguments{
\ite... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.