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 rocker/r-ver:4.0.0-ubuntu18.04 | |
# Basic system Libraries | |
RUN export DEBIAN_FRONTEND=noninteractive; apt-get -y update \ | |
&& apt-get install -y \ | |
file \ | |
gdal-bin \ | |
libgdal-dev \ | |
libproj-dev \ | |
pandoc \ |
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
# Comparing different ways of processing a data frame row-by-row: | |
library(data.table) | |
df = data.frame(a = runif(10000), b = runif(10000)) | |
system.time(rbindlist(purrrlyr::by_row(df, function(row) { data.frame(a = row$a) }, .labels = FALSE)$.out)) | |
# user system elapsed | |
# 4.479 0.008 4.494 | |
# This is fast, but note that 'apply' doesnt preserve types. e.g. character columns will get converted to numeric. |
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
server <- function(input, output) { | |
output$force <- networkD3::renderForceNetwork({ | |
networkD3::forceNetwork(Links = networkD3::MisLinks, Nodes = networkD3::MisNodes, | |
Source = "source", Target = "target", Value = "value", | |
NodeID = "name", Group = "group") | |
}) | |
output$scatterPlot <- scatterD3::renderScatterD3({ | |
scatterD3::scatterD3(x = c(1,2,3,4), |
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |