阅读背景:

R优化嵌套在for循环中的while循环,以在数据帧中引入缺失值

来源:互联网 

I have a (70 rows x 4 columns) dataframe (data) that has 10% of NAs. My dataframe has no more than one NA per row. From this dataset, I would like to produce 10 dataframes with 60% of NAs. But I do not want to have entirely empty (=all-NA) rows. So I made a while loop nested into a for loop. The code is working but it is taking a very long time to run. As I need to run this loop for many datasets I would like to know if there is an easy way to improve it.I have a (70 rows x 4 columns) dataframe (data)




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: