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 |
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
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
# Use x11() device as Rstudio device has "issues" with grid.locator() | |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
library(grid) | |
x11(type = 'cairo') | |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
# Some linear-ish points in range/domain [0,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
--- | |
title: "Reactive Objects" | |
output: rmarkdown::html_vignette | |
vignette: > | |
%\VignetteIndexEntry{Reactive Objects} | |
%\VignetteEngine{knitr::rmarkdown} | |
%\VignetteEncoding{UTF-8} | |
--- | |
```{r, include = FALSE} |
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
listframe <- function(...){ | |
structure( | |
tibble(...), | |
class = c("listframe","tbl_df","tbl","data.frame") | |
) | |
} | |
lf <- listframe( | |
a = list(1,c("a","b","c"),matrix(1:4,2,2)), |
NewerOlder