8
8
< meta name ="generator " content ="slidify " />
9
9
< meta name ="apple-mobile-web-app-capable " content ="yes ">
10
10
< meta http-equiv ="X-UA-Compatible " content ="chrome=1 ">
11
- < link rel ="stylesheet " href ="../../libraries /frameworks/io2012/css/default.css " media ="all " >
12
- < link rel ="stylesheet " href ="../../libraries /frameworks/io2012/phone.css "
11
+ < link rel ="stylesheet " href ="../../librariesNew /frameworks/io2012/css/default.css " media ="all " >
12
+ < link rel ="stylesheet " href ="../../librariesNew /frameworks/io2012/css /phone.css "
13
13
media ="only screen and (max-device-width: 480px) " >
14
- < link rel ="stylesheet " href ="../../libraries/frameworks/io2012/css/slidify.css " >
15
- < link rel ="stylesheet " href ="../../libraries/highlighters/highlight.js/css/tomorrow.css " />
16
- < base target ="_blank "> <!-- This amazingness opens all links in a new tab. -->
17
- < script data-main ="../../libraries/frameworks/io2012/js/slides "
18
- src ="../../libraries/frameworks/io2012/js/require-1.0.8.min.js ">
14
+ < link rel ="stylesheet " href ="../../librariesNew/frameworks/io2012/css/slidify.css " >
15
+ < link rel ="stylesheet " href ="../../librariesNew/highlighters/highlight.js/css/tomorrow.css " />
16
+ < base target ="_blank "> <!-- This amazingness opens all links in a new tab. -->
17
+
18
+ <!-- Grab CDN jQuery, fall back to local if offline -->
19
+ < script src ="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.min.js "> </ script >
20
+ < script > window . jQuery || document . write ( '<script src="../../librariesNew/widgets/quiz/js/jquery.js"><\/script>' ) </ script >
21
+ < script data-main ="../../librariesNew/frameworks/io2012/js/slides "
22
+ src ="../../librariesNew/frameworks/io2012/js/require-1.0.8.min.js ">
19
23
</ script >
20
24
21
- < link rel ="stylesheet " href = "../../assets/css/custom.css ">
22
- < link rel ="stylesheet " href = "../../assets/css/custom.css.BACKUP.546.css ">
23
- < link rel ="stylesheet " href = "../../assets/css/custom.css.BASE.546.css ">
24
- < link rel ="stylesheet " href = "../../assets/css/custom.css.LOCAL.546.css ">
25
- < link rel ="stylesheet " href = "../../assets/css/custom.css.orig ">
26
- < link rel ="stylesheet " href = "../../assets/css/custom.css.REMOTE.546.css ">
27
- < link rel ="stylesheet " href = "../../assets/css/ribbons.css ">
25
+
28
26
29
27
</ head >
30
28
< body style ="opacity: 0 ">
31
29
< slides class ="layout-widescreen ">
32
30
33
31
<!-- LOGO SLIDE -->
34
- <!-- END LOGO SLIDE -->
32
+ < slide class ="title-slide segue nobackground ">
33
+ < aside class ="gdbar ">
34
+ < img src ="../../assets/img/bloomberg_shield.png ">
35
+ </ aside >
36
+ < hgroup class ="auto-fadein ">
37
+ < h1 > Dates and Times in R</ h1 >
38
+ < h2 > </ h2 >
39
+ < p > Roger D. Peng, Associate Professor of Biostatistics< br /> Johns Hopkins Bloomberg School of Public Health</ p >
40
+ </ hgroup >
41
+ < article > </ article >
42
+ </ slide >
35
43
36
44
37
- <!-- TITLE SLIDE -->
38
- <!-- Should I move this to a Local Layout File? -->
39
- < slide class ="title-slide segue nobackground ">
40
- < aside class ="gdbar ">
41
- < img src ="../../assets/img/bloomberg_shield.png ">
42
- </ aside >
43
- < hgroup class ="auto-fadein ">
44
- < h1 > Dates and Times in R</ h1 >
45
- < h2 > </ h2 >
46
- < p > Roger D. Peng, Associate Professor of Biostatistics< br /> Johns Hopkins Bloomberg School of Public Health</ p >
47
- </ hgroup >
48
- </ slide >
49
-
50
45
<!-- SLIDES -->
51
- < slide class ="" id ="slide-1 " style ="background:; ">
46
+ < slide class ="" id ="slide-1 " style ="background:; ">
52
47
< hgroup >
53
48
< h2 > Dates and Times in R</ h2 >
54
49
</ hgroup >
55
- < article >
50
+ < article data-timings ="" >
56
51
< p > R has developed a special representation of dates and times</ p >
57
52
58
53
< ul >
@@ -66,11 +61,11 @@ <h2>Dates and Times in R</h2>
66
61
<!-- Presenter Notes -->
67
62
</ slide >
68
63
69
- < slide class ="" id ="slide-2 " style ="background:; ">
64
+ < slide class ="" id ="slide-2 " style ="background:; ">
70
65
< hgroup >
71
66
< h2 > Dates in R</ h2 >
72
67
</ hgroup >
73
- < article >
68
+ < article data-timings ="" >
74
69
< p > Dates are represented by the Date class and can be coerced from a character string using the < code > as.Date()</ code > function.</ p >
75
70
76
71
< pre > < code class ="r "> x <- as.Date("1970-01-01")
@@ -86,11 +81,11 @@ <h2>Dates in R</h2>
86
81
<!-- Presenter Notes -->
87
82
</ slide >
88
83
89
- < slide class ="" id ="slide-3 " style ="background:; ">
84
+ < slide class ="" id ="slide-3 " style ="background:; ">
90
85
< hgroup >
91
86
< h2 > Times in R</ h2 >
92
87
</ hgroup >
93
- < article >
88
+ < article data-timings ="" >
94
89
< p > Times are represented using the < code > POSIXct</ code > or the < code > POSIXlt</ code > class</ p >
95
90
96
91
< ul >
@@ -110,11 +105,11 @@ <h2>Times in R</h2>
110
105
<!-- Presenter Notes -->
111
106
</ slide >
112
107
113
- < slide class ="" id ="slide-4 " style ="background:; ">
108
+ < slide class ="" id ="slide-4 " style ="background:; ">
114
109
< hgroup >
115
110
< h2 > Times in R</ h2 >
116
111
</ hgroup >
117
- < article >
112
+ < article data-timings ="" >
118
113
< p > Times can be coerced from a character string using the < code > as.POSIXlt</ code > or < code > as.POSIXct</ code > function.</ p >
119
114
120
115
< pre > < code class ="r "> x <- Sys.time()
@@ -132,11 +127,11 @@ <h2>Times in R</h2>
132
127
<!-- Presenter Notes -->
133
128
</ slide >
134
129
135
- < slide class ="" id ="slide-5 " style ="background:; ">
130
+ < slide class ="" id ="slide-5 " style ="background:; ">
136
131
< hgroup >
137
132
< h2 > Times in R</ h2 >
138
133
</ hgroup >
139
- < article >
134
+ < article data-timings ="" >
140
135
< p > You can also use the < code > POSIXct</ code > format.</ p >
141
136
142
137
< pre > < code class ="r "> x <- Sys.time()
@@ -155,19 +150,26 @@ <h2>Times in R</h2>
155
150
<!-- Presenter Notes -->
156
151
</ slide >
157
152
158
- < slide class ="" id ="slide-6 " style ="background:; ">
153
+ < slide class ="" id ="slide-6 " style ="background:; ">
159
154
< hgroup >
160
155
< h2 > Times in R</ h2 >
161
156
</ hgroup >
162
- < article >
163
- < p > Finally, there is the < code > strptime</ code > function in case your dates are written in a different format</ p >
157
+ < article data-timings ="">
158
+ < p > Finally, there is the < code > strptime</ code > function in case your dates are
159
+ written in a different format</ p >
164
160
165
- < pre > < code class ="r "> datestring <- c("January 10, 2012 10:40", "December 9, 2011
161
+ < pre > < code class ="r "> datestring <- c("January 10, 2012 10:40", "December 9, 2011 9:10")
166
162
x <- strptime(datestring, "%B %d, %Y %H:%M")
167
163
x
168
- ## [1] "2012-01-10 10:40:00" "2011-12-09 09:10:00"
169
- class(x)
170
- ## [1] "POSIXlt" "POSIXt"
164
+ </ code > </ pre >
165
+
166
+ < pre > < code > ## [1] "2012-01-10 10:40:00 EST" "2011-12-09 09:10:00 EST"
167
+ </ code > </ pre >
168
+
169
+ < pre > < code class ="r "> class(x)
170
+ </ code > </ pre >
171
+
172
+ < pre > < code > ## [1] "POSIXlt" "POSIXt"
171
173
</ code > </ pre >
172
174
173
175
< p > I can < em > never</ em > remember the formatting strings. Check < code > ?strptime</ code > for details.</ p >
@@ -176,11 +178,11 @@ <h2>Times in R</h2>
176
178
<!-- Presenter Notes -->
177
179
</ slide >
178
180
179
- < slide class ="" id ="slide-7 " style ="background:; ">
181
+ < slide class ="" id ="slide-7 " style ="background:; ">
180
182
< hgroup >
181
183
< h2 > Operations on Dates and Times</ h2 >
182
184
</ hgroup >
183
- < article >
185
+ < article data-timings ="" >
184
186
< p > You can use mathematical operations on dates and times. Well, really just + and -. You can do comparisons too (i.e. ==, <=)</ p >
185
187
186
188
< pre > < code class ="r "> x <- as.Date("2012-01-01")
@@ -198,11 +200,11 @@ <h2>Operations on Dates and Times</h2>
198
200
<!-- Presenter Notes -->
199
201
</ slide >
200
202
201
- < slide class ="" id ="slide-8 " style ="background:; ">
203
+ < slide class ="" id ="slide-8 " style ="background:; ">
202
204
< hgroup >
203
205
< h2 > Operations on Dates and Times</ h2 >
204
206
</ hgroup >
205
- < article >
207
+ < article data-timings ="" >
206
208
< p > Even keeps track of leap years, leap seconds, daylight savings, and time zones.</ p >
207
209
208
210
< pre > < code class ="r "> x <- as.Date("2012-03-01") y <- as.Date("2012-02-28")
@@ -218,11 +220,11 @@ <h2>Operations on Dates and Times</h2>
218
220
<!-- Presenter Notes -->
219
221
</ slide >
220
222
221
- < slide class ="" id ="slide-9 " style ="background:; ">
223
+ < slide class ="" id ="slide-9 " style ="background:; ">
222
224
< hgroup >
223
225
< h2 > Summary</ h2 >
224
226
</ hgroup >
225
- < article >
227
+ < article data-timings ="" >
226
228
< ul >
227
229
< li > Dates and times have special classes in R that allow for numerical and statistical calculations</ li >
228
230
< li > Dates use the < code > Date</ code > class</ li >
@@ -236,34 +238,89 @@ <h2>Summary</h2>
236
238
237
239
< slide class ="backdrop "> </ slide >
238
240
</ slides >
239
-
240
- <!--[if IE]>
241
+ < div class ="pagination pagination-small " id ='io2012-ptoc ' style ="display:none; ">
242
+ < ul >
243
+ < li >
244
+ < a href ="# " target ="_self " rel ='tooltip '
245
+ data-slide =1 title ='Dates and Times in R '>
246
+ 1
247
+ </ a >
248
+ </ li >
249
+ < li >
250
+ < a href ="# " target ="_self " rel ='tooltip '
251
+ data-slide =2 title ='Dates in R '>
252
+ 2
253
+ </ a >
254
+ </ li >
255
+ < li >
256
+ < a href ="# " target ="_self " rel ='tooltip '
257
+ data-slide =3 title ='Times in R '>
258
+ 3
259
+ </ a >
260
+ </ li >
261
+ < li >
262
+ < a href ="# " target ="_self " rel ='tooltip '
263
+ data-slide =4 title ='Times in R '>
264
+ 4
265
+ </ a >
266
+ </ li >
267
+ < li >
268
+ < a href ="# " target ="_self " rel ='tooltip '
269
+ data-slide =5 title ='Times in R '>
270
+ 5
271
+ </ a >
272
+ </ li >
273
+ < li >
274
+ < a href ="# " target ="_self " rel ='tooltip '
275
+ data-slide =6 title ='Times in R '>
276
+ 6
277
+ </ a >
278
+ </ li >
279
+ < li >
280
+ < a href ="# " target ="_self " rel ='tooltip '
281
+ data-slide =7 title ='Operations on Dates and Times '>
282
+ 7
283
+ </ a >
284
+ </ li >
285
+ < li >
286
+ < a href ="# " target ="_self " rel ='tooltip '
287
+ data-slide =8 title ='Operations on Dates and Times '>
288
+ 8
289
+ </ a >
290
+ </ li >
291
+ < li >
292
+ < a href ="# " target ="_self " rel ='tooltip '
293
+ data-slide =9 title ='Summary '>
294
+ 9
295
+ </ a >
296
+ </ li >
297
+ </ ul >
298
+ </ div > <!--[if IE]>
241
299
<script
242
300
src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js">
243
301
</script>
244
302
<script>CFInstall.check({mode: 'overlay'});</script>
245
303
<![endif]-->
246
304
</ body >
247
- <!-- Grab CDN jQuery, fall back to local if offline -->
248
- < script src ="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.min.js "> </ script >
249
- < script > window . jQuery || document . write ( '<script src="../../libraries/widgets/quiz/js/jquery-1.7.min.js"><\/script>' ) </ script >
250
- <!-- Load Javascripts for Widgets -->
251
- <!-- MathJax: Fall back to local if CDN offline but local image fonts are not supported (saves >100MB) -->
252
- < script type ="text/x-mathjax-config ">
253
- MathJax . Hub . Config ( {
254
- tex2jax : {
255
- inlineMath : [ [ '$' , '$' ] , [ '\\(' , '\\)' ] ] ,
256
- processEscapes : true
257
- }
258
- } ) ;
259
- </ script >
260
- < script type ="text/javascript " src ="http://cdn.mathjax.org/mathjax/2.0-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML "> </ script >
261
- <!-- <script src="https://c328740.ssl.cf1.rackcdn.com/mathjax/2.0-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
262
- </script> -->
263
- < script > window . MathJax || document . write ( '<script type="text/x-mathjax-config">MathJax.Hub.Config({"HTML-CSS":{imageFont:null}});<\/script><script src="../../libraries/widgets/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"><\/script>' )
305
+ <!-- Load Javascripts for Widgets -->
306
+
307
+ <!-- MathJax: Fall back to local if CDN offline but local image fonts are not supported (saves >100MB) -->
308
+ < script type ="text/x-mathjax-config ">
309
+ MathJax . Hub . Config ( {
310
+ tex2jax : {
311
+ inlineMath : [ [ '$' , '$' ] , [ '\\(' , '\\)' ] ] ,
312
+ processEscapes : true
313
+ }
314
+ } ) ;
315
+ </ script >
316
+ < script type ="text/javascript " src ="http://cdn.mathjax.org/mathjax/2.0-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML "> </ script >
317
+ <!-- <script src="https://c328740.ssl.cf1.rackcdn.com/mathjax/2.0-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
318
+ </script> -->
319
+ < script > window . MathJax || document . write ( '<script type="text/x-mathjax-config">MathJax.Hub.Config({"HTML-CSS":{imageFont:null}});<\/script><script src="../../librariesNew/widgets/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"><\/script>' )
264
320
</ script >
265
321
<!-- LOAD HIGHLIGHTER JS FILES -->
266
- < script src ="../../libraries/highlighters/highlight.js/highlight.pack.js "> </ script >
267
- < script > hljs . initHighlightingOnLoad ( ) ; </ script >
268
- <!-- DONE LOADING HIGHLIGHTER JS FILES -->
269
- </ html >
322
+ < script src ="../../librariesNew/highlighters/highlight.js/highlight.pack.js "> </ script >
323
+ < script > hljs . initHighlightingOnLoad ( ) ; </ script >
324
+ <!-- DONE LOADING HIGHLIGHTER JS FILES -->
325
+
326
+ </ html >
0 commit comments