-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cap03-09-Pacotes-e-Instalacao-de-Pacotes.R
60 lines (46 loc) · 1.24 KB
/
Cap03-09-Pacotes-e-Instalacao-de-Pacotes.R
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
# Pacotes e Instalação de Pacotes
# Obs: Caso tenha problemas com a acentuação, consulte este link:
# https://support.rstudio.com/hc/en-us/articles/200532197-Character-Encoding
# Configurando o diretório de trabalho
# Coloque entre aspas o diretório de trabalho que você está usando no seu computador
# Não use diretórios com espaço no nome
setwd("C:/FCD/BigDataRAzure/Cap03")
getwd()
# De onde vem as funções? Pacotes (conjuntos de funções)
# Quando você inicia o RStudio, alguns pacotes são
# carregados por padrão
# Busca os pacotes carregados
search()
# Instala e carrega os pacotes
install.packages(c("ggvis", "tm", "dplyr"))
library(ggvis)
library(tm)
require(dplyr)
search()
?require
detach(package:dplyr)
# Lista o conteúdo dos pacotes
?ls
ls(pos = "package:tm")
ls(getNamespace("tm"), all.names = TRUE)
# Lista as funções de um pacote
lsf.str("package:tm")
lsf.str("package:ggplot2")
library(ggplot2)
lsf.str("package:ggplot2")
# R possui um conjunto de datasets preinstalados.
library(MASS)
data()
?lynx
head(lynx)
head(iris)
tail(lynx)
summary(lynx)
plot(lynx)
hist(lynx)
head(iris)
iris$Sepal.Length
sum(Sepal.Length)
?attach
attach(iris)
sum(Sepal.Length)