This file contains hidden or 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
# carregar base de dados em excel (import dataset from text (base)): BasesEstados | |
library(readxl) | |
BasesEstados <- read_excel("C:/Program Files/RStudio/Base_de_dados-master/BasesEstados.xlsx") | |
View(BasesEstados) | |
# carregar base de dados em csv (import dataset from text (readr)): FifaData.csv | |
library(readr) | |
Fifa <- read_csv("C:/Program Files/RStudio/Base_de_dados-master/FifaData.csv") | |
View(Fifa) |
This file contains hidden or 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
#resumo da variável | |
summary(CARROS$kmporlitro) | |
summary(BasesEstados$PIB) | |
#verificar os tipos dos objetos | |
class(Fifa$Nationality) | |
class(CARROS$Tipodecombustivel) | |
#transformar o tipo da variável | |
CARROS$Tipodecombustivel <- as.factor(CARROS$Tipodecombustivel) |
This file contains hidden or 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
# criar uma nova tabela | |
tabela_combustível <- table(CARROS$Tipodecombustivel_2) | |
# exibir a tabela com número absoluto | |
tabela_combustível | |
# exibir a tabela com número relativo | |
prop.table(tabela_combustível) | |
# exibir a tabela com número relativo em percentual |
This file contains hidden or 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
import React from ‘react’; | |
class Post extends React.Component { | |
//componentização | |
} |
This file contains hidden or 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
//components/Post.js | |
import React from ‘react’; | |
class Post extends React.Component { | |
render(){ | |
return <h1> Hello World</h1> | |
} | |
} |
This file contains hidden or 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
import React from ‘react’; | |
export default class Post extends React.Component { | |
//componentização | |
} |
This file contains hidden or 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
import React from ‘react’; | |
import Post from ‘Post’; | |
class Lista extends React.Component { | |
render(){ | |
return ( | |
<Post/> | |
<Post/> | |
<Post/> | |
); |
This file contains hidden or 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
import React from ‘react’; | |
import Post from ‘Post’; | |
class Lista extends React.Component { | |
render(){ | |
return ( | |
<Post title=”Aprendendo React”/> | |
<Post title=”A Rocketseat é massa !”/> | |
<Post title=”Não sei mais títulos.”/> | |
); |
This file contains hidden or 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
//components/Post.js | |
import React from ‘react’; | |
class Post extends React.Component { | |
render() { | |
return <h1>{this.props.title}</h1> | |
} | |
} |
This file contains hidden or 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
//components/Lista.js | |
import React from ‘react’; | |
import Post from ‘Post’; | |
class Lista extends React.Component { | |
state = { | |
posts: [ | |
{id: 1, title: ‘Aprendendo React.’}, |