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
# Set MKL threads if Revolution R Open or Revolution R Enterprise is available | |
if(require("RevoUtilsMath")){ | |
setMKLthreads(4) | |
} | |
# Initialization | |
set.seed (1) |
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
************* Preparing the environment for Debugger Extensions Gallery repositories ************** | |
ExtensionRepository : Implicit | |
UseExperimentalFeatureForNugetShare : true | |
AllowNugetExeUpdate : true | |
AllowNugetMSCredentialProviderInstall : true | |
AllowParallelInitializationOfLocalRepositories : true | |
-- Configuring repositories | |
----> Repository : LocalInstalled, Enabled: true |
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
import pandas # noqa: F401 (this line needed for Shinylive to load plotly.express) | |
import plotly.express as px | |
import plotly.graph_objs as go | |
from shinywidgets import output_widget, render_widget | |
from shiny import App | |
from shiny import experimental as x | |
from shiny import reactive, render, req, session, ui |
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
import pandas # noqa: F401 (this line needed for Shinylive to load plotly.express) | |
import plotly.express as px | |
import plotly.graph_objs as go | |
from shinywidgets import output_widget, render_widget | |
from shiny import App | |
from shiny import experimental as x | |
from shiny import reactive, render, req, session, ui |
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("networkD3") | |
library("igraph") | |
# Download prepared igraph file from github | |
url <- "https://github.com/andrie/cran-network-structure/blob/master/pdb/depGraph-CRAN.rds?raw=true" | |
datafile <- tempfile(fileext = ".rds") | |
download.file(url, destfile = datafile, mode = "wb") | |
gs <- readRDS(datafile) | |
# Remove all nodes with fewer than 50 edges |
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
# compute hilbert curve | |
# inspired by https://logicgrimoire.wordpress.com/2020/06/19/how-to-draw-the-hilbert-curve-using-a-computer-program/ | |
library(ggplot2) | |
library(dplyr) | |
library(magrittr) | |
# rotate matrix | |
rotate <- function(x, th = pi/2) { | |
x %*% matrix(c(cos(th), -sin(th), sin(th), cos(th)), ncol = 2, byrow = TRUE) |
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
import {makeScene2D} from '@motion-canvas/2d/lib/scenes';; | |
import {createRef} from '@motion-canvas/core/lib/utils'; | |
import {all} from '@motion-canvas/core/lib/flow'; | |
import {createSignal} from '@motion-canvas/core/lib/signals'; | |
import {Polygon} from '../components/Polygon'; | |
export default makeScene2D(function* (view) { | |
const myPoly = createRef<Polygon>(); |
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(repr) | |
# Change plot size to 4 x 3 | |
options(repr.plot.width=4, repr.plot.height=3) | |
curve(sin(x), from = 0, to=2*pi, n = 100) | |
# Change plot size to 8 x 3 | |
options(repr.plot.width=8, repr.plot.height=3) | |
curve(sin(x), from = 0, to=4*pi, n = 200) |
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
# Objective | |
# | |
# Fit a gamma distribution knowing that: | |
# - 20% fall below 15 days | |
# - 80% fall below 60 days | |
# Inspired by http://www.johndcook.com/blog/2010/01/31/parameters-from-percentiles/ | |
x <- c(0.2, 0.8) | |
y <- c(15, 60) |
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
## Analyze R packages for popularity, using pagerank algorithm | |
# Inspired by Antonio Piccolboni, http://piccolboni.info/2012/05/essential-r-packages.html | |
library(miniCRAN) | |
library(igraph) | |
library(magrittr) | |
# Download matrix of available packages at specific date ------------------ |
NewerOlder