Prática No. 2
- Cargar las librerías: fdth, readr
- Cargar datos de starwars, verificar str() estructura y las variable descriptivas con summary()
- Generar tablas de distribución de frecuencias de la variable categóricas gender, homeworld, species
- Generar gráficas de barras con barplot()
- Generar tabla de distribución de frecuencias de la variable de height y mass
- Generar gráfica de barras con barplot()
- Subir al servicio rpubs
- Enviar enlace para su valoración
Las librerías
library(readr) # Leer datos
library(fdth) # Crear tablas de distribución
library(knitr) # kable
Cargar los datos
datos <- read.csv("https://raw.githubusercontent.com/rpizarrog/Curso-Titulacion-Data-Science-/master/2020/datos/starwars.csv")
kable(datos)
| 1 |
Luke Skywalker |
172 |
77.0 |
blond |
fair |
blue |
19.0 |
male |
Tatooine |
Human |
| 2 |
C-3PO |
167 |
75.0 |
NA |
gold |
yellow |
112.0 |
NA |
Tatooine |
Droid |
| 3 |
R2-D2 |
96 |
32.0 |
NA |
white, blue |
red |
33.0 |
NA |
Naboo |
Droid |
| 4 |
Darth Vader |
202 |
136.0 |
none |
white |
yellow |
41.9 |
male |
Tatooine |
Human |
| 5 |
Leia Organa |
150 |
49.0 |
brown |
light |
brown |
19.0 |
female |
Alderaan |
Human |
| 6 |
Owen Lars |
178 |
120.0 |
brown, grey |
light |
blue |
52.0 |
male |
Tatooine |
Human |
| 7 |
Beru Whitesun lars |
165 |
75.0 |
brown |
light |
blue |
47.0 |
female |
Tatooine |
Human |
| 8 |
R5-D4 |
97 |
32.0 |
NA |
white, red |
red |
NA |
NA |
Tatooine |
Droid |
| 9 |
Biggs Darklighter |
183 |
84.0 |
black |
light |
brown |
24.0 |
male |
Tatooine |
Human |
| 10 |
Obi-Wan Kenobi |
182 |
77.0 |
auburn, white |
fair |
blue-gray |
57.0 |
male |
Stewjon |
Human |
| 11 |
Anakin Skywalker |
188 |
84.0 |
blond |
fair |
blue |
41.9 |
male |
Tatooine |
Human |
| 12 |
Wilhuff Tarkin |
180 |
NA |
auburn, grey |
fair |
blue |
64.0 |
male |
Eriadu |
Human |
| 13 |
Chewbacca |
228 |
112.0 |
brown |
unknown |
blue |
200.0 |
male |
Kashyyyk |
Wookiee |
| 14 |
Han Solo |
180 |
80.0 |
brown |
fair |
brown |
29.0 |
male |
Corellia |
Human |
| 15 |
Greedo |
173 |
74.0 |
NA |
green |
black |
44.0 |
male |
Rodia |
Rodian |
| 16 |
Jabba Desilijic Tiure |
175 |
1358.0 |
NA |
green-tan, brown |
orange |
600.0 |
hermaphrodite |
Nal Hutta |
Hutt |
| 17 |
Wedge Antilles |
170 |
77.0 |
brown |
fair |
hazel |
21.0 |
male |
Corellia |
Human |
| 18 |
Jek Tono Porkins |
180 |
110.0 |
brown |
fair |
blue |
NA |
male |
Bestine IV |
Human |
| 19 |
Yoda |
66 |
17.0 |
white |
green |
brown |
896.0 |
male |
NA |
Yoda’s species |
| 20 |
Palpatine |
170 |
75.0 |
grey |
pale |
yellow |
82.0 |
male |
Naboo |
Human |
| 21 |
Boba Fett |
183 |
78.2 |
black |
fair |
brown |
31.5 |
male |
Kamino |
Human |
| 22 |
IG-88 |
200 |
140.0 |
none |
metal |
red |
15.0 |
none |
NA |
Droid |
| 23 |
Bossk |
190 |
113.0 |
none |
green |
red |
53.0 |
male |
Trandosha |
Trandoshan |
| 24 |
Lando Calrissian |
177 |
79.0 |
black |
dark |
brown |
31.0 |
male |
Socorro |
Human |
| 25 |
Lobot |
175 |
79.0 |
none |
light |
blue |
37.0 |
male |
Bespin |
Human |
| 26 |
Ackbar |
180 |
83.0 |
none |
brown mottle |
orange |
41.0 |
male |
Mon Cala |
Mon Calamari |
| 27 |
Mon Mothma |
150 |
NA |
auburn |
fair |
blue |
48.0 |
female |
Chandrila |
Human |
| 28 |
Arvel Crynyd |
NA |
NA |
brown |
fair |
brown |
NA |
male |
NA |
Human |
| 29 |
Wicket Systri Warrick |
88 |
20.0 |
brown |
brown |
brown |
8.0 |
male |
Endor |
Ewok |
| 30 |
Nien Nunb |
160 |
68.0 |
none |
grey |
black |
NA |
male |
Sullust |
Sullustan |
| 31 |
Qui-Gon Jinn |
193 |
89.0 |
brown |
fair |
blue |
92.0 |
male |
NA |
Human |
| 32 |
Nute Gunray |
191 |
90.0 |
none |
mottled green |
red |
NA |
male |
Cato Neimoidia |
Neimodian |
| 33 |
Finis Valorum |
170 |
NA |
blond |
fair |
blue |
91.0 |
male |
Coruscant |
Human |
| 34 |
Jar Jar Binks |
196 |
66.0 |
none |
orange |
orange |
52.0 |
male |
Naboo |
Gungan |
| 35 |
Roos Tarpals |
224 |
82.0 |
none |
grey |
orange |
NA |
male |
Naboo |
Gungan |
| 36 |
Rugor Nass |
206 |
NA |
none |
green |
orange |
NA |
male |
Naboo |
Gungan |
| 37 |
Ric Olié |
183 |
NA |
brown |
fair |
blue |
NA |
male |
Naboo |
NA |
| 38 |
Watto |
137 |
NA |
black |
blue, grey |
yellow |
NA |
male |
Toydaria |
Toydarian |
| 39 |
Sebulba |
112 |
40.0 |
none |
grey, red |
orange |
NA |
male |
Malastare |
Dug |
| 40 |
Quarsh Panaka |
183 |
NA |
black |
dark |
brown |
62.0 |
male |
Naboo |
NA |
| 41 |
Shmi Skywalker |
163 |
NA |
black |
fair |
brown |
72.0 |
female |
Tatooine |
Human |
| 42 |
Darth Maul |
175 |
80.0 |
none |
red |
yellow |
54.0 |
male |
Dathomir |
Zabrak |
| 43 |
Bib Fortuna |
180 |
NA |
none |
pale |
pink |
NA |
male |
Ryloth |
Twi’lek |
| 44 |
Ayla Secura |
178 |
55.0 |
none |
blue |
hazel |
48.0 |
female |
Ryloth |
Twi’lek |
| 45 |
Dud Bolt |
94 |
45.0 |
none |
blue, grey |
yellow |
NA |
male |
Vulpter |
Vulptereen |
| 46 |
Gasgano |
122 |
NA |
none |
white, blue |
black |
NA |
male |
Troiken |
Xexto |
| 47 |
Ben Quadinaros |
163 |
65.0 |
none |
grey, green, yellow |
orange |
NA |
male |
Tund |
Toong |
| 48 |
Mace Windu |
188 |
84.0 |
none |
dark |
brown |
72.0 |
male |
Haruun Kal |
Human |
| 49 |
Ki-Adi-Mundi |
198 |
82.0 |
white |
pale |
yellow |
92.0 |
male |
Cerea |
Cerean |
| 50 |
Kit Fisto |
196 |
87.0 |
none |
green |
black |
NA |
male |
Glee Anselm |
Nautolan |
| 51 |
Eeth Koth |
171 |
NA |
black |
brown |
brown |
NA |
male |
Iridonia |
Zabrak |
| 52 |
Adi Gallia |
184 |
50.0 |
none |
dark |
blue |
NA |
female |
Coruscant |
Tholothian |
| 53 |
Saesee Tiin |
188 |
NA |
none |
pale |
orange |
NA |
male |
Iktotch |
Iktotchi |
| 54 |
Yarael Poof |
264 |
NA |
none |
white |
yellow |
NA |
male |
Quermia |
Quermian |
| 55 |
Plo Koon |
188 |
80.0 |
none |
orange |
black |
22.0 |
male |
Dorin |
Kel Dor |
| 56 |
Mas Amedda |
196 |
NA |
none |
blue |
blue |
NA |
male |
Champala |
Chagrian |
| 57 |
Gregar Typho |
185 |
85.0 |
black |
dark |
brown |
NA |
male |
Naboo |
Human |
| 58 |
Cordé |
157 |
NA |
brown |
light |
brown |
NA |
female |
Naboo |
Human |
| 59 |
Cliegg Lars |
183 |
NA |
brown |
fair |
blue |
82.0 |
male |
Tatooine |
Human |
| 60 |
Poggle the Lesser |
183 |
80.0 |
none |
green |
yellow |
NA |
male |
Geonosis |
Geonosian |
| 61 |
Luminara Unduli |
170 |
56.2 |
black |
yellow |
blue |
58.0 |
female |
Mirial |
Mirialan |
| 62 |
Barriss Offee |
166 |
50.0 |
black |
yellow |
blue |
40.0 |
female |
Mirial |
Mirialan |
| 63 |
Dormé |
165 |
NA |
brown |
light |
brown |
NA |
female |
Naboo |
Human |
| 64 |
Dooku |
193 |
80.0 |
white |
fair |
brown |
102.0 |
male |
Serenno |
Human |
| 65 |
Bail Prestor Organa |
191 |
NA |
black |
tan |
brown |
67.0 |
male |
Alderaan |
Human |
| 66 |
Jango Fett |
183 |
79.0 |
black |
tan |
brown |
66.0 |
male |
Concord Dawn |
Human |
| 67 |
Zam Wesell |
168 |
55.0 |
blonde |
fair, green, yellow |
yellow |
NA |
female |
Zolan |
Clawdite |
| 68 |
Dexter Jettster |
198 |
102.0 |
none |
brown |
yellow |
NA |
male |
Ojom |
Besalisk |
| 69 |
Lama Su |
229 |
88.0 |
none |
grey |
black |
NA |
male |
Kamino |
Kaminoan |
| 70 |
Taun We |
213 |
NA |
none |
grey |
black |
NA |
female |
Kamino |
Kaminoan |
| 71 |
Jocasta Nu |
167 |
NA |
white |
fair |
blue |
NA |
female |
Coruscant |
Human |
| 72 |
Ratts Tyerell |
79 |
15.0 |
none |
grey, blue |
unknown |
NA |
male |
Aleen Minor |
Aleena |
| 73 |
R4-P17 |
96 |
NA |
none |
silver, red |
red, blue |
NA |
female |
NA |
NA |
| 74 |
Wat Tambor |
193 |
48.0 |
none |
green, grey |
unknown |
NA |
male |
Skako |
Skakoan |
| 75 |
San Hill |
191 |
NA |
none |
grey |
gold |
NA |
male |
Muunilinst |
Muun |
| 76 |
Shaak Ti |
178 |
57.0 |
none |
red, blue, white |
black |
NA |
female |
Shili |
Togruta |
| 77 |
Grievous |
216 |
159.0 |
none |
brown, white |
green, yellow |
NA |
male |
Kalee |
Kaleesh |
| 78 |
Tarfful |
234 |
136.0 |
brown |
brown |
blue |
NA |
male |
Kashyyyk |
Wookiee |
| 79 |
Raymus Antilles |
188 |
79.0 |
brown |
light |
brown |
NA |
male |
Alderaan |
Human |
| 80 |
Sly Moore |
178 |
48.0 |
none |
pale |
white |
NA |
female |
Umbara |
NA |
| 81 |
Tion Medon |
206 |
80.0 |
none |
grey |
black |
NA |
male |
Utapau |
Pau’an |
| 82 |
Finn |
NA |
NA |
black |
dark |
dark |
NA |
male |
NA |
Human |
| 83 |
Rey |
NA |
NA |
brown |
light |
hazel |
NA |
female |
NA |
Human |
| 84 |
Poe Dameron |
NA |
NA |
brown |
light |
brown |
NA |
male |
NA |
Human |
| 85 |
BB8 |
NA |
NA |
none |
none |
black |
NA |
none |
NA |
Droid |
| 86 |
Captain Phasma |
NA |
NA |
unknown |
unknown |
unknown |
NA |
female |
NA |
NA |
| 87 |
Padmé Amidala |
165 |
45.0 |
brown |
light |
brown |
46.0 |
female |
Naboo |
Human |
str(datos)
## 'data.frame': 87 obs. of 11 variables:
## $ X : int 1 2 3 4 5 6 7 8 9 10 ...
## $ name : Factor w/ 87 levels "Ackbar","Adi Gallia",..: 46 15 62 21 44 54 10 64 12 53 ...
## $ height : int 172 167 96 202 150 178 165 97 183 182 ...
## $ mass : num 77 75 32 136 49 120 75 32 84 77 ...
## $ hair_color: Factor w/ 12 levels "auburn","auburn, grey",..: 5 NA NA 10 7 8 7 NA 4 3 ...
## $ skin_color: Factor w/ 31 levels "blue","blue, grey",..: 7 9 29 28 17 17 17 30 17 7 ...
## $ eye_color : Factor w/ 15 levels "black","blue",..: 2 15 11 15 4 2 2 11 4 3 ...
## $ birth_year: num 19 112 33 41.9 19 52 47 NA 24 57 ...
## $ gender : Factor w/ 4 levels "female","hermaphrodite",..: 3 NA NA 3 1 3 1 NA 3 3 ...
## $ homeworld : Factor w/ 48 levels "Alderaan","Aleen Minor",..: 40 40 28 40 1 40 40 40 40 38 ...
## $ species : Factor w/ 37 levels "Aleena","Besalisk",..: 11 6 6 11 11 11 11 6 11 11 ...
summary(datos)
## X name height mass
## Min. : 1.0 Ackbar : 1 Min. : 66.0 Min. : 15.00
## 1st Qu.:22.5 Adi Gallia : 1 1st Qu.:167.0 1st Qu.: 55.60
## Median :44.0 Anakin Skywalker : 1 Median :180.0 Median : 79.00
## Mean :44.0 Arvel Crynyd : 1 Mean :174.4 Mean : 97.31
## 3rd Qu.:65.5 Ayla Secura : 1 3rd Qu.:191.0 3rd Qu.: 84.50
## Max. :87.0 Bail Prestor Organa: 1 Max. :264.0 Max. :1358.00
## (Other) :81 NA's :6 NA's :28
## hair_color skin_color eye_color birth_year gender
## none :37 fair :17 brown :21 Min. : 8.00 female :19
## brown :18 light :11 blue :19 1st Qu.: 35.00 hermaphrodite: 1
## black :13 dark : 6 yellow :11 Median : 52.00 male :62
## white : 4 green : 6 black :10 Mean : 87.57 none : 2
## blond : 3 grey : 6 orange : 8 3rd Qu.: 72.00 NA's : 3
## (Other): 7 pale : 5 red : 5 Max. :896.00
## NA's : 5 (Other):36 (Other):13 NA's :44
## homeworld species
## Naboo :11 Human :35
## Tatooine :10 Droid : 5
## Alderaan : 3 Gungan : 3
## Coruscant: 3 Kaminoan: 2
## Kamino : 3 Mirialan: 2
## (Other) :47 (Other) :35
## NA's :10 NA's : 5
Generar tablas de distribución de frecuencias de la variable categóricas gender de Sexo y su gráfica barplot
tabla.frecuencias <- fdt_cat(x = datos$gender)
tabla.frecuencias <- as.data.frame(tabla.frecuencias)
kable(tabla.frecuencias)
| male |
62 |
0.7380952 |
73.809524 |
62 |
73.80952 |
| female |
19 |
0.2261905 |
22.619048 |
81 |
96.42857 |
| none |
2 |
0.0238095 |
2.380952 |
83 |
98.80952 |
| hermaphrodite |
1 |
0.0119048 |
1.190476 |
84 |
100.00000 |
barplot(height = tabla.frecuencias$f, names.arg = tabla.frecuencias$Category)

Generar tablas de distribución de frecuencias de la variable categóricas homeworld de origen planeta y su gráfica barplot
tabla.frecuencias <- fdt_cat(x = datos$homeworld)
tabla.frecuencias <- as.data.frame(tabla.frecuencias)
kable(tabla.frecuencias)
| Naboo |
11 |
0.1428571 |
14.285714 |
11 |
14.28571 |
| Tatooine |
10 |
0.1298701 |
12.987013 |
21 |
27.27273 |
| Alderaan |
3 |
0.0389610 |
3.896104 |
24 |
31.16883 |
| Coruscant |
3 |
0.0389610 |
3.896104 |
27 |
35.06494 |
| Kamino |
3 |
0.0389610 |
3.896104 |
30 |
38.96104 |
| Corellia |
2 |
0.0259740 |
2.597403 |
32 |
41.55844 |
| Kashyyyk |
2 |
0.0259740 |
2.597403 |
34 |
44.15584 |
| Mirial |
2 |
0.0259740 |
2.597403 |
36 |
46.75325 |
| Ryloth |
2 |
0.0259740 |
2.597403 |
38 |
49.35065 |
| Aleen Minor |
1 |
0.0129870 |
1.298701 |
39 |
50.64935 |
| Bespin |
1 |
0.0129870 |
1.298701 |
40 |
51.94805 |
| Bestine IV |
1 |
0.0129870 |
1.298701 |
41 |
53.24675 |
| Cato Neimoidia |
1 |
0.0129870 |
1.298701 |
42 |
54.54545 |
| Cerea |
1 |
0.0129870 |
1.298701 |
43 |
55.84416 |
| Champala |
1 |
0.0129870 |
1.298701 |
44 |
57.14286 |
| Chandrila |
1 |
0.0129870 |
1.298701 |
45 |
58.44156 |
| Concord Dawn |
1 |
0.0129870 |
1.298701 |
46 |
59.74026 |
| Dathomir |
1 |
0.0129870 |
1.298701 |
47 |
61.03896 |
| Dorin |
1 |
0.0129870 |
1.298701 |
48 |
62.33766 |
| Endor |
1 |
0.0129870 |
1.298701 |
49 |
63.63636 |
| Eriadu |
1 |
0.0129870 |
1.298701 |
50 |
64.93506 |
| Geonosis |
1 |
0.0129870 |
1.298701 |
51 |
66.23377 |
| Glee Anselm |
1 |
0.0129870 |
1.298701 |
52 |
67.53247 |
| Haruun Kal |
1 |
0.0129870 |
1.298701 |
53 |
68.83117 |
| Iktotch |
1 |
0.0129870 |
1.298701 |
54 |
70.12987 |
| Iridonia |
1 |
0.0129870 |
1.298701 |
55 |
71.42857 |
| Kalee |
1 |
0.0129870 |
1.298701 |
56 |
72.72727 |
| Malastare |
1 |
0.0129870 |
1.298701 |
57 |
74.02597 |
| Mon Cala |
1 |
0.0129870 |
1.298701 |
58 |
75.32468 |
| Muunilinst |
1 |
0.0129870 |
1.298701 |
59 |
76.62338 |
| Nal Hutta |
1 |
0.0129870 |
1.298701 |
60 |
77.92208 |
| Ojom |
1 |
0.0129870 |
1.298701 |
61 |
79.22078 |
| Quermia |
1 |
0.0129870 |
1.298701 |
62 |
80.51948 |
| Rodia |
1 |
0.0129870 |
1.298701 |
63 |
81.81818 |
| Serenno |
1 |
0.0129870 |
1.298701 |
64 |
83.11688 |
| Shili |
1 |
0.0129870 |
1.298701 |
65 |
84.41558 |
| Skako |
1 |
0.0129870 |
1.298701 |
66 |
85.71429 |
| Socorro |
1 |
0.0129870 |
1.298701 |
67 |
87.01299 |
| Stewjon |
1 |
0.0129870 |
1.298701 |
68 |
88.31169 |
| Sullust |
1 |
0.0129870 |
1.298701 |
69 |
89.61039 |
| Toydaria |
1 |
0.0129870 |
1.298701 |
70 |
90.90909 |
| Trandosha |
1 |
0.0129870 |
1.298701 |
71 |
92.20779 |
| Troiken |
1 |
0.0129870 |
1.298701 |
72 |
93.50649 |
| Tund |
1 |
0.0129870 |
1.298701 |
73 |
94.80519 |
| Umbara |
1 |
0.0129870 |
1.298701 |
74 |
96.10390 |
| Utapau |
1 |
0.0129870 |
1.298701 |
75 |
97.40260 |
| Vulpter |
1 |
0.0129870 |
1.298701 |
76 |
98.70130 |
| Zolan |
1 |
0.0129870 |
1.298701 |
77 |
100.00000 |
barplot(height = tabla.frecuencias$f, names.arg = tabla.frecuencias$Category)

