Create dataframe with name of string stored in variable

Trying to store a dataframe into a new one with the name of a variable. Not sure how to code it exactly...

Posting an example below. Goal is to get a dataframe named Flowers with the data from df

df <- data.frame(iris)
x <- "Flowers"

I think you want to use

assign(x,  df)
1 Like

Thank you!!!!! That did the trick! :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.