This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Vetores | |
vetor_inteiro <- 11:13 | |
vetor_numerico <- c(1.1,1.2,1.3) | |
vetor_texto <- letters[11:13] | |
vetor_imaginario <- c((1+1i), (1+2i),(1+1i)) | |
vetor_logico <- c(TRUE,FALSE,TRUE) | |
#Lista | |
lista <- list(vetor_inteiro,vetor_numerico,vetor_texto,vetor_imaginario,vetor_logico) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a <- "1" -> b | |
c <- "2" -> d | |
e <- "3" -> f | |
g <- "4" -> h | |
i <- "5" | |
filepath <- choose.files() | |
save.image(filepath) | |
#Save file with .RData extension |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Sequency | |
#For simple tests (don't use in prod) | |
1:9 | |
80:32 | |
4:-2 | |
3:3 | |
1:0 | |
#Seq Function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Special Values (NA, NaN, Inf e -Inf, Null) | |
#NA vs NULL | |
c(18,NA,NA,19,50) | |
c(18,NA,NULL,19,50) | |
class(NA) | |
#Create variables with special values | |
var_na = NA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Filters | |
mtcars | |
mtcars[2,5] #row,column | |
mtcars[2:4,5] | |
mtcars[2:4,5:7] | |
mtcars[8:9, c(1,2,4)] | |
mtcars[2:4, c("mpg", "wt")] | |
#Filter mpg >= 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "R Notebook" | |
output: html_notebook | |
--- | |
This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code. | |
Try executing this chunk by clicking the *Run* button within the chunk or by placing your cursor inside it and pressing *Ctrl+Shift+Enter*. | |
```{r} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "firstMarkdown" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) | |
``` | |
## R Markdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Primeiros Passos" | |
output: html_notebook | |
--- | |
Primeiro exemplo de notebook seguindo o [conteúdo](https://gist.github.com/LetticiaNicoli/4bc69bb982f070d337bc3dfae21a39c8) de vetores. | |
Alguns exemplos de tipos de vetores: | |
*Inteiro* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Review | |
#Vetor | |
vet_a = c(333658,19960204,829,399097,1234) | |
vet_b = vet_a * 2 | |
vet_c = vet_b / 3 | |
vet_d = vet_c + vet_a^2 #or vet_a**2 | |
vet_e = sqrt(vet_d) | |
vet_ai = rev(vet_a) #or vet_a[5:1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Mutiplicação Matrizes | |
vet_a = c(333658,19960204,829,399097,1234) | |
vet_b = vet_a * 2 | |
vet_c = vet_b / 3 | |
vet_d = vet_c + vet_a^2 #or vet_a**2 | |
vet_e = sqrt(vet_d) | |
vet_ai = rev(vet_a) #or vet_a[5:1] | |
m1 = matrix(data = c(vet_a,vet_b,vet_c,vet_d,vet_e,vet_ai), |
OlderNewer