-
Notifications
You must be signed in to change notification settings - Fork 0
/
22-06-01.Rmd
105 lines (87 loc) · 1.21 KB
/
22-06-01.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
title: "teste"
output: html_document
date: '2022-06-01'
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
cars
```
```{r}
head(mtcars, n=5)
```
```{r}
tail(cars,n=5)
```
```{r cars}
summary(cars)
```
## Including Plots
You can also embed plots, for example:
```{r pressure, echo=FALSE}
plot(cars)
```
```{r}
seq(0,8, by=2)
```
```{r}
rep(c(0,1,2),each =10)
```
```{r}
10:pi
```
```{r}
help(':')
```
```{r}
my_seq = seq.int(0,10,length=30)
my_seq
```
```{r}
pi:10
10:pi
```
```{r}
oi = NA
oi2 = 0/0
oi3 = 1/0
oi4 = NULL
oi5 = 5
oi6 = -1/0
is.na(oi)
is.nan(oi2)
is.infinite(oi3)
is.null(oi4)
is.finite(oi5)
is.infinite(oi5)
```
```{r}
mtcars[2:4]
```
```{r}
mtcars[1,0:10]
```
```{r}
invert = function(lista){
return(lista[length(lista):1])
}
invert(c(1,2,3,4))
```
```{r}
est = function(lista) {
return(c(min(lista),max(lista),median(lista), quantile(lista,probs=c(0,0.25,0.5,0.75,1))))
}
est(c(1,2,3,4,5,6,7,8,9,10))
```
```{r}
install.packages("tidyverse")
library(tidyverse)
library(dplyr)
c(1,10) %>% mean()
```
```{r}
library(rhs)
(1:10)/3 |> sum |> mean |> round(digits=1)
```