library(ggplot2)
df <- data.frame(Empresa =
c("Disney World",
"Florida Hospital",
"Publix Supermarkets Inc",
"Walmart Stores Ind",
"Univaersal Orlando"),
Asalariados =
c(51600,
19283,
14995,
14995,
12000))
knitr::kable(df)
| Empresa | Asalariados |
|---|---|
| Disney World | 51600 |
| Florida Hospital | 19283 |
| Publix Supermarkets Inc | 14995 |
| Walmart Stores Ind | 14995 |
| Univaersal Orlando | 12000 |
head(df)
## Empresa Asalariados
## 1 Disney World 51600
## 2 Florida Hospital 19283
## 3 Publix Supermarkets Inc 14995
## 4 Walmart Stores Ind 14995
## 5 Univaersal Orlando 12000
library(ggplot2)
ggplot(data=df, aes(x=Empresa, y=Asalariados)) + geom_bar(stat="identity")
ggplot(data=df, aes(x=Empresa, y=Asalariados)) + geom_bar(stat="identity") + coord_flip()
ggplot(data=df, aes(x=Empresa, y=Asalariados)) + geom_bar(stat="identity", width=0.5)
ggplot(data=df, aes(x=Empresa, y=Asalariados)) + geom_bar(stat="identity", color="blue", fill="white")
p <- ggplot(data=df, aes(x=Empresa, y=Asalariados)) + geom_bar(stat="identity", fill="steelblue") + theme_minimal()
p
library(ggplot2)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
specie <- c(rep("sorgho" , 3),
rep("poacee" , 3),
rep("banana" , 3),
rep("triticum" , 3))
condition <- rep(c("normal" , "stress" , "Nitrogen") , 4)
value <- abs(rnorm(12 , 0 , 15))
data <- data.frame(specie, condition, value)
knitr::kable(data)
| specie | condition | value |
|---|---|---|
| sorgho | normal | 10.0305514 |
| sorgho | stress | 13.6581473 |
| sorgho | Nitrogen | 11.9804859 |
| poacee | normal | 22.7171202 |
| poacee | stress | 3.6559661 |
| poacee | Nitrogen | 0.5526182 |
| banana | normal | 12.0870279 |
| banana | stress | 16.7395930 |
| banana | Nitrogen | 17.3048092 |
| triticum | normal | 3.0288642 |
| triticum | stress | 9.0109272 |
| triticum | Nitrogen | 0.0456306 |
head(data)
## specie condition value
## 1 sorgho normal 10.0305514
## 2 sorgho stress 13.6581473
## 3 sorgho Nitrogen 11.9804859
## 4 poacee normal 22.7171202
## 5 poacee stress 3.6559661
## 6 poacee Nitrogen 0.5526182
ggplot(data, aes(fill=condition, y=value, x=specie)) +
geom_bar(position="dodge", stat="identity")
ggplot(data, aes(fill=condition, y=value, x=specie)) +
geom_bar(position="stack", stat="identity")
df <- data.frame(Especialidad = c(rep("Finanzas", 2),
rep("Marketing", 2),
rep("Contabilidad", 2)),
Año = rep(c(2000, 2005), 3),
Matriculados = c(160, 250,
140, 200,
100, 150))
knitr::kable(df)
| Especialidad | Año | Matriculados |
|---|---|---|
| Finanzas | 2000 | 160 |
| Finanzas | 2005 | 250 |
| Marketing | 2000 | 140 |
| Marketing | 2005 | 200 |
| Contabilidad | 2000 | 100 |
| Contabilidad | 2005 | 150 |
ggplot(df, aes(fill = Especialidad, y = Matriculados, x = Año)) +
geom_bar(position="dodge", stat="identity")
ggplot(df, aes(fill = Especialidad, y = Matriculados, x = Año)) +
geom_bar(position="stack", stat="identity")
library(ggplot2)
library(dplyr)
data <- data.frame(group =
c("Transporte",
"Alojamiento",
"Alimentaión",
"Gastos de matricula",
"Varios"),
value = c(31, 25, 12, 20, 12))
knitr::kable(data)
| group | value |
|---|---|
| Transporte | 31 |
| Alojamiento | 25 |
| Alimentaión | 12 |
| Gastos de matricula | 20 |
| Varios | 12 |
ggplot(data, aes(x = "", y = value, fill=group)) +
geom_bar(stat = "identity", width = 1) +
coord_polar("y", start = 0)
library(ggplot2)
library(dplyr)
data <- data %>%
arrange(desc(group)) %>%
mutate(prop = value / sum(data$value) *100) %>%
mutate(ypos = cumsum(prop)- 0.5*prop )
require(scales)
## Loading required package: scales
ggplot(data, aes(x="", y = prop, fill=group)) +
geom_bar(stat="identity", width=1, color="white") +
coord_polar("y", start=0) +
theme_void() +
theme(legend.position="none") +
geom_text(aes(y = ypos, label = percent(value/100)), color = "white", size=6) +
scale_fill_brewer(palette="Set1")
library(ggQC)
library(ggplot2)
ggplot(df, aes(x = Error, y = Frecuencia)) +
stat_pareto(point.color = "red",
point.size = 3,
line.color = "black",
bars.fill = c("blue", "orange")) +
theme(axis.text.x = element_text(angle = 10))
df <- data.frame(calificaciones = c(78, 67, 65, 87, 75, 65, 71, 54, 94, 64, 84, 82, 81,
68, 85, 76, 89, 98, 59, 57, 79, 65, 59, 80, 67))
head(df)
## calificaciones
## 1 78
## 2 67
## 3 65
## 4 87
## 5 75
## 6 65
knitr::kable(head(df))
| calificaciones |
|---|
| 78 |
| 67 |
| 65 |
| 87 |
| 75 |
| 65 |
stem(df$calificaciones)
##
## The decimal point is 1 digit(s) to the right of the |
##
## 5 | 4799
## 6 | 4555778
## 7 | 15689
## 8 | 0124579
## 9 | 48
head(ChickWeight)
## weight Time Chick Diet
## 1 42 0 1 1
## 2 51 2 1 1
## 3 59 4 1 1
## 4 64 6 1 1
## 5 76 8 1 1
## 6 93 10 1 1
knitr::kable(head(ChickWeight))
| weight | Time | Chick | Diet |
|---|---|---|---|
| 42 | 0 | 1 | 1 |
| 51 | 2 | 1 | 1 |
| 59 | 4 | 1 | 1 |
| 64 | 6 | 1 | 1 |
| 76 | 8 | 1 | 1 |
| 93 | 10 | 1 | 1 |
stem(ChickWeight$weight)
##
## The decimal point is 1 digit(s) to the right of the |
##
## 2 | 599999999
## 4 | 00000111111111111111111112222222222222223333456678888888899999999999+38
## 6 | 00111111122222222333334444455555666677777888888900111111222222333334+8
## 8 | 00112223344444455555566777788999990001223333566666788888889
## 10 | 0000111122233333334566667778889901122223445555667789
## 12 | 00002223333344445555667788890113444555566788889
## 14 | 11123444455556666677788890011234444555666777777789
## 16 | 00002233334444466788990000134445555789
## 18 | 12244444555677782225677778889999
## 20 | 0123444555557900245578
## 22 | 0012357701123344556788
## 24 | 08001699
## 26 | 12344569259
## 28 | 01780145
## 30 | 355798
## 32 | 12712
## 34 | 1
## 36 | 13
stem(ChickWeight$weight, scale = 2)
##
## The decimal point is 1 digit(s) to the right of the |
##
## 3 | 599999999
## 4 | 00000111111111111111111112222222222222223333456678888888899999999999
## 5 | 000000111111112222333334445555566667778888899999
## 6 | 001111111222222223333344444555556666777778888889
## 7 | 0011111122222233333444444446667778889999
## 8 | 0011222334444445555556677778899999
## 9 | 0001223333566666788888889
## 10 | 00001111222333333345666677788899
## 11 | 01122223445555667789
## 12 | 0000222333334444555566778889
## 13 | 0113444555566788889
## 14 | 1112344445555666667778889
## 15 | 0011234444555666777777789
## 16 | 0000223333444446678899
## 17 | 0000134445555789
## 18 | 1224444455567778
## 19 | 2225677778889999
## 20 | 01234445555579
## 21 | 00245578
## 22 | 00123577
## 23 | 01123344556788
## 24 | 08
## 25 | 001699
## 26 | 12344569
## 27 | 259
## 28 | 0178
## 29 | 0145
## 30 | 35579
## 31 | 8
## 32 | 127
## 33 | 12
## 34 | 1
## 35 |
## 36 | 1
## 37 | 3
library(readr)
##
## Attaching package: 'readr'
## The following object is masked from 'package:scales':
##
## col_factor
library(knitr)
df <- read_csv("https://raw.githubusercontent.com/lihkir/AnalisisEstadisticoUN/main/Data/annual_csv.csv")
## Rows: 274 Columns: 3
## -- Column specification --------------------------------------------------------
## Delimiter: ","
## chr (1): Source
## dbl (2): Year, Mean
##
## i Use `spec()` to retrieve the full column specification for this data.
## i Specify the column types or set `show_col_types = FALSE` to quiet this message.
knitr::kable(head(df))
| Source | Year | Mean |
|---|---|---|
| GCAG | 2016 | 0.9363 |
| GISTEMP | 2016 | 0.9900 |
| GCAG | 2015 | 0.8998 |
| GISTEMP | 2015 | 0.8700 |
| GCAG | 2014 | 0.7408 |
| GISTEMP | 2014 | 0.7400 |
library(ggplot2)
library(dplyr)
ggplot(df, aes(x = Year, y = Mean)) +
geom_line(color="#69b3a2", size = 1) +
xlab("Year")