Speed up the loop operation in R

0 votes
I have a significant R performance issue. A method I created iterates through a data.frame object. It merely aggregates something and adds a new column to a data.frame. (Easy procedure). In the data.frame, there are about 850K rows. I don't know how long the PC has been running; it's been on for roughly 10 hours.

Dayloop 2: function(temp)

I in 1:nrow(temp) for

{

temp(i,10) - I

if I > 1) {

In the event that ((temp[i,6] == temp[i-1,6]) & (temp[i,3] == temp[i-1,3])) {

i=temp[i,9] + i=temp[i-1,10] - i=temp[i,10]

} else {

I 10, - I 9, temp

}

} else {

I 10, - I 9, temp

}

}

"V10" is the value of names(temp). <- "Kumm."

return(temp)

}

Any suggestions for accelerating this process?
Jul 20 in Data Analytics by avinash
• 1,840 points
11 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Data Analytics

0 votes
1 answer

Loop to automate the plotting process in R

Try something like this: library(tidyverse) data(iris) ## create a grid ...READ MORE

answered Dec 7, 2018 in Data Analytics by Maverick
• 10,840 points
824 views
0 votes
1 answer

Plotting multiple graphs on the same page in R

If you want to plot 4 graphs ...READ MORE

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,660 points
649 views
0 votes
1 answer

How to find out the sum/mean for multiple variables per group in R?

You can use the reshape2 package for ...READ MORE

answered Apr 12, 2018 in Data Analytics by DataKing99
• 8,240 points
2,617 views
0 votes
1 answer
0 votes
2 answers

R function for finding the index of an element in a vector?

The function match works on vectors : x <- sample(1:10) x # ...READ MORE

answered Dec 12, 2020 in Data Analytics by Rajiv
• 8,910 points
52,196 views
+1 vote
2 answers

Which function can I use to clear the console in R and RStudio ?

Description                   Windows & Linux           Mac Clear console                      Ctrl+L ...READ MORE

answered Apr 17, 2018 in Data Analytics by anonymous
49,003 views
0 votes
1 answer

Big Data transformations with R

Dear Koushik, Hope you are doing great. You can ...READ MORE

answered Dec 18, 2017 in Data Analytics by Sudhir
• 1,610 points
438 views
0 votes
2 answers

Transforming a key/value string into distinct rows in R

We would start off by loading the ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
483 views
0 votes
1 answer

Finding frequency of observations in R

You can use the "dplyr" package to ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
4,353 views
0 votes
1 answer

Left Join and Right Join using "dplyr"

The below is the code to perform ...READ MORE

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,660 points
504 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP