commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
7afb9a6d6d1abfd69a3f8e237ed71085737c1f1a | Solve Simple Sum in r | deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playgr... | solutions/uri/1003/1003.r | solutions/uri/1003/1003.r | input <- file('stdin', 'r')
a <- as.integer(readLines(input, n=1))
b <- as.integer(readLines(input, n=1))
write(paste("SOMA =", a + b), '')
| mit | R | |
a803ee0976fdc3b943830363e269bd67696ffd9d | Create R_plotting.r | nairvinayv/random_scripts,nairvinayv/random_scripts | R_plotting.r | R_plotting.r | data1 = read.csv('S5_A_data', sep = '\t', header = FALSE)
data2 = read.csv('S5_B_data', sep = '\t', header = FALSE)
data3 = read.csv('S5_C_data', sep = '\t', header = FALSE)
data4 = read.csv('S5_D_data', sep = '\t', header = FALSE)
residues = readLines('S5_rownames')
setEPS()
postscript("S5_curvature.eps")
boxplot(dat... | mit | R | |
8eb729aeee313cb8c33c76585da62c1b36877a02 | Create linear.r | Sokel/R-shchu | linear.r | linear.r |
df <- read.csv("train.csv", sep=";")
ggplot(df, aes(read, math, col = gender))+
geom_point()+
facet_grid(.~hon)+
theme(axis.text=element_text(size=25),
axis.title=element_text(size=25, face="bold"))
fit <- glm(hon~read + math + gender, df, family = "binomial")
summary(fit)
exp(fit$coefficients)
head(... | apache-2.0 | R | |
ea906a644caf0c6f0af71ffd65b021f03d555092 | Create ACTIVITYUML.rd | johncorderox/Eternity-Tracking,johncorderox/Eternity-Tracking | docs/ACTIVITYUML.rd | docs/ACTIVITYUML.rd |
<a href="http://tinypic.com?ref=ao7r6e" target="_blank"><img src="http://i67.tinypic.com/ao7r6e.jpg" border="0" alt="Image and video hosting by TinyPic"></a>
| apache-2.0 | R | |
a41594e4eac094661ebabbb30f5bd007db5c5513 | Create simbnmBM.r | Sabertn/Simulation | simbnmBM.r | simbnmBM.r | # function to generate standard Normal using the Box-Muller transformations
simnormbm <- function(n.gen){
urandom1 <- runif(n.gen)
urandom2 <- runif(n.gen)
Rsqua <- -2*log(urandom1)
theta <- 2*pi*urandom2
x <- sqrt(Rsq)*cos(theta)
y <- sqrt(Rsq)*sin(theta)
# combine independent x and y
z <- (x+y)/sqrt(2... | mit | R | |
ab8898128f65a4c922cde87a696d26c861546a88 | Add files via upload | PSC-CoTC/PSC-FRAM-Admin,PSC-CoTC/PSC-FRAM-Admin | config/2016_report_config.r | config/2016_report_config.r |
run.year <- 2016
post.season.fram.db <- "./fram db/Final pre and post databases/2018PFMC_NOF_ForPSC-Coho-Backwards-thru2016_compact.mdb"
post.season.run.name <- "bc-Coho1637 Final + BP27"
post.season.tamm <- "./fram db/TAMM_Files_Postseason/coho BK 2015 Final Feb 15th.xlsm"
pre.season.fram.db <- "./fram db/Fi... | mit | R | |
8f23d4baedafcf1b3019770b20e291d93c81c5fb | Create script.r | coatless/stat490uiuc,coatless/stat490uiuc,coatless/stat490uiuc | rexamples/script.r | rexamples/script.r | #!/usr/bin/env Rscript
f = file("stdin") ## read the contents of standard input (stdin)
open(f) ## open the handle on stdin
my_data = read.delim(f, header=FALSE, stringsAsFactors=FALSE) ## read stdin as a table
my_data_count = table(my_data[,1]) ## count the number of occurance of column 1
write.table(my_data_count,quo... | mit | R | |
493439708b5037231281e48e07629d37e37c08c2 | Create graphs.r | Sokel/R-shchu | graphs.r | graphs.r | df <- mtcars
df$vs <- factor(df$vs, labels = c("V","S"))
df$am <- factor(df$am, labels = c("Auto", "Manual"))
hist(df$mpg)
hist(df$mpg, breaks = 20, xlab = "MPG")
boxplot(mpg ~ am, df, ylab = " MPG")
plot(df$mpg, df$hp)
plot(df$mpg, df$am)
library(ggplot2)
ggplot(df, aes(x = mpg))+
geom_histogram(fill = "whit... | apache-2.0 | R | |
1e2a29cff08898ca238fd13f14eb31038914a6b8 | Add an R script to fit the model, and compare with survival::clogit estimates | dcmuller/stan_clogit | clogit_stan.r | clogit_stan.r | ## example conditional logistic regression using Stan
## David C Muller
library(survival)
library(rstan)
set.seed(77834)
## use the infertility data from the survival package
datlist <- list(N=nrow(infert),
n_grp=max(infert[, "stratum"]),
n_coef=2,
x=infert[,c("spont... | bsd-3-clause | R | |
b47001c0da4d83f5a10f607793d2d29e479202b9 | Add Multiple linear regression in R | a-holm/MachinelearningAlgorithms,a-holm/MachinelearningAlgorithms | Regression/MultipleLinearRegression/regularMultipleRegression.r | Regression/MultipleLinearRegression/regularMultipleRegression.r | # Multiple linear regression for machine learning.
#
# A linear regression model that contains more than one predictor variable is
# called a multiple linear regression model. It is basically the same as Simple
# Linear regression, but with more predictor variables (features). The idea is
# that linearly related predi... | mit | R | |
8e804dc8b5383e10658f68b838b59007ce0fe931 | Create corrMatrix.r | pmb59/KLTepigenome,pmb59/KLTepigenome | corrMatrix.r | corrMatrix.r | artistic-2.0 | R | ||
28846015697fcbf27d1dddce8157d255a154ad93 | add R script to plot coverage-based sex, #1522 | opencb/opencga,opencb/opencga,j-coll/opencga,opencb/opencga,opencb/opencga,j-coll/opencga,j-coll/opencga,opencb/opencga,opencb/opencga,j-coll/opencga,j-coll/opencga,j-coll/opencga | opencga-analysis/src/main/R/genetic-checks/plot_coverage_base_sex.r | opencga-analysis/src/main/R/genetic-checks/plot_coverage_base_sex.r | library(ggplot2)
library(rjson)
library(dplyr)
library("RColorBrewer")
# New 100k thresholds
thresholds <- fromJSON(file = "201906_thresholds_grch38_v4.json")
dat <- read.delim("201908019_coverage_based_sex_thresholds.txt",
na.strings="None", header=FALSE, stringsAsFactors=FALSE)
colnames(dat) <- c("... | apache-2.0 | R | |
5659e5084a29ba3ceb18359fc8a0af8f09776a65 | Create rmd2md.r | patwynne/patwynne.github.io,patwynne/patwynne.github.io,patwynne/patwynne.github.io | rmd2md.r | rmd2md.r | #' This R script will process all R mardown files (those with in_ext file extention,
#' .rmd by default) in the current working directory. Files with a status of
#' 'processed' will be converted to markdown (with out_ext file extention, '.markdown'
#' by default). It will change the published parameter to 'true' and ch... | mit | R | |
d9b75a86d4f00458923ecb0baf927f1df9f1ca21 | Create poissonRegressionModel.r | julia-sevenof9/Presentation,julia-sevenof9/Presentation | poissonRegressionModel.r | poissonRegressionModel.r | # +++++++++++++++++++++++++++++++++++++++++ #
# --- UNOS INTERVIEW PRESENTATION --- #
# --- JULIA E. BARNHART --- #
# --- JUNE 7, 2017 --- #
# --- EXAMPLE POISSON REGRESSION MODEL --- #
# +++++++++++++++++++++++++++++++++++++++++ #
# Note: This is just a snippet of code outlining some backbone techniques
# and code use... | mit | R | |
f002413137dbbfe3a3e7f0c99874971a9861efed | Install margins for ENVECON C118. | ryanlovett/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub | deployments/r/image/extras.d/2020-spring-envecon-c118.r | deployments/r/image/extras.d/2020-spring-envecon-c118.r | #!/usr/bin/env Rscript
source("/tmp/class-libs.R")
class_name = "2020 Spring Env Econ C118"
class_libs = c(
"margins", "0.3.23"
)
class_libs_install_version(class_name, class_libs)
| bsd-3-clause | R | |
3211522c549b7ef6805fb85d2b5c9f37636d4d93 | add script for plotting te similarity | sestaton/sesbio,sestaton/sesbio,sestaton/sesbio,sestaton/sesbio | transposon_annotation/transposon_annotation_R_scripts/plot_te_similarity.r | transposon_annotation/transposon_annotation_R_scripts/plot_te_similarity.r | library("ggplot2")
sims <- read.table("all_te_similarity_0106.txt",sep="\t",header=F)
names(sims) <- c("type","element","length","similarity")
sims$type <- factor(sims$type,
levels = c("copia","gypsy","unclassified-ltr","trim","hAT",
"mutator","tc1-mariner","unclassified-tir"),
labels = c("Copia","G... | mit | R | |
cbf7c0ba195d7db0d191ef21b640b953feb36f09 | include records-tidy.r | isithot/isithotrightnow,isithot/isithotrightnow,isithot/isithotrightnow,isithot/isithotrightnow,isithot/isithotrightnow | databackup/records-tidy.r | databackup/records-tidy.r | # A heatmap of thresholds over the past 30 days
library(ggplot2)
library(jsonlite)
library(lubridate)
library(tibble)
library(dplyr)
library(tidyr)
library(readr)
library(RJSONIO)
library(xml2)
library(purrr)
library(plot3D)
select = dplyr::select
filter = dplyr::filter
# set base path depending on whether this is run... | mit | R | |
237e9bccbf73e8f09ba2c16e84fb2c7512c82fba | Create analysis.r | jessicaannlee/us-open | analysis.r | analysis.r | # Relevant commands for RStudio (Mac OS X 10.9.1)
# set your working directory
setwd("[file path]")
# reads the data file
uso.f<-read.csv("USO_f.csv")
# loads ggplot
library(ggplot2)
# for determining number of ticks:
number_ticks <- function(n) {function(limits) pretty(limits, n)}
# makes horizontal bar chart... | mit | R | |
1955b89d4b43234a7747db05911167fd9ed4ba31 | add growonly graph | Ecotrust/growth-yield-batch,Ecotrust/growth-yield-batch,Ecotrust/growth-yield-batch,Ecotrust/growth-yield-batch,jgcobb3/growth-yield-batch,Ecotrust/growth-yield-batch,jgcobb3/growth-yield-batch,Ecotrust/growth-yield-batch,jgcobb3/growth-yield-batch,jgcobb3/growth-yield-batch,jgcobb3/growth-yield-batch,jgcobb3/growth-yi... | scripts/postproc/graph_growonly.r | scripts/postproc/graph_growonly.r | library(ggplot2)
library(grid)
library(RSQLite)
runsql <- function(sql, dbname="/home/mperry/Desktop/data.db"){
require(RSQLite)
driver <- dbDriver("SQLite")
connect <- dbConnect(driver, dbname=dbname);
closeup <- function(){
sqliteCloseConnection(connect)
sqliteCloseDriver(driver)
}
dd <- tryCatch... | bsd-3-clause | R | |
6a7e95876a63a76c00af37c6fb3969a67c7ac194 | Create app.r | cenuno/shiny | DT-Download-All-Rows-Button/app.r | DT-Download-All-Rows-Button/app.r | #
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
library( DT )
# Define UI for application that creates a datatables
ui <- fluidPage(
# Appl... | mit | R | |
2be0b170ee839737a9b80476506598bdb8eb29e7 | 更新:第七章fig7-24 | shuaimeng/r | thesis/chap7/fig7-24.r | thesis/chap7/fig7-24.r | dyn.load('/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/server/libjvm.dylib')
library(rJava)
setwd("/Users/mengmengjiang/all datas/print")
library(xlsx)
# reading repeart
#k1<-read.xlsx("repert.xlsx",sheetName="600",header=TRUE)
k1<-read.xlsx("repert.xlsx",sheetName="600",header=TRUE)
k2<... | mit | R | |
019b9d73b5499cf869dbd3c5af5ba294eec2eba0 | Solve Extremely Basic in r | deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playgr... | solutions/uri/1001/1001.r | solutions/uri/1001/1001.r | input <- file('stdin', 'r')
a <- as.integer(readLines(input, n=1))
b <- as.integer(readLines(input, n=1))
soma = a + b
write(paste("X =", soma), '')
| mit | R | |
467699c21db930f71be8ee73cb88d1a1e58a1b19 | Create saveInFile.r | jluzuria2001/codeSnippets,jluzuria2001/codeSnippets,jluzuria2001/codeSnippets,jluzuria2001/codeSnippets | saveInFile.r | saveInFile.r | # Export a matrix object to .txt file
write.table(mat, file="mymatrix.txt", row.names=FALSE, col.names=FALSE)
| mit | R | |
50df7f307d2fa2b224f027c06e32a5f1e027695a | Create diagnostic.r | Sokel/R-shchu | diagnostic.r | diagnostic.r |
data(swiss)
str(swiss)
pairs(swiss)
library(ggplot2)
ggplot(swiss, aes(x = Examination, y = Education))+
geom_point()+
theme(axis.text = element_text(size = 25),
axis.title =element_text(size = 25, face = 'bold'))
library(ggplot2)
ggplot(swiss, aes(x = Examination, y = Education))+
geom_point()+
th... | apache-2.0 | R | |
c996ac80069f4b51ff9aa72d2945e1c79f238be7 | Add new way to look at NDCG5 with R | davidgasquez/kaggle-airbnb | snippets/ndcg.r | snippets/ndcg.r | # This R script is based on indradenbakker's R script
# I customized eval_metric ndcg5 so that it is much easier to monitor ndcg value.
# load libraries
library(xgboost)
library(readr)
library(stringr)
library(caret)
library(car)
set.seed(1)
# load data
df_train = read_csv("datasets/raw/train_users.csv")
df_test = ... | mit | R | |
f8b865e64dba836ed1a8c52018148620f10f3016 | Add data example | tisp-lang/tisp,tisp-lang/tisp,raviqqe/tisp,raviqqe/tisp,raviqqe/tisp | examples/data.r | examples/data.r | ; Dictionary
(let d {"foo" 1 "bar" 2})
; Set
(let s '{1 2 3})
; List
(let l [1 2 3])
; Array?
(let l '[1 2 3])
| mit | R | |
f3041b4e33c159aa5585213c73a3876be9d0c25f | Create bay_area.r | sequenceiq/r_datagen | clustering/bay_area.r | clustering/bay_area.r | multiplier<-1
#Sunnyside, 6h, 12h and 18h clusters, #250000
#location
n1<-250
dev<-0.02
x<-c(rnorm(n1,mean=37.72891,sd=dev))
y<-c(rnorm(n1,mean=-122.44503,sd=dev))
#datetime
start<-as.POSIXct(strptime("2014/01/01", "%Y/%m/%d"))
end<-as.POSIXct(strptime("2014/02/28", "%Y/%m/%d"))
dt=end-start
dd<-dt/2
t<-c(start+rnor... | apache-2.0 | R | |
f5d22e24f5c06375116b717163eda8709fa8b362 | Add “fonts” module to register fonts | klmr/ggplots | fonts.r | fonts.r | extrafontdb_path = try(system.file('metrics', package = 'extrafontdb', mustWork = TRUE), silent = TRUE)
# FIXME: Make this work with un-gzipped font metrics as well.
# FIXME: Make this work with incomplete fonts.
complete_font_set = paste0(c('-Regular', '-Bold', '-Italic', '-BoldItalic'), '.afm.gz')
rebuild_cache = fu... | apache-2.0 | R | |
e1af5139381422311d04b259325bce96b41b1a8a | Create test.r | IceAgeEcologist/Paleoecology-R-Labs | test.r | test.r | #Test file for importing to RStudio
source(bacon)
| mit | R | |
1767b5232adb0dea77326f8e0f5959736dc98dcb | Create Multiple_Regression_Model_Analysis.r | lancezlin/Applied_Linear_Model_with_R | Multiple_Regression_Model_Analysis.r | Multiple_Regression_Model_Analysis.r | #####################################################################
###### Applied Linear Model ######
#####################################################################
library("alr3")
###############
#A data frame with 32 observations on 11 variables in mtcars
#[, 1] mpg Miles/(US)... | mit | R | |
85586cee79ee8b2504af09a632588eb4d2a7b33d | Add r source | waps12b/celebrity_grading,waps12b/celebrity_grading,waps12b/celebrity_grading,waps12b/celebrity_grading | r/dm.r | r/dm.r | install.packages("RMySQL")
install.packages("plyr")
library(RMySQL)
library(plyr)
Sys.setenv("plotly_username"="clacis91")
Sys.setenv("plotly_api_key"="oYTo6pz0Zw8YnT0sYgqu")
con <- dbConnect(MySQL(), user="datamining", password="dm2016", dbname="celebrity_grading", host="codingmonster.net", port=3306)
dbLis... | mit | R | |
733cef8b44eea2df56b7094499d48e48575dd205 | Create check_for_seq.r | vlulla/data.table,jangorecki/data.table,Rdatatable/data.table,vlulla/data.table,Rdatatable/data.table,Rdatatable/data.table,vlulla/data.table,jangorecki/data.table,vlulla/data.table,jangorecki/data.table,Rdatatable/data.table,jangorecki/data.table | R/check_for_seq.r | R/check_for_seq.r | ## This file contains
## check_for_seq() and convert_to_col_number_and_check_valid()
## for allowing .SDcols='b':'d' and/or by='g':'k'
##
## Todo: Test against unquoted column names
## can NOT yet handle nested functions,
## such as c('b':'d') or do.call(paste, list("V", c(3, 7)))
check... | mpl-2.0 | R | |
30f31e11a2778b956de8193ad2011cef24c385aa | Create info.r | SuriyaaKudoIsc/wift,SuriyaaKudoIsc/wift | system/info.r | system/info.r | REBOL [
Title: "Wift System Informations"
Author: "Suriyaa Kudo"
File: %info.r
Tabs: 4
Rights: "Copyright (C) 2015-present Suriyaa Kudo. All rights reserved."
License: "GNU - https://github.com/SuriyaaKudoIsc/wift/blob/trunk/LICENSE.md"
]
| bsd-2-clause | R | |
5b97c663453af9e1f034de98713191e352b60a28 | Create ui.r | mmjazzar/Load_dashboard,mmjazzar/TimeSeries_Forecasting | ui.r | ui.r | apache-2.0 | R | ||
2ef01d1fa262cb44a981fffa236e0be0e4193acd | Create error.r | bgweber/RServer,bgweber/RServer,bgweber/RServer,bgweber/RServer | tasks/userDemo/error.r | tasks/userDemo/error.r | warning("This is a warning!")
stop("This is an error!")
| bsd-3-clause | R | |
d4255c8882c4978d3186d8cbd9f6bded00378a58 | 更新:第六章fig6-9 | shuaimeng/r | thesis/chap6/fig6-9.r | thesis/chap6/fig6-9.r | dyn.load('/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/server/libjvm.dylib')
setwd("/Users/mengmengjiang/all datas/voltage")
##raeding datas of flow rates
eq<-read.xlsx("voltage.xls",sheetName="ethanol_q",header=TRUE)
aq<-read.xlsx("voltage.xls",sheetName="acetone_q",header=TRUE)
iq<-read... | mit | R | |
c5c4e65b29fa005b769bb09291515bd50440d557 | Add function to plot all inclinations in one facet | gadomski/rivlib-utils | scripts/chart-inclinations.r | scripts/chart-inclinations.r | library(ggplot2)
library(reshape2)
library(plyr)
filenames <- c(
"Zuma/140117_160540_inclinations.txt",
"Zuma/140117_163141_inclinations.txt",
"Zuma/140123_202748_inclinations.txt",
"Zuma/140201_185848_inclinations.txt",
"Zuma/140226_163837_inc... | library(ggplot2)
library(reshape2)
filenames <- c(
"Zuma/140117_160540_inclinations.txt",
"Zuma/140117_163141_inclinations.txt",
"Zuma/140123_202748_inclinations.txt",
"Zuma/140201_185848_inclinations.txt",
"Zuma/140226_163837_inclinations.txt"... | mit | R |
edc74e497650d1b3255c2278dafa207845b8ff72 | Create compute.gen.cpp.r | perdumonocle/neuralnet2cpp | compute.gen.cpp.r | compute.gen.cpp.r | compute.gen.cpp <-
function (x, path, rep = 1, float.type = "double", namespace = TRUE)
{
fd = file( path, open = "wt" );
nn <- x
linear.output <- nn$linear.output
weights <- nn$weights[[rep]]
nrow.weights <- sapply( weights, nrow )
ncol.weights <- sapply( weights, ncol )
length.weights <-... | mit | R | |
8edab0602a2fc106d6a7bc0ac98ed75797de12ef | Add notebook example | antoyo/relm,antoyo/relm | examples/tabs.rsx | examples/tabs.rsx | /*
* Copyright (c) 2017 Boucher, Antoni <bouanto@zoho.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy,... | mit | R | |
82ec987d7adbcbe530b046f094fe3d6c3cc4bbdd | Create analiza.3.faza.r | rozmanU14/APPR-2015-16,rozmanU14/APPR-2015-16 | analiza.3.faza.r | analiza.3.faza.r | mit | R | ||
23fe2b0d3a308a7678a2af6ffbc23f42987e50a0 | Create rlibrary_dependency.r | oltkkol/vmod | rlibrary_dependency.r | rlibrary_dependency.r | rlibrary <- function(libraryName, fInstall = NULL){
prequire <- function() return(require(libraryName, character.only=T))
if (prequire() == F){
if (is.function(fInstall)){
fInstall()
}else{
install.packages(libraryName)
}
library(libraryName, character.only=T)
}
}
| mit | R | |
cbfe48c6081622cad5900ed15c8ba80d009b28b9 | Create dataVisualisation.r | svobodam/Deep-Learning-Text-Summariser,svobodam/Deep-Learning-Text-Summariser,svobodam/Deep-Learning-Text-Summariser | dataVisualisation/dataVisualisation.r | dataVisualisation/dataVisualisation.r | # Script to perform data visualisation
# All visualise stored in dataVisualisation/Plots
# Load required libraries
library(wordcloud)
library(ggplot2)
library(SnowballC)
library(plyr)
library(RColorBrewer)
library(sentimentr)
library(tm)
library(data.table)
# ***Functions***
# Sentiment Analysis
# return sentiment
s... | mit | R | |
ca8473f38cb6ce0f984dfd0f95a398ae4ee8beae | Fix qsort for 32-bit systems | hostilefork/rebol,draegtun/ren-c,kealist/ren-c,draegtun/ren-c,hostilefork/rebol,kealist/ren-c,draegtun/ren-c,mbk/ren-c,hostilefork/rebol,codebybrett/ren-c,hostilefork/rebol,rgchris/ren-c,hostilefork/rebol,draegtun/ren-c,codebybrett/ren-c,codebybrett/ren-c,giuliolunati/ren-c,codebybrett/ren-c,kealist/ren-c,rgchris/ren-c... | make/tests/qsort.r | make/tests/qsort.r | REBOL []
recycle/torture
i386?: 4 = fifth system/version
f: func [
a [integer!] "pointer to an integer"
b [integer!] "pointer to an integer"
][
i: make struct! compose/deep [
[raw-memory: (a)]
int32 i
]
j: make struct! compose/deep [
[raw-memory: (b)]
int32 i
]... | REBOL []
recycle/torture
f: func [
a [integer!] "pointer to an integer"
b [integer!] "pointer to an integer"
][
i: make struct! compose/deep [
[raw-memory: (a)]
int32 i
]
j: make struct! compose/deep [
[raw-memory: (b)]
int32 i
]
case [
i/i = j/i [0]... | apache-2.0 | R |
6fbd8956b70a0ca4c515ed6ebf43041f3408d9bb | Add a testing file for Windows | draegtun/ren-c,mbk/ren-c,draegtun/ren-c,kealist/ren-c,codebybrett/ren-c,giuliolunati/ren-c,giuliolunati/ren-c,hostilefork/rebol,draegtun/ren-c,hostilefork/rebol,rgchris/ren-c,rgchris/ren-c,rgchris/ren-c,mbk/ren-c,kealist/ren-c,codebybrett/ren-c,rgchris/ren-c,hostilefork/rebol,codebybrett/ren-c,hostilefork/rebol,mbk/ren... | make/tests/ms-drives.r | make/tests/ms-drives.r | REBOL []
msvcrt: make library! %msvcrt.dll
getdrives: make routine! compose/deep [
[return: [uint32]]
(msvcrt) "_getdrives"
]
maps: getdrives
i: 0
while [i < 26] [
unless zero? maps and shift 1 i [
print rejoin [to char! (to integer! #"A") + i ":"]
]
++ i
]
close msvcrt
| apache-2.0 | R | |
fa4ed9b9c63f9fe99058f333bfafaaeef7d5ff5a | Add a test for converting rectypes | mnpopcenter/ripums,mnpopcenter/ripums | tests/testthat/test_convert_rectype.r | tests/testthat/test_convert_rectype.r | context("Converting rectypes")
test_that("Converting rectypes works.",
expect_equal(
ripums:::convert_rectype(
c(`1` = "H", `2` = "P", `3` = "I"),
c(1, 3, 3, 2, 1)
),
c("H", "I", "I", "P", "H")
)
)
| mpl-2.0 | R | |
dc1381c8fea2395f199ec32f2f6e14736c21f7ed | add plot test r | Fougere87/unsec,Fougere87/unsec,Fougere87/unsec | plot_test.r | plot_test.r |
FOLDER = "test_results"
data = read.table("test_results2/clustering.test", header=T, sep="\t")
par(mfrow=c(1,3))
plot(data$intra, main="mean Intra distance", type="l", xlab ="number of cluster")
plot(data$extra, main="exta distance", type="l", xlab ="number of cluster")
plot(data$silhouette, main="Silhouette score"... | unlicense | R | |
7adc3a208aa4cd6d323c8985fd22fae92dc5c5b1 | Create stage_processing.r | dpbroman/floodforecasting | stage_processing.r | stage_processing.r | #######DESCRIPTION###############################
#processes raw stage data from Indian CWC records
#outputs rdata object and csv
#################################################
#load libraries
library(dplyr)
library(data.table)
library(readr)
library(tidyr)
library(ncdf4)
library(tools)
##user inputs
#raw file locat... | mit | R | |
617d3f182aa29f8f79f6b4170d9787aab88cd6f1 | Add R classification template | a-holm/MachinelearningAlgorithms,a-holm/MachinelearningAlgorithms | Classification/LogisticRegression/regularLogisticRegression.r | Classification/LogisticRegression/regularLogisticRegression.r | # Logistic Regression Classification for machine learning.
#
# In statistics, logistic regression, or logit regression, or logit model is a
# regression model where the dependent variable (DV) is categorical. This project
# covers the case of a binary dependent variable—that is, where it can take
# only two values, "0... | mit | R | |
03d89350923dd62978a8c8bad66dafdbe5b52587 | Create rn_map.r | Mazuh/Algs,Mazuh/Algs,Mazuh/MISC-Algs,Mazuh/MISC-Algs,Mazuh/MISC-Algs,Mazuh/Algs,Mazuh/Algs,Mazuh/Algs,Mazuh/MISC-Algs | src/ufrn_tis/scraping_with_silvio/rn_map.r | src/ufrn_tis/scraping_with_silvio/rn_map.r |
# -----------------------------------
# Leitura, Silvio.
library(stringr)
require(rvest) # importa a biblioteca rvest
cidades <- read_html("http://cidades.ibge.gov.br/download/mapa_e_municipios.php?lang=&uf=rn") %>% html_table(fill=TRUE)
base<-data.frame(cidades[[1]][c(1,2,4)]) # Selecionando os dados de interess... | unknown | R | |
a43c93570637e1e39391816d7c63d629ac22fcce | Add summer 2019-19 plot | isithot/isithotrightnow,isithot/isithotrightnow,isithot/isithotrightnow,isithot/isithotrightnow,isithot/isithotrightnow | otherscripts/2018-heatmaps.r | otherscripts/2018-heatmaps.r | library(tidyverse)
library(purrr)
library(jsonlite)
library(lubridate)
library(ggmap)
# extrafont also needed on windows
library(extrafont)
library(here)
stations =
fromJSON(here('www', 'locations.json'), simplifyDataFrame = TRUE) %>%
select(station = id, name, label, lat, lon)
# code percentile ranges as discrn... | mit | R | |
96cca383010f4d79de89a1dbb6dd593219cb7b4f | Create load-mouse-manifest.r | perishky/meffil,perishky/meffil | data-raw/load-mouse-manifest.r | data-raw/load-mouse-manifest.r | ## https://support.illumina.com/array/array_kits/infinium-mouse-methylation-beadchip-kit/downloads.html
## https://support.illumina.com/content/dam/illumina-support/documents/downloads/productfiles/mouse-methylation/Infinium%20Mouse%20Methylation%20v1.0%20A1%20GS%20Manifest%20File.csv
## https://support.illumina.com/co... | artistic-2.0 | R | |
6336b8036472566786734d603505814b1a5faf4f | Solve Average 2 in r | deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playgr... | solutions/uri/1006/1006.r | solutions/uri/1006/1006.r | input <- file('stdin', 'r')
a <- as.double(readLines(input, n=1))
b <- as.double(readLines(input, n=1))
c <- as.double(readLines(input, n=1))
result = sprintf("MEDIA = %.1f", (a * 2.0 + b * 3.0 + c * 5.0) / 10.0)
write(result, "")
| mit | R | |
c22fd486fe7bb29f89ea81a1f731d9bffa4a9065 | Create 2.r | glor/R,glor/R | aufgaben/blatt08/2.r | aufgaben/blatt08/2.r | cm = lm(formula=response~treatment.A+treatment.B+ treatment.A:treatment.B, data + cherry)
fitted.value=fitted(cm)
resid.value=resid(cm)
plot(fitted.value, resid.value)
abline(h=0)
boxplot(resid.value)
#lev = data.frame(res=resid.value, group=rep(c("low.light.c", "low.light.s","mod.light.c","mod.light.s") #falls daten
... | bsd-2-clause | R | |
97b7568f1598aa808f3bfe5113e6e3cb49d92050 | Split evaluation and training code | xuyangkang/MLLab | ANN_Evaluate.r | ANN_Evaluate.r | #!/usr/bin/Rscript
model <- read("model.txt")
layer.size <- model$layer.size
neuron.size <- model$neuron.size
synapse <- model.synapse
pf.in <- file("test-images", "rb")
pf.out <- file("test-labels", "rb")
#check magic
magic <-readBin(pf.in, integer(), 1, endian = "big")
stopifnot(magic == 2051)
magic <-readBin(pf.ou... | mit | R | |
f4739275c366653347f78bb0c0c8fab38bae366f | Create forecast_stage.r | dpbroman/floodforecasting | forecast_stage.r | forecast_stage.r | #######DESCRIPTION###############################
#uses stage-stage fitted rating curves to produce 0-15 day lead
#forecasts of stage
#requires fitted rating curves from stage_ratingcurve_stage_fit.r
#observed stage values
#################################################
##load libraries
library(tools)
library(ncdf4)... | mit | R | |
7f67555554ce7ff21d42a3943cb1785915db5f6b | Create complete.r | evohnave/R-Programming-Course | complete.r | complete.r | complete <- function(directory, id = 1:332) {
## 'directory' is a character vector of length 1 indicating
## the location of the CSV files
## As before, we assume the directory is a sub-directory
## of the working directory, getwd()
## 'id' is an integer vector indicating the monitor ID numbers
## to... | unlicense | R | |
99edb7ce127b8156c5f04ffeaa6d59e5b43fca75 | Create activeH5.r | ActiveAnalytics/activeH5-dataframe-bench,ActiveAnalytics/activeH5-dataframe-bench | activeH5.r | activeH5.r | # Benchmark code for reading/writing data frames from/to HDF5 files using activeH5 package
# Load the data set from CSV file
data_path <- "../data/2007.csv"
system.time(dat <- read.csv(data_path))
# Load the activeH5 package
require(activeH5)
# Prepare the file
system.time(h5DAT <- newH5DF(dat, filePath = h5_file))
... | mit | R | |
758953a33faf72c22fb3e459fd4ab675e914fa58 | Create Variable2Factor.r | jluzuria2001/codeSnippets,jluzuria2001/codeSnippets,jluzuria2001/codeSnippets,jluzuria2001/codeSnippets | Variable2Factor.r | Variable2Factor.r | #sample data
myData <- data.frame(A=rep(1:2, 3), B=rep(1:3, 2), Pulse=20:25)
#convert variables to factors
myData$A <- as.factor(myData$A)
myData$B <- as.factor(myData$B)
#see our data
myData
#calcs over out data
mean(myData$A, na.rm=TRUE)
#see our levels
myData$B
#define levels with a specific name
levels(myData$... | mit | R | |
2774ef082a6933402b8f203e841c057b40ca004c | Create nominateVars.r | Sokel/R-shchu | nominateVars.r | nominateVars.r |
df <- read.csv("grants.csv")
str(df)
df$status <- as.factor(df$status)
levels(df$status) <- c("Not Funded", "Funded")
df$status <- factor(df$status, labels = c("Not Funded", "Funded"))
# 1d Table
t1 <- table(df$status)
t1
dim(t1)
# 2d Table
t2 <- table(df$status, df$field)
t2
t2 <- table(status = df$status, fiel... | apache-2.0 | R | |
5f699cd7a8d553e876e412f96b8220dfa03465d1 | 更新:第六章fig6-4 | shuaimeng/r | thesis/chap6/fig6-4.r | thesis/chap6/fig6-4.r | dyn.load('/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/server/libjvm.dylib')
setwd("/Users/mengmengjiang/all datas/voltage")
library(xlsx)
# 32G 0+2kv 18nl/min
x<-c(2,2.5,3,3.5,4)
y0<-c(33/60,33/60,33.4/60,34/60,34/60)
y1<-c(34/60,35/60,34.5/60,34.5/60,35/60) # 32G,0+2kv,18nl/min
y2<-c... | mit | R | |
17ba6b286d2d8a6a506157a23f132487c1055420 | Create sunnyside.r | sequenceiq/r_datagen | clustering/sunnyside.r | clustering/sunnyside.r | #Sunnyside, 6h, 12h and 18h clusters, #250000
#location
n1<-250
multiplier<-1
dev<-0.02
x<-c(rnorm(n1,mean=37.72891,sd=dev))
y<-c(rnorm(n1,mean=-122.44503,sd=dev))
#datetime
start<-as.POSIXct(strptime("2014/01/01", "%Y/%m/%d"))
end<-as.POSIXct(strptime("2014/02/28", "%Y/%m/%d"))
dt=end-start
dd<-dt/2
t<-c(start+rnorm... | apache-2.0 | R | |
9f09de1c71f32a48977e35a6baa40d59667e44ad | test for strategy arguments of primitives | lichtemo/strategoxt,lichtemo/strategoxt,lichtemo/strategoxt,lichtemo/strategoxt,metaborg/strategoxt,lichtemo/strategoxt,Apanatshka/strategoxt,metaborg/strategoxt,metaborg/strategoxt,metaborg/strategoxt,Apanatshka/strategoxt,Apanatshka/strategoxt,metaborg/strategoxt,Apanatshka/strategoxt,Apanatshka/strategoxt | strc/spec/test1/test48.r | strc/spec/test1/test48.r | module test48.r
strategies
ALL(s) =
?t; prim("SRTS_all", s | t)
main =
ALL(id) | apache-2.0 | R | |
3771244dc32b0e5b035ef22d1c5a394cb2422868 | Add slurm-container.r | jmousseau/Stain | R/slurm-container.r | R/slurm-container.r | #' SlurmContainer R6 object.
#'
#' A slurm container is simply a directory with a specific
#' structure, particulary it has a submit.slurm script at the
#' top level.
SlurmContainer <- R6::R6Class("SlurmContainer",
public = list(
dir = NULL,
initialize = function(dir = ".") {
name <- pas... | mit | R | |
d7f294ee0c088f1f066c7d3585e0cd7e3dc800e0 | Create dialplot.r | nairvinayv/random_scripts,nairvinayv/random_scripts | dialplot.r | dialplot.r | library(plotrix)
data<-read.csv('15T-epsilon.dat')
setEPS()
png("15T-epsilon.png")
polar.plot(data[1:14999,1],data[1:14999,2],rp.type="p",start=90,clockwise=TRUE,main=expression(paste("Torsion Angles: 1,5T-",epsilon)))
dev.off()
| mit | R | |
a2f8483962e9e342db0d959d926c231b0671a67f | Create assort.r | maggiecrow/scCoexp,maggiecrow/scCoexp | assort.r | assort.r | assortativity <- function(network){
diag(network) = 0
node_degree=rowSums(network)}
# Weighted network
indices = which(!is.na(network), arr.ind=T )
w = network[indices]/ sum(network[indices])
x = node_degree[indices[,1]] - sum( node_degree[indices[,1]] * w )
y = n... | mit | R | |
5669d796c059e371a522a33063149c068a056d63 | Create app.r | suraj-deshmukh/myCodes,suraj-deshmukh/myCodes,suraj-deshmukh/myCodes | ml-ui/app.r | ml-ui/app.r | source("packages.r")
source("ui.r")
source("server.r")
shinyApp(ui,server)
| mit | R | |
fef20337ad7ecf15b73eebc087e249e5848ae268 | Remove a currently broken test. | qinwf/r-travis,hadley/r-travis,eddelbuettel/r-travis,qinwf/r-travis,robzhu/r-travis,craigcitro/r-travis,hadley/r-travis,craigcitro/r-travis,eddelbuettel/r-travis,robzhu/r-travis | fakepackage/inst/tests/test-fakepackage.r | fakepackage/inst/tests/test-fakepackage.r | context("fake")
test_that("returns 3", {
expect_equal(3, three())
})
test_that("is_three recognizes 3", {
expect_that(is_three(3), is_true())
expect_that(is_three(5), not(is_true()))
expect_that(is_three(5), is_false())
})
| context("fake")
# We want to make sure these installed.
library(lubridate)
library(stringr)
test_that("returns 3", {
expect_equal(3, three())
})
test_that("is_three recognizes 3", {
expect_that(is_three(3), is_true())
expect_that(is_three(5), not(is_true()))
expect_that(is_three(5), is_false())
})
| apache-2.0 | R |
2a30747ad73e842b479bf0927afdf3c42297530d | Create propVarPlot.r | pmb59/KLTepigenome,pmb59/KLTepigenome | propVarPlot.r | propVarPlot.r | artistic-2.0 | R | ||
a81d843a855360155cef670cca12eff3d309ae47 | check doubletfinder result | shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl,shengqh/ngsperl | lib/scRNA/seurat_doublet_check.r | lib/scRNA/seurat_doublet_check.r | source("scRNA_func.r")
library(Seurat)
library(ggplot2)
library(ggpubr)
library(cowplot)
library(scales)
library(stringr)
library(htmltools)
library(patchwork)
options(future.globals.maxSize= 10779361280)
options_table<-read.table(parSampleFile1, sep="\t", header=F, stringsAsFactors = F)
myoptions<-split(options_tabl... | apache-2.0 | R | |
a09a26c8a2e13154f643a978998bc34ab25e5105 | Create simpolnor.r | Sabertn/Simulation | simpolnor.r | simpolnor.r | # function to generate standard normal using the Polar method
simnormpolar <- function(n.gen){
sim.vector <- rep(0,n.gen)
for (i in 1:n.gen){
urandom <- runif(2)
v1 <- 2*urandom[1]-1; v2 <- 2*urandom[2]-1
s <- v1^2 + v2^2
while(s > 1){
urandom <- runif(2)
v1 <- 2*urandom[1]-1; v2 <- 2*ur... | mit | R | |
6dfa61292aa0dc9bd50d3b11244ff2a50d2fe37e | Create convert_lfmm.r | jdmanthey/conversion_files | convert_lfmm.r | convert_lfmm.r | convert_lfmm <- function(file) {
file <- file
x <- read.table(file, sep = "\t")
# remove the population identification column or not
if (is.na(x[1, 2]) == TRUE) {
x <- cbind(x[,1], x[,3:ncol(x)])
}
snp.names <- as.character(x[1,2:ncol(x)])
x <- x[2:nrow(x),]
bi_allelic <- c()
for(a in 2:ncol(x)) { ... | bsd-3-clause | R | |
ed5b17b75b4a5cc2c5aa14cc21b9422d2db3c45c | Create gem.r | geb5101h/riddler_gem | gem.r | gem.r | library(magrittr)
a=1/2
b=1/3
c=1/6
Ea = (1+1/(1-a)
+b*(1/c)*(a/(a+b))
+c*(1/b)*(a/(a+c)))
Eb = (c*1/a + a*(1+(1/c)*a/(a+b)) )/(1-b)
Ec=(b*1/a + a*(1+(1/b)*a/(a+c)) )/(1-c)
a*Ea+b*Eb+c*Ec
gemCountSim<- function(){
vecCount = c(0,0,0)
while(TRUE){
draw = rmultinom(1,1,c(1/2,1/3,1/6))%>%as.vector
vecCount = vecC... | mit | R | |
4947f725b850841caa4bc07159956a509d4aa951 | Add the analysis engine | dennisaldea/genetic-heatmaps,dennisaldea/genetic-heatmaps | analysis-engine.r | analysis-engine.r | #!/usr/bin/env Rscript
#===============================================================================
# TITLE : analysis-engine.r
# ABSTRACT : An R script that combines RNA-seq files and ChIP-seq gene lists to
# generate combined gene activity CSV files
#
# AUTHOR : Dennis Aldea <dennis.aldea@gmail.c... | mit | R | |
aa009fe1c47e128096f1bbf4cf91dffd48060203 | Add files via upload | GalDrnovsek/Fuzbal | uvoz.r | uvoz.r | require(dplyr)
require(rvest)
require(gsubfn)
library(reshape2)
library(ggplot2)
url <- "http://www.betstudy.com/soccer-stats/c/england/premier-league/"
stran <- html_session(url) %>% read_html(encoding="UTF-8")
tab <- stran %>% html_nodes(xpath ="//table[1]") %>% .[[4]]
tabela <- tab %>% html_table()
ek... | mit | R | |
62bd52023ae415da61c776bc529617e5718bc95b | Add work-in-progress R code for generating ORES before-after plots | alpha721/WikiEduDashboard,majakomel/WikiEduDashboard,alpha721/WikiEduDashboard,majakomel/WikiEduDashboard,majakomel/WikiEduDashboard,alpha721/WikiEduDashboard,KarmaHater/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,KarmaHater/WikiEduDashboard,WikiEducationFoundation... | docs/analytics_scripts/ores_changes.r | docs/analytics_scripts/ores_changes.r | require('ggplot2')
require('dplyr')
csv_path <- '/home/sage/play/ores-changes/spring_2017-articles-2017-09-14.csv'
# csv_path <- '/home/sage/play/ores-changes/visiting_scholars-articles-2017-09-15.csv'
campaign_data <- read.csv(csv_path)
campaign_data$ores_diff <- with(campaign_data, ores_after - ores_before)
# All a... | mit | R | |
227b3c813ac3d6e0046fa588fa37e9870f850b26 | Create vennDiagram.r | crazyhottommy/some-unorganized-old-scripts,crazyhottommy/some-unorganized-old-scripts,crazyhottommy/some-unorganized-old-scripts | R_scripts/vennDiagram.r | R_scripts/vennDiagram.r | # VennDiagram
library("VennDiagram")
venn.plot <- draw.pairwise.venn(area1=42381, area2=3699, cross.area= 866, category=c("GATA3 binding sites","LSD1 binding sites"), fill=c("red","blue"), cex=1, cat.cex=1, cat.prompts=TRUE, cat.dist=c(-0.06,-0.06))
grid.draw(venn.plot)
| mit | R | |
77e7b94e497f467cec07013e31fe825b952ddc8a | Create Main.r | bgweber/RServer,bgweber/RServer,bgweber/RServer,bgweber/RServer | tasks/HelloWorld/Main.r | tasks/HelloWorld/Main.r | cat("Hello World!")
| bsd-3-clause | R | |
e9e86f98035d0cbcc6344341deeae3c94c476627 | remove message & clean up | jae0/bio.snowcrab,jae0/bio.snowcrab | R/snowcrab_landings.db.r | R/snowcrab_landings.db.r | snowcrab_landings_db = function ( ) {
# glue historical data with marfis data
threshold.year = 2004
b = logbook.db( DS="logbook" ) # modern data: mass in kg -- must use all data and not postionally filtered data to get accurate totals
# message( "Note:: Fishing 'yr' for CFA 4X has been set to st... | mit | R | |
8bf0717f872baa73bc75fbf3c8b2e268ffb3dff8 | Create README.rd | gem/oq-engine,luisera/hmtk,gem/oq-engine,g-weatherill/hmtk,gem/oq-engine,gem/oq-hazardlib,gem/oq-engine,gem/oq-engine,g-weatherill/hmtk,gem/oq-hazardlib,luisera/hmtk,g-weatherill/hmtk,gem/oq-hazardlib | hmtk/seismicity/occurrence/README.rd | hmtk/seismicity/occurrence/README.rd | Occurrence
=====
The occurrence module contains methods for the calculation of the
parameters charaterising magnitude-frequency distributions widely
used in seismic hazard analysis.
| agpl-3.0 | R | |
63e0c330e6f64b4df34f9252c06e5de4d214cd56 | Create LogParser.r | bgweber/RServer,bgweber/RServer,bgweber/RServer,bgweber/RServer | tasks/RServerTasks/LogParser.r | tasks/RServerTasks/LogParser.r |
if ("DT" %in% rownames(installed.packages()) == FALSE) {
install.packages("DT", repos='http://cran.us.r-project.org')
}
library(DT)
loadTaskData <- function(daysHistory = 60) {
events <- data.frame()
for (file in list.files("C:/wamp/www/RServer/logs", full.names = TRUE)) {
date <- as.Date(strspli... | bsd-3-clause | R | |
143789be2ddccc2678bf212811c3784a3057ce24 | add postgres compatible plotting script | PolyJIT/benchbuild,PolyJIT/benchbuild,PolyJIT/benchbuild,PolyJIT/benchbuild | pjit-r/pprof-sql.r | pjit-r/pprof-sql.r | library(RPostgreSQL)
library(ggplot2)
library(reshape)
library(scales)
plot_experiment <- function(experiment, connection) {
cat(experiment)
rt_query <- sprintf(paste("SELECT project_name, region, metric, SUM(value) ",
"FROM public.run, public.likwid ",
"WHER... | mit | R | |
faec12cf534680b6d3afd0d84a3e8f3fb9e8112f | Add enhanced colon operator to R | klmr/.files,klmr/.files,klmr/.files | .R/colon.r | .R/colon.r | `:` = function (a, b) {
if (inherits(a, 'xrange'))
do.call(seq, as.list(c(range(a), by = b)))
else if (inherits(a, 'factor'))
interaction(a, b, sep = ':')
else
structure(seq(a, b), class = 'xrange')
}
print.xrange = function (x)
print(as.numeric(x))
| apache-2.0 | R | |
3d5400edf91c4526f7996c14b3f620a2acb793fc | add code for filters coefficients to sdr_transceiver | pavel-demin/red-pitaya-notes,pavel-demin/red-pitaya-notes,pavel-demin/red-pitaya-notes,pavel-demin/red-pitaya-notes,fbalakirev/red-pitaya-notes,pavel-demin/red-pitaya-notes,fbalakirev/red-pitaya-notes,fbalakirev/red-pitaya-notes,pavel-demin/red-pitaya-notes,fbalakirev/red-pitaya-notes,pavel-demin/red-pitaya-notes,fbala... | projects/sdr_transceiver/filters/fir_0.r | projects/sdr_transceiver/filters/fir_0.r | library(signal)
# CIC filter parameters
R <- 50 # Decimation factor
M <- 1 # Differential delay
N <- 6 # Number of stages
Fo <- 0.22 # Pass band edge
# fir2 parameters
k <- kaiserord(c(Fo, Fo+0.02), c(1, 0), 1/(2^16), 1)
L <- ... | mit | R | |
2ddec57396ef86ffa0065eba759542c98ee3926a | add package docs | RBigData/pbdDEMO,snoweye/pbdDEMO,RBigData/pbdDEMO,wrathematics/pbdDEMO,RBigData/pbdDEMO,wrathematics/pbdDEMO,snoweye/pbdDEMO,wrathematics/pbdDEMO,snoweye/pbdDEMO | R/pbdDEMO-package.r | R/pbdDEMO-package.r | #' Demonstrations and Examples for the pbd Project
#'
#' Demos
#'
#' \tabular{ll}{ Package: \tab pbdDMAC\cr Type: \tab Package\cr License: \tab
#' GPL\cr LazyLoad: \tab yes\cr } This package requires an MPI library
#' (OpenMPI, MPICH2, or LAM/MPI).
#'
#' @name pbdDEMO-package
#' @docType package
#' @author Drew Schm... | mpl-2.0 | R | |
2dd6279620ed083e38f925a4b212452582be7cb3 | Add Random Forest Regression in R | a-holm/MachinelearningAlgorithms,a-holm/MachinelearningAlgorithms | Regression/RandomForestRegression/regularRandomForestRegression.r | Regression/RandomForestRegression/regularRandomForestRegression.r | # Random Forest Regression for machine learning.
#
# Random forest algorithm is a supervised classification algorithm. As the name
# suggest, this algorithm creates the forest with a number of decision trees.
#
# In general, the more trees in the forest the more robust the forest looks like.
# In the same way in the ... | mit | R | |
42caf3975f0a75ad2205fec930056f5f58dfcb4a | Add missing test module | klmr/modules,klmr/modules | inst/tests/modules/c.r | inst/tests/modules/c.r | import(a, attach = TRUE)
double = function (x) c(x, x)
indirect_counter = function () get_counter()
| apache-2.0 | R | |
3bac757565f7fa07513c9382d61eff172a90a3da | add r script | STT2810-ASU/STT2810ClassRepoSP15,kenleyplott/STT2810ClassRepo,meganclarke/STT2810ClassRepo,meganclarke/STT2810ClassRepo,STT2810-ASU/STT2810ClassRepoSP15,kenleyplott/STT2810ClassRepo,aimeesinclair/STT2810ClassRepo,STAT-ATA-ASU/STT2810ClassRepo,rachaelgossett/STT2810ClassRepo,rachaelgossett/STT2810ClassRepo,mningle/STT28... | week06/hist.r | week06/hist.r | hist(rnorm(10000), col = "red") | mit | R | |
5d31e5564b6c05a619591b3e6e2710c1f5ea0bea | Create plotSTR.r | DrewWham/Genetic-Structure-Tools | plotSTR.r | plotSTR.r | #function for extracting the cluster Probs, requires STR infile because STRUCTURE likes to chop off the ends of your sample names so I have to use your original file to get your original names
read.STR<-function(STR.in,STR.out){
#read in data
str<-read.table(STR.in,skip=1)
str.out<-readLines(STR.out)
#the next part pa... | apache-2.0 | R | |
1a597c519805c979b4cd0db31cc823c632e502d6 | Create diagnostic2.r | Sokel/R-shchu | diagnostic2.r | diagnostic2.r |
df <- read.csv("train.csv", sep=";")
ggplot(df, aes(read, math, col = gender))+
geom_point()+
facet_grid(.~hon)+
theme(axis.text=element_text(size=25),
axis.title=element_text(size=25, face="bold"))
fit <- glm(hon~read + math + gender, df, family = "binomial")
summary(fit)
exp(fit$coefficients)
head(... | apache-2.0 | R | |
8f41df179d51f8a9b383921e5fbd24d873aca45e | Add cachedRedshiftQuery function | daigotanaka/r-utils | cached_redshift_query.r | cached_redshift_query.r | # Caches the query result in rds file under `getwd()`/redshift_cache.
# It assumes
# redshiftJdbcURL
# redshiftJdbcPort
# redshiftDatabase
# redshiftUsername
# redshiftPassword
# variables in the env.
# Remove the cache files if the update value is needed.
# Expire:
# positive integer n: Expire ... | mit | R | |
bb8561921bf2a02c3b508cf2999f5a161c4fc249 | Create simpleStatistics.r | Sokel/R-shchu | simpleStatistics.r | simpleStatistics.r |
?mtcars
df <- mtcars
str(df)
# creating factor about num
df$vs <- factor(df$vs, labels=c("V", "S"))
df$am <- factor(df$am, labels=c("Auto", "Manual"))
# simple static functions
median(df$mpg)
mean(df$disp)
sd(df$hp)
range(df$cyl)
mean_disp <-mean(df$disp)
print(mean_disp)
# example 1
mean(df$mpg[df$cyl == 6... | apache-2.0 | R | |
0c990ac141eb64b25c1b8633f2bd4d295ce1e3e9 | save R | brkyvz/git-rest-api | notebooks/rNotebook.r | notebooks/rNotebook.r | # Databricks notebook source exported at Thu, 11 Jun 2015 17:14:08 UTC
1 + 1
# COMMAND ----------
| apache-2.0 | R | |
71e374ee72a80d6e769012d08eba6f9dd686518b | Add charting script | gadomski/rivlib-utils | scripts/chart-inclinations.r | scripts/chart-inclinations.r | library(ggplot2)
library(reshape2)
filenames <- c("140123_202748_inclinations.txt",
"140201_185848_inclinations.txt",
"140226_163837_inclinations.txt")
FILENAME_INDEX <- 3
inclinations <- read.csv(paste0("~/Code/rivlib-development/data/Zuma/", filenames[FILENAME_INDEX]))
inclinations <- ... | mit | R | |
5de590b4c62e5b856eede0b716c4c0edf4725ea6 | Update and rename R to R/teradata.query.r | xiaodaigh/teradata.dplyr | R/teradata.query.r | R/teradata.query.r | Teradata.Query <- R6::R6Class("Teradata.Query",
private = list(
.nrow = NULL,
.vars = NULL
),
public = list(
con = NULL,
sql = NULL,
... | mit | R | |
3b9cddd1d5f1cd3c7c2aab1b0d895864d2115c6c | Add littler script to actually run update | hadley/crantastic,tenforwardconsulting/crantastic,tenforwardconsulting/crantastic,tenforwardconsulting/crantastic,hadley/crantastic,tenforwardconsulting/crantastic,hadley/crantastic | lib/r/run-update.r | lib/r/run-update.r | #!/usr/bin/r
source("update.r")
update.packages() | mit | R | |
0c416b98c081e04f2e999f0ea03199bf5294319b | Create contributions.rd | labidiaymen/nodejs-tn,labidiaymen/nodejs-tn | projects/contributions.rd | projects/contributions.rd | mit | R | ||
f0e63491abce9012a52b64aad21f76be0c6d1e38 | Create movement.r | phase/refract,phase/refract | examples/movement.r | examples/movement.r | v; <^
> z
< ^ ^<
| mit | R | |
dce62753db135a1aa27dc4af62e59cd6f8d7555c | Add generative CRP. | jtobin/bnp | chinese-restaurant-process/src/crp.r | chinese-restaurant-process/src/crp.r | crp = function(n, a) {
restaurant = data.frame(table = 1, customers = 1)
for (j in seq(n - 1)) {
restaurant = arrival(restaurant, a)
}
restaurant
}
arrival = function(r, a) {
p = 1 - a / (sum(r$customers) + a)
if (rbinom(1, 1, p)) {
join_table(r, a)
} else {
start_table(r)
}
}
jo... | mit | R | |
786b0d61a3eb60a796fc96865c461f9fff35e2f8 | Create forecast_discharge.r | dpbroman/floodforecasting | forecast_discharge.r | forecast_discharge.r | #######DESCRIPTION###############################
#uses stage-stage fitted rating curves to produce 0-15 day lead
#forecasts of stage
#requires fitted rating curves from stage_ratingcurve_stage_fit.r
#observed stage values
#################################################
##load libraries
library(tools)
library(ncdf4)... | mit | R | |
dd2b37a81f3120999fd067628d51028e0c60f9c9 | Create satprcp_processing.r | dpbroman/floodforecasting | satprcp_processing.r | satprcp_processing.r | #######DESCRIPTION###############################
#processes raw merged satellite precipitation from NCAR
#TRMM + CMORPH + GsMAP
#outputs rdta object and csv
#################################################
##load libraries
library(dplyr)
library(data.table)
library(readr)
library(tidyr)
library(ncdf4)
list.dirs = fun... | mit | R |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.