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(callme) | |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
# Code Segment 1 | |
# 1. Define an 'adder()' function | |
# 2. Wrapper function to return the address of this function | |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
code1 <- r"( | |
int adder(int 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
# There is some explanation for why the bitwise operator functions do what they do here: | |
# https://inventwithpython.com/blog/2021/08/02/algorithmic-art-with-the-bitfielddraw-module/ | |
# ignore the warnings, THIS IS ART! | |
library(ggplot2) | |
cols <- c("#b8e1c5", "#3ac9fb", "#fadacc","#fcb2c6", | |
"#002f88", "#fd7a5d","#00B850", "#091a22") |
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
- - - - - - - - - - - - - - - - - - - - | |
- - - - - - - - - - - - - | |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
- |
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
##___________________________________________________ | |
## | |
## Script name: render_pointcloud.R | |
## | |
## Purpose of script: | |
## render forest plot pointcloud with raytracing | |
## | |
## Author: Jens Wiesehahn | |
## Copyright (c) Jens Wiesehahn, 2023 | |
## Email: [email protected] |
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
# remotes::install_github("multimeric/altrepr") | |
library(altrepr) | |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
# Create a long vector of consecutive INTEGER values | |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
int_vec_str <- sprintf("c(%s)", paste(5:(2^18), 'L', sep = '', collapse = ", ")) | |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
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
Subject: Clarificaiton requested on 'connections' interface. | |
Hi All, | |
I am confused on the status of being able to create custom connections in R. | |
The functions 'R_new_custom_connection()' and 'R_GetConnection()' | |
(defined in 'R_ext/Connections.h') are marked in 'sotools.c' as 'nonAPI'. | |
This would seem to indicate that it is not for use in packages as it will |
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
file <- system.file("jsonexamples", "twitter.json", package="RcppSimdJson") | |
jsontxt <- readLines(file) | |
res <- microbenchmark::microbenchmark(jsonify = jsonify::validate_json(jsontxt), | |
jsonlite = jsonlite::validate(jsontxt), | |
simdjson = RcppSimdJson::validateJSON(file), | |
ndjson = ndjson::validate(file), | |
RJSONIO = RJSONIO::isValidJSON(file), | |
yyjsonr = yyjsonr::validate_json_file(file), |
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(carelesswhisper) | |
library(styler) | |
library(dplyr) | |
library(stringr) | |
ctx <- whisper_init() | |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
#' Record audio and convert to text |
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: "Toy WASM interpreter in base R" | |
author: "mikefc" | |
date: 2022-07-29T18:05:00+10:00 | |
categories: ['Rstats'] | |
tags: ["R"] | |
--- | |
```{r, include = FALSE} | |
knitr::opts_chunk$set( |
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
# remotes::install_github("coolbutuseless/eventloop") | |
Pong <- R6::R6Class( | |
"pong", | |
public = list( | |
initialize = function(width=10, height=7, speed=0.02) { | |
require(grid) | |
private$width <- width | |
private$height <- height |
NewerOlder