阅读背景:

如何用R中的子集来代替NA(用plyr来表示)

来源:互联网 

I have a dataframe with the lengths and widths of various arthropods from the guts of salamanders. Because some guts had thousands of certain prey items, I only measured a subset of each prey type. I now want to replace each unmeasured individual with the mean length and width for that prey. I want to keep the dataframe and just add imputed columns (length2, width2). The main reason is that each row also has columns with data on the date and location the salamander was collected. I could fill in the NA with a random selection of the measured individuals but for the sake of argument let's assume I just want to replace each NA with the mean.I have a dataframe with the lengths and widths




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

分享到: