This file contains 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: Alkalmazott statisztika? R! | |
author: Daróczi Gergely | |
date: 2016 | |
--- | |
Az R programozási nyelvvel és adatelemző, statisztikai és adatvizualizációs rendszerrel (R Core Team 2016) kicsit több mint 10 éve ismerkedtem meg felsőfokú tanulmányaim során, amikor is egy választható gazdaságszociológia kurzus keretén belül a magyarországi burgonyapiac kaotikus viselkedésével (Vizvári, Bacsi 1997; Vizvári 2002) volt szerencsém rövidebben foglalkozni. Ezt a személyes emléket azért tartottam fontosnak leírni, mert a káoszelmélettel való ismerkedés in medias res -- a kapcsolódó meglehetősen összetettnek tűnő matematikai háttér tárgyalása nélkül --, az alkalmazással indult, és az R-nek köszönhetően a félév végén sikerrel abszolváltam a kurzust. Ezzel párhuzamosan egy új és igen gazdag világ tárult fel előttem az R eszköztárával, amely évekkel később egyik legkedvesebb szabadidős elfoglaltságommá, majd elsődleges munkaeszközömmé vált. | |
Noha az R nyelv már több mint 20 éves múltra tekinthet vissza, népszerűségét legin |
This file contains 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
ddist <- function(df, quantiles = c(0,.02, .25, .50, .75, .90, .98, .99, .999, 1), na.rm = TRUE) { | |
numvars <- which(sapply(df, is.numeric)) | |
sapply(numvars, function(v) { | |
if (is.data.table(df)) { | |
v <- df[, v, with = FALSE] | |
} else { | |
v <- df[, v] | |
} | |
c(n = length(v), | |
ndistinct = length(unique(v)), |
This file contains 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
-- create a new temp table with exact same schema | |
CREATE TABLE foobar_temp (LIKE foobar INCLUDING DEFAULTS); | |
-- or create this temp table with any new schema (eg updated col type) | |
CREATE TABLE foobar_temp (...) | |
-- copy everything from old table | |
INSERT INTO foobar_temp <list of columns> SELECT <list of columns> FROM foobar; | |
-- rename/drop tables |
This file contains 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
## fetch & parse data from Wikipedia | |
library(XML) | |
wiki <- 'https://en.wikipedia.org/wiki/Chronology_of_computation_of_%CF%80' | |
tables <- readHTMLTable(readLines(wiki), stringsAsFactors = FALSE) | |
## merge data from 4 tables | |
library(data.table) | |
pis <- rbindlist(list( | |
## data data before 1400 from 3rd table extracted by hand |
This file contains 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
## compile a list of available packages on CRAN | |
aps <- as.data.frame(available.packages()) | |
## get the list of Depends and clean up a bit | |
deps <- gdata::trim(unlist(strsplit(as.character(aps$Depends), ','))) | |
deps <- gsub('[ \\(].*|\\n', '', deps) | |
## freq table | |
depst <- table(deps) |
This file contains 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
# Maintainer: Andrea Scarpino <andrea@archlinux.org> | |
pkgname=kdeplasma-applets-applicationname | |
pkgver=1.7 | |
pkgrel=1 | |
pkgdesc="A QML plasmoid to display the application name of the focused window" | |
arch=('any') | |
url="https://github.com/ndr/applicationname-plasmoid" | |
license=('GPL') | |
depends=('kdebase-workspace') |
This file contains 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
```{r include=FALSE} | |
library(pander); library(xtable) | |
``` | |
# `pander` demo | |
```{r, results="asis"} | |
pander(CO2[1:8, ], style = 'rmarkdown') | |
``` |
This file contains 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
# Maintainer: Igor Yanchenko <yanchenko.igor@gmail.com> | |
# Updated: Gergely Daróczig <gergely@snowl.net> | |
pkgname=snakefire-git | |
pkgver=20130818 | |
pkgrel=1 | |
pkgdesc='A Campfire desktop client' | |
arch=('i686' 'x86_64' 'ppc') | |
url='http://snakefire.org' | |
license=('MIT') | |
depends=('python2' 'python2-distribute' 'python-pyfire' 'python2-pyqt' 'python2-keyring' 'python2-notify' 'python2-pyenchant') |
This file contains 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
<!--head | |
meta: | |
title: UK language usage | |
description: Analysing the results of The Cambridge Online Survey of World Englishes | |
in the United Kingdom | |
author: ' (@daroczig)' | |
packages: | |
- class | |
- descr | |
- dismo |
This file contains 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
## load "pander" package | |
## http://rapporter.github.com/pander/ | |
library(pander) | |
## "brew" the below file to Pandoc's markdown | |
Pandoc.brew('example.brew') | |
## or convert to HTML at one go | |
## NOTE: `pandoc` is needed for the conversion | |
Pandoc.brew('example.brew', output = tempfile(), convert = 'html') |