阅读背景:

如何在R中向量化一个for循环

来源:互联网 

I'm trying to clean this code up and was wondering if anybody has any suggestions on how to run this in R without a loop. I have a dataset called data with 100 variables and 200,000 observations. What I want to do is essentially expand the dataset by multiplying each observation by a specific scalar and then combine the data together. In the end, I need a data set with 800,000 observations (I have four categories to create) and 101 variables. Here's a loop that I wrote that does this, but it is very inefficient and I'd like something quicker and more efficient. I'm trying to clean this code up and was wonder




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

分享到: