R programming language


Say we have the two following groups : g1 <- c(55, 65, 58) g2 <- c(12, 18, 32) We want to see if the two groups belong to the same distribution or can be considered as different groups. We might be tempted to try a Student’s t-test. t.test(g1, g2) ## Welch Two Sample t-test ## ## data: g1 and g2 ## t = 5.8366, df = 2.9412, p-value = 0.01059 ## alternative hypothesis: true difference in means is not equal [...]

By | 2017-04-30T10:15:37+00:00 October 14, 2015|Categories: Data Analysis, R, Statistics|0 Comments

Don’t ignore the warnings!

I'm sure that all of you R users have now noticed that sometimes R is talking to you. When you do something wrong, R replies with a message written in red in the console. How many of you actually read those error messages? If you take the time to read them carefully, you'll get a hint about what was wrong in your command. Let's look at an example: > sum(c('1','3','4','4')) Error in sum(c("1", "3", "4", "4")) : invalid 'type' (character) [...]

By | 2017-04-30T16:25:19+00:00 September 3, 2015|Categories: R, Statistics|0 Comments

Be better at programming with static program analysis

- What is static program analysis ? Static program analysis allows the gathering of informations about the execution behaviour of your code without actually executing it. It is the opposite of dynamic program analysis (like debugging) which required the code to be executed. - Ok! But why should I use this in practice ? To save time by suppressing the save/execute cycles induced by syntax errors (missing ";", function or variable not initialized, typos, ...). Correcting these errors at the [...]

By | 2017-04-29T17:13:51+00:00 May 8, 2015|Categories: Performance, Python, R|Tags: , |0 Comments

Identifying a point in ggplot2

So you have spent much time converting your simple R plot to a full-fledged ggplot2 graph with all its bells and whistles just to find that you are unable to identify a point on this graph to further investigate it. Indeed, the typical identify method is not applicable to ggplot2 graphs. Fortunately, there is a solution, which involves performing all the work yourself by going under the hood of ggplot2 to access the low-level graphics system on which it is [...]

By | 2017-05-01T10:13:03+00:00 March 11, 2015|Categories: Data Visualization, R|Tags: |0 Comments

Table-reading: loading data into R without a hassle

The first thing I have learned in R is how to load a table. Usually, when you start your R journey, someone more knowledgeable will tell you how to do this very first action. It will typically be: data<-read.table("~/SomeFolder/datafile.txt") You probably will be adding various parameters into the brackets such as "row.names=0" or "header=TRUE" or, "sep="\t"", to make sure you are reading your file correctly. And this is perfectly fine, as a loading method of small datasets. However, to maximize [...]

By | 2017-04-29T17:14:58+00:00 February 5, 2015|Categories: Bioinformatics, R|Tags: |1 Comment