Skip to content

Instantly share code, notes, and snippets.

View Thell's full-sized avatar

Thell 'Bo' Fowler Thell

  • Pyrapat Inc.
  • Arkansas, USA
View GitHub Profile
// [[Rcpp::plugins("cpp11")]]
#include <ostream>
#include <iterator>
#include <RcppCommon.h>
class BadIter;
RCPP_EXPOSED_CLASS(BadIter)
#include <Rcpp.h>
@Thell
Thell / RCPP_EXPOSED_CLASS
Created February 27, 2014 01:20
Example of creation time for pre/post construction populated RCPP_EXPOSED_CLASS
// [[Rcpp::plugins("cpp11")]]
#include <RcppCommon.h>
class preVector;
RCPP_EXPOSED_CLASS(preVector)
class postVector;
RCPP_EXPOSED_CLASS(postVector)
@Thell
Thell / SO11533438
Created February 28, 2014 05:03
SO rmd
_Why_ it is so slow? A little research located a mail group posting from a year ago this month where @hadley, the package author, [states][2]
> This is a drawback of the way that ddply always works with data
frames. It will be a bit faster if you use summarise instead of
data.frame (because data.frame is very slow), but I'm still thinking
about how to overcome this fundamental limitation of the ddply
approach.
---
/***
*
* Scenario:
*
* You desire to use RCPP_EXPOSE_CLASS on a class and it needs to store
* a pointer to somewhere in a constructor initialized container either
* using the default initializer list or from within the constructor.
*
* Problem:
*
clang++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -I"/home/thell/R/x86_64-pc-linux-gnu-library/3.0/Rcpp/include" -fpic -Wall -O3 -c RcppExports.cpp -o RcppExports.o
14
** libs
15
clang++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -I"/home/thell/R/x86_64-pc-linux-gnu-library/3.0/Rcpp/include" -fpic -Wall -O3 -c RcppMultiPrecision.cpp -o RcppMultiPrecision.o
16
clang++ -shared -o RcppMultiPrecision.so RcppExports.o RcppMultiPrecision.o -lmpfr -lgmp -L/usr/lib/R/lib -lR
@Thell
Thell / PandocMathTest.Rmd
Created April 9, 2014 23:57
Pandoc Mathjax Test Doc
---
title: "Pandoc MathTest"
author: "Thell"
date: "04/09/2014"
output:
html_document: default
pdf_document:
pandoc_args: --tex-escape-outer-math
---
@Thell
Thell / SO-Meta-Q.md
Last active August 29, 2015 14:00
Community Imposed Answer Acceptance

Community Imposed Answer Acceptance

(For Abandoned Questions)

The Unanswered questions listings are a great place to find questions with some meat on their bones that take some time, thought, research and self-learning to answer, but the quantity of questions that build up which actually do have an answer makes finding those fun gems not so fun to find.

Sure, we have advanced search syntax, data.stackexchange queries and filtered questions but none of these stop the build up of abandoned and answered but unaccepted questions.

In the blog post Why Can’t I Accept My Own Answer? Jeff Atwood gives a great explanation of the spirit of accepting answers. Two pertinent quotes from that posting are...

---
title: "testfn"
output: html_document
---
```{r knitr-setup, include=FALSE, echo=FALSE}
library(knitr)
```
```{r insert-fun, echo=FALSE}
@Thell
Thell / SpanError.md
Created June 22, 2015 20:08
Closing span tag parsing error.

\begin{equation*} 1 \end{equation*}

@Thell
Thell / MathjaxVer.Rmd
Created August 7, 2015 18:04
RStudio MathJax Version
---
output: html_document
---
### RStudio MathJax and the preview window/pane
When $MathJax$ is rendered it should be using
```{r}
Sys.getenv(x = "RMARKDOWN_MATHJAX_PATH")