Home > Software engineering >  How to save a new data frame in R
How to save a new data frame in R

Time:03-24

I am very new to R so I am not sure how to save a new data frame in R. May I know how to do it? I used this code to combine rows in my data frame.

my_data %>% 
  bind_rows(my_data)

May I know how to save the changes I made to my data frame, or save it as a new one? Thank you.

CodePudding user response:

You can use the following code:

new_data <- my_data%>% bind_rows(my_data)

The <- can be use create a new name for your dataframe and save it.

CodePudding user response:

if you want to get the data frame in to a file:

df_new <- my_data%>%bind_rows(my_data)

write.csv(df_new, "C:\Users\Name\Folder\data.csv", row.names=FALSE)

  • Related