Skip to content

Instantly share code, notes, and snippets.

@jjallaire
jjallaire / table.cpp
Created November 11, 2012 16:15 — forked from hadley/table.cpp
IntegerVector table1(const CharacterVector x) {
std::map<char*, int> counts;
int n = x.length();
for (int i = 0; i < n; i++) {
counts[x[i]]++;
}
// Loop through each element of map and output into named vector
IntegerVector out(counts.size());
@jjallaire
jjallaire / binner.cpp
Last active September 13, 2019 13:46 — forked from hadley/binner.cpp
#include <Rcpp.h>
using namespace Rcpp;
class BinFixed {
double width_;
double origin_;
public:
@jjallaire
jjallaire / .gitignore
Last active November 2, 2023 14:19 — forked from wch/retirement-logo.png
Retirement simulation Quarto Shiny app
env/
__pycache__/
*-app.py
*_files/
*.html