R - Dput

1 - About

Write an Object to a file or Recreate it

3 - Snippet


df=data.frame(a=1:2,b=4:5)
df


a b
1 1 4
2 2 5


dput(df)


structure(list(a = 1:2, b = 4:5), .Names = c("a", "b"), row.names = c(NA, 
-2L), class = "data.frame")


dput(df, file="df.R")

You wil get this OS file:


structure(list(a = 1:2, b = 4:5), .Names = c("a", "b"), row.names = c(NA,
-2L), class = "data.frame")

To make an new data frame from the created file use dget


dfFromFile = dget("df.R")
dfFromFile


a b
1 1 4
2 2 5


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap