I hereby claim:
- I am andrie on github.
- I am apdevries (https://keybase.io/apdevries) on keybase.
- I have a public key ASDOCA6xxvGsbQQS_v860hBzhtmtZ2Jf-sscY3X2a2kl5wo
To claim this, I am signing this object:
# Scrapes CRAN archives to determine the number of packages per release | |
# Create a list of pages to scrape, including both archive and current | |
extract_url <- function(){ | |
url <- list( | |
archive = "https://cran-archive.r-project.org/bin/windows/contrib/", | |
active = "https://cran.r-project.org/bin/windows/contrib/" | |
) | |
get_urls <- function(url){ |
I hereby claim:
To claim this, I am signing this object:
### Connect to SQL Server using RODBC | |
library(RODBC) | |
library(magrittr) | |
# Connect to SQL Server using RODBC ------------------ | |
sqlHost <- "DAA136209339.sys-sqlsvr.local" | |
sqlDatabase <- "RevoTestDB" | |
dsnString <- "driver={SQL Server};server=%s;database=%s;trusted_connection=true" |
# Generate data in the form of a sine wave | |
set.seed(1) | |
n <- 1e3 | |
dat <- data.frame( | |
x = 1:n, | |
y = sin(seq(0, 5*pi, length.out = n)) + rnorm(n=n, mean = 0, sd=0.1) | |
) | |
approxData <- data.frame( |
library(doSNOW) | |
library(tcltk) | |
cl <- makeSOCKcluster(2) | |
registerDoSNOW(cl) | |
pb <- txtProgressBar(max=100, style=3) | |
progress <- function(n) setTxtProgressBar(pb, n) | |
opts <- list(progress=progress) | |
r <- foreach(i=1:100, .options.snow=opts) %dopar% { |
library(foreach) | |
library(iterators) | |
library(doParallel) | |
library(tcltk) | |
# Choose number of iterations | |
n <- 1000 | |
cl <- makeCluster(8) |
library(ggplot2) | |
dat <- read.csv("world records.csv", stringsAsFactors = FALSE) | |
# Clean and transform the data -------------------------------------------- | |
track <- within(dat, { | |
Time <- as.numeric(Time.in.hours) | |
Date <- as.Date(Date, format = "%d-%b-%y") | |
Speed <- Distance / Time | |
logDistance <- log10(Distance) |
# Original blog post | |
# https://fronkonstin.com/2019/01/10/rcpp-camaron-de-la-isla-and-the-beauty-of-maths/ | |
# For this example to work, you must have a conda environment with the datashader library | |
# See http://datashader.org/getting_started/index.html#installation for installation instructions | |
library(Rcpp) | |
library(reticulate) | |
library(dplyr) | |
use_condaenv("datashader", required = TRUE) |
# Install package from CRAN | |
getOption("repos") | |
options(repos=c(CRAN="http://cran.at.r-project.org/")) | |
install.packages("miniCRAN", type="source") | |
library("miniCRAN") | |
sessionInfo() |
# Instructions for using miniCRAN to create a package repository for installing packages on SQL Server 2016 | |
# | |
# 1. Create a local repository on a machine connected to the Internet | |
# 2. Copy the miniCRAN repository to the target machine | |
# 3. Install the packages on the target machine |