0

I have a loop that has six iterations:

Perc <- c(0.99,0.90,0.80,0.70,0.60,0.50)

for(x in 1:length(Perc))
{
}

Each loop creates a dataframe called 'Data'

I need to name each dataframe Data_0.99, Data_0.90, Data_0.80........and so on so I can refer back to them later in the code.

I figured this would do it paste("Data_",Perc[x],sep = "") <- Data

However I get the below error:

Error in paste("Data_", Perc[x], sep = "") <- Data : 
  target of assignment expands to non-language object

If anyone could point me in the direction of how to name each dataframe as the loop creates it that would be fantastic.

Also happy to add more information, code data if that will help!

3442
  • 8,248
  • 2
  • 19
  • 41
Methexis
  • 2,739
  • 5
  • 24
  • 34

0 Answers0