1. Importar la base de datos

Para importar la base de datos empleo la fuincio read_excel del paquete readxl ir Anexo1

library(readxl)
datos_actividad1 <- read_excel("data/datos_actividad1.xlsx")

2. Tablas de frecuencia

head(datos)
# A tibble: 6 × 10
  invoice_no customer_id gender   age category quantity  price payment_method
  <chr>      <chr>       <chr>  <dbl> <chr>       <dbl>  <dbl> <chr>         
1 I138884    C241288     Female    28 Clothing        5  15004 Credit Card   
2 I317333    C111565     Male      21 Shoes           3 180051 Debit Card    
3 I317333    C111565     Male      21 Shoes           3 180051 Debit Card    
4 I127801    C266599     Male      20 Clothing        1     NA Cash          
5 I173702    C988172     Female    66 Shoes           5 300085 Credit Card   
6 I337046    C189076     Female    53 Books           4    606 Cash          
# ℹ 2 more variables: invoice_date <dttm>, shopping_mall <chr>
table(datos$gender)

female Female   male   Male 
     2  59472      2  39970 

Libro

Anexo 1