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 |
|---|---|---|---|---|---|---|---|---|---|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/SCESet-methods.R
\name{toCellDataSet}
\alias{toCellDataSet}
\title{Convert an \code{SCESet} to a \code{CellDataSet}}
\usage{
toCellDataSet(sce, exprs_values = "exprs")
}
\arguments{
\item{sce}{An \code{SCESet} object}
\item{exprs_values}{Wha... | /man/toCellDataSet.Rd | permissive | dynverse/scaterlegacy | R | false | true | 822 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/SCESet-methods.R
\name{toCellDataSet}
\alias{toCellDataSet}
\title{Convert an \code{SCESet} to a \code{CellDataSet}}
\usage{
toCellDataSet(sce, exprs_values = "exprs")
}
\arguments{
\item{sce}{An \code{SCESet} object}
\item{exprs_values}{Wha... |
#function to compute percentage changes of a data frame, all are assumed to be coercible to numerical
#returns another data frame with one row less and percentage numbers.
pctcompute<-function(x) {
imax<-dim(x)[1]
y<-data.matrix(x)
for (i in 1:imax-1)
y[i,]=(y[i,]-y[i+1,])*100/(y[i+1,])
y
} | /src/pctcompute.R | no_license | arjunaraoc/gtp-tewp | R | false | false | 320 | r | #function to compute percentage changes of a data frame, all are assumed to be coercible to numerical
#returns another data frame with one row less and percentage numbers.
pctcompute<-function(x) {
imax<-dim(x)[1]
y<-data.matrix(x)
for (i in 1:imax-1)
y[i,]=(y[i,]-y[i+1,])*100/(y[i+1,])
y
} |
ll_plot <- function(object, type="p", pch="."){
#this is just a wrapper function to plot.zoo
#with more better defaults
require(zoo)
plot.zoo(object, type=type, pch=pch)
}
| /Pressure_Transducer_R_CODE/ll_plot.R | no_license | ssefick/R_scripts | R | false | false | 177 | r | ll_plot <- function(object, type="p", pch="."){
#this is just a wrapper function to plot.zoo
#with more better defaults
require(zoo)
plot.zoo(object, type=type, pch=pch)
}
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Functions.R
\name{spp109}
\alias{spp109}
\title{species function}
\usage{
spp109(a, b, c, d, e)
}
\arguments{
\item{a}{environmental parameter}
\item{b}{environmental parameter}
\item{c}{environmental parameter}
\item{d}{environmental para... | /man/spp109.Rd | permissive | Djeppschmidt/Model.Microbiome | R | false | true | 456 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Functions.R
\name{spp109}
\alias{spp109}
\title{species function}
\usage{
spp109(a, b, c, d, e)
}
\arguments{
\item{a}{environmental parameter}
\item{b}{environmental parameter}
\item{c}{environmental parameter}
\item{d}{environmental para... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functions.R
\name{bin_mode}
\alias{bin_mode}
\title{bin_mode}
\usage{
bin_mode(trials, prob)
}
\arguments{
\item{trials}{Number of trials}
\item{prob}{probability of success in a single trial}
}
\value{
numeric: the mode value(s)
}
\descript... | /binomial/man/bin_mode.Rd | no_license | ranmeng747/R-Data-Vis-and-Pkg-Development | R | false | true | 474 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functions.R
\name{bin_mode}
\alias{bin_mode}
\title{bin_mode}
\usage{
bin_mode(trials, prob)
}
\arguments{
\item{trials}{Number of trials}
\item{prob}{probability of success in a single trial}
}
\value{
numeric: the mode value(s)
}
\descript... |
if(getRversion() >= "2.15.1") utils::globalVariables("observables")
estimate_risk_out_all <- function(thetas, knobj, experiment_fun){
## Estimates the risk of experiment defined by experiment_fun given
## sample thetas and parameters in knobj
## N_simu_weight is the number of sample required for the output
## simu... | /pauwels2014/R/estimate_risk_out_all.R | no_license | ingted/R-Examples | R | false | false | 2,599 | r | if(getRversion() >= "2.15.1") utils::globalVariables("observables")
estimate_risk_out_all <- function(thetas, knobj, experiment_fun){
## Estimates the risk of experiment defined by experiment_fun given
## sample thetas and parameters in knobj
## N_simu_weight is the number of sample required for the output
## simu... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tutorial-format.R
\name{tutorial}
\alias{tutorial}
\title{Tutorial document format}
\usage{
tutorial(
fig_width = 6.5,
fig_height = 4,
fig_retina = 2,
fig_caption = TRUE,
progressive = FALSE,
allow_skip = FALSE,
dev = "png",
d... | /man/tutorial.Rd | permissive | VincentGuyader/learnr | R | false | true | 4,080 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tutorial-format.R
\name{tutorial}
\alias{tutorial}
\title{Tutorial document format}
\usage{
tutorial(
fig_width = 6.5,
fig_height = 4,
fig_retina = 2,
fig_caption = TRUE,
progressive = FALSE,
allow_skip = FALSE,
dev = "png",
d... |
library(analytics)
### Name: Wbiplot
### Title: Weighted Biplot
### Aliases: Wbiplot
### ** Examples
require(graphics)
# Exemple 1: Row metric preserving
Wbiplot(USArrests, numer1 = 1, numer2 = 0, cx = 0.6)
# Exemple 2: Column metric preserving
Wbiplot(USArrests, numer1 = 0, numer2 = 1, cx = 0.6)
# Comparison w... | /data/genthat_extracted_code/analytics/examples/Wbiplot.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 565 | r | library(analytics)
### Name: Wbiplot
### Title: Weighted Biplot
### Aliases: Wbiplot
### ** Examples
require(graphics)
# Exemple 1: Row metric preserving
Wbiplot(USArrests, numer1 = 1, numer2 = 0, cx = 0.6)
# Exemple 2: Column metric preserving
Wbiplot(USArrests, numer1 = 0, numer2 = 1, cx = 0.6)
# Comparison w... |
#################################################################
###
### This Script combines the clinical data relating to patients
### that have RNASeq Data available with IMS predictions based
### based on both RNASeq and MicroArray data.
###
#################################################################
# Se... | /Deprecated seperate Cancer Code/Ovarian/v1.Code/4.0.TCGA.OV.RNASeq_ISGS_Master.WHX.R | no_license | dudious/QCRI-SIDRA-ICR | R | false | false | 3,341 | r | #################################################################
###
### This Script combines the clinical data relating to patients
### that have RNASeq Data available with IMS predictions based
### based on both RNASeq and MicroArray data.
###
#################################################################
# Se... |
#rm(list = ls())
## LOAD THE REQUIRED LIBRARYS
library(ncdf4) # if running on windows, need opendap ncdf4 build https://github.com/pmjherman/r-ncdf4-build-opendap-windows
library(lubridate)
library(dplyr)
library(zoo)
library(plyr)
library(rowr)
library(precintcon)
library(gridExtra)
library(raster)
library(MASS)
libr... | /precipitation/R/precipitation_map.R | no_license | LMXB/drought_indicators | R | false | false | 8,737 | r | #rm(list = ls())
## LOAD THE REQUIRED LIBRARYS
library(ncdf4) # if running on windows, need opendap ncdf4 build https://github.com/pmjherman/r-ncdf4-build-opendap-windows
library(lubridate)
library(dplyr)
library(zoo)
library(plyr)
library(rowr)
library(precintcon)
library(gridExtra)
library(raster)
library(MASS)
libr... |
#' Calculate Life Expectancy using phe_life_expectancy
#'
#' Compute life expectancy for a given age, and its standard error
#'
#' @param data data.frame or tbl containing the deaths and population data
#' @param deaths field name from data containing the number of deaths within age
#' band; unquoted string; no... | /R/LifeExpectancy.R | no_license | cran/PHEindicatormethods | R | false | false | 24,861 | r | #' Calculate Life Expectancy using phe_life_expectancy
#'
#' Compute life expectancy for a given age, and its standard error
#'
#' @param data data.frame or tbl containing the deaths and population data
#' @param deaths field name from data containing the number of deaths within age
#' band; unquoted string; no... |
# RIKZ data loading and processing
# Preamble - load libraries and clear environment
remove(list=ls())
## Step 1. Load data from csv
rikz.data.1 <- read.csv("data/raw_data/RIKZ_1.csv")
rikz.data.2 <- read.csv("data/raw_data/RIKZ_2.csv")
rikz.data.3 <- read.csv("data/raw_data/RIKZ_3.csv")
rikz.data.4 <- read.csv("data... | /student_folders/magswell/activity1a_data_processing.R | permissive | Magswell/reproducibility_workshop | R | false | false | 748 | r | # RIKZ data loading and processing
# Preamble - load libraries and clear environment
remove(list=ls())
## Step 1. Load data from csv
rikz.data.1 <- read.csv("data/raw_data/RIKZ_1.csv")
rikz.data.2 <- read.csv("data/raw_data/RIKZ_2.csv")
rikz.data.3 <- read.csv("data/raw_data/RIKZ_3.csv")
rikz.data.4 <- read.csv("data... |
context("utils-fetch tests")
test_that('fetchRatingShifts data returns as expected', {
library(jsonlite)
reportObject <- fromJSON('{
"ratingShifts" : [
{
"curveNumber": "9",
"shiftPoints": [
0,
0
],
"stagePoints": [
3.5,
... | /tests/testthat/test-utils-fetch.R | permissive | thongsav-usgs/repgen | R | false | false | 33,154 | r | context("utils-fetch tests")
test_that('fetchRatingShifts data returns as expected', {
library(jsonlite)
reportObject <- fromJSON('{
"ratingShifts" : [
{
"curveNumber": "9",
"shiftPoints": [
0,
0
],
"stagePoints": [
3.5,
... |
### PLOTS ILLUSTRATING KINGMAN COALESCENT PROPERTIES
#library(ggplot2)
nmax<-100
nvals <- seq(2,nmax)
ET1 <- function(n){2*(1-(1/n))}
VT1 <- function(n){4* cumsum(n^(-2)*(n-1)^(-2))}
EL <- function(n){2* cumsum((n-1)^(-1))}
VL <- function(n){4* cumsum((n-1)^(-2))}
plot(nvals, ET1(nvals), type='l')
lines(nvals, VT1(n... | /phd/R/KCproperties_plots.R | no_license | suziebrown/phd | R | false | false | 638 | r | ### PLOTS ILLUSTRATING KINGMAN COALESCENT PROPERTIES
#library(ggplot2)
nmax<-100
nvals <- seq(2,nmax)
ET1 <- function(n){2*(1-(1/n))}
VT1 <- function(n){4* cumsum(n^(-2)*(n-1)^(-2))}
EL <- function(n){2* cumsum((n-1)^(-1))}
VL <- function(n){4* cumsum((n-1)^(-2))}
plot(nvals, ET1(nvals), type='l')
lines(nvals, VT1(n... |
rm(list=ls())
library(readxl)
library(lubridate)
library(openxlsx)
library(ggplot2)
library(tidyverse)
library(gridExtra)
library(data.table)
library(MASS)
library(randomForest)
library(ranger)
library(rfinterval)
library(gganimate)
library(mgcv)
library(leaps)
library(usmap)
library(caret)
library(d... | /02_analysis.R | no_license | smsarkar1994/police_killings | R | false | false | 10,855 | r | rm(list=ls())
library(readxl)
library(lubridate)
library(openxlsx)
library(ggplot2)
library(tidyverse)
library(gridExtra)
library(data.table)
library(MASS)
library(randomForest)
library(ranger)
library(rfinterval)
library(gganimate)
library(mgcv)
library(leaps)
library(usmap)
library(caret)
library(d... |
render_page <- function(clean = FALSE) {
library(rmarkdown)
dir.create('output/data', showWarnings = FALSE)
dir.create('output/js', showWarnings = FALSE)
dir.create('output/css', showWarnings = FALSE)
file.copy('views', 'output', recursive = TRUE)
file.copy('js', 'output', recursive = TRUE)
file.copy('css... | /render_page.R | no_license | junkka/swe-mfrt | R | false | false | 426 | r | render_page <- function(clean = FALSE) {
library(rmarkdown)
dir.create('output/data', showWarnings = FALSE)
dir.create('output/js', showWarnings = FALSE)
dir.create('output/css', showWarnings = FALSE)
file.copy('views', 'output', recursive = TRUE)
file.copy('js', 'output', recursive = TRUE)
file.copy('css... |
# In this programming problem you'll code up Dijkstra's shortest-path algorithm.
# Download the text file here. (Right click and save link as).
# The file contains an adjacency list representation of an undirected weighted graph with 200 vertices labeled 1 to 200. Each row consists of the node tuples that are adjacen... | /Assignment5.R | no_license | xutaosjtu/HW_Algor | R | false | false | 2,869 | r | # In this programming problem you'll code up Dijkstra's shortest-path algorithm.
# Download the text file here. (Right click and save link as).
# The file contains an adjacency list representation of an undirected weighted graph with 200 vertices labeled 1 to 200. Each row consists of the node tuples that are adjacen... |
library(readHAC)
### Name: [.HAC
### Title: Extract tuples.
### Aliases: [.HAC
### ** Examples
## Don't show:
hacfile <- system.file("hac","Hac-test_000001.hac",package="readHAC")
x <- readHAC(hacfile)
## End(Don't show)
x[1:2]
subset(x, type == 10000)
split(x, x$type)
| /data/genthat_extracted_code/readHAC/examples/indexSubset.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 278 | r | library(readHAC)
### Name: [.HAC
### Title: Extract tuples.
### Aliases: [.HAC
### ** Examples
## Don't show:
hacfile <- system.file("hac","Hac-test_000001.hac",package="readHAC")
x <- readHAC(hacfile)
## End(Don't show)
x[1:2]
subset(x, type == 10000)
split(x, x$type)
|
install.packages("lubridate")
install.packages("reshape2")
install.packages("plyr")
install.packages("ggplot2")
install.packages("gridExtra")
install.packages("vegan")
install.packages("MASS")
| /install.R | permissive | ReproducibleQM/rebugged | R | false | false | 193 | r | install.packages("lubridate")
install.packages("reshape2")
install.packages("plyr")
install.packages("ggplot2")
install.packages("gridExtra")
install.packages("vegan")
install.packages("MASS")
|
library(tidyverse)
library("readr")
## Get data
tsConf <- "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv"
# tsDeath <- "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid... | /PL.R | permissive | bczernecki/nCovForecast | R | false | false | 5,365 | r | library(tidyverse)
library("readr")
## Get data
tsConf <- "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv"
# tsDeath <- "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid... |
# For data that is quantitative, scaled, measured, interval or ratio level
# we will do basic histograms on iris datasets
hist(iris$Sepal.Lenght) #works only in RStudio
#histograms of group
#put graphs in 3 row and 1 colum
par(mfrow= c(3,1) ) #c is a function for concatenation (3 is the number of rows and 1 colu... | /R_histograms.r | no_license | DrGuidoEvangelista/learning | R | false | false | 2,034 | r | # For data that is quantitative, scaled, measured, interval or ratio level
# we will do basic histograms on iris datasets
hist(iris$Sepal.Lenght) #works only in RStudio
#histograms of group
#put graphs in 3 row and 1 colum
par(mfrow= c(3,1) ) #c is a function for concatenation (3 is the number of rows and 1 colu... |
# Sum 2020 problem
# Day 1
library(tidyverse)
input <- read.table("~/data/adventofcode2020/day01/input.txt",
quote="\"", comment.char="")
ninput <- input %>%
mutate(V1 = 2020-V1)
ninput %>%
semi_join(input)
1703*317
# Stage 2 - find three numbers
#Learning from Ian that 'cros... | /day01/day1.R | no_license | jillymackay/adventofcode2020 | R | false | false | 501 | r | # Sum 2020 problem
# Day 1
library(tidyverse)
input <- read.table("~/data/adventofcode2020/day01/input.txt",
quote="\"", comment.char="")
ninput <- input %>%
mutate(V1 = 2020-V1)
ninput %>%
semi_join(input)
1703*317
# Stage 2 - find three numbers
#Learning from Ian that 'cros... |
#'View
#'
#'Replaces View as given by R Studio.
#'This automatically opens the viewer app.
#'Disable this by setting replace = F
#'
#'@export
#'@importFrom utils View
#'@param datain a data frame or list of data frames
#'@param replace Set equal to false to use normal view
#'@return Either the View, or the app View fro... | /R/view_replace.R | no_license | kieranjmartin/viewenhance | R | false | false | 794 | r | #'View
#'
#'Replaces View as given by R Studio.
#'This automatically opens the viewer app.
#'Disable this by setting replace = F
#'
#'@export
#'@importFrom utils View
#'@param datain a data frame or list of data frames
#'@param replace Set equal to false to use normal view
#'@return Either the View, or the app View fro... |
\name{cor2cov}
\alias{cor2cov}
\title{
Correlation Matrix to Covariance Matrix Conversion
}
\description{
Function to convert a correlation matrix to a covariance matrix.
}
\usage{
cor2cov(cor.mat, sd, discrepancy = 1e-05)
}
\arguments{
\item{cor.mat}{
The correlation matrix to be converted.
}
\item{... | /man/cor2cov.Rd | no_license | santucofs/CatDyn | R | false | false | 1,391 | rd | \name{cor2cov}
\alias{cor2cov}
\title{
Correlation Matrix to Covariance Matrix Conversion
}
\description{
Function to convert a correlation matrix to a covariance matrix.
}
\usage{
cor2cov(cor.mat, sd, discrepancy = 1e-05)
}
\arguments{
\item{cor.mat}{
The correlation matrix to be converted.
}
\item{... |
library(data.table)
rm ( list = ls())
powerDT = read.table("household_power_consumption.txt", header = T,
sep = ";", na.strings = "?")
head(powerDT$Date)
#convert the date variable to date format
powerDT$Date = as.Date(powerDT$Date, format = "%d/%m/%Y" )
#subsetting date
data... | /Plot3.R | no_license | RohasRedz/ExData_Plotting1 | R | false | false | 1,033 | r | library(data.table)
rm ( list = ls())
powerDT = read.table("household_power_consumption.txt", header = T,
sep = ";", na.strings = "?")
head(powerDT$Date)
#convert the date variable to date format
powerDT$Date = as.Date(powerDT$Date, format = "%d/%m/%Y" )
#subsetting date
data... |
# This file contains all the function definition used throughout this project
# They are sorted in the exact same order they are used in the analysis notebooks
normalize_hash <- function(sce) {
# Normalizes each hashtag oligonucleotide (HTO) UMI by dividing by the
# geometric mean and log-transforming it.
#
... | /1-PBMC/bin/utils.R | permissive | massonix/sampling_artifacts | R | false | false | 35,907 | r | # This file contains all the function definition used throughout this project
# They are sorted in the exact same order they are used in the analysis notebooks
normalize_hash <- function(sce) {
# Normalizes each hashtag oligonucleotide (HTO) UMI by dividing by the
# geometric mean and log-transforming it.
#
... |
#Q3#
library('bloom')
coln = c("Sex", "Length", "Diameter", "Height", "Whole_weight",
"Shucked_weight", "Viscera_weight", "Shell_weight", "Rings")
abalone = read_csv( file = "abalone.csv",col_names = coln )
summary( abalone )
summary( factor( abalone$Sex ) )
#a)
big.lm = lm(data=abalone, Rings ~ Length + ... | /Statistical Methods/Principal Component Regression.R | no_license | JacobPosel/STAT3064-R | R | false | false | 3,916 | r | #Q3#
library('bloom')
coln = c("Sex", "Length", "Diameter", "Height", "Whole_weight",
"Shucked_weight", "Viscera_weight", "Shell_weight", "Rings")
abalone = read_csv( file = "abalone.csv",col_names = coln )
summary( abalone )
summary( factor( abalone$Sex ) )
#a)
big.lm = lm(data=abalone, Rings ~ Length + ... |
# Construct confusion matrix
y_test = test[, ncol(test)]
cm = table(y_test, y_pred) | /r/confusion.r | no_license | jachang820/r-vs-python | R | false | false | 83 | r | # Construct confusion matrix
y_test = test[, ncol(test)]
cm = table(y_test, y_pred) |
after <- function(x, child) {
UseMethod("after", x)
}
before <- function(x, child) {
UseMethod("before", x)
}
| /R/generics.R | no_license | datawookie/emayili | R | false | false | 115 | r | after <- function(x, child) {
UseMethod("after", x)
}
before <- function(x, child) {
UseMethod("before", x)
}
|
## 2 functions: makeCacheMatrix to create matrix 'object' and cacheSolve to perfrom inversion and caching
## take a matrix as argument and store it together with access functions (get/set)
makeCacheMatrix <- function(x = matrix()) {
i <- NULL
set <- function(y) {
x <<- y
i <<- NULL
}
get <- function() ... | /cachematrix.R | no_license | thomas2701/ProgrammingAssignment2 | R | false | false | 978 | r | ## 2 functions: makeCacheMatrix to create matrix 'object' and cacheSolve to perfrom inversion and caching
## take a matrix as argument and store it together with access functions (get/set)
makeCacheMatrix <- function(x = matrix()) {
i <- NULL
set <- function(y) {
x <<- y
i <<- NULL
}
get <- function() ... |
library(data.table)
library(reshape2)
# create a tempfile and a tempdir
tmpdir <- tempdir()
urlDomain = "https://d396qusza40orc.cloudfront.net/"
urlFile = "exdata%2Fdata%2FNEI_data.zip"
url <- paste(urlDomain, urlFile)
localFile <- paste(tmpdir, urlFile, sep="/")
# download the data if it doesn't exist
if(!file.exis... | /Q4.R | no_license | andrewwoods-coursera/ExData_assignment2 | R | false | false | 2,759 | r | library(data.table)
library(reshape2)
# create a tempfile and a tempdir
tmpdir <- tempdir()
urlDomain = "https://d396qusza40orc.cloudfront.net/"
urlFile = "exdata%2Fdata%2FNEI_data.zip"
url <- paste(urlDomain, urlFile)
localFile <- paste(tmpdir, urlFile, sep="/")
# download the data if it doesn't exist
if(!file.exis... |
# Global Active Power by submeter (Time Series)
# Read data
data <- read.table("household_power_consumption.txt", sep=";", header=T,
colClasses = c("character", "character", "numeric", "numeric",
"numeric", "numeric", "numeric", "numeric", "numeric"),
na.strings="?")
# Convert ... | /plot3.R | no_license | djanzek/ExData_Plotting1 | R | false | false | 1,069 | r | # Global Active Power by submeter (Time Series)
# Read data
data <- read.table("household_power_consumption.txt", sep=";", header=T,
colClasses = c("character", "character", "numeric", "numeric",
"numeric", "numeric", "numeric", "numeric", "numeric"),
na.strings="?")
# Convert ... |
\name{simulateNetwork}
\alias{simulateNetwork}
\title{Simulate a gene expression dataset.}
\usage{
simulateNetwork(adjList,
genes = sort(union(adjList[, 1], adjList[, 2])),
samples = 100, noise = 1)
}
\arguments{
\item{adjList}{the adjacency list of the matrix you're
looking to simulate. The first column ... | /ENA/man/simulateNetwork.Rd | permissive | QBRC/ENA | R | false | false | 1,205 | rd | \name{simulateNetwork}
\alias{simulateNetwork}
\title{Simulate a gene expression dataset.}
\usage{
simulateNetwork(adjList,
genes = sort(union(adjList[, 1], adjList[, 2])),
samples = 100, noise = 1)
}
\arguments{
\item{adjList}{the adjacency list of the matrix you're
looking to simulate. The first column ... |
stopifnot(require("testthat"),
require("glmmTMB"),
require("lme4"))
## simulate something smaller than the Owls data set?
context("ZI models")
data(Owls)
test_that("zi", {
## Fit negative binomial model with "constant" Zero Inflation :
owls_nb1 <<- glmmTMB(SiblingNegotiation ~ FoodTreatm... | /glmmTMB/tests/testthat/test-zi.R | no_license | btamasi/glmmTMB | R | false | false | 2,170 | r | stopifnot(require("testthat"),
require("glmmTMB"),
require("lme4"))
## simulate something smaller than the Owls data set?
context("ZI models")
data(Owls)
test_that("zi", {
## Fit negative binomial model with "constant" Zero Inflation :
owls_nb1 <<- glmmTMB(SiblingNegotiation ~ FoodTreatm... |
local({
# fall back on '/' if baseurl is not specified
baseurl = servr:::jekyll_config('.', 'baseurl', '/')
knitr::opts_knit$set(base.url = baseurl)
# fall back on 'kramdown' if markdown engine is not specified
# markdown = servr:::jekyll_config('.', 'markdown', 'kramdown')
markdown = servr:::jekyll_config(... | /build.R | no_license | zxyzzj/TestZXY | R | false | false | 1,371 | r | local({
# fall back on '/' if baseurl is not specified
baseurl = servr:::jekyll_config('.', 'baseurl', '/')
knitr::opts_knit$set(base.url = baseurl)
# fall back on 'kramdown' if markdown engine is not specified
# markdown = servr:::jekyll_config('.', 'markdown', 'kramdown')
markdown = servr:::jekyll_config(... |
library(tidyverse)
library(lubridate)
library(broom)
library(emmeans)
##load lys_data_load
##2019 Data Only
CP <- lys_data_CP %>%
filter(year == 2019) %>%
group_by(field, date, treatment, plot, compound) %>%
mutate(mass = concentration*Volume)
vol_weighted <- CP %>%
group_by(date,field, treatment, compound) ... | /Code/Water/vol_weighted_CP.R | no_license | twilli2/n2oflux | R | false | false | 6,024 | r | library(tidyverse)
library(lubridate)
library(broom)
library(emmeans)
##load lys_data_load
##2019 Data Only
CP <- lys_data_CP %>%
filter(year == 2019) %>%
group_by(field, date, treatment, plot, compound) %>%
mutate(mass = concentration*Volume)
vol_weighted <- CP %>%
group_by(date,field, treatment, compound) ... |
# Processing level 1 models:
# there are a few unique things I want to accomplish in this script. Ideally, I think I should
# split this into at least a few different scripts:
# 1) load in prior train predictions for training intermediate level2 stacks
# 2) load in prior train predictions for a final level ... | /r_scripts/lvl1_xgb_testpreds.R | no_license | tjvananne/kaggle_porto_seguro | R | false | false | 6,798 | r |
# Processing level 1 models:
# there are a few unique things I want to accomplish in this script. Ideally, I think I should
# split this into at least a few different scripts:
# 1) load in prior train predictions for training intermediate level2 stacks
# 2) load in prior train predictions for a final level ... |
install.packages("devtools")
devtools::install_github("colemanja91/rEloqua")
library(rEloqua)
## Setup login object
myLogin <- eloquaLogin(pod = 1, company = "myCompany", username = "myUsername", password = "myPassword")
## Create an export definition for Web Visit Activities, filtering for 2015-11-19
filters <-... | /example.R | no_license | colemanja91/rEloqua | R | false | false | 994 | r | install.packages("devtools")
devtools::install_github("colemanja91/rEloqua")
library(rEloqua)
## Setup login object
myLogin <- eloquaLogin(pod = 1, company = "myCompany", username = "myUsername", password = "myPassword")
## Create an export definition for Web Visit Activities, filtering for 2015-11-19
filters <-... |
ui = fluidPage(theme = add_theme(getShinyOption('theme')),
add_css(),
sidebarLayout(
sidebarPanel(width = 3,
sliderInput("range.hyp",
label = "Plot Range",
min = 0,
max = 50,
step = 1,
valu... | /teachingApps/inst/apps/distribution_hypergeometric_functions/ui.R | no_license | akhikolla/TestedPackages-NoIssues | R | false | false | 1,669 | r | ui = fluidPage(theme = add_theme(getShinyOption('theme')),
add_css(),
sidebarLayout(
sidebarPanel(width = 3,
sliderInput("range.hyp",
label = "Plot Range",
min = 0,
max = 50,
step = 1,
valu... |
# local copy of the code, did changess and commit
get_data <- function(){
data <- read.csv("surveys1.csv")
return(data)
}
git_size_class <- function(weight){
if(weight>50){
size_class <- "large"
}
else{
size_class <- "small"
}
return(size)
}
git_size_class <- function(weight,threshold){
if(w... | /version control.R | no_license | pamarasinghe/portal_size_ts_analysis | R | false | false | 616 | r | # local copy of the code, did changess and commit
get_data <- function(){
data <- read.csv("surveys1.csv")
return(data)
}
git_size_class <- function(weight){
if(weight>50){
size_class <- "large"
}
else{
size_class <- "small"
}
return(size)
}
git_size_class <- function(weight,threshold){
if(w... |
################################################################################
# Covid Data Analysis South Tyrol
# (c) Thomas Ludwig
################################################################################
# packages
library(ggplot2)
library(dplyr)
library(readxl)
library(EpiEstim)
library(incidence)
libra... | /Covid_Analysis/R/covid_analysis.R | no_license | tom-finance/analysis_obituary_covid-19 | R | false | false | 9,711 | r | ################################################################################
# Covid Data Analysis South Tyrol
# (c) Thomas Ludwig
################################################################################
# packages
library(ggplot2)
library(dplyr)
library(readxl)
library(EpiEstim)
library(incidence)
libra... |
context("name_backbone")
test_that("name_backbone returns the correct class", {
vcr::use_cassette("name_backbne", {
tt <- name_backbone(name='Helianthus annuus', rank='species')
uu <- name_backbone(name='Helianthus annuus', rank='species',
verbose = TRUE)
})
expect_is(tt, "list")
expect_is(u... | /tests/testthat/test-name_backbone.r | permissive | yangxhcaf/rgbif | R | false | false | 593 | r | context("name_backbone")
test_that("name_backbone returns the correct class", {
vcr::use_cassette("name_backbne", {
tt <- name_backbone(name='Helianthus annuus', rank='species')
uu <- name_backbone(name='Helianthus annuus', rank='species',
verbose = TRUE)
})
expect_is(tt, "list")
expect_is(u... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/missing_ind.R
\name{miss_ind}
\alias{miss_ind}
\title{Add missingness indicators to existing data object}
\usage{
miss_ind(data, prefix = "miss_")
}
\arguments{
\item{data}{A numeric vector or array.}
\item{prefix}{A string used to name the ... | /man/miss_ind.Rd | permissive | nhejazi/nima | R | false | true | 669 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/missing_ind.R
\name{miss_ind}
\alias{miss_ind}
\title{Add missingness indicators to existing data object}
\usage{
miss_ind(data, prefix = "miss_")
}
\arguments{
\item{data}{A numeric vector or array.}
\item{prefix}{A string used to name the ... |
# Chapter 7 Exercise 2: indexing and filtering vectors
# Create a vector `first_ten` that has the values 10 through 20 in it (using
# the : operator)
first_ten <- c(10:20)
# Create a vector `next_ten` that has the values 21 through 30 in it (using the
# seq() function)
next_ten <- seq(21, 30)
# Create a vector `al... | /chapter-07-exercises/exercise-2/exercise.R | permissive | hshin0718/book-exercises | R | false | false | 1,643 | r | # Chapter 7 Exercise 2: indexing and filtering vectors
# Create a vector `first_ten` that has the values 10 through 20 in it (using
# the : operator)
first_ten <- c(10:20)
# Create a vector `next_ten` that has the values 21 through 30 in it (using the
# seq() function)
next_ten <- seq(21, 30)
# Create a vector `al... |
# load raw data and create a data.frame object
setwd("~/Documents/R/bank/")
bank <- read.csv("bank.csv",header=T)
# kill the CMB
bank <- bank[bank$sbank!="招商",]
nb <- data.frame(bank$amount,bank$date,bank$bank,bank$sbank)
# rename the colnames of the data.frame
colnames(nb) <- c("ex","date","bank","sbank")
# cre... | /bank/amount.R | no_license | allenmagic/R | R | false | false | 1,561 | r | # load raw data and create a data.frame object
setwd("~/Documents/R/bank/")
bank <- read.csv("bank.csv",header=T)
# kill the CMB
bank <- bank[bank$sbank!="招商",]
nb <- data.frame(bank$amount,bank$date,bank$bank,bank$sbank)
# rename the colnames of the data.frame
colnames(nb) <- c("ex","date","bank","sbank")
# cre... |
library(tidyverse)
# Define input locationsfulcrum export data
fulcrum_file <- 'data/tree_transfer_20200423.csv'
photo_source <- "data/photos/" # Put full selection of export photos here
photo_destination <- "output/photos_o/" # Location where exported photos will be moved
#### Photo ID processings
df <- read_csv(fulc... | /R/photo_move.r | no_license | aecom-ecology/fulcrum_photo_handler | R | false | false | 1,043 | r | library(tidyverse)
# Define input locationsfulcrum export data
fulcrum_file <- 'data/tree_transfer_20200423.csv'
photo_source <- "data/photos/" # Put full selection of export photos here
photo_destination <- "output/photos_o/" # Location where exported photos will be moved
#### Photo ID processings
df <- read_csv(fulc... |
"block.random" <-
function(n,ncond=NULL) {
if(is.null(ncond)) {ncond <- 2
IVs <- 1
conditions <- c(ncond)
} else {
if (length(ncond) < 2) {
IVs<- 1
conditions <- c(ncond)} else {
... | /R/block.random.R | no_license | cran/psych | R | false | false | 1,189 | r | "block.random" <-
function(n,ncond=NULL) {
if(is.null(ncond)) {ncond <- 2
IVs <- 1
conditions <- c(ncond)
} else {
if (length(ncond) < 2) {
IVs<- 1
conditions <- c(ncond)} else {
... |
# Write a function that reads a directory full of files and reports the number of
# completely observed cases in each data file.
# The function should return a data frame
# where the first column is the name of the file and the
# second column is the number of complete cases.
... | /source/complete.R | no_license | Natachacarvalho/R-course | R | false | false | 1,906 | r | # Write a function that reads a directory full of files and reports the number of
# completely observed cases in each data file.
# The function should return a data frame
# where the first column is the name of the file and the
# second column is the number of complete cases.
... |
#'Plot model trajectories
#'
#'This function use faceting to plot all trajectories in a data frame. Convenient to see results of several simulations, or data. Also, if \code{data} is present, then an additional plot is displayed with data and potentially observation generated.
#' @param traj data.frame, output of \code... | /R/plot.r | no_license | arbstat/fitR | R | false | false | 22,294 | r | #'Plot model trajectories
#'
#'This function use faceting to plot all trajectories in a data frame. Convenient to see results of several simulations, or data. Also, if \code{data} is present, then an additional plot is displayed with data and potentially observation generated.
#' @param traj data.frame, output of \code... |
\name{HR}
\alias{BT}
\alias{HR}
\alias{HR2}
\title{Convert path/url to HTML href Tag}
\usage{
HR(path = "clipboard", text = NULL, new_win = FALSE,
copy2clip = TRUE, print = FALSE)
HR2(path = "clipboard", text = NULL, new_win = TRUE,
copy2clip = TRUE, print = FALSE)
BT(path = "clipboard", text = NULL, ne... | /man/hyperref.Rd | no_license | riverlee/reports | R | false | false | 1,876 | rd | \name{HR}
\alias{BT}
\alias{HR}
\alias{HR2}
\title{Convert path/url to HTML href Tag}
\usage{
HR(path = "clipboard", text = NULL, new_win = FALSE,
copy2clip = TRUE, print = FALSE)
HR2(path = "clipboard", text = NULL, new_win = TRUE,
copy2clip = TRUE, print = FALSE)
BT(path = "clipboard", text = NULL, ne... |
library(data.table)
library(plyr)
library(randtoolbox)
df1 = fread("D:/SEMESTR IV/PRAKTYKI/dane1.csv")
setwd("D:/SEMESTR IV/PRAKTYKI/csvFiles10mln")
fileList = list.files(path = "D:/SEMESTR IV/PRAKTYKI/csvFiles10mln")
dataset = data.frame()
for (i in 1:length(fileList)){
tempDf = fread(fileList[i])
dataset = r... | /R/analyzing_python_vectors.R | no_license | karo99/RandomNumberGenerating | R | false | false | 2,046 | r | library(data.table)
library(plyr)
library(randtoolbox)
df1 = fread("D:/SEMESTR IV/PRAKTYKI/dane1.csv")
setwd("D:/SEMESTR IV/PRAKTYKI/csvFiles10mln")
fileList = list.files(path = "D:/SEMESTR IV/PRAKTYKI/csvFiles10mln")
dataset = data.frame()
for (i in 1:length(fileList)){
tempDf = fread(fileList[i])
dataset = r... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ge_model_microhap1.R
\name{ge_model_microhap1}
\alias{ge_model_microhap1}
\title{create matrix C for probability of observed genotypes from microhaplotype data}
\usage{
ge_model_microhap1(
L,
miscall_rate = 0.005,
dropout_rate = 0.005,
... | /man/ge_model_microhap1.Rd | no_license | eriqande/CKMRsim | R | false | true | 2,205 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ge_model_microhap1.R
\name{ge_model_microhap1}
\alias{ge_model_microhap1}
\title{create matrix C for probability of observed genotypes from microhaplotype data}
\usage{
ge_model_microhap1(
L,
miscall_rate = 0.005,
dropout_rate = 0.005,
... |
#' Find first non-missing element
#'
#' Given a set of vectors, `coalesce()` finds the first non-missing value
#' at each position. This is inspired by the SQL `COALESCE` function
#' which does the same thing for `NULL`s.
#'
#' @param ... Vectors. All inputs should either be length 1, or the
#' same length as the fir... | /R/coalesce.R | permissive | mohamedndiaye/dplyr | R | false | false | 1,365 | r | #' Find first non-missing element
#'
#' Given a set of vectors, `coalesce()` finds the first non-missing value
#' at each position. This is inspired by the SQL `COALESCE` function
#' which does the same thing for `NULL`s.
#'
#' @param ... Vectors. All inputs should either be length 1, or the
#' same length as the fir... |
library(shiny)
# Define UI
ui <- fluidPage(
titlePanel("My Shiny App"),
sidebarLayout(
sidebarPanel(
h1("Installation"),
p("Shiny is available on CRAN, so you can install it in the usual way from your R console:"),
code('install.packages("shiny")'),
... | /Shiny/App-1/app.R | no_license | vanbibn/datasciencecoursera | R | false | false | 1,532 | r | library(shiny)
# Define UI
ui <- fluidPage(
titlePanel("My Shiny App"),
sidebarLayout(
sidebarPanel(
h1("Installation"),
p("Shiny is available on CRAN, so you can install it in the usual way from your R console:"),
code('install.packages("shiny")'),
... |
/9 Other/Advanced/asm/traccia comandi R 2015_2016_ASM - 7 - CA (addendum)(1).R | no_license | Alejandroslab/R-Studio | R | false | false | 5,428 | r | ||
# Title: JHU EDA Final Assignment - Plot 4
# Author: Tucker Doud
# Date: Nov 6, 2016
# Data Source: RDS file 'summarySCC_PM25.rds' in wd()
# Load data and tools -------------------------------------------------
library(dplyr)
library(ggplot2)
setwd("~/GitHub/ExplDataAnalysis/Assignment2") #Chang... | /Assignment2/Plot4.R | no_license | jtdoud/ExplDataAnalysis | R | false | false | 1,210 | r |
# Title: JHU EDA Final Assignment - Plot 4
# Author: Tucker Doud
# Date: Nov 6, 2016
# Data Source: RDS file 'summarySCC_PM25.rds' in wd()
# Load data and tools -------------------------------------------------
library(dplyr)
library(ggplot2)
setwd("~/GitHub/ExplDataAnalysis/Assignment2") #Chang... |
#' Filter phylogenomics datasets
#'
#' Detection and filtering out of outliers in a list of trees
#' or a list of distance matrices.
#'
#' @param X A list of phylogenetic trees (phylo object) or a list
#' of distance matrices. Trees can have different number of leaves and matrices
#' can have different dimensions. ... | /R/phylter.R | no_license | damiendevienne/phylter | R | false | false | 11,846 | r | #' Filter phylogenomics datasets
#'
#' Detection and filtering out of outliers in a list of trees
#' or a list of distance matrices.
#'
#' @param X A list of phylogenetic trees (phylo object) or a list
#' of distance matrices. Trees can have different number of leaves and matrices
#' can have different dimensions. ... |
\name{foo}
\alias{foo}
\title{The foo function}
\usage{
foo(a, b)
}
\arguments{
\item{a}{one argument}
\item{b}{the other one}
}
\value{
\code{NULL}
}
\description{
This is the foo function.
}
\section{Special Section}{
This is a customized \bold{section}.
Another paragraph with a URL \url{https://git... | /inst/examples/pkgDemo/man/foo.Rd | no_license | aalfons/Rd2roxygen | R | false | false | 422 | rd | \name{foo}
\alias{foo}
\title{The foo function}
\usage{
foo(a, b)
}
\arguments{
\item{a}{one argument}
\item{b}{the other one}
}
\value{
\code{NULL}
}
\description{
This is the foo function.
}
\section{Special Section}{
This is a customized \bold{section}.
Another paragraph with a URL \url{https://git... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_and_summary.R
\name{plot.ithresh}
\alias{plot.ithresh}
\title{Plot diagnostics an ithresh object}
\usage{
\method{plot}{ithresh}(x, y, ..., which_v = NULL, prob = TRUE,
top_scale = TRUE, add_legend = FALSE, legend_pos = "topleft... | /man/plot.ithresh.Rd | no_license | GRSEB9S/threshr | R | false | true | 5,403 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_and_summary.R
\name{plot.ithresh}
\alias{plot.ithresh}
\title{Plot diagnostics an ithresh object}
\usage{
\method{plot}{ithresh}(x, y, ..., which_v = NULL, prob = TRUE,
top_scale = TRUE, add_legend = FALSE, legend_pos = "topleft... |
## Data sets used in the course
library(tidyverse)
library(AmesHousing)
## ----colors-----------------------------------------------------------------------------------
KULbg <- "#116E8A"
## ----indeeddotcom-----------------------------------------------------------------------------
# The popularity data (by Katrien... | /scripts/day_1/1_data_sets_used_solutions.R | no_license | Olivello98/workshop-ML | R | false | false | 4,649 | r | ## Data sets used in the course
library(tidyverse)
library(AmesHousing)
## ----colors-----------------------------------------------------------------------------------
KULbg <- "#116E8A"
## ----indeeddotcom-----------------------------------------------------------------------------
# The popularity data (by Katrien... |
# LCM_analysis_helper_functions
# --
# This set of functions is useful for multiple analysis steps of Laser Capture Microdissection (LCM) derived data.
# --
# /// Author --- SIMON FELIX BRUNNER
# /// Creation date --- 2-NOV-2017
library(useful)
get_spread_tbl <- function(caveman_var_calls_tbl, donor_name, minvaf_filt... | /lib/LCM_analysis_helper_functions.R | permissive | sfbrunner/liver-pub-repo | R | false | false | 46,429 | r | # LCM_analysis_helper_functions
# --
# This set of functions is useful for multiple analysis steps of Laser Capture Microdissection (LCM) derived data.
# --
# /// Author --- SIMON FELIX BRUNNER
# /// Creation date --- 2-NOV-2017
library(useful)
get_spread_tbl <- function(caveman_var_calls_tbl, donor_name, minvaf_filt... |
# To add to index.html
# 20190429
thismainpath <- function(){
path <- readline("Main Path ")
if((nchar(path)>0)&&(substring(path,nchar(path))!="/")){
path=paste(path,"/",sep="")
setwd(path)
}
}
thisfile <- function(){
path <- readline("Main Path ")
if((nchar(path)>0)&&(substring(path,nchar(path))... | /indexadd.r | no_license | kubo-yuge/testrun | R | false | false | 5,118 | r | # To add to index.html
# 20190429
thismainpath <- function(){
path <- readline("Main Path ")
if((nchar(path)>0)&&(substring(path,nchar(path))!="/")){
path=paste(path,"/",sep="")
setwd(path)
}
}
thisfile <- function(){
path <- readline("Main Path ")
if((nchar(path)>0)&&(substring(path,nchar(path))... |
# linear regression ###########################################################
###############################################################################
# restart R session
# load data
library(gapminder)
# load other packages needed
library(ggplot2)
library(broom)
library(tidyverse)
library(plotly)
# inspect ... | /code/regressions_ggplot.R | no_license | majazaloznik/2019-03-sage | R | false | false | 2,487 | r | # linear regression ###########################################################
###############################################################################
# restart R session
# load data
library(gapminder)
# load other packages needed
library(ggplot2)
library(broom)
library(tidyverse)
library(plotly)
# inspect ... |
##Functions that cache the inverse of a matrix.
## This function creates a special matrix object that can cache its inverse.
makeCacheMatrix <- function(x = matrix()) {
m <- NULL ##Cache a matrix
set <- function(y) {
x <<- y
m <<- NULL
}
get <- function... | /cachematrix.R | no_license | diluisi/ProgrammingAssignment2 | R | false | false | 1,140 | r | ##Functions that cache the inverse of a matrix.
## This function creates a special matrix object that can cache its inverse.
makeCacheMatrix <- function(x = matrix()) {
m <- NULL ##Cache a matrix
set <- function(y) {
x <<- y
m <<- NULL
}
get <- function... |
rm(list=ls())
setwd('/Users/robins64/Documents/git_repos/grazing-gradients')
library(tidyverse); theme_set(theme_bw()); library(chron)
uniques<-function(x){length(unique(x))}
## read sonja raw bite obs
bite<-read.csv('data/bite-rates/raw/bejarano_biterates_raw.csv', stringsAsFactors=F)
## drop fish without time data... | /scripts/cleaning/bite_rate_bejarano_clean.R | no_license | jpwrobinson/grazing-gradients | R | false | false | 2,801 | r | rm(list=ls())
setwd('/Users/robins64/Documents/git_repos/grazing-gradients')
library(tidyverse); theme_set(theme_bw()); library(chron)
uniques<-function(x){length(unique(x))}
## read sonja raw bite obs
bite<-read.csv('data/bite-rates/raw/bejarano_biterates_raw.csv', stringsAsFactors=F)
## drop fish without time data... |
### practice_2
### dataframe practice - II
library(readr)
test_data <- read_csv("~/GitHub/107-1RSampleCode/week_2/course_2/test_data.csv")
### GetBmi 請複製您於practice_1.R的function GetBmi
GetBmi <- function (my.height.cm, my.weight.kg) {
# Create my.height.m by my.height.cm
my.height.m <- my.height.cm/100
# ... | /week_2/course_2/practice_2.R | no_license | opop2280/107-1-NTUCSX | R | false | false | 3,838 | r | ### practice_2
### dataframe practice - II
library(readr)
test_data <- read_csv("~/GitHub/107-1RSampleCode/week_2/course_2/test_data.csv")
### GetBmi 請複製您於practice_1.R的function GetBmi
GetBmi <- function (my.height.cm, my.weight.kg) {
# Create my.height.m by my.height.cm
my.height.m <- my.height.cm/100
# ... |
# ###################
# # RUG GEOMS
# ###################
rug_server <- function(input, output, session, theme_reactive) {
# https://ggplot2.tidyverse.org/reference/geom_rug.html
p <- ggplot(mtcars, aes(wt, mpg)) +
geom_point()
output$rug <- renderPlot({
p + geom_rug() +
theme_reactive()()
... | /server-components/geoms/rug.R | no_license | taylorperkins/ggplot-themes | R | false | false | 713 | r | # ###################
# # RUG GEOMS
# ###################
rug_server <- function(input, output, session, theme_reactive) {
# https://ggplot2.tidyverse.org/reference/geom_rug.html
p <- ggplot(mtcars, aes(wt, mpg)) +
geom_point()
output$rug <- renderPlot({
p + geom_rug() +
theme_reactive()()
... |
library(XLConnect)
### Name: setColumnWidth-methods
### Title: Setting the width of a column in a worksheet
### Aliases: setColumnWidth setColumnWidth-methods
### setColumnWidth,workbook,character-method
### setColumnWidth,workbook,numeric-method
### Keywords: methods utilities
### ** Examples
# mtcars xlsx fil... | /data/genthat_extracted_code/XLConnect/examples/setColumnWidth-methods.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 661 | r | library(XLConnect)
### Name: setColumnWidth-methods
### Title: Setting the width of a column in a worksheet
### Aliases: setColumnWidth setColumnWidth-methods
### setColumnWidth,workbook,character-method
### setColumnWidth,workbook,numeric-method
### Keywords: methods utilities
### ** Examples
# mtcars xlsx fil... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/General.R
\name{compare_general_numbers}
\alias{compare_general_numbers}
\title{Compare general numbers between data sets}
\usage{
compare_general_numbers(
list_of_data_lists,
colors = c("darkgrey", "chocolate3"),
Legendpos = "top",
m... | /man/compare_general_numbers.Rd | no_license | mathiaskalxdorf/IceR | R | false | true | 926 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/General.R
\name{compare_general_numbers}
\alias{compare_general_numbers}
\title{Compare general numbers between data sets}
\usage{
compare_general_numbers(
list_of_data_lists,
colors = c("darkgrey", "chocolate3"),
Legendpos = "top",
m... |
#title: Analysis and figures for Knight and Bayne 2018. Classification threshold and training data affect the quality and utility of focal species data processed with automated audio-recognition software. Bioacoustics 10.1080/09524622.2018.1503971.
#author: Elly C. Knight
#date: Oct. 1, 2018
library(stringi)
library(t... | /analysis_figures.R | no_license | ecknight/recognizer_training_and_score | R | false | false | 31,666 | r | #title: Analysis and figures for Knight and Bayne 2018. Classification threshold and training data affect the quality and utility of focal species data processed with automated audio-recognition software. Bioacoustics 10.1080/09524622.2018.1503971.
#author: Elly C. Knight
#date: Oct. 1, 2018
library(stringi)
library(t... |
medianNaN <-function(x){
m<-apply(as.matrix(x),2,median,na.rm=TRUE)
return (m)
}
| /DbtTools/nanHandling/R/medianNaN.R | no_license | markus-flicke/KD_Projekt_1 | R | false | false | 96 | r | medianNaN <-function(x){
m<-apply(as.matrix(x),2,median,na.rm=TRUE)
return (m)
}
|
require(wnl)
dPK05 = read.csv("data/PK05.csv", skip=1)
colnames(dPK05) = c("TIME", "DV", "CMT") ; dPK05
AMT = 250 # mg
## Closed form model
fPK05a = function(THETA)
{
V = THETA[1]
Cl = THETA[2]
fe = THETA[3]
Div = AMT
T1 = e$DATA[e$DATA[,"CMT"]==1,"TIME"]
Civ = Div / V * exp(-Cl/V*T1) # Eq 5... | /R-old/PK05.R | no_license | pipetcpt/study-pkpd | R | false | false | 1,307 | r | require(wnl)
dPK05 = read.csv("data/PK05.csv", skip=1)
colnames(dPK05) = c("TIME", "DV", "CMT") ; dPK05
AMT = 250 # mg
## Closed form model
fPK05a = function(THETA)
{
V = THETA[1]
Cl = THETA[2]
fe = THETA[3]
Div = AMT
T1 = e$DATA[e$DATA[,"CMT"]==1,"TIME"]
Civ = Div / V * exp(-Cl/V*T1) # Eq 5... |
#Trying to get it to plot means, not their natural logarithms.
library(shiny)
library(boot)
library(MASS)
library(segmented)
library(sm)
library(mixtools)
library(vioplot)
ui <- fluidPage(
titlePanel("Mixture modelling of Plasmodium falciparum half lives"),
fileInput(inputId = "file", label = "Select... | /Tom/Histogram plot 6.R | no_license | SaiTheinThanTun/Shiny | R | false | false | 5,935 | r | #Trying to get it to plot means, not their natural logarithms.
library(shiny)
library(boot)
library(MASS)
library(segmented)
library(sm)
library(mixtools)
library(vioplot)
ui <- fluidPage(
titlePanel("Mixture modelling of Plasmodium falciparum half lives"),
fileInput(inputId = "file", label = "Select... |
# clear all variables
rm(list = ls(all = TRUE))
graphics.off()
# load data
ibm = read.csv("ibm.csv")
apple = read.csv("apple.csv")
bac = read.csv("bac.csv")
ford = read.csv("ford.csv")
ed = read.csv("ed.csv")
ms = read.csv("ms.csv")
# compute returns for IBM
y1 = ibm[, 5]
a = 0
i = 1
while (i <= 120) {
... | /QID-1229-MVAreturns/MVAreturns.r | no_license | QuantLet/MVA | R | false | false | 2,450 | r |
# clear all variables
rm(list = ls(all = TRUE))
graphics.off()
# load data
ibm = read.csv("ibm.csv")
apple = read.csv("apple.csv")
bac = read.csv("bac.csv")
ford = read.csv("ford.csv")
ed = read.csv("ed.csv")
ms = read.csv("ms.csv")
# compute returns for IBM
y1 = ibm[, 5]
a = 0
i = 1
while (i <= 120) {
... |
# @knitr theta_init
theta1 <- c(R_0 = 2, D_lat = 2, D_inf = 2, alpha = 0.8, D_imm = 16, rho = 0.85)
theta2 <- c(R_0 = 20, D_lat = 2, D_inf = 2, alpha = 0.1, D_imm = 8, rho = 0.3)
| /scripts/snippets/theta-init.r | permissive | sbfnk/mfiidd | R | false | false | 179 | r | # @knitr theta_init
theta1 <- c(R_0 = 2, D_lat = 2, D_inf = 2, alpha = 0.8, D_imm = 16, rho = 0.85)
theta2 <- c(R_0 = 20, D_lat = 2, D_inf = 2, alpha = 0.1, D_imm = 8, rho = 0.3)
|
testlist <- list(mu = -3.1638862116397e+134, var = -3.1638862116397e+134)
result <- do.call(metafolio:::est_beta_params,testlist)
str(result) | /metafolio/inst/testfiles/est_beta_params/libFuzzer_est_beta_params/est_beta_params_valgrind_files/1612988155-test.R | no_license | akhikolla/updatedatatype-list3 | R | false | false | 141 | r | testlist <- list(mu = -3.1638862116397e+134, var = -3.1638862116397e+134)
result <- do.call(metafolio:::est_beta_params,testlist)
str(result) |
\name{confint.breakpointsfull}
\alias{confint.breakpointsfull}
\alias{lines.confint.breakpoints}
\alias{print.confint.breakpoints}
\title{Confidence Intervals for Breakpoints}
\description{
Computes confidence intervals for breakpoints.
}
\usage{
\method{confint}{breakpointsfull}(object, parm = NULL, level = 0.95,
... | /man/confint.breakpointsfull.Rd | no_license | cran/strucchange | R | false | false | 3,361 | rd | \name{confint.breakpointsfull}
\alias{confint.breakpointsfull}
\alias{lines.confint.breakpoints}
\alias{print.confint.breakpoints}
\title{Confidence Intervals for Breakpoints}
\description{
Computes confidence intervals for breakpoints.
}
\usage{
\method{confint}{breakpointsfull}(object, parm = NULL, level = 0.95,
... |
library(pracma)
### Name: abm3pc
### Title: Adams-Bashford-Moulton
### Aliases: abm3pc
### Keywords: ode
### ** Examples
## Attempt on a non-stiff equation
# y' = y^2 - y^3, y(0) = d, 0 <= t <= 2/d, d = 0.01
f <- function(t, y) y^2 - y^3
d <- 1/250
abm1 <- abm3pc(f, 0, 2/d, d, n = 1/d)
abm2 <- abm3pc(f, 0, 2/d, ... | /data/genthat_extracted_code/pracma/examples/abm3.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 477 | r | library(pracma)
### Name: abm3pc
### Title: Adams-Bashford-Moulton
### Aliases: abm3pc
### Keywords: ode
### ** Examples
## Attempt on a non-stiff equation
# y' = y^2 - y^3, y(0) = d, 0 <= t <= 2/d, d = 0.01
f <- function(t, y) y^2 - y^3
d <- 1/250
abm1 <- abm3pc(f, 0, 2/d, d, n = 1/d)
abm2 <- abm3pc(f, 0, 2/d, ... |
# Load RDS
library(ggplot2)
NEI <- readRDS("summarySCC_PM25.rds")
NEI$year <- factor(NEI$year, levels=c('1999', '2002', '2005', '2008'))
SCC <- readRDS("Source_Classification_Code.rds")
# Baltimore City, Maryland == fips
MD.onroad <- subset(NEI, fips == 24510 & type == 'ON-ROAD')
# Aggregate
MD.df <- aggregate(MD.onr... | /plot5.R | no_license | bimpok/Exploratory_Data_Analysis | R | false | false | 864 | r | # Load RDS
library(ggplot2)
NEI <- readRDS("summarySCC_PM25.rds")
NEI$year <- factor(NEI$year, levels=c('1999', '2002', '2005', '2008'))
SCC <- readRDS("Source_Classification_Code.rds")
# Baltimore City, Maryland == fips
MD.onroad <- subset(NEI, fips == 24510 & type == 'ON-ROAD')
# Aggregate
MD.df <- aggregate(MD.onr... |
testlist <- list(A = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 1.22810536108277e+146, 7.37584170671906e-304, 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, 0, 0, 0, 0, 0), .Dim = c(5L, 7L)), B = structure(0, .Dim = c(1L, 1L)))
result <- do.call(multivariance:::match_row... | /multivariance/inst/testfiles/match_rows/AFL_match_rows/match_rows_valgrind_files/1613102808-test.R | no_license | akhikolla/updatedatatype-list3 | R | false | false | 343 | r | testlist <- list(A = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 1.22810536108277e+146, 7.37584170671906e-304, 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, 0, 0, 0, 0, 0), .Dim = c(5L, 7L)), B = structure(0, .Dim = c(1L, 1L)))
result <- do.call(multivariance:::match_row... |
#############################################################
# Get the length and GC content of the ERCCs.
library(Biostrings)
epath <- "/lustre/jmlab/resources/genomes/sequences/spikes/ERCC92.fa"
erccs <- readDNAStringSet(epath)
elen <- width(erccs)
edead <- DNAStringSet(sub("A+$", "", as.character(erccs)))
tab <- ... | /sequences/biophysical/check_biophys.R | no_license | MarioniLab/SpikeIns2016 | R | false | false | 2,212 | r | #############################################################
# Get the length and GC content of the ERCCs.
library(Biostrings)
epath <- "/lustre/jmlab/resources/genomes/sequences/spikes/ERCC92.fa"
erccs <- readDNAStringSet(epath)
elen <- width(erccs)
edead <- DNAStringSet(sub("A+$", "", as.character(erccs)))
tab <- ... |
# Importing necessary libraries
library(tidyverse)
library(caret)
library(dslabs)
library(dplyr)
library(ggplot2)
library(matrixStats)
library(data.table)
library(lubridate)
# Data pre-processing
##########################################################
# Create edx set, validation set (final hold-out test set)
###... | /Project.R | no_license | ANDREW-C1982/Movie-Recomendation-Project | R | false | false | 8,884 | r | # Importing necessary libraries
library(tidyverse)
library(caret)
library(dslabs)
library(dplyr)
library(ggplot2)
library(matrixStats)
library(data.table)
library(lubridate)
# Data pre-processing
##########################################################
# Create edx set, validation set (final hold-out test set)
###... |
###########################################
# TRABALHO FINAL #
# #
#Equipe: Gustavo Vieira Costa #
# Marcus Vinícius do Carmo Bastos #
# Rafael Carneiro de Castro #
# Thaís Matos Acácio #
#####... | /trabalho_final/trabalho_final.R | no_license | castro150/modelos-estatisticos-inferencia-2016-1 | R | false | false | 4,186 | r | ###########################################
# TRABALHO FINAL #
# #
#Equipe: Gustavo Vieira Costa #
# Marcus Vinícius do Carmo Bastos #
# Rafael Carneiro de Castro #
# Thaís Matos Acácio #
#####... |
\name{rxTreeDiscretize}
\alias{rxTreeDiscretize}
\title{Function to discretize continous variables using a tree.}
\usage{
rxTreeDiscretize(formula, data, criteria = c("gini", "information"),
subscript = "disc", sep = "_", integerLabels = FALSE,
finalTransform = TRUE)
}
\arguments{
\item{formula}{Formula}
\item... | /man/rxTreeDiscretize.Rd | no_license | RevoEnhancements/RevoEnhancements | R | false | false | 1,069 | rd | \name{rxTreeDiscretize}
\alias{rxTreeDiscretize}
\title{Function to discretize continous variables using a tree.}
\usage{
rxTreeDiscretize(formula, data, criteria = c("gini", "information"),
subscript = "disc", sep = "_", integerLabels = FALSE,
finalTransform = TRUE)
}
\arguments{
\item{formula}{Formula}
\item... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/visualize.R
\name{visualize.community}
\alias{visualize.community}
\title{visualize ego gene X, its k step neighbours, and the W gene communities: Generate a graph
with different community in different colors.
\code{visualize.community()}is ... | /LANDD/man/visualize.community.Rd | no_license | akhikolla/TestedPackages-NoIssues | R | false | true | 1,565 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/visualize.R
\name{visualize.community}
\alias{visualize.community}
\title{visualize ego gene X, its k step neighbours, and the W gene communities: Generate a graph
with different community in different colors.
\code{visualize.community()}is ... |
throughput_time_case <- function(eventlog, units = "days") {
stop_eventlog(eventlog)
colnames(eventlog)[colnames(eventlog) == case_id(eventlog)] <- "case_classifier"
colnames(eventlog)[colnames(eventlog) == activity_id(eventlog)] <- "event_classifier"
colnames(eventlog)[colnames(eventlog) == life_cycle_id(eventl... | /R/throughput_time_case.R | no_license | smyth7/edeaR | R | false | false | 824 | r |
throughput_time_case <- function(eventlog, units = "days") {
stop_eventlog(eventlog)
colnames(eventlog)[colnames(eventlog) == case_id(eventlog)] <- "case_classifier"
colnames(eventlog)[colnames(eventlog) == activity_id(eventlog)] <- "event_classifier"
colnames(eventlog)[colnames(eventlog) == life_cycle_id(eventl... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/qsub_config.R
\name{create_qsub_config}
\alias{create_qsub_config}
\alias{override_qsub_config}
\title{Create a qsub configuration object.}
\usage{
create_qsub_config(
remote,
local_tmp_path,
remote_tmp_path,
name = "r2qsub",
num_co... | /man/create_qsub_config.Rd | no_license | rcannood/qsub | R | false | true | 4,255 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/qsub_config.R
\name{create_qsub_config}
\alias{create_qsub_config}
\alias{override_qsub_config}
\title{Create a qsub configuration object.}
\usage{
create_qsub_config(
remote,
local_tmp_path,
remote_tmp_path,
name = "r2qsub",
num_co... |
[1] "n_0078" "n_0108" "c_0391" "c_0572" "c_0591" "c_0835" "c_0944" "c_1029" "c_1033"
[10] "c_1095" "c_1100" "c_1172" "c_1190" "c_1225" "c_1231" "c_1247" "c_1259"
ggplot(train.ds, aes(x = c_1259, fill = factor(service_b))) +
geom_histogram(position = "dodge")
| /code/EDA_dataCleaning/veiwFeatures.R | permissive | ctufts/PPFA | R | false | false | 264 | r | [1] "n_0078" "n_0108" "c_0391" "c_0572" "c_0591" "c_0835" "c_0944" "c_1029" "c_1033"
[10] "c_1095" "c_1100" "c_1172" "c_1190" "c_1225" "c_1231" "c_1247" "c_1259"
ggplot(train.ds, aes(x = c_1259, fill = factor(service_b))) +
geom_histogram(position = "dodge")
|
library(lubridate)
lambda<-60
registerTwitterOAuth(cred)
tweets = searchTwitter("RT: #Buenfin @movistarmx", lang="es",cainfo="cacert.pem")
tweets_df = twListToDF(tweets)
followers<-c()
for(i in 1:nrow(tweets_df)){
followers<-c(followers,getUser(tweets_df$screenName[i])$followersCount)
}
STOP<-Sys.time()
M<-getUser('... | /minper.R | no_license | FMurphyHernandez/TwitteR-Intelligence | R | false | false | 913 | r | library(lubridate)
lambda<-60
registerTwitterOAuth(cred)
tweets = searchTwitter("RT: #Buenfin @movistarmx", lang="es",cainfo="cacert.pem")
tweets_df = twListToDF(tweets)
followers<-c()
for(i in 1:nrow(tweets_df)){
followers<-c(followers,getUser(tweets_df$screenName[i])$followersCount)
}
STOP<-Sys.time()
M<-getUser('... |
#First of all, clearing the existing environment
rm(list=ls());
#And unloading the loaded packages
lapply(paste('package:',names(sessionInfo()$otherPkgs),sep=""),detach,character.only=TRUE,unload=TRUE)
#Defining the requred packages, installing the unavailable ones, and loading them into the environment
requiredP... | /moodandmentalhealthall.R | permissive | natalia-io/SSCSurveyAnalysis | R | false | false | 16,401 | r | #First of all, clearing the existing environment
rm(list=ls());
#And unloading the loaded packages
lapply(paste('package:',names(sessionInfo()$otherPkgs),sep=""),detach,character.only=TRUE,unload=TRUE)
#Defining the requred packages, installing the unavailable ones, and loading them into the environment
requiredP... |
data2010 <- get_mlb_data('data/retrosheet/GL2010.txt')
data2011 <- get_mlb_data('data/retrosheet/GL2011.txt')
data2012 <- get_mlb_data('data/retrosheet/GL2012.txt')
data2013 <- get_mlb_data('data/retrosheet/GL2013.txt')
data2014 <- get_mlb_data('data/retrosheet/GL2014.txt')
data2015 <- get_mlb_data('data/retrosheet/G... | /main.r | no_license | macc87/mlb_games | R | false | false | 1,948 | r |
data2010 <- get_mlb_data('data/retrosheet/GL2010.txt')
data2011 <- get_mlb_data('data/retrosheet/GL2011.txt')
data2012 <- get_mlb_data('data/retrosheet/GL2012.txt')
data2013 <- get_mlb_data('data/retrosheet/GL2013.txt')
data2014 <- get_mlb_data('data/retrosheet/GL2014.txt')
data2015 <- get_mlb_data('data/retrosheet/G... |
library(ape)
testtree <- read.tree("11101_0.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="11101_0_unrooted.txt") | /codeml_files/newick_trees_processed_and_cleaned/11101_0/rinput.R | no_license | DaniBoo/cyanobacteria_project | R | false | false | 137 | r | library(ape)
testtree <- read.tree("11101_0.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="11101_0_unrooted.txt") |
#####################################################################
#
# this program takes the summary data created
# by python program
# /groups/brooksgrp/center_for_washington_area_studies/state_of_the_capitol_region/python_programs/2019/acs_census_zcta_ch01_ch03_v04.py
# and tries to make plots from it
# for prese... | /r_programs/2019/old/acs_zcta_plots_ch01_ch03_v08_all_areas_counties.R | no_license | chirag-jhamb/us_census_data_study | R | false | false | 25,868 | r | #####################################################################
#
# this program takes the summary data created
# by python program
# /groups/brooksgrp/center_for_washington_area_studies/state_of_the_capitol_region/python_programs/2019/acs_census_zcta_ch01_ch03_v04.py
# and tries to make plots from it
# for prese... |
################################################################################
### R script to compare several conditions with the SARTools and edgeR packages
### Hugo Varet
### June 1st, 2017
### designed to be executed with SARTools 1.5.0
#############################################################################... | /scripts/R-scripts/Sartools_EdgeR.r | no_license | ChromatinCardiff/DanielPassProcessingPipelines | R | false | false | 4,597 | r | ################################################################################
### R script to compare several conditions with the SARTools and edgeR packages
### Hugo Varet
### June 1st, 2017
### designed to be executed with SARTools 1.5.0
#############################################################################... |
## pASTA code for p-value estimation and subset identification
if(!require("smoothmest")) install.packages("smoothmest")
library(smoothmest)
cond.prob <- function(K, current.subset, study.size, cor){
# K is the total number of traits
# current.subset is a vector of length K, a row from all.combn
# cor is the co... | /pASTA_code.R | no_license | youfeiyu/pASTA | R | false | false | 3,688 | r | ## pASTA code for p-value estimation and subset identification
if(!require("smoothmest")) install.packages("smoothmest")
library(smoothmest)
cond.prob <- function(K, current.subset, study.size, cor){
# K is the total number of traits
# current.subset is a vector of length K, a row from all.combn
# cor is the co... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cluster.R
\name{clusterTimeseries}
\alias{clusterTimeseries}
\title{Cluster a processed time-series with k-means.}
\usage{
clusterTimeseries(tset, K = 16, iter.max = 1e+05, nstart = 100,
nui.thresh = -Inf, verb = 1)
}
\arguments{
\item{tset... | /segmenTier/man/clusterTimeseries.Rd | no_license | akhikolla/InformationHouse | R | false | true | 4,529 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cluster.R
\name{clusterTimeseries}
\alias{clusterTimeseries}
\title{Cluster a processed time-series with k-means.}
\usage{
clusterTimeseries(tset, K = 16, iter.max = 1e+05, nstart = 100,
nui.thresh = -Inf, verb = 1)
}
\arguments{
\item{tset... |
# Look at structure of mtcars
str(mtcars)
cars <- mtcars
# Calculate each car's score in a new column named score
# score = mpg.hp / wt
cars$score <- cars$mpg*cars$hp/cars$wt
str(cars)
# Store the scores in a vector s
s <- cars$score
mean(s)
# Create a new vector named performance equal to the length o... | /Intermediate R/intermediate_exercise_solution.R | no_license | alka15apr/IIITB_Alka | R | false | false | 1,337 | r | # Look at structure of mtcars
str(mtcars)
cars <- mtcars
# Calculate each car's score in a new column named score
# score = mpg.hp / wt
cars$score <- cars$mpg*cars$hp/cars$wt
str(cars)
# Store the scores in a vector s
s <- cars$score
mean(s)
# Create a new vector named performance equal to the length o... |
getwd()
#[1] "C:/Users/Linda/Desktop/Rdocument"
## for Cecile
setwd("~/Dropbox/cecile/Work/SupervisionETC/Linda_Mengling_Xu/Experiment1_RT/src/")
############### Native Attention data ##############
dat1 <- read.csv('C://Users//Linda//Desktop//Rdocument//data//25nativeChineseAttention.csv', header=T, sep=',')
str(dat... | /AttentionModel.R | no_license | ceciletje/Mengling | R | false | false | 29,830 | r | getwd()
#[1] "C:/Users/Linda/Desktop/Rdocument"
## for Cecile
setwd("~/Dropbox/cecile/Work/SupervisionETC/Linda_Mengling_Xu/Experiment1_RT/src/")
############### Native Attention data ##############
dat1 <- read.csv('C://Users//Linda//Desktop//Rdocument//data//25nativeChineseAttention.csv', header=T, sep=',')
str(dat... |
#################################
# Normalization
#################################
setwd("~/Documents/projects/course-data-analysis-basic/r-scripts")
### Calculate z-score normalization.
zscore <- function(x) {
mu = mean(x, na.rm = TRUE)
ro = sd(x, na.rm = TRUE)
z = (x - mu) / ro
return (z)
}
### Calculate ... | /r-scripts/01_normalization.R | no_license | nextmining/course-data-analysis-basic | R | false | false | 1,123 | r | #################################
# Normalization
#################################
setwd("~/Documents/projects/course-data-analysis-basic/r-scripts")
### Calculate z-score normalization.
zscore <- function(x) {
mu = mean(x, na.rm = TRUE)
ro = sd(x, na.rm = TRUE)
z = (x - mu) / ro
return (z)
}
### Calculate ... |
library(tidyverse)
library(lubridate)
patient_demo <- read_tsv("data/patient_demo.txt")
patient_cd4 <- read_tsv("data/patient_cd4.txt")
patient_who_stage <- read_tsv("data/patient_who_stage.txt")
patient_art_ctx_event <- read_tsv("data/patient_art_ctx_event.txt")
patient_demo_2006 <- patient_demo %>% filter(year(Dat... | /uscf_script.R | no_license | mayerantoine/PEPFARDataAnalysis | R | false | false | 2,174 | r | library(tidyverse)
library(lubridate)
patient_demo <- read_tsv("data/patient_demo.txt")
patient_cd4 <- read_tsv("data/patient_cd4.txt")
patient_who_stage <- read_tsv("data/patient_who_stage.txt")
patient_art_ctx_event <- read_tsv("data/patient_art_ctx_event.txt")
patient_demo_2006 <- patient_demo %>% filter(year(Dat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.