[<75 characters ideally]
[<200 characters]
library(data.table) | |
library(chron) | |
library(ggplot2) | |
library(stringr) | |
# This doesn't cope with spaces in URLs grr!! | |
url_pattern <- "http[s]?://(?:[@blank:]|[a-zA-Z]|[0-9]|[$-_@.&+ ]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+" | |
## Read data in from a text file | |
raw.log <- data.table(scan("bloblog.txt", character(0), sep = "\n")) |
R_USER = "E:/Dropbox/hobbies/R" |
library(magrittr) | |
library(rvest) | |
library(data.table) | |
library(stringr) | |
library(plyr) | |
# All (accepted) submitted sessions | |
allsubmissions <- html("https://sqlbits.com/information/PublicSessions.aspx") %>% | |
html_node(".session") %>% | |
html_table() %>% |
> mytestfunction(iris) | |
Functional sequence with the following components: | |
1. data.table(.) | |
2. { if (y) rbind(head(., 1), tail(., 1)) else .} | |
Use 'functions' to extract the individual functions. | |
> sessionInfo() | |
R version 3.1.2 (2014-10-31) | |
Platform: x86_64-w64-mingw32/x64 (64-bit) |
library(data.table) | |
x<-data.table(a=c(1,2),a1=c(1,2), | |
b=c(1,2),b1=c(1,2), | |
c=c(1,2),c1=c(1,2)) | |
y<-data.table(mina=0,maxa=3, | |
minb=0,maxb=3, | |
minc=0,maxc=3) |
source("inputcontrols.R") | |
server <- function(input, output) { | |
output$distPlot <- renderPlot({ | |
hist(rnorm(input$obs), col = 'darkgray', border = 'white') | |
}) | |
} | |
ui <- fluidPage( | |
sidebarLayout( |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Learning the Ropes Via the Community</title> | |
<meta charset="utf-8"> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="chrome=1"> | |
<meta name="generator" content="pandoc" /> |
if (!require(DiagrammeR)) install.packages(DiagrammeR) | |
library(DiagrammeR) | |
hangs<-"graph TB | |
D[Data] --> R[Read into memory] | |
R --> DM[Data manipulation] | |
DM --> V[Visualisation] | |
DM --> O[Output] | |
V --> Do[Document] | |
Do --> O | |
V --> I[Interactive report] |
library(ggplot2) | |
library(optiRum) | |
basicplot<-ggplot(data=iris, | |
aes(x=Sepal.Width, y=Sepal.Length, colour=Species)) + | |
geom_point() + | |
stat_boxplot(fill="transparent") | |
multiplot(basicplot+ggtitle("theme_bw()"), | |
basicplot+theme_minimal()+ggtitle("theme_minimal()"), |