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 |
|---|---|---|---|---|---|---|---|---|---|
\name{manip}
\alias{arrange}
\alias{filter}
\alias{manip}
\alias{mutate}
\alias{select}
\alias{summarise}
\alias{summarize}
\title{Data manipulation functions.}
\usage{
filter(.data, ...)
summarise(.data, ...)
summarize(.data, ...)
mutate(.data, ...)
arrange(.data, ...)
select(.data, ...)
}
\arguments{
\item{.da... | /man/manip.Rd | no_license | bmschmidt/dplyr | R | false | false | 3,778 | rd | \name{manip}
\alias{arrange}
\alias{filter}
\alias{manip}
\alias{mutate}
\alias{select}
\alias{summarise}
\alias{summarize}
\title{Data manipulation functions.}
\usage{
filter(.data, ...)
summarise(.data, ...)
summarize(.data, ...)
mutate(.data, ...)
arrange(.data, ...)
select(.data, ...)
}
\arguments{
\item{.da... |
## Put comments here that give an overall description of what your
## functions do
## create a special matrix 'x' that also stores it's inverse
makeCacheMatrix <- function(x = matrix()) {
inv <- NULL
set <- function(y) {
x <<- y
inv <<- NULL
}
get <- function() x
setinv <- function(inve... | /cachematrix.R | no_license | ataicher/ProgrammingAssignment2 | R | false | false | 699 | r | ## Put comments here that give an overall description of what your
## functions do
## create a special matrix 'x' that also stores it's inverse
makeCacheMatrix <- function(x = matrix()) {
inv <- NULL
set <- function(y) {
x <<- y
inv <<- NULL
}
get <- function() x
setinv <- function(inve... |
###VISUALISE MODEL OUTPUTS###
#install.packages("tidyverse")
library(tidyverse)
# library(dplyr)
#install.packages("maptools")
library(maptools)
#install.packages("rgeos")
library(rgeos)
# install.packages("maps")
library(maps)
#install.packages("Cairo")
library(Cairo)
# install.packages('rgdal')
library(rgdal)
#instal... | /vis/vis.R | permissive | nismod/digital_comms | R | false | false | 36,299 | r | ###VISUALISE MODEL OUTPUTS###
#install.packages("tidyverse")
library(tidyverse)
# library(dplyr)
#install.packages("maptools")
library(maptools)
#install.packages("rgeos")
library(rgeos)
# install.packages("maps")
library(maps)
#install.packages("Cairo")
library(Cairo)
# install.packages('rgdal')
library(rgdal)
#instal... |
predict.fishnet=function(object,newx,s=NULL,type=c("link","response","coefficients","nonzero"),exact=FALSE,newoffset,...){
type=match.arg(type)
nfit=NextMethod("predict")
switch(type,
response=exp(nfit),
nfit
)
}
| /R/predict.fishnet.R | no_license | junyangq/glmnetPlus | R | false | false | 244 | r | predict.fishnet=function(object,newx,s=NULL,type=c("link","response","coefficients","nonzero"),exact=FALSE,newoffset,...){
type=match.arg(type)
nfit=NextMethod("predict")
switch(type,
response=exp(nfit),
nfit
)
}
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/solve_bp_generic.R
\name{solve_bp_generic}
\alias{solve_bp_generic}
\title{Solve generic breed probabilities}
\usage{
solve_bp_generic(snps_, geno_, b_mat_, white_)
}
\arguments{
\item{snps_}{character vector containing names of SNPs to be ex... | /man/solve_bp_generic.Rd | no_license | funkhou9/breedTools | R | false | true | 1,216 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/solve_bp_generic.R
\name{solve_bp_generic}
\alias{solve_bp_generic}
\title{Solve generic breed probabilities}
\usage{
solve_bp_generic(snps_, geno_, b_mat_, white_)
}
\arguments{
\item{snps_}{character vector containing names of SNPs to be ex... |
#Using a Quality assurance model to perform benchmarks among age groups, Nirosha ran the Random Forest algorithm...NT
#in doing so, Nirosha hopes to achieve an accuracy rate higher than 75% to see if she has a good fit...NT
#model for determining which age group among the customers made recurring purchases...NT
nece... | /SuppliedFix_RandomForest.R | no_license | miasimms100/greyson-data | R | false | false | 5,923 | r | #Using a Quality assurance model to perform benchmarks among age groups, Nirosha ran the Random Forest algorithm...NT
#in doing so, Nirosha hopes to achieve an accuracy rate higher than 75% to see if she has a good fit...NT
#model for determining which age group among the customers made recurring purchases...NT
nece... |
setwd("/Users/mine/Desktop/Open Intro/EOCE - Second Edition/01/figures/eoce/durhamAQI")
oiB = "#3E9BC0"
oiG = "#4C721D"
d = read.csv("pm25_2011_durham.csv")
d = d[d$DAILY_AQI_VALUE != ".",]
d$DAILY_AQI_VALUE = as.numeric(as.character(d$DAILY_AQI_VALUE))
###
pdf("durhamAQI_hist.pdf", 8, 4)
par(mar=c(4,3,0.5,0.5), ... | /figures01/eoce/durhamAQI/durhamAQI.R | permissive | Cstats-learner/statistics | R | false | false | 1,394 | r | setwd("/Users/mine/Desktop/Open Intro/EOCE - Second Edition/01/figures/eoce/durhamAQI")
oiB = "#3E9BC0"
oiG = "#4C721D"
d = read.csv("pm25_2011_durham.csv")
d = d[d$DAILY_AQI_VALUE != ".",]
d$DAILY_AQI_VALUE = as.numeric(as.character(d$DAILY_AQI_VALUE))
###
pdf("durhamAQI_hist.pdf", 8, 4)
par(mar=c(4,3,0.5,0.5), ... |
# register the spark_connection S3 class for use in setClass slots
#' spark_connection class
#'
#' @name spark_connection-class
#' @exportClass spark_connection
methods::setOldClass("spark_connection")
#' spark_jobj class
#'
#' @name spark_jobj-class
#' @exportClass spark_jobj
methods::setOldClass("spark_jobj")
.spa... | /R/connection_spark.R | permissive | brioglade/sparklyr | R | false | false | 11,369 | r | # register the spark_connection S3 class for use in setClass slots
#' spark_connection class
#'
#' @name spark_connection-class
#' @exportClass spark_connection
methods::setOldClass("spark_connection")
#' spark_jobj class
#'
#' @name spark_jobj-class
#' @exportClass spark_jobj
methods::setOldClass("spark_jobj")
.spa... |
rm(list = ls())
gc()
setwd("~/Desktop/Code/torsten/example-models/PKPD/torsten/R")
.libPaths("~/svn-StanPmetrics/script/lib")
modelName <- "neutropeniaPopulation"
## Relative paths assuming the working directory is the script directory
## containing this script
scriptDir <- getwd()
projectDir <- dirname(scriptDir)
fi... | /example-models/R/neutropeniaPopulation.R | permissive | metrumresearchgroup/Torsten | R | false | false | 17,346 | r | rm(list = ls())
gc()
setwd("~/Desktop/Code/torsten/example-models/PKPD/torsten/R")
.libPaths("~/svn-StanPmetrics/script/lib")
modelName <- "neutropeniaPopulation"
## Relative paths assuming the working directory is the script directory
## containing this script
scriptDir <- getwd()
projectDir <- dirname(scriptDir)
fi... |
cpt.reg <- function(data, penalty="MBIC", pen.value=0, method="AMOC", dist="Normal",
class=TRUE, param.estimates=TRUE, minseglen=3, shape = 0, tol = 1e-07){
MBIC=0
##Check arguments are valid
if(!is.array(data) || !is.numeric(data)) ##Further checks applied later
stop("Argument 'data' must be a numerical m... | /R/CptReg.R | no_license | cran/EnvCpt | R | false | false | 7,594 | r | cpt.reg <- function(data, penalty="MBIC", pen.value=0, method="AMOC", dist="Normal",
class=TRUE, param.estimates=TRUE, minseglen=3, shape = 0, tol = 1e-07){
MBIC=0
##Check arguments are valid
if(!is.array(data) || !is.numeric(data)) ##Further checks applied later
stop("Argument 'data' must be a numerical m... |
library(tidyquant)
library(tidyverse)
library(timetk)
library(broom)
library(highcharter)
#### PART 1 ####
#### Read In Symbols
symbols <- c("FDX","CORE", "BLK","LMT","ORCL","NTRS","SJM","MDLZ","JNJ","TPH","AXP","CNC","MDT","PFE","SYY","NRZ","OHI","VIRT","WMT","TSM","REGI","V","MSFT","BX","LDOS","MRK","NKE","AMZN","G... | /monteCarloMain.R | no_license | dvushaj/MonteCarlo | R | false | false | 7,406 | r | library(tidyquant)
library(tidyverse)
library(timetk)
library(broom)
library(highcharter)
#### PART 1 ####
#### Read In Symbols
symbols <- c("FDX","CORE", "BLK","LMT","ORCL","NTRS","SJM","MDLZ","JNJ","TPH","AXP","CNC","MDT","PFE","SYY","NRZ","OHI","VIRT","WMT","TSM","REGI","V","MSFT","BX","LDOS","MRK","NKE","AMZN","G... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/as.data.table.predictCSC.R
\name{as.data.table.predictCSC}
\alias{as.data.table.predictCSC}
\title{Turn predictCSC Object Into a \code{data.table}}
\usage{
\method{as.data.table}{predictCSC}(x, keep.rownames = FALSE, se = TRUE,
...)
}
\argu... | /man/as.data.table.predictCSC.Rd | no_license | bozenne/riskRegressionLight | R | false | true | 585 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/as.data.table.predictCSC.R
\name{as.data.table.predictCSC}
\alias{as.data.table.predictCSC}
\title{Turn predictCSC Object Into a \code{data.table}}
\usage{
\method{as.data.table}{predictCSC}(x, keep.rownames = FALSE, se = TRUE,
...)
}
\argu... |
configHtml = function(opt, outfile, jsdir, style) {
id = paste('ID', format(Sys.time(), "%Y%m%d%H%M%S"), proc.time()[3]*100, sep="_")
Sys.sleep(0.02)
if(is.null(jsdir)) {
jsdir = 'http://efe.baidu.com/echarts/doc/example/www/js/'
}
jsdir = gsub('/$', '', jsdir)
eJS = paste(jsdir, 'echarts-map', sep = '/')
... | /R/config.R | permissive | kener/recharts | R | false | false | 2,486 | r | configHtml = function(opt, outfile, jsdir, style) {
id = paste('ID', format(Sys.time(), "%Y%m%d%H%M%S"), proc.time()[3]*100, sep="_")
Sys.sleep(0.02)
if(is.null(jsdir)) {
jsdir = 'http://efe.baidu.com/echarts/doc/example/www/js/'
}
jsdir = gsub('/$', '', jsdir)
eJS = paste(jsdir, 'echarts-map', sep = '/')
... |
#' This class read data from Knoema and transform it to ts,xts or zoo
#' @export
#' @importFrom lubridate day
#' @importFrom lubridate week
#' @importFrom lubridate month
#' @importFrom lubridate quarter
#' @importFrom lubridate year
#' @importFrom xts as.xts
#' @importFrom xts xts
#' @importFrom zoo as.yearmo... | /R/DataReader.R | no_license | ketiketi2507/knoematest | R | false | false | 8,488 | r | #' This class read data from Knoema and transform it to ts,xts or zoo
#' @export
#' @importFrom lubridate day
#' @importFrom lubridate week
#' @importFrom lubridate month
#' @importFrom lubridate quarter
#' @importFrom lubridate year
#' @importFrom xts as.xts
#' @importFrom xts xts
#' @importFrom zoo as.yearmo... |
\name{regulonlihc}
\Rdversion{1.4}
\alias{regulonlihc}
\docType{data}
\title{Human Liver Hepatocellular Carcinoma context-specific ARACNe interactome}
\description{
The interactome is a human Liver Hepatocellular Carcinoma context-specific
regulatory ne... | /man/regulonlihc.Rd | no_license | grumpypolarbear/aracne.networks | R | false | false | 1,395 | rd |
\name{regulonlihc}
\Rdversion{1.4}
\alias{regulonlihc}
\docType{data}
\title{Human Liver Hepatocellular Carcinoma context-specific ARACNe interactome}
\description{
The interactome is a human Liver Hepatocellular Carcinoma context-specific
regulatory ne... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | /R/pkg/R/mllib.R | permissive | gitter-badger/snappy-spark | R | false | false | 4,062 | r | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/ecotoxicology.R
\name{AdjustAbbott}
\alias{AdjustAbbott}
\title{Calculate corrected efficacy \% with Abbott's formula}
\source{
ehabsoft, last accessed 2015
\url{http://www.ehabsoft.com/ldpline/onlinecontrol.htm}
}
\usage{
AdjustAbbot... | /man/AdjustAbbott.Rd | no_license | cran/ecotoxicology | R | false | false | 1,252 | rd | % Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/ecotoxicology.R
\name{AdjustAbbott}
\alias{AdjustAbbott}
\title{Calculate corrected efficacy \% with Abbott's formula}
\source{
ehabsoft, last accessed 2015
\url{http://www.ehabsoft.com/ldpline/onlinecontrol.htm}
}
\usage{
AdjustAbbot... |
deplie2 <-
function(Y,M=NULL) {
if (is.null(M)) {M = floor((-1+sqrt(1+4*length(Y)))/2)}
trans = matrix(0,M,M-1);
nc = (length(Y)-(M*(M-1)))/M
par.trans = matrix(0,M,nc);
for (i in 1:(M-1)){
trans[,i] = Re(Y[(M*(i-1)+1):(M*i)]);
}
for (i in 1:nc) {
# par.trans[,i] = Y[(M*(M-1)+(i-1)*nc+1 ):(M*(... | /R/deplie2.R | no_license | cran/NHMSAR | R | false | false | 470 | r | deplie2 <-
function(Y,M=NULL) {
if (is.null(M)) {M = floor((-1+sqrt(1+4*length(Y)))/2)}
trans = matrix(0,M,M-1);
nc = (length(Y)-(M*(M-1)))/M
par.trans = matrix(0,M,nc);
for (i in 1:(M-1)){
trans[,i] = Re(Y[(M*(i-1)+1):(M*i)]);
}
for (i in 1:nc) {
# par.trans[,i] = Y[(M*(M-1)+(i-1)*nc+1 ):(M*(... |
# ---------------------------- #
# Simulation 4.2 for scenario
# ---------------------------- #
# Pesticide event: multiple exposure, on day_pesticide (i.e. 120) of each year
# asymmetric migration from an upstream patch
library(simecol)
# needs ajdustment to your path:
setwd("~/Desktop/Modelling_Twopatch/Latest_scri... | /Sim4.2_Migr_assym_MultEx.R | no_license | rbslandau/Patchmodel | R | false | false | 13,805 | r | # ---------------------------- #
# Simulation 4.2 for scenario
# ---------------------------- #
# Pesticide event: multiple exposure, on day_pesticide (i.e. 120) of each year
# asymmetric migration from an upstream patch
library(simecol)
# needs ajdustment to your path:
setwd("~/Desktop/Modelling_Twopatch/Latest_scri... |
### Clearing workspace...
rm(list = ls())
gc()
setwd("F:\\Mach. Learning\\Kaggle case studies\\Predict the Happiness")
## Libraries
library(data.table)
library(ggplot2)
library(caret)
library(Matrix)
library(xgboost)
library(stringr)
library(tm)
library(randomForest)
### Read the input files...
dt =... | /Predict the Happiness.R | no_license | Harishbe93/ML-Problems | R | false | false | 6,159 | r | ### Clearing workspace...
rm(list = ls())
gc()
setwd("F:\\Mach. Learning\\Kaggle case studies\\Predict the Happiness")
## Libraries
library(data.table)
library(ggplot2)
library(caret)
library(Matrix)
library(xgboost)
library(stringr)
library(tm)
library(randomForest)
### Read the input files...
dt =... |
# annelyns-infiltration exemplar
can_fast_attack <- function(knight_is_awake) {
!knight_is_awake
}
can_spy <- function(knight_is_awake, archer_is_awake, prisoner_is_awake) {
knight_is_awake || archer_is_awake || prisoner_is_awake
}
can_signal_prisoner <- function(archer_is_awake, prisoner_is_awake) {
prisoner_... | /exercises/concept/annalyns-infiltration/.meta/exemplar.R | permissive | exercism/r | R | false | false | 659 | r | # annelyns-infiltration exemplar
can_fast_attack <- function(knight_is_awake) {
!knight_is_awake
}
can_spy <- function(knight_is_awake, archer_is_awake, prisoner_is_awake) {
knight_is_awake || archer_is_awake || prisoner_is_awake
}
can_signal_prisoner <- function(archer_is_awake, prisoner_is_awake) {
prisoner_... |
### Mini Project
### Stats 170 - Time Series Analysis
### Konner Macias
### 004603916
### section 2
# read in the time data
pData = read.table("http://www.stat.ucla.edu/~jsanchez/data/hwk6data.csv", sep = ",", header = T)
train = pData[1:(nrow(pData)-12),]
test = pData[(nrow(pData)-11):nrow(pData),]
# get mts object... | /Project/MACIAS-004603916.R | no_license | konnermacias/Time-Series-Analysis-Stats-170 | R | false | false | 9,330 | r | ### Mini Project
### Stats 170 - Time Series Analysis
### Konner Macias
### 004603916
### section 2
# read in the time data
pData = read.table("http://www.stat.ucla.edu/~jsanchez/data/hwk6data.csv", sep = ",", header = T)
train = pData[1:(nrow(pData)-12),]
test = pData[(nrow(pData)-11):nrow(pData),]
# get mts object... |
# Internal functions for Dunnett's exact prediction interval
# helper Dunnett's function to integrate - one-sided case
Dunnetts_KF1 <- function (x, k, rho)
{
fcn.to.integrate <- function(y, x, k, rho) {
exp(k*pnorm((x + sqrt(rho) * y)/sqrt(1 - rho), log.p=TRUE) +
dnorm(y, log=TRUE))
}
integrate(fcn... | /inst/ztemp/DunnettIntervals.R | no_license | stla/SLutils | R | false | false | 9,729 | r |
# Internal functions for Dunnett's exact prediction interval
# helper Dunnett's function to integrate - one-sided case
Dunnetts_KF1 <- function (x, k, rho)
{
fcn.to.integrate <- function(y, x, k, rho) {
exp(k*pnorm((x + sqrt(rho) * y)/sqrt(1 - rho), log.p=TRUE) +
dnorm(y, log=TRUE))
}
integrate(fcn... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/exceltoolsV3.R
\name{readsheet}
\alias{readsheet}
\title{load specific sheets from a chosen excel file}
\usage{
readsheet(filepath = NULL, sheet = NULL)
}
\arguments{
\item{filepath}{A path to an excel file}
\item{sheet}{An integer referring... | /man/readsheet.Rd | no_license | Hannibal83dk/Rexceltools | R | false | true | 508 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/exceltoolsV3.R
\name{readsheet}
\alias{readsheet}
\title{load specific sheets from a chosen excel file}
\usage{
readsheet(filepath = NULL, sheet = NULL)
}
\arguments{
\item{filepath}{A path to an excel file}
\item{sheet}{An integer referring... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/V1_T2.3.R
\docType{data}
\name{V1_T2.3}
\alias{V1_T2.3}
\title{Volume I: Table 2.3}
\format{A data frame with 4 variables:
\describe{
\item{\code{County}}{County}
\item{\code{Population}}{Population Size}
\item{\code{NumberOfHouseholds}}{Numb... | /man/V1_T2.3.Rd | permissive | LucyNjoki/rKenyaCensus | R | false | true | 545 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/V1_T2.3.R
\docType{data}
\name{V1_T2.3}
\alias{V1_T2.3}
\title{Volume I: Table 2.3}
\format{A data frame with 4 variables:
\describe{
\item{\code{County}}{County}
\item{\code{Population}}{Population Size}
\item{\code{NumberOfHouseholds}}{Numb... |
#Proportion mature at each age by sex
#HS is based on Pritchard and Calkins 1979
#SSL is based on Winship et al. 2002
#CSL is based on Winship steller sea lion estimates. This doesn't really matter since only adult males are in Puget Sound
HS = as.matrix(read.table("HS_MatAtAge.dat", header=FALSE, skip=2))
SSL = as.ma... | /CreateMaturityAtAge.r | no_license | bchasco/Inland | R | false | false | 641 | r | #Proportion mature at each age by sex
#HS is based on Pritchard and Calkins 1979
#SSL is based on Winship et al. 2002
#CSL is based on Winship steller sea lion estimates. This doesn't really matter since only adult males are in Puget Sound
HS = as.matrix(read.table("HS_MatAtAge.dat", header=FALSE, skip=2))
SSL = as.ma... |
rm(list=ls())
# LOAD LIBRARIES ------------------------------------------------------------------------------
library(tidyverse)
library(dplyr)
library(ggplot2)
library(ggthemes)
#library(gridExtra)
#library(grid)
library(data.table)
library(Hmisc)
#load data
ipf_lifts <- read.csv("https://raw.githubusercontent.com/r... | /powerlifting/powerlifting.R | no_license | housemouse77/tidytuesday | R | false | false | 1,551 | r | rm(list=ls())
# LOAD LIBRARIES ------------------------------------------------------------------------------
library(tidyverse)
library(dplyr)
library(ggplot2)
library(ggthemes)
#library(gridExtra)
#library(grid)
library(data.table)
library(Hmisc)
#load data
ipf_lifts <- read.csv("https://raw.githubusercontent.com/r... |
#' Meta Data
#'
#' @param class string (optional) specify class or classes to get metadata for
#' @param un string cartegraph username
#' @param pw string cartegraph password
#' @param org orginization API ID ie 'PittsburghPA'
#' @param base_url API Base URL (defaulted to "https://cgweb06.cartegraphoms.com/")
#'
#' @re... | /R/metaData.R | permissive | CityofPittsburgh/caRtegraph | R | false | false | 1,021 | r | #' Meta Data
#'
#' @param class string (optional) specify class or classes to get metadata for
#' @param un string cartegraph username
#' @param pw string cartegraph password
#' @param org orginization API ID ie 'PittsburghPA'
#' @param base_url API Base URL (defaulted to "https://cgweb06.cartegraphoms.com/")
#'
#' @re... |
#' @title getGlist
#' @author Oyvind Bleka
#' @description getGlist Returns a list of genotypes with corresponding probabilities for a given allele frequency-list.
#' @details The function returns the list of all possible observed genotypes, with corresponding Hardy-Weinberg assumed probabilities. The allele-names in ... | /euroformix_1.11.4/R/getGlist.R | no_license | oyvble/euroformixArchive | R | false | false | 1,327 | r | #' @title getGlist
#' @author Oyvind Bleka
#' @description getGlist Returns a list of genotypes with corresponding probabilities for a given allele frequency-list.
#' @details The function returns the list of all possible observed genotypes, with corresponding Hardy-Weinberg assumed probabilities. The allele-names in ... |
##Define Data in Country Pricing for Dashboard####
a <- uapc[Country %in% mapc$Country,]
b <- mapc
c <- merge(a,b, by = "Country")
c[,V3.x:= NULL]
c[,V3.y:= NULL]
c[,diff := Price.y - Price.x]
##How much more or less
z <- c[which.max((abs(c$diff))),]
posneg <- if(z$diff > 0 ) {"more"} else if(z$diff < 0) {"fewer"}
val ... | /dashboard.R | no_license | robertncrampton/Oenalytics-App | R | false | false | 1,435 | r | ##Define Data in Country Pricing for Dashboard####
a <- uapc[Country %in% mapc$Country,]
b <- mapc
c <- merge(a,b, by = "Country")
c[,V3.x:= NULL]
c[,V3.y:= NULL]
c[,diff := Price.y - Price.x]
##How much more or less
z <- c[which.max((abs(c$diff))),]
posneg <- if(z$diff > 0 ) {"more"} else if(z$diff < 0) {"fewer"}
val ... |
library(cluster.datasets)
### Name: sample.mammals.milk.1956
### Title: Hartigan (1975) Mammals Milk
### Aliases: sample.mammals.milk.1956
### Keywords: datasets
### ** Examples
data(sample.mammals.milk.1956)
| /data/genthat_extracted_code/cluster.datasets/examples/sample.mammals.milk.1956.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 216 | r | library(cluster.datasets)
### Name: sample.mammals.milk.1956
### Title: Hartigan (1975) Mammals Milk
### Aliases: sample.mammals.milk.1956
### Keywords: datasets
### ** Examples
data(sample.mammals.milk.1956)
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Funs.R
\name{add}
\alias{add}
\title{Title}
\usage{
add(x, y)
}
\arguments{
\item{y}{}
}
\value{
}
\description{
Title
}
| /man/add.Rd | permissive | mmhoustonmm/my1pkg | R | false | true | 200 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Funs.R
\name{add}
\alias{add}
\title{Title}
\usage{
add(x, y)
}
\arguments{
\item{y}{}
}
\value{
}
\description{
Title
}
|
# Script for creating plot 4
## Obtains the data for the plot
getData<-function()
{
data.path <- "./ExData_Plotting1_Data"
zipfile.url = "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip"
zipfile.file <- paste0(data.path, "/household_power_consumption.zip")
data.file <-p... | /plot4.R | no_license | enrique-repulles/ExData_Plotting1 | R | false | false | 1,856 | r | # Script for creating plot 4
## Obtains the data for the plot
getData<-function()
{
data.path <- "./ExData_Plotting1_Data"
zipfile.url = "https://d396qusza40orc.cloudfront.net/exdata%2Fdata%2Fhousehold_power_consumption.zip"
zipfile.file <- paste0(data.path, "/household_power_consumption.zip")
data.file <-p... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/router.R
\name{route}
\alias{route}
\title{Create single route configuration.}
\usage{
route(path, ui)
}
\arguments{
\item{path}{Website route.}
\item{ui}{Valid Shiny user interface.}
}
\value{
A route configuration.
}
\description{
Create s... | /man/route.Rd | permissive | cosi1/shiny.router | R | false | true | 481 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/router.R
\name{route}
\alias{route}
\title{Create single route configuration.}
\usage{
route(path, ui)
}
\arguments{
\item{path}{Website route.}
\item{ui}{Valid Shiny user interface.}
}
\value{
A route configuration.
}
\description{
Create s... |
#this is a really crude zoom function for use in plotting shapefiles or rasters
#it is meant to be run on an object that is already in your plot window
#it can be run multiple times to zoom in as far as you want.
#to zoom all the way out, make your first click to the right of your second.
#once you've zoomed in... | /simpleZoom.r | no_license | vppatil/nla | R | false | false | 730 | r | #this is a really crude zoom function for use in plotting shapefiles or rasters
#it is meant to be run on an object that is already in your plot window
#it can be run multiple times to zoom in as far as you want.
#to zoom all the way out, make your first click to the right of your second.
#once you've zoomed in... |
filename <- "Coursera_DS3_Final.zip"
# Checking if archieve already exists.
if (!file.exists(filename)){
fileURL <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip"
download.file(fileURL, filename, method="curl")
}
# Checking if folder exists
if (!file.exists("UC... | /run_analysis.R | no_license | harshtripathi6/CleaningDataRepo | R | false | false | 2,338 | r | filename <- "Coursera_DS3_Final.zip"
# Checking if archieve already exists.
if (!file.exists(filename)){
fileURL <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip"
download.file(fileURL, filename, method="curl")
}
# Checking if folder exists
if (!file.exists("UC... |
#### Encase all code in a tryCatch block, so if anything unexpected goes wrong, pipeline will still run ####
tryCatch({
#### Set snakemake variables ####
cat("Setting snakemake variables", "\n")
bamPath <- snakemake@input[[1]]
baiPath <- snakemake@input[[2]]
bindingSitesPath <- snakemake@input[[3]]
... | /snakemakeATAC/resources/scripts/footprinting/correctInsertionMatrix.R | no_license | jk3755/jskCode | R | false | false | 3,264 | r | #### Encase all code in a tryCatch block, so if anything unexpected goes wrong, pipeline will still run ####
tryCatch({
#### Set snakemake variables ####
cat("Setting snakemake variables", "\n")
bamPath <- snakemake@input[[1]]
baiPath <- snakemake@input[[2]]
bindingSitesPath <- snakemake@input[[3]]
... |
#' Loades Packages
#'
#' @param required_packages
#'
#' @return
#'
#' @examples
load_needed_packages <- function(required_packages = c('dplyr')) {
loaded_packages <- gsub("package:", "", search())
package_to_load <- required_packages[!required_packages %in%
loaded_packages]
... | /R/gdelt_free_text_api.R | no_license | benmarwick/gdeltr2 | R | false | false | 29,086 | r | #' Loades Packages
#'
#' @param required_packages
#'
#' @return
#'
#' @examples
load_needed_packages <- function(required_packages = c('dplyr')) {
loaded_packages <- gsub("package:", "", search())
package_to_load <- required_packages[!required_packages %in%
loaded_packages]
... |
\name{EG2DO}
\docType{data}
\alias{EG2DO}
\title{Map entrez gene ID to DO terms}
\description{
This data contain a list of entrez gene IDs annotated with DO terms.
}
\keyword{datasets} | /2X/2.9/DOSE/man/EG2DO.Rd | no_license | GuangchuangYu/bioc-release | R | false | false | 198 | rd | \name{EG2DO}
\docType{data}
\alias{EG2DO}
\title{Map entrez gene ID to DO terms}
\description{
This data contain a list of entrez gene IDs annotated with DO terms.
}
\keyword{datasets} |
### Download and extract the data
if (!file.exists("data")) { dir.create("data") }
data.url <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip"
# If on Linux/Mac
#download.file(data.url, destfile = "./data/UCI_HAR_Dataset.zip", method = 'curl')
# If on windows
download.fi... | /GettingAndCleaningData/run_analysis.R | no_license | toxicafunk/datasciencecoursera | R | false | false | 4,422 | r | ### Download and extract the data
if (!file.exists("data")) { dir.create("data") }
data.url <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip"
# If on Linux/Mac
#download.file(data.url, destfile = "./data/UCI_HAR_Dataset.zip", method = 'curl')
# If on windows
download.fi... |
args <- commandArgs(trailingOnly = TRUE)
cat('Hi ', args[1], "!\n", sep = '')
| /hi.r | no_license | joaomagalhaes/hello-you | R | false | false | 78 | r | args <- commandArgs(trailingOnly = TRUE)
cat('Hi ', args[1], "!\n", sep = '')
|
\name{ess.elir}
\alias{ess.elir}
\concept{Effective sample size (ESS)}
\title{
Expected local-information-ratio ESS
}
\description{
This function computes \eqn{ESS_{ELIR}}{ESS_ELIR}, the \emph{expected
local-information-ratio ESS (effective sample size)} of a posterior
predictive distribution.
}
\usage{
ess... | /man/ess.elir.Rd | no_license | gunhanb/bayesmeta | R | false | false | 4,616 | rd | \name{ess.elir}
\alias{ess.elir}
\concept{Effective sample size (ESS)}
\title{
Expected local-information-ratio ESS
}
\description{
This function computes \eqn{ESS_{ELIR}}{ESS_ELIR}, the \emph{expected
local-information-ratio ESS (effective sample size)} of a posterior
predictive distribution.
}
\usage{
ess... |
# Find index where call is evaluated in envir data.
# Used in subset2i
find.index.i=function(call,data){
tryCatch(eval(call,data),error = function(e) rep(TRUE,nrow(data)))
}
# Find index where cond is a condition list.
# Used in subset2
find.index=function(cond,data){
expr=names(cond)
cond=cond[[1]][[1... | /R/toolbox_subset2.R | no_license | kuremon/exe | R | false | false | 2,342 | r | # Find index where call is evaluated in envir data.
# Used in subset2i
find.index.i=function(call,data){
tryCatch(eval(call,data),error = function(e) rep(TRUE,nrow(data)))
}
# Find index where cond is a condition list.
# Used in subset2
find.index=function(cond,data){
expr=names(cond)
cond=cond[[1]][[1... |
\name{solvd_sim}
\alias{solvd_sim}
\docType{data}
\title{
Simulated Data Set
}
\description{
Simulated Data Set to have the same variables as in the SOLVD Treatment and Prevention Trials Data.
Note that this is just a simulated data set and does not contain any data from the SOLVD trials.
}
\usage{data("solvd_sim")}
\f... | /man/solvd_sim.Rd | no_license | nchenderson/AFTrees | R | false | false | 2,404 | rd | \name{solvd_sim}
\alias{solvd_sim}
\docType{data}
\title{
Simulated Data Set
}
\description{
Simulated Data Set to have the same variables as in the SOLVD Treatment and Prevention Trials Data.
Note that this is just a simulated data set and does not contain any data from the SOLVD trials.
}
\usage{data("solvd_sim")}
\f... |
# clear variables and close windows
rm(list = ls(all = TRUE))
graphics.off()
# Load data
x = read.table("uscomp2.dat")
y = data.frame(x)
# Create subsets for Energy and Manufacturing
yE = subset(y, y$V8 == "Energy")
yM = subset(y, y$V8 == "Manufacturing")
# Calculate means of groups
exE = cbind(apply(yE[, 2:3], 2, ... | /QID-1659-MVAsimcidif/MVAsimcidif.r | no_license | QuantLet/MVA | R | false | false | 1,227 | r |
# clear variables and close windows
rm(list = ls(all = TRUE))
graphics.off()
# Load data
x = read.table("uscomp2.dat")
y = data.frame(x)
# Create subsets for Energy and Manufacturing
yE = subset(y, y$V8 == "Energy")
yM = subset(y, y$V8 == "Manufacturing")
# Calculate means of groups
exE = cbind(apply(yE[, 2:3], 2, ... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scores.R
\docType{data}
\name{scores}
\alias{scores}
\title{Scores data set.}
\format{A tibble (\code{tbl}) of 30 rows and 11 columns:
\describe{
\item{student}{first name, last name}
\item{quiz_1, quiz_2, quiz_3}{quiz scores out of 2... | /man/scores.Rd | permissive | gueyenono/professorrr | R | false | true | 687 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scores.R
\docType{data}
\name{scores}
\alias{scores}
\title{Scores data set.}
\format{A tibble (\code{tbl}) of 30 rows and 11 columns:
\describe{
\item{student}{first name, last name}
\item{quiz_1, quiz_2, quiz_3}{quiz scores out of 2... |
################################
#### Regression for compositional data based on the log-ratio transformation
#### Tsagris Michail 6/2014
#### mtsagris@yahoo.gr
#### References: John Aitchison (2003)
#### The Statistical Analysis of Compositional Data p. 158-160 Blackburn Press
################################
... | /Compositional/R/comp.reg.R | no_license | ingted/R-Examples | R | false | false | 1,700 | r | ################################
#### Regression for compositional data based on the log-ratio transformation
#### Tsagris Michail 6/2014
#### mtsagris@yahoo.gr
#### References: John Aitchison (2003)
#### The Statistical Analysis of Compositional Data p. 158-160 Blackburn Press
################################
... |
\name{uniroot.integer}
\alias{uniroot.integer}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{Find the root of a function to the nearest integer}
\description{
Let f be a monotonic function that changes sign within the interval specified. If f(i)=0 for some i within the interval specified (i... | /man/uniroot.integer.Rd | no_license | cran/ssanv | R | false | false | 2,740 | rd | \name{uniroot.integer}
\alias{uniroot.integer}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{Find the root of a function to the nearest integer}
\description{
Let f be a monotonic function that changes sign within the interval specified. If f(i)=0 for some i within the interval specified (i... |
test.GBM.groupsplit <- function() {
# Training set has only 45 categories cat1 through cat45
Log.info("Importing 50_cattest_train.csv data...\n")
train.hex <- h2o.uploadFile(locate("smalldata/gbm_test/50_cattest_train.csv"), destination_frame = "train.hex")
train.hex$y <- as.factor(train.hex$y)
Log.info("S... | /h2o-r/tests/testdir_algos/gbm/runit_GBM_groupsplit_50cat.R | permissive | StephRoark/h2o-3 | R | false | false | 1,573 | r |
test.GBM.groupsplit <- function() {
# Training set has only 45 categories cat1 through cat45
Log.info("Importing 50_cattest_train.csv data...\n")
train.hex <- h2o.uploadFile(locate("smalldata/gbm_test/50_cattest_train.csv"), destination_frame = "train.hex")
train.hex$y <- as.factor(train.hex$y)
Log.info("S... |
# installs all packages from wish list including dependencies
# pre-requisites
install.packages(c("tidyverse", "devtools", "readxl"))
library(devtools)
library(readxl)
# packages only available on GitHub
devtools::install_github("stan-dev/cmdstanr")
devtools::install_github("UUPharmacometrics/PsNR")
devtools::instal... | /inst_all_pkgs.R | no_license | qualityland/DV_R_Packages | R | false | false | 1,231 | r | # installs all packages from wish list including dependencies
# pre-requisites
install.packages(c("tidyverse", "devtools", "readxl"))
library(devtools)
library(readxl)
# packages only available on GitHub
devtools::install_github("stan-dev/cmdstanr")
devtools::install_github("UUPharmacometrics/PsNR")
devtools::instal... |
`mu.mblalc` <-
function(len,alpha,beta,level=0.95)
{
n <- ceiling(4*beta*(qnorm((1+level)/2)/len*exp(lgamma(alpha-.5)-lgamma(alpha)))^2)
step <- 2^3
found.upper.bound <- FALSE
found.lower.bound <- FALSE
direction <- +1
while(step >= 2)
{
step <- ifelse(found.upper.bound & found.low... | /R/mu.mblalc.R | no_license | cran/SampleSizeMeans | R | false | false | 925 | r | `mu.mblalc` <-
function(len,alpha,beta,level=0.95)
{
n <- ceiling(4*beta*(qnorm((1+level)/2)/len*exp(lgamma(alpha-.5)-lgamma(alpha)))^2)
step <- 2^3
found.upper.bound <- FALSE
found.lower.bound <- FALSE
direction <- +1
while(step >= 2)
{
step <- ifelse(found.upper.bound & found.low... |
#!/usr/bin/env Rscript
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
# 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... | /scripts/forge_bsgenome.R | permissive | Multiscale-Genomics/mg-process-fastq | R | false | false | 975 | r | #!/usr/bin/env Rscript
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
# 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... |
\name{problematicPeaks}
\alias{problematicPeaks}
\title{Identify intense peaks (in a list of unmatched peaks)}
\usage{
problematicPeaks(peaks_unmatched, peaks_matched, mode =
"pH")
}
\arguments{
\item{peaks_unmatched}{Table of unmatched peaks, with at
least \code{cpdID, scan, mzFound, int}.}
\it... | /man/problematicPeaks.Rd | no_license | uchem-massbank/RMassBank | R | false | false | 1,256 | rd | \name{problematicPeaks}
\alias{problematicPeaks}
\title{Identify intense peaks (in a list of unmatched peaks)}
\usage{
problematicPeaks(peaks_unmatched, peaks_matched, mode =
"pH")
}
\arguments{
\item{peaks_unmatched}{Table of unmatched peaks, with at
least \code{cpdID, scan, mzFound, int}.}
\it... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/platt.r
\docType{data}
\name{PI}
\alias{PI}
\title{Simulated Photosynthesis-Irradiance data}
\format{
A data frame with 124 rows and 3 variables:
\describe{
\item{Depth}{Sample identifier}
\item{P}{Photosynthetic rate}
\item{I}{Irradian... | /man/PI.Rd | no_license | SWotherspoon/Platt | R | false | true | 455 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/platt.r
\docType{data}
\name{PI}
\alias{PI}
\title{Simulated Photosynthesis-Irradiance data}
\format{
A data frame with 124 rows and 3 variables:
\describe{
\item{Depth}{Sample identifier}
\item{P}{Photosynthetic rate}
\item{I}{Irradian... |
# Initialize model environments
# ------------------------------------------------------------------------------
## Rules about model-related information
### Definitions:
# - the model is the model type (e.g. "rand_forest", "linear_reg", etc)
# - the model's mode is the species of model such as "classification" or ... | /R/aaa_models.R | no_license | markfairbanks/parsnip | R | false | false | 27,272 | r | # Initialize model environments
# ------------------------------------------------------------------------------
## Rules about model-related information
### Definitions:
# - the model is the model type (e.g. "rand_forest", "linear_reg", etc)
# - the model's mode is the species of model such as "classification" or ... |
#' Gene symbol conversion
#'
#' Convert between Mouse and Human gene symbols
#' @param genes vector of genes
#' @export
#' @examples
#' symbols <- convert_symbols(c('Il6'))
library(reticulate)
if('r-fastGene' %in% conda_list()[[1]]){
reticulate::use_condaenv('r-fastGene')
}else{
conda_install('r-fastGene', packages... | /R/convert_symbols.R | no_license | samuelbunga/fastGene | R | false | false | 591 | r | #' Gene symbol conversion
#'
#' Convert between Mouse and Human gene symbols
#' @param genes vector of genes
#' @export
#' @examples
#' symbols <- convert_symbols(c('Il6'))
library(reticulate)
if('r-fastGene' %in% conda_list()[[1]]){
reticulate::use_condaenv('r-fastGene')
}else{
conda_install('r-fastGene', packages... |
library(Diagnostics)
learn <- function(hist){
c <- list()
historical_data = hist
# p(Pn,Te,VTB,TB,Sm,LC,Br,XR,Dy) = p(Dy|Pn,Te,VTB,TB,Sm,LC,Br,XR) . p(XR|Pn,Te,VTB,TB,Sm,LC,Br) . p(Br|Pn,Te,VTB,TB,Sm,LC) . p(LC|Pn,Te,VTB,TB,Sm) . p(Sm|Pn,Te,VTB,TB) . p(TB|Pn,Te,VTB) . p(VTB|Pn,Te) . p(Te|Pn) . p(Pn)
#... | /Artificial Intelligence/project_3.R | no_license | tahseenadit/academicWorks | R | false | false | 32,219 | r | library(Diagnostics)
learn <- function(hist){
c <- list()
historical_data = hist
# p(Pn,Te,VTB,TB,Sm,LC,Br,XR,Dy) = p(Dy|Pn,Te,VTB,TB,Sm,LC,Br,XR) . p(XR|Pn,Te,VTB,TB,Sm,LC,Br) . p(Br|Pn,Te,VTB,TB,Sm,LC) . p(LC|Pn,Te,VTB,TB,Sm) . p(Sm|Pn,Te,VTB,TB) . p(TB|Pn,Te,VTB) . p(VTB|Pn,Te) . p(Te|Pn) . p(Pn)
#... |
correlations_module <- list(
name = "Correlations",
icon = icon("th-large")
)
correlations_sidebar <- function(id) {
ns <- NS(id)
list(
sliderInput(ns("exclude"), label = "Exclude", min = -1, max = 1, step = 0.01, value = c(0, 0))
)
}
correlations_ui <- function(id) {
ns <- NS(id)
tabItem(
tab... | /modules/correlations.R | no_license | altaf-ali/shiny-stats | R | false | false | 3,206 | r | correlations_module <- list(
name = "Correlations",
icon = icon("th-large")
)
correlations_sidebar <- function(id) {
ns <- NS(id)
list(
sliderInput(ns("exclude"), label = "Exclude", min = -1, max = 1, step = 0.01, value = c(0, 0))
)
}
correlations_ui <- function(id) {
ns <- NS(id)
tabItem(
tab... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/auth.R
\name{removeAuthorizedUser}
\alias{removeAuthorizedUser}
\title{Remove authorized user from an application}
\usage{
removeAuthorizedUser(
user,
appDir = getwd(),
appName = NULL,
account = NULL,
server = NULL
)
}
\arguments{
\... | /man/removeAuthorizedUser.Rd | no_license | btongson/rsconnect | R | false | true | 945 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/auth.R
\name{removeAuthorizedUser}
\alias{removeAuthorizedUser}
\title{Remove authorized user from an application}
\usage{
removeAuthorizedUser(
user,
appDir = getwd(),
appName = NULL,
account = NULL,
server = NULL
)
}
\arguments{
\... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/binomial.R
\name{bin_distribution}
\alias{bin_distribution}
\title{bin_distribution}
\usage{
bin_distribution(trials, prob)
}
\arguments{
\item{trials}{(integer) number of trials}
\item{prob}{(numeric) probability of success}
}
\value{
a dat... | /man/bin_distribution.Rd | permissive | jacobyeung/Binomial_Package | R | false | true | 509 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/binomial.R
\name{bin_distribution}
\alias{bin_distribution}
\title{bin_distribution}
\usage{
bin_distribution(trials, prob)
}
\arguments{
\item{trials}{(integer) number of trials}
\item{prob}{(numeric) probability of success}
}
\value{
a dat... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/multivariance-functions.R
\name{resample.pvalue}
\alias{resample.pvalue}
\title{p-value via resampling}
\usage{
resample.pvalue(value, ...)
}
\arguments{
\item{value}{numeric, the value of (total-/m-)multivariance for which the p-value shall ... | /fuzzedpackages/multivariance/man/resample.pvalue.Rd | no_license | akhikolla/testpackages | R | false | true | 1,322 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/multivariance-functions.R
\name{resample.pvalue}
\alias{resample.pvalue}
\title{p-value via resampling}
\usage{
resample.pvalue(value, ...)
}
\arguments{
\item{value}{numeric, the value of (total-/m-)multivariance for which the p-value shall ... |
#!/usr/bin/env Rscript
# https://stackoverflow.com/questions/18306362/run-r-script-from-command-line
# Clear workspace
rm(list = ls())
options(echo = TRUE)
args <- commandArgs(trailingOnly = TRUE)
if (length(args) > 0) {
print("Taking cli arguments.")
workspace = args[1]
# Load the config
if (!exists("... | /old interfaces/main-harmonic-means.R | no_license | AMCeScience/R-topicmodelling | R | false | false | 2,592 | r | #!/usr/bin/env Rscript
# https://stackoverflow.com/questions/18306362/run-r-script-from-command-line
# Clear workspace
rm(list = ls())
options(echo = TRUE)
args <- commandArgs(trailingOnly = TRUE)
if (length(args) > 0) {
print("Taking cli arguments.")
workspace = args[1]
# Load the config
if (!exists("... |
# Function to generate nice long-form CSV from World Bank CSV export
# for ONE YEAR AND ONLY for OECD countries
cleanWorldBank <- function(filename, year) {
OECD <- c("Austria", "Belgium", "Canada", "Chile", "Czech", "Republic",
"Denmark", "Estonia", "Finland", "France", "Germany", "Greece",
... | /scripts/wikinz/src/clean-WorldBank.R | no_license | anhinton/conduit-seminar2014 | R | false | false | 993 | r |
# Function to generate nice long-form CSV from World Bank CSV export
# for ONE YEAR AND ONLY for OECD countries
cleanWorldBank <- function(filename, year) {
OECD <- c("Austria", "Belgium", "Canada", "Chile", "Czech", "Republic",
"Denmark", "Estonia", "Finland", "France", "Germany", "Greece",
... |
# load shiny package
library(shiny)
# shiny UI
shinyUI(navbarPage("Developing Data Products - Shiny Project",
# first tab
tabPanel("Documentation",
br(),
h3("Plotting predictors for the Wage dataset"),
br(),
p("We use the dataset", s... | /ui.R | no_license | denitram/wage_shiny_app | R | false | false | 2,060 | r | # load shiny package
library(shiny)
# shiny UI
shinyUI(navbarPage("Developing Data Products - Shiny Project",
# first tab
tabPanel("Documentation",
br(),
h3("Plotting predictors for the Wage dataset"),
br(),
p("We use the dataset", s... |
#############################################################################################
## Title: RBSA Analysis
## Author: Casey Stevens, Cadmus Group
## Created: 06/13/2017
## Updated:
## Billing ... | /Code/Table Code/SF - Lock Down/Item 169.R | no_license | casey-stevens/Cadmus-6000-2017 | R | false | false | 14,073 | r | #############################################################################################
## Title: RBSA Analysis
## Author: Casey Stevens, Cadmus Group
## Created: 06/13/2017
## Updated:
## Billing ... |
#Function not in R
#FLMatrixREF
test_that("testing the example written in FLMatrixREF",{
flmatrix <- FLMatrix("FL_DEMO", "tblMatrixMulti", 5,"MATRIX_ID","ROW_ID","COL_ID","CELL_VAL")
resultFLMatrix <- FLMatrixREF(flmatrix)
print(resultFLMatrix)
})
| /tests/testsuite/test_FLMatrixREF.R | no_license | gkappler/AdapteR | R | false | false | 265 | r | #Function not in R
#FLMatrixREF
test_that("testing the example written in FLMatrixREF",{
flmatrix <- FLMatrix("FL_DEMO", "tblMatrixMulti", 5,"MATRIX_ID","ROW_ID","COL_ID","CELL_VAL")
resultFLMatrix <- FLMatrixREF(flmatrix)
print(resultFLMatrix)
})
|
## This is programming assignment number 2 for R Programming class
## This function will cache the inverse of a matrix and return a list
makeCacheMatrix <- function(x = matrix()) {
m <- NULL
set <- function(y) {
x <<- y
m <<- NULL
}
get <- function() x
setsolve <- function(solve) m <<- solve
getso... | /cachematrix.R | no_license | victorborrero/ProgrammingAssignment2 | R | false | false | 849 | r | ## This is programming assignment number 2 for R Programming class
## This function will cache the inverse of a matrix and return a list
makeCacheMatrix <- function(x = matrix()) {
m <- NULL
set <- function(y) {
x <<- y
m <<- NULL
}
get <- function() x
setsolve <- function(solve) m <<- solve
getso... |
### In this file, there are a lot of functions form caret that are
### references using the explicit namespace operator (:::). For some
### reason, with some parallel processing technologies and foreach,
### functions inside of caret cannot be found despite using the
### ".packages" argument and calling the caret pack... | /pkg/caret/R/workflows.R | no_license | andirey/caret | R | false | false | 31,769 | r |
### In this file, there are a lot of functions form caret that are
### references using the explicit namespace operator (:::). For some
### reason, with some parallel processing technologies and foreach,
### functions inside of caret cannot be found despite using the
### ".packages" argument and calling the caret pack... |
#!/usr/bin/Rscript
countries <- read.csv("iso_3166_2_countries.csv",header=TRUE,dec=",",sep=",")
cities1 <- read.csv("unece/2014-1_UNLOCODE_CodeListPart1_utf8.csv",header=FALSE,
dec=",",sep=",")
cities2 <- read.csv("unece/2014-1_UNLOCODE_CodeListPart2_utf8.csv",header=FALSE,
dec=",",sep=",")
cities3 <-... | /txt/geoloc/getList.r | no_license | hibarikyouya/findlab | R | false | false | 663 | r | #!/usr/bin/Rscript
countries <- read.csv("iso_3166_2_countries.csv",header=TRUE,dec=",",sep=",")
cities1 <- read.csv("unece/2014-1_UNLOCODE_CodeListPart1_utf8.csv",header=FALSE,
dec=",",sep=",")
cities2 <- read.csv("unece/2014-1_UNLOCODE_CodeListPart2_utf8.csv",header=FALSE,
dec=",",sep=",")
cities3 <-... |
##############################################################################-
## Project: Alcohol
## Script purpose: scrape longitude and latitude of all countries
## Date: 2019-10-13
## Author: Joseph T. Powers
##############################################################################-
## Overview ----
########... | /munge/raw_data_extraction/longitude_latitude_raw.R | no_license | joepowers16/alcohol | R | false | false | 21,840 | r | ##############################################################################-
## Project: Alcohol
## Script purpose: scrape longitude and latitude of all countries
## Date: 2019-10-13
## Author: Joseph T. Powers
##############################################################################-
## Overview ----
########... |
context("test-getcomment.R")
test_that("get one comment work", {
tar <- "http://v.media.daum.net/v/20100101092104056"
tem <- getComment(tar)
print(tem)
expect_equal(nrow(tem), 1)
})
test_that("get zero comment work", {
tar <- "http://v.media.daum.net/v/20180516222212362"
tem <- getComment(tar)
print(tem... | /tests/testthat/test-getcomment.R | permissive | snapbuy/DNH4 | R | false | false | 735 | r | context("test-getcomment.R")
test_that("get one comment work", {
tar <- "http://v.media.daum.net/v/20100101092104056"
tem <- getComment(tar)
print(tem)
expect_equal(nrow(tem), 1)
})
test_that("get zero comment work", {
tar <- "http://v.media.daum.net/v/20180516222212362"
tem <- getComment(tar)
print(tem... |
run_as_rstudio_job <- function(expr) {
tf <- tempfile(fileext = ".R")
lines <- deparse(substitute(expr))
lines <- c(
"source(\"dev_utils.R\")",
lines
)
writeLines(lines, con = tf)
rstudioapi::jobRunScript(path = tf, workingDir = getwd())
}
run_fun_as_rstudio_job <- function(fun_nm) {
stop... | /dev_utils.R | no_license | rdosreis/popEpi | R | false | false | 3,414 | r |
run_as_rstudio_job <- function(expr) {
tf <- tempfile(fileext = ".R")
lines <- deparse(substitute(expr))
lines <- c(
"source(\"dev_utils.R\")",
lines
)
writeLines(lines, con = tf)
rstudioapi::jobRunScript(path = tf, workingDir = getwd())
}
run_fun_as_rstudio_job <- function(fun_nm) {
stop... |
library(testthat)
library(httr)
library(stringr)
library(jpredapir)
test_check("jpredapir")
| /tests/testthat.R | permissive | MoseleyBioinformaticsLab/jpredapir | R | false | false | 93 | r | library(testthat)
library(httr)
library(stringr)
library(jpredapir)
test_check("jpredapir")
|
users <- read.csv("users.csv");
words <- read.csv("words.csv");
users_words <-merge(words,users, by.x="User", by.y="RESPID",all.x=T)
rows <- is.na(users_words)
users_words[rows] <- 0
output <- colSums(users_words)
write.csv(output,"TotalWordFrequency.csv",row.names=TRUE) | /resources/rScript/TotalWordFrequency.R | no_license | maulikfojdar/musicalminds | R | false | false | 274 | r | users <- read.csv("users.csv");
words <- read.csv("words.csv");
users_words <-merge(words,users, by.x="User", by.y="RESPID",all.x=T)
rows <- is.na(users_words)
users_words[rows] <- 0
output <- colSums(users_words)
write.csv(output,"TotalWordFrequency.csv",row.names=TRUE) |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/visunet.R
\docType{package}
\name{VisuNet-package}
\alias{VisuNet}
\alias{VisuNet-package}
\title{Rule Network Visualistion gadget}
\description{
This is a mostly empty package to learn roxygen documentation.
}
\details{
Hello allows me to le... | /man/VisuNet-package.Rd | no_license | karsmo/VisuNet | R | false | true | 494 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/visunet.R
\docType{package}
\name{VisuNet-package}
\alias{VisuNet}
\alias{VisuNet-package}
\title{Rule Network Visualistion gadget}
\description{
This is a mostly empty package to learn roxygen documentation.
}
\details{
Hello allows me to le... |
#load info for partner kin ----
pedigree <- read_excel("Dropbox/Pedigree and Life-History Data/PEDIGREE_updated2016.xlsx", sheet = "Demographic Data")
pedigree <- as.data.table(pedigree)
pedigree[is.na(DAM),DAM:=`BEHAVIORAL MOM`]
pedigree[,SEX:=tolower(SEX)]
Afull <- pedigree[,2*kinship2::kinship(Focal_ID,dadid=SIRE,m... | /loadcovariates.R | no_license | thewart/OrdRegMix | R | false | false | 2,993 | r | #load info for partner kin ----
pedigree <- read_excel("Dropbox/Pedigree and Life-History Data/PEDIGREE_updated2016.xlsx", sheet = "Demographic Data")
pedigree <- as.data.table(pedigree)
pedigree[is.na(DAM),DAM:=`BEHAVIORAL MOM`]
pedigree[,SEX:=tolower(SEX)]
Afull <- pedigree[,2*kinship2::kinship(Focal_ID,dadid=SIRE,m... |
library(KrigInv)
### Name: max_timse_parallel
### Title: Minimizer of the parallel timse criterion
### Aliases: max_timse_parallel
### ** Examples
#max_timse_parallel
set.seed(9)
N <- 20 #number of observations
T <- c(40,80) #thresholds
testfun <- branin
lower <- c(0,0)
upper <- c(1,1)
#a 20 points initial desig... | /data/genthat_extracted_code/KrigInv/examples/max_timse_parallel.Rd.R | no_license | surayaaramli/typeRrh | R | false | false | 1,786 | r | library(KrigInv)
### Name: max_timse_parallel
### Title: Minimizer of the parallel timse criterion
### Aliases: max_timse_parallel
### ** Examples
#max_timse_parallel
set.seed(9)
N <- 20 #number of observations
T <- c(40,80) #thresholds
testfun <- branin
lower <- c(0,0)
upper <- c(1,1)
#a 20 points initial desig... |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/getTracks.R
\name{parseFullTrack}
\alias{parseFullTrack}
\title{Parse full tracks object}
\usage{
parseFullTrack(track_obj)
}
\arguments{
\item{tracks_obj}{A json-like list, full track object returned by Spotify API}
}
\value{
A tibble
}
\des... | /man/parseFullTrack.Rd | no_license | Jkassof/rspotify | R | false | true | 421 | rd | % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/getTracks.R
\name{parseFullTrack}
\alias{parseFullTrack}
\title{Parse full tracks object}
\usage{
parseFullTrack(track_obj)
}
\arguments{
\item{tracks_obj}{A json-like list, full track object returned by Spotify API}
}
\value{
A tibble
}
\des... |
`relDiff4LogRatio` <-
function(logRatio){
# function RelDiff = RelDiff4LogRatio(LogRatio);
# % RelDiff = RelDiffTrans(LogRatio);
# % Uebersetzung von LogRatio in Relative Differenzen
# % Achtung: gilt nur naeherungsweise! gut fuer LogRatio in [-0.5 0.5]
# % INPUT
# % LogRatio(1:d,1:n)
# % OUTPUT
# % RelDi... | /DbtTools/Transforms/R/relDiff4LogRatio.R | no_license | markus-flicke/KD_Projekt_1 | R | false | false | 566 | r | `relDiff4LogRatio` <-
function(logRatio){
# function RelDiff = RelDiff4LogRatio(LogRatio);
# % RelDiff = RelDiffTrans(LogRatio);
# % Uebersetzung von LogRatio in Relative Differenzen
# % Achtung: gilt nur naeherungsweise! gut fuer LogRatio in [-0.5 0.5]
# % INPUT
# % LogRatio(1:d,1:n)
# % OUTPUT
# % RelDi... |
## National park visits
# By Nyssa Silbiger
# 9/17/2019
### load the libraries
library(tidyverse)
library(sf)
library(usmap)
library(gganimate)
library(transformr)
library(scales)
### Read in the data
park_visits <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/20... | /NationalParks/ParkScript.R | no_license | njsilbiger/TidyTuesday_CSUN | R | false | false | 1,756 | r |
## National park visits
# By Nyssa Silbiger
# 9/17/2019
### load the libraries
library(tidyverse)
library(sf)
library(usmap)
library(gganimate)
library(transformr)
library(scales)
### Read in the data
park_visits <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/20... |
\name{ks.cp3o_delta}
\alias{ks.cp3o_delta}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
CHANGE POINTS ESTIMATION BY PRUNED OBJECTIVE (VIA KOLMOGOROV-SMIRNOV STATISTIC)
}
\description{
An algorithm for multiple change point analysis that uses dynamic programming and
pruning. The Kolmogorov-... | /man/ks.cp3o_delta.Rd | no_license | zwenyu/ecp | R | false | false | 2,622 | rd | \name{ks.cp3o_delta}
\alias{ks.cp3o_delta}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
CHANGE POINTS ESTIMATION BY PRUNED OBJECTIVE (VIA KOLMOGOROV-SMIRNOV STATISTIC)
}
\description{
An algorithm for multiple change point analysis that uses dynamic programming and
pruning. The Kolmogorov-... |
#' Modulus of elasticity
#'
#' Determines pressure potential and the modulus of elasticity
#'
#' @param data data frame containing columns of equal lengths giving the numerical
#' coordinates of the curve: water potential (bar) and RWD (\%), ordered by sample by descending water potential. A
#' column containing ... | /R/ModElasticity.R | no_license | cran/pvldcurve | R | false | false | 8,819 | r | #' Modulus of elasticity
#'
#' Determines pressure potential and the modulus of elasticity
#'
#' @param data data frame containing columns of equal lengths giving the numerical
#' coordinates of the curve: water potential (bar) and RWD (\%), ordered by sample by descending water potential. A
#' column containing ... |
# test_ISOImageryPlan.R
# Author: Emmanuel Blondel <emmanuel.blondel1@gmail.com>
#
# Description: Unit tests for ISOImageryPlan.R
#=======================
require(geometa, quietly = TRUE)
require(testthat)
context("ISOImageryPlan")
test_that("encoding",{
testthat::skip_on_cran()
#encoding
md <- ISO... | /tests/testthat/test_ISOImageryPlan.R | no_license | cran/geometa | R | false | false | 1,849 | r | # test_ISOImageryPlan.R
# Author: Emmanuel Blondel <emmanuel.blondel1@gmail.com>
#
# Description: Unit tests for ISOImageryPlan.R
#=======================
require(geometa, quietly = TRUE)
require(testthat)
context("ISOImageryPlan")
test_that("encoding",{
testthat::skip_on_cran()
#encoding
md <- ISO... |
#'//////////////////////////////////////////////////////////////////////////////
#' FILE: app.R
#' CREATED: 2018-08-16
#' MODIFIED: 2021-05-29
#' PURPOSE: demo for custom styling of <select> input
#' PACKAGES: shiny
#' STATUS: working + complete;
#' COMMENTS: see comments in www/css/styles.css for information on css
#'... | /select-input-styling/app.R | permissive | davidruvolo51/shinyAppTutorials | R | false | false | 1,863 | r | #'//////////////////////////////////////////////////////////////////////////////
#' FILE: app.R
#' CREATED: 2018-08-16
#' MODIFIED: 2021-05-29
#' PURPOSE: demo for custom styling of <select> input
#' PACKAGES: shiny
#' STATUS: working + complete;
#' COMMENTS: see comments in www/css/styles.css for information on css
#'... |
setwd("~/Coursera/Exploratory Data Analysis/Week1")
data0<-read.table(file="household_power_consumption.txt",header=TRUE,sep=";",stringsAsFactors = FALSE,dec=".")
#extract only the rows that we need, i.e. rows on 1/2/2007 and 2/2/2007
data<-data0[data0$Date %in% c("1/2/2007","2/2/2007"),]
#Save the plot (Histogram) i... | /plot1.R | no_license | JOELJAIMON/project1 | R | false | false | 573 | r | setwd("~/Coursera/Exploratory Data Analysis/Week1")
data0<-read.table(file="household_power_consumption.txt",header=TRUE,sep=";",stringsAsFactors = FALSE,dec=".")
#extract only the rows that we need, i.e. rows on 1/2/2007 and 2/2/2007
data<-data0[data0$Date %in% c("1/2/2007","2/2/2007"),]
#Save the plot (Histogram) i... |
#' Return Latest File
#'
#' `return_latest` checks for a pattern in a folder and provides the most
#' recent file bases on the time the file was created.
#'
#' @param folderpath path to folder where file(s) are located.
#' @param pattern pattern in file name, regex expressions. If not parttern is
#' provided, the l... | /R/return_latest.R | permissive | Green-EyE/glamr | R | false | false | 1,110 | r | #' Return Latest File
#'
#' `return_latest` checks for a pattern in a folder and provides the most
#' recent file bases on the time the file was created.
#'
#' @param folderpath path to folder where file(s) are located.
#' @param pattern pattern in file name, regex expressions. If not parttern is
#' provided, the l... |
#' Publish the site
#'
#' \code{wflow_publish} is the main workflowr function. Use it when you are
#' ready to publish an analysis to your site. \code{wflow_publish} performs
#' three steps: 1) commit the file(s) (can include both Rmd and non-Rmd files,
#' e.g. \code{_site.yml}), 2) rebuild the R Markdown file(s), 3) c... | /R/wflow_publish.R | permissive | workflowr/workflowr | R | false | false | 11,204 | r | #' Publish the site
#'
#' \code{wflow_publish} is the main workflowr function. Use it when you are
#' ready to publish an analysis to your site. \code{wflow_publish} performs
#' three steps: 1) commit the file(s) (can include both Rmd and non-Rmd files,
#' e.g. \code{_site.yml}), 2) rebuild the R Markdown file(s), 3) c... |
testlist <- list(g = 0, z = 6.33392637859786e-140)
result <- do.call(hmlasso:::softThresholdC,testlist)
str(result) | /hmlasso/inst/testfiles/softThresholdC/libFuzzer_softThresholdC/softThresholdC_valgrind_files/1609897499-test.R | no_license | akhikolla/newtestfiles-2 | R | false | false | 115 | r | testlist <- list(g = 0, z = 6.33392637859786e-140)
result <- do.call(hmlasso:::softThresholdC,testlist)
str(result) |
### Model #1
rf1 <- h2o.randomForest(training_frame = trainh2o, validation_frame = validh2o,
x=1:12, y=13,
model_id = "rf_v1",
ntrees = 200, # random forest model. The default is 50.
stopping_rounds = 3, # Stop fitting ... | /Test_RCode/multiple_RFs.R | no_license | kaseyriver11/data-scientist-exercise01 | R | false | false | 2,336 | r |
### Model #1
rf1 <- h2o.randomForest(training_frame = trainh2o, validation_frame = validh2o,
x=1:12, y=13,
model_id = "rf_v1",
ntrees = 200, # random forest model. The default is 50.
stopping_rounds = 3, # Stop fitting ... |
setwd("C:/Users/.../Documents/Coursera/DataScience/ExploratoryDataAnalysis")
# Read the complete dataset
data <- read.table("household_power_consumption.txt", header=TRUE, sep=";", stringsAsFactors=FALSE, dec=".")
# Subset the desired dates from the complete dataset
d_data <- data[data$Date %in% c("1/2/2007","2/2/2007... | /Plot4.r | no_license | DraganP/ExplDataAnalysis-Project1 | R | false | false | 1,461 | r | setwd("C:/Users/.../Documents/Coursera/DataScience/ExploratoryDataAnalysis")
# Read the complete dataset
data <- read.table("household_power_consumption.txt", header=TRUE, sep=";", stringsAsFactors=FALSE, dec=".")
# Subset the desired dates from the complete dataset
d_data <- data[data$Date %in% c("1/2/2007","2/2/2007... |
################################################
# XGBOOST weighted 20 - Validation on May 2016 #
################################################
# Clear the workspace
rm(list=ls())
# Set working directory
setwd("C:/Users/Tom/Documents/Kaggle/Santander")
# Load the required libraries
library(data.table)
library(bit... | /Validation/18-12-2016/xgboost weighted 20.R | no_license | PetrShypila/Santander-Product-Recommendation | R | false | false | 40,230 | r | ################################################
# XGBOOST weighted 20 - Validation on May 2016 #
################################################
# Clear the workspace
rm(list=ls())
# Set working directory
setwd("C:/Users/Tom/Documents/Kaggle/Santander")
# Load the required libraries
library(data.table)
library(bit... |
#############################
# Summarize the discrete time
# spatiotemporal model fit
# to Sciurid data
#############################
library(gridExtra)
library(grid)
library(ggplot2)
library(plyr)
library(mvtnorm)
library(R.utils)
sourceDirectory('Documents/research/dataInt/R/')
analysis_name <- "cdph_temporal_ana... | /studies/cdph_temporal_summary.R | no_license | brianconroy/dataInt | R | false | false | 7,237 | r | #############################
# Summarize the discrete time
# spatiotemporal model fit
# to Sciurid data
#############################
library(gridExtra)
library(grid)
library(ggplot2)
library(plyr)
library(mvtnorm)
library(R.utils)
sourceDirectory('Documents/research/dataInt/R/')
analysis_name <- "cdph_temporal_ana... |
# Exercise 4: complex Shiny UI layouts
# Load libraries so they are available
library("shiny")
# Use source() to execute the `app_ui.R` and `app_server.R` files. These will
# define the UI value and server function respectively.
source("app_ui.R")
source("app_server.R")
# You will need to fill in the `app_... | /app.R | no_license | cpz-baron/Week-8 | R | false | false | 498 | r | # Exercise 4: complex Shiny UI layouts
# Load libraries so they are available
library("shiny")
# Use source() to execute the `app_ui.R` and `app_server.R` files. These will
# define the UI value and server function respectively.
source("app_ui.R")
source("app_server.R")
# You will need to fill in the `app_... |
## Instructions
## 1 Merges the training and the test sets to create one data set.
# read in Test & Training sets,then combine them
x.test <- read.table("test/X_test.txt")
x.train <- read.table("train/X_train.txt")
X <- rbind(x.test, x.train)
# read in Test & Training labels,then combine them
y.test <- read.table("te... | /run_analysis.R | no_license | LoneSparrow/GettingAndCleaningData | R | false | false | 2,016 | r | ## Instructions
## 1 Merges the training and the test sets to create one data set.
# read in Test & Training sets,then combine them
x.test <- read.table("test/X_test.txt")
x.train <- read.table("train/X_train.txt")
X <- rbind(x.test, x.train)
# read in Test & Training labels,then combine them
y.test <- read.table("te... |
#Load packages
pkg_list = c("XML","corrplot","magrittr","dplyr")
lapply(pkg_list,require,character.only=TRUE)
ordered_fstmat <- function(filepath,remove0=TRUE,order=TRUE,pvalue=FALSE){
#----Read the XML and extract contents----#
arqxml <- xmlParse(filepath)
arq_fstmat <- xpathSApply(arqxml,"//... | /fstmatfunction.R | no_license | niccw/arlequin_xml | R | false | false | 4,982 | r |
#Load packages
pkg_list = c("XML","corrplot","magrittr","dplyr")
lapply(pkg_list,require,character.only=TRUE)
ordered_fstmat <- function(filepath,remove0=TRUE,order=TRUE,pvalue=FALSE){
#----Read the XML and extract contents----#
arqxml <- xmlParse(filepath)
arq_fstmat <- xpathSApply(arqxml,"//... |
head(phe)
exprset[1:4,1:4]
set.seed(1234567890)
dim(expr)
k=sample(1:593,300)
t_exp=expr[,k]
v_exp=expr[,-k]
head(t_phe)
x=t(log2(t_tumour+1))
y=t_phe$event
View(x)
all(t_phe$ID==colnames(t_exp))
dim(expr)
dim(phe)
data=cbind(x,y)
colnames(data)[ncol(data)]="event"
data=as.data.frame(data)
data$event=as.factor(data$ev... | /svm-18.R | no_license | jaysonwujq/mytcga | R | false | false | 699 | r | head(phe)
exprset[1:4,1:4]
set.seed(1234567890)
dim(expr)
k=sample(1:593,300)
t_exp=expr[,k]
v_exp=expr[,-k]
head(t_phe)
x=t(log2(t_tumour+1))
y=t_phe$event
View(x)
all(t_phe$ID==colnames(t_exp))
dim(expr)
dim(phe)
data=cbind(x,y)
colnames(data)[ncol(data)]="event"
data=as.data.frame(data)
data$event=as.factor(data$ev... |
#----------------------------------------------------------------------------------------------
# Script: Boxplot der Temperaturen am 12.11.2014, gemittelt, Vergleich mit DWD
# TODO: DWD Station in eigener Spalte sauber platzieren
#
# Script to paper by Langanki, Schulz 2015
# R version 3.1.2 (2014-10-31), RStudio 0.... | /code/radiation.boxplot.dwd.R | no_license | gavin971/r_dev_messkonzept | R | false | false | 2,568 | r | #----------------------------------------------------------------------------------------------
# Script: Boxplot der Temperaturen am 12.11.2014, gemittelt, Vergleich mit DWD
# TODO: DWD Station in eigener Spalte sauber platzieren
#
# Script to paper by Langanki, Schulz 2015
# R version 3.1.2 (2014-10-31), RStudio 0.... |
n<- 100
f1 <- function(){
m <-1
return (m)
}
print(f1())
print(n)
list=ls()
print(list)
rm(list=ls())
print(list)
f1 <- function(){
result <- c(10,20,30,40,50)
return (result)
} | /R/r11.R | no_license | saltandlight/TIL | R | false | false | 193 | r | n<- 100
f1 <- function(){
m <-1
return (m)
}
print(f1())
print(n)
list=ls()
print(list)
rm(list=ls())
print(list)
f1 <- function(){
result <- c(10,20,30,40,50)
return (result)
} |
### データフレームの例 (ベクトルから行列を作成)
(A <- data.frame(height=c(172,158,160),
weight=c(60,53,51)))
(B <- matrix(1:8,nrow=4,ncol=2))
(C <- data.frame(B)) # 行列から作ることもできる
(rownames(C) <- letters[1:nrow(C)]) # 行名を付ける
(names(C) <- c("Left","Right")) # 列名を付ける
C # 内容を確認する
### データ例 datasets::airquality (help(airqua... | /docs/code/data-data.frame.r | no_license | noboru-murata/sda | R | false | false | 783 | r | ### データフレームの例 (ベクトルから行列を作成)
(A <- data.frame(height=c(172,158,160),
weight=c(60,53,51)))
(B <- matrix(1:8,nrow=4,ncol=2))
(C <- data.frame(B)) # 行列から作ることもできる
(rownames(C) <- letters[1:nrow(C)]) # 行名を付ける
(names(C) <- c("Left","Right")) # 列名を付ける
C # 内容を確認する
### データ例 datasets::airquality (help(airqua... |
\name{Rsgf}
\alias{Rsgf}
\alias{Rsgf::loadSGF}
\alias{Rsgf::playerCard}
\alias{Rsgf::boardHeatMap}
\alias{Rsgf::getColorPalette}
\alias{Rsgf::SGFGame}
\alias{loadSGF}
\alias{playerCard}
\alias{boardHeatMap}
\alias{getColorPalette}
\alias{SGFGame}
\title{R package that imports SGF (Smart Game File). Used for Go and oth... | /man/Rsgf.Rd | no_license | cran/Rsgf | R | false | false | 2,116 | rd | \name{Rsgf}
\alias{Rsgf}
\alias{Rsgf::loadSGF}
\alias{Rsgf::playerCard}
\alias{Rsgf::boardHeatMap}
\alias{Rsgf::getColorPalette}
\alias{Rsgf::SGFGame}
\alias{loadSGF}
\alias{playerCard}
\alias{boardHeatMap}
\alias{getColorPalette}
\alias{SGFGame}
\title{R package that imports SGF (Smart Game File). Used for Go and oth... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.