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
library(lingtypology) | |
library(geosphere) | |
d <- gcIntermediate(c(5, 52), | |
c(47, 43), | |
n = 100, | |
addStartEnd = TRUE, | |
sp = TRUE) | |
co <- as.data.frame(d@lines[[1]]@Lines[[1]]@coords) |
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
#!/usr/bin/env Rscript | |
require(docopt, quietly = TRUE) | |
'Usage: | |
calculate.R [-n <nlines>] | |
Options: | |
-n Number of stdin lines [default: 1] | |
]' -> doc |
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
library(tidyverse) | |
t <- seq(0,0.5, 0.001) | |
`500 Hz` <- sin(1*5*2*pi*t) | |
`1000 Hz` <- sin(2*5*2*pi*t) | |
`1500 Hz` <- sin(3*5*2*pi*t) | |
`2000 Hz` <- sin(4*5*2*pi*t) | |
`2500 Hz` <- sin(5*5*2*pi*t) | |
`500 + 500 Hz` <- sin(1*5*2*pi*t) + sin(1*5*2*pi*t) | |
`1000 + 500 Hz` <- sin(2*5*2*pi*t) + sin(1*5*2*pi*t) | |
`1500 + 500 Hz` <- sin(3*5*2*pi*t) + sin(1*5*2*pi*t) |
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
# from here https://github.com/lbraglia/telegram | |
library(telegram) | |
bot <- TGBot$new(token = bot_token('hseling_bot')) | |
bot$set_default_chat_id(407084056) | |
Sys.time() | |
md1 <- "*bold* _italic_ [r-project](http://r-project.org) " | |
md2 <- " try `x <- rnorm(100)` at the console ..." | |
## below left spaces just for github displaying (not needed in the .R src) |
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
library(udpipe) | |
model <- udpipe_download_model(language = "polish") | |
model <- udpipe_load_model(file = model$file_model) | |
x <- udpipe_annotate(model, x = "Budynek otrzymany od parafii wymaga remontu, a placówka nie otrzymała jeszcze żadnej dotacji.") | |
x <- as.data.frame(x) | |
View(x) |
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
devtools::install_github("dkahle/dirichlet") | |
library(dirichlet) | |
library(dplyr, warn.conflicts = FALSE) | |
library(ggplot2) | |
theme_set(theme_bw()) | |
f <- function(v) { | |
ddirichlet(v, c(20, 10, 5)) | |
} | |
mesh <- simplex_mesh(.0025) %>% |
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
library(dplyr); library(widyr) | |
# there are 7 pairs | |
dat <- data_frame(group = rep(1:7, each = 2), | |
letter = c("a", "b", | |
"b", "e", | |
"a", "c", | |
"a", "c", | |
"b", "e", | |
"b", "e", |
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
library(waffle) | |
# simple waffle ----------------------------------------------------------- | |
parts <- c(plus = 80, times = 30, secret = 20, circle = 10) | |
waffle(parts, rows=8) | |
# awsom icons ------------------------------------------------------------- | |
# list of the icon names: http://fontawesome.io/icons/ | |
waffle(parts, rows=8, use_glyph="user-plus") |
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
# Bland-Altman ------------------------------------------------------------ | |
# about analysis https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4470095/pdf/bm-25-141.pdf | |
# visulisation from https://sw23993.wordpress.com/2017/05/31/bland-altmantukey-mean-difference-plots-using-ggplot2/ | |
library(tidyverse) | |
pine_df <- Loblolly | |
data.frame(sample_n(pine_df, size = nrow(pine_df) * 0.5) %>% | |
select(height) %>% | |
arrange(desc(height)), |
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
# from http://r.prevos.net/sierpinski-triangle/ | |
p <- c(0, 500, 1000) | |
q <- c(0, 1000, 0) | |
x11() | |
par(mar = rep(0, 4)) | |
plot(p, q, col= "red", pch = 15, cex = 1, axes = FALSE) | |
# Random starting point | |
x <- sample(0:1000, 1) |
OlderNewer