问题
我记得,但似乎找不到一个内置函数,它允许您从现有的tibble / dataframe中生成创建tibble / dataframe的代码。
换句话说,假设我有标准的iris数据。我想要生成手动构建这个数据的代码。我正在寻找的函数将产生如下内容:
# Function Call
Theoretical_Function_I_Recall_Exists_But_Cant_Find(iris)
# Output of Function
tibble::tribble(
~Sepal.Length, ~Sepal.Width, ~Petal.Length, ~Petal.Width, ~Species,
5.1, 3.5, 1.4, 0.2, "setosa",
4.9, 3.0, 1.4, 0.2, "setosa",
4.7, 3.2, 1.3, 0.2, "setosa",
4.6, 3.1, 1.5, 0.2, "setosa",
5.0, 3.6, 1.4, 0.2, "setosa"
)我可以发誓,一个函数已经存在,但多次尝试帮助文档和谷歌已经空出来.
有人还记得这样的函数是否真的存在吗?
发布于 2017-11-10 16:33:59
dput在这里运行得很好--也是R基的一部分。
发布于 2020-01-09 21:30:00
您可能正在寻找datapasta::dpasta()或datapasta::dmdclip()。达帕斯塔塔
https://stackoverflow.com/questions/47182796
复制相似问题