I hereby claim:
- I am daroczig on github.
- I am daroczig (https://keybase.io/daroczig) on keybase.
- I have a public key is ASBYP5QGYjtBrURgkEZJXoJrs_sWW8u-ENKAFO36yUGQDwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#' Guess a text data file's parameters | |
#' @param file filename | |
#' @return list of \code{sep}, \code{quote}, \code{dec}, \code{header},\code{fileEncoding} | |
#' @export | |
import.text.guess <- function(file) { | |
## check encoding -> encoding | |
encoding <- sub('.*charset=', '', system(sprintf('file -bi %s', shQuote(file)), intern = TRUE)) | |
if (encoding %in% c('???', 'unknown-8bit')) { | |
warning('Could not identify encoding!') |
library(XML) | |
html <- htmlParse(readLines('https://www.meetup.com/topics/r-project-for-statistical-computing/all/')) | |
names <- xpathSApply(html, '//li[@class="gridList-item"]/a/span', xmlValue) | |
attrs <- xpathSApply(html, '//li[@class="gridList-item"]/span[@class="text--secondary text--small chunk"]', xmlValue) | |
attrs <- gsub('\\n|\\t', '', attrs) | |
users <- as.numeric(gsub(',', '', sub('^([0-9,]*) .*', '\\1', attrs))) | |
geo <- sub('.* \\| ', '', attrs) | |
data.frame(name = names, location, members) |
#' Connect and query Imapala via SSH and Impala-shell | |
#' @param query SQL query to run | |
#' @param host server hostname or IP | |
#' @param log enable or disable logging of debug/trace messages | |
#' @return data.table object | |
#' @export | |
query_impala <- function(query, host = 'localhost', log = require(futile.logger)) { | |
## measure time of query | |
timer <- proc.time() |
library(shiny) | |
library(rmarkdown) | |
shinyServer(function(input, output) { | |
output$html = reactive({ | |
t <- tempfile() | |
cat(input$markdown, file = t) |
## Start with the official rocker image (lightweight Debian) | |
FROM rocker/r-base:latest | |
MAINTAINER Gergely Daroczi <[email protected]> | |
## Install Java | |
RUN echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" \ | |
| tee /etc/apt/sources.list.d/webupd8team-java.list \ | |
&& echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" \ | |
| tee -a /etc/apt/sources.list.d/webupd8team-java.list \ |
library(pander) | |
evals(readLines('demo.R')) |
> dim(m) | |
[1] 32400 32400 | |
> sum(m) / prod(dim(m)) | |
[1] 0.0007337982 | |
> table(rowSums(m)) | |
0 16 22 26 35 38 41 46 | |
15549 96 30 29 28 27 26 16615 | |
> table(colSums(m)) |