Skip to content

Instantly share code, notes, and snippets.

setwd("~/Dropbox/Projekt Akcelerometr/")
library(ggplot2)
library(lubridate)
read.table("2015-01-20_09-50-28.csv", h=T, sep=",") -> marsz
read.table("2015-01-26_12-32-02.csv", h=T, sep=",") -> schody
read.table("2015-01-26_20-43-38.csv", h=T, sep=",") -> skoki
marsz$loggingTime <- ymd_hms(marsz$loggingTime)
@pbiecek
pbiecek / cl1
Created January 28, 2015 21:35
library(pheatmap)
library(tidyr)
library(RColorBrewer)
library(SmarterPoland)
country_jumper_points <- skiJumps2013 %>%
mutate(jumper = paste(jumperSurname, jumperName)) %>%
group_by(jumper, compName) %>%
summarise(max.points = sum(classPoints, na.rm=TRUE)) %>%
group_by(jumper) %>%
@pbiecek
pbiecek / cl2
Created January 28, 2015 21:36
heatmap(as.matrix(country_jumper_points))
pheatmap(country_jumper_points,
main="Where they've got points")
pheatmap(country_jumper_points, border="white",
color = brewer.pal(9,"Blues"),
main="Where they've got points")
## ui.R
library(shiny)
shinyUI(fluidPage(
textInput(inputId = "imie",
label = "Zaznacz imiona",
value = ""),
plotOutput("choinka", width=720, height=720)
)
)
## server.r
library(ggplot2)
library(scales)
library(Cairo)
library(ggthemes)
library(shiny)
load("dzch.rda")
zielonaChoinka <- function() {
# install_github("amplab-extras/SparkR-pkg",
# subdir="pkg")
library(SparkR)
# you need to have a properly configured Spark installation
sc <- sparkR.init()
# read data from local disk
linesRDD <- textFile(sc, "data.txt")
@pbiecek
pbiecek / HEplot
Last active August 29, 2015 14:15
library(PISA2012lite)
pol <- student2012[student2012$CNT == 'Poland',]
model <- lm(cbind(PV1MATH, PV1READ, PV1SCIE)~ST28Q01+ST04Q01, pol)
# jeżeli nie jest zainstalowany to
# install.packages("heplots")
library(heplots)
heplot(model, size="effect.size", las=1, term.labels=FALSE)
library(PISA2012lite)
pol <- student2012[student2012$CNT == "Poland",]
model <- lm(cbind(PV1MATH, PV1READ, PV1SCIE)~ST28Q01+ST04Q01, pol)
library(candisc)
model2 <- candisc(model, "ST28Q01")
heplot(model2)
model3 <- candisc(model, "ST04Q01")
heplot(model3)