Shige's Research Blog

Monday, April 07, 2014

Play with C++ code in Rstudio

I am not a C++ programmer but sometimes I need to play with some C++ code. On my Linux workstation, I have the complete GNU tool chain installed. I don't really want to do that on my tiny Windows ultrabook because ... well, it's tiny and I want to keep it that way.

I do have R (and the magical Rcpp package), Rtools, and Rstudio installed on my ultrabook. I just realized how trivial it is to tweak C++ code fragments using these tools together.

For example, in order to run this very simple C++ code fragment:

===========================================
#include <iostream>
using std::cout;

int main() {
for (int hashNum = 1; hashNum <= 5; hashNum++) {
cout << "#";
}
cout << "\n";
return 0;
}
===========================================

One just need to add a few lines so that the code looks like this:

===========================================
#include <Rcpp.h>

using std::cout;
using namespace Rcpp;

// [[Rcpp::export]]
int main() {
  for (int hashNum = 1; hashNum <= 5; hashNum++) {
cout << "#";
}
cout << "\n";
return 0;
}

/*** R
main()
*/
===========================================

Hit Ctrl + Enter, problem solved!

Tuesday, April 01, 2014

Data analysis on AWS cloud

Here is a good introduction on how to get started with data analysis on AWS cloud.

Sunday, March 30, 2014

More on pandoc and markdown

This post explains how to use citation and reference in a pandoc markdown document.

Saturday, March 29, 2014

Texts, a pandoc editor

I really like this Pandoc editor I bought. It is small, lightweight, and elegant. More importantly, combined with the Pandoc engine, it can handle long and complicated documents. I also like the this review. This short article also looks very interesting (and this guy is a sociologist!).

CuteMarkEd is another promising markdown editor. It is a free and open source project.

Tuesday, March 18, 2014

Manjaro

Manjaro is a Linux distro based on Arch. Based on this review, it has become a real competitor of Ubuntu and Mint. I should give a try sometime.

Rstudio

By integrating R, markdown, and many other exciting new technologies, Rstudio has become a complete and fascinating data analysis environment.

Monday, March 17, 2014

Ceemple

Ceemple takes a different approach to scientific computing: it is based on C++ and integrates a large number of scientific libraries into an intuitive IDE. It is free for academic use but so far is Windows-only.

Counter