Generar tablas de distribución de frecuencias de la variable categóricas species de origen planeta y su gráfica barplot
tabla.frecuencias <- fdt_cat(x = datos$species)
tabla.frecuencias <- as.data.frame(tabla.frecuencias)
kable(tabla.frecuencias)
| Human |
35 |
0.4268293 |
42.682927 |
35 |
42.68293 |
| Droid |
5 |
0.0609756 |
6.097561 |
40 |
48.78049 |
| Gungan |
3 |
0.0365854 |
3.658537 |
43 |
52.43902 |
| Kaminoan |
2 |
0.0243902 |
2.439024 |
45 |
54.87805 |
| Mirialan |
2 |
0.0243902 |
2.439024 |
47 |
57.31707 |
| Twi’lek |
2 |
0.0243902 |
2.439024 |
49 |
59.75610 |
| Wookiee |
2 |
0.0243902 |
2.439024 |
51 |
62.19512 |
| Zabrak |
2 |
0.0243902 |
2.439024 |
53 |
64.63415 |
| Aleena |
1 |
0.0121951 |
1.219512 |
54 |
65.85366 |
| Besalisk |
1 |
0.0121951 |
1.219512 |
55 |
67.07317 |
| Cerean |
1 |
0.0121951 |
1.219512 |
56 |
68.29268 |
| Chagrian |
1 |
0.0121951 |
1.219512 |
57 |
69.51220 |
| Clawdite |
1 |
0.0121951 |
1.219512 |
58 |
70.73171 |
| Dug |
1 |
0.0121951 |
1.219512 |
59 |
71.95122 |
| Ewok |
1 |
0.0121951 |
1.219512 |
60 |
73.17073 |
| Geonosian |
1 |
0.0121951 |
1.219512 |
61 |
74.39024 |
| Hutt |
1 |
0.0121951 |
1.219512 |
62 |
75.60976 |
| Iktotchi |
1 |
0.0121951 |
1.219512 |
63 |
76.82927 |
| Kaleesh |
1 |
0.0121951 |
1.219512 |
64 |
78.04878 |
| Kel Dor |
1 |
0.0121951 |
1.219512 |
65 |
79.26829 |
| Mon Calamari |
1 |
0.0121951 |
1.219512 |
66 |
80.48780 |
| Muun |
1 |
0.0121951 |
1.219512 |
67 |
81.70732 |
| Nautolan |
1 |
0.0121951 |
1.219512 |
68 |
82.92683 |
| Neimodian |
1 |
0.0121951 |
1.219512 |
69 |
84.14634 |
| Pau’an |
1 |
0.0121951 |
1.219512 |
70 |
85.36585 |
| Quermian |
1 |
0.0121951 |
1.219512 |
71 |
86.58537 |
| Rodian |
1 |
0.0121951 |
1.219512 |
72 |
87.80488 |
| Skakoan |
1 |
0.0121951 |
1.219512 |
73 |
89.02439 |
| Sullustan |
1 |
0.0121951 |
1.219512 |
74 |
90.24390 |
| Tholothian |
1 |
0.0121951 |
1.219512 |
75 |
91.46341 |
| Togruta |
1 |
0.0121951 |
1.219512 |
76 |
92.68293 |
| Toong |
1 |
0.0121951 |
1.219512 |
77 |
93.90244 |
| Toydarian |
1 |
0.0121951 |
1.219512 |
78 |
95.12195 |
| Trandoshan |
1 |
0.0121951 |
1.219512 |
79 |
96.34146 |
| Vulptereen |
1 |
0.0121951 |
1.219512 |
80 |
97.56098 |
| Xexto |
1 |
0.0121951 |
1.219512 |
81 |
98.78049 |
| Yoda’s species |
1 |
0.0121951 |
1.219512 |
82 |
100.00000 |
barplot(height = tabla.frecuencias$f, names.arg = tabla.frecuencias$Category)

Datos numéricos Generar tabla de distribución de frecuencias de la variable de height y su gráfica barplot
tabla.frecuencias <- fdt(x = datos$height)
kable(tabla.frecuencias)
| [65.34,90.5025) |
3 |
0.0370370 |
3.703704 |
3 |
3.703704 |
| [90.5025,115.665) |
5 |
0.0617284 |
6.172840 |
8 |
9.876543 |
| [115.665,140.827) |
2 |
0.0246914 |
2.469136 |
10 |
12.345679 |
| [140.827,165.99) |
9 |
0.1111111 |
11.111111 |
19 |
23.456790 |
| [165.99,191.152) |
43 |
0.5308642 |
53.086420 |
62 |
76.543210 |
| [191.152,216.315) |
14 |
0.1728395 |
17.283951 |
76 |
93.827161 |
| [216.315,241.477) |
4 |
0.0493827 |
4.938272 |
80 |
98.765432 |
| [241.477,266.64) |
1 |
0.0123457 |
1.234568 |
81 |
100.000000 |
|
| start |
65.3400 |
| end |
266.6400 |
| h |
25.1625 |
| right |
0.0000 |
|
barplot(height = tabla.frecuencias$table$f, names.arg = tabla.frecuencias$table$`Class limits`)

Generar tabla de distribución de frecuencias de la variable de mass y su gráfica barplot
tabla.frecuencias <- fdt(x = datos$mass)
kable(tabla.frecuencias)
| [14.85,208.6686) |
58 |
0.9830508 |
98.305085 |
58 |
98.30508 |
| [208.6686,402.4871) |
0 |
0.0000000 |
0.000000 |
58 |
98.30508 |
| [402.4871,596.3057) |
0 |
0.0000000 |
0.000000 |
58 |
98.30508 |
| [596.3057,790.1243) |
0 |
0.0000000 |
0.000000 |
58 |
98.30508 |
| [790.1243,983.9429) |
0 |
0.0000000 |
0.000000 |
58 |
98.30508 |
| [983.9429,1177.761) |
0 |
0.0000000 |
0.000000 |
58 |
98.30508 |
| [1177.761,1371.58) |
1 |
0.0169492 |
1.694915 |
59 |
100.00000 |
|
| start |
14.8500 |
| end |
1371.5800 |
| h |
193.8186 |
| right |
0.0000 |
|
barplot(height = tabla.frecuencias$table$f, names.arg = tabla.frecuencias$table$`Class limits`)
