I want to know how to generate an automatized sequence from 0 to 100, with numbers each 5 positions only, all the rest should be NA values. At the end I would like to have something like this:
> labCol
[1] 0 NA NA NA NA 5 NA NA NA NA 10 NA NA NA NA 15 NA ..... 100
I have done this example manually like this, but it is time consuming:
labCol <- c(0, NA, NA, NA, NA, 5, NA, NA, NA, NA, 10, NA, NA, NA, NA, 15, NA, ... 100 )
I can't find an option in the seq()
function to do this.
This problem is because I'm doing a Heat Map with the function heatmap.2()
of the gplots
package, and the column labels are too close to read. Neither can I set the labels every 5 or 10 positions. That is why I need generate my own label sequence with NA values to avoid this overlapping.
Any suggestion is welcome :)