jeudi 24 mars 2016

How to get the code to recreate a dataframe in R?

I have some dataframe object.

I want to see the code that recreates that dataframe object.

For example, here is my dataframe

str(ror)
# 'data.frame':   2 obs. of  2 variables:
#  $ from: Factor w/ 2 levels "x","x1": 2 1
#  $ to  : Factor w/ 2 levels "x2","y": 1 2

I want to get the following code to be printed by calling some function such as: recreate(ror)

recreate(ror)
# data.frame(from = c('x1', 'x'), to = c('x2', 'y'))

I remember that there was a function to get this code from ror, but I cannot find the exact name of this function or exact term to search in google to find it?





Aucun commentaire:

Enregistrer un commentaire