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 |
|---|---|---|---|---|---|---|---|---|---|
context("sf_polygon")
test_that("various objects converted to sf_polygon",{
m <- matrix(1:4, ncol = 2)
res <- sfheaders:::rcpp_sf_polygon(m, c(0L,1L), NULL, NULL, xyzm = "", keep = TRUE, close = FALSE )
expect_true( all( attr(res, "class") == c("sf", "data.frame") ) )
m <- matrix(c(1.2,3,4,5), ncol = 2)
re... | /tests/testthat/test-sf_polygon.R | permissive | dcooley/sfheaders | R | false | false | 9,005 | r | context("sf_polygon")
test_that("various objects converted to sf_polygon",{
m <- matrix(1:4, ncol = 2)
res <- sfheaders:::rcpp_sf_polygon(m, c(0L,1L), NULL, NULL, xyzm = "", keep = TRUE, close = FALSE )
expect_true( all( attr(res, "class") == c("sf", "data.frame") ) )
m <- matrix(c(1.2,3,4,5), ncol = 2)
re... |
rm(list=ls())
cat("\014")
library(ALL)
data(ALL)
cat("\014")
ist = grep("T", as.character(ALL$BT))
length(ist)
T = ALL[, ist]
cat("\014")
samplesCR = c('01003',
'01007',
'04018',
'09002',
'10005',
'11002',
'15006',
'160... | /pfkfb3.r | no_license | vuslan/sage | R | false | false | 3,439 | r | rm(list=ls())
cat("\014")
library(ALL)
data(ALL)
cat("\014")
ist = grep("T", as.character(ALL$BT))
length(ist)
T = ALL[, ist]
cat("\014")
samplesCR = c('01003',
'01007',
'04018',
'09002',
'10005',
'11002',
'15006',
'160... |
library(soil.spec)
library(readr)
#Read OFRA 2 MIR data
#set working directory
setwd("~/Models/aFSIS/data")
#set name of new spectra
new <- "VS"
afs<-read_csv("~/Dropbox/AfSIS_reporting_data/Seperated_datasets/Calibration_Htsxt_MIR.csv")
new<-read_csv("~/Dropbox/AfSIS_MASTER_FILES/VS/VS_combined/data/VS_MIR_spectra.cs... | /afsis PCA models vs new spectra.R | no_license | asila/spectral_data_code | R | false | false | 1,986 | r | library(soil.spec)
library(readr)
#Read OFRA 2 MIR data
#set working directory
setwd("~/Models/aFSIS/data")
#set name of new spectra
new <- "VS"
afs<-read_csv("~/Dropbox/AfSIS_reporting_data/Seperated_datasets/Calibration_Htsxt_MIR.csv")
new<-read_csv("~/Dropbox/AfSIS_MASTER_FILES/VS/VS_combined/data/VS_MIR_spectra.cs... |
plot4 <- function () {
par(mfrow=c(2,2))
plot(data$time,data$Global_active_power, type="l", ylab="Global Active Power", xlab="")
plot(data$time,data$Voltage, type="l",ylab="Voltage", xlab="datetime")
plot(data$time,data$Sub_metering_1, type="l",ylab="Energy sub metering", xlab="")
lines(data$time,d... | /plot4.R | no_license | HGCobos/ExData_Plotting1 | R | false | false | 727 | r | plot4 <- function () {
par(mfrow=c(2,2))
plot(data$time,data$Global_active_power, type="l", ylab="Global Active Power", xlab="")
plot(data$time,data$Voltage, type="l",ylab="Voltage", xlab="datetime")
plot(data$time,data$Sub_metering_1, type="l",ylab="Energy sub metering", xlab="")
lines(data$time,d... |
library(shiny)
library(chron)
library(ggplot2)
precio <- read.csv("Precio.csv", header = T)
precio$Fecha <- as.Date(precio$Fecha, "%d/%m/%Y")
precio <- precio[order(precio[, 3], precio[, 2]), ]
precio$Variacion <- c(0,diff(precio$Precio))
attach(precio)
shinyServer(function(input, output) {
Pre... | /server.R | no_license | jclopez59/Precio-Cerdo | R | false | false | 3,307 | r | library(shiny)
library(chron)
library(ggplot2)
precio <- read.csv("Precio.csv", header = T)
precio$Fecha <- as.Date(precio$Fecha, "%d/%m/%Y")
precio <- precio[order(precio[, 3], precio[, 2]), ]
precio$Variacion <- c(0,diff(precio$Precio))
attach(precio)
shinyServer(function(input, output) {
Pre... |
# This code gets us a WDI dataset using the `WDI` package. There are two main
# outputs here:
#
# - `wdi_data`, which can take a while to load, so I suggest saving it through
# the `saveRDS(wdi_data, "wdi_data.rds")` function.
#
# - `wdi_varlist` provides the whole set of variables which I thought were most
# relevant.... | /wdi_data/wdi.R | no_license | acastroaraujo/TaxHavens | R | false | false | 1,745 | r | # This code gets us a WDI dataset using the `WDI` package. There are two main
# outputs here:
#
# - `wdi_data`, which can take a while to load, so I suggest saving it through
# the `saveRDS(wdi_data, "wdi_data.rds")` function.
#
# - `wdi_varlist` provides the whole set of variables which I thought were most
# relevant.... |
#' Plot single-sample network
#'
#' This function is able to plot sepecified amount of edges in a specified sample network.
#' This function should be used following the \code{\link{runLioness}}.
#' As LIONESS estimates the single-sample network of an aggregate network generated by PANDA (more )
#'
#' @param col Numer... | /R/plotLioness.R | no_license | xhyuo/netZoo | R | false | false | 2,169 | r | #' Plot single-sample network
#'
#' This function is able to plot sepecified amount of edges in a specified sample network.
#' This function should be used following the \code{\link{runLioness}}.
#' As LIONESS estimates the single-sample network of an aggregate network generated by PANDA (more )
#'
#' @param col Numer... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lm.R
\name{ggDiagnose.lm}
\alias{ggDiagnose.lm}
\title{Diagnostic plot for lm and glm objects (ggplot based)}
\usage{
ggDiagnose.lm(x, which = c(1L:3L, 5L),
caption = list("Residuals vs Fitted", "Normal Q-Q", "Scale-Location",
"Cook's dis... | /man/ggDiagnose.lm.Rd | permissive | benjaminleroy/ggDiagnose | R | false | true | 2,674 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lm.R
\name{ggDiagnose.lm}
\alias{ggDiagnose.lm}
\title{Diagnostic plot for lm and glm objects (ggplot based)}
\usage{
ggDiagnose.lm(x, which = c(1L:3L, 5L),
caption = list("Residuals vs Fitted", "Normal Q-Q", "Scale-Location",
"Cook's dis... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/group_metrics.R
\name{pct_dom1_group}
\alias{pct_dom1_group}
\title{The percent of the most dominant group}
\usage{
pct_dom1_group(long.df, master.df, Group, taxa.rank)
}
\arguments{
\item{long.df}{Long data frame format of taxonomic counts.}... | /man/pct_dom1_group.Rd | no_license | esocid/Benthos | R | false | true | 716 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/group_metrics.R
\name{pct_dom1_group}
\alias{pct_dom1_group}
\title{The percent of the most dominant group}
\usage{
pct_dom1_group(long.df, master.df, Group, taxa.rank)
}
\arguments{
\item{long.df}{Long data frame format of taxonomic counts.}... |
# Define server logic required to draw a histogram
server <- function(input, output, session) {
temp <- reactiveVal(fromJSON(urlWeather)$main$temp)
# Refresh date and week every hour
today <- reactive({
invalidateLater(3600000)
Sys.Date()
})
weekNr <- reactive({
invalidateLater(3600000)
... | /Dashboard/server.R | no_license | emos8710/Dashboard | R | false | false | 3,794 | r | # Define server logic required to draw a histogram
server <- function(input, output, session) {
temp <- reactiveVal(fromJSON(urlWeather)$main$temp)
# Refresh date and week every hour
today <- reactive({
invalidateLater(3600000)
Sys.Date()
})
weekNr <- reactive({
invalidateLater(3600000)
... |
#' Posterior predictive intervals
#'
#' Posterior predictive intervals of the model.
#'
#' @template args-methods
#' @template args-prob
#' @template args-dots-ignored
#'
#' @details
#'
#' Reports for each row of the input data set the predictive interval
#' according to the fitted model.
#'
#' @return Matrix with as m... | /R/predictive_interval.R | no_license | cran/OncoBayes2 | R | false | false | 1,604 | r | #' Posterior predictive intervals
#'
#' Posterior predictive intervals of the model.
#'
#' @template args-methods
#' @template args-prob
#' @template args-dots-ignored
#'
#' @details
#'
#' Reports for each row of the input data set the predictive interval
#' according to the fitted model.
#'
#' @return Matrix with as m... |
#' Multilevel Exponential-Family Random Graph Models
#'
#' This function estimates an exponential-family random graph model for multilevel network data. At present, \code{mlergm} covers network data where the set of nodes is nested within known blocks (see, e.g., Schweinberger and Handcock, 2015). An example is groups... | /R/mlergm.R | no_license | meleangelo/mlergm | R | false | false | 14,816 | r | #' Multilevel Exponential-Family Random Graph Models
#'
#' This function estimates an exponential-family random graph model for multilevel network data. At present, \code{mlergm} covers network data where the set of nodes is nested within known blocks (see, e.g., Schweinberger and Handcock, 2015). An example is groups... |
/run_analysis.R | no_license | mtgds/Getting-and-Cleaning-Data-Project | R | false | false | 3,210 | r | ||
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/model_get_toggleswitch.R
\name{get_toggleswitch}
\alias{get_toggleswitch}
\title{Toggle switch model}
\usage{
get_toggleswitch()
}
\value{
The list contains rprior, dprior (generate and evaluate the density of prior distribution),
generate_ra... | /man/get_toggleswitch.Rd | no_license | alexanderwhatley/winference | R | false | true | 847 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/model_get_toggleswitch.R
\name{get_toggleswitch}
\alias{get_toggleswitch}
\title{Toggle switch model}
\usage{
get_toggleswitch()
}
\value{
The list contains rprior, dprior (generate and evaluate the density of prior distribution),
generate_ra... |
library(elliptic)
### Name: near.match
### Title: Are two vectors close to one another?
### Aliases: near.match
### Keywords: math
### ** Examples
x <- rep(1,6)
near.match(x, x+rnorm(6)/1e10)
| /data/genthat_extracted_code/elliptic/examples/near.match.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 199 | r | library(elliptic)
### Name: near.match
### Title: Are two vectors close to one another?
### Aliases: near.match
### Keywords: math
### ** Examples
x <- rep(1,6)
near.match(x, x+rnorm(6)/1e10)
|
n<-40
p<-0.99
result<-0
sum<-0
for(k in 0:n){
if(k%%2==0){
sum<-sum+choose(n-1,k)*(p^(n-1-k))*((1-p)^k)
}
}
result<-sum*100
print(result)
| /R/teste.r | no_license | raphaelfilene/Portfolio | R | false | false | 145 | r | n<-40
p<-0.99
result<-0
sum<-0
for(k in 0:n){
if(k%%2==0){
sum<-sum+choose(n-1,k)*(p^(n-1-k))*((1-p)^k)
}
}
result<-sum*100
print(result)
|
rm(list=ls())
library('gee')
library('data.table')
library('MuMIn')
data=data.frame(read.table('full_df.tsv',header=TRUE,sep='\t'))
#remove any rows with "NA" -- no device value recorded
data=na.omit(data)
data$Error=abs(data$Error)
data$Activity=factor(data$Activity,levels=c("sit","walk","run","bike","max"))
hr=dat... | /gee/multivar_mixed_model.R | no_license | AshleyLab/device_validation | R | false | false | 3,277 | r | rm(list=ls())
library('gee')
library('data.table')
library('MuMIn')
data=data.frame(read.table('full_df.tsv',header=TRUE,sep='\t'))
#remove any rows with "NA" -- no device value recorded
data=na.omit(data)
data$Error=abs(data$Error)
data$Activity=factor(data$Activity,levels=c("sit","walk","run","bike","max"))
hr=dat... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/print.PMCMR.R
\name{summaryGroup}
\alias{summaryGroup}
\title{Grouped Summary of an PMCMR Object}
\usage{
summaryGroup(x, alpha = 0.05, ...)
}
\arguments{
\item{x}{an object of class \code{"PMCMR"}.}
\item{alpha}{the selected alpha-level. De... | /man/summaryGroup.Rd | no_license | pociuteagne/PMCMRplus | R | false | true | 713 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/print.PMCMR.R
\name{summaryGroup}
\alias{summaryGroup}
\title{Grouped Summary of an PMCMR Object}
\usage{
summaryGroup(x, alpha = 0.05, ...)
}
\arguments{
\item{x}{an object of class \code{"PMCMR"}.}
\item{alpha}{the selected alpha-level. De... |
\name{formatDistData}
\alias{formatDistData}
\title{Bin distance data}
\usage{formatDistData(distData, distCol, transectNameCol, dist.breaks,
occasionCol, effortMatrix)}
\description{Convert individual-level distance data to the transect-level
format required by \code{\link{distsamp}} or \code{\li... | /fuzzedpackages/unmarked/man/formatDistData.Rd | no_license | akhikolla/testpackages | R | false | false | 3,719 | rd | \name{formatDistData}
\alias{formatDistData}
\title{Bin distance data}
\usage{formatDistData(distData, distCol, transectNameCol, dist.breaks,
occasionCol, effortMatrix)}
\description{Convert individual-level distance data to the transect-level
format required by \code{\link{distsamp}} or \code{\li... |
## This function creates a special "matrix" object that can cache its inverse.
makeCacheMatrix <- function(x = numeric()){
inversion <- NULL;
set <- function(value){
x <<- value
inversion <<- NULL;
}
get <- function() x
setInversion <- function(value) inversion <<- value
getI... | /cachematrix.R | no_license | Changdao/ProgrammingAssignment2 | R | false | false | 1,008 | r |
## This function creates a special "matrix" object that can cache its inverse.
makeCacheMatrix <- function(x = numeric()){
inversion <- NULL;
set <- function(value){
x <<- value
inversion <<- NULL;
}
get <- function() x
setInversion <- function(value) inversion <<- value
getI... |
"factor.stats" <-
function(r=NULL,f,phi=NULL,n.obs=NA,np.obs=NULL,alpha=.1,fm=NULL,smooth=TRUE) {
fa.stats(r=r,f=f,phi=phi,n.obs=n.obs,np.obs=np.obs,alpha=alpha,fm=fm,smooth=smooth)}
"fa.stats" <-
function(r=NULL,f,phi=NULL,n.obs=NA,np.obs=NULL,alpha=.05,fm=NULL,smooth=TRUE) {
#revised June 21, 2010 to add RMSEA... | /R/factor.stats.R | no_license | cran/psych | R | false | false | 16,993 | r |
"factor.stats" <-
function(r=NULL,f,phi=NULL,n.obs=NA,np.obs=NULL,alpha=.1,fm=NULL,smooth=TRUE) {
fa.stats(r=r,f=f,phi=phi,n.obs=n.obs,np.obs=np.obs,alpha=alpha,fm=fm,smooth=smooth)}
"fa.stats" <-
function(r=NULL,f,phi=NULL,n.obs=NA,np.obs=NULL,alpha=.05,fm=NULL,smooth=TRUE) {
#revised June 21, 2010 to add RMSEA... |
context("test connect connection")
# should connect with env vars
test_conn_1 <- NULL
test_conn_2 <- NULL
test_that("connect works", {
test_conn_1 <<- connect(
host = Sys.getenv("TEST_1_SERVER"),
api_key = Sys.getenv("TEST_1_API_KEY")
)
expect_true(validate_R6_class(test_conn_1, "Connect"))
})
test_tha... | /tests/integrated/test-connect.R | no_license | slodge/connectapi | R | false | false | 1,185 | r | context("test connect connection")
# should connect with env vars
test_conn_1 <- NULL
test_conn_2 <- NULL
test_that("connect works", {
test_conn_1 <<- connect(
host = Sys.getenv("TEST_1_SERVER"),
api_key = Sys.getenv("TEST_1_API_KEY")
)
expect_true(validate_R6_class(test_conn_1, "Connect"))
})
test_tha... |
basicPage("Hello, Shiny!")
| /ui.r | no_license | adriedl/shiny | R | false | false | 27 | r | basicPage("Hello, Shiny!")
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/NlcOptim.R
\name{solnl}
\alias{solnl}
\title{Solve Optimization problem with Nonlinear Objective and Constraints}
\usage{
solnl(X = NULL, objfun = NULL, confun = NULL, A = NULL, B = NULL,
Aeq = NULL, Beq = NULL, lb = NULL, ub = NULL, tolX =... | /man/solnl.Rd | no_license | octaviodeliberato/NlcOptim | R | false | true | 5,715 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/NlcOptim.R
\name{solnl}
\alias{solnl}
\title{Solve Optimization problem with Nonlinear Objective and Constraints}
\usage{
solnl(X = NULL, objfun = NULL, confun = NULL, A = NULL, B = NULL,
Aeq = NULL, Beq = NULL, lb = NULL, ub = NULL, tolX =... |
################################################################################
# module_load_cppModel_UI
################################################################################
# A module's UI function should be given a name that is
# suffixed with Input, Output, or UI;
module_load_cppModel_UI <- function... | /module/module_load_cppModel.R | no_license | fyang72/handbook | R | false | false | 12,564 | r | ################################################################################
# module_load_cppModel_UI
################################################################################
# A module's UI function should be given a name that is
# suffixed with Input, Output, or UI;
module_load_cppModel_UI <- function... |
# ---------------------------------------------------------------------------------------------
# Script to:
# * Fill gaps in AGB map by interpolating by land cover class
# Proceeds:
# * (possibly postprocess_AGB_map.R)
# * regression_AGB-g0.R - creates AGB map
# * calculate_AGB.R - calculates AGB by p... | /src/R/2018/05_post_fill_AGB_gaps.R | no_license | emilysturdivant/biomass-espanola | R | false | false | 8,269 | r | # ---------------------------------------------------------------------------------------------
# Script to:
# * Fill gaps in AGB map by interpolating by land cover class
# Proceeds:
# * (possibly postprocess_AGB_map.R)
# * regression_AGB-g0.R - creates AGB map
# * calculate_AGB.R - calculates AGB by p... |
library(shiny)
library(ggplot2)
# Create populations from 10 to 10000, using a log10 scale
pop <- round(10 ^ seq(1, 4, by = 0.03))
base <- 5
# Functions for base 5 flooring and ceiling
floor_ <- function(num, base) { floor(num / base) * base }
ceil_ <- function(num, base) { ceiling(num / base) * base }
# Define ser... | /sup-sim/server.R | permissive | malavv/sup-sim | R | false | false | 1,050 | r | library(shiny)
library(ggplot2)
# Create populations from 10 to 10000, using a log10 scale
pop <- round(10 ^ seq(1, 4, by = 0.03))
base <- 5
# Functions for base 5 flooring and ceiling
floor_ <- function(num, base) { floor(num / base) * base }
ceil_ <- function(num, base) { ceiling(num / base) * base }
# Define ser... |
##Data Specialization 04 - Exploratory Data: Project 1 - plot1
rm(list=ls())
wd <- "C:/Users/KK/Documents/Outside Learning/Specialization-Data Science/04_Exploratory Data Analysis/Project/Project01/exdata-data-household_power_consumption"
setwd(wd)
data <- read.table("household_power_consumption.txt",nrow=2075259,sep=... | /plot1.R | no_license | ArctikkSunrise/ExData_Plotting1 | R | false | false | 1,138 | r | ##Data Specialization 04 - Exploratory Data: Project 1 - plot1
rm(list=ls())
wd <- "C:/Users/KK/Documents/Outside Learning/Specialization-Data Science/04_Exploratory Data Analysis/Project/Project01/exdata-data-household_power_consumption"
setwd(wd)
data <- read.table("household_power_consumption.txt",nrow=2075259,sep=... |
"catheter" <-
structure(list(Name = c("Ciresi", "George", "Hannan", "Heard",
"vanHeerden", "Maki", "Bach(a)", "Ramsay", "Appavu", "Trazzera",
"Collins", "Bach(b)", "Tennenberg", "Pemberton", "Logghe"), n.trt = c(124,
44, 68, 151, 28, 208, 14, 199, 12, 123, 98, 116, 137, 32, 338
), n.ctrl = c(127, 35, 60, 157, 26, 19... | /rmeta/data/catheter.R | no_license | ingted/R-Examples | R | false | false | 756 | r | "catheter" <-
structure(list(Name = c("Ciresi", "George", "Hannan", "Heard",
"vanHeerden", "Maki", "Bach(a)", "Ramsay", "Appavu", "Trazzera",
"Collins", "Bach(b)", "Tennenberg", "Pemberton", "Logghe"), n.trt = c(124,
44, 68, 151, 28, 208, 14, 199, 12, 123, 98, 116, 137, 32, 338
), n.ctrl = c(127, 35, 60, 157, 26, 19... |
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/GUIfunctions.R
\name{generateStrata}
\alias{generateStrata}
\title{Generate one strata variable from multiple factors}
\usage{
generateStrata(df, stratavars, name)
}
\arguments{
\item{df}{a data.frame}
\item{stratavars}{character vec... | /man/generateStrata.Rd | no_license | bigfoot31/sdcMicro | R | false | false | 686 | rd | % Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/GUIfunctions.R
\name{generateStrata}
\alias{generateStrata}
\title{Generate one strata variable from multiple factors}
\usage{
generateStrata(df, stratavars, name)
}
\arguments{
\item{df}{a data.frame}
\item{stratavars}{character vec... |
#' @rdname coupled4_CASPF
#' @title 4-way Coupled Ancestor Sampling Conditional Particle Filter
#' @description Runs four coupled conditional particle filters (two at each discretization level).
#' @param model a list representing a hidden Markov model, e.g. \code{\link{hmm_ornstein_uhlenbeck}}
#' @param theta a vector... | /R/coupled4_CASPF.R | no_license | jeremyhengjm/UnbiasedScore | R | false | false | 24,785 | r | #' @rdname coupled4_CASPF
#' @title 4-way Coupled Ancestor Sampling Conditional Particle Filter
#' @description Runs four coupled conditional particle filters (two at each discretization level).
#' @param model a list representing a hidden Markov model, e.g. \code{\link{hmm_ornstein_uhlenbeck}}
#' @param theta a vector... |
#################################################################
###
###
### Data input:
### "./4_Analysis/",download.method, "/", Cancer, "/Signature_Enrichment/GSEA_", Cancer,
### "_Bindea_xCell_HallmarkPathways.Rdata")
### Output :
### "./5_Figures/Correlation_plots/ICR_Correlation_plots/", download.method,
### "... | /Any Cancer (V4.1)/5.5.1.2.Pancancer.ES.Heatmap.ICR.Enabled.Disabled.R | no_license | dudious/QCRI-SIDRA-ICR | R | false | false | 13,992 | r | #################################################################
###
###
### Data input:
### "./4_Analysis/",download.method, "/", Cancer, "/Signature_Enrichment/GSEA_", Cancer,
### "_Bindea_xCell_HallmarkPathways.Rdata")
### Output :
### "./5_Figures/Correlation_plots/ICR_Correlation_plots/", download.method,
### "... |
# 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 <- c(seq(21, 30, 1))
# Create a vector `all_... | /chapter-07-exercises/exercise-2/exercise.R | permissive | omgitsjt/book-exercises | R | false | false | 1,720 | r | # 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 <- c(seq(21, 30, 1))
# Create a vector `all_... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rd2roxygen.R
\name{create_roxygen}
\alias{create_roxygen}
\title{Create the roxygen documentation}
\usage{
create_roxygen(info, usage = FALSE)
}
\arguments{
\item{info}{the named list of the parsed documentation}
\item{usage}{logical: whethe... | /man/create_roxygen.Rd | no_license | yihui/Rd2roxygen | R | false | true | 891 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rd2roxygen.R
\name{create_roxygen}
\alias{create_roxygen}
\title{Create the roxygen documentation}
\usage{
create_roxygen(info, usage = FALSE)
}
\arguments{
\item{info}{the named list of the parsed documentation}
\item{usage}{logical: whethe... |
##################################################################
## ##
## Plots of Volume of Landings/Discards per FO/Fishing Day/Trip ##
## ##
## MM 07/02/2008 ... | /COSTeda/R/MarketSeaSampGraphs_Explore.r | no_license | BackupTheBerlios/cost-project | R | false | false | 26,720 | r | ##################################################################
## ##
## Plots of Volume of Landings/Discards per FO/Fishing Day/Trip ##
## ##
## MM 07/02/2008 ... |
# this code relates to https://github.com/pepfar-datim/COP-Target-Setting/issues/700
# it is not being exported pending https://github.com/pepfar-datim/COP-Target-Setting/issues/734
# as it works for COP20 leaving it in place for now
#' @export
#' @title Pull & combine all UIDS for specified data_stream types and FY.... | /R/getCOPDataFromDATIM.R | permissive | Solanrewaju/datapackr | R | false | false | 4,515 | r | # this code relates to https://github.com/pepfar-datim/COP-Target-Setting/issues/700
# it is not being exported pending https://github.com/pepfar-datim/COP-Target-Setting/issues/734
# as it works for COP20 leaving it in place for now
#' @export
#' @title Pull & combine all UIDS for specified data_stream types and FY.... |
# flashiness
flash <- function(temp) {
n <- length(temp) # read out length of input data
t_fl <<- c() # create return vector; <<- defines global variable
for(i in 2:n) t_fl[i] <- abs(temp[i]-temp[i-1]) # calculate RB-index
flashy <- sum(t_fl, na.rm = TRUE)/(n-1)
return(flashy)
}
t_flsh <- flash(temp... | /flashiness.R | no_license | ValeGacitua/Data-Collection-Storage-and-Management | R | false | false | 369 | r | # flashiness
flash <- function(temp) {
n <- length(temp) # read out length of input data
t_fl <<- c() # create return vector; <<- defines global variable
for(i in 2:n) t_fl[i] <- abs(temp[i]-temp[i-1]) # calculate RB-index
flashy <- sum(t_fl, na.rm = TRUE)/(n-1)
return(flashy)
}
t_flsh <- flash(temp... |
library(modelsummary)
library(bife)
library(broom)
library(finalfit)
library(lmtest)
library(plm)
cyears <- read.csv("may2020data.csv")
# main models ----
p1 <- glm(new_mil ~ theta_diff_lag + theta_lag + gdpgr_lag + durable + recent_reb + (year>1989) + ethfrac, data=cyears, family=binomial("logit"))
summary(p1)
coef... | /analysis/jun2020_models.R | no_license | dbowden/defection_manuscript | R | false | false | 5,135 | r | library(modelsummary)
library(bife)
library(broom)
library(finalfit)
library(lmtest)
library(plm)
cyears <- read.csv("may2020data.csv")
# main models ----
p1 <- glm(new_mil ~ theta_diff_lag + theta_lag + gdpgr_lag + durable + recent_reb + (year>1989) + ethfrac, data=cyears, family=binomial("logit"))
summary(p1)
coef... |
#Load Data.table library
library("data.table")
#set file to filename variable.
filename <- "./household_power_consumption.txt"
# Read data into variable "read" with read.table function.
read <- read.table(filename, sep = ";", na = "?", header = TRUE)
# convert to data.table and set to dtread format.
# subset... | /plot4.R | no_license | brent-halen/ExData_Plotting1 | R | false | false | 1,911 | r | #Load Data.table library
library("data.table")
#set file to filename variable.
filename <- "./household_power_consumption.txt"
# Read data into variable "read" with read.table function.
read <- read.table(filename, sep = ";", na = "?", header = TRUE)
# convert to data.table and set to dtread format.
# subset... |
# Q4: Across the United States, how have emissions from coal combustion-related sources changed from 1999-2008?
# load dplyr lib
library(dplyr)
# read data
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
# Filter SCC table by "coal"
filteredSCC <- filter(SCC, grepl("coal", SCC$... | /project2_plot4.R | no_license | data-sci-1/ExData_Project2 | R | false | false | 1,206 | r | # Q4: Across the United States, how have emissions from coal combustion-related sources changed from 1999-2008?
# load dplyr lib
library(dplyr)
# read data
NEI <- readRDS("summarySCC_PM25.rds")
SCC <- readRDS("Source_Classification_Code.rds")
# Filter SCC table by "coal"
filteredSCC <- filter(SCC, grepl("coal", SCC$... |
# Fractals
library(RColorBrewer)
recurs <- function(one,two,h) {
if (h==0) {
lines(c(one[1],two[1]),c(one[2],two[2]))
}
else {
vec <- (3*one+two)/4 - one
recurs(one,one+vec,h-1)
recurs(one+vec,one+vec+rot%*%vec,h-1)
recurs(one+vec+rot%*%vec,two-vec+rot%*%vec,h-1)
recurs(two-vec+rot%*%vec,two-vec,h-1)... | /Other/Geometry/Fract/Fractals.R | no_license | chacemcneil/Personal | R | false | false | 5,668 | r | # Fractals
library(RColorBrewer)
recurs <- function(one,two,h) {
if (h==0) {
lines(c(one[1],two[1]),c(one[2],two[2]))
}
else {
vec <- (3*one+two)/4 - one
recurs(one,one+vec,h-1)
recurs(one+vec,one+vec+rot%*%vec,h-1)
recurs(one+vec+rot%*%vec,two-vec+rot%*%vec,h-1)
recurs(two-vec+rot%*%vec,two-vec,h-1)... |
## code to prepare `vars.ejscreen.acs` dataset
# mytables <- c("B01001", "B03002", "B15002", 'B23025', "B25034", "C16002", "C17002")
# get.table.info(mytables)
# ID title
# 1 B01001 SEX BY AGE
# 2 B0300... | /data-raw/vars-ejscreen-acs.R | no_license | ejanalysis/ejscreen | R | false | false | 4,137 | r | ## code to prepare `vars.ejscreen.acs` dataset
# mytables <- c("B01001", "B03002", "B15002", 'B23025', "B25034", "C16002", "C17002")
# get.table.info(mytables)
# ID title
# 1 B01001 SEX BY AGE
# 2 B0300... |
#Set the current directory
setwd("C:/Coursera/R")
#Read the data from household_power_consumption.txt file
householdData <- read.csv("./household/household_power_consumption.txt", header=T, sep=';', na.strings="?")
# We will only be using data from the dates 2007-02-01 and 2007-02-02.
# Subset of Data
householdSubs... | /plot1.R | no_license | pkssd/ExData_Plotting1 | R | false | false | 807 | r | #Set the current directory
setwd("C:/Coursera/R")
#Read the data from household_power_consumption.txt file
householdData <- read.csv("./household/household_power_consumption.txt", header=T, sep=';', na.strings="?")
# We will only be using data from the dates 2007-02-01 and 2007-02-02.
# Subset of Data
householdSubs... |
testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 1.22810536108214e+146, 4.12457037567309e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(10L, 3L)))
result <- do.call(CNull:::communities_individual_based_sampling... | /CNull/inst/testfiles/communities_individual_based_sampling_alpha/AFL_communities_individual_based_sampling_alpha/communities_individual_based_sampling_alpha_valgrind_files/1615777995-test.R | no_license | akhikolla/updatedatatype-list2 | R | false | false | 348 | r | testlist <- list(m = NULL, repetitions = 0L, in_m = structure(c(2.31584307392677e+77, 9.53818252170339e+295, 1.22810536108214e+146, 4.12457037567309e-221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), .Dim = c(10L, 3L)))
result <- do.call(CNull:::communities_individual_based_sampling... |
# Compare two strategies
library(fPortfolio)
infile=read.csv(".Close50.csv")
tail(infile,2)
dateID=as.POSIXlt(as.Date(infile[,1]), format='%Y-%m-%d')
myData0=infile[,-1]
rownames(myData0)=dateID
myData0=as.timeSeries(myData0)
tail(myData0)
ncol(myData0)
myData=returns(myData0)[,-1]*100
ID=as.character(read.table("fil... | /05-專題/2_Portfolio/03_mvCompare.R | no_license | LINS2000/R-Class | R | false | false | 2,042 | r | # Compare two strategies
library(fPortfolio)
infile=read.csv(".Close50.csv")
tail(infile,2)
dateID=as.POSIXlt(as.Date(infile[,1]), format='%Y-%m-%d')
myData0=infile[,-1]
rownames(myData0)=dateID
myData0=as.timeSeries(myData0)
tail(myData0)
ncol(myData0)
myData=returns(myData0)[,-1]*100
ID=as.character(read.table("fil... |
#' Winsorize a numeric vector
#'
#' @param x A vector of values
#' @param cutpoints Cutpoints under and above which are defined outliers. Default is (median - five times interquartile range, median + five times interquartile range). Compared to bottom and top percentile, this takes into account the whole distribution ... | /R/winsorize.R | no_license | cran/statar | R | false | false | 1,933 | r | #' Winsorize a numeric vector
#'
#' @param x A vector of values
#' @param cutpoints Cutpoints under and above which are defined outliers. Default is (median - five times interquartile range, median + five times interquartile range). Compared to bottom and top percentile, this takes into account the whole distribution ... |
setwd( "C:/Users/James.Thorson/Desktop/Project_git/2018_FSH556/Week 7 -- spatiotemporal models/Lab" )
#########################
# Spatial Gompertz model
# SEE: James T. Thorson, Hans Skaug, Kasper Kristensen, Andrew O. Shelton, Eric J. Ward, John Harms, Jim Benante. In press. The importance of spatial models for est... | /Week 7 -- spatiotemporal models/Lab/spatial_gompertz_estimation_example.R | no_license | tXiao95/2018_FSH556 | R | false | false | 4,702 | r |
setwd( "C:/Users/James.Thorson/Desktop/Project_git/2018_FSH556/Week 7 -- spatiotemporal models/Lab" )
#########################
# Spatial Gompertz model
# SEE: James T. Thorson, Hans Skaug, Kasper Kristensen, Andrew O. Shelton, Eric J. Ward, John Harms, Jim Benante. In press. The importance of spatial models for est... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/is.r
\name{is_converted_data_frame}
\alias{is_converted_data_frame}
\title{Test data set}
\usage{
is_converted_data_frame(x)
}
\arguments{
\item{x}{the object to test}
}
\value{
A flag (logical scalar) indicating whether converted data
}
\des... | /man/is_converted_data_frame.Rd | no_license | poissonconsulting/datalist | R | false | true | 584 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/is.r
\name{is_converted_data_frame}
\alias{is_converted_data_frame}
\title{Test data set}
\usage{
is_converted_data_frame(x)
}
\arguments{
\item{x}{the object to test}
}
\value{
A flag (logical scalar) indicating whether converted data
}
\des... |
#' ---
#' title: Emodiversity Preliminary Report
#' author: Max
#' date: "`r Sys.Date()`"
#' output:
#' pdf_document
#' ---
#' `r knitr::opts_chunk$set(echo=FALSE,warning=FALSE,message=FALSE,cache=FALSE)`
library(ggplot2)
theme_thesis <- function(){
theme_bw() %+replace%
theme(
#line = element_line... | /02_descriptive_stats.R | no_license | srsrsunrui/diet_covid19 | R | false | false | 13,048 | r | #' ---
#' title: Emodiversity Preliminary Report
#' author: Max
#' date: "`r Sys.Date()`"
#' output:
#' pdf_document
#' ---
#' `r knitr::opts_chunk$set(echo=FALSE,warning=FALSE,message=FALSE,cache=FALSE)`
library(ggplot2)
theme_thesis <- function(){
theme_bw() %+replace%
theme(
#line = element_line... |
# url <- "https://row.githubusercontent.com/rafalab/dslabs/master/inst/extdata/murders.csv"
# dest_file<- "data/murders.csv"
# download.file(url, destfile = dest_file)
library(dslabs)
library(tidyverse)
murders<- murders
murders <- murders %>% mutate(region= factor(region), rate= population * 10^5)
save (murders, file... | /download-data.R | no_license | catareyesvillegas/murders | R | false | false | 825 | r | # url <- "https://row.githubusercontent.com/rafalab/dslabs/master/inst/extdata/murders.csv"
# dest_file<- "data/murders.csv"
# download.file(url, destfile = dest_file)
library(dslabs)
library(tidyverse)
murders<- murders
murders <- murders %>% mutate(region= factor(region), rate= population * 10^5)
save (murders, file... |
# Most of this code is from a great tutorial from Bradley Boehmke
# (https://rpubs.com/bradleyboehmke/weather_graphic)
# but with minor style modifications and using a different data set
# Preprocessing & summarizing data
library(dplyr)
library(tidyr)
# Visualization package
library(ggplot2)
# Cities and airport cod... | /weather_charter.R | no_license | trendct/weather | R | false | false | 7,329 | r | # Most of this code is from a great tutorial from Bradley Boehmke
# (https://rpubs.com/bradleyboehmke/weather_graphic)
# but with minor style modifications and using a different data set
# Preprocessing & summarizing data
library(dplyr)
library(tidyr)
# Visualization package
library(ggplot2)
# Cities and airport cod... |
context("Test for is-hex-color")
test_that("is_hex() works as expected", {
expect_true(is_hex("#FF00A7"))
expect_true(is_hex("#ff0000"))
expect_true(is_hex("#123456"))
expect_true(is_hex("#12Fb56"))
expect_false(is_hex("FF0000"))
expect_false(is_hex("#1234GF"))
expect_false(is_hex("#1234567"))
expect_fa... | /workout02/code/tests/test-hex-color.R | no_license | nabkizil/stat133_fall2018 | R | false | false | 689 | r | context("Test for is-hex-color")
test_that("is_hex() works as expected", {
expect_true(is_hex("#FF00A7"))
expect_true(is_hex("#ff0000"))
expect_true(is_hex("#123456"))
expect_true(is_hex("#12Fb56"))
expect_false(is_hex("FF0000"))
expect_false(is_hex("#1234GF"))
expect_false(is_hex("#1234567"))
expect_fa... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gender-streetnet.R
\name{gender_streetnet}
\alias{gender_streetnet}
\title{gender_streetnet}
\usage{
gender_streetnet(net, wt_profile = "foot", country = "de")
}
\arguments{
\item{net}{Street network in \pkg{sf} or \pkg{sc} format}
\item{wt_... | /man/gender_streetnet.Rd | no_license | mpadge/gender-conscious-routing | R | false | true | 795 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gender-streetnet.R
\name{gender_streetnet}
\alias{gender_streetnet}
\title{gender_streetnet}
\usage{
gender_streetnet(net, wt_profile = "foot", country = "de")
}
\arguments{
\item{net}{Street network in \pkg{sf} or \pkg{sc} format}
\item{wt_... |
testlist <- list(Rs = numeric(0), atmp = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), relh = -1.72131968218895e+83, temp = c(8.5728629954997e-312, 1.56898424065867e+82, 8.96970809549085e-158, -1.3258495253834e-113, 2.79620616433656e-119, -6.800335110... | /meteor/inst/testfiles/ET0_Makkink/AFL_ET0_Makkink/ET0_Makkink_valgrind_files/1615845437-test.R | no_license | akhikolla/updatedatatype-list3 | R | false | false | 736 | r | testlist <- list(Rs = numeric(0), atmp = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), relh = -1.72131968218895e+83, temp = c(8.5728629954997e-312, 1.56898424065867e+82, 8.96970809549085e-158, -1.3258495253834e-113, 2.79620616433656e-119, -6.800335110... |
library(neuralnet)
library(caTools)
library(plyr)
library(boot)
library(matrixStats)
library(rstudioapi)
#-------------------------Read csv file------------------------------------------------------
current_path <- getActiveDocumentContext()$path
setwd(dirname(current_path ))
data <- read.delim("features2.csv",header... | /VariationTrainSet_CrossValidation.R | no_license | dalilareis/CS-R-neural-network | R | false | false | 4,006 | r | library(neuralnet)
library(caTools)
library(plyr)
library(boot)
library(matrixStats)
library(rstudioapi)
#-------------------------Read csv file------------------------------------------------------
current_path <- getActiveDocumentContext()$path
setwd(dirname(current_path ))
data <- read.delim("features2.csv",header... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gini.R
\name{gini}
\alias{gini}
\title{Calculate Gini Index of a numeric vector}
\usage{
gini(x)
}
\arguments{
\item{x}{A numeric vector.}
}
\value{
A numeric value between 0 and 1.
}
\description{
Calculate the Gini index of a... | /man/gini.Rd | no_license | planetMDX/BioQC | R | false | true | 783 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gini.R
\name{gini}
\alias{gini}
\title{Calculate Gini Index of a numeric vector}
\usage{
gini(x)
}
\arguments{
\item{x}{A numeric vector.}
}
\value{
A numeric value between 0 and 1.
}
\description{
Calculate the Gini index of a... |
#' heatmap module UI representation
#'
#' @param id The ID of the modules namespace.
#' @param row.label Boolean Value set initial Value for rowlabel checkbox (Default = TRUE).
#'
#' @return A list with HTML tags from \code{\link[shiny]{tag}}.
#'
#' @export
heatmapUI <- function(id, row.label = TRUE) {
ns <-... | /R/heatmap.R | permissive | cran/wilson | R | false | false | 18,986 | r | #' heatmap module UI representation
#'
#' @param id The ID of the modules namespace.
#' @param row.label Boolean Value set initial Value for rowlabel checkbox (Default = TRUE).
#'
#' @return A list with HTML tags from \code{\link[shiny]{tag}}.
#'
#' @export
heatmapUI <- function(id, row.label = TRUE) {
ns <-... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functions.R
\name{normal_approximation}
\alias{normal_approximation}
\title{Normal approximation method}
\usage{
normal_approximation(s, n, alpha, use.backup = FALSE, backup.method, ...)
}
\arguments{
\item{s}{Vector of successes.}
... | /man/normal_approximation.Rd | no_license | cran/serieslcb | R | false | true | 1,131 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functions.R
\name{normal_approximation}
\alias{normal_approximation}
\title{Normal approximation method}
\usage{
normal_approximation(s, n, alpha, use.backup = FALSE, backup.method, ...)
}
\arguments{
\item{s}{Vector of successes.}
... |
library(randomForest)
library(caret)
data(GermanCredit)
#check missing values
GermanCredit[rowSums(is.na(GermanCredit)) > 0,]
inTrain<-createDataPartition(GermanCredit[,10],p=0.8,list=FALSE)
train<-GermanCredit[inTrain,]
test<-GermanCredit[-inTrain,]
train_control<-trainControl(method='cv',number=10)
fit<-randomFore... | /process.R | no_license | cleobatista/credit_risk_analysis | R | false | false | 436 | r | library(randomForest)
library(caret)
data(GermanCredit)
#check missing values
GermanCredit[rowSums(is.na(GermanCredit)) > 0,]
inTrain<-createDataPartition(GermanCredit[,10],p=0.8,list=FALSE)
train<-GermanCredit[inTrain,]
test<-GermanCredit[-inTrain,]
train_control<-trainControl(method='cv',number=10)
fit<-randomFore... |
library(tidyverse)
library(ape)
library(ggtree)
library(phytools)
marine_families <- c("Balaenidae", "Balaenopteridae", "Delphinidae", "Dugongidae", "Eschrichtiidae", "Iniidae", "Monodontidae", "Neobalaenidae", "Odobenidae", "Otariidae", "Phocidae", "Phocoenidae", "Physeteridae", "Platanistidae", "Trichechidae", "Ziph... | /Code/R/tree_figure.R | no_license | emilio-berti/rewiring-rewilding | R | false | false | 940 | r | library(tidyverse)
library(ape)
library(ggtree)
library(phytools)
marine_families <- c("Balaenidae", "Balaenopteridae", "Delphinidae", "Dugongidae", "Eschrichtiidae", "Iniidae", "Monodontidae", "Neobalaenidae", "Odobenidae", "Otariidae", "Phocidae", "Phocoenidae", "Physeteridae", "Platanistidae", "Trichechidae", "Ziph... |
testlist <- list(x = c(2.08655633926036e-308, 1.79244985109153e-310, 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, 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, 0, 0, 0, 0, 0))
result <- do.call(myTAI:::cpp_geom_mean,testl... | /myTAI/inst/testfiles/cpp_geom_mean/AFL_cpp_geom_mean/cpp_geom_mean_valgrind_files/1615839129-test.R | no_license | akhikolla/updatedatatype-list3 | R | false | false | 336 | r | testlist <- list(x = c(2.08655633926036e-308, 1.79244985109153e-310, 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, 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, 0, 0, 0, 0, 0))
result <- do.call(myTAI:::cpp_geom_mean,testl... |
##
## diagram.R
##
## Simple objects for the elements of a diagram (text, arrows etc)
## that are compatible with plot.layered and plot.listof
##
## $Revision: 1.10 $ $Date: 2015/02/17 03:45:04 $
# ......... internal class 'diagramobj' supports other classes .........
diagramobj <- function(X, ...) {
if(i... | /R/diagram.R | no_license | jmetz/spatstat | R | false | false | 10,362 | r | ##
## diagram.R
##
## Simple objects for the elements of a diagram (text, arrows etc)
## that are compatible with plot.layered and plot.listof
##
## $Revision: 1.10 $ $Date: 2015/02/17 03:45:04 $
# ......... internal class 'diagramobj' supports other classes .........
diagramobj <- function(X, ...) {
if(i... |
#! /usr/local/bin/Rscript
data_merge <- read.table("clean_data/clean_data.txt", header = TRUE)
# plot of biom1 vs. biom 2
png("figs/fig2.png")
plot(y = data_merge$biom1, x = data_merge$biom2,
xlab = "Biomarker2", ylab = "Biomarker 1")
dev.off() | /lectures/07_make/exercise_soln/R/make_fig2.R | no_license | rossmck94/open-science-course | R | false | false | 251 | r | #! /usr/local/bin/Rscript
data_merge <- read.table("clean_data/clean_data.txt", header = TRUE)
# plot of biom1 vs. biom 2
png("figs/fig2.png")
plot(y = data_merge$biom1, x = data_merge$biom2,
xlab = "Biomarker2", ylab = "Biomarker 1")
dev.off() |
#-------------------------------------------------------------------------------
# create_df_variables_desc :
# Read features.txt which contains the description of the features given in
# the test and training sets.
#
# The features contains two columns :
# - V1 : the column number of the feature in the t... | /final_work_utils.R | no_license | dbod/GetAndCleanFinalWork | R | false | false | 3,776 | r |
#-------------------------------------------------------------------------------
# create_df_variables_desc :
# Read features.txt which contains the description of the features given in
# the test and training sets.
#
# The features contains two columns :
# - V1 : the column number of the feature in the t... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read_micaps.R
\name{read_micaps_3}
\alias{read_micaps_3}
\title{Read micaps type 3 file (general scatter point).}
\usage{
read_micaps_3(filename)
}
\arguments{
\item{filename}{: file name}
}
\value{
a list include datatime. data.frame (ID,lon... | /man/read_micaps_3.Rd | permissive | nmcdev/nmcMetIO | R | false | true | 543 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read_micaps.R
\name{read_micaps_3}
\alias{read_micaps_3}
\title{Read micaps type 3 file (general scatter point).}
\usage{
read_micaps_3(filename)
}
\arguments{
\item{filename}{: file name}
}
\value{
a list include datatime. data.frame (ID,lon... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/trace_coverage.R
\name{trace_coverage}
\alias{trace_coverage}
\alias{trace_coverage.eventlog}
\alias{trace_coverage.grouped_eventlog}
\title{Metric: Trace coverage}
\usage{
trace_coverage(eventlog, level, append, ...)
\method{trace_coverage}... | /man/trace_coverage.Rd | no_license | heoa/edeaR | R | false | true | 1,644 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/trace_coverage.R
\name{trace_coverage}
\alias{trace_coverage}
\alias{trace_coverage.eventlog}
\alias{trace_coverage.grouped_eventlog}
\title{Metric: Trace coverage}
\usage{
trace_coverage(eventlog, level, append, ...)
\method{trace_coverage}... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/main.R
\name{prompt_file}
\alias{prompt_file}
\title{Opens a file selection dialog box}
\usage{
prompt_file(
default = "",
caption = "Select files",
multi = TRUE,
filters = NULL,
index = 1
)
}
\value{
The selected file, or NULL if c... | /man/prompt_file.Rd | permissive | Cyclic3/c3.263 | R | false | true | 381 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/main.R
\name{prompt_file}
\alias{prompt_file}
\title{Opens a file selection dialog box}
\usage{
prompt_file(
default = "",
caption = "Select files",
multi = TRUE,
filters = NULL,
index = 1
)
}
\value{
The selected file, or NULL if c... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bulma-menu.R
\name{bulmaMenu}
\alias{bulmaMenu}
\title{bulma Menu}
\usage{
bulmaMenu(...)
}
\arguments{
\item{...}{Slot for bulmaMenuItem and bulmaMenuLabel.}
}
\description{
Create a menu \url{https://bulma.io/documentation/components/menu/}... | /man/bulmaMenu.Rd | no_license | PaulC91/shinybulma | R | false | true | 2,868 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bulma-menu.R
\name{bulmaMenu}
\alias{bulmaMenu}
\title{bulma Menu}
\usage{
bulmaMenu(...)
}
\arguments{
\item{...}{Slot for bulmaMenuItem and bulmaMenuLabel.}
}
\description{
Create a menu \url{https://bulma.io/documentation/components/menu/}... |
## Main function. Create a tidy dataset.
## path variable is path to file where dataset will be saved.
get_data <- function(path = "dataset.txt") {
## Read train data
train_data <- read_data("train")
## Read test data
test_data <- read_data("test")
## Merge data
data <- rbind(train_data, test_da... | /run_analysis.R | no_license | pavelgein/GetData2 | R | false | false | 2,067 | r | ## Main function. Create a tidy dataset.
## path variable is path to file where dataset will be saved.
get_data <- function(path = "dataset.txt") {
## Read train data
train_data <- read_data("train")
## Read test data
test_data <- read_data("test")
## Merge data
data <- rbind(train_data, test_da... |
stopifnot(require("testthat"),
require("selfisher"))
data(haddock)
dat <- transform(haddock, tot=nfine+nwide, prop=nwide/(nfine+nwide))
context("Very basic selfisher fitting")
m0 <- selfisher(prop~Lengths, pformula=~0, total=tot, psplit = TRUE, dat)
m1 <- selfisher(prop~Lengths, pformula=~1, total=tot, psp... | /selfisher/tests/testthat/test-basics.R | no_license | mebrooks/selfisher | R | false | false | 860 | r | stopifnot(require("testthat"),
require("selfisher"))
data(haddock)
dat <- transform(haddock, tot=nfine+nwide, prop=nwide/(nfine+nwide))
context("Very basic selfisher fitting")
m0 <- selfisher(prop~Lengths, pformula=~0, total=tot, psplit = TRUE, dat)
m1 <- selfisher(prop~Lengths, pformula=~1, total=tot, psp... |
library(mazeGen)
### Name: gridTwentyLeft
### Title: Grid Twenty Left
### Aliases: gridTwentyLeft
### Keywords: datasets
### ** Examples
## Not run:
##D
##D # Returns a Grid with rank = 20
##D data(gridTwentyLeft)
##D coordinates <- gridTwentyLeft
##D
## End(Not run)
| /data/genthat_extracted_code/mazeGen/examples/gridTwentyLeft.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 279 | r | library(mazeGen)
### Name: gridTwentyLeft
### Title: Grid Twenty Left
### Aliases: gridTwentyLeft
### Keywords: datasets
### ** Examples
## Not run:
##D
##D # Returns a Grid with rank = 20
##D data(gridTwentyLeft)
##D coordinates <- gridTwentyLeft
##D
## End(Not run)
|
#!/bin/env Rscript
args <- commandArgs(trailingOnly=TRUE)
if (is.na(args[2])){
stop("inadequate number of arguments")
}
dfmfilelist <- args[1]
outpdf <- args[2]
dfmfiles <- readLines(dfmfilelist)
dfmlist <- list()
for(i in 1:length(dfmfiles)){
d <- read.table(dfmfiles[i], header = TRUE)
if (nrow(d) > ... | /modules/eqtl/fusion/fusion.heatmap.drop.R | no_license | drveera/genie | R | false | false | 841 | r | #!/bin/env Rscript
args <- commandArgs(trailingOnly=TRUE)
if (is.na(args[2])){
stop("inadequate number of arguments")
}
dfmfilelist <- args[1]
outpdf <- args[2]
dfmfiles <- readLines(dfmfilelist)
dfmlist <- list()
for(i in 1:length(dfmfiles)){
d <- read.table(dfmfiles[i], header = TRUE)
if (nrow(d) > ... |
#' Quantile estimation of a composite extreme value distribution
#'
#' @param p a scalar giving the quantile of the distribution sought
#' @param loc a scalar, vector or matrix giving the location parameter
#' @param scale as above, but scale parameter
#' @param shape as above, but shape parameter
#' @param m a scalar ... | /evgam/R/retlev.R | no_license | akhikolla/TestedPackages-NoIssues | R | false | false | 3,816 | r | #' Quantile estimation of a composite extreme value distribution
#'
#' @param p a scalar giving the quantile of the distribution sought
#' @param loc a scalar, vector or matrix giving the location parameter
#' @param scale as above, but scale parameter
#' @param shape as above, but shape parameter
#' @param m a scalar ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{Violations}
\alias{Violations}
\alias{ViolationCodes}
\alias{Cuisines}
\title{NYC Restaurant Health Violations}
\format{{
A data frame with 480,621 observations on the following 16 variables.
\describe{
\item{\cod... | /man/Violations.Rd | no_license | pathebah/mdsr | R | false | true | 1,519 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{Violations}
\alias{Violations}
\alias{ViolationCodes}
\alias{Cuisines}
\title{NYC Restaurant Health Violations}
\format{{
A data frame with 480,621 observations on the following 16 variables.
\describe{
\item{\cod... |
local({
# the requested version of renv
version <- "0.17.0"
# the project directory
project <- getwd()
# figure out whether the autoloader is enabled
enabled <- local({
# first, check config option
override <- getOption("renv.config.autoloader.enabled")
if (!is.null(override))
return(... | /book/renv/activate.R | permissive | mlr-org/mlr3book | R | false | false | 27,691 | r |
local({
# the requested version of renv
version <- "0.17.0"
# the project directory
project <- getwd()
# figure out whether the autoloader is enabled
enabled <- local({
# first, check config option
override <- getOption("renv.config.autoloader.enabled")
if (!is.null(override))
return(... |
#prepare to find object type
install.packages("pryr")
library(pryr)
#download data set
library(MASS)
df=data("USArrests")
#test for generic function
mean(USArrests[["Murder"]])
UseMethod(mean, "Murder")
#determine object type
otype(data("USArrests"))
otype(USArrests["Murder"])
isS4(USArrests)
isS4("M... | /assignment7.R | no_license | cnmwebb/assignment7 | R | false | false | 514 | r | #prepare to find object type
install.packages("pryr")
library(pryr)
#download data set
library(MASS)
df=data("USArrests")
#test for generic function
mean(USArrests[["Murder"]])
UseMethod(mean, "Murder")
#determine object type
otype(data("USArrests"))
otype(USArrests["Murder"])
isS4(USArrests)
isS4("M... |
##### set functions -----
# refresh current year tournament results
update_tourneys <- function() {
library(rvest)
library(tidyverse)
library(lubridate)
library(jsonlite)
library(janitor)
##### get tournament schedule and IDs ----
grab_id <- "[[:digit:]]+"
grab_tournament_name <- "(?<=>).*(?=</... | /predict_script_functions.R | no_license | mhogel/golf_analysis | R | false | false | 10,621 | r |
##### set functions -----
# refresh current year tournament results
update_tourneys <- function() {
library(rvest)
library(tidyverse)
library(lubridate)
library(jsonlite)
library(janitor)
##### get tournament schedule and IDs ----
grab_id <- "[[:digit:]]+"
grab_tournament_name <- "(?<=>).*(?=</... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/model_evaluation.R
\name{g_tests}
\alias{g_tests}
\title{Graph-based two-sample tests}
\usage{
g_tests(df1, df2, method = "euclidean")
}
\arguments{
\item{df1, df2}{dataframes}
\item{method}{distance measure. Must be one of "euclidean" (defa... | /man/g_tests.Rd | no_license | kcf-jackson/glmGraph | R | false | true | 1,283 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/model_evaluation.R
\name{g_tests}
\alias{g_tests}
\title{Graph-based two-sample tests}
\usage{
g_tests(df1, df2, method = "euclidean")
}
\arguments{
\item{df1, df2}{dataframes}
\item{method}{distance measure. Must be one of "euclidean" (defa... |
#' Generate scatter pots for a particular country
#'
#' This function generates a scatter plot for all variables
#' @param i_alloc,
#' @param i_nodeInfo
#' @param i_iso
#' @param i_var_dep
#' @keywords plot, scatter, regression tree
#' @export
#'
#'
plot_ScatterCountry_allVars <- function(i_alloc, i_nodeInfo, i_iso, i_... | /R/plot_ScatterCountry_allVars.R | no_license | jhilaire/guidr | R | false | false | 3,583 | r | #' Generate scatter pots for a particular country
#'
#' This function generates a scatter plot for all variables
#' @param i_alloc,
#' @param i_nodeInfo
#' @param i_iso
#' @param i_var_dep
#' @keywords plot, scatter, regression tree
#' @export
#'
#'
plot_ScatterCountry_allVars <- function(i_alloc, i_nodeInfo, i_iso, i_... |
# Load libraries
library("shiny")
library("ggplot2")
library("plotly")
hiv_df <- read.csv("./data/art_coverage_by_country_clean.csv",
stringsAsFactors = FALSE
)
bar_chart_df <- hiv_df %>%
group_by(WHO.Region) %>%
select(
Country, WHO.Region,
Estimated.ART.coverage.among.people.living.with.HIV...._median... | /app_ui.R | permissive | info-201a-sp21/project-ryanzhao-pog | R | false | false | 10,839 | r | # Load libraries
library("shiny")
library("ggplot2")
library("plotly")
hiv_df <- read.csv("./data/art_coverage_by_country_clean.csv",
stringsAsFactors = FALSE
)
bar_chart_df <- hiv_df %>%
group_by(WHO.Region) %>%
select(
Country, WHO.Region,
Estimated.ART.coverage.among.people.living.with.HIV...._median... |
# Copyright 2011 Revolution Analytics
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | /pkg/R/IO.R | no_license | beedata-analytics/rmr2 | R | false | false | 20,520 | r | # Copyright 2011 Revolution Analytics
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
## Extract reads corresponding to each peak region
setMethod(
f="extractReads",
signature="MosaicsPeak",
definition=function( object, chipFile=NULL, chipFileFormat=NULL,
chipPET=FALSE, chipFragLen=200,
controlFile=NULL, controlFileFormat=NULL,
controlPET=FALSE, controlFragLen=200, keepReads=FALSE,
... | /R/extractReads.R | no_license | jdavisturak/mosaics | R | false | false | 5,142 | r |
## Extract reads corresponding to each peak region
setMethod(
f="extractReads",
signature="MosaicsPeak",
definition=function( object, chipFile=NULL, chipFileFormat=NULL,
chipPET=FALSE, chipFragLen=200,
controlFile=NULL, controlFileFormat=NULL,
controlPET=FALSE, controlFragLen=200, keepReads=FALSE,
... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/instrumental_forest.R
\name{instrumental_forest}
\alias{instrumental_forest}
\title{Intrumental forest}
\usage{
instrumental_forest(X, Y, W, Z, Y.hat = NULL, W.hat = NULL, Z.hat = NULL,
sample.fraction = 0.5, mtry = NULL, num.trees = 2000,
... | /grf/man/instrumental_forest.Rd | no_license | gannawag/grf_custom | R | false | true | 3,471 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/instrumental_forest.R
\name{instrumental_forest}
\alias{instrumental_forest}
\title{Intrumental forest}
\usage{
instrumental_forest(X, Y, W, Z, Y.hat = NULL, W.hat = NULL, Z.hat = NULL,
sample.fraction = 0.5, mtry = NULL, num.trees = 2000,
... |
library(readxl)
library(tidyverse)
trade_years <- list()
available_countries <- NULL
for(year in as.character(1964:1976)) {
trade_year <- readxl::read_excel(here::here("data-raw", "dyadic-compact.xls"),
sheet = year)
trade_year <- as.matrix(trade_year[, 5:ncol(trade_year)])... | /data-raw/world-trade.R | permissive | petershan1119/lsmdn | R | false | false | 1,113 | r | library(readxl)
library(tidyverse)
trade_years <- list()
available_countries <- NULL
for(year in as.character(1964:1976)) {
trade_year <- readxl::read_excel(here::here("data-raw", "dyadic-compact.xls"),
sheet = year)
trade_year <- as.matrix(trade_year[, 5:ncol(trade_year)])... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/VarID_functions.R
\name{plotExpNoise}
\alias{plotExpNoise}
\title{Noise-expression scatter plot}
\usage{
plotExpNoise(g, object, noise, set = NULL, ps = 0.1, norm = TRUE, ...)
}
\arguments{
\item{g}{Valid gene ID with available expression and... | /man/plotExpNoise.Rd | no_license | dgrun/RaceID3_StemID2_package | R | false | true | 1,036 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/VarID_functions.R
\name{plotExpNoise}
\alias{plotExpNoise}
\title{Noise-expression scatter plot}
\usage{
plotExpNoise(g, object, noise, set = NULL, ps = 0.1, norm = TRUE, ...)
}
\arguments{
\item{g}{Valid gene ID with available expression and... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{native_cpp_obj_fun_}
\alias{native_cpp_obj_fun_}
\title{Native object function.}
\usage{
native_cpp_obj_fun_(name, y_vec, x_mat, b_vec)
}
\arguments{
\item{name}{.}
\item{y_vec}{.}
\item{x_mat}{.}
\item{b... | /man/native_cpp_obj_fun_.Rd | no_license | cran/ncpen | R | false | true | 433 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{native_cpp_obj_fun_}
\alias{native_cpp_obj_fun_}
\title{Native object function.}
\usage{
native_cpp_obj_fun_(name, y_vec, x_mat, b_vec)
}
\arguments{
\item{name}{.}
\item{y_vec}{.}
\item{x_mat}{.}
\item{b... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/source.R
\name{source_python}
\alias{source_python}
\title{Read and evaluate a Python script}
\usage{
source_python(file, envir = parent.frame(), convert = TRUE)
}
\arguments{
\item{file}{Source file}
\item{envir}{The environment to assign P... | /man/source_python.Rd | permissive | aespar21/reticulate | R | false | true | 745 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/source.R
\name{source_python}
\alias{source_python}
\title{Read and evaluate a Python script}
\usage{
source_python(file, envir = parent.frame(), convert = TRUE)
}
\arguments{
\item{file}{Source file}
\item{envir}{The environment to assign P... |
## best.R is a function that takes as arguments the state and a certain pathology.
## The function returns the hospital that has the lowest mortality rates in a given state
## and for a certain pathology
best <- function(state, pathology) {
## Read outcome/pathology data
data <- read.csv("/Users/BertCarlier/... | /best.R | no_license | s0159140/ProgrammingAssignment3 | R | false | false | 1,291 | r | ## best.R is a function that takes as arguments the state and a certain pathology.
## The function returns the hospital that has the lowest mortality rates in a given state
## and for a certain pathology
best <- function(state, pathology) {
## Read outcome/pathology data
data <- read.csv("/Users/BertCarlier/... |
library(ape)
testtree <- read.tree("9554_0.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="9554_0_unrooted.txt") | /codeml_files/newick_trees_processed/9554_0/rinput.R | no_license | DaniBoo/cyanobacteria_project | R | false | false | 135 | r | library(ape)
testtree <- read.tree("9554_0.txt")
unrooted_tr <- unroot(testtree)
write.tree(unrooted_tr, file="9554_0_unrooted.txt") |
\name{estimateDeriv}
\alias{estimateDeriv}
\title{
Derivative Estimation
}
\description{
Estimate derivative of a function at a point d_0 based on a
local quadratic regression procedure of Fan and Gijbels (1996) that
utilizes an automatic bandwidth selection formula.
}
\usage{
estimateDeriv(explanatory, response, d_... | /man/estimateDeriv.Rd | no_license | cran/twostageTE | R | false | false | 2,896 | rd | \name{estimateDeriv}
\alias{estimateDeriv}
\title{
Derivative Estimation
}
\description{
Estimate derivative of a function at a point d_0 based on a
local quadratic regression procedure of Fan and Gijbels (1996) that
utilizes an automatic bandwidth selection formula.
}
\usage{
estimateDeriv(explanatory, response, d_... |
# construct species consensus sequences
# PACKAGE: megaptera
# CALLED BY: stepE
# AUTHOR: Christoph Heibl
# LAST UPDATE: 2014-10-30
speciesConsensus <- function(megProj, spec){
## PARAMETERS
## -----------
gene <- megProj@locus@sql
acc.tab <- paste("acc", gsub("^_", "", gene), sep = "_")
spec.tab <- paste... | /R/speciesConsensus.R | no_license | cran/megaptera | R | false | false | 3,194 | r | # construct species consensus sequences
# PACKAGE: megaptera
# CALLED BY: stepE
# AUTHOR: Christoph Heibl
# LAST UPDATE: 2014-10-30
speciesConsensus <- function(megProj, spec){
## PARAMETERS
## -----------
gene <- megProj@locus@sql
acc.tab <- paste("acc", gsub("^_", "", gene), sep = "_")
spec.tab <- paste... |
demix <- function(x = NULL,
Preprocessing = NULL,
pdf = NULL,
k = NULL,
xmin = NULL,
xmax = NULL, ...)
{
digits <- getOption("digits"); options(digits = 15)
if (is.null(x)) {
stop(sQuote("x"), " must not be NULL!", call. = FALSE)
}
if ((!is.numeric(x)) && (!is.data.frame(x))) ... | /rebmix/R/demix.R | no_license | ingted/R-Examples | R | false | false | 4,774 | r | demix <- function(x = NULL,
Preprocessing = NULL,
pdf = NULL,
k = NULL,
xmin = NULL,
xmax = NULL, ...)
{
digits <- getOption("digits"); options(digits = 15)
if (is.null(x)) {
stop(sQuote("x"), " must not be NULL!", call. = FALSE)
}
if ((!is.numeric(x)) && (!is.data.frame(x))) ... |
\name{addqtl}
\alias{addqtl}
\title{Scan for an additional QTL in a multiple-QTL model}
\description{
Scan for an additional QTL in the context of a
multiple QTL model.
}
\usage{
addqtl(cross, chr, pheno.col=1, qtl, covar=NULL, formula,
method=c("imp","hk"), incl.markers=TRUE, verbose=FALSE)
}
\arguments{... | /man/addqtl.Rd | no_license | pjotrp/rqtl | R | false | false | 4,328 | rd | \name{addqtl}
\alias{addqtl}
\title{Scan for an additional QTL in a multiple-QTL model}
\description{
Scan for an additional QTL in the context of a
multiple QTL model.
}
\usage{
addqtl(cross, chr, pheno.col=1, qtl, covar=NULL, formula,
method=c("imp","hk"), incl.markers=TRUE, verbose=FALSE)
}
\arguments{... |
setwd("E:/coursera course/Course4- Exploratory Data Analysis/Week1")
electric <- read.table("household_power_consumption.txt", sep = ";", header=TRUE, na.strings="?")
electric$datetime <- strptime(paste(electric$Date, electric$Time, sep = ""), format="%d/%m/%Y %H:%M:%S")
electric$Date <- as.Date(electric$Date, format =... | /plot1.R | no_license | vivaldiibm/ExData_Plotting1 | R | false | false | 660 | r | setwd("E:/coursera course/Course4- Exploratory Data Analysis/Week1")
electric <- read.table("household_power_consumption.txt", sep = ";", header=TRUE, na.strings="?")
electric$datetime <- strptime(paste(electric$Date, electric$Time, sep = ""), format="%d/%m/%Y %H:%M:%S")
electric$Date <- as.Date(electric$Date, format =... |
# Copyright 2019 Battelle Memorial Institute; see the LICENSE file.
#' module_energy_LA123.electricity
#'
#' This script creates electricity generation and inputs by fuel, region and historical year. Estimates are adjusted by efficiency factors.
#'
#' @param command API command to execute
#' @param ... other optional ... | /input/gcamdata/R/zchunk_LA123.electricity.R | permissive | djvdven/gcam52 | R | false | false | 9,653 | r | # Copyright 2019 Battelle Memorial Institute; see the LICENSE file.
#' module_energy_LA123.electricity
#'
#' This script creates electricity generation and inputs by fuel, region and historical year. Estimates are adjusted by efficiency factors.
#'
#' @param command API command to execute
#' @param ... other optional ... |
with(a6712399b292f44f9ba9780943185bec6, {ROOT <- 'C:/tools/111719/SEMOSS_v4.0.0_x64/semosshome/db/Atadata2__3b3e4a3b-d382-4e98-9950-9b4e8b308c1c/version/80bb2a25-ac5d-47d0-abfc-b3f3811f0936';FRAME878836[,(c('report_run_end_date','modified_date','created_date','report_run_date')) := lapply(.SD, function(x) as.Date(x, fo... | /80bb2a25-ac5d-47d0-abfc-b3f3811f0936/R/Temp/azgKqgoj1hagT.R | no_license | ayanmanna8/test | R | false | false | 426 | r | with(a6712399b292f44f9ba9780943185bec6, {ROOT <- 'C:/tools/111719/SEMOSS_v4.0.0_x64/semosshome/db/Atadata2__3b3e4a3b-d382-4e98-9950-9b4e8b308c1c/version/80bb2a25-ac5d-47d0-abfc-b3f3811f0936';FRAME878836[,(c('report_run_end_date','modified_date','created_date','report_run_date')) := lapply(.SD, function(x) as.Date(x, fo... |
DrawCatchAll <- function(catch.per.trip, compliant, num.keep.legal,
num.keep.legal.group, length.min.legal.all, length.max.legal.all,
rec.sel.at.length, lengths, len.pop.female, len.pop.male,
modeled.stock.rec.catch.source.subarea, wave) {
#' DrawCatchAll
#'
#' Draw catch information
#'
... | /R/DrawCatchAll.r | no_license | allen-chen-noaa-gov/nwblastarca | R | false | false | 5,691 | r | DrawCatchAll <- function(catch.per.trip, compliant, num.keep.legal,
num.keep.legal.group, length.min.legal.all, length.max.legal.all,
rec.sel.at.length, lengths, len.pop.female, len.pop.male,
modeled.stock.rec.catch.source.subarea, wave) {
#' DrawCatchAll
#'
#' Draw catch information
#'
... |
#################################################################
## COMPASS-CABG:Cohort Selection ##
#################################################################
# libraries:
library(pacman)
p_load("tidyverse","Hmisc","rms","survival","haven","readxl","naniar","lubridate")
... | /cohort_selection.R | permissive | svd09/CABG_COMPASS | R | false | false | 15,948 | r | #################################################################
## COMPASS-CABG:Cohort Selection ##
#################################################################
# libraries:
library(pacman)
p_load("tidyverse","Hmisc","rms","survival","haven","readxl","naniar","lubridate")
... |
#' Create a special "matrix" object that can cache its inverse.
#'
#' @param x A matrix
#'
#' @return A list containing four functions to set and get the value of the
#' matrix and to set and get the inverse of the matrix
#'
makeCacheMatrix <- function(x = matrix()) {
m <- NULL
# Define function to s... | /cachematrix.R | no_license | dhivyab90/ProgrammingAssignment2 | R | false | false | 1,848 | r | #' Create a special "matrix" object that can cache its inverse.
#'
#' @param x A matrix
#'
#' @return A list containing four functions to set and get the value of the
#' matrix and to set and get the inverse of the matrix
#'
makeCacheMatrix <- function(x = matrix()) {
m <- NULL
# Define function to s... |
##Load packages
# install.packages("dplyr")
library(dplyr)
library(e1071)
# install.packages("tidyr")
library(tidyr)
install.packages("recommenderlab")
library(recommenderlab)
#install.packages("Matrix")
library(Matrix)
##############################################Set the working directory
wd = "C:/Users/... | /script/2_IBCF_Prediction.R | no_license | dkewon/Last-FM-Recommendation-System | R | false | false | 10,890 | r | ##Load packages
# install.packages("dplyr")
library(dplyr)
library(e1071)
# install.packages("tidyr")
library(tidyr)
install.packages("recommenderlab")
library(recommenderlab)
#install.packages("Matrix")
library(Matrix)
##############################################Set the working directory
wd = "C:/Users/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.