forked from tpemartin/110-1-r4ds-main
-
Notifications
You must be signed in to change notification settings - Fork 0
/
week9_1.Rmd
67 lines (40 loc) · 1.54 KB
/
week9_1.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
title: "week9 _1"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r cars}
summary(cars)
```
## Including Plots
You can also embed plots, for example:
```{r pressure, echo=FALSE}
plot(pressure)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
typeof(c("John", "Mary"))
typeof(c(2, 3.1412))
typeof(c(TRUE, TRUE, F))
class(c("John", "Mary"))
class(c(2, 3.1412))
class(c(TRUE, TRUE, F))
dateTimeInfo<-"2021-01-01 12:03:33"
typeof(dateTimeInfo)
class(dateTimeInfo)
dateTimeInfo + 20
"2021-01-01 12:03:33" + "20 seconds"
install.packages("lubridate")
lubridate::ymd_hms("2021-01-01 12:03:33")
lubridate::ymd_hms("2021-01-01 12:03:33") + lubridate::seconds(20)
lubridate::ymd_hms("2021-01-01 12:03:33") + lubridate::seconds(30)
dateTimeInfo2<-"2021-01-01 12:03:33"
dateTimeInfo2<-lubridate::ymd_hms("2021-01-01 12:03:33")
class(dateTimeInfo2)
dateTimeInfo2+lubridate::seconds (+50)
type: store "raw"info
class: what R can do with different infos