Created
September 20, 2016 17:48
-
-
Save Diegow3b/43743af3f6a685870732a94d99450d55 to your computer and use it in GitHub Desktop.
This file contains 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
#Pequeno script para pegar 100 valores aleatorios entre as strings"HAS","Has","has","DM","Dm" | |
pool <- c("HAS","Has","has","DM","Dm") | |
index <- sample(1:5,100,replace=T) #Amostra de 100 valores entre 1 e 5 | |
comorb <- character(length=100) #Declara variavel comorb | |
#For loop para selecionar um item da lista conforme numero aleatorio sorteado | |
for (i in 1:100){ | |
comorb[i] <- pool[index[i]] | |
} | |
id <- seq(1:100) #Identificacao para cada caso | |
comorb.data <- as.data.frame(cbind(comorb,id)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment