Browse code

Rprofile - v0.1 - Fix a minor bug

Fred authored on06/08/2014 16:52:18
Showing1 changed files
... ...
@@ -1,8 +1,8 @@
1 1
 # Title: .Rprofile
2 2
 # Author: Frédéric CHEVALIER <f15.chevalier@gmail.com>
3
-# Version: 0.0
3
+# Version: 0.1
4 4
 # Created in: 2014-07-06
5
-# Modified in:
5
+# Modified in: 2014-08-06
6 6
 
7 7
 
8 8
 
... ...
@@ -19,6 +19,7 @@
19 19
 # Versions #
20 20
 #==========#
21 21
 
22
+# v0.1 - 2014-08-06: bug correction about interactivity (curly brackets missing)
22 23
 # v0.0 - 2014-07-06: creation
23 24
 
24 25
 
... ...
@@ -28,7 +29,7 @@
28 29
 #=======================#
29 30
 
30 31
 # Test if it is an interactive session
31
-if(interactive())
32
+if (interactive()) {
32 33
 
33 34
 # Create a new invisible environment for all the functions to go in so it doesn't clutter your workspace
34 35
 .startup <- new.env()
... ...
@@ -56,11 +57,11 @@ require(utils, quietly = TRUE)
56 57
 	
57 58
 	# Add colors to prompt
58 59
 	options(colorout.anyterm = TRUE)
59
-    if(! .startup$is.installed("colorout")) {
60
-        cat("If you want colored prompt, you should install the colorout package.\nLink: http://www.lepem.ufc.br/jaa/colorout.html\n\n")
61
-    } else {
62
-        library('colorout')
63
-    	setOutputColors256(
60
+	if(! .startup$is.installed("colorout")) {
61
+		cat("If you want colored prompt, you should install the colorout package.\nLink: http://www.lepem.ufc.br/jaa/colorout.html\n\n")
62
+	} else {
63
+		library('colorout')
64
+		setOutputColors256(
64 65
 	    	normal = 40,
65 66
 		    number = 214,
66 67
     		string = 85,
... ...
@@ -69,13 +70,13 @@ require(utils, quietly = TRUE)
69 70
     		error = c(1, 0, 1),
70 71
 	    	warn = c(1, 0, 100)
71 72
     	)
72
-	    cat("\n")
73
+		cat("\n")
73 74
     }
74 75
 	
75
-    # Enlarge columns display in R terminal
76
+	# Enlarge columns display in R terminal
76 77
 	# source: http://stackoverflow.com/questions/1172485/how-to-increase-the-number-of-columns-using-r-in-linux
77 78
 	wideScreen <- function(howWide=Sys.getenv("COLUMNS")) {
78
-	     options(width=as.integer(howWide))
79
+		options(width=as.integer(howWide))
79 80
 	wideScreen()
80 81
 	}
81 82
 
... ...
@@ -127,3 +128,5 @@ if (capabilities()[["tcltk"]] && require(tcltk2, quietly=TRUE)) {
127 128
 
128 129
 # Attach all the variables above
129 130
 attach(.startup)
131
+
132
+} # End of interactive statement