Last active
April 1, 2022 17:48
-
-
Save rocarvaj/8b795d0618a45cbba05ea33469c0d01d to your computer and use it in GitHub Desktop.
Generador de datos por grupo en Proyecto RCD II
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cargar base de datos (requiere cargar tidyverse y readxl) | |
MK <- read_excel("NIELSEN01V2.xlsx") | |
# Escribir en la función set.seed() el código de cuatro dígitos asignado | |
# a tu grupo para obtener los datos que el grupo deber analizar | |
set.seed(CodigoGrupo) | |
p = 0.8 # Proporción de la muestra | |
BaseGrupo <- MK %>% | |
sample_n(size = ceiling(p*nrow(MK)), replace = FALSE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment