mercredi 26 avril 2017

comprehensive way to check for functions that use the random number generator in an R script?

is there a smart way to identify all functions that use .Random.seed (the random number generator state within R) at any point in an R script?

use case: we have a dataset that changes constantly, both the records [rows] and the information [columns] - we add new records often, but we also update information in certain columns. so the dataset is constantly in flux. we fill in some missing data with an imputation, which requires random number generation with the sample() function. so whenever we add a new row or update any information in the column, the randomly imputed numbers all change -- which is expected. we use set.seed() at the start of each random imputation, so if a column changes but zero rows change, the other randomly-generated columns are not affected.

i'm under the impression that the only function within our entire codebase that ever touches a random seed is the sample() function, but i would like to verify this somehow?

thanks




Aucun commentaire:

Enregistrer un commentaire