Tarea 1 Electiva
Tarea 1 Electiva
Tarea 1 Electiva
2024-02-18
##
## Attaching package: 'dplyr'
# Cambiar nombre
colnames(mtcars)[1] = "Miles_per_Gallon"
names(mtcars)
#dyplr
data_R = data_R %>%
rename(Miles_per_Gallon = mpg)
names(data_R)
# nuevo dataframe
str(mtcars_fil)
tail(mtcars_hp, 10)
mtcars_mut %>%
relocate(., KPL, .after=Miles_per_Gallon)
head(mtcars_mut, 5)
grupo_cyl
## # A tibble: 3 × 2
## cyl prom_mpg
## <dbl> <dbl>
## 1 4 26.7
## 2 6 19.7
## 3 8 15.1
head(mtcars_agr, 20)
# Imprimir el valor
prom_hp100
## prom_hp
## 1 174.2174
autos_cyl
## cyl n
## 1 4 11
## 2 6 7
## 3 8 14
## cyl gear n
## 1 4 3 1
## 2 4 4 8
## 3 4 5 2
## 4 6 3 2
## 5 6 4 4
## 6 6 5 1
## 7 8 3 12
## 8 8 5 2
head(filtrar_mpg_hp, 10)