This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(data.table) | |
| library(ggplot2) | |
| ratio<-2/3 | |
| dblayout<-rbind( | |
| data.table(level=4,colour='DB',name='Database', start=0 ,end=1), | |
| data.table(level=3,colour='S', name='Schema' , start=0 ,end=ratio), | |
| data.table(level=3,colour='S', name='...' , start=ratio ,end=1), | |
| data.table(level=2,colour='T', name='Table' , start=0 ,end=ratio^2), | |
| data.table(level=2,colour='T', name='...' , start=ratio^2,end=ratio), | |
| data.table(level=1,colour='C', name='Key' , start=0 ,end=ratio^3), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if(!require(googlesheets)) install.packages("googlesheets") | |
| if(!require(data.table)) install.packages("data.table") | |
| if(!require(ggmap)) install.packages("ggmap") | |
| library(googlesheets) | |
| library(data.table) | |
| library(ggmap) | |
| responses <- gs_key('1v9aEe8ov4zSGWKjaNYMFbahdDST3RN88LoI56BGzQHM', visibility = 'public', verbose = FALSE) | |
| responses <- gs_read(responses, ws = 1, verbose = FALSE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## ------------------------------------------------------------------------ | |
| # Set the repo for use throughout | |
| cran <- "https://cran.rstudio.org" | |
| # Install | |
| if(!require(miniCRAN)){ | |
| install.packages("miniCRAN", repos = cran) | |
| } | |
| ## ------------------------------------------------------------------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| link<-"http://cranlogs.r-pkg.org/downloads/daily/last-month/R" | |
| library(httr) | |
| library(data.table) | |
| raw<-GET(link) | |
| rhs<-content(raw,simplify=TRUE)$downloads[[1]] | |
| setDT(rhs) | |
| rhs[,sum(downloads)/rhs[,sum(downloads)],os] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| > sessionInfo() | |
| R version 3.2.3 (2015-12-10) | |
| Platform: x86_64-w64-mingw32/x64 (64-bit) | |
| Running under: Windows >= 8 x64 (build 9200) | |
| locale: | |
| [1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 | |
| [3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C | |
| [5] LC_TIME=English_United Kingdom.1252 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Error in vis$data[[name]] <- data : | |
| invalid type/length (closure/0) in vector allocation | |
| Calls: <Anonymous> ... eval -> _fseq -> freduce -> <Anonymous> -> add_data | |
| Execution halted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Import-Module CredentialManager | |
| Import-Module .\posh-git\posh-git.psm1 | |
| $keyfile = "id_rsa" | |
| $dir = ".ssh/" | |
| # Need to create the cred in Windows Credential Manager first (can use New-StoredCredential) | |
| $cred = Get-StoredCredential -Target $keyfile | |
| Add-SshKey |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| title: "Stats 101" | |
| output: | |
| revealjs::revealjs_presentation: | |
| theme: white | |
| --- | |
| ```{r setup, include=FALSE} | |
| knitr::opts_chunk$set(echo = TRUE, message = FALSE, dev="svg", | |
| fig.height = 500) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(data.table) | |
| iris1<-iris # shows up | |
| iris2<-iris # shows up | |
| iris3<-setDT(copy(iris)) # shows up | |
| iris4<-setDT(copy(iris)) # doesn't show up |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| title: "data.table keys" | |
| author: "Steph Locke" | |
| date: "4 April 2016" | |
| output: | |
| md_document: | |
| variant: markdown_github | |
| --- | |
| # Glossary |