Clean and tidy R-script

A tidy script is easy to grasp quickly, and also to quickly spot mistakes (missing coma/parenthesis/mistype in the command). If you get good typing habits, it will not cost you more time when creating the script, but it will save you (potentially a lot of) time when reading or fixing the script in future. Some suggestions follow.

Example of tidy script:

col.rain <- rainbow (n = 50)   # rainbow chooses colors from hue circle
col.terr <- terrain.colors (n = 20)  # terrain colors
col.topo <- topo.colors (n = 20)  # topo colors

barplot (1:50, col = col.rain)
barplot (1:20, col = col.terr)
barplot (1:20, col = col.topo)

... and example of untidy script:

col_rainbow<- rainbow (n=50 )
col.ter =terrain.colors (n= 20)
barplot( 1:50,col =col_rainbow )
col_topog <-  topo.colors ( n =20)
barplot (c(1,2,3,4,5, 6,7,8,9,10,11,12,13,14,15 ,16,17,18,19, 20) ,col=  col.ter)

barplot (seq(1,20 ),col =col_topog)