@@ -144,6 +144,26 @@ In the 'Environment' window you will also get a table:
144
144
The 'Environment' window allows you to keep track of the objects you have
145
145
created in R.
146
146
147
+
148
+ ::::::::::::::::::::::::::::::::::::::::: callout
149
+
150
+ ## Tip: Use of white space for readability
151
+
152
+ The white spaces surrounding the assignment operator ` <- ` in the example
153
+ above (` first_value <- 1 ` ) is unnecessary. However, it does make your code
154
+ easier to read. There are several style guides you can follow, and choosing
155
+ one is up to you, but consistency is key!
156
+
157
+ A style guide we recommend is the Tidyverse [ style guide] ( https://style.tidyverse.org/ ) .
158
+ As they say:
159
+
160
+ "Good coding style is like correct punctuation: you can manage without it, butitsuremakesthingseasiertoread."
161
+
162
+ ::::::::::::::::::::::::::::::::::::::::::::::::::
163
+
164
+
165
+
166
+
147
167
::::::::::::::::::::::::::::::::::::::: challenge
148
168
149
169
## Exercise: Create some objects in R
@@ -193,8 +213,9 @@ Here are some important details about naming objects in R.
193
213
a colored highlight or RStudio gives you a suggested autocompletion you have
194
214
chosen a name that has a reserved meaning.
195
215
- ** Use the recommended assignment operator** : In R, we use '\< - ' as the
196
- preferred assignment operator. '=' works too, but is most commonly used in
197
- passing arguments to functions (more on functions later). There is a shortcut
216
+ preferred assignment operator, which is recommended by the Tidyverse
217
+ [ style guide] ( https://style.tidyverse.org/ ) discussed above. '=' works too, but is most
218
+ commonly used in passing arguments to functions (more on functions later). There is a shortcut
198
219
for the R assignment operator:
199
220
- Windows execution shortcut: <KBD >Alt</KBD >\+ <KBD >\- </KBD >
200
221
- Mac execution shortcut: <KBD >Option</KBD >\+ <KBD >\- </KBD >
0 commit comments