Can you use a loop to repeat a cbind function

0 votes
I have 40 dataframes from two dataframes (growth and investment) that I separated using the group split() function (split per COROP region in the Netherlands). The following code can be used to combine the divided dataframes for each COROP, which is what I'm trying to do:

# COROP 1

Growth per COOP and investment per COOP are bound by the function cbind(CR01), # combining investment and growth statistics for COOP 1

CR01 <- CR01[-c(4:6)] # eliminating redundant columns

# COROP 2

Growth per corop[[2]], investment per corop[[2]] cbind(CR02) # combining investment and growth statistics for COOP 2

CR02 <- CR02[-c(4:6)] # eliminating redundant columns

etc.

Given my inadequate understanding of loops and the time it would take me to repeat this manually for COROP 1 to 40, I was wondering if anyone could assist me. Can the code above be repeated using a loop?
Jul 20, 2022 in Data Science by avinash
• 1,840 points

edited Mar 4 16 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.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP