Monday, December 1, 2014

Book Review: R Object-oriented Programming

Recently, Packt Publishing publish the book R Object-oriented Programming. The eleven chapter book covers from basic data types in R to a more advanced method such as simulation and writing functions.  Different data types (i.e. integer, character, factor) are discussed in-depth in the book as well as numeric and string operations. The good thing with it is that it walks the reader from simple to complicated topic making it easier to learn the language. There are two chapters dedicated in discussing about S3 and S4 classes which are not commonly found published books about R. The last two chapters of the book are dedicated case studies wherein the reader can apply all the learnings from previous chapter. A very good book for beginners and basic users who want to advance their skill and explore the full potential of R as a programming language. Good book to have!

Friday, November 14, 2014

Scatter Plot Matrices in R

One of our graduate student ask me on how he can check for correlated variables on his dataset. Using R, his problem can be done is three (3) ways. First, he can use the cor function of the stat package to calculate correlation coefficient between variables. Second, he can use functions such as pairs (graphics) to visually check possible correlated variables. Third, he can combine the first two approach following the example of vinux in stackoverflow or using ggpairs function of GGally package.

First Approach

             Sepal.Length Sepal.Width Petal.Length Petal.Width
Sepal.Length    1.0000000  -0.1175698    0.8717538   0.8179411
Sepal.Width    -0.1175698   1.0000000   -0.4284401  -0.3661259
Petal.Length    0.8717538  -0.4284401    1.0000000   0.9628654
Petal.Width     0.8179411  -0.3661259    0.9628654   1.0000000

Second Approach

Third Approach


Saturday, August 9, 2014

Book Review: Bioinformatics with R Cookbook

The book BioInformaticswith R Cookbook is a 340 pages book published by PACKT publishing last June. The book is intended for individuals working on the areas of biology and genetics. Most of the techniques and type of analysis (i.e. sequence, protein structure, microarray, etc.) discussed in the book are tailored for practitioners handling genomics data. A typical cookbook style material, the focus of the book is on how to implement the above mentioned techniques using R. The book also tackles procedure on how to connect with genomics databases such as Kyoto Encyclopedia of Genes and Genomes (KEGG) and Gene Ontology as through the Bioconductor platform.  It also tackles access some cloud base implementation of R. The structure of the discussion is very helpful and easy to follow. The How to Do it, How it works, and There’s more.. sequence of discussion provides readers a good guide and grasp on the techniques that are being discussed.
On the other hand, the book is somehow lacking in the discussion of the basics of R software (i.e. intro to the language and data type). The book assumes that the readers have already acquired these basic know how about the language.
Overall, the book is a good reference material especially for individuals dealing with data on biology and genomics.  

Sunday, June 15, 2014

Creating Inset Map with ggplot2

According to one of the reason for using inset map is to provide a reference for an area for unfamiliar readers.  Inset map is also considered a great asset for cartographers.  Most of the GIS software available in the market have a provision for non-cartographer and beginners to create inset map. However, for R users who are into making maps, creating inset map is a bit challenging. Thanks to the post of Pascal Mickelson and Scott Chamberlain which gave users like me a guide on how to create inset map in R using ggplot2. Below is an example of map with inset created using R.

Monday, June 2, 2014

Social Media Mining with R (Book Review)

The book Social Media Mining with R is a timely text for researchers and practitioners, specially those in social sciences who want to apply the methods of social media mining and learn basic R. The author provided a good balance of theory and step-by-step approach on how to implement different social media mining techniques (e.g. lexicon-based sentiments). However, the book lacks thorough explanation on how to interpret results from the different social media mining techniques.

The book is useful as complementary material. Major books on social media mining and learning R are still necessary.

Sunday, June 1, 2014

Malawi Animated Rainfall Map

Couple of months ago, Charles Langton Vanya of Malawi contacted me on how to make animated rainfall map  in R. I was very busy that I was not able to respond. Anyway, to Mr. Vanya, here is the code you can play on to produce a similar map as below.

Saturday, May 31, 2014

Mindoro Digital Elevation Map Updated

Almost 2 years ago, I made a post on creating digital elevation map using R. For that post, I used the basic R plotting function to create the map. Recently, I started learning to use ggplot2 package for visualizing data. Today, I created the same map that I did two years ago, using raster and gpplot2, its for you guys to tell the difference.

Happy Coding! Use R!



Sunday, March 2, 2014

Introduction to R for Quantitative Finance Introduction to R for Quantitative Finance (Book Review)

Last November 2013, PACKT Publishing launched the Introduction to R for Quantitative Finance. The book around  which is around 164 pages (including cover page and back pages) discuss the implementation different quantitative methods used in finance using R language . The book consists of nine (9) chapters  cover topics from time series analysis to finance networks.

For individuals with little background in quantitative methods in finance, the theoretical and application discussion in the start of each chapter provided a good overview and basics of the method being discussed. Also, the problem-solution approached used by the authors added practicality on the used of the book for quantitative analysis. However, for individuals (i.e. finance people)  with little R background, the book somehow lacks the basic introduction to the R language and environment commonly found in most R books and tutorials. I think for finance individuals who are R beginners, it will be handy to use this book along with R introductory books/websites (e.g. Instant R, Quick R)