Category Archives: R

Installing R on Mac OS from the command line

I just updated R remotely. I wanted to avoid the hassle of logging in via VNC (“Screen Sharing”), so I did this: Now, to get RStudio from the command-line: Advertisements

Posted in Mac, R | Tagged , | Leave a comment

Install Shiny Server on OS X 10.8.4

The instructions here work pretty much without modification. The only tweak I made was to how I installed the shiny package. From Terminal, I ran R as root (sudo R) and then installed shiny using something like install.packages(‘shiny’, repos=’http://cran.rstudio.com/’, type=’source’, … Continue reading

Posted in Mac, R | 3 Comments

RPostgreSQL (R) versus psycopg (Python)

Here’s a rather simplistic comparison of the performance of R and Python in getting data from PostgreSQL. R: Time taken: 26-27 seconds. Python: Time taken: Around 6 seconds. I’m impressed. I’ve never really been bothered by performance in getting data … Continue reading

Posted in PostgreSQL, R | Tagged , , | Leave a comment

Remote WRDS SAS from R

Here’s an illustration of how once can get something like PC Connect SAS from R. The following code takes a ticker and a date and then pulls TAQ consolidated trade and quote data from WRDS. Note that this is probably … Continue reading

Posted in R, SAS | Tagged , | 19 Comments

Calling Apophenia library from R

I struggled to get the code (markov.c) on p.129 of the book “Modeling with Data” to work. It turns out that the code needs to be modified to the following (the author of the book tells me that the current … Continue reading

Posted in R, Uncategorized | Leave a comment

Linking R to GSL

I put the following in r_gsl_test.c Then ran PKG_LIBS=”-lgsl” R CMD SHLIB r_gsl_test.c at the command line (obviously, I need to have GSL installed). Then tested using the following R code: No huge speed advantage evident here, though it is … Continue reading

Posted in R | Leave a comment

Code for 5.2.5 Extended Example: A Salary Study from “The Art of R Programming”

Here is code for 5.2.5 Extended Example: A Salary Study from “The Art of R Programming“. The primary addition to the code in the book is the addition of code to get the data from the Department of Labor’s website.

Posted in R | Tagged , | Leave a comment