I write this function to generate random numbers in a normal distribution with min, max, mean, sd.
The c argument is column number .
My main problem is that my function seems to work, but the value doesn't replace Tibble
please help me.
Note = each cell of the column has a specific random number.
Note2= "a" variable is a random number
this is code :
ff=function(c,minn,maxx,meann,sdd){
for(i in 1:nrow(continuous_dataset)){
a=round(rtruncnorm(1,minn,maxx,meann,sdd))
continuous_dataset %>% mutate(category = if_else((is.na(continuous_dataset[[i,c]])), a, continuous_dataset[[i,c]]))
}
return(continuous_dataset)
}