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 |
|---|---|---|---|---|---|---|---|---|---|
#' @export
ntigram <-
function (x, bins = 12, name = deparse(substitute(x)), ...)
{
if (bins >= length(x)/3) {
bins <- round(length(x)/3)
}
sdata <- sort(x)
width <- round(length(sdata)/bins)
l <- length(sdata)
cdata <- sdata[seq(round(l/(2 * bins)), l, length = bins)]
bks <- cdata[... | /R/ntigram.R | no_license | cran/fastR | R | false | false | 727 | r | #' @export
ntigram <-
function (x, bins = 12, name = deparse(substitute(x)), ...)
{
if (bins >= length(x)/3) {
bins <- round(length(x)/3)
}
sdata <- sort(x)
width <- round(length(sdata)/bins)
l <- length(sdata)
cdata <- sdata[seq(round(l/(2 * bins)), l, length = bins)]
bks <- cdata[... |
/run_analysis.R | no_license | IgorPavlov2015/Getting-and-Cleaning-Data | R | false | false | 3,378 | r | ||
## cacheMatrix.R is a set of functions that
## take a matrix passed in and initially
## calculate and cache it's inverse such that
## the inverse is calculated only once and
## only the cached inverse is used if needed
## again later.
## The makeCacheMatrix function creates an
## object that can cache the inverse... | /cachematrix.R | no_license | tqfb/ProgrammingAssignment2 | R | false | false | 1,138 | r | ## cacheMatrix.R is a set of functions that
## take a matrix passed in and initially
## calculate and cache it's inverse such that
## the inverse is calculated only once and
## only the cached inverse is used if needed
## again later.
## The makeCacheMatrix function creates an
## object that can cache the inverse... |
\name{dwt.forward}
\alias{dwt.forward}
\alias{dwt.backward}
\alias{modwt.forward}
\alias{modwt.backward}
\title{
Discrete Wavelet Transform and Maximal Overlap Discrete Wavelet
Tranform Forward and Backward Pyramid Algorithm
}
\description{
Implementation of DWT and MODWT forward and backward pyramid
algorithms... | /man/dwt.forward.Rd | no_license | cran/wavelets | R | false | false | 2,330 | rd | \name{dwt.forward}
\alias{dwt.forward}
\alias{dwt.backward}
\alias{modwt.forward}
\alias{modwt.backward}
\title{
Discrete Wavelet Transform and Maximal Overlap Discrete Wavelet
Tranform Forward and Backward Pyramid Algorithm
}
\description{
Implementation of DWT and MODWT forward and backward pyramid
algorithms... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/deprecated.R
\name{annotate_junc_ref}
\alias{annotate_junc_ref}
\alias{.get_ref_exons_annot}
\alias{.tidy_junc_annot}
\alias{.classify_junc}
\alias{.get_gr_for_start_end}
\alias{.merge_lists}
\title{Deprecated function: Annotate junctions usi... | /man/deprecated.Rd | no_license | dzhang32/dasper | R | false | true | 1,575 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/deprecated.R
\name{annotate_junc_ref}
\alias{annotate_junc_ref}
\alias{.get_ref_exons_annot}
\alias{.tidy_junc_annot}
\alias{.classify_junc}
\alias{.get_gr_for_start_end}
\alias{.merge_lists}
\title{Deprecated function: Annotate junctions usi... |
# Libraries ---------------------------------------------------------------
library(tidyverse)
library(randomForest)
# Get data ----------------------------------------------------------------
samplesizes <- read_delim("data/references/sample_sizes.csv", delim = ";")
samplesizes <- samplesizes[-((nrow(samplesizes) ... | /lib/03_calibrate_validate_RF_model.R | no_license | Mcflyuu/MappingForestDisturbancesEurope | R | false | false | 8,547 | r |
# Libraries ---------------------------------------------------------------
library(tidyverse)
library(randomForest)
# Get data ----------------------------------------------------------------
samplesizes <- read_delim("data/references/sample_sizes.csv", delim = ";")
samplesizes <- samplesizes[-((nrow(samplesizes) ... |
#-------------------------------------------------------------------------
# Code to check if variables exists
# Used in the RUNCODE_PowerSteps - Step 5 to make sure all variables are loaded
# before proceeding.
#--------------------------------------------------------------------------
var.check <- function(var... | /Functions_Fonctions/FormattingScripts/check.var.FUN.r | no_license | martinjeanphd/CABIN_vv_RCBA | R | false | false | 2,999 | r | #-------------------------------------------------------------------------
# Code to check if variables exists
# Used in the RUNCODE_PowerSteps - Step 5 to make sure all variables are loaded
# before proceeding.
#--------------------------------------------------------------------------
var.check <- function(var... |
# Bike Sharing Demand Prediction / 2021.01.07
library(tidymodels) # machine learning
library(caret)
library(lubridate) # working with date & time
library(tidyverse) # data wrangling
library(moments) # skewness testing
library(corrr) # correlation
bike <- read_csv("Data.csv")
bike %>% dim()
# No variables have missing ... | /Bike-Sharing/Bike-Sharing.R | no_license | EpiSuRgeon/Machine-Learning-Projects | R | false | false | 8,238 | r | # Bike Sharing Demand Prediction / 2021.01.07
library(tidymodels) # machine learning
library(caret)
library(lubridate) # working with date & time
library(tidyverse) # data wrangling
library(moments) # skewness testing
library(corrr) # correlation
bike <- read_csv("Data.csv")
bike %>% dim()
# No variables have missing ... |
\name{filterPD-methods}
\docType{methods}
\alias{filterPD}
\alias{filterPD-methods}
\alias{filterPD,PD-method}
\title{Simple filtering of a partial discharge signal}
\description{Filtering of a partial discharge signal.}
\usage{
\S4method{filterPD}{PD}(object,
filter=N>10 & nZC>0 & W4>0 & freq1>1 & freq1<2e7 &... | /man/filterPD-methods.Rd | no_license | oscarperpinan/pdcluster | R | false | false | 857 | rd | \name{filterPD-methods}
\docType{methods}
\alias{filterPD}
\alias{filterPD-methods}
\alias{filterPD,PD-method}
\title{Simple filtering of a partial discharge signal}
\description{Filtering of a partial discharge signal.}
\usage{
\S4method{filterPD}{PD}(object,
filter=N>10 & nZC>0 & W4>0 & freq1>1 & freq1<2e7 &... |
### Most fit allele always don't go to fixation.
source("http://jonsmitchell.com/code/fxn05.R")
Pop1<-simPop(Popsize=50, nGenerations=100,initial_p=0.5,h =1,s=0)
test<-simPop(Popsize=10, nGenerations=10,initial_p=0.1,h =1,s=0)
test
plot(1:nrow(Pop1),Pop1[,1],ylim=c(0,1), type ="l" , xlab="generation", ylab="allele fr... | /Task_04/Task_04.r | no_license | 01raza/Tasks | R | false | false | 5,213 | r | ### Most fit allele always don't go to fixation.
source("http://jonsmitchell.com/code/fxn05.R")
Pop1<-simPop(Popsize=50, nGenerations=100,initial_p=0.5,h =1,s=0)
test<-simPop(Popsize=10, nGenerations=10,initial_p=0.1,h =1,s=0)
test
plot(1:nrow(Pop1),Pop1[,1],ylim=c(0,1), type ="l" , xlab="generation", ylab="allele fr... |
## Read the data
p <- read.table("./household_power_consumption.txt", header=TRUE, sep=';', na.strings="?")
## making sure date is understood as a date...
p$Date <- as.Date(p$Date, format="%d/%m/%Y")
## Subsetting the data
psub <- subset(p, subset=(Date >= "2007-02-01" & Date <= "2007-02-02"))
## Combine date/time... | /exploratory_data_analysis/plot3.R | no_license | brockwebb/datasciencecoursera | R | false | false | 1,465 | r | ## Read the data
p <- read.table("./household_power_consumption.txt", header=TRUE, sep=';', na.strings="?")
## making sure date is understood as a date...
p$Date <- as.Date(p$Date, format="%d/%m/%Y")
## Subsetting the data
psub <- subset(p, subset=(Date >= "2007-02-01" & Date <= "2007-02-02"))
## Combine date/time... |
#' Build output dataframes for CU data
#'
#' This is one of two sister functions that are extensions of
#' \code{genOutputList} and used to builds dataframes around key variables that
#' change across scenarios. One is for CU-specific data and the other for
#' aggregate data. Each combination of directory, subdirectory... | /R/buildDataframe.R | no_license | carrieholt/samSim | R | false | false | 7,564 | r | #' Build output dataframes for CU data
#'
#' This is one of two sister functions that are extensions of
#' \code{genOutputList} and used to builds dataframes around key variables that
#' change across scenarios. One is for CU-specific data and the other for
#' aggregate data. Each combination of directory, subdirectory... |
#' Identify Nearest Date in a Timeseries Relative to an Index Timepoint
#'
#' \code{FindNearestDate} returns a binary vector of the same length as input data. The value 1 indicates the vector or row position of the comparison
#' where the nearest data to the index date is true. Applies to each g... | /R/FindNearestDate.R | permissive | billy-nz/Allie | R | false | false | 5,055 | r | #' Identify Nearest Date in a Timeseries Relative to an Index Timepoint
#'
#' \code{FindNearestDate} returns a binary vector of the same length as input data. The value 1 indicates the vector or row position of the comparison
#' where the nearest data to the index date is true. Applies to each g... |
#Appendix B. - Guide for Placing Soils in Capability Subclasses in California - Guides A and B
#(Only soils in capability classes 2 through 7 are assigned to a subclass.)
#criteria in guide A and B are the same, but subclass by slope % varies
#NOTES (AGB):
# Somewhat poorly drained soils that lack a slow/v.slow perme... | /LCC/lcc_subclassR.R | no_license | brownag/sANDREWbox | R | false | false | 10,852 | r | #Appendix B. - Guide for Placing Soils in Capability Subclasses in California - Guides A and B
#(Only soils in capability classes 2 through 7 are assigned to a subclass.)
#criteria in guide A and B are the same, but subclass by slope % varies
#NOTES (AGB):
# Somewhat poorly drained soils that lack a slow/v.slow perme... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/trend_months.R
\name{trend_months}
\alias{trend_months}
\title{Visualize price tendencies in months}
\usage{
trend_months(years = 2016:2016, months = 1:6, min_lag = 0, max_lag = 60)
}
\arguments{
\item{years}{a vector of years to plot}
\item... | /man/trend_months.Rd | no_license | mokacao/ppai | R | false | true | 709 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/trend_months.R
\name{trend_months}
\alias{trend_months}
\title{Visualize price tendencies in months}
\usage{
trend_months(years = 2016:2016, months = 1:6, min_lag = 0, max_lag = 60)
}
\arguments{
\item{years}{a vector of years to plot}
\item... |
.onAttach <- function(libname, pkgname) {
packageStartupMessage("><(((O> ><(((O> ><(((O> Welcome to the OGFL utility package <O)))>< <O)))>< <O)))>< ")
}
ec_2_sal = function(temp, cond){
if (any(temp > 35, na.rm = T)) {
warning('Temperature is high, ensure that units are in degrees C', call. = F, immediate. =... | /R/utils.R | no_license | MalteWillmes/OGFLtools | R | false | false | 10,482 | r | .onAttach <- function(libname, pkgname) {
packageStartupMessage("><(((O> ><(((O> ><(((O> Welcome to the OGFL utility package <O)))>< <O)))>< <O)))>< ")
}
ec_2_sal = function(temp, cond){
if (any(temp > 35, na.rm = T)) {
warning('Temperature is high, ensure that units are in degrees C', call. = F, immediate. =... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MatOp.R
\name{MatOp}
\alias{MatOp}
\title{Conduct a matrix operation and print the diagonal elements of the product}
\usage{
MatOp(A, B, C, D)
}
\arguments{
\item{A}{A matrix}
\item{B}{A matrix. Size equals size of A}
\item{C}{A matrix. Num... | /MatrixOperation/man/MatOp.Rd | no_license | zxq991109/MatOp | R | false | true | 497 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MatOp.R
\name{MatOp}
\alias{MatOp}
\title{Conduct a matrix operation and print the diagonal elements of the product}
\usage{
MatOp(A, B, C, D)
}
\arguments{
\item{A}{A matrix}
\item{B}{A matrix. Size equals size of A}
\item{C}{A matrix. Num... |
#' Scrape Fantasy Pros Projeections
#'
#' @inheritParams scrape_razzball_steamer
#' @return data frame with fantasy pros projection data
#'
#' @export
scrape_fantasy_pros <- function(url) {
h <- xml2::read_html(url)
projs <- h %>%
html_nodes('#data') %>%
html_table(fill = TRUE)
projs[[1]]
}
#' Read... | /R/fantasy_pros.R | no_license | nicholasgmartin/projprep | R | false | false | 3,916 | r | #' Scrape Fantasy Pros Projeections
#'
#' @inheritParams scrape_razzball_steamer
#' @return data frame with fantasy pros projection data
#'
#' @export
scrape_fantasy_pros <- function(url) {
h <- xml2::read_html(url)
projs <- h %>%
html_nodes('#data') %>%
html_table(fill = TRUE)
projs[[1]]
}
#' Read... |
#' Eavesdrop two continuous variables on a bivariate plot.
#'
#' The \code{eavesdropper_2D} widget displays a bivariate window of data. The
#' plotted data have a half-life and are deleted once their timer (parameter
#' \code{forget}) expires. For the univariate version use \code{eavesdropper}.
#' The number of da... | /R/eavesdropper_2D.R | no_license | cran/switchboard | R | false | false | 7,591 | r | #' Eavesdrop two continuous variables on a bivariate plot.
#'
#' The \code{eavesdropper_2D} widget displays a bivariate window of data. The
#' plotted data have a half-life and are deleted once their timer (parameter
#' \code{forget}) expires. For the univariate version use \code{eavesdropper}.
#' The number of da... |
#' get_crimes
#'
#' Fetches crimes from the police.uk API within a given sf polygon.
#'
#' @param polygon an sf polygon within which to request the crimes data
#' @param start_month first month for which to get data for in the format "YYYY-MM". Defaults to most recent month available.
#' @param end_month last month for... | /R/get_crimes.R | no_license | Chrisjb/rpoliceuk | R | false | false | 4,447 | r | #' get_crimes
#'
#' Fetches crimes from the police.uk API within a given sf polygon.
#'
#' @param polygon an sf polygon within which to request the crimes data
#' @param start_month first month for which to get data for in the format "YYYY-MM". Defaults to most recent month available.
#' @param end_month last month for... |
source("R2WBwrapper.R")
clear.data.param()
load("Y.RData")
set.data("N.site", length(Y))
set.data("Y", Y)
Adj <- c(sapply(2:(N.site - 1), function(a) c(a - 1, a + 1)))
set.data("Adj", c(2, Adj, N.site - 1))
set.data("Weights", rep(1, 2 * N.site - 2))
set.data("Num", c(1, rep(2, N.site - 2), 1))
set.param("beta", 0)
... | /R/kubo/data/11/runbugs.R | no_license | DaisukeYamato/book | R | false | false | 514 | r | source("R2WBwrapper.R")
clear.data.param()
load("Y.RData")
set.data("N.site", length(Y))
set.data("Y", Y)
Adj <- c(sapply(2:(N.site - 1), function(a) c(a - 1, a + 1)))
set.data("Adj", c(2, Adj, N.site - 1))
set.data("Weights", rep(1, 2 * N.site - 2))
set.data("Num", c(1, rep(2, N.site - 2), 1))
set.param("beta", 0)
... |
censusDegree <- c("Secondary","Post-Secondary","Bachelor's","Master's","Associate's","Professional","Doctoral","None")
censusCount <- c(70882,46750,47718,20187,13507+9893,3210,4006,815)
censusRatios <- censusCount/sum(censusCount)
censusFrame <- data.frame(Education = censusDegree, rate = censusRatios) | /SOdevSurvey/global.R | no_license | AJB0211/StackOverflowDeveloperSurvey | R | false | false | 308 | r |
censusDegree <- c("Secondary","Post-Secondary","Bachelor's","Master's","Associate's","Professional","Doctoral","None")
censusCount <- c(70882,46750,47718,20187,13507+9893,3210,4006,815)
censusRatios <- censusCount/sum(censusCount)
censusFrame <- data.frame(Education = censusDegree, rate = censusRatios) |
rm(list=ls())
library(ggplot2)
library(gridExtra)
library(ggpubr)
library(cowplot)
# pal_style = "Set1"
pal_style = "Dark2"
wid = 6
hei = 3
########### Brexit data ###########
load(paste0("res/M0_1.RData"))
ncountries0 = M0_res_mat[1,]
ate0 = M0_res_mat[2,]
load(paste0("res/M1_1.RData"))
ncountries1 = M1_res_mat[1... | /box_brexit.R | permissive | y-ding/DYNSCM | R | false | false | 1,290 | r | rm(list=ls())
library(ggplot2)
library(gridExtra)
library(ggpubr)
library(cowplot)
# pal_style = "Set1"
pal_style = "Dark2"
wid = 6
hei = 3
########### Brexit data ###########
load(paste0("res/M0_1.RData"))
ncountries0 = M0_res_mat[1,]
ate0 = M0_res_mat[2,]
load(paste0("res/M1_1.RData"))
ncountries1 = M1_res_mat[1... |
library(testthat)
library(UN.plot.package)
test_check("UN.plot.package")
| /tests/testthat.R | no_license | tianyang1998/UN.plot.package | R | false | false | 74 | r | library(testthat)
library(UN.plot.package)
test_check("UN.plot.package")
|
RID=read.table("pppb1566.txt", as.is = T, sep="\t") #original file
colnames(RID)[c(1,2)]=c("Raw_ID", "PPPA_ID")
RID$Raw_ID=toupper(RID$Raw_ID)
RID$PPPA_ID=toupper(RID$PPPA_ID)
RID$CPP_ID="NA" #CPP_ID
RID$PPP_ID="NA" #PPP_ID
RID$PAIR_ID="NA"
RID$MS_ID="NA" #MS_ID
RID$USZ_ID="NA" #USZ_ID
RID$Tissue="NA" # Tissue, C (ctrl... | /SWATH/RawIDNov.R | no_license | gc5k/Notes | R | false | false | 5,816 | r | RID=read.table("pppb1566.txt", as.is = T, sep="\t") #original file
colnames(RID)[c(1,2)]=c("Raw_ID", "PPPA_ID")
RID$Raw_ID=toupper(RID$Raw_ID)
RID$PPPA_ID=toupper(RID$PPPA_ID)
RID$CPP_ID="NA" #CPP_ID
RID$PPP_ID="NA" #PPP_ID
RID$PAIR_ID="NA"
RID$MS_ID="NA" #MS_ID
RID$USZ_ID="NA" #USZ_ID
RID$Tissue="NA" # Tissue, C (ctrl... |
library(BMS)
### Name: predict.bma
### Title: Predict Method for bma Objects
### Aliases: predict.bma
### Keywords: utilities
### ** Examples
data(datafls)
mm=bms(datafls,user.int=FALSE)
predict(mm) #fitted values based on MCM frequencies
predict(mm, exact=TRUE) #fitted values based on best models
predict(... | /data/genthat_extracted_code/BMS/examples/predict.bma.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 565 | r | library(BMS)
### Name: predict.bma
### Title: Predict Method for bma Objects
### Aliases: predict.bma
### Keywords: utilities
### ** Examples
data(datafls)
mm=bms(datafls,user.int=FALSE)
predict(mm) #fitted values based on MCM frequencies
predict(mm, exact=TRUE) #fitted values based on best models
predict(... |
#### run this file for the pre-registered (confirmatory) analysis
#### main output are the graphs
rm(list=ls())
library(dplyr)
library(ggplot2)
library(MatchIt)
library(multiwayvcov)
library(plm)
library(lmtest)
library(clubSandwich)
library(moments)
library(doParallel)
set.seed(123456789) #not needed for final versi... | /report/analysis_report_hetero_1.R | no_license | bjvca/baraza | R | false | false | 47,725 | r | #### run this file for the pre-registered (confirmatory) analysis
#### main output are the graphs
rm(list=ls())
library(dplyr)
library(ggplot2)
library(MatchIt)
library(multiwayvcov)
library(plm)
library(lmtest)
library(clubSandwich)
library(moments)
library(doParallel)
set.seed(123456789) #not needed for final versi... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cutoff.R
\name{plotkaplanmeier}
\alias{plotkaplanmeier}
\title{Plot KM}
\usage{
plotkaplanmeier(marker, time, event, cutoff = NULL, surv.test = "sctest",
conf.level = 95, colors = c("black", "red"), jpg.width = 1000 * sqrt(2),
jpg.height ... | /man/plotkaplanmeier.Rd | no_license | olssol/cutoff | R | false | true | 398 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cutoff.R
\name{plotkaplanmeier}
\alias{plotkaplanmeier}
\title{Plot KM}
\usage{
plotkaplanmeier(marker, time, event, cutoff = NULL, surv.test = "sctest",
conf.level = 95, colors = c("black", "red"), jpg.width = 1000 * sqrt(2),
jpg.height ... |
library(testit)
test_pkg('myFunctions')
| /tests/test-all.R | no_license | xiaofeng007/myFunctions | R | false | false | 40 | r | library(testit)
test_pkg('myFunctions')
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/auto_delin.R
\name{auto_delin}
\alias{auto_delin}
\title{Auto-Delineation}
\usage{
auto_delin(stimuli, model = c("fpp106", "fpp83"), replace = FALSE, face = 1)
}
\arguments{
\item{stimuli}{list of stimuli}
\item{model}{Which model (fpp106, f... | /man/auto_delin.Rd | permissive | debruine/webmorphR | R | false | true | 1,710 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/auto_delin.R
\name{auto_delin}
\alias{auto_delin}
\title{Auto-Delineation}
\usage{
auto_delin(stimuli, model = c("fpp106", "fpp83"), replace = FALSE, face = 1)
}
\arguments{
\item{stimuli}{list of stimuli}
\item{model}{Which model (fpp106, f... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/strings.R
\name{charseq}
\alias{charseq}
\title{Generates 001, 002, ...}
\usage{
charseq(I, prefix = NULL, suffix = NULL, ndigits = floor(log10(I)) +
1)
}
\arguments{
\item{I}{integer}
\item{prefix}{character, to prepend}
\item{suffix}{ch... | /man/charseq.Rd | no_license | stla/SLutils | R | false | true | 753 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/strings.R
\name{charseq}
\alias{charseq}
\title{Generates 001, 002, ...}
\usage{
charseq(I, prefix = NULL, suffix = NULL, ndigits = floor(log10(I)) +
1)
}
\arguments{
\item{I}{integer}
\item{prefix}{character, to prepend}
\item{suffix}{ch... |
#' Compute forecast
#'
#' Predict time-series curves ("today" from predict_from to horizon) at the selected days
#' indices ("today" from 1am to predict_from-1). This function just runs a loop over all
#' requested indices, and stores the individual forecasts into a Forecast object.
#' Note: in training stage ts_hat(da... | /pkg/R/computeForecast.R | permissive | yagu0/talweg | R | false | false | 4,566 | r | #' Compute forecast
#'
#' Predict time-series curves ("today" from predict_from to horizon) at the selected days
#' indices ("today" from 1am to predict_from-1). This function just runs a loop over all
#' requested indices, and stores the individual forecasts into a Forecast object.
#' Note: in training stage ts_hat(da... |
rm(list=ls())
### SETUP ##############################################################
source("~/Documents/workflows/bird_trait_networks/setup.R")
qcmnames = c("qc", "observer", "ref", "n", "notes")
taxo.var <- c("species", "order","family", "subspp", "parent.spp")
var.var <- c("var", "value", "data")
var.omit <- c... | /process D1.R | no_license | AlejandroG-V/bird_trait_networks | R | false | false | 3,944 | r | rm(list=ls())
### SETUP ##############################################################
source("~/Documents/workflows/bird_trait_networks/setup.R")
qcmnames = c("qc", "observer", "ref", "n", "notes")
taxo.var <- c("species", "order","family", "subspp", "parent.spp")
var.var <- c("var", "value", "data")
var.omit <- c... |
source('scripts/de.R')
trnaPlotCountMatrix <- function () {
mkdir('plots/de')
categories <- list(genes = trnaDeCounts,
acc = trnaAccDe$counts,
type = trnaTypeDe$counts)
plotSingle <- function (data, name) {
on.exit(dev.off())
pdf(sprintf('plots... | /chip/scripts/de-plots.R | permissive | klmr/trna | R | false | false | 767 | r | source('scripts/de.R')
trnaPlotCountMatrix <- function () {
mkdir('plots/de')
categories <- list(genes = trnaDeCounts,
acc = trnaAccDe$counts,
type = trnaTypeDe$counts)
plotSingle <- function (data, name) {
on.exit(dev.off())
pdf(sprintf('plots... |
## This functions are used to solve the inverse matrix and put it in a cache
## allowing to reuse the cached matrix instead of calculating again
## makeCacheMatrix: creates a special matrix with caching abilities
## it receives a normal matrix as an argument
makeCacheMatrix <- function(x = matrix()) ... | /cachematrix.R | no_license | mavigno/ProgrammingAssignment2 | R | false | false | 1,846 | r | ## This functions are used to solve the inverse matrix and put it in a cache
## allowing to reuse the cached matrix instead of calculating again
## makeCacheMatrix: creates a special matrix with caching abilities
## it receives a normal matrix as an argument
makeCacheMatrix <- function(x = matrix()) ... |
<?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="Microsoft.Samples.CRUDSqlAzure" generation="1" functional="0" release="0" Id="7bb933ee-3a5c-40df-ba14-f87439445bfb" dslVersion="1.2.0.0" xmlns="http://schemas.mi... | /Mobile-Restaurant/CRUDSqlAzure3_old/CRUDSqlAzure/csx/Debug/ServiceDefinition.build.rd | no_license | junleqian/Mobile-Restaurant | R | false | false | 18,261 | 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="Microsoft.Samples.CRUDSqlAzure" generation="1" functional="0" release="0" Id="7bb933ee-3a5c-40df-ba14-f87439445bfb" dslVersion="1.2.0.0" xmlns="http://schemas.mi... |
tyot_vakanssi_ku_dat <- readRDS(here("data/avoimet_tyopaikat_tyonhakijat.rds"))
tyot_vakanssi_ku_dat %>%
# filter(vuosi == 2018) %>%
mutate(tyottomyysaste = Tyottomat / Tyovoima,
vakanssiaste = Avoimet_tyopaikat / (Avoimet_tyopaikat + Tyovoima - Tyottomat)) %>%
group_by(Kunta, vuosi) %>%
summarise_at... | /analyysit/Kohtaanto/Koodit/tyottomyys_vakanssit_scatter.R | no_license | pttry/KT162R | R | false | false | 2,788 | r |
tyot_vakanssi_ku_dat <- readRDS(here("data/avoimet_tyopaikat_tyonhakijat.rds"))
tyot_vakanssi_ku_dat %>%
# filter(vuosi == 2018) %>%
mutate(tyottomyysaste = Tyottomat / Tyovoima,
vakanssiaste = Avoimet_tyopaikat / (Avoimet_tyopaikat + Tyovoima - Tyottomat)) %>%
group_by(Kunta, vuosi) %>%
summarise_at... |
#' @name rownames
#'
#' @title Method override for rownames function
#'
#' @exportMethod rownames
setMethod(f = 'rownames', signature = 'IBRAP',
function(x,
do.NULL = TRUE,
prefix = 'row') {
rownames(x@methods[[1]]@counts)
})
setMethod(f = 'ro... | /R/rownames.R | no_license | jcogan1/IBRAP | R | false | false | 503 | r | #' @name rownames
#'
#' @title Method override for rownames function
#'
#' @exportMethod rownames
setMethod(f = 'rownames', signature = 'IBRAP',
function(x,
do.NULL = TRUE,
prefix = 'row') {
rownames(x@methods[[1]]@counts)
})
setMethod(f = 'ro... |
# This script provides a function for getting and preprocessing the required
# two-day usage data. If the data file is not found in the current directory,
# it will be downloaded and unzipped first.
get_twoday_powerusage <- function() {
if(! file.exists("household_power_consumption.txt")){
download.file("ht... | /Plot3.R | no_license | mushshu/Coursera-Assignment | R | false | false | 2,155 | r | # This script provides a function for getting and preprocessing the required
# two-day usage data. If the data file is not found in the current directory,
# it will be downloaded and unzipped first.
get_twoday_powerusage <- function() {
if(! file.exists("household_power_consumption.txt")){
download.file("ht... |
# Set options here
options(golem.app.prod = FALSE) # TRUE = production mode, FALSE = development mode
# Detach all loaded packages and clean your environment
golem::detach_all_attached()
# rm(list=ls(all.names = TRUE))
# Document and reload your package
golem::document_and_reload()
# Run the application
tidytuesday2... | /dev/run_dev.R | permissive | ColinFay/tidytuesday201942 | R | false | false | 337 | r | # Set options here
options(golem.app.prod = FALSE) # TRUE = production mode, FALSE = development mode
# Detach all loaded packages and clean your environment
golem::detach_all_attached()
# rm(list=ls(all.names = TRUE))
# Document and reload your package
golem::document_and_reload()
# Run the application
tidytuesday2... |
#' \code{PlotPLS2DScore} - plot 2D score plot.
#' @param inx1,inx2 The order numbers of PCs.
#' @param reg Set the confidence level for plotting confidence region ellipse.
#' @param show If \code{TRUE} then points at the plot are labeled.
#' @rdname PlotPLS
#' @export
# score plot
plot_PLS_scores <- function(df, inx1 ... | /R/99 - plot_pls.R | no_license | kbajdzienko/Phosphoproteomics | R | false | false | 10,243 | r |
#' \code{PlotPLS2DScore} - plot 2D score plot.
#' @param inx1,inx2 The order numbers of PCs.
#' @param reg Set the confidence level for plotting confidence region ellipse.
#' @param show If \code{TRUE} then points at the plot are labeled.
#' @rdname PlotPLS
#' @export
# score plot
plot_PLS_scores <- function(df, inx1 ... |
# tocID <- "BIN-Storing_data.R"
#
# Purpose: A Bioinformatics Course:
# R code accompanying the BIN-Storing_data unit
#
# Version: 1.3.1
#
# Date: 2017-10 - 2020-09
# Author: Boris Steipe (boris.steipe@utoronto.ca)
#
# V 1.3.1 add overlooked jsonlite:: prefix to fromJson()
# V 1.3 Made file loca... | /BIN-Storing_data.R | no_license | liushangjian/ABC-units | R | false | false | 26,526 | r | # tocID <- "BIN-Storing_data.R"
#
# Purpose: A Bioinformatics Course:
# R code accompanying the BIN-Storing_data unit
#
# Version: 1.3.1
#
# Date: 2017-10 - 2020-09
# Author: Boris Steipe (boris.steipe@utoronto.ca)
#
# V 1.3.1 add overlooked jsonlite:: prefix to fromJson()
# V 1.3 Made file loca... |
library(ggplot2)
library(maps)
library(dplyr)
library(mapdata)
library(rgdal)
#energy = read.csv('Energy_use.csv')
oil = read.csv('oil_boilers.csv')
#we'll look at data on oil_boilers in NYC
#let's start by inspecting data
print(dim(oil))
print(sum(is.na(oil$Latitude)))
print(colnames(oil))
#let's get an idea of of ho... | /projects/projects/NycOil.R | no_license | chinm0818/NYCDSA_proj | R | false | false | 2,017 | r | library(ggplot2)
library(maps)
library(dplyr)
library(mapdata)
library(rgdal)
#energy = read.csv('Energy_use.csv')
oil = read.csv('oil_boilers.csv')
#we'll look at data on oil_boilers in NYC
#let's start by inspecting data
print(dim(oil))
print(sum(is.na(oil$Latitude)))
print(colnames(oil))
#let's get an idea of of ho... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/balanced_sampling.R
\name{samplestratified_shp}
\alias{samplestratified_shp}
\title{Take A Stratified Sample Of A .SHP With Spectral Indices As Attributes}
\usage{
samplestratified_shp(shp_fname, shp_outname, nsamples, plott = T,
cols2ignor... | /man/samplestratified_shp.Rd | no_license | pieterbeck/CanHeMonR | R | false | true | 1,404 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/balanced_sampling.R
\name{samplestratified_shp}
\alias{samplestratified_shp}
\title{Take A Stratified Sample Of A .SHP With Spectral Indices As Attributes}
\usage{
samplestratified_shp(shp_fname, shp_outname, nsamples, plott = T,
cols2ignor... |
#on lit les données
ozoneTrain <- read.table("ozoneTrain.txt", header=TRUE)
#un fait un summary mais avec juste les données qui nou sintéressent
summary(ozoneTrain[,c("maxO3","T12")])
#mettre face a face les deux valuer,s et si 'lon veux considérer toutes les valeurs, on met un . au lieu de T12
plot(maxO3~T12,data=ozo... | /ED/tdED/TD07Datasets/td7.R | no_license | benchekroun/coursm1 | R | false | false | 3,961 | r | #on lit les données
ozoneTrain <- read.table("ozoneTrain.txt", header=TRUE)
#un fait un summary mais avec juste les données qui nou sintéressent
summary(ozoneTrain[,c("maxO3","T12")])
#mettre face a face les deux valuer,s et si 'lon veux considérer toutes les valeurs, on met un . au lieu de T12
plot(maxO3~T12,data=ozo... |
#RETIRED
library(dplyr)
#Data source: JHU -- https://github.com/CSSEGISandData/COVID-19
global_confirmed = read.csv("~/Downloads/.../csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv")
global_deaths = read.csv("~/.../csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_... | /Data/Data_Cleaning_Scripts/Archive/JHU_cleaning_script.R | no_license | jiyingz/COVID19_projections | R | false | false | 2,256 | r | #RETIRED
library(dplyr)
#Data source: JHU -- https://github.com/CSSEGISandData/COVID-19
global_confirmed = read.csv("~/Downloads/.../csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv")
global_deaths = read.csv("~/.../csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_... |
#' @noRd
draw_key_square <- function(data, params, size) {
if (is.null(data$size)) {
data$size <- 0.5
}
grid::rectGrob(
x = 0.5,
y = 0.5,
width = grid::unit(data$r0, "npc") - grid::unit(data$size, "mm"),
height = grid::unit(data$r0, "npc") - grid::unit(data$size, "mm"),
gp = grid::gpar(col... | /R/draw-key.R | no_license | Bmdistef/ggcor | R | false | false | 11,561 | r | #' @noRd
draw_key_square <- function(data, params, size) {
if (is.null(data$size)) {
data$size <- 0.5
}
grid::rectGrob(
x = 0.5,
y = 0.5,
width = grid::unit(data$r0, "npc") - grid::unit(data$size, "mm"),
height = grid::unit(data$r0, "npc") - grid::unit(data$size, "mm"),
gp = grid::gpar(col... |
#' Make state transitions.
#'
#' Take in the matrix of the states of synthetic population (created by \code{syn_pop} function)
#' and calculate the transitions from one state to other state(s) using the transition rate(s).
#'
#' @param origin A number which represents the column index \code{s.matrix} you want to d... | /ibmcraftr/R/state_trans.R | no_license | akhikolla/InformationHouse | R | false | false | 2,417 | r | #' Make state transitions.
#'
#' Take in the matrix of the states of synthetic population (created by \code{syn_pop} function)
#' and calculate the transitions from one state to other state(s) using the transition rate(s).
#'
#' @param origin A number which represents the column index \code{s.matrix} you want to d... |
startTime <- Sys.time()
cat(paste0("> Rscript aucFCC_PCA_cancerDS.R\n"))
suppressPackageStartupMessages(library(foreach, warn.conflicts = FALSE, quietly = TRUE, verbose = FALSE))
suppressPackageStartupMessages(library(doMC, warn.conflicts = FALSE, quietly = TRUE, verbose = FALSE))
suppressPackageStartupMessages(libra... | /aucFCC_PCA_cancerDS.R | no_license | marzuf/TAD_DE_pipeline_v2_11_18 | R | false | false | 7,465 | r |
startTime <- Sys.time()
cat(paste0("> Rscript aucFCC_PCA_cancerDS.R\n"))
suppressPackageStartupMessages(library(foreach, warn.conflicts = FALSE, quietly = TRUE, verbose = FALSE))
suppressPackageStartupMessages(library(doMC, warn.conflicts = FALSE, quietly = TRUE, verbose = FALSE))
suppressPackageStartupMessages(libra... |
#parameters and settings;
#seed
ran.seed <- 1
#Number of new infections per day within the whole ward 58 & 59 is Poisson distributed;
#lambda <- 1 #lambda for the peak season, now assume no seasonality;
n.sim <- 1000
n.pop <- 160000
n.household <-30000 #ask the student for details;
n.person.per.house <- 16/3
n.house.p... | /v5/v5.param.R | no_license | YWAN446/Adaptive-Sampling-Site-Allocation | R | false | false | 1,763 | r | #parameters and settings;
#seed
ran.seed <- 1
#Number of new infections per day within the whole ward 58 & 59 is Poisson distributed;
#lambda <- 1 #lambda for the peak season, now assume no seasonality;
n.sim <- 1000
n.pop <- 160000
n.household <-30000 #ask the student for details;
n.person.per.house <- 16/3
n.house.p... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ss.ceDiag.R
\name{ss.ceDiag}
\alias{ss.ceDiag}
\title{Cause and Effect Diagram}
\usage{
ss.ceDiag(
effect,
causes.gr,
causes,
main = "Six Sigma Cause-and-effect Diagram",
sub,
ss.col = c("#666666", "#BBBBBB", "#CCCCCC", "#DDDDDD",... | /man/ss.ceDiag.Rd | no_license | emilopezcano/SixSigma | R | false | true | 2,357 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ss.ceDiag.R
\name{ss.ceDiag}
\alias{ss.ceDiag}
\title{Cause and Effect Diagram}
\usage{
ss.ceDiag(
effect,
causes.gr,
causes,
main = "Six Sigma Cause-and-effect Diagram",
sub,
ss.col = c("#666666", "#BBBBBB", "#CCCCCC", "#DDDDDD",... |
library(googlesheets4);
library(tidyverse);
library(data.table);
intentions <- read_sheet("intentions_sheet_url")
intentions <- select(intentions, "Farm Name", "Field", "Actual Variety", "PLANTED ACRES", "Planter Operator","Planting Date", "LOT NUMBER")
data <- intentions %>% rename("farm"="Farm Name") %>% rename("f... | /main.r | permissive | lyoder3/intentions-check | R | false | false | 966 | r | library(googlesheets4);
library(tidyverse);
library(data.table);
intentions <- read_sheet("intentions_sheet_url")
intentions <- select(intentions, "Farm Name", "Field", "Actual Variety", "PLANTED ACRES", "Planter Operator","Planting Date", "LOT NUMBER")
data <- intentions %>% rename("farm"="Farm Name") %>% rename("f... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/targeted-methods.R
\docType{class}
\name{targeted-class}
\alias{targeted-class}
\alias{riskreg.targeted}
\alias{ate.targeted}
\title{targeted class object}
\value{
objects of the S3 class '\code{targeted}'
}
\description{
The functions \code{... | /R-package/targeted/man/targeted-class.Rd | permissive | kkholst/target | R | false | true | 1,417 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/targeted-methods.R
\docType{class}
\name{targeted-class}
\alias{targeted-class}
\alias{riskreg.targeted}
\alias{ate.targeted}
\title{targeted class object}
\value{
objects of the S3 class '\code{targeted}'
}
\description{
The functions \code{... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/preprocessing_choice_regression.R
\name{preprocessing_choice_regression}
\alias{preprocessing_choice_regression}
\title{Preprocessing Choice Regressions}
\usage{
preprocessing_choice_regression(Y, choices, dataset = "UK",
base_case_index = ... | /man/preprocessing_choice_regression.Rd | no_license | paddytobias/preText | R | false | true | 1,753 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/preprocessing_choice_regression.R
\name{preprocessing_choice_regression}
\alias{preprocessing_choice_regression}
\title{Preprocessing Choice Regressions}
\usage{
preprocessing_choice_regression(Y, choices, dataset = "UK",
base_case_index = ... |
summary = readRDS("summarySCC_PM25.rds")
source = readRDS("Source_Classification_Code.rds")
library(ggplot2)
x = grepl("Highway Veh",source$Short.Name)
source1 = source[x,]
source2 = source1[,c(1,3)]
mrg = merge(summary,source2,by.x = "SCC",by.y = "SCC")
cond = mrg$fips%in% c("24510","06037")
mrg = mrg[cond,]
library(d... | /project-2/plot6.r | no_license | ayushjain2699/datasciencecoursera | R | false | false | 705 | r | summary = readRDS("summarySCC_PM25.rds")
source = readRDS("Source_Classification_Code.rds")
library(ggplot2)
x = grepl("Highway Veh",source$Short.Name)
source1 = source[x,]
source2 = source1[,c(1,3)]
mrg = merge(summary,source2,by.x = "SCC",by.y = "SCC")
cond = mrg$fips%in% c("24510","06037")
mrg = mrg[cond,]
library(d... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{dprecchol_drho}
\alias{dprecchol_drho}
\title{Derivative of the upper Cholesky triangle of the precision matrix of a
stationary Gaussian AR(1) process.}
\usage{
dprecchol_drho(U, dQ)
}
\arguments{
\item{U}{The upper Choles... | /man/dprecchol_drho.Rd | no_license | cran/irregulAR1 | R | false | true | 897 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{dprecchol_drho}
\alias{dprecchol_drho}
\title{Derivative of the upper Cholesky triangle of the precision matrix of a
stationary Gaussian AR(1) process.}
\usage{
dprecchol_drho(U, dQ)
}
\arguments{
\item{U}{The upper Choles... |
library(googledrive)
drive_get(id = "1o1hi0z9O-G9xsgkspOFG2VWzh0wQKjiezzoVpItaCxU") %>%
drive_download(path = here::here("99-codebook.txt"),
overwrite = T)
file.rename("99-codebook.txt",
"99-codebook.md")
| /code/update_codebook.R | no_license | judgelord/dissertation | R | false | false | 240 | r | library(googledrive)
drive_get(id = "1o1hi0z9O-G9xsgkspOFG2VWzh0wQKjiezzoVpItaCxU") %>%
drive_download(path = here::here("99-codebook.txt"),
overwrite = T)
file.rename("99-codebook.txt",
"99-codebook.md")
|
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{soap}
\alias{soap}
\title{soap data}
\format{\Sexpr[results=rd]{bps6data:::doc_bps6_data("soap") }}
\source{
\url{ http://content.bfwpub.com/webroot_pubcontent/Content/BCS_5/BPS6e/Student/DataSets/PC_Text/P... | /man/soap.Rd | no_license | jrnold/bps6data | R | false | false | 590 | rd | % Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{soap}
\alias{soap}
\title{soap data}
\format{\Sexpr[results=rd]{bps6data:::doc_bps6_data("soap") }}
\source{
\url{ http://content.bfwpub.com/webroot_pubcontent/Content/BCS_5/BPS6e/Student/DataSets/PC_Text/P... |
f<-matrix(0,12,10)
f<-read.table("New Microsoft Excel Worksheet.txt",header = TRUE)
a=0.01
input<-matrix(0,12,9)
for(i in 1:9)
{
input[,i]=f[,i+1]
}
target<-matrix(0,1,12)
for(i in 1:12)
{
target[,i]=f[i,1]
}
weight<-matrix(0,9,10000)
for(i in 1:9)
{
for(j in 1:10000)
{
weight[i,j]=... | /ELMexampleFromNTUwebsiteWithTANHfunctionand10000HiddenLayers.R | no_license | harshitlohani/Extreme-Learning-Machine | R | false | false | 1,307 | r | f<-matrix(0,12,10)
f<-read.table("New Microsoft Excel Worksheet.txt",header = TRUE)
a=0.01
input<-matrix(0,12,9)
for(i in 1:9)
{
input[,i]=f[,i+1]
}
target<-matrix(0,1,12)
for(i in 1:12)
{
target[,i]=f[i,1]
}
weight<-matrix(0,9,10000)
for(i in 1:9)
{
for(j in 1:10000)
{
weight[i,j]=... |
# Assignment 2: Linear Regression Matrix Algebra
# Maxwell Martin - QMST 3334.251 - Spring 2020
# Question 1.
magazines <- read.table("magazines.csv", header = TRUE, sep = ",")
# Question 2.
Y <- magazines[,1]
head(Y)
# Question 3.
X <- magazines[,-1]
X <- cbind(Intercept = 1, X)
class(X)
X <- a... | /matrix_algebra_a2/Martin-Maxwell.R | no_license | maxwell-martin/txst-qmst3334-spring2020 | R | false | false | 655 | r | # Assignment 2: Linear Regression Matrix Algebra
# Maxwell Martin - QMST 3334.251 - Spring 2020
# Question 1.
magazines <- read.table("magazines.csv", header = TRUE, sep = ",")
# Question 2.
Y <- magazines[,1]
head(Y)
# Question 3.
X <- magazines[,-1]
X <- cbind(Intercept = 1, X)
class(X)
X <- a... |
library(tidyverse)
# load in data to bind into a data frame
train_y <- read_delim('~/Downloads/TCGA_mRNA_RNA/y_train.csv', ',', col_names = F)
test_y <- read_delim('~/Downloads/TCGA_mRNA_RNA/y_test.csv', ',', col_names = F)
sample_labels_train <- read_delim('~/Downloads/TCGA_mRNA_RNA/train_X_samples.csv', ',', col_n... | /282_analysis.R | permissive | bkompa/UFDN-Transcriptome | R | false | false | 10,737 | r | library(tidyverse)
# load in data to bind into a data frame
train_y <- read_delim('~/Downloads/TCGA_mRNA_RNA/y_train.csv', ',', col_names = F)
test_y <- read_delim('~/Downloads/TCGA_mRNA_RNA/y_test.csv', ',', col_names = F)
sample_labels_train <- read_delim('~/Downloads/TCGA_mRNA_RNA/train_X_samples.csv', ',', col_n... |
#' Align matrix margins
#'
#' @importFrom magrittr "%<>%"
#' @param mat_list list of matrices (columns are genes, rows are samples)
#' @param na_rows if TRUE, add NAs for missing rows, otherwise they are removed
#' @param na_cols if TRUE, add NAs for missing columns, otherwise they are removed
#' @param use_dims either... | /cdsr-master/R/align_matrix_margins.R | no_license | ssj1739/MyToolkit | R | false | false | 2,001 | r | #' Align matrix margins
#'
#' @importFrom magrittr "%<>%"
#' @param mat_list list of matrices (columns are genes, rows are samples)
#' @param na_rows if TRUE, add NAs for missing rows, otherwise they are removed
#' @param na_cols if TRUE, add NAs for missing columns, otherwise they are removed
#' @param use_dims either... |
#align plot titles in centre
theme_update(plot.title = element_text(hjust = 0.5))
#plot graph, showing changing viewing percentage per run
(step_plot = ggplot(data = video_df_long, aes(x = viewed, y = value, color = factor(step_position))) +
stat_summary(fun = mean, geom = "line") +
labs(
x = "% Vide... | /CSC8631 Project/src/vid_analysis.R | no_license | LukeBattle/CSC8631 | R | false | false | 1,368 | r |
#align plot titles in centre
theme_update(plot.title = element_text(hjust = 0.5))
#plot graph, showing changing viewing percentage per run
(step_plot = ggplot(data = video_df_long, aes(x = viewed, y = value, color = factor(step_position))) +
stat_summary(fun = mean, geom = "line") +
labs(
x = "% Vide... |
cohFunc <- function(x,y) {
m <- matrix(c(x,y),ncol=2)
s <- SDF(m, method="multitaper", n.taper=7)
sm <- as.matrix(s)
#csd <- Re(sm[,2])
csn <- abs(sm[,2] * Conj(sm[,2]))
coh <- csn / Re(sm[,1] * sm[,3])
return(mean(coh))
} | /cohFunc.R | permissive | ColeLab/simplesims | R | false | false | 245 | r | cohFunc <- function(x,y) {
m <- matrix(c(x,y),ncol=2)
s <- SDF(m, method="multitaper", n.taper=7)
sm <- as.matrix(s)
#csd <- Re(sm[,2])
csn <- abs(sm[,2] * Conj(sm[,2]))
coh <- csn / Re(sm[,1] * sm[,3])
return(mean(coh))
} |
#' Generate plots following model projection
#'
#' @param wd working directory
#'
#' @param countryName string defining country name
#'
#' @export
ProjectionPlots <- function(wd, countryName) {
# create output directly
out_dir <- paste0(wd,"/results/", tolower(countryName), "/proj/")
system(paste0("mkdir -... | /inst/projection.R | no_license | strategist922/clustr | R | false | false | 1,652 | r | #' Generate plots following model projection
#'
#' @param wd working directory
#'
#' @param countryName string defining country name
#'
#' @export
ProjectionPlots <- function(wd, countryName) {
# create output directly
out_dir <- paste0(wd,"/results/", tolower(countryName), "/proj/")
system(paste0("mkdir -... |
library(EstSimPDMP)
### Name: CondPdf.DC
### Title: Estimation of the density associated to the jump rate for
### piecewise-deterministic Markov processes (discrete state space)
### Aliases: CondPdf.DC
### ** Examples
# CondPdf.DC
# Simulation of a PDMP with discrete state space
dat<-Simu.PDMP.DC(1,200,verbose=F... | /data/genthat_extracted_code/EstSimPDMP/examples/CondPdf.DC.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 424 | r | library(EstSimPDMP)
### Name: CondPdf.DC
### Title: Estimation of the density associated to the jump rate for
### piecewise-deterministic Markov processes (discrete state space)
### Aliases: CondPdf.DC
### ** Examples
# CondPdf.DC
# Simulation of a PDMP with discrete state space
dat<-Simu.PDMP.DC(1,200,verbose=F... |
#' Convert to tidygraph.
#'
#'
#' @param x model
#' @param ... other args
#'
#' @export
#' @name as_tbl_graph
#' @importFrom tidygraph as_tbl_graph activate
#' @importFrom tibble tibble as_tibble
#' @importFrom dplyr bind_cols %>%
#' @importFrom sc sc_uid
#' @importFrom igraph layout.star
#' @importFrom rlang .dat... | /R/tidygraph.R | no_license | cuulee/scgraph | R | false | false | 1,438 | r | #' Convert to tidygraph.
#'
#'
#' @param x model
#' @param ... other args
#'
#' @export
#' @name as_tbl_graph
#' @importFrom tidygraph as_tbl_graph activate
#' @importFrom tibble tibble as_tibble
#' @importFrom dplyr bind_cols %>%
#' @importFrom sc sc_uid
#' @importFrom igraph layout.star
#' @importFrom rlang .dat... |
setwd('C:/Karun_documents/juniper/outputs_point_juniper')
rm(list=ls(all.names=TRUE))
vvv=expression(paste("GPP (kgCm"^"-2","yr"^"-1",")"))
#vvv=expression(paste("kgC/m"^"2","/yr"))
s1gd<-read.csv('C:/Karun_documents/juniper/outputs_point_juniper/out_def/annual_gpp_co1901_2020.csv')
s1gd[,8]<- s1gd[,3]+s1gd[,4... | /ED2_Juniper/plot_gpp_agb.R | no_license | panditk17/Vegetation-Modeling | R | false | false | 7,616 | r | setwd('C:/Karun_documents/juniper/outputs_point_juniper')
rm(list=ls(all.names=TRUE))
vvv=expression(paste("GPP (kgCm"^"-2","yr"^"-1",")"))
#vvv=expression(paste("kgC/m"^"2","/yr"))
s1gd<-read.csv('C:/Karun_documents/juniper/outputs_point_juniper/out_def/annual_gpp_co1901_2020.csv')
s1gd[,8]<- s1gd[,3]+s1gd[,4... |
# Matrix inversion is usually a costly computation and there may be some benefit
# to caching the inverse of a matrix rather than compute it repeatedly. The
# following two functions are used to cache the inverse of a matrix.
# makeCacheMatrix creates a list containing a function to
# 1. set the value of the matr... | /cachematrix.R | no_license | deepbiomed9/ProgrammingAssignment2 | R | false | false | 1,343 | r | # Matrix inversion is usually a costly computation and there may be some benefit
# to caching the inverse of a matrix rather than compute it repeatedly. The
# following two functions are used to cache the inverse of a matrix.
# makeCacheMatrix creates a list containing a function to
# 1. set the value of the matr... |
ac_1.4 <- read.csv("datasets/AC_1.4_1.21.csv",header = T,stringsAsFactors = F)
ac_1.4$Date.Time <- as.POSIXct(ac_1.4[,1], format = "%d/%m/%Y %I:%M:%S %p")
ac_1.4 <- ac_1.4[order(ac_1.4$Date.Time),]
list_roof <- ac_1.4[16946:38017,c(1,5)]
combine_data <- function(path1,path2){
a = list.files(path1)
dir = paste(pat... | /reformat_data.R | no_license | ChangDeng1110/Final_project_master | R | false | false | 3,049 | r | ac_1.4 <- read.csv("datasets/AC_1.4_1.21.csv",header = T,stringsAsFactors = F)
ac_1.4$Date.Time <- as.POSIXct(ac_1.4[,1], format = "%d/%m/%Y %I:%M:%S %p")
ac_1.4 <- ac_1.4[order(ac_1.4$Date.Time),]
list_roof <- ac_1.4[16946:38017,c(1,5)]
combine_data <- function(path1,path2){
a = list.files(path1)
dir = paste(pat... |
# DAAG EXERCISES
## ex. 11 cap. 3
aberrant_crypt <- c(87, 53, 72, 90, 78, 85, 83)
n <- length(aberrant_crypt)
M <- 10000
crypt_mean <-mean(aberrant_crypt)
crypt_var <- var(aberrant_crypt)
paste("aberrant crypt mean:", crypt_mean)
paste("aberrant crypt variance:", crypt_var)
vec_mean <- c()
vec_var <- c()
for (i in ... | /books and notes/Lab/esercizi.R | permissive | wilsonjefferson/DSSC_SMDS | R | false | false | 8,988 | r | # DAAG EXERCISES
## ex. 11 cap. 3
aberrant_crypt <- c(87, 53, 72, 90, 78, 85, 83)
n <- length(aberrant_crypt)
M <- 10000
crypt_mean <-mean(aberrant_crypt)
crypt_var <- var(aberrant_crypt)
paste("aberrant crypt mean:", crypt_mean)
paste("aberrant crypt variance:", crypt_var)
vec_mean <- c()
vec_var <- c()
for (i in ... |
## Hi, first we need to download the data set
project_url <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip"
download.file(project_url, "project.zip", method="curl")
unzip("project.zip")
## Once it's done, we can now read the data :
## test
subject_test <- read.table("UCI HAR ... | /R03 - Getting and cleaning data/run_analysis.R | no_license | dasmey/Portfolio | R | false | false | 2,640 | r | ## Hi, first we need to download the data set
project_url <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip"
download.file(project_url, "project.zip", method="curl")
unzip("project.zip")
## Once it's done, we can now read the data :
## test
subject_test <- read.table("UCI HAR ... |
library(ElemStatLearn)
### Name: orange4.test
### Title: Simulated Orange Data
### Aliases: orange4.test
### Keywords: datasets
### ** Examples
str(orange4.test)
| /data/genthat_extracted_code/ElemStatLearn/examples/orange4.test.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 169 | r | library(ElemStatLearn)
### Name: orange4.test
### Title: Simulated Orange Data
### Aliases: orange4.test
### Keywords: datasets
### ** Examples
str(orange4.test)
|
#' Simple Training/Test Set Splitting
#'
#' `initial_split` creates a single binary split of the data into a training
#' set and testing set. `initial_time_split` does the same, but takes the
#' _first_ `prop` samples for training, instead of a random selection.
#' `group_initial_split` creates splits of the data ba... | /R/initial_split.R | permissive | tidymodels/rsample | R | false | false | 4,289 | r | #' Simple Training/Test Set Splitting
#'
#' `initial_split` creates a single binary split of the data into a training
#' set and testing set. `initial_time_split` does the same, but takes the
#' _first_ `prop` samples for training, instead of a random selection.
#' `group_initial_split` creates splits of the data ba... |
## This function will generate random substrings from the larger reference sequence
GenerateSimulatedReads <- function(refSequence, readLength, numberOfReadsToSimulate) {
startPositions <- sample(x = c(1:(nchar(refSequence) - readLength)), size = numberOfReadsToSimulate, replace = T)
endPositions <- startPosit... | /Class_7-Epigenetics/simulateCpGmethylation.r | no_license | moverton88/BGGN213 | R | false | false | 3,692 | r |
## This function will generate random substrings from the larger reference sequence
GenerateSimulatedReads <- function(refSequence, readLength, numberOfReadsToSimulate) {
startPositions <- sample(x = c(1:(nchar(refSequence) - readLength)), size = numberOfReadsToSimulate, replace = T)
endPositions <- startPosit... |
#' Unload pacakges
#'
#' Detach the list of pacakges, only detaching those that are on the
#' search path.
#'
#' @param l Vector of package names.
#' @return nothing.
#' @rdname unloadLibs
unloadLibs <- function(l)
{
for (p in l)
{
pn <- sprintf("package:%s", p)
if (pn %in% search()) detach(pn, character.on... | /R/unloadLibs.R | no_license | cran/rattle | R | false | false | 352 | r | #' Unload pacakges
#'
#' Detach the list of pacakges, only detaching those that are on the
#' search path.
#'
#' @param l Vector of package names.
#' @return nothing.
#' @rdname unloadLibs
unloadLibs <- function(l)
{
for (p in l)
{
pn <- sprintf("package:%s", p)
if (pn %in% search()) detach(pn, character.on... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/food-demand.R
\name{apply.bias.corrections}
\alias{apply.bias.corrections}
\title{Apply bias corrections to model outputs}
\usage{
apply.bias.corrections(mod, bc)
}
\arguments{
\item{mod}{Data frame of model outputs}
\item{bc}{Vector of regi... | /man/apply.bias.corrections.Rd | permissive | JGCRI/ambrosia | R | false | true | 458 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/food-demand.R
\name{apply.bias.corrections}
\alias{apply.bias.corrections}
\title{Apply bias corrections to model outputs}
\usage{
apply.bias.corrections(mod, bc)
}
\arguments{
\item{mod}{Data frame of model outputs}
\item{bc}{Vector of regi... |
## ---- brcaMolClassData ----
require(pamr)
load(paste(config$R_SOURCE_PATH, '/data/brca_mol_class/pamr.ER.Rdata', sep='')) # predictor for ER receptor status
load(paste(config$R_SOURCE_PATH, '/data/brca_mol_class/pamr.PR.Rdata', sep='')) # predictor for PR receptor status
load(paste(config$R_SOURCE_PATH, '/data/brca_... | /omics_pipe/scripts/reporting/src/modules/brca_mol_class.R | permissive | wangdi2014/OmicsPipe2.0 | R | false | false | 2,162 | r | ## ---- brcaMolClassData ----
require(pamr)
load(paste(config$R_SOURCE_PATH, '/data/brca_mol_class/pamr.ER.Rdata', sep='')) # predictor for ER receptor status
load(paste(config$R_SOURCE_PATH, '/data/brca_mol_class/pamr.PR.Rdata', sep='')) # predictor for PR receptor status
load(paste(config$R_SOURCE_PATH, '/data/brca_... |
build_consjump_transmat = function(data, p) {
n = data[, length(gam)]
decay_matrix <- matrix(0, nrow = n, ncol = n)
for (i in 1:n) {
if (i == 1) {
decay_matrix[1,i] = 1
} else {
decay_matrix[i,i] = p
decay_matrix[1,i] = 1-p
}
}
return(decay_matrix)
}
| /functions/transmat_functions/build_consjump_transmat.R | no_license | anthonyleezhang/dlcode | R | false | false | 304 | r |
build_consjump_transmat = function(data, p) {
n = data[, length(gam)]
decay_matrix <- matrix(0, nrow = n, ncol = n)
for (i in 1:n) {
if (i == 1) {
decay_matrix[1,i] = 1
} else {
decay_matrix[i,i] = p
decay_matrix[1,i] = 1-p
}
}
return(decay_matrix)
}
|
library(PASWR2)
### Name: PHONE
### Title: Telephone Call Times
### Aliases: PHONE
### Keywords: datasets
### ** Examples
with(data = PHONE,
SIGN.test(call.time, md = 2.1))
| /data/genthat_extracted_code/PASWR2/examples/PHONE.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 181 | r | library(PASWR2)
### Name: PHONE
### Title: Telephone Call Times
### Aliases: PHONE
### Keywords: datasets
### ** Examples
with(data = PHONE,
SIGN.test(call.time, md = 2.1))
|
# http://www.statmethods.net/advgraphs/ggplot2.html
# ggplot2 examples
library(ggplot2)
# create factors with value labels
mtcars$gear <- factor(mtcars$gear,levels=c(3,4,5), labels=c("3gears","4gears","5gears"))
mtcars$am <- factor(mtcars$am,levels=c(0,1), labels=c("Automatic","Manual"))
mtcars$cyl <- factor(mtca... | /Part11_qplot/qplot examples.R | no_license | DublinR/ggplot2workshop | R | false | false | 1,501 | r | # http://www.statmethods.net/advgraphs/ggplot2.html
# ggplot2 examples
library(ggplot2)
# create factors with value labels
mtcars$gear <- factor(mtcars$gear,levels=c(3,4,5), labels=c("3gears","4gears","5gears"))
mtcars$am <- factor(mtcars$am,levels=c(0,1), labels=c("Automatic","Manual"))
mtcars$cyl <- factor(mtca... |
istrue<-function(x)x&!is.na(x)
| /Code/utilities/istrue.R | no_license | GustafRydevik/reverse-hindcasting | R | false | false | 31 | r | istrue<-function(x)x&!is.na(x)
|
data(airquality)
laq <- log(airquality[,1:4])
mle <- glm(Ozone ~ Solar.R+Wind+Temp, data=laq)
n <- nrow(airquality)
gamma <- c()
for(b in 1:100){
ib <- sample(1:n,n,replace=TRUE)
fb <- glm(Ozone ~ Solar.R+Wind+Temp, data=laq[ib,])
gamma <- c(gamma,coef(fb)["Temp"]) }
hist(gamma)
abline(v=coef(mle)["Temp"], ... | /examples/airquality.R | no_license | jakewalker56/ml-lab | R | false | false | 921 | r | data(airquality)
laq <- log(airquality[,1:4])
mle <- glm(Ozone ~ Solar.R+Wind+Temp, data=laq)
n <- nrow(airquality)
gamma <- c()
for(b in 1:100){
ib <- sample(1:n,n,replace=TRUE)
fb <- glm(Ozone ~ Solar.R+Wind+Temp, data=laq[ib,])
gamma <- c(gamma,coef(fb)["Temp"]) }
hist(gamma)
abline(v=coef(mle)["Temp"], ... |
\encoding{latin1}
\name{bw.boot}
\alias{bw.boot}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{ Bootstrap method }
\description{
This function implements the bootstrap procedure proposed by Di Marzio et al. (2011) for selecting the smoothing parameter for density estimation taking
the... | /man/bw.boot.Rd | no_license | cran/NPCirc | R | false | false | 2,355 | rd | \encoding{latin1}
\name{bw.boot}
\alias{bw.boot}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{ Bootstrap method }
\description{
This function implements the bootstrap procedure proposed by Di Marzio et al. (2011) for selecting the smoothing parameter for density estimation taking
the... |
# If you want, run the cleaning from this config file.
# But, that will take a little bit since it is subsetted after reading file
# Cleaned data is in an RDS file loaded below
# source("scripts/wk1_config.R")
utilData <- readRDS("data/utilData.rds")
#Plot 3
png(file = "graphs/plot3.png")
par(bg='transparent')
plot(... | /scripts/plot3.R | no_license | SpencerVaradi/ExData_Plotting1 | R | false | false | 728 | r |
# If you want, run the cleaning from this config file.
# But, that will take a little bit since it is subsetted after reading file
# Cleaned data is in an RDS file loaded below
# source("scripts/wk1_config.R")
utilData <- readRDS("data/utilData.rds")
#Plot 3
png(file = "graphs/plot3.png")
par(bg='transparent')
plot(... |
# Page no. : 36 - 37
x <- c(7, 8, 8, 7, 3, 1, 6, 9, 3, 8)
value <- mean(x)
cat("Mean of x is", value) | /Statistics_For_Psychology_by_Arthur_Aron_Elliot_J_Coups_And_Elaine_N_Aron/CH2/EX2.1a/Ex2_1a.R | permissive | FOSSEE/R_TBC_Uploads | R | false | false | 104 | r | # Page no. : 36 - 37
x <- c(7, 8, 8, 7, 3, 1, 6, 9, 3, 8)
value <- mean(x)
cat("Mean of x is", value) |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/devicefarm_operations.R
\name{devicefarm_schedule_run}
\alias{devicefarm_schedule_run}
\title{Schedules a run}
\usage{
devicefarm_schedule_run(projectArn, appArn, devicePoolArn,
deviceSelectionConfiguration, name, test, configuration,
exe... | /cran/paws.mobile/man/devicefarm_schedule_run.Rd | permissive | johnnytommy/paws | R | false | true | 3,812 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/devicefarm_operations.R
\name{devicefarm_schedule_run}
\alias{devicefarm_schedule_run}
\title{Schedules a run}
\usage{
devicefarm_schedule_run(projectArn, appArn, devicePoolArn,
deviceSelectionConfiguration, name, test, configuration,
exe... |
#' Mangrove Plot Method Analysis
#'
#' This function allows you to estimate mangrove forest structure based on sampling using fixed-area sampling (plot).
#' @param plotnumber Column name in data frame for plot nymber (numerical). Default name is "plotnumber". First plot number must be 1.
#' @param dbh Column name in da... | /R/plot.method.R | permissive | NuoroForestrySchool/mangroveStructure | R | false | false | 7,737 | r | #' Mangrove Plot Method Analysis
#'
#' This function allows you to estimate mangrove forest structure based on sampling using fixed-area sampling (plot).
#' @param plotnumber Column name in data frame for plot nymber (numerical). Default name is "plotnumber". First plot number must be 1.
#' @param dbh Column name in da... |
## Final Project NN From Scratch
### Libraries
# none :3
# jk, I'll use tidyverse:
library(tidyverse)
### Setting seed
set.seed(25)
## Defining data frame
x <- rnorm(100)
y <- ifelse(x >= -0.5 & x <= 0.5, 1, 0)
gaussian_df <- sample(data.frame(rn = x, resp = y))
## Poisoning the data
#gaussian_df[sample(which(gauss... | /NN_Scratch_FinalProject_Code.R | no_license | b-thi/NNs | R | false | false | 4,341 | r | ## Final Project NN From Scratch
### Libraries
# none :3
# jk, I'll use tidyverse:
library(tidyverse)
### Setting seed
set.seed(25)
## Defining data frame
x <- rnorm(100)
y <- ifelse(x >= -0.5 & x <= 0.5, 1, 0)
gaussian_df <- sample(data.frame(rn = x, resp = y))
## Poisoning the data
#gaussian_df[sample(which(gauss... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/calculateClonalReproduction.R
\name{calculateClonalReproduction}
\alias{calculateClonalReproduction}
\title{Calculate Clonal Reproduction}
\usage{
calculateClonalReproduction(Plant.Surveys.by.Year, Plant.Surveys.by.Plant,
Plant.Info.Analysi... | /man/calculateClonalReproduction.Rd | no_license | ksauby/GTMNERRproc | R | false | true | 1,029 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/calculateClonalReproduction.R
\name{calculateClonalReproduction}
\alias{calculateClonalReproduction}
\title{Calculate Clonal Reproduction}
\usage{
calculateClonalReproduction(Plant.Surveys.by.Year, Plant.Surveys.by.Plant,
Plant.Info.Analysi... |
#Links to refer to
#https://www.analyticsvidhya.com/blog/2016/03/practical-guide-deal-imbalanced-classification-problems
# Below are the methods used to treat imbalanced datasets:
# Undersampling
# Oversampling
# Synthetic Data Generation
# Cost Sensitive Learning
# ROSE (Random Over Sampling Examples) pack... | /Sampling.R | no_license | consultsd/Knowledge | R | false | false | 3,780 | r | #Links to refer to
#https://www.analyticsvidhya.com/blog/2016/03/practical-guide-deal-imbalanced-classification-problems
# Below are the methods used to treat imbalanced datasets:
# Undersampling
# Oversampling
# Synthetic Data Generation
# Cost Sensitive Learning
# ROSE (Random Over Sampling Examples) pack... |
## Dynamic Network
library(networkDynamic)
par(mfrow = c(1, 1))
ub <- dat_31
node <- ub$V8
max(node)
wownet <- network.initialize(164)
di1 = 1
di2 = 2
38 != 38
node[di1] != node[di2]
for(i in 1:length(node)) {
if (node[di1] != node [di2]) {
add.edge(wownet, node[di1], node[di2])
}
di1 = di1 + 1
di2 = di2... | /Reference/Ubam_quali_analysis/WOW/wow_2.R | no_license | TongfangInCafe/UX-ML-Research | R | false | false | 350 | r | ## Dynamic Network
library(networkDynamic)
par(mfrow = c(1, 1))
ub <- dat_31
node <- ub$V8
max(node)
wownet <- network.initialize(164)
di1 = 1
di2 = 2
38 != 38
node[di1] != node[di2]
for(i in 1:length(node)) {
if (node[di1] != node [di2]) {
add.edge(wownet, node[di1], node[di2])
}
di1 = di1 + 1
di2 = di2... |
# Function to perform safe NLS fitting
safe_nls <- function(x, KmGuess=200) {
# Create a unique starting guess for Vmax
VmaxGuess <- max(x$v0.mass.norm)
# Safely fit the plots by NLS
mmFit <- tryCatch(
nls(formula=mmForm, data=x, start=list(Vmax=VmaxGuess, Km=KmGuess)),
error=function(err) NA)
m... | /R/safe_nls.R | no_license | adsteen/WOR_enz_2013_2014 | R | false | false | 326 | r | # Function to perform safe NLS fitting
safe_nls <- function(x, KmGuess=200) {
# Create a unique starting guess for Vmax
VmaxGuess <- max(x$v0.mass.norm)
# Safely fit the plots by NLS
mmFit <- tryCatch(
nls(formula=mmForm, data=x, start=list(Vmax=VmaxGuess, Km=KmGuess)),
error=function(err) NA)
m... |
################################################
# Analysis of multispecies duckweed experiment #
# #
# Statistical analyses #
################################################
##############################
# Two-way anova #
# Y= total s... | /code/multispecies statistics.R | no_license | mccannecology/experiments | R | false | false | 3,586 | r | ################################################
# Analysis of multispecies duckweed experiment #
# #
# Statistical analyses #
################################################
##############################
# Two-way anova #
# Y= total s... |
paper_mode=TRUE
source('R/helper.R')
require(plyr)
require(data.table)
r_data = read.csv(unz(description = "../data/BD/choices_diagno.csv.zip", filename = 'choices_diagno.csv'))
r_data$ID = as.character(r_data$ID)
r_data$key = as.character(r_data$key)
r_data[r_data$key == "R1",]$key = 1
r_data[r_data$key == "R2",]$ke... | /src/BD/R/lin_classification.R | permissive | lilihub/rnn_beh | R | false | false | 6,035 | r | paper_mode=TRUE
source('R/helper.R')
require(plyr)
require(data.table)
r_data = read.csv(unz(description = "../data/BD/choices_diagno.csv.zip", filename = 'choices_diagno.csv'))
r_data$ID = as.character(r_data$ID)
r_data$key = as.character(r_data$key)
r_data[r_data$key == "R1",]$key = 1
r_data[r_data$key == "R2",]$ke... |
## Description: Estimate models for Manhattan Euclides paper
## Author: @griverorz
## Date: 23 Oct 2010
library(doMC); registerDoMC(3)
library(rjags); load.module("glm"); load.module("lecuyer")
library(dclone)
library(RCurl)
source("~/Documents/wip/manhattan_euclides/src/organize_data.R")
## Test
runif(1)
## GALICI... | /src/models.R | no_license | griverorz/manhattan_euclides | R | false | false | 5,835 | r | ## Description: Estimate models for Manhattan Euclides paper
## Author: @griverorz
## Date: 23 Oct 2010
library(doMC); registerDoMC(3)
library(rjags); load.module("glm"); load.module("lecuyer")
library(dclone)
library(RCurl)
source("~/Documents/wip/manhattan_euclides/src/organize_data.R")
## Test
runif(1)
## GALICI... |
c(lunge_sensors, lunge_events) %<-% load_lunges()
test_deployids <- deployments(lunge_sensors)[1:4]
c(sensors_test, sensors_train) %<-% divide(lunge_sensors, test_deployids)
c(events_test, events_train) %<-% divide(lunge_events, test_deployids)
run_stickleback <- function() {
tsc <- compose_tsc(module = "interval_ba... | /tests/testthat/test-seed.R | permissive | FlukeAndFeather/rstickleback | R | false | false | 1,413 | r | c(lunge_sensors, lunge_events) %<-% load_lunges()
test_deployids <- deployments(lunge_sensors)[1:4]
c(sensors_test, sensors_train) %<-% divide(lunge_sensors, test_deployids)
c(events_test, events_train) %<-% divide(lunge_events, test_deployids)
run_stickleback <- function() {
tsc <- compose_tsc(module = "interval_ba... |
#Load file from workding directory
#note that ';' delimiter is set, ?'s are converted to NA, and only data for Feb 1 2007 and Feb 2 2007 is selected
power <- subset(read.csv("household_power_consumption.txt", sep=";", na.strings="?"), Date == "1/2/2007" | Date == "2/2/2007")
#convert date and time to POSIX calendar
po... | /plot3.R | no_license | philtabak/ExData_Plotting1 | R | false | false | 952 | r | #Load file from workding directory
#note that ';' delimiter is set, ?'s are converted to NA, and only data for Feb 1 2007 and Feb 2 2007 is selected
power <- subset(read.csv("household_power_consumption.txt", sep=";", na.strings="?"), Date == "1/2/2007" | Date == "2/2/2007")
#convert date and time to POSIX calendar
po... |
#' @rdname prediction
#' @export
prediction.merMod <- function(model, data = find_data(model), type = c("response", "link"), ...) {
# setup data
data <- data
type <- match.arg(type)
# extract predicted value at input value (value can only be 1 number)
pred <- data.frame(fitted = predict(mo... | /R/prediction_merMod.R | no_license | benwhalley/prediction | R | false | false | 794 | r | #' @rdname prediction
#' @export
prediction.merMod <- function(model, data = find_data(model), type = c("response", "link"), ...) {
# setup data
data <- data
type <- match.arg(type)
# extract predicted value at input value (value can only be 1 number)
pred <- data.frame(fitted = predict(mo... |
## font: http://computationalfinance.lsi.upc.edu/?page_id=108
# Fiting an exponencial curve to the DJIA from 1978 to 2001
# The data is retrieved directly from Federal Reserve.
require(quantmod); getSymbols("DJIA",src="FRED")
serie=DJIA["1978/2001"]
price=as.numeric(serie) #extract numeric values of price
time = in... | /FinancialAnalytics/Scripts/Labs_2.R | no_license | fpsimonee/Studio | R | false | false | 3,835 | r | ## font: http://computationalfinance.lsi.upc.edu/?page_id=108
# Fiting an exponencial curve to the DJIA from 1978 to 2001
# The data is retrieved directly from Federal Reserve.
require(quantmod); getSymbols("DJIA",src="FRED")
serie=DJIA["1978/2001"]
price=as.numeric(serie) #extract numeric values of price
time = in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.