arxiv_id stringlengths 0 16 | text stringlengths 10 1.65M |
|---|---|
2011.11210 | \section{Introduction}
\label{s:intro}
The demand for automatic modeling of city-scale urban environments has recently attracted increasing interest \citep{remondino2017critical}. Specifically, high-quality 3D reconstruction of road networks, which form the skeleton of urban scenes, is useful in a variety of applicat... |
1403.1863 | \section{Introduction}
Synchronous Phasor Measurement Units (PMUs) are being massively deployed throughout the grid
and provide the dispatcher with time-stamped measurements relevant to the state of grid health as well as the required data for controlling and monitoring the system. Currently, PMU's provide the faste... |
# Generate an object containing the data in “Aphid_longevity_A06_405.txt” using read.table()
Aphids <- read.table("Aphid_longevity_A06_405.txt", header = TRUE)
# Check that the data have been imported properly using str()
# str(Aphids)
# SUCCESS! RESULT => 'data.frame': 55 obs. of 2 variables:
# $ subline : Factor ... | |
###############################################################
# oml4spark_function_create_balanced_input.r
#
# Function to create a Balanced Dataset based on Input
# Dataset and formula.
#
# Input can ... | |
writexy <- function(file, x, y, xprecision=3, yprecision=3) {
fx <- formatC(x, digits=xprecision, format="g", flag="-")
fy <- formatC(y, digits=yprecision, format="g", flag="-")
dfr <- data.frame(fx, fy)
write.table(dfr, file=file, sep="\t", row.names=F, col.names=F, quote=F)
}
x <- c(1, 2, 3, 1e11)
y <- sqrt(... | |
#' Make display maps for a species
#'
#' Make display maps for a species.
#' @param species Name of species
#' @param family Family of species
#' @param focus2Sp Spatial data frame object in equal-area projection
#' @param gadm1Sp Spatial object with states, does not have to be cropped to focus2Sp
#' @param q Vector of... | |
#Data Frames
x <- 10:1
y <- -4:5
q <- c("Hockey", "Football", "Baseball", "Curling", "Rugby", "Lacrosse", "Basketball", "Tennis", "Cricket", "Soccer")
theDF <- data.frame(x,y,q)
theDF
theDF <- data.frame(First = x, Second = y, Sport = q)
str(theDF)
class(theDF$Sport)
theDF <- data.frame(First = x, Second = y, Sport = ... | |
#!/usr/bin/Rscript
library(DESeq2)
# script arguments
args <- commandArgs(trailingOnly=T)
rda_to_load <- args[1]
rda_to_save <- args[2]
# loading
load(rda_to_load)
rlog <- data
# let DESeq do the PCA for us
pca <- DESeq2::plotPCA(rlog, intgroup="sample", ntop=1000, returnData=T)
# saving
data <- pca
save(data, fil... | |
incarceration_trends <- read.csv("https://raw.githubusercontent.com/vera-institute/incarceration-trends/master/incarceration_trends.csv")
incarceration_trends_jail_jurisdiction <- read.csv("https://raw.githubusercontent.com/vera-institute/incarceration-trends/master/incarceration_trends_jail_jurisdiction.csv")
# what i... | |
wesley_safadao <- function(day, month, year){
safadeza <- (sum(seq(1, month)) + (year / 100) * (50 - day))
anjo <- 100 - safadeza
return(c(safadeza, anjo))
}
say_safadeza <- function(day, month, year){
grau_de_safadeza <- data.frame(safadeza=NA, anjo=NA)
grau_de_safadeza[c('safadeza', 'anjo')] <- wesley_safa... | |
REBOL [
Title: "Kaj-fossil-download"
Date: 23-Jul-2013/18:18:25+2:00
Name: none
Version: 0.0.1
Comment: "just very fast written version so far!"
File: none
Home: none
Author: "Oldes"
]
;Fossil server does not serve JS without this:
system/schemes/http/user-agent: {Mozilla/5.0 (Windows; U; ... | |
suppressPackageStartupMessages({
library(data.table)
library(quanteda)
library(spacyr)
library(parallel)
library(textclean)
library(fastTextR)
library(dbscan)
library(digest)
library(FNN)
library(igraph)
})
source('../tree-functions.r')
progressbar <- function(n, length = 50L)... | |
# 2. faza: Uvoz podatkov
sl <- locale("sl", decimal_mark=",", grouping_mark=".")
# Podatki o zgodovini vozenj s kolesi se zacenjo leta 2010. Do vkljucno leta
# 2017 so bili podatki na AWS nalozeni letno oz. cetrtletno, poznejsi pa so
# nalozeni mesecno.
source('lib/funkcije.r', encoding='UTF-8')
PrenosCB(2011, 202... | |
# 2. faza: Uvoz podatkov
sl <- locale("sl", decimal_mark=",", grouping_mark=".")
pretvornik.regij <- function(){ # 2 regiji (Posavska in Jugovzhodna Slovenija) imata različno poimenovanje v različnih virih
regije.slo = tibble(
regija = c(
"Gorenjska",
"Goriška",
"Jugovzhodna",
"Koroška",... | |
#' Merge two lists
#'
#' Additive and non-additive merging of lists. \code{add} will merge lists additively, this means
#' that named items shared in both lists are added concatenated. \code{merge} is non-additive
#' merging and named items from list in the first argument will be replaced by items from
#' the list in t... | |
############################################################
# create_text_strings()
#
# Returns a list containing US English text strings.
#
# These are used by the following functions:
# * Import_Export_plot()
#
create_text_strings <- function(plottype='Exports',country='MZM_WORLD',fuel='oil',units='bbl',conprod='co... | |
# Eric R. Gamazon
# Create genotype table for eQTL mapping
"%&%" = function(a,b) paste(a,b,sep="")
mydir = "/nas40t0/egamazon/VANDY/PREDIXCAN/";
for (i in (1:22))
{
a <- read.table(gzfile(mydir %&% 'DGN.imputed_maf0.05_R20.8.hapmapSnpsCEU.chr' %&% i %&% '.mldose.gz'), header=F)
a <- a[,-1]
a <- a[,-1]
a.t <- t(... | |
#' Creates a Watershed object
#' @param stream Stream network raster, required
#' @param drainage Drainage direction raster, required
#' @param elevation Optional elevation raster
#' @param accumulation Optional flow accumulation raster
#' @param catchmentArea Optional catchment area raster
#' @param otherLayers Raster... | |
# packages ----
library(knitr)
library(lubridate)
library(progress)
library(tidyverse)
library(xml2)
# functions ----
source("get_xml.r")
source("extract_overview.r")
source("extract_historic.r")
source("extract_dividends.r")
source("clean_overview.r")
source("clean_price.r")
source("clean_dividends.r")
source("downlo... | |
#' @title kml.polygon
#' @description unknown
#' @family abysmally documented
#' @author unknown, \email{<unknown>@@dfo-mpo.gc.ca}
#' @export
kml.polygon = function( item='', name='', label='', style.id='', colour='ff0000cc', line.colour='4c7fffff', line.width="1", fill="0", outline="1", con='', style.id.highlight='... | |
#' Title
#'
#' @param model
#' @param parms
#' @param over
#' @param xrange
#' @param res
#' @param ini
#' @param t_max
#' @param method
#' @param colors
#' @param new
#'
#' @return
#' @export
#'
#' @examples
#' library(rgl)
#' p <- set_parms(livestock$defparms, set = list(b = 0.9, c = 0.2, f = 0, p = 0, alpha = 0.2))
... | |
myTestRule {
#Input parameter is:
# Standard output from clamscan
# Resource where clamscan was run
#Output parameter is:
# Status
#Execute the clamscan (Clam AntiVirus) utility "clamscan -ri VAULT_DIR"
# Note that the *VaultPath is the physical path for *Resource on *Host
# clamscan looks at the physical files in... | |
#format of args <cran mirror> <number of default repos> <indexies of default repos> <users repos>
args <- commandArgs(TRUE)
chooseCRANmirror(ind = args[1])
number.defaults = as.numeric(args[2])
defaults = if(number.defaults>0){
args[3:(2+number.defaults)]
}
additional = if((length(args)-2-number.defaults)>0){
... | |
# clean up
rm(list = ls())
# libraries
library(shiny)
library(magrittr)
library(plotly)
library(lubridate)
# module
source("HeatModule.R")
# data
load("heatmap.RData")
# small helper function to show time as nice string
GetTimeString <- function(){as.character(ymd_hms(paste(today(),format(Sys.time(), "%H-%M-%S"))))... | |
#!/usr/bin/env Rscript
# Parse the --file= argument out of command line args and
# determine where base directory is so that we can source
# our common sub-routines
arg0 <- sub("--file=(.*)", "\\1", grep("--file=", commandArgs(), value = TRUE))
dir0 <- dirname(arg0)
source(file.path(dir0, "common.r"))
theme_set(theme... | |
morse <- "ETIANMSURWDKGOHVF L PJBXCYZQ 54 3 2 16 7 8 90"
cat(sapply(readLines(tail(commandArgs(), n=1)), function(s) {
paste(lapply(strsplit(s, " ")[[1]], function(x) {
if (x == "") {
" "
} else {
p <- Reduce(function(a, b) {
if (b == '.') {
a * 2
} else... | |
# Master Thesis Project - Extreme Value Theory
# Getting the experimental data above the 95 %
# and fitting a GEV distribution to it
# Clear the environment
rm(list=ls())
# Close all already open graphic windows
graphics.off()
# Sourcing the auxiliary files
source("loadStockData_plain.r")
# Remark : the csv uses th... | |
# Nombre:
# Fecha:
# Curso: Métodos Cuantitativos.
# Prof. Héctor Bahamonde.
# 1. Esta tarea combina los ej's chicos #2, #3 y #4. Volviendo del break, haremos la tareas grandes #1 y #2 combinadas.
# 2. Se entrega el viernes a las 5 pm en uCampus.
# 3. Si quieres trabajar en grupo, se puede hacer. Pero las notas son i... | |
# Agave Platform Science API
#
# Power your digital lab and reduce the time from theory to discovery using the Agave Science-as-a-Service API Platform. Agave provides hosted services that allow researchers to manage data, conduct experiments, and publish and share results from anywhere at any time.
#
# Agave Platform v... | |
# qnoise R API
#
# mat - input data matrix
# noiseType -
# 0: Missing
# 1: Inconsistency
# 2: Outlier
# 3: Error
# 4: Duplicate
# percentage - percentage of the noise seed
# granularity -
# 0: ROW
# 1: CELL
# model - tuple picking model
# 0: Random
# 1: H... | |
#' Effective number of codons
#'
#' This function calculate the effective number of codons (ENC) using Wright's formula.
#'
#' @param x a list of KZsqns objects
#' @param spp.list an array indicating the the species identity of each KZsqns object in the list \emph{x}. The default option is to calculate an ENC for each ... | |
hanoimove <- function(ndisks, from, to, via) {
if ( ndisks == 1 )
cat("move disk from", from, "to", to, "\n")
else {
hanoimove(ndisks-1, from, via, to)
hanoimove(1, from, to, via)
hanoimove(ndisks-1, via, to, from)
}
}
hanoimove(4,1,2,3) | |
library(shiny)
library(hackR)
shinyServer(function(input, output, session){
localstate <- reactiveValues(text="")
observeEvent(input$button_leetify, {
leethandle <- leetify(handle=input$inputbox, case.type=input$case.type, sub.type=input$sub.type, leetness=input$leetness, include.unicode=input$include.unic... | |
/*
** Resources for the sys.path initialization, the Python options
** and the preference filename
*/
#include "Types.r"
#include "patchlevel.h"
#include "pythonresources.h"
/* A few resource type declarations */
type 'Popt' {
literal byte version = POPT_VERSION_CURRENT;
byte noInspect = 0, inspect = 1;
byte noVer... | |
#!/usr/bin/env Rscript
# Making figures for AGU Fall Meeting presentation 9 Dec 2019
# Eric Barefoot
# Dec 2019
# load packages
library(tidyverse)
library(here)
library(broom)
library(lme4)
library(devtools) # for the next thing
library(colorspace)
library(paleohydror)
library(purrr)
library(rsample)
library(segment... | |
# Plot shaded lines for data series (after plot has been initiated)
#' Plot shaded polygons
#'
#' Plot shaded polygons between any number of input lines
#'
#' @param x Data frame with x values
#' @param y Data frame with y values
#' @param clr vector with colors
#' @param ... Other parameters parsed to po... | |
# Merge the AERONET and the MetOffice data
aeronet <- import_aeronet_data("data/AERONET/lev20/920801_111119_Chilbolton.lev20")
meto <- import_meto_data("data/MetOffice/MetOData_All.csv")
index(meto) <- as.POSIXct(index(meto))
index(aeronet) <- as.POSIXct(index(aeronet))
ind <- index(aeronet)
rounded <- round_date(in... | |
Rebol [
title: "SWF Examiner"
Author: "oldes"
Date: 21-11-2002
version: 0.0.12
File: %exam-swf.r
Email: oliva.david@seznam.cz
Purpose: {
Basic SWF parser which can
show all standard informations from the file.
}
Category: [file util 3]
History: [
0.0.20 [21-11-2002 {Now using... | |
####### Final plots
source("https://raw.githubusercontent.com/Cdevenish/R-Material/master/Functions/w.xls.r")
## Data from Thompson_method scripts
load("sightings.rdata")
years
dataX <- data.frame(years = years, PXt, Basis = "All records")
head(dataX)
load("specimen.rdata")
dataX <- rbind(dataX,data.frame(years = ... | |
#' Scales for area or radius
#'
#' `scale_size()` scales area, `scale_radius()` scales radius. The size
#' aesthetic is most commonly used for points and text, and humans perceive
#' the area of points (not their radius), so this provides for optimal
#' perception. `scale_size_area()` ensures that a value of 0 is mappe... | |
#load library
library(MethComp)
#import data
df<-read.csv("gatti.csv", header = TRUE, sep = ";", dec= ",", stringsAsFactors = FALSE)
#
# #ignore columns
# df<-df[,1:22]
#
# head(df)
# str(df)
# #delete record number 99
# df<-df[-c(393:396),]
#
# df_Meth<-Meth(df, 2,1,3,7)
#
# plot(df_Meth)
#conv... | |
#'@title calcEF_PM
#'
#'@description
#'Calculates the appropriate particulate matter (PM10 or PM2.5) emission factor
#'(g/kWh) for the given parameters.
#'
#'@param engineType Engine type (vector of strings) (see
#'\code{\link{calcEngineType}}). Valid values are: \itemize{
#'\item "SSD"
#'\item "MSD"
#'\item "MSD-ED"
#... | |
#Objetivo1: resolver el tema de los NAs y si se debe ordenar ascendente o descendente
#Objetivo2: aplicar a todas las variables
#limpio la memoria
rm(list=ls())
gc()
library("data.table")
#cargo los datos
dataset <- fread("201902.txt")
#creo una clase que se 1 cuando es BAJA+2 , y 0 en caso contrario
#esto ... | |
lesmis <- read.delim("lesmis.dat",header = F,sep = ",")
polbooks <- read.delim("polbooks.dat", header = F, sep = ",")
#d <- data.frame((lesmis[,1] + 1), (lesmis[,2] + 1))
d <- data.frame((polbooks[,1] + 1), (polbooks[,2] + 1))
n <- max(d) #No. of vertices
a <- matrix(0,n,n,dimnames = list(c(seq(1:n)),c(seq(1:n))))
#C... | |
#' @export
on_load_called = 0L
.on_load = function (ns) {
ns$on_load_called = ns$on_load_called + 1L
}
#' @export
register_unload_callback = local({
unloaded = NULL
function (callback) {
unloaded <<- callback
}
}, envir = (callback = new.env()))
.on_unload = function (ns) {
if (! is.null... | |
#include "AEConfig.h"
#ifndef AE_OS_WIN
#include "AE_General.r"
#endif
resource 'PiPL' (16000) {
{ /* array properties: 7 elements */
/* [1] */
Kind {
AEGP
},
/* [2] */
Name {
"Panelator"
},
/* [3] */
Category {
"General Plugin"
},
/* [4] */
Version {
196608
},
#ifdef AE_OS_WIN
#... | |
#' dmulti_ddirch_forecast.r
#' NOTE: this assumes the predictor "map" is mean annual precipitation in mm, and natural log transforms.
#'
#' @param mod #model output from ddirch fitting function.
#' @param cov_mu #dataframe of site-level covariates. Must include all covariates ... | |
ef <- function(model='Schwab', from=NA, to=NA, efdata=NA, adjdates=NULL, period='months',
annualize=TRUE, addline=TRUE, col='black', lty=1, pch=3) {
## create Efficient Frontier points to assess TWR vs. risk
## model = 'Schwab' uses a blend of US L, US S, Inter, Fixed, and Cash
## ... | |
####################
##this is r developing code for running simulation to generate
##the DNA/protein microarray data
## the model (ref: smyth 2004, Bayesian hierarchical model and linear model)
## linear model:
## Y_ijk=alpha_i+beta_j+ gamma_ij+ epsilon_ijk
## see the doc named: "Microarray data s... | |
# Util
standard_error <- function(X, y, robust){
if (robust %in% c("White", "white", "HC0")) {
std_error <- robust_stde0(X, y)
cov_type <- "heteroskadestic (White)"
} else if (robust %in% c("Hinkley", "hinkley", "HC1")) {
std_error <- robust_stde1(X, y)
cov_type <- "hete... | |
# The functions require rchart-helper.R preloaded
getLineRangePlot =
function(seriesNames, lines, ranges, rangeName, yLabel, verticalLineDate=NULL, colors, timezone="UTC") {
series <- list()
minValue <- 0
for (i in 1:length(lines)) {
series[[2 * (i - 1) + 1]] <-
list(name=seriesNames[i]... | |
# Compare MAPE for different validation
# of the best model to be used in forecasting
source('2020-08-31-jsa-type-v2-ch2/03-evaluate/init.r')
# Inititalize parameters
model <- c("BGY-E1-C4-I20000-A0.99-T12-F50-V50")
dir_model_folder <- paste0(dir_analysis_edie_model, model, "/")
model_params <- parse_mode... | |
#Packages to import
library(ggplot2)
library(reshape2)
library(cowplot)
library(lubridate)
#Import data
tsc <- read.table("timeseries_cluster-eps_0.1-num_26.csv",sep=",",header=TRUE)
tp.int <- read.table("timeseries_cluster-eps_0.1-num_26.csv",sep=",",header=FALSE)[1,6:ncol(tsc)]
#This is the first sample date
basedat... | |
## Weight by the margin probabilities ###
rm(list = ls())
# install.packages(c("tidyverse", "msm", "foreign", "boot", "car",
# "nnet", "haven", "lavaan", "cowplot", "readstata13", "reshape2" ),
# quiet=TRUE)
#detach("packages:dplyr")
source("/Users/chrisweber/Desktop/Authoritar... | |
# Fit SSD to Silver dataset
# Copyright 2017 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | |
#' Predict method for MBM objects
#'
#' @param x A previously-fit MBM object
#' @param newdata Optional dataset for prediction. If present, it should be a new dataset in
#' the same format used to fit the model (i.e., a site by covariate matrix). If missing,
#' predictions will be for the original data.
#' @param... | |
#####################################################################
# PACOTES/BIBLIOTECAS #
#####################################################################
install.packages("RColorBrewer")
require("RColorBrewer")
library(ggplot2)
#----------------------------------------------------------------------... | |
REBOL [
System: "REBOL [R3] Language Interpreter and Run-time Environment"
Title: "Build REBOL 3.0 boot extension module"
Rights: {
Copyright 2012 REBOL Technologies
REBOL is a trademark of REBOL Technologies
}
License: {
Licensed under the Apache License, Version 2.0
See: http://www.apache.org/licenses/LI... | |
library(Sleuth3)
library(ggplot2)
head(case0501)
summary(case0501$Diet)
qplot(Diet,Lifetime,data=case0501,geom="boxplot")
case0501.aov<-aov(Lifetime~Diet,data=case0501)
case0501.aov
anova(case0501.aov)
t.test(Depth~Year,data=case0201,var.equal=TRUE)
case0201.aov<-aov(Depth~Year,data=case0201)
anova(case02... | |
# random forest and naive bayes
library( randomForest )
library( e1071 )
library( caTools )
setwd( '/path/to/showofhands/data' )
data = read.csv( 'train.csv' )
# which columns are not factors?
cols = colnames( data )
for ( i in 1:length( cols )) {
col_class = class( data[,i] )
if ( col_class != 'factor' )... | |
library(shiny)
library(qvalue, lib.loc= .libPaths()[1])
library(shiny)
library(shinythemes)
library(shinyjs)
library(markdown)
library(DT)
library(shinyjqui)###need to upload package to server
library(shinycssloaders)
options(shiny.maxRequestSize=300*1024^2)
files <- list.files("data")
shinyUI(fluidPage(
tags$head(... | |
getwd()
setwd("R")
system("../src/run.bat pet_all")
source("read.admb.R")
?read.table
mc=read.table("../src/arc/pet_all_s2_mcout.rep",skip=1,header=F)
mc=read.table("../src/arc/pet_all_mcout.rep",skip=1,header=F)
colnames(mc)=c("B","N","p_loss","Rep_Rate_F","Ref_Rate_SF","M","ER","Survival","ObjFun","ObjF_Tags","ObjF_R... | |
petsc_matprinter_fmt <- function(fmt="default")
{
fmt_choices <- c("default", "matlab", "dense", "impl", "info", "info_detail", "common", "index", "symmodu", "vtk", "native", "basic", "lg", "contour")
fmt <- match.arg(tolower(fmt), fmt_choices)
fmt_int <- .Call(sbase_petsc_printer_lookup_code, fmt)
.Call(sba... | |
# Example Usage
# irule -F project_collection_creation.r "*proj_name='alice-project'" "*owner='alice'" "*collab_list='bobby, eve , joe'" *lifetime=0.001 *object_quota=5 *size_quota=500
project_collection_creation {
create_project_collection(
*proj_name, *owner, *collab_list,
*lifetime, *object_quot... | |
<<<<<<< HEAD
#### Healthy Neighborhoods Project: Using Ecological Data to Improve Community Health
### Neville Subproject: Using Random Forestes, Factor Analysis, and Logistic regression to Screen Variables for Imapcts on Public Health
## National Health and Nutrition Examination Survey: The R Project for Statistical C... | |
library(randomForest)
library(ROCR)
train_tf_idf = read.csv("/Users/ouyamei/Documents/GitHub/kaggle-crisis/data/kaggle_train_tf_idf.csv")
train_wc = read.csv("/Users/ouyamei/Documents/GitHub/kaggle-crisis/data/kaggle_train_wc.csv")
test_wc = read.csv("/Users/ouyamei/Documents/GitHub/kaggle-crisis/data/kaggle_test_wc.c... | |
pwd:alibaba
openssl genrsa -out private-rsa.key 1024
openssl req -new -x509 -key private-rsa.key -out public-rsa-10years.cer -days 3650
openssl pkcs12 -export -out private-rsa.pfx -inkey private-rsa.key -in public-rsa-10years.cer | |
jmp = c(6, 1.5, 1.5, 0.25, 0.75, 1.5, 3, 0.5, 1.5)
iter = 1e8
out.length = 10000
burn.length = 1e8
resp.f = c(1.21,1.37,1.2,1.47,1.47,1.49,1.47,1.39,1.52) | |
library(testthat)
source("../src/data_structures.r")
source("../src/estimators.r")
source("../src/losses.r")
source("../src/constrained_boosting.r")
test_that("fit_const_pair",{
data <- dummyData()
expect_error(fit_const_pair(4,4),
"is(object = data, class2 = \"data\") is not TRUE",fixed=TRUE)
... | |
func_num=function(x){
num<-c(0,1,2,3,4,5,6,7,8,9)
datalist<-list(10)
a<-as.numeric(unlist(strsplit(as.character(x),"")))
return(num[which(is.na(match(num,a)))])
} | |
nox<-2; noy<-3;
paper<-F # graphics on paper=file (TRUE) or on screen (FALSE)
cleanup()
first.year.on.plot<-1974
last.year.on.plot<-2016
doGrid<-T
first.pch<-1 # first pch symbol
first.color<-1 # first color
palette("default") # good for clolorfull plots
#palette(gray(seq(0,.9,len=6))) # ... | |
# Mojang API
#
# No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
#
# OpenAPI spec version: 2020-06-05
#
# Generated by: https://openapi-generator.tech
#' CurrentPlayerIDs Class
#'
#' @field id
#' @field name
#' @field legacy
#' @field demo
#'
#' @importF... | |
#Naive bayes
library(caTools)
library(rpart)
library(rpart.plot)
library(caret)
library(e1071)
set.seed(125)
myd=read.csv('diabetes.csv')
myd$Outcome=factor(myd$Outcome,
c(0,1))
split=sample.split(myd,SplitRatio = 0.75)
train_data=subset(myd,split==TRUE)
test_data=subset(myd,split==... | |
offsetof(record, x) = 0
offsetof(record, y) = 0
offsetof(record, c) = 0 | |
capwords <- function(s, strict = FALSE, sentence=T) {
cap <- function(s) paste(toupper(substring(s, 1, 1)),
{s <- substring(s, 2); if(strict) tolower(s) else s},
sep = "", collapse = " " )
if(sentence){
sapply(s, cap, USE.NAMES = !is.null(names(s)))
} else {... | |
cat('fix_gridlines() now available as a function\n')
fix_gridlines = function(p){
p<<-p
pp <<- ggplot_build(p)$layout$panel_params[[1]]
grid_coords = lst(
x_major = b$layout$panel_params[[1]]$y$breaks
, x_minor = b$layout$panel_params[[1]]$y$minor_breaks
, y_major = b$layout$panel_params[[1]]$x$breaks
, y_mi... | |
#!/usr/bin/env Rscript
setwd("~/tmp/jmh-dscg-benchmarks-results")
timestamp <- "20150109_1718"
# install.packages("vioplot")
# install.packages("beanplot")
# install.packages("ggplot2")
# install.packages("reshape2")
# install.packages("functional")
# install.packages("plyr")
# install.packages("extrafont")
# install... | |
plot.width = {img_width}
plot.height = {img_height}
plot.range = {date_range}
plot.locationid = {locationid}
plot.title = '{plot_title}'
plot.path = '{plot_path}'
date.min <- Sys.Date() - plot.range
type_list <- c(16274, 17887, 17888, 17889)
plot.typeids.str <- paste(type_list, collapse=',')
## Event List ##
event.que... | |
r=359.16
https://sandbox.dams.library.ucdavis.edu/fcrepo/rest/collection/sherry-lehmann/catalogs/d72013/media/images/d72013-013/svc:tesseract/full/full/359.16/default.jpg Accept:application/hocr+xml | |
CP009748.1 <- tibble::tribble(
~V0, ~V1, ~V2, ~V3, ~V4, ~V5, ~V6, ~V7, ~V8, ~V9,
"CP009748.1", 1L, "9.9", "questionable", 70L, 16L, "1114538-1124478", "PHAGE_Bacill_G_NC_023719(2)", "45.71", "Bacillus amyloliquefaciens ATCC 13952",
"CP009748.1", 2L, "16.3", "incomplete", 40L, 27L, "1129262-1145591", "PHAGE_Brevi... | |
#' Lists all players for a league on a given date, with full bio and other details.
#' @param date given date
#' @param sport mlb | nfl | nba | etc..
#' @param ... optional query parameters
#'
#' @examples
#' \dontrun{
#' j <- all_players("mlb", team = "bos", rosterstatus = c("assigned-to-roster", "assigned-to-injury-l... | |
volumes <- c(25, 45, 28, 79, 74, 61, 12, 68, 93, 39, 100)
soma <- sum(volumes)
# Soma de todos vetores
print(soma) | |
library(shiny)
library(ggplot2)
library(dplyr)
library(RCurl)
library(zoo)
us_counties = read.csv(text = getURL("https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv"))
us_counties$date = as.Date(us_counties$date)
us_counties = us_counties[order(us_counties$county),]
# Define UI f... | |
data("PlantGrowth")
View(PlantGrowth)
anova_results<-aov(PlantGrowth$weight~PlantGrowth$group, data = PlantGrowth)
summary(anova_results) | |
# downtime graph
Sys.setlocale("LC_ALL", "C")
library(reshape2)
library(ggplot2)
library(scales)
downtime <- function(){
DF <- read.table(text=iconv("ID Equipment Downtime Running Idle
1 设备1 1.7 6.15 1
2 设备2 1.0 6.6 0.5
3 设备3 0.9 7.6 0
4 设备4 ... | |
# https://towardsdatascience.com/animating-your-data-visualizations-like-a-boss-using-r-f94ae20843e3
hand_data <- read.csv(file="log_1616588440.log",head=TRUE,sep=" ")
hand_data <- transform(hand_data, timestamp = (timestamp - hand_data[1,1]))
hand_data <- transform(hand_data, height = (height * 0.001))
hand_data
lib... | |
########################################################
##### Author: Diego Valle Jones
##### Website: www.diegovalle.net
##### Date Created: Fri Mar 19 07:53:06 2010
########################################################
#Run all scripts and save the charts in the output directories
#If you have ... | |
#ID GWAS IN BIOVU 23K EA
#both the genotype and phenotype data are processed by Xue.
#genotype data dir: /data/g***/z***/biovu/23k/geno/ea_chr/chr*
#binary trait dir: /data/c***/z***/data/biovu/pheno/EA23k_plink.txt
#adj cov: AGE_in_days,GENDER,PC1,PC2,PC3,PC4,PC5,ARRAY
args<-as.numeric(commandArgs(TRUE)) #528... | |
#!/usr/bin/env Rscript
#
# adonis.r - R slave for two-way permanova analysis with R package vegan
#
# Version 1.0.0 (July, 15, 2016)
#
# Copyright (c) 2016-- Lela Andrews
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
#... | |
outpath1 = '../TCN/char_cnn/data/quora'
outpath2 = '../TCN/char_cnn/data/quora-small'
# Create data stream.
a = read.csv('train.csv')
x = paste(a$question_text, a$target, sep='ª')
# Partition and create large dataset.
n3 = length(x)
n2 = 9 * n3 %/% 10
n1 = 8 * n3 %/% 10
trn = x[1:n1]
vld = x[(n1+1):n2]
tst = x[(n2+1... | |
#' Get sea ice data.
#'
#' @export
#' @param year (numeric) a year
#' @param month (character) a month, as character abbrevation of a month
#' @param pole (character) one of S (south) or N (north)
#' @param format (character) one of shp (default), geotiff-extent (for geotiff
#' extent data), or geotiff-conc (for geotif... | |
##############################################################################################
## Script to export single state-year municipal election returns with coalition aggregates. ##
## Output saved in ./xport/ directory with one column for each party. ##
###################################... | |
%r
library(SparkR)
df <- sql("SELECT * FROM `v_7d`")
xt <- xtabs(~prior_type+current_type, data=collect(df))
print(xt)
chisq.test(xt) | |
linear.bounded <- function(x, a, b, minY = 0, maxY = 1) {
y = a * x + b
y[y>maxY] = maxY
y[y<minY] = minY
return(y)
} | |
\clearpage
\subsubsection{Case Statement} % (fold)
\label{sub:case_statement}
The case statement is the second kind of branching statement. This allows you to create paths that execute based on matching a value from an expression. This allows one case statement to handle many alternative paths.
\begin{figure}[h]
\... | |
%!TEX root = ./jctt.tex
\newcommand{\rell}{^\ell} % raise to ellth power
\newcommand{\relll}{^{\ell+1}} % raise to ell + 1 th power
\newcommand{\rellh}{^{\ell+1/2}} % raise to ell + 1/2 power
\newcommand{\paren}[1]{\left(#1\right)}
\newcommand{\br}[1]{\left[#1\right]}
\newcommand{\curl}[1]{\left\{#1\right\}}
\new... | |
\documentclass[10pt,colorlinks=true,urlcolor=blue]{moderncv}
\usepackage{utopia}
\moderncvtheme[blue]{classic}
\usepackage[utf8]{inputenc}
\usepackage{multibbl}
\newbibliography{pub}
\newbibliography{techreports}
\newbibliography{talks}
\newbibliography{misc}
\newbibliography{conf}
\pagenumbering{arabic}
\usepackage{la... | |
%%% template.tex
%%%
%%% This LaTeX source document can be used as the basis for your technical
%%% paper or abstract. Intentionally stripped of annotation, the parameters
%%% and commands should be adjusted for your particular paper - title,
%%% author, article DOI, etc.
%%% The accompanying ``template.annotated.tex'... | |
%% declare document class and geometry
\documentclass[12pt]{article} % use larger type; default would be 10pt
\usepackage[english]{babel} % for hyphenation dictionary
%\setdefaultlanguage{english} % polyglossia command for use with XeTeX / LuaTeX
\usepackage{geometry} % setup page geometry
\geometry{letterpaper, portra... | |
\section{Process' perspective}
\subsection{Interactions as developers}
%How do you interact as developers?
Due to the current Covid situation, the team was forced to meet and work online.
The team typically met on Discord in the DevOps exercise sessions, during the week, and in the weekends.
Often, collaboration was... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.